:root{
  --midnight:#14072a; --plum:#2a0f4d; --violet:#6d3bd2; --orchid:#b57bee;
  --lilac:#e6d4ff; --rose:#ff9fd0; --flame:#ffd36e;
  --serif:"Cormorant Garamond", Georgia, "Times New Roman", serif;
  --script:"Great Vibes", "Brush Script MT", cursive;
}
*{box-sizing:border-box;margin:0;padding:0}
html{scroll-behavior:smooth;-webkit-text-size-adjust:100%}
body{
  min-height:100vh; color:var(--lilac); font-family:var(--serif);
  background:radial-gradient(120% 90% at 50% 0%, #3b1578 0%, var(--plum) 38%, var(--midnight) 100%) fixed;
  overflow-x:hidden;
}
.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
:focus-visible{outline:2px solid var(--rose);outline-offset:4px;border-radius:6px}
#sky{position:fixed;inset:0;width:100%;height:100%;z-index:0;pointer-events:none}
.progress{position:fixed;top:0;left:0;height:3px;width:0;z-index:50;background:linear-gradient(90deg,var(--violet),var(--rose));box-shadow:0 0 12px var(--rose)}
main{position:relative;z-index:2}

/* ---------- Gate with blooming flower ---------- */
@property --spread{syntax:'<number>';inherits:true;initial-value:.1}
#gate{
  position:fixed;inset:0;z-index:100;border:0;cursor:pointer;color:var(--lilac);
  display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2.2rem;
  background:radial-gradient(90% 70% at 50% 45%, #4a1b92 0%, #1d0a3d 60%, #0f0522 100%);
  transition:opacity 1s ease, visibility 1s;
}
#gate.gone{opacity:0;visibility:hidden;pointer-events:none}
.bud{
  --spread:.08; position:relative; width:260px;height:260px;
  transition:--spread 1.7s cubic-bezier(.2,.8,.2,1), transform 1.9s cubic-bezier(.5,0,.2,1), opacity 1.4s ease .5s;
  animation:breathe 3.2s ease-in-out infinite;
  filter:drop-shadow(0 0 28px rgba(181,123,238,.55));
}
.bud.open{--spread:1;animation:none}
#gate.opening .bud{transform:scale(5);opacity:0}
#gate.opening .gate-text{opacity:0}
.bud i{
  position:absolute;left:50%;bottom:50%;width:70px;height:124px;margin-left:-35px;
  border-radius:50% 50% 50% 50% / 82% 82% 18% 18%;
  transform-origin:50% 100%;
  transform:rotate(calc((var(--i) - 3.5)*45deg*var(--spread))) scale(calc(.8 + .2*var(--spread)));
  background:linear-gradient(to top,#6d3bd2 0%,#b57bee 55%,#f0dcff 100%);
  opacity:.92;
}
.bud i.r2{
  width:56px;height:98px;margin-left:-28px;
  transform:rotate(calc((var(--i) - 3)*45deg*var(--spread))) scale(calc(.75 + .25*var(--spread)));
  background:linear-gradient(to top,#8a4fe0 0%,#d9b8ff 60%,#fff 100%);
}
.bud .heart{
  position:absolute;left:50%;top:50%;width:26px;height:26px;margin:-13px 0 0 -13px;border-radius:50%;
  background:radial-gradient(circle at 35% 35%,#fff6d0,var(--flame) 55%,#e39a2d);
  box-shadow:0 0 30px 8px rgba(255,211,110,.55);
}
.gate-text{font-family:var(--script);font-size:clamp(1.8rem,5vw,2.6rem);letter-spacing:.02em;transition:opacity .6s;animation:pulse 2.6s ease-in-out infinite}
@keyframes breathe{50%{transform:scale(1.05)}}
@keyframes pulse{50%{opacity:.55}}

/* ---------- Hero (the one orchestrated moment) ---------- */
.hero{position:relative;min-height:100vh;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;padding:2rem 1.2rem 22vh}
.hb{
  font-family:var(--script);font-size:clamp(3.4rem,13vw,9rem);line-height:1.1;padding:.1em .25em;
  background:linear-gradient(100deg,#fff 0%,var(--lilac) 25%,var(--orchid) 50%,var(--rose) 75%,#fff 100%);
  background-size:250% 100%;-webkit-background-clip:text;background-clip:text;color:transparent;-webkit-text-fill-color:transparent;
  filter:drop-shadow(0 0 22px rgba(181,123,238,.6));
  clip-path:inset(-10% 100% -10% 0);
}
.name{margin-top:.6rem;font-size:clamp(1.5rem,5.2vw,3.2rem);font-style:italic;font-weight:500;letter-spacing:.06em;color:#fff;text-shadow:0 0 18px rgba(255,159,208,.55)}
.name span{display:inline-block;opacity:0;transform:translateY(.7em);filter:blur(8px)}
.name .sp{width:.35em}
.tagline{margin-top:1.4rem;font-size:clamp(1.1rem,3vw,1.5rem);color:var(--lilac);opacity:0}
.scroll{position:absolute;bottom:25vh;left:50%;width:26px;height:44px;margin-left:-13px;border:2px solid rgba(230,212,255,.6);border-radius:16px;opacity:0}
.scroll span{position:absolute;left:50%;top:8px;width:6px;height:6px;margin-left:-3px;border-radius:50%;background:var(--rose);animation:drip 1.8s ease-in-out infinite}
@keyframes drip{0%{transform:translateY(0);opacity:1}80%{transform:translateY(18px);opacity:0}100%{opacity:0}}

body.revealed .hb{animation:write 2.4s cubic-bezier(.6,.1,.2,1) .2s forwards, shimmer 7s linear 2.6s infinite}
body.revealed .name span{animation:rise .9s cubic-bezier(.2,.8,.2,1) forwards;animation-delay:calc(2.2s + var(--d)*.07s)}
body.revealed .tagline{animation:fade 1.6s ease 4.6s forwards}
body.revealed .scroll{animation:fade 1.2s ease 5.4s forwards}
@keyframes write{to{clip-path:inset(-10% -5% -10% 0)}}
@keyframes shimmer{to{background-position:-250% 0}}
@keyframes rise{to{opacity:1;transform:none;filter:none}}
@keyframes fade{to{opacity:1}}

/* ---------- Letter ---------- */
.script{font-family:var(--script);font-weight:400;font-size:clamp(2.4rem,7vw,4rem);text-align:center;color:#fff;text-shadow:0 0 20px rgba(181,123,238,.7)}
.letter-wrap{padding:6vh 1.1rem 8vh}
.letter{
  max-width:46rem;margin:2.2rem auto 0;padding:clamp(1.6rem,5vw,3.4rem);
  background:linear-gradient(160deg,rgba(60,24,120,.62),rgba(24,8,52,.7));
  border:1px solid rgba(214,184,255,.28);border-radius:28px 6px 28px 6px;
  box-shadow:0 20px 70px rgba(10,2,30,.6), inset 0 0 60px rgba(181,123,238,.12);
  backdrop-filter:blur(6px);-webkit-backdrop-filter:blur(6px);
}
.letter p{font-size:clamp(1.15rem,2.6vw,1.4rem);line-height:1.95;color:#f1e6ff;text-align:left;hyphens:auto}
.letter p::first-letter{font-family:var(--script);font-size:4.2em;line-height:.7;float:left;padding:.08em .12em 0 0;color:var(--rose)}

/* ---------- Candle ---------- */
.wish{padding:6vh 1rem 16vh;text-align:center}
.candle-box{display:flex;flex-direction:column;align-items:center;gap:1.4rem;margin-top:1.4rem}
.candle{width:150px;height:auto;overflow:visible}
.flame{transform-origin:60px 66px;animation:flicker 1.1s ease-in-out infinite alternate}
.flame.in{animation-duration:.8s}
.halo{transform-origin:60px 52px;animation:halo 2.2s ease-in-out infinite alternate}
.smoke{opacity:0;stroke-dasharray:80;stroke-dashoffset:80}
.candle.out .flame,.candle.out .halo{opacity:0;animation:none;transition:opacity .35s}
.candle.out .smoke{animation:smoke 2.4s ease-out forwards}
@keyframes flicker{from{transform:scale(1,1) rotate(-2deg)}to{transform:scale(.92,1.08) rotate(2.5deg)}}
@keyframes halo{from{opacity:.6;transform:scale(.95)}to{opacity:1;transform:scale(1.05)}}
@keyframes smoke{0%{opacity:.9;stroke-dashoffset:80}100%{opacity:0;stroke-dashoffset:0;transform:translateY(-26px)}}
.btn{
  font-family:var(--serif);font-size:1.3rem;font-weight:600;letter-spacing:.04em;color:#fff;cursor:pointer;
  padding:.8em 2em;border:0;border-radius:999px;
  background:linear-gradient(120deg,var(--violet),var(--orchid) 60%,var(--rose));
  box-shadow:0 8px 30px rgba(140,80,230,.5);transition:transform .25s,box-shadow .25s;
}
.btn:hover{transform:translateY(-3px) scale(1.03);box-shadow:0 14px 40px rgba(181,123,238,.65)}
.btn:active{transform:scale(.97)}
.btn.ghost{background:transparent;border:1px solid var(--orchid);box-shadow:none}
.after{min-height:5.5rem;max-width:34rem;font-family:var(--script);font-size:clamp(1.8rem,5vw,2.6rem);line-height:1.3;color:#fff;opacity:0;transition:opacity 1.6s}
.after.show{opacity:1}

.foot{text-align:center;padding:0 1rem 34vh}
.sign{font-size:clamp(1.8rem,5vw,2.8rem);line-height:1.4;margin-bottom:1.6rem}

/* ---------- Garden ---------- */
.garden{position:fixed;left:0;bottom:0;width:100%;height:30vh;min-height:190px;max-height:300px;z-index:1;pointer-events:none;opacity:0;transition:opacity 1s}
body.revealed .garden{opacity:1}
.plant{animation:sway var(--t,5s) ease-in-out infinite alternate}
@keyframes sway{from{transform:rotate(-2.2deg)}to{transform:rotate(2.2deg)}}
.stem{fill:none;stroke:#3f8a5f;stroke-width:3;stroke-linecap:round;stroke-dasharray:var(--len);stroke-dashoffset:var(--len);animation:grow 1.8s ease-out forwards;animation-delay:var(--d)}
.leaf{fill:#4aa174;opacity:0;animation:fade 1s ease forwards;animation-delay:calc(var(--d) + 1s)}
.bloom{transform-box:fill-box;transform-origin:center;transform:scale(0);animation:pop 1.4s cubic-bezier(.2,1.5,.4,1) forwards;animation-delay:calc(var(--d) + 1.5s)}
@keyframes grow{to{stroke-dashoffset:0}}
@keyframes pop{to{transform:scale(1)}}

/* ---------- Music button ---------- */
.music{position:fixed;right:1rem;bottom:1rem;z-index:60;width:48px;height:48px;border-radius:50%;cursor:pointer;color:#fff;
  border:1px solid rgba(214,184,255,.5);background:rgba(42,15,77,.75);backdrop-filter:blur(6px);display:grid;place-items:center;
  box-shadow:0 0 22px rgba(181,123,238,.5);opacity:0;pointer-events:none;transition:opacity 1s}
body.revealed .music{opacity:1;pointer-events:auto}
.music .ico-off{opacity:0}
.music.muted .ico-off{opacity:1}
.music:not(.muted){animation:beat 2.4s ease-in-out infinite}
@keyframes beat{50%{box-shadow:0 0 34px rgba(255,159,208,.75)}}

@media (max-width:520px){.bud{width:220px;height:220px}.bud i{width:60px;height:106px;margin-left:-30px}.bud i.r2{width:48px;height:84px;margin-left:-24px}.letter{border-radius:20px 4px 20px 4px}}
@media (prefers-reduced-motion:reduce){
  html{scroll-behavior:auto}
  *,*::before,*::after{animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important}
  .plant{animation:none}
}

/* ---------- Cake cutting ---------- */
.cake-sec,.gifts-sec{padding:6vh 1rem 8vh;text-align:center;display:flex;flex-direction:column;align-items:center;gap:1.4rem}
.cake{width:min(400px,88vw);height:auto;overflow:visible;filter:drop-shadow(0 18px 30px rgba(10,2,30,.55))}
.slice-wrap{transition:transform .9s cubic-bezier(.3,1.3,.5,1)}
.cake.cut .slice-wrap{transform:translate(48px,10px) rotate(9deg);transition-delay:.9s}
.cutface{opacity:0;transition:opacity .3s}
.cake.cut .cutface{opacity:1;transition-delay:.9s}
.knife{opacity:0;transform:translateY(-240px)}
.cake.cut .knife{animation:knife 1.8s ease-in-out forwards}
@keyframes knife{0%{opacity:1;transform:translateY(-240px)}45%{opacity:1;transform:translateY(72px)}65%{opacity:1;transform:translateY(72px)}100%{opacity:0;transform:translateY(-240px)}}

/* ---------- Gifts ---------- */
.gifts{display:grid;grid-template-columns:repeat(4,110px);gap:1.8rem;justify-content:center;margin-top:.6rem}
.gift{position:relative;width:110px;height:140px;background:none;border:0;cursor:pointer;color:var(--lilac);font-family:var(--serif);font-size:1.2rem;display:flex;flex-direction:column;align-items:center;justify-content:flex-end;gap:.5rem;transition:transform .3s}
.gift:hover{transform:translateY(-5px)}
.gift .g{position:relative;display:block;width:96px;height:92px}
.gift .body,.gift .lid{position:absolute;display:block;background:linear-gradient(135deg,var(--c1),var(--c2))}
.gift .body{left:8px;right:8px;bottom:0;height:62px;border-radius:6px;box-shadow:0 10px 24px rgba(10,2,30,.5)}
.gift .lid{left:0;right:0;bottom:58px;height:24px;border-radius:6px;filter:brightness(1.18);transform-origin:left bottom;transition:transform .7s cubic-bezier(.3,1.6,.5,1)}
.gift .body::after,.gift .lid::after{content:"";position:absolute;left:50%;width:9px;margin-left:-4.5px;top:0;bottom:0;background:#ffe9a8}
.gift .lid::before{content:"";position:absolute;left:50%;top:-13px;width:28px;height:17px;margin-left:-14px;border-radius:50%;border:5px solid #ffe9a8}
.gift .g::after{content:"";position:absolute;left:16px;right:16px;bottom:56px;height:0;background:linear-gradient(to top,rgba(255,233,168,.85),transparent);filter:blur(7px);transition:height .7s}
.gift.open .lid{transform:translate(-10px,-26px) rotate(-20deg)}
.gift.open .g::after{height:100px}
.stage{min-height:300px;max-width:34rem;opacity:0;transition:opacity .5s;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:.6rem}
.stage.show{opacity:1}
.hint{font-size:1.3rem;color:rgba(230,212,255,.75)}
.bouquet{width:min(300px,72vw);height:auto;overflow:visible}
.bouquet .stem{stroke-width:3.2}
.gift-note{font-family:var(--script);font-size:clamp(1.9rem,5.2vw,2.7rem);line-height:1.3;color:#fff;text-shadow:0 0 18px rgba(181,123,238,.7);padding:0 .5rem}
.balloon{position:fixed;bottom:-150px;width:54px;height:68px;border-radius:50% 50% 48% 48%;z-index:40;pointer-events:none;
  background:radial-gradient(circle at 32% 28%,rgba(255,255,255,.75) 0 9%,transparent 10%),radial-gradient(circle at 50% 40%,var(--b1),var(--b2));
  box-shadow:inset -6px -8px 14px rgba(0,0,0,.18);animation:floatUp var(--dur) ease-in var(--del) forwards}
.balloon::after{content:"";position:absolute;left:50%;top:100%;width:1px;height:70px;background:rgba(230,212,255,.6)}
@keyframes floatUp{0%{transform:translate(0,0) rotate(-3deg)}50%{transform:translate(var(--sx),-65vh) rotate(4deg)}100%{transform:translate(calc(var(--sx) * -1),-140vh) rotate(-3deg)}}
@media (max-width:520px){.gifts{grid-template-columns:repeat(2,110px)}}
