/* ==========================================================================
   A MAGICAL SECRET GARDEN OF LOVE — for Kiki
   ========================================================================== */

:root {
  /* --- color tokens --- */
  --ivory: #FFF8F3;
  --cream: #FFF2E6;
  --blush: #FFD9E8;
  --blush-deep: #F5A8C4;
  --lavender: #D9C6F5;
  --lavender-deep: #B79AE0;
  --peach: #F6C9A0;
  --sunset: #F0925C;
  --gold: #C9A876;
  --gold-light: #E6CFA0;
  --rose-gold: #E3AE9A;
  --night: #1A1230;
  --night-deep: #0F0A1F;
  --night-violet: #2E1F4D;
  --moonlight: #FFEFD6;
  --text-dark: #4A3B4F;
  --text-soft: #7A6580;
  --text-on-dark: #F3E9FF;

  /* --- type tokens --- */
  --font-display: 'Playfair Display', serif;
  --font-letter: 'Cormorant Garamond', serif;
  --font-utility: 'Quicksand', sans-serif;

  /* --- spacing scale (consistent rhythm across sections) --- */
  --space-xs: 8px;
  --space-sm: 16px;
  --space-md: 24px;
  --space-lg: 40px;
  --space-xl: 64px;
  --space-2xl: 96px;

  --ease-silk: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-soft: cubic-bezier(0.16, 0.84, 0.44, 1);

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
}

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

html {
  background: var(--night-deep);
  scroll-behavior: smooth;
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
}

body {
  font-family: var(--font-utility);
  color: var(--text-dark);
  background: var(--night-deep);
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
  position: relative;
  -webkit-font-smoothing: antialiased;
}

#page {
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
  position: relative;
}

/* ==========================================================================
   THEMED SCROLLBAR — matching theme color palette
   ========================================================================== */
::-webkit-scrollbar {
  width: 10px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--sunset), var(--rose-gold), var(--lavender-deep));
  border-radius: 10px;
  border: 2px solid rgba(255, 255, 255, 0.2);
}
::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, var(--rose-gold), var(--blush-deep), var(--sunset));
  box-shadow: 0 0 10px rgba(240, 146, 92, 0.5);
}

/* Firefox scrollbar support */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--rose-gold) transparent;
}

::selection { background: var(--blush-deep); color: white; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

img { max-width: 100%; display: block; }

/* ==========================================================================
   CURSOR GLOW — warm spotlight aura floating over content
   ========================================================================== */
#cursor-glow {
  position: fixed;
  top: 0; left: 0;
  width: 360px;
  height: 360px;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(circle, rgba(255,217,232,0.32) 0%, rgba(240,146,92,0.15) 35%, rgba(217,198,245,0.08) 65%, transparent 75%);
  z-index: 999;
  opacity: 0.85;
}
@media (max-width: 780px) { #cursor-glow { display: none; } }

/* ==========================================================================
   VINE SCROLL SPINE — signature element
   ========================================================================== */
.vine-track {
  position: fixed;
  left: 18px;
  top: 0;
  bottom: 0;
  width: 26px;
  z-index: 40;
  pointer-events: none;
  opacity: 0.9;
}
#vine-svg { width: 100%; height: 100%; overflow: visible; }
#vine-path {
  stroke-dasharray: 5200;
  stroke-dashoffset: 5200;
}
.vine-leaf {
  position: absolute;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--ivory);
  border: 1px solid rgba(201,168,118,0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.62rem;
  color: var(--rose-gold);
  box-shadow: 0 2px 8px rgba(201,168,118,0.2);
}
@media (max-width: 780px) {
  .vine-track { left: 4px; width: 14px; opacity: 0.35; }
  .vine-leaf { width: 14px; height: 14px; font-size: 0.45rem; }
}

/* ==========================================================================
   NAV DOTS — no blur, cheap
   ========================================================================== */
.section-dots {
  position: fixed;
  right: 22px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 41;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.section-dots .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(199,168,118,0.35);
  transition: transform 0.35s var(--ease-soft), background 0.35s var(--ease-soft);
}
.section-dots .dot.active {
  background: var(--rose-gold);
  transform: scale(1.8);
  box-shadow: 0 0 8px rgba(227,174,154,0.8);
}
@media (max-width: 780px) { .section-dots { display: none; } }

/* ==========================================================================
   AUDIO TOGGLE
   ========================================================================== */
