/* ============================================================
   BIRTHDAY SURPRISE — Soft Pink & Rose Gold Theme
   Multi-Device Responsive, Ultra-Premium, Bug-Free
   ============================================================ */

/* ── CSS Custom Properties ─────────────────────────────────── */
:root {
  /* Color Palette */
  --pink-50: #fff5f8;
  --pink-100: #fde4ee;
  --pink-200: #fcc8dd;
  --pink-300: #f9a1c3;
  --pink-400: #f472a8;
  --pink-500: #e8458a;
  --pink-600: #d42a6e;
  --pink-700: #b01d56;

  --rose-gold: #b76e79;
  --rose-gold-light: #d4a0a7;
  --rose-gold-lighter: #eec9cf;
  --rose-gold-dark: #8e4f57;

  --cream: #fffaf6;
  --cream-card: rgba(255, 255, 255, 0.92);
  --ivory: #fffff2;

  --gold: #d4a574;
  --gold-light: #f5dfbe;

  /* Text Colors */
  --text-primary: #3d2537;
  --text-secondary: #6e5267;
  --text-muted: #967d91;

  /* Gradients */
  --gradient-main: linear-gradient(135deg, #fff2f6 0%, #fde6f0 30%, #fff7fb 60%, #fff4f1 100%);
  --gradient-card: linear-gradient(145deg, rgba(255,255,255,0.96) 0%, rgba(254,242,247,0.9) 100%);
  --gradient-rose: linear-gradient(135deg, #d4a0a7 0%, #b76e79 50%, #9e5863 100%);
  --gradient-pink: linear-gradient(135deg, #f9a1c3 0%, #e8458a 100%);
  --gradient-night: radial-gradient(ellipse at 50% 20%, #1a0a2e 0%, #0d0521 45%, #050216 75%, #020010 100%);

  /* Shadows */
  --shadow-soft: 0 4px 20px rgba(183, 110, 121, 0.12);
  --shadow-medium: 0 8px 30px rgba(183, 110, 121, 0.18);
  --shadow-heavy: 0 16px 50px rgba(183, 110, 121, 0.25);

  /* Fonts */
  --font-display: 'Playfair Display', Georgia, serif;
  --font-elegant: 'Cormorant Garamond', Garamond, serif;
  --font-script: 'Dancing Script', cursive;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  /* Transitions */
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out-back: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ── Reset & Baseline ──────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  position: fixed;
  font-family: var(--font-body);
  color: var(--text-primary);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection {
  background: var(--pink-200);
  color: var(--pink-700);
}

/* ── Preloader ─────────────────────────────────────────────── */
#preloader {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: var(--gradient-main);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.7s var(--ease-out-expo), visibility 0.7s;
}

#preloader.fade-out {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.preloader-content {
  text-align: center;
  padding: 1.5rem;
}

.preloader-heart {
  width: 54px;
  height: 54px;
  margin: 0 auto 1.25rem;
  animation: heartbeat 1.2s ease-in-out infinite;
}

.heart-svg {
  width: 100%;
  height: 100%;
  fill: var(--pink-400);
  filter: drop-shadow(0 0 14px rgba(244, 114, 168, 0.45));
}

.preloader-text {
  font-family: var(--font-elegant);
  font-size: clamp(1rem, 3vw, 1.25rem);
  color: var(--text-secondary);
  font-style: italic;
  letter-spacing: 0.04em;
}

@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  14% { transform: scale(1.18); }
  28% { transform: scale(1); }
  42% { transform: scale(1.12); }
}

/* ── Floating Particles ────────────────────────────────────── */
#particles-container {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}

.particle {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  will-change: transform, opacity;
}

/* ── Floating Music Controller ─────────────────────────────── */
#music-toggle {
  position: fixed;
  top: clamp(0.75rem, 2vw, 1.25rem);
  right: clamp(0.75rem, 2vw, 1.25rem);
  z-index: 1001;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.85rem;
  border-radius: 100px;
  border: 1px solid rgba(183, 110, 121, 0.25);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  box-shadow: var(--shadow-soft);
  transition: all 0.3s var(--ease-out-expo);
}

#music-toggle:hover {
  transform: scale(1.05);
  box-shadow: var(--shadow-medium);
  border-color: var(--rose-gold);
}

