:root {
  --night-1: #0a0d24;
  --night-2: #17123c;
  --night-3: #2a1645;
  --gold: #f6c87a;
  --gold-2: #ffe3a8;
  --blush: #ff9fb6;
  --rose: #e8577e;
  --cream: #fdf3e7;
  --muted: rgba(253, 243, 231, 0.62);
  --paper: #fff8ee;
  --ink: #3b2a35;
  --serif: "Fraunces", Georgia, serif;
  --sans: "DM Sans", system-ui, sans-serif;
  --hand: "Caveat", cursive;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--sans);
  color: var(--cream);
  background: radial-gradient(120% 80% at 50% 0%, var(--night-2) 0%, var(--night-1) 55%, #06071a 100%) fixed;
  background-color: var(--night-1);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
body.locked { overflow: hidden; height: 100vh; }
body.locked main { visibility: hidden; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible { outline: 2px dashed var(--gold); outline-offset: 6px; border-radius: 8px; }
img { display: block; max-width: 100%; }

#sky, #fx { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; }
#sky { z-index: 0; }
#petals { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
#balloons { position: fixed; inset: 0; z-index: 30; pointer-events: none; overflow: hidden; }
#fx { z-index: 60; }
main { position: relative; z-index: 1; }

/* ---------- shared type ---------- */
.eyebrow {
  font-family: var(--sans);
  font-size: .78rem;
  letter-spacing: .32em;
  text-transform: uppercase;
  color: var(--gold);
  opacity: .9;
}
.section {
  min-height: 100vh;
  padding: 18vh 16px 12vh;
  display: flex; flex-direction: column; align-items: center;
  text-align: center;
}
.section__title {
  font-family: var(--serif);
  font-weight: 300;
  font-style: italic;
  font-size: clamp(2.4rem, 7vw, 4.2rem);
  line-height: 1.05;
  margin: .6rem 0 .8rem;
  font-variation-settings: "opsz" 144;
}
.section__sub { color: var(--muted); font-size: 1.02rem; max-width: 30rem; }

.shimmer {
  background: linear-gradient(100deg, var(--gold) 0%, var(--gold-2) 25%, var(--blush) 50%, var(--gold-2) 75%, var(--gold) 100%);
  background-size: 250% 100%;
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
  animation: shimmer 6s linear infinite;
}
@keyframes shimmer { to { background-position: -250% 0; } }

.reveal { opacity: 0; transform: translateY(28px); transition: opacity 1s var(--ease), transform 1s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

.btn {
  margin-top: 1.4rem;
  padding: .85rem 1.5rem;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--gold), var(--blush));
  color: #2a1530;
  font-weight: 600;
  box-shadow: 0 10px 30px -10px rgba(255, 159, 182, .6);
  transition: transform .25s var(--ease), box-shadow .25s;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 14px 34px -10px rgba(255, 159, 182, .8); }
.btn--ghost { background: rgba(255,255,255,.06); color: var(--cream); border: 1px solid rgba(255,255,255,.18); box-shadow: none; }
.btn--ghost:hover { background: rgba(255,255,255,.12); box-shadow: none; }

/* ---------- GATE ---------- */
.gate {
  position: fixed; inset: 0; z-index: 50;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 16px; text-align: center;
  transition: opacity 1.2s var(--ease), visibility 1.2s;
}
.gate.gone { opacity: 0; visibility: hidden; }
.gate__eyebrow { font-family: var(--hand); font-size: 1.7rem; color: var(--muted); }
.gate__name {
  font-family: var(--serif); font-style: italic; font-weight: 300;
  font-size: clamp(2.6rem, 10vw, 5rem); color: var(--cream);
  margin: .1rem 0 2.6rem;
}
.gate__hint { margin-top: 2.2rem; font-size: .8rem; letter-spacing: .3em; text-transform: uppercase; color: var(--muted); animation: breathe 2.4s ease-in-out infinite; }
@keyframes breathe { 50% { opacity: .35; } }

.gift { position: relative; width: 150px; height: 150px; animation: wiggle 3.2s ease-in-out infinite; }
.gift__box {
  position: absolute; left: 10px; right: 10px; bottom: 0; height: 100px;
  border-radius: 6px 6px 10px 10px;
  background:
    linear-gradient(90deg, transparent 43%, var(--gold) 43%, var(--gold-2) 50%, var(--gold) 57%, transparent 57%),
    linear-gradient(160deg, #ff7ea0, var(--rose));
  box-shadow: inset 0 -14px 24px rgba(0,0,0,.18), 0 20px 40px -10px rgba(232, 87, 126, .6);
}
.gift__lid {
  position: absolute; left: 0; right: 0; top: 22px; height: 32px; z-index: 2;
  border-radius: 6px;
  background:
    linear-gradient(90deg, transparent 43%, var(--gold) 43%, var(--gold-2) 50%, var(--gold) 57%, transparent 57%),
    linear-gradient(160deg, #ff95b0, #f0678c);
  box-shadow: 0 6px 12px rgba(0,0,0,.2);
  transition: transform .9s var(--ease), opacity .9s;
}
.gift__bow { position: absolute; left: 50%; top: -24px; width: 0; height: 0; }
.gift__bow::before, .gift__bow::after {
  content: ""; position: absolute; top: 0; width: 34px; height: 26px;
  border: 7px solid var(--gold); border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
}
.gift__bow::before { right: 0; transform: rotate(-20deg); transform-origin: right bottom; }
.gift__bow::after  { left: 0;  transform: rotate(20deg);  transform-origin: left bottom; }
.gift__glow { position: absolute; inset: -40px; z-index: -1; border-radius: 50%; background: radial-gradient(circle, rgba(246,200,122,.35), transparent 65%); animation: breathe 2.4s ease-in-out infinite; }
@keyframes wiggle { 0%, 70%, 100% { transform: rotate(0); } 75% { transform: rotate(-6deg); } 80% { transform: rotate(5deg); } 85% { transform: rotate(-4deg); } 90% { transform: rotate(2deg); } }
.gift.open { animation: none; }
.gift.open .gift__lid { transform: translate(40px, -160px) rotate(35deg); opacity: 0; }

/* ---------- HERO ---------- */
.hero {
  min-height: 100vh; min-height: 100svh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 16px; position: relative;
}
.hero__title { font-family: var(--serif); font-weight: 300; margin: 1rem 0 1.2rem; line-height: .95; }
.hero__happy { display: block; font-style: italic; font-size: clamp(2.1rem, 6.4vw, 3.6rem); color: var(--cream); margin-bottom: .5rem; line-height: 1.1; }
.hero__happy .love { color: var(--blush); font-weight: 500; text-shadow: 0 0 24px rgba(255, 159, 182, .7); }
.hero__happy .heart-beat { color: var(--rose); font-style: normal; margin-left: .25em; }
.go .heart-beat { animation: charIn 1s cubic-bezier(.2, 1.4, .4, 1) calc(var(--i) * 90ms) both, heartbeat 1.3s ease-in-out calc(1.4s + var(--i) * 90ms) infinite !important; }
@keyframes heartbeat { 0%, 100% { opacity: 1; transform: scale(1); } 15% { opacity: 1; transform: scale(1.3); } 30% { opacity: 1; transform: scale(1); } 45% { opacity: 1; transform: scale(1.18); } }
.hero__name { display: inline-block; font-weight: 500; font-size: clamp(3.4rem, 13vw, 8rem); white-space: nowrap; letter-spacing: -.02em; padding: 0 .08em .1em; font-variation-settings: "opsz" 144; }
.hero__line { font-family: var(--hand); font-size: clamp(1.5rem, 4vw, 2rem); color: var(--muted); max-width: 32rem; }
.hero .reveal:nth-child(2) { transition-delay: .2s; }
.hero .reveal:nth-child(3) { transition-delay: .5s; }
.hero .reveal:nth-child(4) { transition-delay: .8s; }

.counter { margin-top: 2.6rem; display: flex; flex-wrap: wrap; justify-content: center; gap: .6rem; max-width: 34rem; }
.counter__item {
  min-width: 76px; padding: .8rem .6rem .6rem;
  border-radius: 14px;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.1);
  backdrop-filter: blur(6px);
  display: flex; flex-direction: column; align-items: center;
}
.counter__num { font-family: var(--serif); font-size: 1.7rem; font-variant-numeric: tabular-nums; color: var(--gold-2); }
.counter__lbl { font-size: .68rem; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }
.counter__cap { width: 100%; font-family: var(--hand); font-size: 1.35rem; color: var(--blush); margin-top: .3rem; }

.scroll-cue { position: absolute; bottom: 28px; left: 50%; width: 26px; height: 42px; margin-left: -13px; border: 2px solid rgba(255,255,255,.35); border-radius: 14px; }
.scroll-cue span { position: absolute; left: 50%; top: 8px; width: 4px; height: 8px; margin-left: -2px; border-radius: 2px; background: var(--gold); animation: cue 1.8s ease-in-out infinite; }
@keyframes cue { 0% { opacity: 0; transform: translateY(0); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateY(14px); } }

/* ---------- CONSTELLATION ---------- */
.constellation { position: relative; width: min(460px, 100%); margin-top: 1.6rem; }
.constellation svg { width: 100%; height: auto; overflow: visible; touch-action: manipulation; }
.c-star { cursor: pointer; transform-box: fill-box; transform-origin: center; outline: none; }
.c-star .core { fill: #fff; transition: r .3s, fill .3s; }
.c-star .halo { fill: var(--gold); opacity: 0; }
.c-star .hit { fill: transparent; }
.c-star.next .halo { animation: pulse 1.4s ease-in-out infinite; }
.c-star.next .core { fill: var(--gold-2); }
.c-star.done .core { fill: var(--gold); }
.c-star.done { cursor: default; }
@keyframes pulse { 0%, 100% { opacity: .1; r: 2; } 50% { opacity: .5; r: 4.2; } }
.c-line { stroke: var(--gold-2); stroke-width: .5; stroke-linecap: round; filter: url(#glow); }
#heartPath { transition: opacity 2s ease; }
.constellation.complete #heartPath { opacity: 1; }
.constellation.complete .c-line { stroke: var(--blush); transition: stroke 1.5s; }
.constellation__msg {
  font-family: var(--hand); font-size: clamp(1.6rem, 4.5vw, 2.1rem); color: var(--cream);
  margin-top: 1rem; min-height: 2.6em;
  opacity: 0; transform: translateY(10px); transition: opacity 1.4s .6s, transform 1.4s .6s var(--ease);
}
.constellation.complete .constellation__msg { opacity: 1; transform: none; }

/* ---------- POLAROIDS ---------- */
.polaroids {
  margin-top: 2.6rem;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 2.4rem 1.8rem;
  width: min(860px, 100%);
}
.polaroid {
  position: relative; aspect-ratio: 4 / 5; cursor: zoom-in;
  background: var(--paper); border-radius: 4px;
  padding: 10px 10px 0;
  display: flex; flex-direction: column;
  box-shadow: 0 18px 40px -14px rgba(0,0,0,.7), 0 2px 6px rgba(0,0,0,.3);
  transform: perspective(800px) rotate(var(--r)) rotateX(var(--ty, 0deg)) rotateY(var(--tx, 0deg));
  transition: transform .9s cubic-bezier(.34, 1.56, .64, 1), opacity .5s, box-shadow .3s;
}
.polaroid.reveal { opacity: 0; transform: translateY(-180px) rotate(calc(var(--r) * -6)) scale(.8); }
.polaroid.reveal.in { opacity: 1; transform: perspective(800px) rotate(var(--r)) rotateX(var(--ty, 0deg)) rotateY(var(--tx, 0deg)); }
.polaroid.tilting { transition-duration: .15s; z-index: 2; box-shadow: 0 30px 60px -18px rgba(0,0,0,.8), 0 0 40px -10px rgba(255,159,182,.45); }
.polaroid__photo { flex: 1; border-radius: 2px; overflow: hidden; position: relative; background: #2a2340; }
.polaroid__photo img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; transition: transform .8s var(--ease); }
.polaroid:hover .polaroid__photo img { transform: scale(1.07); }
.polaroid__photo::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(circle at var(--mx, 50%) var(--my, 0%), rgba(255,255,255,.35), transparent 55%);
  opacity: 0; transition: opacity .3s;
}
.polaroid.tilting .polaroid__photo::after { opacity: 1; }
.polaroid__cap { font-family: var(--hand); font-size: 1.45rem; color: var(--ink); padding: .45rem 0 .55rem; line-height: 1.1; }
.polaroid .tape {
  position: absolute; top: -12px; left: 50%; width: 84px; height: 26px; margin-left: -42px; z-index: 3;
  background: rgba(255, 236, 200, .55); transform: rotate(-3deg);
  box-shadow: 0 1px 3px rgba(0,0,0,.15);
}

/* ---------- JAR ---------- */
.jar-wrap { margin-top: 2.4rem; display: flex; align-items: center; justify-content: center; gap: 3rem; flex-wrap: wrap; width: min(820px, 100%); }
.jar { position: relative; width: 190px; height: 250px; transition: transform .3s var(--ease); }
.jar:hover { transform: rotate(-3deg); }
.jar.shake { animation: jarShake .5s; }
@keyframes jarShake { 25% { transform: rotate(-7deg); } 50% { transform: rotate(6deg); } 75% { transform: rotate(-3deg); } }
.jar__lid {
  position: absolute; top: 0; left: 34px; right: 34px; height: 30px; z-index: 2;
  border-radius: 8px 8px 4px 4px;
  background: repeating-linear-gradient(90deg, #d9a85e 0 6px, #c08c45 6px 8px);
  box-shadow: 0 4px 8px rgba(0,0,0,.3);
}
.jar__glass {
  position: absolute; top: 24px; left: 10px; right: 10px; bottom: 0;
  border-radius: 34px 34px 40px 40px;
  background: linear-gradient(100deg, rgba(255,255,255,.18) 0%, rgba(255,255,255,.04) 30%, rgba(255,255,255,.02) 70%, rgba(255,255,255,.14) 100%);
  border: 2px solid rgba(255,255,255,.28);
  overflow: hidden;
  box-shadow: inset 0 0 30px rgba(255,255,255,.06), 0 20px 50px -20px rgba(246,200,122,.35);
}
.jar__glass::after { content: ""; position: absolute; top: 18px; left: 18px; width: 12px; height: 120px; border-radius: 10px; background: rgba(255,255,255,.22); }
.jar__notes { position: absolute; inset: 0; }
.jar__notes i {
  position: absolute; width: 34px; height: 20px; border-radius: 3px;
  box-shadow: 0 2px 4px rgba(0,0,0,.25);
  transition: opacity .4s, transform .4s;
}
.jar__notes i.gone { opacity: 0; transform: translateY(-60px) scale(.5); }

.note-stage { width: min(340px, 100%); min-height: 240px; display: flex; align-items: center; justify-content: center; perspective: 900px; }
.note {
  width: 100%; padding: 2rem 1.6rem 1.4rem;
  background: var(--paper); color: var(--ink);
  border-radius: 6px;
  box-shadow: 0 24px 50px -18px rgba(0,0,0,.7);
  transform-origin: top center;
  position: relative;
}
.note::before { content: ""; position: absolute; top: -10px; left: 50%; width: 70px; height: 22px; margin-left: -35px; background: rgba(255, 159, 182, .55); transform: rotate(2deg); }
.note.pop { animation: notePop .75s var(--ease); }
@keyframes notePop { 0% { transform: translate(-120px, 40px) scale(.2) rotateX(80deg); opacity: 0; } 60% { opacity: 1; } 100% { transform: none; opacity: 1; } }
.note__text { font-family: var(--hand); font-size: 1.85rem; line-height: 1.15; }
.note__count { margin-top: 1rem; font-size: .72rem; letter-spacing: .25em; text-transform: uppercase; color: #a3868f; }

/* ---------- ENVELOPE & LETTER ---------- */
.envelope-wrap { margin-top: 3rem; transition: opacity .8s, transform .8s var(--ease); }
.envelope-wrap.away { opacity: 0; transform: translateY(40px) scale(.9); pointer-events: none; }
.envelope { position: relative; width: min(340px, 82vw); aspect-ratio: 3 / 2; perspective: 1000px; animation: float 4s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-8px); } }
.envelope > span { position: absolute; }
.envelope__back { inset: 0; border-radius: 8px; background: #e7b7a2; }
.envelope__paper {
  left: 6%; right: 6%; top: 8%; bottom: 8%; border-radius: 4px;
  background: repeating-linear-gradient(transparent 0 14px, rgba(0,0,0,.05) 14px 15px), var(--paper);
  transition: transform 1s .5s var(--ease);
}
.envelope__front {
  inset: 0; border-radius: 8px;
  background:
    linear-gradient(to top right, #f2c8b4 50%, transparent 50.5%) left / 50.5% 100% no-repeat,
    linear-gradient(to top left, #f2c8b4 50%, transparent 50.5%) right / 50.5% 100% no-repeat;
  box-shadow: 0 30px 60px -24px rgba(0,0,0,.8);
  z-index: 2;
}
.envelope__flap {
  left: 0; right: 0; top: 0; height: 58%; z-index: 3;
  background: #f7d5c4;
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  transform-origin: top center;
  transition: transform .8s var(--ease), z-index 0s .4s;
  filter: drop-shadow(0 3px 2px rgba(0,0,0,.1));
}
.envelope__seal {
  left: 50%; top: 58%; z-index: 4; width: 52px; height: 52px; margin: -26px 0 0 -26px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #f07a99, #b8284f 70%);
  color: #ffd3dd; font-size: 1.4rem; line-height: 52px; text-align: center;
  box-shadow: 0 4px 10px rgba(0,0,0,.35), inset 0 -3px 6px rgba(0,0,0,.25);
  transition: transform .5s var(--ease), opacity .5s;
}
.envelope.open { animation: none; }
.envelope.open .envelope__seal { transform: scale(1.6); opacity: 0; }
.envelope.open .envelope__flap { transform: rotateX(180deg); z-index: 1; }
.envelope.open .envelope__paper { transform: translateY(-45%); }

.letter {
  margin-top: 2rem; width: min(620px, 100%);
  background:
    radial-gradient(120% 100% at 0 0, rgba(255, 220, 200, .35), transparent 60%),
    var(--paper);
  color: var(--ink); text-align: left;
  padding: clamp(1.8rem, 6vw, 3.4rem);
  border-radius: 6px;
  box-shadow: 0 40px 80px -30px rgba(0,0,0,.85);
  animation: letterIn 1.1s var(--ease);
}
@keyframes letterIn { from { opacity: 0; transform: translateY(60px) rotate(-1.5deg); } to { opacity: 1; transform: none; } }
.letter__greet { font-family: var(--hand); font-size: 2.2rem; margin-bottom: 1rem; color: var(--rose); }
.letter p.line { font-family: var(--serif); font-size: 1.12rem; line-height: 1.75; margin-bottom: 1.1rem; opacity: 0; transform: translateY(8px); transition: opacity 1.2s, transform 1.2s var(--ease); }
.letter p.line.in { opacity: 1; transform: none; }
.letter__sign { font-family: var(--hand); font-size: 1.7rem; margin-top: 1.6rem; text-align: right; line-height: 1.2; }
.letter__name { font-size: 2.3rem; color: var(--rose); }

/* ---------- CAKE ---------- */
.cake-wrap { margin-top: 4.5rem; }
.cake { position: relative; width: 260px; height: 230px; }
.cake__plate { position: absolute; bottom: 0; left: -30px; right: -30px; height: 18px; border-radius: 50%; background: linear-gradient(#f5ede6, #cbbdb3); box-shadow: 0 16px 30px -8px rgba(0,0,0,.6); }
.cake__layer { position: absolute; left: 0; right: 0; border-radius: 10px; }
.cake__layer--2 { bottom: 9px; height: 90px; background: linear-gradient(90deg, #d6627f, #f4889f 45%, #d6627f); }
.cake__layer--1 { bottom: 92px; left: 18px; right: 18px; height: 72px; background: linear-gradient(90deg, #f3d9b1, #fff1d6 45%, #f3d9b1); }
.cake__layer--2::after { content: ""; position: absolute; left: 0; right: 0; top: 40px; height: 10px; background: repeating-radial-gradient(circle at 10px 5px, #fff6e6 0 4px, transparent 4.5px 20px); background-size: 20px 10px; opacity: .9; }
.drip { position: absolute; left: -2px; right: -2px; top: 0; height: 26px; border-radius: 10px 10px 0 0;
  background:
    radial-gradient(circle at 12px 18px, #ff9fb6 9px, transparent 9.5px) 0 0 / 38px 30px repeat-x,
    linear-gradient(#ff9fb6, #ff9fb6) top / 100% 14px no-repeat;
}
.cake__top { position: absolute; bottom: 156px; left: 18px; right: 18px; height: 16px; border-radius: 50%; background: #ffb2c4; }
.cake__candles { position: absolute; bottom: 162px; left: 30px; right: 30px; height: 60px; display: flex; justify-content: space-evenly; align-items: flex-end; z-index: 2; }
.candle { position: relative; width: 12px; height: 46px; border-radius: 3px; background: repeating-linear-gradient(135deg, #fff 0 6px, #8fc7ff 6px 12px); cursor: pointer; }
.candle::before { content: ""; position: absolute; left: 50%; top: -8px; width: 2px; height: 8px; margin-left: -1px; background: #4b3b3b; }
.candle--num { width: auto; height: auto; background: none; justify-content: center; display: flex; margin: 0 -4px; }
.candle--num + .candle--num { margin-left: -2px; }
.digit {
  display: block; font-family: var(--serif); font-weight: 500; font-size: 112px; line-height: .78;
  background: repeating-linear-gradient(135deg, #fff 0 10px, #ff8fab 10px 20px);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  -webkit-text-stroke: 1.5px rgba(232, 87, 126, .55);
  filter: drop-shadow(0 4px 6px rgba(0,0,0,.25));
  padding-top: 4px;
}
.candle--num .flame { top: -40px; }
.candle--num::before { top: -9px; }
.candle .hit { position: absolute; left: -16px; right: -16px; top: -56px; bottom: 0; }
.flame {
  position: absolute; left: 50%; top: -38px; width: 16px; height: 30px; margin-left: -8px;
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  background: radial-gradient(ellipse at 50% 80%, #fff 0 20%, #ffe07a 35%, #ff9a3c 70%, transparent 72%);
  transform-origin: 50% 100%;
  animation: flicker .14s ease-in-out infinite alternate;
  filter: drop-shadow(0 0 10px rgba(255, 190, 90, .9));
  transition: opacity .3s, transform .3s;
}
.flame::after { content: ""; position: absolute; inset: -30px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 200, 120, .35), transparent 60%); pointer-events: none; }
@keyframes flicker { from { transform: scale(1, 1) rotate(-2deg); } to { transform: scale(.94, 1.06) rotate(2deg); } }
.candle.out .flame { opacity: 0; transform: scale(.2, .6); animation: none; }
.candle.out { cursor: default; }
.smoke { position: absolute; left: 50%; top: -20px; width: 8px; height: 8px; margin-left: -4px; border-radius: 50%; background: rgba(220,220,230,.5); animation: smoke 1.6s ease-out forwards; pointer-events: none; }
@keyframes smoke { to { transform: translate(10px, -60px) scale(4); opacity: 0; } }
#micBtn { margin-top: 2.4rem; }
#micBtn.listening { border-color: var(--blush); color: var(--blush); }

/* ---------- FINALE ---------- */
.finale { justify-content: center; min-height: 90vh; padding-top: 10vh; }
.finale__title { font-family: var(--serif); font-weight: 500; font-style: italic; font-size: clamp(2.6rem, 9vw, 6rem); line-height: 1.02; padding-bottom: .1em; }
.finale__msg { font-family: var(--hand); font-size: clamp(1.6rem, 4.5vw, 2.3rem); max-width: 34rem; margin-top: 1.4rem; color: var(--cream); }
.finale__actions { display: flex; flex-wrap: wrap; gap: .8rem; justify-content: center; margin-top: 1rem; }
.finale > *:not(.mosaic) { animation: rise 1.4s var(--ease) both; }
.finale__msg { animation-delay: 1.8s !important; }
.finale__actions { animation-delay: 2.4s !important; }
@keyframes rise { from { opacity: 0; transform: translateY(30px); } }

.foot { position: relative; z-index: 1; text-align: center; padding: 3rem 16px 4rem; font-family: var(--hand); font-size: 1.3rem; color: var(--muted); }

/* ---------- MUSIC ---------- */
.music {
  position: fixed; right: 18px; bottom: 18px; z-index: 40;
  width: 52px; height: 52px; border-radius: 50%;
  background: rgba(20, 16, 50, .7); border: 1px solid rgba(255,255,255,.2);
  backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
}
.music__bars { display: flex; gap: 3px; align-items: flex-end; height: 18px; }
.music__bars i { width: 3px; height: 4px; background: var(--gold); border-radius: 2px; }
.music.playing .music__bars i { animation: bars .9s ease-in-out infinite alternate; }
.music.playing .music__bars i:nth-child(2) { animation-delay: -.3s; }
.music.playing .music__bars i:nth-child(3) { animation-delay: -.6s; }
.music.playing .music__bars i:nth-child(4) { animation-delay: -.15s; }
@keyframes bars { from { height: 4px; } to { height: 18px; } }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 760px) {
  .polaroids { grid-template-columns: repeat(2, 1fr); gap: 1.8rem 1.1rem; }
  .polaroid__cap { font-size: 1.2rem; }
  .jar-wrap { gap: 1.6rem; }
  .counter__item { min-width: 68px; }
  .section { padding-top: 14vh; }
}
@media (max-width: 380px) {
  .cake { transform: scale(.86); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .2s !important; }
  html { scroll-behavior: auto; }
}

/* =================================================================
   EXTRA MAGIC
   ================================================================= */

/* ---------- hero portrait ---------- */
.portrait { position: relative; width: min(290px, 68vw); aspect-ratio: 1; margin-bottom: .2rem; }
.portrait.reveal { transform: scale(.6) rotate(-20deg); transition-duration: 1.6s; }
.portrait.reveal.in { transform: none; }
.portrait__ring { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; animation: spin 26s linear infinite; }
.portrait__ring text { font-family: var(--sans); font-weight: 600; font-size: 14px; letter-spacing: 3px; fill: var(--gold); text-transform: uppercase; }
@keyframes spin { to { transform: rotate(360deg); } }
.portrait__photo {
  position: absolute; inset: 15%; border-radius: 50%; overflow: hidden;
  box-shadow: 0 0 0 3px rgba(246,200,122,.75), 0 0 0 11px rgba(246,200,122,.08), 0 0 70px rgba(255,159,182,.5);
  animation: haloPulse 3.2s ease-in-out infinite;
  background: #2a2340;
}
.portrait__photo img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 22%; animation: kenburns 16s ease-in-out infinite alternate; }
@keyframes kenburns { from { transform: scale(1.05) translate(0, 0); } to { transform: scale(1.22) translate(-3%, 4%); } }
@keyframes haloPulse { 50% { box-shadow: 0 0 0 3px rgba(246,200,122,.95), 0 0 0 16px rgba(246,200,122,.05), 0 0 100px rgba(255,159,182,.75); } }
.portrait__sparkle { position: absolute; color: var(--gold-2); text-shadow: 0 0 12px var(--gold); animation: twinkle 2.2s ease-in-out infinite; }
.portrait__sparkle.s1 { top: 6%; right: 8%; font-size: 1.6rem; }
.portrait__sparkle.s2 { bottom: 10%; left: 4%; font-size: 1.1rem; animation-delay: -.8s; }
.portrait__sparkle.s3 { top: 40%; left: -4%; font-size: 1.3rem; color: var(--blush); animation-delay: -1.4s; }
@keyframes twinkle { 0%, 100% { opacity: .2; transform: scale(.6) rotate(0); } 50% { opacity: 1; transform: scale(1.2) rotate(45deg); } }

.hero__title { margin-top: .6rem; }
.hero__title .ch {
  display: inline-block; opacity: 0;
  text-shadow: 0 0 30px rgba(255, 159, 182, .35);
}
.go .ch {
  animation: charIn 1s cubic-bezier(.2, 1.4, .4, 1) calc(var(--i) * 90ms) both, wave 3.4s ease-in-out calc(1.6s + var(--i) * 120ms) infinite;
}
@keyframes charIn {
  0% { opacity: 0; transform: translateY(70%) rotate(18deg) scale(.4); filter: blur(10px); }
  100% { opacity: 1; transform: none; filter: blur(0); }
}
@keyframes wave { 0%, 100% { opacity: 1; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-8px); } }
.hero { padding-bottom: 96px; padding-top: 48px; }
.hero__tip { margin-top: 1.4rem; font-size: .85rem; color: var(--muted); letter-spacing: .05em; }

/* ---------- petals ---------- */
.petal {
  position: absolute; top: -40px; left: var(--x);
  width: var(--s); height: var(--s);
  border-radius: 150% 0 150% 0;
  background: linear-gradient(135deg, #ffd1dc, #ff8fab);
  opacity: .75;
  animation: fall var(--d) linear var(--delay) infinite;
}
@keyframes fall {
  0%   { transform: translate(0, 0) rotate(0deg); }
  25%  { transform: translate(40px, 27vh) rotate(90deg); }
  50%  { transform: translate(-20px, 55vh) rotate(200deg); }
  75%  { transform: translate(35px, 82vh) rotate(290deg); }
  100% { transform: translate(0, 112vh) rotate(380deg); }
}

/* ---------- balloons ---------- */
.balloon {
  position: absolute; bottom: -150px; left: var(--x);
  width: 58px; height: 72px; pointer-events: auto; cursor: pointer;
  border-radius: 50% 50% 48% 52% / 58% 58% 42% 42%;
  background: radial-gradient(circle at 32% 28%, rgba(255,255,255,.75) 0 6%, var(--c) 32%, var(--c2) 100%);
  box-shadow: inset -6px -8px 14px rgba(0,0,0,.18);
  animation: rise var(--d) linear forwards;
  -webkit-tap-highlight-color: transparent;
}
.balloon::before { content: ""; position: absolute; left: 50%; bottom: -10px; margin-left: -5px; border: 5px solid transparent; border-bottom: 7px solid var(--c2); }
.balloon::after { content: ""; position: absolute; left: 50%; top: 100%; width: 1px; height: 70px; background: rgba(255,255,255,.45); margin-top: 4px; }
.balloon.popped { animation: pop .22s ease-out forwards; pointer-events: none; }
@keyframes rise {
  0%   { transform: translate(0, 0) rotate(-4deg); }
  25%  { transform: translate(22px, -32vh) rotate(4deg); }
  50%  { transform: translate(-14px, -64vh) rotate(-3deg); }
  75%  { transform: translate(18px, -96vh) rotate(3deg); }
  100% { transform: translate(0, calc(-100vh - 320px)) rotate(-2deg); }
}
@keyframes pop { to { transform: var(--t, none) scale(1.6); opacity: 0; } }

/* ---------- scratch card ---------- */
.scratch {
  position: relative; margin-top: 2.4rem;
  width: min(330px, 86vw); aspect-ratio: 3 / 4;
  border-radius: 20px; overflow: hidden;
  box-shadow: 0 30px 70px -24px rgba(0,0,0,.85), 0 0 0 1px rgba(246,200,122,.35), 0 0 50px -10px rgba(246,200,122,.35);
}
.scratch__under { position: absolute; inset: 0; }
.scratch__under img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 20%; }
.scratch__text {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 4rem 1.2rem 1.4rem;
  background: linear-gradient(transparent, rgba(10, 6, 26, .88));
}
.scratch__title { font-family: var(--serif); font-style: italic; font-size: 1.5rem; line-height: 1.1; color: var(--gold-2); }
.scratch__msg { font-family: var(--hand); font-size: 1.6rem; color: var(--cream); margin-top: .3rem; }
.scratch__foil { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: grab; transition: opacity 1.2s var(--ease); }
.scratch.done .scratch__foil { opacity: 0; pointer-events: none; }
.scratch.done { animation: cardGlow 2.4s ease-in-out infinite; }
@keyframes cardGlow { 50% { box-shadow: 0 30px 70px -24px rgba(0,0,0,.85), 0 0 0 2px rgba(255,159,182,.7), 0 0 80px -6px rgba(255,159,182,.6); } }

/* ---------- photo viewer ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 70;
  display: flex; align-items: center; justify-content: center; gap: 1rem;
  padding: 16px;
  background: rgba(5, 6, 20, .9);
  backdrop-filter: blur(10px);
  animation: fadeIn .35s ease;
}
@keyframes fadeIn { from { opacity: 0; } }
.lightbox__card {
  background: var(--paper); padding: 12px 12px 0; border-radius: 6px;
  width: min(460px, 100%);
  box-shadow: 0 40px 90px -20px rgba(0,0,0,.9);
  animation: cardIn .55s cubic-bezier(.34, 1.56, .64, 1);
}
.lightbox__card.swap { animation: cardSwap .45s var(--ease); }
@keyframes cardIn { from { opacity: 0; transform: scale(.7) rotate(-8deg) translateY(40px); } }
@keyframes cardSwap { from { opacity: 0; transform: translateX(var(--dir, 40px)) rotate(4deg); } }
.lightbox__card img { width: 100%; max-height: 62vh; object-fit: contain; background: #1c1730; border-radius: 2px; }
.lightbox__card figcaption { padding: .7rem .4rem 1rem; text-align: center; }
.lightbox__cap { font-family: var(--hand); font-size: 1.9rem; color: var(--rose); line-height: 1; }
.lightbox__note { font-family: var(--hand); font-size: 1.4rem; color: var(--ink); line-height: 1.15; margin-top: .35rem; }
.lightbox__nav, .lightbox__close {
  flex: none; width: 48px; height: 48px; border-radius: 50%;
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.2);
  font-size: 1.8rem; line-height: 1; color: var(--cream);
  display: flex; align-items: center; justify-content: center;
  transition: background .2s;
}
.lightbox__nav:hover, .lightbox__close:hover { background: rgba(255,255,255,.18); }
.lightbox__close { position: absolute; top: 16px; right: 16px; z-index: 2; }
.lightbox__count { position: absolute; bottom: 16px; left: 0; right: 0; text-align: center; font-size: .75rem; letter-spacing: .3em; color: var(--muted); }

/* ---------- heart mosaic ---------- */
.mosaic {
  --cell: min(46px, calc((100vw - 64px) / 9));
  display: grid; grid-template-columns: repeat(9, var(--cell)); grid-auto-rows: var(--cell); gap: 4px;
  margin: 2.2rem 0 .6rem;
  filter: drop-shadow(0 0 30px rgba(255, 159, 182, .45));
}
.mosaic.beat { animation: beat 1.6s ease-in-out infinite; }
.mosaic i { display: block; border-radius: 7px; background: center / cover no-repeat; opacity: 0; transform: scale(0) rotate(-40deg); }
.mosaic i.empty { visibility: hidden; }
.mosaic.go i { animation: tileIn .7s cubic-bezier(.34, 1.56, .64, 1) calc(var(--i) * 40ms) forwards; }
@keyframes tileIn { to { opacity: 1; transform: none; } }
@keyframes beat { 0%, 40%, 100% { transform: scale(1); } 12% { transform: scale(1.07); } 26% { transform: scale(1.03); } }

@media (max-width: 760px) {
  .lightbox { flex-wrap: wrap; align-content: center; }
  .lightbox__card { order: 1; }
  .lightbox__nav--prev { order: 2; }
  .lightbox__nav--next { order: 3; }
  .lightbox__count { bottom: 10px; }
  .balloon { width: 48px; height: 60px; }
}
@media (prefers-reduced-motion: reduce) {
  .petal, .balloon { display: none; }
}