#audio-toggle {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 50;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: 1px solid rgba(201,168,118,0.4);
  background: rgba(255,248,243,0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--sunset);
  transition: transform 0.3s var(--ease-soft), box-shadow 0.3s var(--ease-soft);
  box-shadow: 0 4px 20px rgba(201,168,118,0.2);
}
#audio-toggle:hover { transform: scale(1.08); box-shadow: 0 6px 28px rgba(201,168,118,0.35); }
#audio-toggle i { font-size: 1rem; position: relative; z-index: 2; }
.audio-ring {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1px solid var(--rose-gold);
  opacity: 0;
}
#audio-toggle.playing .audio-ring { animation: audioPulse 2s ease-out infinite; }
@keyframes audioPulse {
  0% { opacity: 0.6; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.5); }
}

/* ==========================================================================
   SHARED SECTION LAYOUT — consistent spacing scale
   ========================================================================== */
.section {
  position: relative;
  min-height: 100vh;
  width: 100%;
  max-width: 100vw;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-2xl) var(--space-md);
  margin-bottom: -1px;
  overflow: hidden;
}

/* ==========================================================================
   CLOUD DIVIDERS — whimsical organic cloud section transitions
   ========================================================================== */
.cloud-divider {
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100%;
  height: 40px;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
  line-height: 0;
  opacity: 0.6;
}
.cloud-divider svg {
  width: 100%;
  height: 100%;
  display: block;
}