.music-note-icon {
  font-size: 1rem;
  display: inline-block;
  transition: transform 0.3s;
}

#music-toggle.playing .music-note-icon {
  animation: note-bounce 1s ease-in-out infinite alternate;
}

@keyframes note-bounce {
  0% { transform: scale(1) rotate(-6deg); }
  100% { transform: scale(1.2) rotate(6deg); }
}

/* ── Desktop Navigation Dots ───────────────────────────────── */
#nav-dots {
  position: fixed;
  right: clamp(1rem, 2.5vw, 2rem);
  top: 50%;
  transform: translateY(-50%);
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.nav-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--rose-gold-light);
  background: transparent;
  cursor: pointer;
  position: relative;
  transition: all 0.35s var(--ease-out-expo);
  padding: 0;
}

.nav-dot::before {
  content: '';
  position: absolute;
  inset: 2px;
  border-radius: 50%;
  background: var(--rose-gold);
  transform: scale(0);
  transition: transform 0.35s var(--ease-out-back);
}

.nav-dot.active {
  border-color: var(--rose-gold);
  transform: scale(1.2);
  box-shadow: 0 0 10px rgba(183, 110, 121, 0.4);
}

.nav-dot.active::before {
  transform: scale(1);
}

.nav-tooltip {
  position: absolute;
  right: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%);
  background: rgba(61, 37, 55, 0.88);
  color: white;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.72rem;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
  backdrop-filter: blur(6px);
}

.nav-dot:hover .nav-tooltip {
  opacity: 1;
}

/* ── Mobile Bottom Navigation Dock ─────────────────────────── */
#mobile-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid rgba(183, 110, 121, 0.2);
  padding: 0.35rem 0.5rem;
  padding-bottom: max(0.35rem, env(safe-area-inset-bottom));
  justify-content: space-around;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.05);
}

.mob-nav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  background: none;
  border: none;
  padding: 0.3rem 0.6rem;
  border-radius: 12px;
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.25s var(--ease-out-expo);
  flex: 1;
  max-width: 70px;
}

.mob-icon {
  font-size: 1.15rem;
  line-height: 1;
}

.mob-label {
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.mob-nav-btn.active {
  color: var(--rose-gold-dark);
  background: rgba(244, 114, 168, 0.12);
  transform: translateY(-2px);
}

.mob-nav-btn.active .mob-icon {
  transform: scale(1.15);
}

/* ── Floating Quick Nav Arrows (Desktop) ───────────────────── */
#floating-quick-nav {
  position: fixed;
  left: clamp(1rem, 2vw, 1.5rem);
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  z-index: 999;
}

.quick-nav-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(183, 110, 121, 0.25);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(8px);
  color: var(--rose-gold);
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-soft);
  transition: all 0.25s;
}

.quick-nav-btn:hover {
  background: var(--rose-gold);
  color: white;
  transform: scale(1.1);
}

/* ── Section Architecture (Bug-Free Scrolling) ─────────────── */
.section {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  visibility: hidden;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  transition: opacity 0.6s var(--ease-out-expo), visibility 0.6s;
  z-index: 2;
}

.section.active {
  opacity: 1;
  visibility: visible;
  z-index: 5;
}

.section-inner {
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: clamp(2rem, 5vw, 3.5rem) clamp(1rem, 4vw, 2.5rem);
  padding-bottom: clamp(4.5rem, 8vw, 5rem); /* clearance for mobile nav */
  box-sizing: border-box;
}

/* Headings */
.section-heading {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 4.5vw, 2.6rem);
  font-weight: 700;
  color: var(--text-primary);
  text-align: center;
  margin-bottom: 0.4rem;
  line-height: 1.25;
}

