/* ============ base ============ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --ink: #3b2433;
  --rose: #9c2f4f;
  --cream: #fdf6ec;
  --glow: #ffd6dc;
}

html, body {
  height: 100%;
  overflow: hidden;
  background: #160d26;
  color: #fff3ea;
  font-family: 'Cormorant Garamond', Georgia, serif;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
  overscroll-behavior: none;
}

button { font: inherit; color: inherit; }

/* ============ background ============ */
.sky { position: fixed; inset: 0; z-index: 0; }
.sky-layer { position: absolute; inset: 0; opacity: 0; transition: opacity 2.4s ease; }
.sky-layer.on { opacity: 1; }
[data-mood="night"]  { background: radial-gradient(130% 85% at 50% 110%, #7a3358 0%, #3a1a3f 45%, #160d26 100%); }
[data-mood="gold"]   { background: radial-gradient(130% 85% at 50% 110%, #f3a96f 0%, #b24f60 42%, #3a1838 100%); }
[data-mood="storm"]  { background: radial-gradient(130% 85% at 50% 110%, #3c4a68 0%, #1f2a44 45%, #0b1020 100%); }
[data-mood="warm"]   { background: radial-gradient(130% 85% at 50% 108%, #c46e5e 0%, #5d2b40 45%, #1d1020 100%); }
[data-mood="dream"]  { background: radial-gradient(130% 85% at 50% 110%, #c36d98 0%, #4f3a7c 45%, #171633 100%); }
[data-mood="rose"]   { background: radial-gradient(130% 85% at 50% 110%, #f4a3ad 0%, #a63d63 42%, #33122b 100%); }
[data-mood="candle"] { background: radial-gradient(90% 70% at 50% 58%, #5a2c26 0%, #22121a 55%, #09060b 100%); }

#fx { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 1; pointer-events: none; }

.grain {
  position: fixed; inset: 0; z-index: 2; pointer-events: none; opacity: .08; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

#dim {
  position: fixed; inset: 0; z-index: 2; pointer-events: none;
  background: #000; opacity: 0; transition: opacity 1.4s ease;
}
#dim.on { opacity: .75; }

/* ============ scenes ============ */
#app { position: fixed; inset: 0; z-index: 3; }

.scene {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; justify-content: safe center;
  gap: 1.3rem;
  padding: max(1.2rem, env(safe-area-inset-top)) 1.1rem max(1.2rem, env(safe-area-inset-bottom));
  overflow-x: hidden; overflow-y: auto;
  opacity: 0; visibility: hidden; transform: scale(.97);
  transition: opacity .9s ease, transform 1.1s ease, visibility 0s linear .9s;
}
.scene.active {
  opacity: 1; visibility: visible; transform: none;
  transition: opacity 1.2s ease .35s, transform 1.4s ease .35s, visibility 0s;
}

.scene-title {
  font-family: 'Caveat', cursive;
  font-size: clamp(1.5rem, 5.6vw, 2.1rem);
  text-align: center; max-width: 22ch; line-height: 1.2;
  color: var(--glow);
  text-shadow: 0 2px 20px rgba(0,0,0,.35);
}

/* ============ buttons / hints ============ */
.btn {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic; font-weight: 500;
  font-size: 1.25rem; line-height: 1; letter-spacing: .02em;
  color: #3b1a2c;
  background: linear-gradient(180deg, #fff6ee, #f6d6cb);
  border: 0; border-radius: 999px;
  padding: .9rem 1.7rem;
  box-shadow: 0 10px 34px -8px rgba(255, 160, 170, .65), inset 0 -2px 0 rgba(0,0,0,.08);
  cursor: pointer;
  transition: transform .2s ease, opacity .7s ease, box-shadow .3s ease;
}
.btn:hover { box-shadow: 0 12px 40px -6px rgba(255, 170, 180, .85), inset 0 -2px 0 rgba(0,0,0,.08); }
.btn:active { transform: scale(.95); }
.btn.ghost {
  background: rgba(255, 240, 235, .1);
  color: #fff3ea;
  box-shadow: inset 0 0 0 1px rgba(255, 235, 230, .45);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.btn:disabled { opacity: .6; cursor: default; }

.hint { font-style: italic; font-size: 1.1rem; opacity: .8; text-align: center; }
.hint.tiny { font-size: .95rem; opacity: .55; }
.pulse { animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }

.reveal { transition: opacity .8s ease, transform .8s ease; }
.reveal:not(.in) { opacity: 0; pointer-events: none; transform: translateY(8px); }

.sound-btn {
  position: fixed; z-index: 20;
  top: max(.9rem, env(safe-area-inset-top)); right: .9rem;
  width: 42px; height: 42px; border-radius: 50%;
  border: 0; cursor: pointer;
  background: rgba(255,240,235,.12);
  box-shadow: inset 0 0 0 1px rgba(255,235,230,.35);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  font-size: 1.3rem; color: #fff3ea;
  display: grid; place-items: center;
}
.sound-btn .note { display: inline-block; animation: bob 2s ease-in-out infinite; }
.sound-btn.muted .note { animation: none; opacity: .45; }
.sound-btn.muted::after {
  content: ''; position: absolute; width: 22px; height: 2px; background: #fff3ea; opacity: .7;
  transform: rotate(-45deg); border-radius: 2px;
}
@keyframes bob { 50% { transform: translateY(-3px) rotate(-6deg); } }

/* ============ intro ============ */
.intro-lines { text-align: center; display: flex; flex-direction: column; gap: .5rem; }
.intro-line {
  font-family: 'Caveat', cursive;
  font-size: clamp(1.6rem, 6vw, 2.3rem);
  opacity: 0; transform: translateY(12px); filter: blur(6px);
  transition: opacity 1.4s ease, transform 1.4s ease, filter 1.4s ease;
}
.intro-line:first-child {
  font-family: 'Great Vibes', cursive;
  font-size: clamp(2.3rem, 9vw, 3.4rem);
  color: var(--glow);
  margin-bottom: .6rem;
  text-shadow: 0 0 24px rgba(255, 150, 180, .5);
}
.intro-line.in { opacity: 1; transform: none; filter: none; }

/* ============ envelope ============ */
.env-float { animation: float 5s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-10px) rotate(.6deg); } }

.envelope {
  --w: min(86vw, 400px);
  width: var(--w); height: calc(var(--w) * .66);
  position: relative;
  perspective: 1400px;
  filter: drop-shadow(0 30px 40px rgba(0,0,0,.45));
  margin-top: calc(var(--w) * .25);
  cursor: pointer;
}
.envelope.wiggle { animation: wiggle .5s ease; }
@keyframes wiggle { 20% { transform: rotate(-3deg); } 40% { transform: rotate(3deg); } 60% { transform: rotate(-2deg); } 80% { transform: rotate(1deg); } }

.env-back { position: absolute; inset: 0; background: #c99d86; border-radius: 6px; }

.env-letter {
  position: absolute; left: 6%; right: 6%; top: 5%; height: 90%;
  z-index: 2; border-radius: 3px;
  background:
    radial-gradient(circle at 20% 20%, rgba(255,255,255,.7), transparent 60%),
    var(--cream);
  box-shadow: 0 -2px 8px rgba(0,0,0,.1);
  display: grid; place-items: start center; padding-top: 6%;
  transition: transform 1.4s cubic-bezier(.3,.7,.2,1);
}
.env-letter-heart { font-size: calc(var(--w) * .09); color: var(--rose); opacity: .7; }
.envelope.out .env-letter { transform: translateY(-64%); }

.env-pocket {
  position: absolute; inset: 0; z-index: 3; border-radius: 6px;
  background: linear-gradient(165deg, #f4e0cf, #e8c8b2);
  clip-path: polygon(0 0, 50% 56%, 100% 0, 100% 100%, 0 100%);
}
.env-pocket::before, .env-pocket::after { content: ''; position: absolute; inset: 0; }
.env-pocket::before { background: linear-gradient(100deg, rgba(120,70,50,.12), transparent 60%); clip-path: polygon(0 0, 50% 56%, 0 100%); }
.env-pocket::after  { background: linear-gradient(260deg, rgba(120,70,50,.12), transparent 60%); clip-path: polygon(100% 0, 50% 56%, 100% 100%); }

.env-to {
  position: absolute; left: 0; right: 0; bottom: 3%; z-index: 1;
  text-align: center; line-height: 1;
  font-family: 'Great Vibes', cursive;
  font-size: calc(var(--w) * .075);
  color: #8a3b4f;
}

.env-flap {
  position: absolute; left: 0; right: 0; top: 0; height: 62%;
  z-index: 4; transform-origin: top center;
  background: linear-gradient(180deg, #efd5c1, #dcb59c);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  transition: transform 1s cubic-bezier(.5,0,.3,1), z-index 0s linear .5s;
}
.envelope.open .env-flap { transform: rotateX(180deg); z-index: 1; }

.seal {
  position: absolute; left: 50%; top: 62%; z-index: 6;
  width: calc(var(--w) * .21); aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border: 0; background: none; padding: 0; cursor: pointer;
}
.seal::before {
  content: ''; position: absolute; inset: -14%; border-radius: 50%;
  border: 2px solid rgba(255, 215, 215, .7);
  animation: ring 2.2s ease-out infinite;
}
@keyframes ring { from { transform: scale(.85); opacity: 1; } to { transform: scale(1.35); opacity: 0; } }
.seal.broken::before { display: none; }

.seal-half {
  position: absolute; inset: 0; border-radius: 47% 53% 50% 50% / 52% 48% 52% 48%;
  background:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><path d='M50 80 C28 64 18 52 18 39 C18 29 26 22 35 22 C42 22 47 26 50 32 C53 26 58 22 65 22 C74 22 82 29 82 39 C82 52 72 64 50 80Z' fill='none' stroke='rgba(255,190,190,.35)' stroke-width='3' transform='translate(1 1.5)'/><path d='M50 80 C28 64 18 52 18 39 C18 29 26 22 35 22 C42 22 47 26 50 32 C53 26 58 22 65 22 C74 22 82 29 82 39 C82 52 72 64 50 80Z' fill='rgba(70,0,15,.28)'/><circle cx='50' cy='50' r='44' fill='none' stroke='rgba(60,0,10,.25)' stroke-width='2.5'/></svg>") center / 100% 100% no-repeat,
    radial-gradient(circle at 34% 28%, #e0506a, #a3152f 55%, #6d0b20);
  box-shadow: 0 4px 8px rgba(0,0,0,.35), inset 0 -4px 10px rgba(0,0,0,.3), inset 0 3px 6px rgba(255,255,255,.15);
  transition: transform 1.1s cubic-bezier(.4,0,.7,1), opacity 1.1s ease;
}
/* left half overlaps the right a little so no seam shows before it breaks */
.seal-half.left  { clip-path: polygon(0 0, 56% 0, 47% 22%, 60% 40%, 48% 60%, 58% 80%, 50% 100%, 0 100%); }
.seal-half.right { clip-path: polygon(53% 0, 100% 0, 100% 100%, 47% 100%, 55% 80%, 45% 60%, 57% 40%, 44% 22%); }
.seal:not(.broken):hover .seal-half { transform: scale(1.05); }
.seal.broken .seal-half.left  { transform: translate(-60%, 160%) rotate(-50deg); opacity: 0; }
.seal.broken .seal-half.right { transform: translate(60%, 170%) rotate(40deg); opacity: 0; }

/* ============ letter ============ */
.paper {
  position: relative;
  width: min(92vw, 540px);
  min-height: min(46dvh, 440px);
  padding: clamp(2rem, 7vw, 3rem) clamp(1.1rem, 5vw, 2.8rem) clamp(1.6rem, 5vw, 2.4rem);
  color: var(--ink);
  border-radius: 4px;
  background:
    radial-gradient(120% 90% at 10% 0%, rgba(255,255,255,.75), transparent 55%),
    radial-gradient(90% 70% at 100% 100%, rgba(214,180,150,.25), transparent 60%),
    var(--cream);
  box-shadow: 0 30px 60px -18px rgba(0,0,0,.6), 0 0 0 1px rgba(0,0,0,.03);
  transform: rotate(-.6deg);
  -webkit-user-select: text; user-select: text;
  cursor: pointer;
}
/* washi tape */
.paper::before {
  content: ''; position: absolute; top: -14px; left: 50%;
  width: 120px; height: 30px; transform: translateX(-50%) rotate(-3deg);
  background: repeating-linear-gradient(45deg, rgba(244,170,185,.85) 0 8px, rgba(250,196,206,.85) 8px 16px);
  box-shadow: 0 2px 4px rgba(0,0,0,.1);
}
.doodle {
  position: absolute; right: 1.1rem; top: .9rem;
  font-size: 1.4rem; color: var(--rose); opacity: .35; transform: rotate(14deg);
}

.greeting {
  font-family: 'Great Vibes', cursive;
  font-size: clamp(2rem, 8vw, 2.7rem);
  color: var(--rose);
  margin-bottom: .5rem;
}

.stanza {
  font-family: 'Caveat', cursive;
  font-size: clamp(1.3rem, 5vw, 1.95rem);
  line-height: 1.45;
  transition: opacity .6s ease, transform .6s ease;
}
.stanza.leaving { opacity: 0; transform: translateY(-14px); }

.line { display: block; margin-bottom: .2em; }
.word { display: inline-block; white-space: nowrap; }
.ch {
  display: inline-block;
  opacity: 0; transform: translateY(4px) scale(.9);
  animation: ink .55s ease forwards;
}
@keyframes ink { to { opacity: 1; transform: none; } }
.instant .ch { animation-delay: 0s !important; animation-duration: .25s; }

.signature {
  font-family: 'Great Vibes', cursive;
  font-size: clamp(1.8rem, 7vw, 2.3rem);
  color: var(--rose);
  text-align: right;
  margin-top: 1.2rem;
  min-height: 1em;
}

.letter-nav {
  display: flex; align-items: center; justify-content: center; flex-direction: column; gap: .9rem;
  min-height: 5.5rem;
}
.progress { display: flex; gap: .7rem; font-size: 1.25rem; color: var(--glow); }
.progress span { opacity: .4; transition: opacity .6s, transform .6s; }
.progress span.on { opacity: 1; transform: scale(1.15); }
#skip-hint { transition: opacity 1s; }
#skip-hint.gone { opacity: 0; }

/* ============ polaroids ============ */
.polaroids { display: flex; flex-direction: column; align-items: center; }
.polaroid {
  --pw: min(58vw, 270px, 28dvh);
  width: var(--pw);
  background: #fffdf8;
  padding: 10px 10px 0;
  border-radius: 2px;
  box-shadow: 0 22px 40px -12px rgba(0,0,0,.65);
  touch-action: none; cursor: grab;
  transform: translateX(var(--tx)) rotate(var(--rot));
  transition: transform .6s cubic-bezier(.2,.9,.3,1.2);
  position: relative;
}
.polaroid + .polaroid { margin-top: -6px; }
.scene.active .polaroid { animation: drop 1.1s cubic-bezier(.2,1.25,.45,1) .6s both; }
.scene.active .polaroid + .polaroid { animation-delay: 1.1s; }
.scene.active .polaroid.landed { animation: none; }
@keyframes drop {
  from { transform: translate(var(--tx), -110vh) rotate(calc(var(--rot) * 5)); }
  to   { transform: translateX(var(--tx)) rotate(var(--rot)); }
}
.polaroid.developed { cursor: zoom-in; }
.polaroid.zoomed { transform: translateX(0) rotate(0) scale(1.28); z-index: 5; cursor: zoom-out; }

.photo { position: relative; aspect-ratio: 906 / 810; overflow: hidden; background: #1f1f29; }
.photo img {
  width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none;
  filter:
    blur(calc((1 - var(--dev, 0)) * 9px))
    saturate(calc(.15 + var(--dev, 0) * .85))
    sepia(calc((1 - var(--dev, 0)) * .7))
    brightness(calc(.55 + var(--dev, 0) * .45));
}
.develop {
  position: absolute; inset: 0;
  background: radial-gradient(circle at 50% 40%, #3d4050, #1d1d27);
  opacity: calc(1 - var(--dev, 0) * 1.2);
}
.polaroid figcaption {
  font-family: 'Caveat', cursive;
  color: #5a3448;
  font-size: clamp(1.2rem, 4.6vw, 1.5rem);
  text-align: center;
  padding: .35rem .2rem .55rem;
  min-height: 2.6rem;
}

@media (min-width: 760px) {
  .polaroids { flex-direction: row; gap: 2.5rem; }
  .polaroid { --pw: min(300px, 40dvh); --tx: 0 !important; }
  .polaroid + .polaroid { margin-top: 0; }
}

/* ============ cake ============ */
.cake { position: relative; width: 270px; height: 290px; flex-shrink: 0; transition: filter 1.4s ease; }
#cake-scene.dark .cake { filter: brightness(.3); }
#cake-scene.dark .scene-title, #cake-scene.dark .cake-actions { opacity: 0; transition: opacity 1s; }

.plate {
  position: absolute; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 296px; height: 36px; border-radius: 50%;
  background: radial-gradient(ellipse at 50% 35%, #fff, #ddd6e3 65%, #a99fb5);
  box-shadow: 0 18px 30px -8px rgba(0,0,0,.55);
}
.tier { position: absolute; left: 50%; transform: translateX(-50%); border-radius: 0 0 16px 16px / 0 0 12px 12px; }
.tier::before { /* top surface */
  content: ''; position: absolute; left: 0; right: 0; top: -13px; height: 26px; border-radius: 50%;
  background: radial-gradient(ellipse at 50% 40%, #fffaf6, #fbe8e4);
}
.tier.bottom {
  bottom: 18px; width: 236px; height: 98px;
  background: linear-gradient(90deg, #e48ea3, #f7c3cf 32%, #f9cdd7 55%, #d77d95);
}
.tier.bottom::after { /* pearls */
  content: ''; position: absolute; left: 6px; right: 6px; bottom: 6px; height: 10px;
  background: radial-gradient(circle, #fff 3px, transparent 3.6px) 0 0 / 15px 10px repeat-x;
  opacity: .9;
}
.tier.top {
  bottom: 116px; width: 168px; height: 78px;
  background: linear-gradient(90deg, #eeaabb, #fde1e8 32%, #fee7ed 55%, #e29db0);
}
.tier.top::after { /* sprinkles */
  content: ''; position: absolute; inset: 30px 10px 10px;
  background:
    radial-gradient(circle, #8fc7e8 2px, transparent 2.5px) 4px 6px / 34px 22px,
    radial-gradient(circle, #ffd479 2px, transparent 2.5px) 20px 16px / 38px 24px,
    radial-gradient(circle, #b9a4f5 2px, transparent 2.5px) 12px 2px / 30px 26px;
  opacity: .9;
}
.frost {
  position: absolute; left: 0; right: 0; top: 0; height: 26px;
  background:
    radial-gradient(circle at 50% 0, #fdf1ee 9px, transparent 9.5px) 0 4px / 20px 22px repeat-x,
    linear-gradient(#fdf1ee, #fdf1ee) 0 0 / 100% 8px no-repeat;
}

.candles {
  position: absolute; left: 50%; bottom: 190px; transform: translateX(-50%);
  width: 150px; height: 110px;
  display: flex; justify-content: space-evenly; align-items: flex-end;
  z-index: 3;
}
.candle {
  position: relative;
  width: 10px; height: var(--h, 44px);
  border-radius: 3px 3px 2px 2px;
  background: repeating-linear-gradient(135deg, #fff 0 5px, var(--c, #8fc7e8) 5px 10px);
  box-shadow: inset -2px 0 3px rgba(0,0,0,.12);
  cursor: pointer;
}
.candle:nth-child(even) { margin-bottom: 9px; }
.candle::before { /* wick */
  content: ''; position: absolute; left: 50%; top: -7px; width: 2px; height: 8px; margin-left: -1px;
  background: #3a2a2a; border-radius: 1px;
}
.candle::after { /* bigger tap area */
  content: ''; position: absolute; left: -12px; right: -12px; top: -50px; bottom: 0;
}
.flame {
  position: absolute; left: 50%; bottom: calc(100% + 4px);
  width: 14px; height: 26px; margin-left: -7px;
  border-radius: 50% 50% 50% 50% / 62% 62% 38% 38%;
  background: radial-gradient(ellipse at 50% 76%, #fff 0 16%, #ffe48f 30%, #ffad3b 58%, rgba(255,110,40,0) 74%);
  transform-origin: 50% 90%;
  animation: flicker 1.3s ease-in-out infinite;
  transition: transform .35s ease, opacity .35s ease;
}
.flame::after { /* glow */
  content: ''; position: absolute; left: 50%; top: 55%;
  width: 110px; height: 110px; transform: translate(-50%, -50%); border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 196, 110, .38), rgba(255, 160, 80, .08) 45%, transparent 68%);
  pointer-events: none;
}
.cake.breeze .flame { animation-duration: .22s; }
@keyframes flicker {
  0%, 100% { transform: scale(1, 1) rotate(-1deg); }
  25% { transform: scale(.93, 1.07) rotate(2deg); }
  50% { transform: scale(1.04, .95) rotate(-2deg); }
  75% { transform: scale(.97, 1.04) rotate(1deg); }
}
.candle.out .flame { animation: none; transform: scale(0) translateY(10px); opacity: 0; }
.smoke {
  position: absolute; left: 50%; bottom: calc(100% + 4px);
  width: 7px; height: 7px; margin-left: -3.5px; border-radius: 50%;
  background: rgba(225, 220, 235, .55);
  animation: smoke 2.2s ease-out forwards;
  pointer-events: none;
}
@keyframes smoke {
  to { transform: translate(var(--sx, 6px), -80px) scale(5); opacity: 0; }
}

.cake-actions { display: flex; flex-direction: column; align-items: center; gap: .6rem; transition: opacity 1s; }
#mic-btn.listening { animation: pulse 1.4s ease-in-out infinite; }

@media (min-width: 760px) and (min-height: 760px) {
  .cake { transform: scale(1.2); margin: 2.5rem 0; }
}

/* ============ finale ============ */
.heart-photo {
  width: min(46vw, 220px, 26dvh); aspect-ratio: 10 / 9;
  filter: drop-shadow(0 0 26px rgba(255, 140, 170, .6));
  flex-shrink: 0;
}
.heart-photo.in { animation: beat 1.8s ease-in-out infinite 1s; }
@keyframes beat { 0%, 100% { transform: scale(1); } 15% { transform: scale(1.06); } 30% { transform: scale(1); } 45% { transform: scale(1.04); } }
.heart-photo img {
  width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; display: block;
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 90'><path d='M50 88 C20 66 0 49 0 26 C0 11 12 0 26 0 C37 0 45 6 50 15 C55 6 63 0 74 0 C88 0 100 11 100 26 C100 49 80 66 50 88Z'/></svg>") center / contain no-repeat;
          mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 90'><path d='M50 88 C20 66 0 49 0 26 C0 11 12 0 26 0 C37 0 45 6 50 15 C55 6 63 0 74 0 C88 0 100 11 100 26 C100 49 80 66 50 88Z'/></svg>") center / contain no-repeat;
}

.hb {
  font-family: 'Great Vibes', cursive; font-weight: 400;
  font-size: clamp(2.7rem, 11.5vw, 5.4rem);
  line-height: 1.08;
  text-align: center;
  color: #ffe6ea;
  text-shadow: 0 0 30px rgba(255, 140, 175, .7), 0 2px 4px rgba(0,0,0,.2);
}
.hb-line { display: block; }
.hb-line.name { color: #fff; }
.hb .w { display: inline-block; white-space: nowrap; }
.hb .l {
  display: inline-block; opacity: 0;
  transform: translateY(30px) scale(.5) rotate(-8deg);
  animation: pop .8s cubic-bezier(.2,1.6,.4,1) forwards;
}
@keyframes pop { to { opacity: 1; transform: none; } }

.finale-msg {
  font-family: 'Caveat', cursive;
  font-size: clamp(1.35rem, 5vw, 1.85rem);
  line-height: 1.35; text-align: center; max-width: 30ch;
  color: #fff0f2;
  min-height: 3em;
}
.finale-actions { display: flex; flex-wrap: wrap; gap: .8rem; justify-content: center; }

/* ============ full letter ============ */
.paper.scroll { max-height: 78dvh; overflow-y: auto; cursor: auto; transform: rotate(-.3deg); }
.paper.scroll .stanza p { margin-bottom: 1.1em; }

/* ============ calm mode ============ */
@media (prefers-reduced-motion: reduce) {
  .env-float, .pulse, .seal::before, .heart-photo.in { animation: none !important; }
}
