/* =================================================================
   loveyoubaby.ge — a private digital love letter
   Premium romantic theme: dark purple · rose · warm gold
   Pure CSS. No images. Mobile-first.
   ================================================================= */

/* ---------- CSS VARIABLES (edit the palette here) ---------------- */
:root {
  /* Core palette */
  --bg-0: #0c0010;
  --bg-1: #16021f;
  --bg-2: #240a33;
  --plum: #3a0f4d;
  --rose: #ff8fb0;
  --rose-deep: #e85a86;
  --gold: #f4d9a0;
  --gold-soft: #e9c98a;
  --ink: #f6ecf3;
  --ink-soft: #d9c7d6;
  --ink-faint: #a892ad;

  /* Glassmorphism */
  --glass-bg: rgba(40, 14, 56, 0.42);
  --glass-border: rgba(255, 200, 224, 0.16);
  --glass-blur: 18px;

  /* Glows */
  --glow-rose: 0 0 40px rgba(255, 120, 160, 0.35);
  --glow-gold: 0 0 32px rgba(244, 217, 160, 0.28);

  /* Typography */
  --font-serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;

  /* Rhythm */
  --maxw: 760px;
  --radius: 22px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------- RESET ------------------------------------------------ */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* The HTML `hidden` attribute must always win over display rules below */
[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--font-sans);
  color: var(--ink);
  background:
    radial-gradient(120% 80% at 50% -10%, var(--plum) 0%, transparent 55%),
    radial-gradient(100% 70% at 85% 20%, rgba(232, 90, 134, 0.18) 0%, transparent 50%),
    radial-gradient(120% 90% at 10% 90%, rgba(120, 40, 160, 0.22) 0%, transparent 55%),
    linear-gradient(160deg, var(--bg-1) 0%, var(--bg-0) 55%, #050008 100%);
  background-attachment: fixed;
  overflow-x: hidden;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Subtle drifting nebula overlay */
body::before {
  content: "";
  position: fixed;
  inset: -20%;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(40% 40% at 30% 40%, rgba(255, 143, 176, 0.10), transparent 60%),
    radial-gradient(45% 45% at 70% 60%, rgba(155, 89, 224, 0.12), transparent 60%);
  animation: drift 26s ease-in-out infinite alternate;
}

@keyframes drift {
  from { transform: translate3d(-2%, -1%, 0) scale(1); }
  to   { transform: translate3d(2%, 2%, 0) scale(1.08); }
}

/* ---------- PARTICLES & CURSOR ----------------------------------- */
.particles {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}

.particle {
  position: absolute;
  top: 100%;
  color: var(--rose);
  opacity: 0;
  will-change: transform, opacity;
  animation: rise linear infinite;
  text-shadow: 0 0 8px currentColor;
}

.particle--star {
  color: var(--gold);
  border-radius: 50%;
}

@keyframes rise {
  0%   { transform: translateY(0) translateX(0) scale(0.6); opacity: 0; }
  10%  { opacity: var(--p-opacity, 0.8); }
  90%  { opacity: var(--p-opacity, 0.8); }
  100% { transform: translateY(-112vh) translateX(var(--p-drift, 0)) scale(1); opacity: 0; }
}

.cursor-canvas {
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
}

/* ---------- SHARED LAYOUT ---------------------------------------- */
section,
main,
.footer {
  position: relative;
  z-index: 2;
}

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  padding: 0.95em 2.4em;
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: #1a0414;
  background: linear-gradient(135deg, var(--rose) 0%, var(--gold-soft) 100%);
  border: none;
  border-radius: 999px;
  cursor: pointer;
  overflow: hidden;
  isolation: isolate;
  box-shadow: var(--glow-rose), 0 8px 30px rgba(0, 0, 0, 0.35);
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease);
  -webkit-tap-highlight-color: transparent;
}

.btn:hover,
.btn:focus-visible {
  transform: translateY(-2px);
  box-shadow: var(--glow-rose), 0 12px 38px rgba(255, 120, 160, 0.4);
}