.heading-ornament-left,
.heading-ornament-right {
  display: inline-block;
  color: var(--rose-gold-light);
  font-size: 0.65em;
  vertical-align: middle;
  margin: 0 0.4rem;
}

.section-subheading {
  font-family: var(--font-elegant);
  font-size: clamp(0.95rem, 2.5vw, 1.25rem);
  color: var(--text-secondary);
  text-align: center;
  margin-bottom: clamp(1.5rem, 4vw, 2.5rem);
  font-style: italic;
  max-width: 580px;
}

/* Buttons */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: clamp(0.75rem, 2vw, 0.95rem) clamp(1.5rem, 4vw, 2.2rem);
  border: none;
  border-radius: 100px;
  background: var(--gradient-rose);
  color: white;
  font-family: var(--font-body);
  font-size: clamp(0.88rem, 2vw, 1rem);
  font-weight: 500;
  letter-spacing: 0.02em;
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(183, 110, 121, 0.35);
  transition: all 0.35s var(--ease-out-expo);
  text-decoration: none;
}

.btn-primary:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 8px 25px rgba(183, 110, 121, 0.45);
}

.btn-primary:active {
  transform: translateY(0) scale(0.98);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.6rem;
  border-radius: 100px;
  border: 1px solid rgba(220, 200, 240, 0.3);
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(8px);
  color: #eeddf8;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  transform: translateY(-2px);
}

/* ═══════════════════════════════════════════════════════════
   SECTION 1: 3D GIFT BOX
   ═══════════════════════════════════════════════════════════ */
#section-gift {
  background: var(--gradient-main);
}

.gift-scene {
  text-align: center;
  position: relative;
  width: 100%;
  max-width: 580px;
  margin: auto;
}

.gift-sparkles {
  position: absolute;
  inset: -20px;
  pointer-events: none;
}

.sparkle {
  position: absolute;
  color: var(--gold);
  font-size: 1.1rem;
  opacity: 0;
  animation: sparkle-float 3s ease-in-out infinite;
}

.sparkle.s1 { top: 5%; left: 8%; animation-delay: 0s; }
.sparkle.s2 { top: 12%; right: 10%; animation-delay: 0.7s; }
.sparkle.s3 { top: 45%; left: 4%; animation-delay: 1.3s; }
.sparkle.s4 { bottom: 25%; right: 6%; animation-delay: 0.4s; }
.sparkle.s5 { bottom: 8%; left: 12%; animation-delay: 1s; }
.sparkle.s6 { top: 65%; right: 10%; animation-delay: 1.6s; }

@keyframes sparkle-float {
  0%, 100% { opacity: 0; transform: translateY(0) scale(0.6) rotate(0deg); }
  50% { opacity: 0.85; transform: translateY(-8px) scale(1) rotate(180deg); }
}

.gift-title {
  font-family: var(--font-display);
  margin-bottom: 0.6rem;
  line-height: 1.2;
}

.gift-title-line-1 {
  display: block;
  font-size: clamp(1.2rem, 3.5vw, 1.8rem);
  font-weight: 400;
  color: var(--text-secondary);
  letter-spacing: 0.04em;
}

.gift-title-line-2 {
  display: block;
  font-size: clamp(2.2rem, 7.5vw, 4rem);
  font-weight: 800;
  background: var(--gradient-rose);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-top: 0.2rem;
}

.gift-subtitle {
  font-family: var(--font-elegant);
  font-size: clamp(1rem, 2.8vw, 1.25rem);
  color: var(--text-secondary);
  font-style: italic;
  margin-bottom: clamp(1.5rem, 4vw, 2.5rem);
}

/* ── Masterpiece Vector Gift Box ───────────────────────────── */
#gift-box-wrapper {
  margin: 0 auto clamp(0.5rem, 2vw, 1.2rem);
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: opacity 0.5s ease;
}