.cloud-divider-lavender .cloud-back { fill: rgba(217, 198, 245, 0.55); }
.cloud-divider-lavender .cloud-front { fill: #D9C6F5; }

.cloud-divider-cream .cloud-back { fill: rgba(255, 242, 230, 0.6); }
.cloud-divider-cream .cloud-front { fill: #FFF2E6; }

.cloud-divider-blush .cloud-back { fill: rgba(255, 217, 232, 0.65); }
.cloud-divider-blush .cloud-front { fill: #FFD9E8; }

.cloud-divider-dusk .cloud-back { fill: rgba(123, 98, 164, 0.6); }
.cloud-divider-dusk .cloud-front { fill: #7B62A4; }

.cloud-divider-night .cloud-back { fill: rgba(46, 31, 77, 0.7); }
.cloud-divider-night .cloud-front { fill: #2E1F4D; }

.cloud-divider-deep .cloud-back { fill: rgba(26, 18, 48, 0.85); }
.cloud-divider-deep .cloud-front { fill: #0F0A1F; }

.section-heading {
  text-align: center;
  margin-bottom: var(--space-xl);
  position: relative;
  z-index: 5;
}
.section-heading .eyebrow,
.eyebrow {
  font-family: var(--font-utility);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-size: 0.7rem;
  color: var(--rose-gold);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.section-heading .eyebrow { margin-bottom: var(--space-sm); }
.section-heading h2 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4.5vw, 3.4rem);
  font-weight: 600;
  color: var(--text-dark);
  letter-spacing: -0.01em;
}
.section-heading.light-on-dark h2 { color: var(--text-on-dark); }
.section-heading.light-on-dark .eyebrow { color: var(--gold-light); }

.heart-inline { display: inline-block; color: var(--rose-gold); }

/* ==========================================================================
   HERO SECTION
   ========================================================================== */
.hero {
  background: linear-gradient(180deg, #FFE9D6 0%, var(--peach) 35%, var(--blush) 70%, var(--lavender) 100%);
  padding-top: 100px;
}

#hero-bloom-canvas { position: absolute; inset: 0; z-index: 1; }

.hero-sunburst {
  position: absolute;
  top: -20%;
  left: 50%;
  transform: translateX(-50%);
  width: min(900px, 100vw);
  height: min(900px, 100vw);
  background: radial-gradient(circle, rgba(255,255,255,0.55) 0%, rgba(255,233,214,0.25) 35%, transparent 70%);
  border-radius: 50%;
  z-index: 0;
  animation: sunPulse 8s ease-in-out infinite;
}
@keyframes sunPulse {
  0%, 100% { opacity: 0.8; transform: translateX(-50%) scale(1); }
  50% { opacity: 1; transform: translateX(-50%) scale(1.05); }
}

.hero-bokeh {
  position: absolute;
  inset: 0;
  z-index: 1;
  background-image:
    radial-gradient(circle at 15% 25%, rgba(255,255,255,0.5) 0%, transparent 3%),
    radial-gradient(circle at 80% 15%, rgba(255,255,255,0.4) 0%, transparent 4%),
    radial-gradient(circle at 70% 70%, rgba(255,255,255,0.35) 0%, transparent 3%),
    radial-gradient(circle at 25% 80%, rgba(255,255,255,0.45) 0%, transparent 3.5%),
    radial-gradient(circle at 90% 55%, rgba(255,255,255,0.3) 0%, transparent 2.5%);
  animation: bokehDrift 14s ease-in-out infinite alternate;
}
@keyframes bokehDrift {
  0% { transform: translateY(0) scale(1); }
  100% { transform: translateY(-18px) scale(1.03); }
}

.hero-content {
  position: relative;
  z-index: 5;
  text-align: center;
  width: 100%;
  max-width: min(780px, 100%);
  padding: 0 var(--space-xs);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero-content .eyebrow { margin-bottom: var(--space-md); opacity: 0; }

.hero-title {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.08;
  color: var(--text-dark);
}
.hero-title .line {
  display: block;
  font-size: clamp(2.1rem, 6vw, 4.2rem);
  overflow: hidden;
}
.hero-title .hero-name {
  font-style: italic;
  font-weight: 700;
  background: linear-gradient(90deg, var(--sunset), var(--rose-gold), var(--lavender-deep));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  font-size: clamp(2.6rem, 7.5vw, 5.2rem);
}
.hero-title .heart-inline { -webkit-text-fill-color: initial; color: var(--rose-gold); font-size: 0.7em; }

.hero-sub {
  font-family: var(--font-letter);
  font-style: italic;
  font-size: clamp(1.15rem, 2.2vw, 1.5rem);
  color: var(--text-soft);
  margin-top: var(--space-md);
  max-width: 520px;
  opacity: 0;
}

.hero-stats {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  margin-top: var(--space-xl);
  opacity: 0;
  flex-wrap: wrap;
  justify-content: center;
}
.stat-pill {
  background: rgba(255,255,255,0.6);
  border: 1px solid rgba(255,255,255,0.7);
  border-radius: var(--radius-lg);
  padding: 18px 30px;
  text-align: center;
  box-shadow: 0 8px 28px rgba(240,146,92,0.14);
  transition: transform 0.35s var(--ease-soft);
}
.stat-pill:hover { transform: translateY(-4px); }
.stat-num {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 2.8rem);
  font-weight: 700;
  color: var(--sunset);
  line-height: 1;
}
.stat-label {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  color: var(--text-soft);
  margin-top: var(--space-xs);
  font-weight: 600;
  max-width: 130px;
}
.stat-divider { color: var(--gold); font-size: 1rem; }

.btn-open-heart {
  position: relative;
  margin-top: var(--space-xl);
  padding: 18px 44px;
  border-radius: 100px;
  border: none;
  background: linear-gradient(135deg, var(--sunset), var(--rose-gold));
  color: white;
  font-family: var(--font-utility);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.03em;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 12px 36px rgba(240,146,92,0.4);
  transition: transform 0.35s var(--ease-soft), box-shadow 0.35s var(--ease-soft);
  overflow: hidden;
  opacity: 0;
}
.btn-open-heart:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 44px rgba(240,146,92,0.55);
}
.btn-open-heart .btn-heart { animation: heartbeat 1.4s ease-in-out infinite; }
@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  25% { transform: scale(1.25); }
  40% { transform: scale(1); }
}
.btn-glow {
  position: absolute;
  inset: -2px;
  border-radius: 100px;
  background: linear-gradient(135deg, var(--gold-light), transparent, var(--blush));
  opacity: 0;
  z-index: -1;
  transition: opacity 0.35s;
}
.btn-open-heart:hover .btn-glow { opacity: 0.6; }

.scroll-hint {
  position: absolute;
  bottom: 42px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  color: var(--sunset);
  font-size: 1.1rem;
  opacity: 0.6;
  animation: scrollHintBounce 1.8s ease-in-out infinite;
}
@keyframes scrollHintBounce {
  0%, 100% { transform: translate(-50%, 0); opacity: 0.3; }
  50% { transform: translate(-50%, 8px); opacity: 0.7; }
}

/* ==========================================================================
   LOVE LETTER SECTION
   ========================================================================== */
.letter-section {
  background: linear-gradient(180deg, var(--lavender) 0%, var(--blush) 55%, var(--cream) 100%);
  padding-top: calc(var(--space-2xl) + 20px);
  padding-bottom: var(--space-2xl);
}
.section-bg.peach-glow {
  position: absolute;
  top: 10%;
  left: 50%;
  transform: translateX(-50%);
  width: min(700px, 100vw);
  height: min(700px, 100vw);
  background: radial-gradient(circle, rgba(255,255,255,0.4), transparent 65%);
  z-index: 0;
}

.envelope-wrap {
  position: relative;
  z-index: 10;
  width: min(94vw, 620px);
  perspective: 1600px;
  margin-top: var(--space-md);
}

.envelope {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 2;
  cursor: pointer;
}
.envelope-back, .envelope-front {
  position: absolute;
  inset: 0;
  border-radius: 8px;
}
.envelope-back {
  background: linear-gradient(135deg, var(--rose-gold), var(--gold-light));
  box-shadow: 0 24px 56px rgba(201,168,118,0.35);
  z-index: 1;
}
.envelope-front {
  background: linear-gradient(160deg, var(--gold-light), var(--rose-gold));
  clip-path: polygon(0 100%, 50% 40%, 100% 100%);
  z-index: 3;
}
.envelope-flap {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 100%;
  background: linear-gradient(200deg, var(--gold-light), var(--sunset));
  clip-path: polygon(0 0, 100% 0, 50% 58%);
  transform-origin: top center;
  z-index: 4;
  transition: transform 1s var(--ease-silk);
  box-shadow: 0 6px 16px rgba(0,0,0,0.08);
}
.envelope.open .envelope-flap { transform: rotateX(180deg); }

.envelope-seal {
  position: absolute;
  top: 46%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #E88AA8, #C9557E);
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-style: italic;
  color: white;
  font-size: 1.4rem;
  box-shadow: 0 6px 16px rgba(201,85,126,0.5);
  transition: transform 0.5s var(--ease-soft), opacity 0.5s;
}
.envelope.open .envelope-seal { transform: translate(-50%, -50%) scale(0); opacity: 0; }

.envelope-hint {
  position: absolute;
  bottom: -34px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-soft);
  opacity: 0.7;
  transition: opacity 0.4s;
}
.envelope.open ~ .envelope-hint,
.envelope.open + .envelope-hint { opacity: 0; }

/* --- letter paper: textured, with fold crease + ribbon seal --- */
.letter-paper {
  position: relative;
  z-index: 2;
  margin: 0 auto;
  margin-top: 54px;
  max-width: 640px;
  background: linear-gradient(180deg, #FFFDF9, var(--ivory));
  border-radius: 4px;
  padding: 60px 52px 52px;
  box-shadow:
    0 30px 70px rgba(74,59,79,0.2),
    0 2px 0 rgba(255,255,255,0.6) inset;
  opacity: 0;
  transform: translateY(40px) scale(0.96);
  isolation: isolate;
}

/* paper grain/texture via layered SVG fractal noise (single static layer, cheap) */
.letter-texture {
  position: absolute;
  inset: 0;
  z-index: 0;
  opacity: 0.5;
  mix-blend-mode: multiply;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='matrix' values='0 0 0 0 0.85 0 0 0 0 0.8 0 0 0 0 0.72 0 0 0 0.05 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 200px 200px;
}
/* deckle / uneven paper edge using a repeating mask */
.letter-paper::before {
  content: '';
  position: absolute;
  inset: -1px;
  z-index: -1;
  background: inherit;
  border-radius: inherit;
  filter: blur(0.4px);
}
.letter-fold {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 100%;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(90deg, transparent 49.7%, rgba(74,59,79,0.05) 50%, transparent 50.3%),
    linear-gradient(180deg, transparent 32.7%, rgba(74,59,79,0.045) 33%, transparent 33.3%),
    linear-gradient(180deg, transparent 65.7%, rgba(74,59,79,0.045) 66%, transparent 66.3%);
}

.letter-ribbon {
  position: absolute;
  top: -22px;
  left: 50%;
  transform: translateX(-50%) rotate(-2deg);
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--rose-gold), var(--sunset));
  box-shadow: 0 6px 14px rgba(240,146,92,0.4);
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.1rem;
}

.letter-line {
  position: relative;
  z-index: 2;
  font-family: var(--font-letter);
  font-size: clamp(1.1rem, 2vw, 1.32rem);
  line-height: 1.75;
  color: var(--text-dark);
  margin-bottom: var(--space-md);
  opacity: 0;
  transform: translateY(16px);
}
.letter-salutation { font-style: italic; font-weight: 500; font-size: 1.4rem; color: var(--sunset); }
.letter-signoff {
  font-weight: 600;
  font-style: italic;
  font-size: 1.5rem;
  color: var(--rose-gold);
  margin-top: var(--space-xs);
  margin-bottom: 0;
}

@media (max-width: 600px) {
  .letter-paper { padding: 46px 26px 36px; }
}

/* ==========================================================================
   TIMELINE SECTION
   ========================================================================== */
.timeline-section {
  background: linear-gradient(180deg, var(--cream), var(--ivory) 40%, var(--blush) 100%);
  padding-bottom: var(--space-xl);
}

.timeline-track {
  position: relative;
  width: min(94vw, 980px);
  padding: var(--space-md) 0;
}
.timeline-line {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 2px;
  transform: translateX(-50%);
  background: linear-gradient(180deg, var(--rose-gold), var(--lavender-deep), var(--gold));
  opacity: 0.4;
}

.tl-card {
  position: relative;
  width: 46%;
  margin-bottom: var(--space-xl);
  background: rgba(255,255,255,0.85);
  border: 1px solid rgba(255,255,255,0.9);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 14px 34px rgba(74,59,79,0.1);
  opacity: 0;
  transition: transform 0.4s var(--ease-soft), box-shadow 0.4s var(--ease-soft);
}
.tl-card[data-side="left"] { margin-right: auto; transform: translateX(-32px); }
.tl-card[data-side="right"] { margin-left: auto; transform: translateX(32px); }
.tl-card:hover {
  transform: translateY(-6px) !important;
  box-shadow: 0 22px 50px rgba(74,59,79,0.16);
}
.tl-card.in-view { opacity: 1; }

.tl-image { width: 100%; aspect-ratio: 16/10; overflow: hidden; background: linear-gradient(135deg, var(--blush), var(--lavender)); }
.tl-image img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s var(--ease-soft); }
.tl-card:hover .tl-image img { transform: scale(1.06); }

.tl-info { padding: 22px var(--space-md) var(--space-md); }
.tl-tag {
  font-size: 0.66rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--rose-gold);
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.tl-info h3 {
  font-family: var(--font-display);
  font-size: 1.28rem;
  margin: var(--space-xs) 0;
  color: var(--text-dark);
}
.tl-info p { font-size: 0.9rem; color: var(--text-soft); line-height: 1.55; }

.tl-flower {
  position: absolute;
  top: -12px;
  font-size: 1.1rem;
  color: var(--rose-gold);
  opacity: 0.75;
  animation: floatSlow 5s ease-in-out infinite;
}
.tl-card[data-side="left"] .tl-flower { right: 12px; }
.tl-card[data-side="right"] .tl-flower { left: 12px; }
@keyframes floatSlow {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-8px) rotate(12deg); }
}

