* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Bricolage Grotesque', system-ui, sans-serif;
  min-height: 100vh;
  transition: background-color 0.4s ease, color 0.4s ease;
}

body.light-mode {
  background: linear-gradient(160deg, #FFF8E7 0%, #F5ECD7 40%, #EDE0C8 100%);
  color: #5C3D2E;
}

body.dark-mode {
  background: linear-gradient(160deg, #1A1A2E 0%, #2D2D3F 40%, #1A1A2E 100%);
  color: #F5ECD7;
}

/* Parchment texture overlay */
.parchment-bg {
  background-image: 
    radial-gradient(ellipse at 20% 50%, rgba(212, 168, 67, 0.06) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(74, 26, 107, 0.04) 0%, transparent 50%),
    linear-gradient(180deg, rgba(255,248,231,0.9) 0%, rgba(245,236,215,0.95) 100%);
}

.dark .parchment-bg {
  background-image:
    radial-gradient(ellipse at 20% 50%, rgba(212, 168, 67, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(74, 26, 107, 0.1) 0%, transparent 50%),
    linear-gradient(180deg, rgba(42, 42, 62, 0.95) 0%, rgba(35, 35, 52, 0.98) 100%);
}

.story-card-bg {
  background-image:
    url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23D4A843' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes quillWrite {
  0%, 100% { transform: rotate(-5deg) translateY(0); }
  25% { transform: rotate(2deg) translateY(-3px); }
  50% { transform: rotate(-3deg) translateY(1px); }
  75% { transform: rotate(4deg) translateY(-2px); }
}

@keyframes shimmer {
  0% { background-position: -200% center; }
  100% { background-position: 200% center; }
}

@keyframes gentlePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(212, 168, 67, 0.3); }
  50% { box-shadow: 0 0 20px 4px rgba(212, 168, 67, 0.15); }
}

@keyframes dots {
  0%, 20% { content: '.'; }
  40% { content: '..'; }
  60% { content: '...'; }
  80%, 100% { content: ''; }
}

.fade-in-up {
  animation: fadeInUp 0.7s ease-out forwards;
}

.quill-animate {
  animation: quillWrite 0.8s ease-in-out infinite;
  display: inline-block;
}

.btn-shimmer {
  background-size: 200% auto;
  animation: shimmer 3s linear infinite;
}

.btn-pulse {
  animation: gentlePulse 2.5s ease-in-out infinite;
}

.drop-zone-active {
  border-color: #D4A843 !important;
  background-color: rgba(212, 168, 67, 0.08) !important;
  transform: scale(1.01);
}

.polaroid-frame {
  background: white;
  padding: 12px 12px 40px 12px;
  box-shadow: 
    0 4px 6px rgba(0,0,0,0.07),
    0 10px 24px rgba(0,0,0,0.1),
    inset 0 0 0 1px rgba(0,0,0,0.04);
  transform: rotate(-0.7deg);
  transition: transform 0.3s ease;
}

.dark .polaroid-frame {
  background: #3a3a4f;
  box-shadow:
    0 4px 6px rgba(0,0,0,0.2),
    0 10px 24px rgba(0,0,0,0.3),
    inset 0 0 0 1px rgba(255,255,255,0.05);
}

.polaroid-frame:hover {
  transform: rotate(0deg);
}

.genre-pill {
  transition: all 0.2s ease;
}

.genre-pill:hover {
  transform: translateY(-2px);
}

.genre-pill.active {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(212, 168, 67, 0.3);
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(212, 168, 67, 0.3);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(212, 168, 67, 0.5);
}

/* Loading dots animation */
.loading-dots::after {
  content: '';
  animation: dots 1.5s steps(4, end) infinite;
}