.gift-box-vector {
  width: clamp(210px, 46vw, 280px);
  max-width: 100%;
  aspect-ratio: 1 / 1;
  cursor: pointer;
  position: relative;
  transition: transform 0.45s var(--ease-out-back), filter 0.4s ease;
  filter: drop-shadow(0 14px 30px rgba(183, 110, 121, 0.24));
  animation: gift-floating 3.8s ease-in-out infinite;
  outline: none;
  border-radius: 24px;
}

.gift-box-vector:hover,
.gift-box-vector:focus-visible {
  transform: translateY(-8px) scale(1.05);
  filter: drop-shadow(0 20px 40px rgba(232, 69, 138, 0.35));
}

@keyframes gift-floating {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

.gift-box-svg {
  width: 100%;
  height: 100%;
  overflow: visible;
  display: block;
}

/* Lid Animation */
.gift-svg-lid {
  transform-origin: 170px 92px;
  transition: transform 0.9s cubic-bezier(0.2, 0.95, 0.3, 1.25), opacity 0.8s ease;
}

.gift-box-vector:hover .gift-svg-lid {
  transform: translateY(-4px);
}

.gift-box-vector.opened .gift-svg-lid {
  transform: translateY(-90px) rotate(-14deg) scale(1.08);
  opacity: 0.12;
  pointer-events: none;
}

/* Inner Glow / Burst */
.gift-inner-glow {
  opacity: 0;
  transform-origin: 170px 115px;
  transform: scale(0.3);
  transition: all 0.7s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.gift-box-vector.opened .gift-inner-glow {
  opacity: 1;
  transform: scale(1.25);
}

.gift-box-vector.opened {
  animation: none;
  transform: scale(1.03);
}

.gift-hint {
  font-family: var(--font-elegant);
  font-size: clamp(0.95rem, 2.5vw, 1.15rem);
  color: var(--text-secondary);
  font-style: italic;
  margin-top: 0.8rem;
  animation: gentle-bounce 2s ease-in-out infinite;
}

@keyframes gentle-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

/* Gift Message Card */
.gift-message {
  margin-top: 1rem;
  animation: scaleIn 0.5s var(--ease-out-back);
}

.gift-message.hidden {
  display: none;
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.85); }
  to { opacity: 1; transform: scale(1); }
}

.gift-message-inner {
  background: var(--gradient-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 24px;
  padding: clamp(1.5rem, 4vw, 2.5rem);
  box-shadow: var(--shadow-heavy);
  max-width: 440px;
  margin: 0 auto;
}

.gift-msg-emoji {
  font-size: 2.8rem;
  margin-bottom: 0.5rem;
}

.gift-msg-title {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 700;
  background: var(--gradient-rose);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.75rem;
}

.gift-msg-text {
  font-family: var(--font-elegant);
  font-size: clamp(1rem, 2.5vw, 1.15rem);
  color: var(--text-secondary);
  line-height: 1.65;
  margin-bottom: 1.5rem;
}

/* ═══════════════════════════════════════════════════════════
   SECTION 2: LOVE LETTER
   ═══════════════════════════════════════════════════════════ */
#section-letter {
  background: var(--gradient-main);
}

.letter-scene {
  width: 100%;
  max-width: 600px;
  margin: auto;
  text-align: center;
}

