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

:root {
  --bg-deep: #0a0709;
  --bg-card: #151018;
  --pink-hot: #ff4d8d;
  --pink-soft: #ff9ec4;
  --pink-glow: rgba(255, 77, 141, 0.45);
  --purple-mist: #6b3a5c;
  --text-primary: #fce4ec;
  --text-muted: #b88a9a;
  --glow: 0 0 40px rgba(255, 77, 141, 0.35);
  --font: "Nunito", system-ui, sans-serif;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font);
  background: var(--bg-deep);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

/* Ambient background */
.ambient {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.ambient__mesh {
  position: absolute;
  inset: -50%;
  background:
    radial-gradient(ellipse 60% 50% at 20% 30%, rgba(255, 77, 141, 0.18) 0%, transparent 55%),
    radial-gradient(ellipse 50% 60% at 80% 70%, rgba(107, 58, 92, 0.25) 0%, transparent 50%),
    radial-gradient(ellipse 40% 40% at 50% 50%, rgba(255, 158, 196, 0.08) 0%, transparent 45%);
  animation: meshMove 18s ease-in-out infinite alternate;
  will-change: transform;
}

.ambient__mesh--lyrics {
  animation-duration: 22s;
  opacity: 0.9;
}

@keyframes meshMove {
  0% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(3%, -2%) scale(1.05); }
  66% { transform: translate(-2%, 3%) scale(0.98); }
  100% { transform: translate(2%, 1%) scale(1.02); }
}

.ambient__vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 40%, rgba(10, 7, 9, 0.7) 100%);
}

.ambient__sparkles {
  position: absolute;
  inset: 0;
}

.sparkle {
  position: absolute;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--pink-soft);
  box-shadow: 0 0 8px var(--pink-glow);
  animation: sparkleFloat 10s ease-in-out infinite;
}

@keyframes sparkleFloat {
  0%, 100% { transform: translateY(0) scale(1); opacity: 0.2; }
  50% { transform: translateY(-30px) scale(1.4); opacity: 0.7; }
}

/* Floating hearts */
.hearts-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.heart {
  position: absolute;
  color: var(--pink-hot);
  opacity: 0.12;
  font-size: 1.25rem;
  animation: floatHeart 14s ease-in-out infinite;
  text-shadow: 0 0 20px var(--pink-glow);
}

.heart--1 { left: 8%; top: 15%; animation-delay: 0s; }
.heart--2 { left: 82%; top: 35%; font-size: 1.6rem; animation-delay: -3s; opacity: 0.18; }
.heart--3 { left: 35%; top: 65%; animation-delay: -6s; }
.heart--4 { left: 60%; top: 80%; font-size: 1rem; animation-delay: -9s; }
.heart--5 { left: 15%; top: 85%; font-size: 1.4rem; animation-delay: -11s; }

@keyframes floatHeart {
  0%, 100% { transform: translateY(0) rotate(-5deg); opacity: 0.1; }
  50% { transform: translateY(-28px) rotate(8deg); opacity: 0.22; }
}

/* Scroll story */
.scroll-story {
  position: relative;
  z-index: 1;
  max-width: 28rem;
  margin: 0 auto;
  padding: 0 1.25rem 3rem;
}

.scroll-story.is-hidden {
  visibility: hidden;
  pointer-events: none;
}

/* Hero */
.hero {
  position: relative;
  min-height: 100dvh;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem 0;
}

.hero__eyebrow {
  font-size: 0.85rem;
  font-weight: 400;
  letter-spacing: 0.25em;
  text-transform: lowercase;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  opacity: 0;
  animation: fadeUp 0.8s var(--ease-out) 0.2s forwards;
}