@media (max-width: 780px) {
  .timeline-line { left: 14px; }
  .tl-card, .tl-card[data-side="left"], .tl-card[data-side="right"] {
    width: 100%;
    margin-left: 34px !important;
    margin-right: 0 !important;
    transform: translateY(20px) !important;
  }
}

/* ==========================================================================
   MEMORY GALLERY
   ========================================================================== */
.gallery-section {
  background: linear-gradient(180deg, var(--blush) 0%, var(--ivory) 50%, var(--blush) 100%);
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-sm);
  width: min(94vw, 1100px);
}
.gallery-tile {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  background: linear-gradient(135deg, var(--blush), var(--lavender));
  box-shadow: 0 10px 26px rgba(74,59,79,0.1);
  transition: transform 0.4s var(--ease-soft), box-shadow 0.4s var(--ease-soft);
  opacity: 0;
}
.gallery-tile.in-view { opacity: 1; }
.gallery-tile img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s var(--ease-soft); }
.gallery-tile:hover {
  transform: scale(1.03) rotate(var(--tilt, -1deg));
  box-shadow: 0 18px 42px rgba(201,168,118,0.3);
  z-index: 3;
}
.gallery-tile:hover img { transform: scale(1.1); }
.gallery-tile::after {
  content: '';
  position: absolute;
  inset: 0;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.4);
  border-radius: var(--radius-md);
  pointer-events: none;
}
.gallery-petal {
  position: absolute;
  font-size: 0.85rem;
  color: white;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s, transform 0.7s var(--ease-soft);
  z-index: 4;
  text-shadow: 0 1px 4px rgba(0,0,0,0.25);
}
.gallery-tile:hover .gallery-petal { opacity: 0.95; }