.letter-envelope-wrapper {
  margin: 0 auto 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.letter-envelope {
  position: relative;
  width: clamp(260px, 80vw, 360px);
  height: clamp(160px, 50vw, 220px);
  background: linear-gradient(180deg, #eed0d5 0%, #dca4ac 100%);
  border-radius: 12px;
  box-shadow: var(--shadow-medium);
  cursor: pointer;
  transition: transform 0.4s var(--ease-out-expo);
  overflow: hidden;
}

.letter-envelope:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: var(--shadow-heavy);
}

.envelope-back {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, #e4b2ba 0%, #caa0a8 100%);
}

.envelope-front {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 70%;
  background: linear-gradient(180deg, #d89da7 0%, #b76e79 100%);
  clip-path: polygon(0 35%, 50% 0%, 100% 35%, 100% 100%, 0% 100%);
  z-index: 2;
}

.envelope-flap {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 55%;
  background: linear-gradient(180deg, #c48b94 0%, #d4a0a7 100%);
  clip-path: polygon(0 0, 50% 100%, 100% 0);
  z-index: 3;
  transform-origin: top center;
  transition: transform 0.7s var(--ease-out-expo);
}

.envelope-seal {
  position: absolute;
  top: 36%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #e8458a, #b01d56);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  z-index: 4;
  box-shadow: 0 3px 10px rgba(176, 29, 86, 0.4);
  transition: opacity 0.4s, transform 0.4s;
}

.letter-envelope.opened .envelope-flap {
  transform: rotateX(180deg);
  z-index: 1;
}

.letter-envelope.opened .envelope-seal {
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.5);
}

.letter-hint {
  font-family: var(--font-elegant);
  font-size: 1rem;
  color: var(--text-secondary);
  font-style: italic;
  margin-top: 1rem;
  animation: gentle-bounce 2s ease-in-out infinite;
}

/* Unfolded Letter Parchment */
.letter-parchment-container {
  width: 100%;
  max-width: 540px;
  margin: 1rem auto 0;
  animation: fadeIn 0.6s var(--ease-out-expo);
}

.letter-parchment-container.hidden {
  display: none;
}

.letter-parchment {
  background: linear-gradient(180deg, #fffcf8 0%, #fff7f0 100%);
  border: 1px solid rgba(183, 110, 121, 0.25);
  border-radius: 20px;
  padding: clamp(1.2rem, 4vw, 2.2rem);
  box-shadow: var(--shadow-heavy);
  text-align: left;
  max-height: clamp(380px, 65vh, 520px);
  display: flex;
  flex-direction: column;
}

.letter-paper-header {
  text-align: center;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--pink-200);
  margin-bottom: 1rem;
}

.letter-date {
  font-family: var(--font-body);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--rose-gold);
  font-weight: 500;
}

.letter-ornament {
  color: var(--rose-gold-light);
  font-size: 1rem;
  margin-top: 0.2rem;
}

.letter-body {
  flex: 1;
  overflow-y: auto;
  padding-right: 0.5rem;
  font-family: var(--font-elegant);
  font-size: clamp(1rem, 2.6vw, 1.18rem);
  line-height: 1.8;
  color: var(--text-primary);
}

.letter-body::-webkit-scrollbar {
  width: 5px;
}

.letter-body::-webkit-scrollbar-thumb {
  background: var(--rose-gold-lighter);
  border-radius: 4px;
}

.letter-greeting {
  font-family: var(--font-script);
  font-size: clamp(1.2rem, 3.2vw, 1.55rem);
  color: var(--rose-gold-dark);
  margin-bottom: 0.8rem;
}

#typed-letter-content {
  white-space: pre-line;
}

.letter-cursor {
  display: inline-block;
  color: var(--pink-500);
  font-weight: 300;
  animation: blink 0.9s step-end infinite;
}

@keyframes blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

.letter-footer {
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--pink-200);
  text-align: right;
}

.letter-sign {
  font-family: var(--font-elegant);
  font-size: 0.9rem;
  color: var(--text-muted);
  font-style: italic;
}

.letter-name {
  font-family: var(--font-script);
  font-size: 1.3rem;
  color: var(--rose-gold-dark);
  margin-top: 0.25rem;
}

.letter-next-action {
  margin-top: 1.25rem;
  text-align: center;
}

/* ═══════════════════════════════════════════════════════════
   SECTION 3: TIMELINE
   ═══════════════════════════════════════════════════════════ */
#section-timeline {
  background: var(--gradient-main);
}

.timeline-scene {
  width: 100%;
  max-width: 820px;
  margin: 0 auto;
}

