:root {
  color-scheme: dark;
  --ink: #fff5f0;
  --muted: #c9acb9;
  --wine: #190b16;
  --wine-light: #311526;
  --rose: #e88d9c;
  --pink: #f3b8c4;
  --gold: #dfc09a;
  --cream: #fbf3eb;
  --serif: 'Cormorant Garamond', Georgia, serif;
  --sans: 'DM Sans', ui-sans-serif, system-ui, sans-serif;
  --ease-silk: cubic-bezier(.2, .75, .22, 1);
}

* { box-sizing: border-box; }
html { min-width: 320px; min-height: 100%; background: var(--wine); scroll-behavior: smooth; }
body { min-width: 320px; min-height: 100vh; min-height: 100svh; margin: 0; color: var(--ink); font-family: var(--sans); background: radial-gradient(ellipse at 50% 44%, #422037 0%, #271321 39%, #190b16 77%); overflow-x: hidden; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; font: inherit; }
button:focus-visible, a:focus-visible { outline: 2px solid #f8cad2; outline-offset: 5px; }
::selection { color: #25101c; background: #f1c0c7; }

.stage { position: relative; isolation: isolate; display: grid; grid-template-rows: auto auto minmax(280px, 1fr) auto; min-height: 100vh; min-height: 100svh; padding: max(24px, env(safe-area-inset-top)) max(34px, env(safe-area-inset-right)) max(22px, env(safe-area-inset-bottom)) max(34px, env(safe-area-inset-left)); overflow: hidden; }
.stage::before { position: absolute; inset: 17% 15% 8%; z-index: -1; border: 1px solid rgba(245, 198, 196, .065); border-radius: 50%; content: ''; filter: blur(1px); transform: rotate(-11deg) scaleX(1.25); pointer-events: none; }
.stage::after { position: absolute; inset: 23% 22% 3%; z-index: -1; border: 1px solid rgba(231, 186, 166, .045); border-radius: 48%; content: ''; transform: rotate(7deg) scaleX(1.12); pointer-events: none; }
.scene-glow { position: fixed; z-index: -2; width: 46vw; aspect-ratio: 1; border-radius: 50%; filter: blur(72px); opacity: .22; pointer-events: none; }
.scene-glow--one { top: 0; left: 50%; background: #a04667; transform: translateX(-50%); animation: glow-breathe 8s ease-in-out infinite alternate; }
.scene-glow--two { right: -20vw; bottom: -30vw; width: 56vw; background: #67314d; animation: glow-breathe 11s ease-in-out infinite alternate-reverse; }
.grain { position: fixed; inset: 0; z-index: 8; opacity: .045; pointer-events: none; background-image: radial-gradient(rgba(255, 245, 240, .16) .45px, transparent .8px); background-size: 4px 4px; }
.floating-hearts { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.float-heart { position: absolute; bottom: -40px; left: var(--x); color: rgba(244, 176, 190, var(--alpha, .3)); font-size: var(--size, 12px); text-shadow: 0 0 22px rgba(238, 127, 157, .4); animation: heart-drift var(--duration, 15s) linear var(--delay, 0s) infinite; }

.masthead, .wordmark, .date-mark, .page-footer, .footer-actions { display: flex; align-items: center; }
.masthead { justify-content: space-between; min-height: 42px; position: relative; z-index: 4; }
.wordmark { gap: 10px; color: rgba(255, 244, 239, .93); text-decoration: none; font: 500 15px/1 var(--serif); letter-spacing: .055em; }
.wordmark i { color: var(--pink); font-weight: 500; }
.wordmark-mark { width: 20px; color: var(--rose); filter: drop-shadow(0 0 10px rgba(239, 141, 166, .34)); }
.wordmark-mark svg { display: block; width: 100%; }
.date-mark { gap: 9px; color: rgba(240, 218, 222, .65); font-size: 9px; font-weight: 600; letter-spacing: .17em; }
.date-dot { width: 5px; height: 5px; border-radius: 100%; background: var(--gold); box-shadow: 0 0 10px rgba(223, 192, 154, .8); }
.date-divider { color: rgba(223, 192, 154, .42); }
.masthead-tools { display: flex; align-items: center; gap: 17px; }
.music-toggle { display: inline-flex; align-items: center; gap: 7px; padding: 8px 11px; border: 1px solid rgba(248, 224, 221, .2); border-radius: 30px; color: rgba(255, 239, 237, .84); background: rgba(51, 25, 43, .3); font-size: 9px; letter-spacing: .04em; cursor: pointer; transition: border-color .25s, background .25s, color .25s; }
.music-toggle:hover, .music-toggle[aria-expanded="true"] { border-color: rgba(248, 202, 210, .5); color: #fff2ef; background: rgba(96, 42, 66, .55); }
.music-toggle__icon { color: var(--pink); font-size: 15px; line-height: 1; }

.dedication-intro { position: relative; z-index: 2; align-self: center; margin: clamp(36px, 7vh, 76px) 0 0; text-align: center; animation: intro-arrive 1.1s var(--ease-silk) both; }
.eyebrow { display: flex; align-items: center; justify-content: center; gap: 13px; margin: 0 0 16px; color: #dfc09a; font-size: 9px; font-weight: 600; letter-spacing: .23em; }
.eyebrow-line { width: 26px; height: 1px; background: linear-gradient(90deg, transparent, rgba(223, 192, 154, .7)); }
.eyebrow-line:last-child { transform: rotate(180deg); }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 10px; color: #fff8f4; font: 400 clamp(38px, 5.5vw, 68px)/.99 var(--serif); letter-spacing: -.028em; text-shadow: 0 3px 40px rgba(255, 211, 219, .08); }
h1 em { color: #efb2bf; font-weight: 400; }
.intro-note { margin: 15px 0 0; color: rgba(231, 207, 215, .76); font: 400 12px/1.8 var(--sans); letter-spacing: .025em; }
.mobile-break { display: none; }

.surprise-zone { position: relative; z-index: 3; display: flex; min-height: 315px; align-items: center; justify-content: center; flex-direction: column; padding: 20px 0 0; }
.sequence-note { display: flex; align-items: center; gap: 9px; min-height: 20px; margin: 2px 0 20px; color: rgba(234, 208, 215, .7); font-size: 10px; letter-spacing: .04em; transition: opacity .6s, transform .6s; }
.sequence-note__sparkle { color: var(--gold); font-size: 12px; animation: sparkle-turn 3.8s ease-in-out infinite; }
.stage.is-finished .sequence-note { transform: translateY(5px); opacity: 0; }
.envelope { position: relative; z-index: 2; display: flex; align-items: center; flex-direction: column; width: min(420px, 86vw); padding: 0; border: 0; background: transparent; cursor: pointer; opacity: 0; visibility: hidden; transform: translateY(22px) scale(.94); transition: opacity 1s var(--ease-silk), visibility 1s, transform 1s var(--ease-silk); }
.stage.is-ready .envelope { opacity: 1; visibility: visible; transform: translateY(0) scale(1); }
.envelope:disabled { cursor: default; }
.envelope-halo { position: absolute; top: 17%; left: 16%; z-index: -1; width: 68%; aspect-ratio: 1.25; border-radius: 50%; background: radial-gradient(ellipse, rgba(239, 164, 178, .17), transparent 70%); filter: blur(24px); animation: halo-breathe 4s ease-in-out infinite alternate; transition: opacity .5s; }
.envelope-visual { position: relative; display: block; width: min(350px, 76vw); aspect-ratio: 1.57; filter: drop-shadow(0 28px 40px rgba(5, 1, 6, .42)); transition: transform .8s var(--ease-silk), filter .8s; transform-style: preserve-3d; }
.envelope:hover .envelope-visual { transform: translateY(-7px) rotate(-1deg); filter: drop-shadow(0 35px 44px rgba(5, 1, 6, .46)); }
.envelope-back { position: absolute; inset: 0; border: 1px solid rgba(255, 235, 216, .84); border-radius: 9px; background: linear-gradient(155deg, #f8e8d9 0%, #e6c9b5 58%, #cfad9e 100%); }
.letter-peek { position: absolute; top: 8%; left: 9%; z-index: 1; display: flex; width: 82%; height: 79%; align-items: center; flex-direction: column; justify-content: center; border-radius: 4px; background: linear-gradient(156deg, #fffaf4, #f2dfd1); box-shadow: 0 3px 8px rgba(47, 17, 29, .08); transition: transform 1.15s var(--ease-silk) .22s; }
.letter-peek__heart { margin: 0 0 4px; color: #ba566e; font: 25px/1 var(--serif); }
.letter-peek__line { width: 37%; height: 1px; margin: 2px 0; background: rgba(139, 88, 95, .22); }
.letter-peek__line--short { width: 23%; }
.envelope-fold-left, .envelope-fold-right { position: absolute; inset: 0; z-index: 2; border-radius: 8px; background: linear-gradient(137deg, #f4e0d1, #e1c0ad 80%); }
.envelope-fold-left { clip-path: polygon(0 0, 51% 53%, 0 100%); }
.envelope-fold-right { clip-path: polygon(100% 0, 49% 53%, 100% 100%); background: linear-gradient(220deg, #f9eadd, #dfbbaa); }
.envelope-flap { position: absolute; inset: 0; z-index: 4; border-radius: 8px; background: linear-gradient(147deg, #f7e8d9, #e8cebd 67%, #dfbfac); clip-path: polygon(0 0, 100% 0, 50% 61%); transform-origin: center top; transition: transform .88s cubic-bezier(.38, -.2, .2, 1), z-index .01s .46s; backface-visibility: hidden; }
.envelope-seal { position: absolute; top: 42%; left: 50%; z-index: 5; display: grid; width: 47px; aspect-ratio: 1; place-items: center; border: 1px solid rgba(247, 193, 189, .62); border-radius: 50%; color: #fff2eb; background: radial-gradient(circle at 35% 25%, #da8090, #a3405e 74%); box-shadow: 0 5px 18px rgba(68, 20, 42, .32), inset 0 1px rgba(255, 255, 255, .4); transform: translate(-50%, -50%); transition: opacity .4s, transform .4s; }
.envelope-seal svg { width: 20px; }
.envelope-caption { display: grid; justify-items: center; gap: 6px; margin-top: 21px; transition: opacity .4s, transform .4s; }
.envelope-caption__overline { color: rgba(229, 198, 188, .73); font-size: 8px; letter-spacing: .21em; }
.envelope-caption__title { color: #fff6f0; font: 400 25px/1.1 var(--serif); }
.envelope-caption__action { margin-top: 5px; color: #ebacb7; font-size: 10px; letter-spacing: .08em; }
.envelope-caption__action span { display: inline-block; padding-left: 4px; transition: transform .3s; }
.envelope:hover .envelope-caption__action span { transform: translate(3px, -3px); }
.envelope.is-opening .envelope-flap { transform: rotateX(180deg); transition: transform .9s cubic-bezier(.48, 0, .14, 1), z-index .01s .45s; }
.envelope.is-opening .letter-peek { transform: translateY(-23%); }
.envelope.is-opening .envelope-seal, .envelope.is-opening .envelope-caption { opacity: 0; transform: translate(-50%, -55%) scale(.8); }
.envelope.is-opening .envelope-caption { transform: translateY(10px); }
.envelope.is-opening .envelope-halo { opacity: .2; }
.skip-button { position: absolute; bottom: 12px; display: flex; align-items: center; gap: 7px; padding: 9px 12px; border: 1px solid rgba(248, 224, 221, .14); border-radius: 30px; color: rgba(251, 232, 230, .62); background: rgba(51, 25, 43, .26); font-size: 10px; letter-spacing: .04em; cursor: pointer; transition: color .3s, border-color .3s, opacity .3s; }
.skip-button:hover { border-color: rgba(248, 202, 210, .48); color: #fff2ef; }
.stage.is-ready .skip-button, .stage.is-finished .skip-button { opacity: 0; pointer-events: none; }

.page-footer { position: relative; z-index: 3; justify-content: space-between; gap: 18px; min-height: 32px; color: rgba(234, 206, 211, .53); font-size: 9px; letter-spacing: .06em; }
.footer-heart { display: inline-block; margin: 0 2px; color: #dc8294; font-size: 11px; }
.footer-ornament { color: rgba(218, 180, 155, .48); letter-spacing: .3em; }
.footer-actions { gap: 19px; }
.text-button { padding: 6px 0; border: 0; color: rgba(244, 221, 222, .7); background: none; font-size: 9px; cursor: pointer; transition: color .25s, opacity .25s; }
.text-button:not(:disabled):hover { color: #ffe3e4; }
.text-button:disabled { opacity: .34; cursor: default; }
.text-button span { margin-left: 3px; }

.notification-layer { position: absolute; inset: 0; z-index: 1; overflow: hidden; pointer-events: none; }
.toast { position: absolute; display: flex; width: min(260px, 25vw); min-height: 50px; align-items: center; gap: 10px; padding: 10px 14px; border: 1px solid rgba(255, 221, 225, .15); border-radius: 13px; background: linear-gradient(130deg, rgba(95, 50, 71, .78), rgba(50, 29, 48, .74)); box-shadow: 0 12px 42px rgba(10, 3, 13, .19), inset 0 1px rgba(255, 255, 255, .07); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); color: rgba(255, 245, 242, .94); opacity: 0; transform: translateY(16px) scale(.97); transition: opacity .6s var(--ease-silk), transform .75s var(--ease-silk); }
.toast.is-visible { opacity: .93; transform: translateY(0) scale(1); }
.toast.is-background { opacity: .24; transform: scale(.95); }
.toast.is-visible.is-background { opacity: .24; transform: translateY(0) scale(.95); }
.toast-icon { display: grid; flex: 0 0 29px; width: 29px; height: 29px; place-items: center; border: 1px solid rgba(243, 184, 196, .25); border-radius: 50%; color: #f1adbc; background: rgba(236, 143, 167, .12); font-size: 13px; }
.toast-copy { min-width: 0; display: grid; gap: 2px; }
.toast-copy strong { color: #fff4f0; font-size: 10px; font-weight: 500; line-height: 1.45; }
.toast-copy small { color: rgba(245, 212, 214, .53); font-size: 8px; letter-spacing: .07em; }
.toast--0 { top: 17%; left: 7%; transform: translate(-15px, 14px) rotate(-3deg); }
.toast--1 { top: 27%; right: 8%; transform: translate(15px, 16px) rotate(2deg); }
.toast--2 { top: 43%; left: 4%; transform: translate(-15px, 16px) rotate(2deg); }
.toast--3 { top: 48%; right: 5%; transform: translate(15px, 14px) rotate(-2deg); }
.toast--4 { top: 68%; left: 10%; transform: translate(-13px, 15px) rotate(2deg); }
.toast--5 { top: 73%; right: 7%; transform: translate(13px, 15px) rotate(-3deg); }
.toast--6 { top: 34%; left: 10%; transform: translate(-13px, 15px) rotate(-2deg); }
.toast--7 { top: 58%; right: 11%; transform: translate(13px, 15px) rotate(2deg); }
.toast--0.is-visible { transform: translate(0, 0) rotate(-3deg); }
.toast--1.is-visible { transform: translate(0, 0) rotate(2deg); }
.toast--2.is-visible { transform: translate(0, 0) rotate(2deg); }
.toast--3.is-visible { transform: translate(0, 0) rotate(-2deg); }
.toast--4.is-visible { transform: translate(0, 0) rotate(2deg); }
.toast--5.is-visible { transform: translate(0, 0) rotate(-3deg); }
.toast--6.is-visible { transform: translate(0, 0) rotate(-2deg); }
.toast--7.is-visible { transform: translate(0, 0) rotate(2deg); }
.letter-alert { position: fixed; top: max(78px, calc(env(safe-area-inset-top) + 68px)); right: max(32px, env(safe-area-inset-right)); z-index: 10; display: flex; width: min(354px, calc(100vw - 36px)); align-items: center; gap: 12px; padding: 13px 17px 14px 13px; overflow: hidden; border: 1px solid rgba(255, 226, 227, .3); border-radius: 13px; background: linear-gradient(116deg, rgba(91, 38, 62, .96), rgba(49, 25, 45, .96)); box-shadow: 0 15px 45px rgba(13, 2, 13, .4), 0 0 30px rgba(215, 104, 138, .14); opacity: 0; transform: translateY(-10px) scale(.98); pointer-events: none; transition: opacity .45s, transform .55s var(--ease-silk); }
.letter-alert[hidden] { display: none; }
.letter-alert.is-visible { opacity: 1; transform: translateY(0) scale(1); }
.letter-alert__icon { display: grid; flex: 0 0 36px; width: 36px; height: 36px; place-items: center; border: 1px solid rgba(250, 203, 208, .28); border-radius: 50%; color: #fac0ca; background: rgba(228, 128, 151, .16); font: 24px/1 var(--serif); animation: heart-beat 2.2s ease-in-out infinite; }
.letter-alert__copy { display: grid; gap: 4px; }
.letter-alert__label { color: #e4ad98; font-size: 8px; font-weight: 600; letter-spacing: .18em; }
.letter-alert__title { color: #fff6f3; font-size: 11px; font-weight: 500; line-height: 1.4; }
.letter-alert__glint { position: absolute; top: 9px; right: 11px; color: rgba(246, 210, 166, .7); font-size: 11px; }

.music-panel { position: fixed; right: max(20px, env(safe-area-inset-right)); bottom: max(58px, calc(env(safe-area-inset-bottom) + 52px)); z-index: 12; display: grid; gap: 8px; width: min(380px, calc(100vw - 28px)); padding: 13px; border: 1px solid rgba(255, 226, 227, .24); border-radius: 15px; background: rgba(49, 25, 45, .97); box-shadow: 0 18px 55px rgba(13, 2, 13, .5); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.music-panel[hidden] { display: none; }
.music-panel__header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.music-panel__title { color: #fff6f3; font: 500 17px/1.2 var(--serif); }
.music-panel__close { display: grid; flex: 0 0 30px; width: 30px; height: 30px; place-items: center; padding: 0; border: 1px solid rgba(248, 224, 221, .2); border-radius: 50%; color: #f4cad0; background: rgba(255, 255, 255, .04); font-size: 21px; cursor: pointer; }
.music-panel__frame { width: 100%; height: 200px; overflow: hidden; border-radius: 9px; background: #08060a; }
.music-panel__frame iframe { display: block; width: 100%; height: 200px; border: 0; }
.music-panel__hint { margin: 0; color: rgba(245, 212, 214, .67); font-size: 9px; line-height: 1.4; }
.music-panel__fallback { justify-self: start; color: #f3b8c4; font-size: 10px; text-decoration: none; }
.music-panel__fallback:hover { color: #fff2ef; text-decoration: underline; }

.letter-dialog { position: fixed; inset: 0; z-index: 20; display: none; width: min(590px, calc(100vw - 32px)); max-width: none; max-height: min(83vh, 790px); max-height: min(83svh, 790px); margin: auto; padding: 0; overflow: visible; border: 0; border-radius: 5px; background: transparent; color: #4c2d35; opacity: 0; transform: translateY(20px) scale(.98); transition: opacity .45s, transform .55s var(--ease-silk), overlay .5s allow-discrete, display .5s allow-discrete; }
.letter-dialog[open] { display: flex; flex-direction: column; opacity: 1; transform: translateY(0) scale(1); }
.letter-dialog.dialog-fallback { inset: 0; width: 100vw; height: 100vh; height: 100svh; max-height: none; align-items: center; justify-content: center; padding: max(12px, env(safe-area-inset-top)) 12px max(12px, env(safe-area-inset-bottom)); border-radius: 0; background: rgba(13, 4, 12, .84); backdrop-filter: blur(9px); -webkit-backdrop-filter: blur(9px); }
.letter-dialog.dialog-fallback .letter-paper { width: min(590px, 100%); max-height: 100%; }
.letter-dialog::backdrop { background: rgba(13, 4, 12, .72); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); animation: veil-in .45s ease both; }
.letter-paper { position: relative; display: flex; min-height: 0; flex-direction: column; padding: 21px 39px 18px; overflow: hidden; border: 1px solid rgba(182, 137, 120, .46); border-radius: 5px; background: radial-gradient(ellipse at 50% -10%, #fffdfa, #fbf2e9 74%, #f4e8db); box-shadow: 0 30px 110px rgba(0, 0, 0, .38), inset 0 0 0 7px rgba(214, 181, 162, .09), inset 0 0 40px rgba(183, 140, 115, .08); }
.letter-paper::before, .letter-paper::after { position: absolute; top: 0; bottom: 0; width: 1px; content: ''; background: rgba(164, 106, 103, .11); }
.letter-paper::before { left: 20px; }.letter-paper::after { right: 20px; }
.paper-topline, .paper-bottomline { display: flex; flex: 0 0 auto; align-items: center; justify-content: space-between; color: #a48378; font-size: 7px; font-weight: 600; letter-spacing: .17em; }
.paper-topline { min-height: 20px; border-bottom: 1px solid rgba(164, 106, 103, .16); }
.paper-topline__heart { color: #b6586d; font-size: 12px; }
.close-letter { position: absolute; top: 15px; right: 32px; z-index: 2; display: grid; width: 34px; height: 34px; place-items: center; border: 1px solid rgba(143, 95, 92, .18); border-radius: 50%; color: #936b69; background: rgba(255, 252, 247, .74); cursor: pointer; transition: background .2s, color .2s, transform .2s; }
.close-letter:hover { color: #673443; background: #fff; transform: rotate(90deg); }
.close-letter svg { width: 16px; }
.paper-content { display: flex; min-height: 0; flex-direction: column; align-items: center; padding: 28px 4px 0; overflow-y: auto; scrollbar-width: thin; scrollbar-color: rgba(174, 114, 115, .32) transparent; overscroll-behavior: contain; }
.paper-content::-webkit-scrollbar { width: 5px; }.paper-content::-webkit-scrollbar-thumb { border-radius: 8px; background: rgba(174, 114, 115, .32); }
.letter-kicker { display: flex; align-items: center; gap: 8px; color: #b78472; font-size: 8px; font-weight: 600; letter-spacing: .21em; }
.letter-kicker__ornament { color: #c48684; font-size: 13px; }
h2 { margin: 8px 0 4px; color: #5c3841; font: 500 clamp(38px, 6vw, 54px)/1 var(--serif); letter-spacing: -.022em; text-align: center; }
h2 em { color: #b75970; font-weight: 500; }
.letter-divider { display: flex; width: 180px; align-items: center; justify-content: center; gap: 11px; margin: 5px 0 18px; color: #b75970; font-size: 11px; }
.letter-divider span { flex: 1; height: 1px; background: linear-gradient(90deg, transparent, rgba(180, 106, 111, .4)); }
.letter-divider span:last-child { transform: rotate(180deg); }
.letter-body { width: 100%; max-width: 438px; color: #684d4e; font: 400 15px/1.72 var(--serif); }
.letter-body p { margin: 0 0 13px; }
.letter-body p:first-child::first-letter { float: left; margin: 1px 6px -5px 0; color: #ad566b; font: 600 41px/.8 var(--serif); }
.letter-signoff { display: grid; justify-items: center; gap: 0; margin: 7px 0 20px; color: #8a6461; font: 400 14px/1.4 var(--serif); }
.letter-signoff strong { color: #a54c64; font: italic 600 24px/1.1 var(--serif); }
.signoff-heart { margin-top: 5px; color: #c06879; font-size: 13px; }
.paper-bottomline { width: 100%; min-height: 25px; margin-top: auto; border-top: 1px solid rgba(164, 106, 103, .16); font-size: 7px; letter-spacing: .15em; }
.letter-dialog.is-closing { opacity: 0; transform: translateY(12px) scale(.99); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

@keyframes intro-arrive { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
@keyframes heart-drift { 0% { opacity: 0; transform: translate3d(0, 8vh, 0) rotate(0) scale(.7); } 12% { opacity: 1; } 86% { opacity: .8; } 100% { opacity: 0; transform: translate3d(var(--sway, 24px), -112vh, 0) rotate(var(--spin, 220deg)) scale(1.2); } }
@keyframes glow-breathe { to { opacity: .38; transform: translateX(-50%) scale(1.15); } }
@keyframes halo-breathe { to { transform: scale(1.12); opacity: .9; } }
@keyframes sparkle-turn { 0%, 100% { opacity: .7; transform: rotate(0) scale(.92); } 50% { opacity: 1; transform: rotate(90deg) scale(1.13); } }
@keyframes heart-beat { 0%, 100% { transform: scale(1); } 11% { transform: scale(1.08); } 22% { transform: scale(1); } }
@keyframes veil-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes burst-out { to { opacity: 0; transform: translate(var(--dx), var(--dy)) rotate(var(--rot)) scale(.3); } }

@media (min-width: 1200px) and (min-height: 900px) {
  .stage { grid-template-rows: 42px auto minmax(350px, 1fr) 34px; }
  .dedication-intro { margin-top: 8vh; }
  .surprise-zone { padding-top: 2.5vh; }
}
@media (min-width: 761px) and (max-width: 1000px) and (orientation: portrait) {
  .dedication-intro { margin-top: 6vh; }
  h1 { font-size: clamp(48px, 7vw, 58px); }
  .toast--0 { top: 34%; }.toast--1 { top: 40%; }.toast--2 { top: 48%; }.toast--3 { top: 55%; }
  .toast--4 { top: 65%; }.toast--5 { top: 73%; }.toast--6 { top: 37%; }.toast--7 { top: 60%; }
}
@media (max-width: 760px) {
  .stage { grid-template-rows: auto auto minmax(270px, 1fr) auto; padding-right: max(20px, env(safe-area-inset-right)); padding-left: max(20px, env(safe-area-inset-left)); }
  .date-mark { gap: 6px; font-size: 8px; letter-spacing: .12em; }
  .date-divider, .date-mark .date-divider ~ * { display: none; }
  .dedication-intro { margin-top: clamp(40px, 8vh, 72px); }
  .eyebrow { gap: 8px; font-size: 8px; letter-spacing: .17em; }
  .eyebrow-line { width: 18px; }
  h1 { font-size: clamp(42px, 10vw, 58px); }
  .intro-note { font-size: 11px; }
  .mobile-break { display: block; }
  .surprise-zone { min-height: 305px; padding-top: 20px; }
  .envelope { width: min(390px, 88vw); }
  .envelope-visual { width: min(330px, 76vw); }
  .toast { width: min(228px, 41vw); min-height: 46px; gap: 7px; padding: 8px 9px; border-radius: 11px; }
  .toast-icon { flex-basis: 25px; width: 25px; height: 25px; font-size: 11px; }
  .toast-copy strong { font-size: 9px; }
  .toast-copy small { font-size: 7px; }
  .toast--0 { top: 37%; left: 2%; }
  .toast--1 { top: 43%; right: 2%; }
  .toast--2 { top: 50%; left: 0; }
  .toast--3 { top: 57%; right: 0; }
  .toast--4 { top: 66%; left: 1%; }
  .toast--5 { top: 74%; right: 1%; }
  .toast--6 { top: 35%; left: 0; }
  .toast--7 { top: 62%; right: 0; }
  .toast.is-visible.is-background { opacity: .13; filter: blur(.7px); }
  .letter-alert { top: max(68px, calc(env(safe-area-inset-top) + 62px)); right: 50%; transform: translate(50%, -10px) scale(.98); }
  .letter-alert.is-visible { transform: translate(50%, 0) scale(1); }
  .footer-ornament { display: none; }
  .footer-actions { gap: 12px; }
  .page-footer { font-size: 8px; }
  .text-button { font-size: 8px; }
}
@media (max-width: 430px) {
  .stage { grid-template-rows: auto auto minmax(250px, 1fr) auto; padding-top: max(18px, env(safe-area-inset-top)); padding-bottom: max(15px, env(safe-area-inset-bottom)); }
  .wordmark { gap: 7px; font-size: 13px; }
  .wordmark-mark { width: 17px; }
  .music-toggle__label { display: none; }
  .music-toggle { width: 32px; height: 32px; justify-content: center; padding: 0; }
  .date-mark { font-size: 7px; letter-spacing: .09em; }
  .dedication-intro { margin-top: 7vh; }
  .eyebrow { font-size: 7px; }
  .eyebrow-line { width: 12px; }
  h1 { font-size: clamp(38px, 10.1vw, 44px); }
  .surprise-zone { min-height: 270px; }
  .sequence-note { margin-bottom: 16px; font-size: 9px; }
  .envelope-visual { width: min(290px, 78vw); }
  .envelope-seal { width: 41px; }
  .envelope-caption { margin-top: 17px; }
  .envelope-caption__overline { font-size: 7px; }
  .envelope-caption__title { font-size: 23px; }
  .page-footer { gap: 8px; }
  .footer-actions { gap: 10px; }
  .text-button span { margin-left: 1px; }
  .toast { width: min(196px, 42vw); min-height: 42px; padding: 7px; }
  .toast-icon { flex-basis: 22px; width: 22px; height: 22px; }
  .toast-copy strong { font-size: 8px; line-height: 1.3; }
  .toast-copy small { font-size: 6px; }
  .toast--0 { top: 37%; left: 0; }
  .toast--1 { top: 43%; right: 0; }
  .toast--2 { top: 50%; left: -3px; }
  .toast--3 { top: 57%; right: -3px; }
  .toast--4 { top: 66%; left: 0; }
  .toast--5 { top: 74%; right: 0; }
  .toast--6 { top: 35%; left: -3px; }
  .toast--7 { top: 62%; right: -2px; }
  .letter-alert { width: calc(100vw - 28px); padding: 10px 13px; }
  .letter-alert__title { font-size: 10px; }
  .letter-dialog { width: calc(100vw - 22px); max-height: 88svh; border-radius: 4px; }
  .letter-paper { padding: 15px 25px 12px; }
  .letter-paper::before { left: 13px; }.letter-paper::after { right: 13px; }
  .paper-topline { font-size: 6px; }
  .close-letter { top: 10px; right: 19px; width: 30px; height: 30px; }
  .paper-content { padding-top: 23px; }
  h2 { font-size: 43px; }
  .letter-divider { margin-bottom: 13px; }
  .letter-body { font-size: 14px; line-height: 1.61; }
  .letter-body p { margin-bottom: 11px; }
  .paper-bottomline { font-size: 6px; letter-spacing: .1em; }
}
@media (max-height: 720px) and (min-width: 761px) {
  .stage { grid-template-rows: 36px auto minmax(265px, 1fr) 28px; padding-top: 15px; padding-bottom: 12px; }
  .dedication-intro { margin-top: 22px; }
  .eyebrow { margin-bottom: 8px; }
  h1 { font-size: clamp(37px, 4vw, 51px); }
  .intro-note { margin-top: 9px; }
  .surprise-zone { min-height: 280px; padding-top: 4px; }
  .sequence-note { margin-bottom: 12px; }
  .envelope-visual { width: min(300px, 36vw); }
  .envelope-caption { margin-top: 11px; }
}
@media (max-height: 520px) and (orientation: landscape) {
  .stage { grid-template-rows: 30px auto minmax(175px, 1fr) 24px; min-height: 100vh; min-height: 100svh; padding: 8px 24px; }
  .dedication-intro { margin-top: 3px; }
  .eyebrow { margin-bottom: 5px; }
  h1 { font-size: clamp(28px, 5.5vw, 42px); }
  .intro-note { margin-top: 5px; font-size: 10px; line-height: 1.35; }
  .surprise-zone { min-height: 175px; padding-top: 0; }
  .sequence-note { min-height: 15px; margin-bottom: 5px; font-size: 9px; }
  .envelope-visual { width: min(240px, 31vw); }
  .envelope-caption { gap: 3px; margin-top: 5px; }
  .envelope-caption__title { font-size: 19px; }
  .envelope-caption__action { margin-top: 1px; }
  .skip-button { bottom: 0; padding: 6px 10px; }
  .page-footer { min-height: 24px; }
  .toast--0 { top: 48%; }.toast--1 { top: 54%; }.toast--2 { top: 60%; }.toast--3 { top: 66%; }
  .toast--4 { top: 72%; }.toast--5 { top: 78%; }.toast--6 { top: 51%; }.toast--7 { top: 69%; }
}
@media (max-width: 760px) {
  .grain { display: none; }
  .masthead-tools { gap: 8px; }
  .music-toggle { padding: 7px 8px; }
  .music-panel { right: 14px; bottom: max(56px, calc(env(safe-area-inset-bottom) + 50px)); width: min(380px, calc(100vw - 28px)); padding: 11px; }
  .toast { backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px); }
  .toast.is-visible.is-background { opacity: .14; }
}
@media (max-height: 520px) and (orientation: landscape) {
  .stage { grid-template-rows: 30px auto minmax(166px, 1fr) 22px; padding: 6px 20px; }
  .masthead { min-height: 30px; }
  .dedication-intro { margin-top: 0; }
  h1 { font-size: clamp(26px, 4.2vw, 36px); }
  .surprise-zone { min-height: 166px; padding-top: 0; }
  .sequence-note { min-height: 14px; margin: 1px 0 4px; }
  .envelope-visual { width: min(150px, 19vw); }
  .envelope-caption { gap: 3px; margin-top: 4px; }
  .envelope-caption__overline { font-size: 7px; }
  .envelope-caption__title { font-size: 18px; }
  .envelope-caption__action { margin-top: 0; font-size: 9px; }
  .skip-button { bottom: 1px; padding: 5px 10px; }
  .page-footer { min-height: 22px; font-size: 8px; }
  .footer-actions { gap: 12px; }
  .text-button { font-size: 8px; }
}
.is-idle .scene-glow, .is-idle .envelope-halo, .is-idle .sequence-note__sparkle, .is-idle .letter-alert__icon, .is-idle .float-heart { animation-play-state: paused; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .float-heart { display: none; }
  .scene-glow, .envelope-halo { animation: none; }
}