@media (max-width: 900px) { .gallery-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 600px) { .gallery-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; } }

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(26,18,48,0.94);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s var(--ease-soft);
}
.lightbox.open { opacity: 1; pointer-events: all; }
.lightbox img {
  max-width: 88vw;
  max-height: 82vh;
  border-radius: 10px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.5);
  transform: scale(0.94);
  transition: transform 0.35s var(--ease-soft);
}
.lightbox.open img { transform: scale(1); }
.lightbox-close {
  position: absolute;
  top: 26px;
  right: 32px;
  font-size: 1.8rem;
  color: white;
  background: none;
  border: none;
  cursor: pointer;
  line-height: 1;
  opacity: 0.8;
}
.lightbox-close:hover { opacity: 1; }

/* ==========================================================================
   REASONS I LOVE YOU
   ========================================================================== */
.reasons-section {
  background: linear-gradient(180deg, var(--blush) 0%, var(--lavender) 100%);
}
.reasons-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-sm);
  width: min(94vw, 1140px);
}
.reason-card {
  background: rgba(255,255,255,0.78);
  border: 1px solid rgba(255,255,255,0.85);
  border-radius: var(--radius-md);
  padding: var(--space-md) 20px;
  text-align: center;
  opacity: 0;
  transform: translateY(24px);
  transition: transform 0.3s var(--ease-soft), box-shadow 0.3s;
}
.reason-card.in-view { opacity: 1; transform: translateY(0); }
.reason-card:hover { transform: translateY(-6px) !important; box-shadow: 0 18px 38px rgba(201,168,118,0.25); }
.reason-num {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 0.82rem;
  color: var(--rose-gold);
  display: block;
  margin-bottom: var(--space-xs);
}
.reason-text {
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--text-dark);
  font-weight: 500;
}
@media (max-width: 900px) { .reasons-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .reasons-grid { grid-template-columns: 1fr; } }