.timeline-container {
  position: relative;
  padding: 1.5rem 0 2.5rem;
}

.timeline-line {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--pink-200);
  transform: translateX(-50%);
}

.timeline-progress {
  position: absolute;
  left: 50%;
  top: 0;
  width: 2px;
  height: 0;
  background: var(--gradient-rose);
  transform: translateX(-50%);
  transition: height 0.25s linear;
}

.timeline-item {
  position: relative;
  width: 50%;
  padding: 0 clamp(1.5rem, 3vw, 2.5rem) clamp(2rem, 4vw, 3rem);
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s var(--ease-out-expo), transform 0.6s var(--ease-out-expo);
}

.timeline-item.visible {
  opacity: 1;
  transform: translateY(0);
}

.timeline-item[data-aos="left"] {
  left: 0;
  text-align: right;
}

.timeline-item[data-aos="right"] {
  left: 50%;
  text-align: left;
}

.timeline-dot {
  position: absolute;
  top: 0;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: white;
  border: 3px solid var(--rose-gold-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  z-index: 2;
  box-shadow: var(--shadow-soft);
  transition: transform 0.35s var(--ease-out-back);
}

.timeline-item[data-aos="left"] .timeline-dot {
  right: -19px;
}

.timeline-item[data-aos="right"] .timeline-dot {
  left: -19px;
}

.timeline-item.visible .timeline-dot {
  transform: scale(1.1);
  border-color: var(--rose-gold);
}

.timeline-card {
  background: var(--gradient-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  transition: transform 0.4s var(--ease-out-expo), box-shadow 0.4s;
}

.timeline-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-medium);
}

.timeline-card-img {
  width: 100%;
  aspect-ratio: 16/9;
  overflow: hidden;
  background: var(--pink-100);
}

.timeline-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.6s var(--ease-out-expo);
}

.timeline-card:hover .timeline-card-img img {
  transform: scale(1.06);
}

.timeline-card-content {
  padding: clamp(1rem, 2.5vw, 1.4rem);
}

.timeline-date {
  font-family: var(--font-body);
  font-size: 0.72rem;
  color: var(--rose-gold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
}

.timeline-card-content h3 {
  font-family: var(--font-display);
  font-size: clamp(1.05rem, 2.2vw, 1.25rem);
  font-weight: 700;
  color: var(--text-primary);
  margin: 0.3rem 0 0.5rem;
}

.timeline-card-content p {
  font-family: var(--font-elegant);
  font-size: clamp(0.95rem, 2vw, 1.05rem);
  color: var(--text-secondary);
  line-height: 1.6;
}

.timeline-footer-action {
  text-align: center;
  margin-top: 1.5rem;
}

/* ═══════════════════════════════════════════════════════════
   SECTION 4: BIRTHDAY CAKE
   ═══════════════════════════════════════════════════════════ */
#section-cake {
  background: var(--gradient-main);
}

.cake-scene {
  width: 100%;
  max-width: 600px;
  margin: auto;
  text-align: center;
}

.cake-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: clamp(1rem, 3vw, 2rem);
}

/* ── Realistic Vector 3-Tier Cake ──────────────────────────── */
.cake-svg-wrapper {
  width: 100%;
  max-width: 380px;
  margin: 0 auto;
  position: relative;
  display: flex;
  justify-content: center;
}

.birthday-cake-svg {
  width: 100%;
  height: auto;
  max-height: clamp(270px, 44vh, 370px);
  filter: drop-shadow(0 10px 25px rgba(183, 110, 121, 0.16));
  overflow: visible;
}

.candle-svg {
  cursor: pointer;
  transition: transform 0.25s var(--ease-out-back);
  transform-origin: center bottom;
}

.candle-svg:hover {
  transform: scale(1.08);
}

.candle-flame-svg {
  transition: opacity 0.5s var(--ease-out-expo), transform 0.5s var(--ease-out-expo);
  transform-origin: center center;
  animation: svg-flame-flicker 0.4s ease-in-out infinite alternate;
}