.hero__title {
  font-size: clamp(1.65rem, 6.5vw, 2.35rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.02em;
  max-width: 18rem;
  line-height: 1.25;
}

.hero-char {
  display: inline-block;
  opacity: 0;
  transform: translateY(20px);
  background: linear-gradient(135deg, var(--text-primary), var(--pink-hot));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: none;
  filter: drop-shadow(0 0 12px var(--pink-glow));
}

.hero.reveal.visible .hero-char {
  animation: charIn 0.6s var(--ease-out) forwards;
  animation-delay: calc(var(--i) * 0.035s + 0.1s);
}

.hero-char--space {
  width: 0.35em;
}

@keyframes charIn {
  to { opacity: 1; transform: translateY(0); }
}

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

.hero__subtitle {
  font-size: 1rem;
  font-weight: 300;
  color: var(--text-muted);
  opacity: 0;
  animation: fadeUp 0.8s var(--ease-out) 0.7s forwards;
}

.hero__scroll-hint {
  position: absolute;
  bottom: 2.5rem;
  left: 50%;
  transform: translateX(-50%);
}

.hero__scroll-line {
  display: block;
  width: 1px;
  height: 2.5rem;
  background: linear-gradient(to bottom, transparent, var(--pink-hot));
  box-shadow: 0 0 8px var(--pink-glow);
  animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse {
  0%, 100% { opacity: 0.3; transform: scaleY(0.6); }
  50% { opacity: 1; transform: scaleY(1); }
}

/* Reveal animations */
.reveal {
  opacity: 0;
  transform: translateY(28px) scale(0.97);
  transition:
    opacity 0.9s var(--ease-out),
    transform 0.9s var(--ease-out);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.hero.reveal {
  opacity: 1;
  transform: none;
  transition: none;
}

.hero.reveal.visible .hero__title {
  animation: titlePulse 4s ease-in-out 1s infinite alternate;
}

@keyframes titlePulse {
  from { filter: drop-shadow(0 0 8px var(--pink-glow)); }
  to { filter: drop-shadow(0 0 20px rgba(255, 77, 141, 0.6)); }
}

/* Lyrics layer */
.lyrics-layer {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--bg-deep);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: env(safe-area-inset-top) 1.25rem calc(env(safe-area-inset-bottom) + 2rem);
  opacity: 0;
  transform: scale(1.05);
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}

.lyrics-layer--opening {
  animation: layerOpen 0.6s var(--ease-out) forwards;
}

@keyframes layerOpen {
  0% { opacity: 0; transform: scale(1.08); }
  100% { opacity: 1; transform: scale(1); }
}

.lyrics-layer.is-active {
  opacity: 1;
  transform: scale(1);
}

.lyrics-layer[hidden] {
  display: none !important;
}

.ambient--lyrics {
  z-index: 0;
}

.lyrics-bloom {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(circle at center, rgba(255, 77, 141, 0.2) 0%, transparent 60%);
  opacity: 0;
}

.lyrics-bloom.is-pulse {
  animation: bloomPulse 0.45s var(--ease-out) forwards;
}

@keyframes bloomPulse {
  0% { opacity: 0; }
  40% { opacity: 1; }
  100% { opacity: 0; }
}

.lyrics-bloom.is-pulse--strong {
  background: radial-gradient(circle at center, rgba(255, 77, 141, 0.35) 0%, transparent 55%);
}

/* Watch to the end hint */
.lyrics-watch-hint {
  position: absolute;
  top: calc(env(safe-area-inset-top, 0px) + 1.25rem);
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  z-index: 5;
  width: max-content;
  max-width: 90%;
  padding: 0.65rem 1.25rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--pink-soft);
  text-align: center;
  background: rgba(255, 77, 141, 0.12);
  border: 1px solid rgba(255, 158, 196, 0.25);
  border-radius: 999px;
  box-shadow: var(--glow);
  opacity: 0;
  transition:
    opacity 0.6s var(--ease-out),
    transform 0.6s var(--ease-out);
  pointer-events: none;
}

.lyrics-watch-hint.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.lyrics-watch-hint.is-faded {
  opacity: 0.35;
  transform: translateX(-50%) translateY(0) scale(0.96);
}

.lyrics-watch-hint.is-hidden {
  opacity: 0 !important;
  visibility: hidden;
}

.lyrics-layer__inner {
  position: relative;
  z-index: 2;
  text-align: center;
}

/* Instrumental */
.lyrics-instrumental {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 5rem;
  width: 5rem;
  margin: 0 auto;
}

.lyrics-instrumental.is-floating {
  animation: lyricDrift 20s ease-in-out infinite;
}

.lyrics-instrumental__ring {
  position: absolute;
  width: 4rem;
  height: 4rem;
  border-radius: 50%;
  border: 2px solid rgba(255, 77, 141, 0.3);
  animation: ringPulse 2s ease-in-out infinite;
}

@keyframes ringPulse {
  0%, 100% { transform: scale(0.9); opacity: 0.4; }
  50% { transform: scale(1.15); opacity: 0.9; box-shadow: 0 0 30px var(--pink-glow); }
}

.lyrics-instrumental__heart {
  position: absolute;
  color: var(--pink-hot);
  font-size: 0.75rem;
  opacity: 0.6;
  animation: orbitHeart 3s ease-in-out infinite;
  text-shadow: 0 0 10px var(--pink-glow);
}

.lyrics-instrumental__heart:nth-child(2) {
  animation-delay: 0s;
  transform-origin: 2rem 2rem;
}

.lyrics-instrumental__heart:nth-child(3) {
  animation-delay: -1s;
  animation-name: orbitHeart2;
}

.lyrics-instrumental__heart:nth-child(4) {
  animation-delay: -2s;
  animation-name: orbitHeart3;
}

@keyframes orbitHeart {
  0% { transform: rotate(0deg) translateX(1.8rem) rotate(0deg); }
  100% { transform: rotate(360deg) translateX(1.8rem) rotate(-360deg); }
}

@keyframes orbitHeart2 {
  0% { transform: rotate(120deg) translateX(1.5rem) rotate(-120deg); }
  100% { transform: rotate(480deg) translateX(1.5rem) rotate(-480deg); }
}

@keyframes orbitHeart3 {
  0% { transform: rotate(240deg) translateX(1.6rem) rotate(-240deg); }
  100% { transform: rotate(600deg) translateX(1.6rem) rotate(-600deg); }
}

.lyrics-progress {
  position: absolute;
  bottom: env(safe-area-inset-bottom, 0);
  left: 0;
  right: 0;
  height: 3px;
  background: rgba(255, 158, 196, 0.12);
  z-index: 3;
}

.lyrics-progress__bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--pink-hot), var(--pink-soft));
  box-shadow: 0 0 12px var(--pink-glow);
  transition: width 0.15s linear;
}