/* ==========================================================================
   FLOATING LOVE NOTES
   ========================================================================== */
.love-notes-layer { position: absolute; inset: 0; height: 0; pointer-events: none; z-index: 0; }
.love-note {
  position: absolute;
  background: var(--moonlight);
  padding: 12px 16px;
  font-family: var(--font-letter);
  font-style: italic;
  font-size: 0.9rem;
  color: var(--text-dark);
  border-radius: 3px;
  box-shadow: 3px 6px 14px rgba(74,59,79,0.15);
  transform: rotate(var(--rot, -4deg));
  max-width: 170px;
  z-index: 6;
  opacity: 0;
  pointer-events: none;
}

/* ==========================================================================
   INTERACTIVE GARDEN
   ========================================================================== */
.garden-section {
  background: linear-gradient(180deg, var(--lavender) 0%, #7B62A4 30%, #4D3770 65%, var(--night-violet) 100%);
}
.garden-instruction {
  font-family: var(--font-letter);
  font-style: italic;
  color: var(--gold-light);
  margin-top: var(--space-xs);
  font-size: 1.05rem;
}
.garden-field {
  position: relative;
  width: min(94vw, 1100px);
  height: 440px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: linear-gradient(180deg, rgba(46,31,77,0.4), rgba(15,10,31,0.7));
  border: 1px solid rgba(227,174,154,0.2);
  cursor: crosshair;
  box-shadow: 0 26px 70px rgba(15,10,31,0.5);
}
#garden-canvas { width: 100%; height: 100%; display: block; }

/* ==========================================================================
   NIGHT SKY
   ========================================================================== */
.sky-section {
  background: linear-gradient(180deg, var(--night-violet) 0%, var(--night) 50%, var(--night-deep) 100%);
  position: relative;
}
#sky-canvas { position: absolute; inset: 0; z-index: 1; }

.moon {
  position: absolute;
  top: 12%;
  right: 14%;
  width: 130px;
  height: 130px;
  z-index: 10;
  cursor: pointer;
  transition: transform 0.4s var(--ease-soft);
}
.moon:hover {
  transform: scale(1.06);
}
.moon-glow {
  position: absolute;
  inset: -40px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,239,214,0.32), transparent 70%);
  animation: moonPulse 6s ease-in-out infinite;
}
@keyframes moonPulse {
  0%, 100% { opacity: 0.8; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.06); }
}
.moon-craters {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #FFFDF6, var(--moonlight) 60%, #E8D2A0 100%);
  box-shadow: 0 0 50px rgba(255,239,214,0.55);
}
.moon-craters::before, .moon-craters::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  background: rgba(200,180,140,0.35);
}
.moon-craters::before { width: 22px; height: 22px; top: 25px; left: 30px; }
.moon-craters::after { width: 14px; height: 14px; top: 70px; left: 70px; }

