/* ==========================================================================
   DESIGN TOKENS
   Palette:  Deep Navy #07111F · Royal Purple #6C63FF · Gold #FFD700
             Soft Pink #FF6BAA · White #FFFFFF
   Display face: "Cormorant Garamond" (emotional, editorial serif, italic accents)
   Body / UI face: "Manrope" (clean geometric sans for readability + captions)
   ========================================================================== */
:root{
  --navy-950: #04080f;
  --navy-900: #07111F;
  --navy-800: #0d1a2e;
  --navy-700: #142339;
  --purple: #6C63FF;
  --purple-soft: #9b93ff;
  --gold: #FFD700;
  --gold-soft: #ffe98a;
  --pink: #FF6BAA;
  --white: #ffffff;
  --ink-70: rgba(255,255,255,.7);
  --ink-50: rgba(255,255,255,.5);
  --glass-bg: rgba(255,255,255,.06);
  --glass-border: rgba(255,255,255,.14);

  --font-display: 'Cormorant Garamond', 'Times New Roman', serif;
  --font-body: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --ease-cinematic: cubic-bezier(.16,.84,.32,1);
  --ease-soft: cubic-bezier(.25,.8,.4,1);

  --section-pad: clamp(4rem, 10vw, 9rem);
}

/* ==========================================================================
   RESET & BASE
   ========================================================================== */
*, *::before, *::after{ box-sizing: border-box; }
html{ scroll-behavior: smooth; }
body{
  margin: 0;
  background: var(--navy-900);
  color: var(--white);
  font-family: var(--font-body);
  overflow-x: hidden;
  cursor: default;
}
h1,h2,h3{ font-family: var(--font-display); margin: 0; font-weight: 500; }
p{ margin: 0; }
button{ font-family: inherit; cursor: pointer; }
img{ max-width: 100%; display: block; }
a{ color: inherit; }

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

/* Custom scrollbar */
::-webkit-scrollbar{ width: 10px; }
::-webkit-scrollbar-track{ background: var(--navy-950); }
::-webkit-scrollbar-thumb{
  background: linear-gradient(var(--purple), var(--pink));
  border-radius: 10px;
  border: 2px solid var(--navy-950);
}

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

/* Visible keyboard focus for accessibility */
a:focus-visible, button:focus-visible, [tabindex]:focus-visible{
  outline: 2px solid var(--gold);
  outline-offset: 4px;
  border-radius: 4px;
}

/* ==========================================================================
   GLOBAL AMBIENT LAYERS (cursor glow + particle canvas)
   ========================================================================== */
.cursor-glow{
  position: fixed;
  top: 0; left: 0;
  width: 380px; height: 380px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 3;
  background: radial-gradient(circle, rgba(108,99,255,.16) 0%, rgba(255,107,170,.08) 45%, transparent 70%);
  transform: translate(-50%, -50%);
  transition: opacity .4s ease;
  will-change: transform;
}
#bg-canvas{
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

@media (hover: none){
  .cursor-glow{ display: none; }
}

/* ==========================================================================
   1. LOADING SCREEN
   ========================================================================== */