.lyrics-layer__tap-hint {
  margin-top: 3rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 300;
  opacity: 0.5;
}

body.song-mode {
  overflow: hidden;
}

body.love-question-active .lyrics-progress {
  opacity: 0;
  transition: opacity 0.5s;
}

/* Love question finale */
.love-question {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.love-question[hidden] {
  display: none !important;
}

.love-question__confetti {
  position: absolute;
  inset: 0;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.love-question__box {
  position: relative;
  width: min(92vw, 22rem);
  padding: 2rem 1.75rem;
  border-radius: 1.25rem;
  background: rgba(20, 8, 14, 0.92);
  border: 1px solid rgba(255, 77, 141, 0.35);
  box-shadow:
    0 0 60px rgba(255, 77, 141, 0.15),
    0 20px 50px rgba(0, 0, 0, 0.5);
  text-align: center;
}

.love-question__text {
  margin: 0 0 1.75rem;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(1.65rem, 7vw, 2.25rem);
  font-weight: 400;
  line-height: 1.35;
  color: var(--text-primary);
  text-shadow: 0 0 24px rgba(255, 77, 141, 0.3);
}

.love-question__actions {
  display: flex;
  gap: 0.85rem;
  justify-content: center;
  flex-wrap: wrap;
}

.love-question__btn {
  min-width: 6.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: 999px;
  font-family: "Inter", system-ui, sans-serif;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  border: none;
  transition: transform 0.2s, box-shadow 0.2s;
}

.love-question__btn--yes {
  background: linear-gradient(135deg, #ff4d8d 0%, #ff66b2 100%);
  color: #fff;
  box-shadow: 0 4px 24px rgba(255, 77, 141, 0.45);
}

.love-question__btn--yes:hover,
.love-question__btn--yes:focus-visible {
  transform: scale(1.05);
  box-shadow: 0 6px 32px rgba(255, 77, 141, 0.6);
}

.love-question__btn--no {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.love-question__btn--no:hover,
.love-question__btn--no:focus-visible {
  background: rgba(255, 255, 255, 0.1);
}

.love-celebration {
  position: relative;
  text-align: center;
  padding: 2rem;
}

.love-celebration[hidden] {
  display: none !important;
}

.love-celebration__title {
  margin: 0 0 0.75rem;
  font-family: "Playfair Display", Georgia, serif;
  font-style: italic;
  font-size: clamp(2rem, 9vw, 3rem);
  font-weight: 600;
  color: #ff66b2;
  text-shadow: 0 0 40px rgba(255, 102, 178, 0.6);
}

.love-celebration__sub {
  margin: 0;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(1.25rem, 5vw, 1.65rem);
  color: var(--text-primary);
  opacity: 0.9;
}

.confetti-particle {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--pink-hot);
  box-shadow: 0 0 10px var(--pink-glow);
  animation: confettiBurst 1.2s var(--ease-out) forwards;
}

@keyframes confettiBurst {
  0% {
    opacity: 1;
    transform: translate(0, 0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(var(--tx), var(--ty)) scale(0.2);
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  .ambient__mesh,
  .sparkle,
  .heart,
  .hero__scroll-line {
    animation: none !important;
  }

  .reveal,
  .hero-char,
  .hero__eyebrow,
  .hero__subtitle {
    opacity: 1 !important;
    transform: none !important;
    animation: none !important;
    transition: none !important;
  }

  .lyrics-instrumental__ring,
  .lyrics-instrumental__heart {
    animation: none !important;
  }

  .lyrics-line--current {
    opacity: 1 !important;
    transform: none !important;
  }

  .lyrics-layer--opening {
    animation: none;
  }

  #ambient-mesh,
  #hero-title {
    transform: none !important;
  }

  .lyrics-watch-hint {
    opacity: 1 !important;
    transform: translateX(-50%) !important;
  }

  .love-celebration__title {
    animation: none !important;
    transform: none !important;
  }

  .confetti-particle {
    display: none;
  }
}