/* Jealous Moon Dialogue Speech Bubble */
.moon-hint {
  position: absolute;
  bottom: -28px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold-light);
  white-space: nowrap;
  opacity: 0.85;
  animation: bounceHint 2s infinite ease-in-out;
}
@keyframes bounceHint {
  0%, 100% { transform: translate(-50%, 0); }
  50% { transform: translate(-50%, -4px); }
}

.moon-bubble {
  position: absolute;
  top: 15px;
  right: 145px;
  width: 260px;
  background: rgba(255, 248, 243, 0.95);
  border: 1px solid rgba(227, 174, 154, 0.4);
  border-radius: 18px;
  padding: 14px 18px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
  font-family: var(--font-letter);
  font-style: italic;
  font-size: 0.96rem;
  color: var(--text-dark);
  line-height: 1.45;
  pointer-events: none;
  z-index: 12;
  transition: opacity 0.3s, transform 0.3s;
}
.moon-bubble::after {
  content: '';
  position: absolute;
  right: -10px;
  top: 30px;
  width: 0;
  height: 0;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  border-left: 10px solid rgba(255, 248, 243, 0.95);
}
@media (max-width: 780px) {
  .moon-bubble {
    right: auto;
    left: 50%;
    top: 140px;
    transform: translateX(-50%);
    width: 240px;
  }
  .moon-bubble::after { display: none; }
}

/* White Cloud Divider — hides any horizontal section lines */
.cloud-white {
  position: absolute;
  bottom: -22px;
  left: 0;
  width: 100%;
  height: 85px;
  z-index: 20;
  pointer-events: none;
  overflow: hidden;
  line-height: 0;
}
.cloud-white svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* Custom Context Menu */
.custom-context-menu {
  position: fixed;
  z-index: 10000;
  background: rgba(255, 248, 243, 0.96);
  border: 1px solid rgba(240, 146, 92, 0.35);
  border-radius: var(--radius-md);
  padding: 10px 0;
  width: 230px;
  box-shadow: 0 14px 40px rgba(46, 31, 77, 0.25);
  backdrop-filter: blur(10px);
  opacity: 0;
  pointer-events: none;
  transform: scale(0.92);
  transition: opacity 0.2s var(--ease-soft), transform 0.2s var(--ease-soft);
}
.custom-context-menu.active {
  opacity: 1;
  pointer-events: all;
  transform: scale(1);
}
.menu-header {
  padding: 10px 18px 8px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--sunset);
  border-bottom: 1px solid rgba(240, 146, 92, 0.15);
  display: flex;
  align-items: center;
  gap: 8px;
}
.menu-header .heart-icon { color: var(--rose-gold); animation: heartbeat 1.5s infinite; }
.menu-options {
  list-style: none;
  padding: 6px 0;
  margin: 0;
}
.menu-options li {
  padding: 9px 18px;
  font-size: 0.85rem;
  color: var(--text-dark);
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: background 0.2s, color 0.2s;
}
.menu-options li i { color: var(--rose-gold); width: 14px; }
.menu-options li:hover {
  background: rgba(240, 146, 92, 0.12);
  color: var(--sunset);
}
.menu-footer {
  padding: 6px 18px 4px;
  font-size: 0.72rem;
  color: var(--text-soft);
  text-align: center;
  font-style: italic;
}