.candle-flame-svg.blown {
  opacity: 0;
  transform: translateY(-12px) scale(0);
  pointer-events: none;
}

@keyframes svg-flame-flicker {
  0% { transform: scale(1) rotate(-0.8deg); }
  50% { transform: scale(1.05, 0.95) rotate(0.8deg); }
  100% { transform: scale(0.96, 1.04) rotate(-0.4deg); }
}

.cake-buttons-wrap {
  margin-top: clamp(1.5rem, 3.5vw, 2.5rem);
}

.btn-blow {
  padding: clamp(0.75rem, 2vw, 0.95rem) clamp(1.8rem, 4vw, 2.8rem);
  border: none;
  border-radius: 100px;
  background: var(--gradient-rose);
  color: white;
  font-family: var(--font-body);
  font-size: clamp(0.9rem, 2vw, 1.05rem);
  font-weight: 500;
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(183, 110, 121, 0.35);
  transition: all 0.35s var(--ease-out-expo);
}

.btn-blow:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 8px 25px rgba(183, 110, 121, 0.45);
}

.btn-blow.hidden {
  display: none;
}

/* Cake Wish Card */
.cake-wish {
  margin-top: 1.5rem;
  animation: scaleIn 0.5s var(--ease-out-back);
}

.cake-wish.hidden {
  display: none;
}

.wish-content {
  background: var(--gradient-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 24px;
  padding: clamp(1.5rem, 4vw, 2.2rem);
  box-shadow: var(--shadow-heavy);
  max-width: 460px;
  margin: 0 auto;
}

.wish-emoji {
  font-size: 2.8rem;
  margin-bottom: 0.4rem;
}

.wish-title {
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 3vw, 1.7rem);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.6rem;
}

.wish-text {
  font-family: var(--font-elegant);
  font-size: clamp(0.98rem, 2.2vw, 1.12rem);
  color: var(--text-secondary);
  line-height: 1.65;
}

/* ═══════════════════════════════════════════════════════════
   SECTION 5: STARRY NIGHT
   ═══════════════════════════════════════════════════════════ */
#section-stars {
  background: #020010;
}

#section-stars .section-inner {
  padding: 0;
  width: 100%;
  height: 100%;
}

.stars-scene {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

#stars-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.stars-content {
  position: absolute;
  top: clamp(1rem, 4vh, 2.5rem);
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  z-index: 5;
  width: 90%;
  max-width: 600px;
  pointer-events: none;
}

.stars-title {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 4vw, 2.6rem);
  font-weight: 700;
  color: #eeddf8;
  margin-bottom: 0.3rem;
  text-shadow: 0 0 25px rgba(210, 160, 255, 0.4);
}

.stars-subtitle {
  font-family: var(--font-elegant);
  font-size: clamp(0.9rem, 2.4vw, 1.15rem);
  color: rgba(220, 200, 240, 0.75);
  font-style: italic;
}

/* Star Modal */
.star-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(3, 0, 18, 0.68);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 1.5rem;
  animation: fadeIn 0.3s ease;
}

.star-modal.hidden {
  display: none;
}

.star-modal-content {
  background: linear-gradient(145deg, rgba(38, 18, 60, 0.96) 0%, rgba(18, 7, 38, 0.96) 100%);
  border: 1px solid rgba(220, 180, 255, 0.3);
  border-radius: 24px;
  padding: clamp(1.8rem, 4vw, 2.5rem);
  max-width: 400px;
  width: 100%;
  text-align: center;
  position: relative;
  box-shadow: 0 0 50px rgba(180, 120, 240, 0.25);
  animation: scaleIn 0.35s var(--ease-out-back);
}

.star-modal-close {
  position: absolute;
  top: 0.75rem;
  right: 1rem;
  background: none;
  border: none;
  color: rgba(220, 200, 240, 0.6);
  font-size: 1.6rem;
  cursor: pointer;
  padding: 0.4rem;
  line-height: 1;
}