.btn:active { transform: translateY(0) scale(0.98); }

.btn:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

.btn__glow {
  position: absolute;
  inset: -40%;
  z-index: -1;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.55), transparent 60%);
  opacity: 0;
  transition: opacity 0.5s var(--ease);
}

.btn:hover .btn__glow { opacity: 0.7; }

.btn--ghost {
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--glass-border);
  box-shadow: none;
  backdrop-filter: blur(6px);
}

.btn--ghost:hover,
.btn--ghost:focus-visible {
  border-color: var(--rose);
  box-shadow: 0 0 26px rgba(255, 143, 176, 0.25);
}

.btn--soft {
  font-size: 0.85rem;
  padding: 0.7em 1.7em;
  color: var(--ink);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  box-shadow: none;
  backdrop-filter: blur(8px);
}

.glass {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

/* ---------- 0. INTRO GATE ---------------------------------------- */
.gate {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  text-align: center;
  transition: opacity 1s var(--ease), visibility 1s var(--ease);
}

.gate.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.gate__inner {
  max-width: 620px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
}

.gate__line {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(1.5rem, 6vw, 2.4rem);
  line-height: 1.4;
  color: var(--ink);
  opacity: 0;
  transform: translateY(14px);
  animation: fadeUp 1.4s var(--ease) 0.3s forwards;
}

.gate__reveal {
  font-family: var(--font-serif);
  font-size: clamp(1.7rem, 7vw, 2.8rem);
  line-height: 1.35;
  background: linear-gradient(120deg, var(--rose) 0%, var(--gold) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: var(--rose);
  opacity: 0;
  transform: translateY(16px);
}

.gate__reveal.is-show {
  animation: fadeUp 1.6s var(--ease) forwards;
}

.gate__btn,
.gate__continue {
  opacity: 0;
  transform: translateY(14px);
  animation: fadeUp 1.2s var(--ease) 1.4s forwards;
}

.gate__continue.is-show {
  animation: fadeUp 1.4s var(--ease) 0.6s forwards;
}

/* ---------- 1. HERO ---------------------------------------------- */
.hero {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 6rem 1.5rem 4rem;
}

.hero__inner {
  max-width: var(--maxw);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.6rem;
}

.hero__title {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: clamp(2.6rem, 11vw, 5rem);
  line-height: 1.05;
  letter-spacing: 0.01em;
  background: linear-gradient(120deg, var(--ink) 0%, var(--rose) 55%, var(--gold) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 60px rgba(255, 143, 176, 0.15);
}

.hero__subtitle {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(1.1rem, 4.5vw, 1.6rem);
  color: var(--ink-soft);
  max-width: 30ch;
}

.hero__btn { margin-top: 1rem; }

.hero__scroll-hint {
  position: absolute;
  bottom: 2.2rem;
  left: 50%;
  width: 22px;
  height: 36px;
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  transform: translateX(-50%);
  opacity: 0.6;
}

.hero__scroll-hint::after {
  content: "";
  position: absolute;
  top: 7px;
  left: 50%;
  width: 3px;
  height: 7px;
  margin-left: -1.5px;
  background: var(--rose);
  border-radius: 2px;
  animation: scrollDot 1.8s ease-in-out infinite;
}

@keyframes scrollDot {
  0%, 100% { transform: translateY(0); opacity: 1; }
  50%      { transform: translateY(10px); opacity: 0.2; }
}

/* ---------- MAIN / SECTIONS -------------------------------------- */
.main { padding-bottom: 2rem; }

.section {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 6rem 1.5rem;
}

.section__eyebrow {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--gold-soft);
  margin-bottom: 1.4rem;
}

.section__title {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: clamp(1.9rem, 7vw, 3rem);
  line-height: 1.15;
  text-align: center;
  margin-bottom: 1.4rem;
  background: linear-gradient(120deg, var(--ink) 0%, var(--rose) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.section__lead {
  text-align: center;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(1.1rem, 4vw, 1.4rem);
  color: var(--ink-soft);
  max-width: 36ch;
  margin: 0 auto 2.5rem;
}

/* Scroll reveal */
.reveal {
  opacity: 0;
  transform: translateY(38px);
  transition: opacity 1.1s var(--ease), transform 1.1s var(--ease);
  will-change: opacity, transform;
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* ---------- 3. LETTER -------------------------------------------- */
.letter {
  padding: clamp(2rem, 7vw, 3.4rem);
}

.letter__body {
  font-family: var(--font-serif);
  font-size: clamp(1.2rem, 4.6vw, 1.55rem);
  line-height: 1.85;
  color: var(--ink);
}

.letter__line {
  display: block;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
}

.letter__line.is-in {
  opacity: 1;
  transform: none;
}

.letter__line--break { height: 1.1em; }

.letter__replay { margin-top: 2rem; }

/* ---------- 4. REASONS ------------------------------------------- */
.reasons {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-top: 1rem;
}

.reason {
  position: relative;
  padding: 1.5rem 1.6rem;
  font-family: var(--font-serif);
  font-size: clamp(1.05rem, 4vw, 1.25rem);
  line-height: 1.5;
  color: var(--ink-soft);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  opacity: 0;
  transform: translateY(26px) scale(0.98);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease),
    border-color 0.4s var(--ease), box-shadow 0.4s var(--ease);
  overflow: hidden;
}

.reason.is-in {
  opacity: 1;
  transform: none;
}

.reason::before {
  content: "♥";
  position: absolute;
  top: 1.1rem;
  right: 1.2rem;
  font-size: 0.85rem;
  color: var(--rose-deep);
  opacity: 0.35;
  transition: opacity 0.4s var(--ease), transform 0.4s var(--ease);
}

.reason:hover {
  border-color: rgba(255, 143, 176, 0.4);
  box-shadow: 0 14px 40px rgba(255, 100, 150, 0.18);
  transform: translateY(-4px);
  color: var(--ink);
}

.reason:hover::before {
  opacity: 0.9;
  transform: scale(1.25);
}

@media (min-width: 720px) {
  .reasons { grid-template-columns: 1fr 1fr; }
}

/* ---------- 5. HOLD MY HEART ------------------------------------- */
.hold {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 220px;
}

.hold__heart {
  position: relative;
  width: 160px;
  height: 160px;
  display: grid;
  place-items: center;
  background: transparent;
  border: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: none;
}

.hold__heart:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 8px;
  border-radius: 50%;
}

.hold__ring {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.hold__ring-bg {
  fill: none;
  stroke: rgba(255, 200, 224, 0.14);
  stroke-width: 4;
}

.hold__ring-fg {
  fill: none;
  stroke: url(#none);
  stroke: var(--rose);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-dasharray: 339.292;
  stroke-dashoffset: 339.292;
  filter: drop-shadow(0 0 6px var(--rose-deep));
  transition: stroke-dashoffset 0.1s linear;
}

.hold__glyph {
  font-size: 4.2rem;
  color: var(--rose);
  text-shadow: var(--glow-rose);
  animation: heartbeat 2.4s ease-in-out infinite;
  transition: transform 0.3s var(--ease);
}

.hold__heart.is-holding .hold__glyph {
  animation: heartbeat 0.7s ease-in-out infinite;
  transform: scale(1.06);
}

@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  14%      { transform: scale(1.12); }
  28%      { transform: scale(1); }
  42%      { transform: scale(1.08); }
  56%      { transform: scale(1); }
}

.hold__sparkles {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.spark {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 10px var(--gold);
  animation: sparkBurst 0.9s ease-out forwards;
}

@keyframes sparkBurst {
  0%   { transform: translate(-50%, -50%) scale(1); opacity: 1; }
  100% {
    transform: translate(calc(-50% + var(--sx)), calc(-50% + var(--sy))) scale(0.2);
    opacity: 0;
  }
}

.hold__result {
  text-align: center;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(1.25rem, 5vw, 1.7rem);
  line-height: 1.5;
  color: var(--gold);
  margin-top: 2.4rem;
  max-width: 30ch;
  margin-left: auto;
  margin-right: auto;
  opacity: 0;
  transform: translateY(14px);
}

.hold__result.is-show {
  animation: fadeUp 1.4s var(--ease) forwards;
}

/* ---------- 6. WHEN LIFE GETS HARD ------------------------------- */
.hard {
  padding: clamp(2.2rem, 7vw, 3.6rem);
  text-align: center;
}

.hard__text {
  font-family: var(--font-serif);
  font-size: clamp(1.2rem, 4.6vw, 1.55rem);
  line-height: 1.9;
  color: var(--ink-soft);
  white-space: pre-line;
}

/* ---------- 7. FINAL REVEAL -------------------------------------- */
.section--final { text-align: center; }

.final__btn { margin-bottom: 2.5rem; }

.final__lines {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  max-width: 34ch;
  margin: 0 auto;
}

.final__line {
  font-family: var(--font-serif);
  font-size: clamp(1.2rem, 4.8vw, 1.6rem);
  line-height: 1.5;
  color: var(--ink);
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 1s var(--ease), transform 1s var(--ease);
}

.final__line.is-in {
  opacity: 1;
  transform: none;
}

.final__signature {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(1.6rem, 7vw, 2.6rem);
  margin-top: 2.6rem;
  background: linear-gradient(120deg, var(--rose) 0%, var(--gold) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: var(--rose);
  opacity: 0;
  transform: translateY(16px);
}

.final__signature.is-show {
  animation: fadeUp 1.8s var(--ease) forwards;
}

/* ---------- 8. FOOTER -------------------------------------------- */
.footer {
  padding: 3.5rem 1.5rem 4.5rem;
  text-align: center;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1rem;
  color: var(--ink-faint);
}

/* ---------- MUSIC DOCK ------------------------------------------- */
.music-dock {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 40;
  padding-bottom: env(safe-area-inset-bottom);
}

.music-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  padding: 0.7em 1.2em;
  font-family: var(--font-sans);
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  color: var(--ink);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  cursor: pointer;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.4);
  transition: border-color 0.4s var(--ease), transform 0.3s var(--ease);
  -webkit-tap-highlight-color: transparent;
}

.music-btn:hover,
.music-btn:focus-visible {
  border-color: var(--rose);
  transform: translateY(-2px);
}

.music-btn:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

.music-btn__icon {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  height: 14px;
}

.music-btn__icon .bar {
  width: 3px;
  height: 5px;
  background: var(--rose);
  border-radius: 2px;
}

.music-btn.is-playing .bar {
  animation: eq 0.9s ease-in-out infinite;
}
.music-btn.is-playing .bar:nth-child(2) { animation-delay: 0.2s; }
.music-btn.is-playing .bar:nth-child(3) { animation-delay: 0.4s; }

@keyframes eq {
  0%, 100% { height: 5px; }
  50%      { height: 14px; }
}

.music-btn.is-error {
  opacity: 0.55;
  cursor: not-allowed;
}

/* ---------- SHARED KEYFRAME -------------------------------------- */
@keyframes fadeUp {
  to { opacity: 1; transform: none; }
}

/* ---------- RESPONSIVE TWEAKS ------------------------------------ */
@media (min-width: 768px) {
  .section { padding: 7.5rem 2rem; }
}

/* ---------- REDUCED MOTION --------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }

  .particles,
  .cursor-canvas,
  .hero__scroll-hint { display: none; }

  body::before { animation: none; }

  .reveal,
  .letter__line,
  .reason,
  .final__line {
    opacity: 1;
    transform: none;
  }

  .gate__line,
  .gate__btn,
  .gate__continue,
  .gate__reveal,
  .hold__result,
  .final__signature {
    opacity: 1;
    transform: none;
    animation: none;
  }
}