/* Floating Love Toast */
.love-toast {
  position: fixed;
  bottom: 35px;
  left: 50%;
  transform: translate(-50%, 20px);
  background: linear-gradient(135deg, var(--sunset), var(--rose-gold));
  color: white;
  padding: 12px 26px;
  border-radius: 100px;
  font-family: var(--font-utility);
  font-weight: 700;
  font-size: 0.92rem;
  box-shadow: 0 10px 30px rgba(240, 146, 92, 0.4);
  z-index: 10001;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s var(--ease-soft), transform 0.35s var(--ease-soft);
  display: flex;
  align-items: center;
  gap: 8px;
}
.love-toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.sky-heading {
  position: relative;
  z-index: 3;
  text-align: center;
  max-width: 700px;
}
.sky-heading .eyebrow { color: var(--gold-light); }
.sky-heading h2 {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  font-size: clamp(1.7rem, 3.6vw, 2.6rem);
  color: var(--text-on-dark);
  margin-top: var(--space-sm);
  line-height: 1.3;
}

/* ==========================================================================
   FINALE
   ========================================================================== */
.finale-section {
  background: linear-gradient(180deg, var(--night-deep) 0%, #241736 60%, #3A2456 100%);
  min-height: 100vh;
}
#finale-canvas { position: absolute; inset: 0; z-index: 1; }

.finale-content { position: relative; z-index: 3; text-align: center; }
.finale-line {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 3.6vw, 2.4rem);
  color: var(--text-on-dark);
  margin-bottom: var(--space-sm);
  opacity: 0;
  transform: translateY(24px);
  font-weight: 500;
}
.finale-love {
  font-style: italic;
  font-size: clamp(2rem, 5vw, 3.4rem);
  color: var(--rose-gold);
  font-weight: 700;
  margin-top: var(--space-sm);
}

.finale-bloom-field {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 150px;
  z-index: 2;
  overflow: hidden;
  pointer-events: none;
}
.finale-bloom {
  position: absolute;
  bottom: -20px;
  font-size: 1.5rem;
  color: var(--rose-gold);
  opacity: 0;
  transform: scale(0.3);
}

.finale-petals {
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
  opacity: 0;
}
.finale-petal {
  position: absolute;
  top: -5%;
  font-size: 0.95rem;
  color: var(--blush-deep);
}

.reveal-fade { will-change: opacity, transform; }

/* ==========================================================================
   MOBILE & TABLET RESPONSIVE MEDIA QUERIES
   ========================================================================== */

/* Tablets (max-width: 900px) */
@media (max-width: 900px) {
  .hero-sunburst {
    width: 600px;
    height: 600px;
  }
  .stat-pill {
    padding: 14px 22px;
  }
  .reasons-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .gallery-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Mobile & Small Tablets (max-width: 780px) */
@media (max-width: 780px) {
  .section {
    padding: var(--space-xl) var(--space-sm);
  }
  .hero {
    padding-top: 80px;
  }
  .hero-stats {
    gap: 12px;
  }
  .stat-pill {
    flex: 1 1 42%;
    padding: 12px 16px;
  }
  .stat-num {
    font-size: 2rem;
  }
  .stat-divider {
    display: none;
  }
  .btn-open-heart {
    padding: 15px 32px;
    font-size: 0.92rem;
  }
  
  /* Envelope & Letter */
  .envelope-wrap {
    width: 96vw;
  }
  .letter-paper {
    padding: 38px 20px 28px;
    margin-top: 36px;
  }
  
  /* Secret Garden */
  .garden-field {
    height: 340px;
  }

  /* Sky & Jealous Moon */
  .moon {
    width: 95px;
    height: 95px;
    top: 6%;
    right: 6%;
  }
  .moon-bubble {
    right: auto;
    left: 50%;
    top: 115px;
    transform: translateX(-50%);
    width: min(88vw, 280px);
    font-size: 0.88rem;
    padding: 10px 14px;
    text-align: center;
  }
  
  /* Context Menu */
  .custom-context-menu {
    width: 210px;
  }
}

/* Extra Small Phones (max-width: 520px) */
@media (max-width: 520px) {
  .section-heading h2 {
    font-size: 1.8rem;
  }
  .hero-title .line {
    font-size: 1.8rem;
  }
  .hero-title .hero-name {
    font-size: 2.3rem;
  }
  .hero-sub {
    font-size: 1.05rem;
  }
  .hero-sunburst {
    width: 380px;
    height: 380px;
  }
  .stat-pill {
    flex: 1 1 100%;
  }
  .reasons-grid {
    grid-template-columns: 1fr;
  }
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  .cloud-white, .cloud-divider {
    height: 55px;
  }
  .finale-line {
    font-size: 1.25rem;
  }
  .finale-love {
    font-size: 1.9rem;
  }
}