.star-modal-emoji {
  font-size: 2.6rem;
  margin-bottom: 0.6rem;
}

.star-modal-text {
  font-family: var(--font-elegant);
  font-size: clamp(1.05rem, 2.8vw, 1.2rem);
  color: #eeddf8;
  line-height: 1.75;
  margin-bottom: 1.5rem;
}

.star-modal-ok-btn {
  padding: 0.6rem 1.8rem;
  font-size: 0.9rem;
}

/* Final Message in Stars */
.stars-final-msg {
  position: absolute;
  bottom: clamp(4rem, 9vh, 5.5rem);
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  z-index: 5;
  width: 90%;
  max-width: 520px;
  pointer-events: auto;
}

.final-heart {
  font-size: 2rem;
  color: var(--pink-300);
  animation: heartbeat 1.4s ease-in-out infinite;
  margin-bottom: 0.3rem;
}

.final-text {
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 3.2vw, 1.7rem);
  font-weight: 600;
  color: #eeddf8;
  margin-bottom: 0.5rem;
}

.final-subtext {
  font-family: var(--font-elegant);
  font-size: clamp(0.9rem, 2.2vw, 1.05rem);
  color: rgba(220, 200, 240, 0.75);
  line-height: 1.6;
  margin-bottom: 0.5rem;
}

.final-year {
  font-family: var(--font-body);
  font-size: 0.75rem;
  color: rgba(220, 200, 240, 0.45);
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

/* ── Confetti Canvas ───────────────────────────────────────── */
#confetti-canvas {
  position: fixed;
  inset: 0;
  z-index: 99999;
  pointer-events: none;
  width: 100%;
  height: 100%;
}

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE BREAKPOINTS (ALL DEVICES)
   ═══════════════════════════════════════════════════════════ */

/* Tablets & Mobile (< 768px) */
@media (max-width: 768px) {
  #nav-dots {
    display: none; /* replaced by mobile nav bar */
  }

  #floating-quick-nav {
    display: none;
  }

  #mobile-nav {
    display: flex;
  }

  /* Timeline mobile single column */
  .timeline-line {
    left: 20px;
  }

  .timeline-progress {
    left: 20px;
  }

  .timeline-item,
  .timeline-item[data-aos="left"],
  .timeline-item[data-aos="right"] {
    width: 100%;
    left: 0;
    text-align: left;
    padding-left: 50px;
    padding-right: 0.5rem;
    padding-bottom: 2rem;
  }

  .timeline-item[data-aos="left"] .timeline-dot,
  .timeline-item[data-aos="right"] .timeline-dot {
    left: 1px;
    right: auto;
  }

  .cake {
    padding-top: 55px;
  }
}

/* Small Mobile (< 480px) */
@media (max-width: 480px) {
  .section-inner {
    padding-left: 0.85rem;
    padding-right: 0.85rem;
  }

  .gift-message-inner,
  .wish-content,
  .letter-parchment {
    padding: 1.25rem 1rem;
    border-radius: 18px;
  }

  .timeline-card-content {
    padding: 0.9rem;
  }

  .timeline-card-content h3 {
    font-size: 1rem;
  }

  .timeline-card-content p {
    font-size: 0.88rem;
  }

  .star-modal-content {
    padding: 1.5rem 1.2rem;
  }
}

/* Small Heights (Landscape or iPhone SE) */
@media (max-height: 650px) {
  .section-inner {
    justify-content: flex-start;
    padding-top: 1.5rem;
    padding-bottom: 4rem;
  }

  .gift-title-line-2 {
    font-size: 2.2rem;
  }

  #gift-box-wrapper {
    margin-bottom: 0.5rem;
  }

  .cake {
    padding-top: 45px;
  }

  .stars-content {
    top: 0.75rem;
  }

  .stars-final-msg {
    bottom: 3.5rem;
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