.loader{
  position: fixed;
  inset: 0;
  z-index: 100;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 1.1s var(--ease-cinematic), visibility 1.1s;
}
.loader.is-hidden{
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.loader-particles{
  position: absolute;
  inset: 0;
  overflow: hidden;
}
.loader-particles span{
  position: absolute;
  bottom: -10px;
  width: 3px;
  height: 3px;
  background: var(--gold);
  border-radius: 50%;
  opacity: 0;
  box-shadow: 0 0 8px 2px rgba(255,215,0,.6);
  animation: loaderFloat linear infinite;
}
@keyframes loaderFloat{
  0%{ transform: translateY(0) scale(.6); opacity: 0; }
  10%{ opacity: 1; }
  90%{ opacity: .5; }
  100%{ transform: translateY(-100vh) scale(1.2); opacity: 0; }
}
.loader-content{
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 0 1.5rem;
}
.loader-caption{
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(1.1rem, 3vw, 1.6rem);
  color: var(--ink-70);
  letter-spacing: .02em;
  margin-bottom: 2rem;
  animation: fadeInSoft 1.4s var(--ease-soft);
}
.loader-bar-track{
  width: min(320px, 60vw);
  height: 2px;
  background: rgba(255,255,255,.12);
  border-radius: 2px;
  margin: 0 auto;
  overflow: hidden;
}
.loader-bar-fill{
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--purple), var(--pink), var(--gold));
  box-shadow: 0 0 12px 1px rgba(255,215,0,.5);
  transition: width .25s var(--ease-soft);
}
.loader-percent{
  margin-top: .9rem;
  font-size: .8rem;
  letter-spacing: .18em;
  color: var(--ink-50);
  font-variant-numeric: tabular-nums;
}
@keyframes fadeInSoft{
  from{ opacity: 0; transform: translateY(10px); }
  to{ opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   SOUND TOGGLE
   ========================================================================== */
.sound-toggle{
  position: fixed;
  bottom: 1.75rem;
  right: 1.75rem;
  z-index: 60;
  width: 52px; height: 52px;
  border-radius: 50%;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  color: var(--gold);
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 0 rgba(255,215,0,.4);
  transition: box-shadow .3s ease, transform .3s ease, background .3s ease;
  opacity: 0;
  pointer-events: none;
}
.sound-toggle.is-visible{ opacity: 1; pointer-events: auto; }
.sound-toggle.is-playing{ box-shadow: 0 0 0 6px rgba(255,215,0,.12); }
.sound-toggle:hover{ transform: scale(1.08); background: rgba(255,255,255,.1); }
.sound-toggle.is-muted .sound-icon::after{ content: '̶'; }

/* ==========================================================================
   MAIN EXPERIENCE
   ========================================================================== */
.experience{ position: relative; z-index: 1; }
.experience[hidden]{ display: none; }

/* Progress rail */
.progress-rail{
  position: fixed;
  right: 1.5rem;
  top: 50%;
  transform: translateY(-50%);
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: .85rem;
}
.rail-dot{
  width: 8px; height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,.25);
  border: 1px solid transparent;
  transition: background .35s ease, transform .35s ease, box-shadow .35s ease;
  position: relative;
}
.rail-dot:hover{ transform: scale(1.4); }
.rail-dot.is-active{
  background: var(--gold);
  box-shadow: 0 0 10px 2px rgba(255,215,0,.6);
}
@media (max-width: 900px){ .progress-rail{ display: none; } }

/* Section shared rhythm */
.section{
  position: relative;
  padding: var(--section-pad) 1.5rem;
  max-width: 1200px;
  margin: 0 auto;
}
.section-header{
  text-align: center;
  max-width: 640px;
  margin: 0 auto clamp(2.5rem, 6vw, 4.5rem);
}
.section-eyebrow{
  display: inline-block;
  font-size: .78rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: .9rem;
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .8s var(--ease-cinematic), transform .8s var(--ease-cinematic);
}
.section-title{
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 500;
  background: linear-gradient(120deg, var(--white), var(--purple-soft) 60%, var(--pink));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity .9s var(--ease-cinematic) .1s, transform .9s var(--ease-cinematic) .1s;
}
.section-hint{
  margin-top: .9rem;
  color: var(--ink-50);
  font-size: .95rem;
  font-style: italic;
  font-family: var(--font-display);
}
.section-header.is-visible .section-eyebrow,
.section-header.is-visible .section-title{
  opacity: 1;
  transform: translateY(0);
}

/* ==========================================================================
   2. HERO
   ========================================================================== */
.hero{
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: radial-gradient(ellipse at 50% 20%, var(--navy-800) 0%, var(--navy-900) 55%, var(--navy-950) 100%);
}
.hero-sky{ position: absolute; inset: 0; z-index: 0; }
.stars{
  position: absolute; inset: 0;
  background-image:
    radial-gradient(1.5px 1.5px at 20% 30%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 75% 15%, #fff, transparent),
    radial-gradient(1px 1px at 50% 60%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 85% 70%, #fff, transparent),
    radial-gradient(1px 1px at 10% 80%, #fff, transparent),
    radial-gradient(1px 1px at 35% 45%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 65% 85%, #fff, transparent),
    radial-gradient(1px 1px at 92% 40%, #fff, transparent);
  background-repeat: repeat;
  background-size: 600px 600px;
  opacity: .8;
  animation: starsTwinkle 6s ease-in-out infinite alternate;
}
@keyframes starsTwinkle{ from{ opacity: .5; } to{ opacity: 1; } }
.aurora{
  position: absolute;
  top: -20%; left: -10%;
  width: 120%; height: 70%;
  background: conic-gradient(from 180deg at 50% 50%, rgba(108,99,255,.35), rgba(255,107,170,.25), rgba(255,215,0,.15), rgba(108,99,255,.35));
  filter: blur(80px);
  opacity: .5;
  animation: auroraDrift 18s ease-in-out infinite alternate;
  mix-blend-mode: screen;
}
@keyframes auroraDrift{
  0%{ transform: translate(-4%, -2%) rotate(0deg); }
  100%{ transform: translate(4%, 3%) rotate(8deg); }
}
.floating-lights{ position: absolute; inset: 0; }
.floating-lights span{
  position: absolute;
  bottom: -20px;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 10px 3px rgba(255,215,0,.5);
  animation: fireflyRise linear infinite;
}
@keyframes fireflyRise{
  0%{ transform: translate(0,0); opacity: 0; }
  15%{ opacity: .9; }
  100%{ transform: translate(var(--drift, 30px), -110vh); opacity: 0; }
}

.hero-content{
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 0 1.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(1.5rem, 4vw, 2.5rem);
}
.hero-eyebrow{
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(1.1rem, 3vw, 1.7rem);
  color: var(--ink-70);
  letter-spacing: .03em;
  opacity: 0;
}
.reveal-line{ animation: heroLineIn 1.4s var(--ease-cinematic) forwards; }
@keyframes heroLineIn{
  from{ opacity: 0; transform: translateY(18px); filter: blur(6px); }
  to{ opacity: 1; transform: translateY(0); filter: blur(0); }
}

.hero-title{
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .25rem;
  line-height: 1.05;
}
.hero-title-emoji{
  font-size: clamp(1.8rem, 5vw, 3rem);
  margin-bottom: .35rem;
  opacity: 0;
}
.hero-title-emoji.is-visible{
  animation: popIn .7s var(--ease-cinematic) forwards;
}
@keyframes popIn{
  0%{ opacity: 0; transform: scale(.4) rotate(-15deg); }
  70%{ opacity: 1; transform: scale(1.15) rotate(5deg); }
  100%{ opacity: 1; transform: scale(1) rotate(0); }
}
.hero-title-line{
  font-size: clamp(2.2rem, 8vw, 5rem);
  font-weight: 500;
  color: var(--white);
}
.hero-title-name{
  font-style: italic;
  background: linear-gradient(100deg, var(--gold), var(--pink) 55%, var(--purple-soft));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 24px rgba(255,215,0,.25));
}
.letter-char{
  display: inline-block;
  opacity: 0;
  transform: translateY(30px) rotate(6deg);
  animation: charIn .6s var(--ease-cinematic) forwards;
}
@keyframes charIn{
  to{ opacity: 1; transform: translateY(0) rotate(0); }
}

.btn-glow{
  position: relative;
  padding: 1rem 2.4rem;
  border: 1px solid rgba(255,215,0,.5);
  border-radius: 999px;
  background: linear-gradient(120deg, rgba(108,99,255,.25), rgba(255,107,170,.2));
  color: var(--white);
  font-size: .95rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  backdrop-filter: blur(10px);
  box-shadow: 0 0 0 0 rgba(255,215,0,.4);
  opacity: 0;
  transform: translateY(14px);
  transition: transform .3s var(--ease-soft), box-shadow .4s ease, background .4s ease;
}
.btn-glow.is-visible{
  animation: btnFadeIn 1s var(--ease-cinematic) forwards;
}
@keyframes btnFadeIn{ to{ opacity: 1; transform: translateY(0); } }
.btn-glow:hover{
  box-shadow: 0 0 24px 4px rgba(255,215,0,.35);
  background: linear-gradient(120deg, rgba(108,99,255,.4), rgba(255,107,170,.35));
}

.confetti-layer, .balloon-layer{
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 3;
}
.confetti-piece{
  position: absolute;
  top: -20px;
  width: 8px; height: 14px;
  opacity: .9;
  animation: confettiFall linear forwards;
}
@keyframes confettiFall{
  to{ transform: translateY(110vh) rotate(720deg); opacity: 0; }
}
.balloon{
  position: absolute;
  bottom: -140px;
  width: 54px; height: 68px;
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  animation: balloonRise linear forwards;
}
.balloon::after{
  content: '';
  position: absolute;
  left: 50%; bottom: -30px;
  width: 1px; height: 30px;
  background: rgba(255,255,255,.35);
  transform: translateX(-50%);
}
@keyframes balloonRise{
  to{ transform: translateY(-135vh) translateX(var(--sway, 20px)); }
}

.scroll-hint{
  position: absolute;
  bottom: 2rem; left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  width: 22px; height: 36px;
  border: 1px solid var(--ink-50);
  border-radius: 20px;
}
.scroll-hint span{
  position: absolute;
  top: 6px; left: 50%;
  width: 4px; height: 8px;
  background: var(--gold);
  border-radius: 3px;
  transform: translateX(-50%);
  animation: scrollDot 1.8s ease-in-out infinite;
}
@keyframes scrollDot{
  0%{ opacity: 0; top: 6px; }
  30%{ opacity: 1; }
  80%{ opacity: 0; top: 20px; }
  100%{ opacity: 0; top: 6px; }
}

/* ==========================================================================
   PHOTO PLACEHOLDER TREATMENTS (swap backgrounds for real <img> later)
   ========================================================================== */
.ph-1{ background: linear-gradient(135deg, #6C63FF, #2a1c66); }
.ph-2{ background: linear-gradient(135deg, #FF6BAA, #7a2350); }
.ph-3{ background: linear-gradient(135deg, #FFD700, #7a5c00); }
.ph-4{ background: linear-gradient(135deg, #6C63FF, #FF6BAA); }

/* ==========================================================================
   3. MEMORY TIMELINE
   ========================================================================== */
.timeline{ position: relative; padding: 1rem 0; }
.timeline-spine{
  position: absolute;
  left: 50%;
  top: 0; bottom: 0;
  width: 2px;
  background: linear-gradient(var(--purple), var(--pink), var(--gold));
  opacity: .35;
  transform: translateX(-50%);
}
@media (max-width: 760px){ .timeline-spine{ left: 20px; } }

.timeline-card{
  position: relative;
  width: 48%;
  margin-bottom: 3.5rem;
  opacity: 0;
  transform: translateY(50px);
  transition: opacity .9s var(--ease-cinematic), transform .9s var(--ease-cinematic);
}
.timeline-card.is-visible{ opacity: 1; transform: translateY(0); }
.timeline-card:nth-child(odd){ margin-left: 0; text-align: right; }
.timeline-card:nth-child(even){ margin-left: 52%; text-align: left; }
@media (max-width: 760px){
  .timeline-card, .timeline-card:nth-child(odd), .timeline-card:nth-child(even){
    width: calc(100% - 50px);
    margin-left: 50px;
    text-align: left;
  }
}

.card-glass{
  display: inline-flex;
  flex-direction: column;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 18px;
  overflow: hidden;
  backdrop-filter: blur(14px);
  box-shadow: 0 10px 40px rgba(0,0,0,.35);
  transition: transform .45s var(--ease-soft), box-shadow .45s var(--ease-soft);
  max-width: 380px;
  width: 100%;
}
.timeline-card:nth-child(odd) .card-glass{ text-align: left; }
.card-glass:hover{
  transform: translateY(-6px) scale(1.02);
  box-shadow: 0 20px 60px rgba(108,99,255,.25), 0 0 0 1px rgba(255,215,0,.2);
}
.card-photo{ height: 180px; width: 100%; }
.card-body{ padding: 1.4rem 1.6rem; }
.card-year{
  font-size: .75rem;
  letter-spacing: .16em;
  color: var(--gold);
  text-transform: uppercase;
}
.card-body h3{ margin: .5rem 0 .5rem; font-size: 1.4rem; }
.card-body p{ color: var(--ink-70); font-size: .95rem; line-height: 1.55; }

/* ==========================================================================
   4. WHY YOU'RE SPECIAL — floating cards
   ========================================================================== */
.float-cards{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1.5rem;
  max-width: 900px;
  margin: 0 auto;
}
.float-card{
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: 2rem 1rem;
  text-align: center;
  backdrop-filter: blur(14px);
  animation: cardFloat 5s ease-in-out infinite;
  animation-delay: var(--delay);
  transition: box-shadow .4s ease, transform .3s ease;
}
.float-card:hover{
  box-shadow: 0 0 30px rgba(255,215,0,.25);
  transform: scale(1.05);
}
.float-emoji{ font-size: 2.2rem; display: block; margin-bottom: .8rem; }
.float-card p{ font-family: var(--font-display); font-size: 1.15rem; font-style: italic; }
@keyframes cardFloat{
  0%, 100%{ transform: translateY(0); }
  50%{ transform: translateY(-14px); }
}

/* ==========================================================================
   5. INTERACTIVE GIFT BOX
   ========================================================================== */
.gift-section{ text-align: center; }
.gift-stage{
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  perspective: 900px;
}
.gift-box{
  position: relative;
  width: 200px; height: 170px;
  margin-top: 2rem;
  cursor: pointer;
  transform-style: preserve-3d;
  transition: transform .5s var(--ease-soft);
}
.gift-box:hover{ transform: rotateY(8deg) rotateX(4deg) scale(1.03); }
.gift-base{
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 120px;
  background: linear-gradient(135deg, var(--purple), #443c9e);
  border-radius: 10px;
  box-shadow: 0 20px 50px rgba(108,99,255,.3), inset 0 0 30px rgba(0,0,0,.2);
}
.gift-lid{
  position: absolute;
  top: 30px; left: -8px; right: -8px;
  height: 40px;
  background: linear-gradient(135deg, var(--pink), #9c3c68);
  border-radius: 8px;
  box-shadow: 0 8px 20px rgba(255,107,170,.35);
  transform-origin: top center;
  transition: transform .8s var(--ease-cinematic);
  z-index: 3;
}
.gift-ribbon-v{
  position: absolute;
  top: 0; bottom: 0; left: 50%;
  width: 18px;
  background: var(--gold);
  transform: translateX(-50%);
  box-shadow: 0 0 12px rgba(255,215,0,.5);
  z-index: 2;
}
.gift-ribbon-h{
  position: absolute;
  top: 44px; left: 0; right: 0;
  height: 18px;
  background: var(--gold);
  box-shadow: 0 0 12px rgba(255,215,0,.5);
  z-index: 4;
}
.gift-bow{
  position: absolute;
  top: -6px; left: 50%;
  transform: translateX(-50%);
  font-size: 2.4rem;
  z-index: 5;
  transition: opacity .5s ease, transform .6s var(--ease-cinematic);
  filter: drop-shadow(0 4px 10px rgba(0,0,0,.4));
}
.gift-glow-ring{
  position: absolute;
  top: 50%; left: 50%;
  width: 40px; height: 40px;
  background: radial-gradient(circle, rgba(255,215,0,.6), transparent 70%);
  transform: translate(-50%,-50%) scale(0);
  border-radius: 50%;
  opacity: 0;
  transition: transform 1s var(--ease-cinematic), opacity 1s ease;
  pointer-events: none;
}
.gift-box.is-open .gift-lid{ transform: rotateX(-115deg) translateY(-6px); }
.gift-box.is-open .gift-ribbon-v,
.gift-box.is-open .gift-ribbon-h{ opacity: 0; transition: opacity .3s ease; }
.gift-box.is-open .gift-bow{ opacity: 0; transform: translate(-50%,-40px) rotate(25deg); }
.gift-box.is-open .gift-glow-ring{ transform: translate(-50%,-50%) scale(8); opacity: 1; }

.gift-particles{
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.gift-spark{
  position: absolute;
  width: 6px; height: 6px;
  background: var(--gold);
  border-radius: 50%;
  box-shadow: 0 0 10px 2px rgba(255,215,0,.7);
  animation: sparkBurst 1.1s var(--ease-cinematic) forwards;
}
@keyframes sparkBurst{
  0%{ transform: translate(0,0) scale(1); opacity: 1; }
  100%{ transform: translate(var(--tx), var(--ty)) scale(0); opacity: 0; }
}

.gift-message{
  max-width: 480px;
  margin-top: 2.5rem;
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-style: italic;
  line-height: 1.6;
  color: var(--ink-70);
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .9s var(--ease-cinematic), transform .9s var(--ease-cinematic);
}
.gift-message.is-visible{ opacity: 1; transform: translateY(0); }

/* ==========================================================================
   6. SECRET LETTER
   ========================================================================== */
.letter-section{ text-align: center; }
.envelope-stage{ display: flex; justify-content: center; margin-top: 2rem; }
.envelope{
  position: relative;
  width: min(420px, 86vw);
  height: 260px;
  cursor: pointer;
}
.envelope-back{
  position: absolute; inset: 0;
  background: linear-gradient(135deg, var(--navy-700), var(--navy-800));
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  box-shadow: 0 25px 60px rgba(0,0,0,.45);
}
.envelope-flap{
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 130px;
  background: linear-gradient(135deg, var(--purple), #4a3fae);
  clip-path: polygon(0 0, 100% 0, 50% 90%);
  transform-origin: top center;
  transition: transform 1s var(--ease-cinematic);
  z-index: 4;
  box-shadow: 0 10px 25px rgba(0,0,0,.3);
}
.envelope-seal{
  position: absolute;
  top: 48%; left: 50%;
  transform: translate(-50%,-50%);
  width: 46px; height: 46px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--gold), #b38f00);
  display: flex; align-items: center; justify-content: center;
  color: var(--navy-900);
  font-size: 1.2rem;
  z-index: 5;
  box-shadow: 0 0 20px rgba(255,215,0,.5);
  transition: opacity .4s ease, transform .4s ease;
}
.envelope-letter{
  position: absolute;
  left: 6%; right: 6%;
  top: 14px;
  height: 92%;
  background: linear-gradient(180deg, #fdf6e9, #f3e9d2);
  border-radius: 4px;
  color: #2c2110;
  padding: 1.8rem 1.6rem;
  box-shadow: 0 10px 30px rgba(0,0,0,.35);
  transform: translateY(0);
  z-index: 2;
  overflow: hidden;
  transition: transform 1.1s var(--ease-cinematic) .15s;
}
.letter-text{
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(1rem, 2.4vw, 1.25rem);
  line-height: 1.7;
  text-align: left;
}
.envelope.is-open .envelope-flap{ transform: rotateX(160deg); }
.envelope.is-open .envelope-seal{ opacity: 0; transform: translate(-50%,-50%) scale(.5); }
.envelope.is-open .envelope-letter{ transform: translateY(-150px); z-index: 6; }
@media (max-width: 560px){
  .envelope.is-open .envelope-letter{ transform: translateY(-90px); }
}

/* ==========================================================================
   7. WISH TREE
   ========================================================================== */
.tree-section{ text-align: center; }
.tree-stage{
  position: relative;
  max-width: 460px;
  margin: 2rem auto 0;
}
.wish-tree-svg{ width: 100%; height: auto; cursor: pointer; }
.tree-leaf{
  animation: leafSway ease-in-out infinite;
  transform-origin: center;
}
@keyframes leafSway{
  0%, 100%{ transform: rotate(-3deg); }
  50%{ transform: rotate(3deg); }
}
.tree-wishes{
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.wish-light{
  position: absolute;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 12px 3px rgba(255,215,0,.7);
  animation: wishRise 2.6s var(--ease-cinematic) forwards;
}
@keyframes wishRise{
  0%{ opacity: 0; transform: translateY(0) scale(.5); }
  15%{ opacity: 1; }
  100%{ opacity: 0; transform: translateY(-260px) translateX(var(--wx, 0px)) scale(1.3); }
}

/* ==========================================================================
   8. PHOTO GALLERY
   ========================================================================== */
.masonry{
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.2rem;
  max-width: 930px;
  margin: 0 auto;
}
.masonry-item{
  display: block;
  flex: 0 1 280px;
  width: min(100%, 280px);
  height: 220px;
  margin: 0;
  border: none;
  border-radius: 16px;
  break-inside: avoid;
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0,0,0,.35);
  transition: transform .5s var(--ease-soft), box-shadow .5s ease;
}
.masonry-item.tall{ height: 300px; }
.photo-item{
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}
.masonry-item:hover{
  transform: scale(1.04) rotate(-.5deg);
  box-shadow: 0 20px 50px rgba(108,99,255,.35);
}
.masonry-item::after{
  content: attr(data-caption);
  position: absolute;
  inset: auto 0 0 0;
  padding: .9rem;
  font-size: .85rem;
  color: var(--white);
  background: linear-gradient(0deg, rgba(0,0,0,.75), transparent);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .35s ease, transform .35s ease;
  text-align: left;
}
.masonry-item:hover::after{ opacity: 1; transform: translateY(0); }

.lightbox{
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(4,8,15,.92);
  backdrop-filter: blur(10px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity .4s ease, visibility .4s ease;
}
.lightbox.is-open{ opacity: 1; visibility: visible; }
.lightbox-frame{
  width: min(560px, 86vw);
  height: min(420px, 60vh);
  border-radius: 14px;
  box-shadow: 0 30px 80px rgba(0,0,0,.5);
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
}
.lightbox-caption{
  margin-top: 1.2rem;
  font-family: var(--font-display);
  font-style: italic;
  color: var(--ink-70);
}
.lightbox-close{
  position: absolute;
  top: 1.5rem; right: 1.5rem;
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  color: var(--white);
}

/* ==========================================================================
   9. COUNTDOWN
   ========================================================================== */
.countdown-section{ text-align: center; }
.countdown-grid{
  display: flex;
  justify-content: center;
  gap: clamp(1rem, 4vw, 2.5rem);
  flex-wrap: wrap;
}
.countdown-unit{
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 18px;
  padding: 1.6rem clamp(1.2rem, 4vw, 2.2rem);
  backdrop-filter: blur(14px);
  min-width: 110px;
}
.countdown-number{
  display: block;
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 6vw, 3.4rem);
  background: linear-gradient(120deg, var(--gold), var(--pink));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-variant-numeric: tabular-nums;
}
.countdown-label{
  display: block;
  margin-top: .4rem;
  font-size: .78rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--ink-50);
}

/* ==========================================================================
   10. FINALE
   ========================================================================== */
.finale-section{
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
  max-width: none;
  padding: var(--section-pad) 1.5rem;
}
.finale-glow{
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 50%, rgba(108,99,255,.35), rgba(255,107,170,.15) 45%, transparent 75%);
  animation: finaleGlowPulse 5s ease-in-out infinite;
}
@keyframes finaleGlowPulse{
  0%, 100%{ opacity: .6; }
  50%{ opacity: 1; }
}
.finale-fireworks, .finale-confetti{
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.firework-spark{
  position: absolute;
  width: 5px; height: 5px;
  border-radius: 50%;
  animation: fireworkBurst 1.4s var(--ease-cinematic) forwards;
}
@keyframes fireworkBurst{
  0%{ transform: translate(0,0) scale(1); opacity: 1; }
  100%{ transform: translate(var(--fx), var(--fy)) scale(.2); opacity: 0; }
}
.finale-content{ position: relative; z-index: 2; }
.finale-title{
  font-size: clamp(2rem, 6vw, 3.6rem);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .6rem;
  flex-wrap: wrap;
}
.finale-title-words span{
  display: inline-block;
  opacity: 0;
  transform: translateY(20px);
  background: linear-gradient(120deg, var(--white), var(--gold), var(--pink));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: wordIn .8s var(--ease-cinematic) forwards;
}
@keyframes wordIn{ to{ opacity: 1; transform: translateY(0); } }
.sparkle{ display: inline-block; animation: sparkleSpin 3s linear infinite; }
@keyframes sparkleSpin{ from{ transform: rotate(0);} to{ transform: rotate(360deg); } }
.finale-subtitle{
  margin-top: 1.2rem;
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(1.1rem, 3vw, 1.6rem);
  color: var(--ink-70);
}
.finale-subtitle span{
  display: inline-block;
  opacity: 0;
  transform: translateY(12px);
  animation: wordIn .7s var(--ease-cinematic) forwards;
}

/* ==========================================================================
   RESPONSIVE FINE-TUNING
   ========================================================================== */
@media (max-width: 600px){
  .masonry{ gap: .9rem; }
  .masonry-item{ flex-basis: min(100%, 220px); }
  .gift-box{ width: 160px; height: 140px; }
}
