/* ==============================================================
   A LITTLE DIGITAL WORLD — stylesheet
   --------------------------------------------------------------
   01 fonts & tokens      07 our memories + lightbox
   02 base                08 the letter
   03 shared pieces       09 our song
   04 opening             10 one more thing
   05 desktop             11 secret + quiz
   06 windows             12 final reveal
                          13 editor, toast
                          14 responsive + reduced motion
   ============================================================== */


/* ---------- 01 · fonts & tokens ---------- */
@font-face { font-family: "Nunito"; src: url("../assets/fonts/nunito.woff2") format("woff2"); font-weight: 400 800; font-display: swap; }
@font-face { font-family: "DM Serif Display"; src: url("../assets/fonts/dm-serif-display.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "DM Serif Display"; src: url("../assets/fonts/dm-serif-display-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Caveat"; src: url("../assets/fonts/caveat.woff2") format("woff2"); font-weight: 500 700; font-display: swap; }

:root {
  --wine:   #641525;
  --cherry: #A91E3B;
  --rose:   #D94F70;
  --blush:  #F3A9BA;
  --cream:  #FFF7F1;
  --white:  #FFFDFB;
  --gold:   #D7AA55;
  --ink:    #35151D;

  --blush-10: #FDEEF1;
  --blush-20: #FAE0E6;
  --gold-20:  #F6EBD4;
  --ink-60:   rgba(53, 21, 29, .62);
  --ink-40:   rgba(53, 21, 29, .42);
  --line:     rgba(100, 21, 37, .14);
  --line-2:   rgba(100, 21, 37, .22);

  --f-ui:    "Nunito", ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-serif: "DM Serif Display", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --f-hand:  "Caveat", "Segoe Print", "Bradley Hand", cursive;
  --f-mono:  ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --r-lg: 22px;
  --r-md: 16px;
  --r-sm: 12px;

  --sh-win: 0 1px 0 rgba(255,255,255,.9) inset, 0 30px 60px -24px rgba(100,21,37,.42), 0 10px 24px -12px rgba(100,21,37,.22);
  --sh-card: 0 1px 1px rgba(53,21,29,.06), 0 14px 26px -14px rgba(100,21,37,.40);

  --ease-out: cubic-bezier(.2, .8, .2, 1);
  --ease-back: cubic-bezier(.34, 1.56, .64, 1);

  --paper-noise: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .39 0 0 0 0 .08 0 0 0 0 .15 0 0 0 .07 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}


/* ---------- 02 · base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html, body { overflow-x: hidden; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font: 400 16px/1.55 var(--f-ui);
  color: var(--ink);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
body.is-locked { overflow: hidden; }
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3, .h-serif, .intro__ask, .us-card__names { text-wrap: balance; }
p { text-wrap: pretty; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 2.5px solid var(--rose); outline-offset: 3px; border-radius: 10px; }
::selection { background: var(--blush); color: var(--wine); }

.hand  { font-family: var(--f-hand); font-weight: 600; }
.h-serif { font-family: var(--f-serif); font-weight: 400; letter-spacing: .005em; margin: 0; line-height: 1.12; }
.mono  { font-family: var(--f-mono); letter-spacing: .08em; }
.heart { color: var(--rose); }
.eyebrow {
  margin: 0 0 .25rem; font-size: .72rem; font-weight: 800; letter-spacing: .16em;
  text-transform: uppercase; color: var(--cherry);
}
.tag {
  display: inline-block; margin: 0 0 .6rem; padding: .35em .8em; border-radius: 999px;
  font-size: .72rem; font-weight: 700; color: var(--cherry); background: var(--blush-10);
  box-shadow: inset 0 0 0 1px rgba(169,30,59,.18);
}
.hint { margin: .6rem 0 0; font-size: .85rem; color: var(--ink-60); }

/* the paper ground — cream breathing space, faint grain, tiny stars */
.paper {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(1200px 700px at 12% -10%, rgba(243,169,186,.38), transparent 60%),
    radial-gradient(900px 600px at 105% 20%, rgba(215,170,85,.16), transparent 60%),
    radial-gradient(1000px 800px at 50% 120%, rgba(243,169,186,.30), transparent 60%),
    var(--paper-noise),
    var(--cream);
}
.paper__stars { position: absolute; inset: 0; }
.twinkle {
  position: absolute; width: var(--s, 10px); height: var(--s, 10px);
  background: var(--c, var(--gold));
  clip-path: polygon(50% 0, 61% 39%, 100% 50%, 61% 61%, 50% 100%, 39% 61%, 0 50%, 39% 39%);
  opacity: .55; animation: twinkle var(--d, 4s) ease-in-out infinite; animation-delay: var(--delay, 0s);
}
.twinkle--dot { clip-path: circle(50%); width: calc(var(--s) * .45); height: calc(var(--s) * .45); }
@keyframes twinkle { 0%,100% { opacity: .2; transform: scale(.7); } 50% { opacity: .75; transform: scale(1); } }

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


/* ---------- 03 · shared pieces ---------- */
.btn {
  --btn-bg: var(--white);
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  min-height: 48px; padding: .85em 1.6em; border: 0; border-radius: 999px;
  font-weight: 800; font-size: .95rem; letter-spacing: .08em; line-height: 1.1;
  text-decoration: none; white-space: nowrap; user-select: none;
  transition: transform .18s var(--ease-out), box-shadow .18s var(--ease-out), background-color .2s, color .2s;
}
.btn:active { transform: translateY(3px); }
.btn--primary {
  color: #fff;
  background: linear-gradient(180deg, #C12A4C 0%, var(--cherry) 60%, #97182F 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 4px 0 var(--wine), 0 14px 26px -12px rgba(100,21,37,.7);
}
.btn--primary:hover { box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 4px 0 var(--wine), 0 18px 30px -12px rgba(169,30,59,.75); }
.btn--primary:active { box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 1px 0 var(--wine), 0 6px 14px -8px rgba(100,21,37,.6); }
.btn--ghost {
  color: var(--cherry); background: var(--white);
  box-shadow: inset 0 0 0 1.5px rgba(169,30,59,.32), 0 3px 0 rgba(100,21,37,.14);
}
.btn--ghost:hover { background: var(--blush-10); }
.btn--gold {
  color: var(--wine);
  background: linear-gradient(180deg, #EFD08F 0%, var(--gold) 70%, #C4933C 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.55), 0 4px 0 #8E6A28, 0 16px 30px -12px rgba(215,170,85,.65);
}
.btn--gold:active { box-shadow: inset 0 1px 0 rgba(255,255,255,.55), 0 1px 0 #8E6A28; }
.btn--next {
  min-height: 44px; padding: .7em 1.2em; font-size: .82rem; letter-spacing: .06em;
  color: var(--cherry); background: transparent; box-shadow: inset 0 0 0 1.5px rgba(169,30,59,.25);
}
.btn--next::after { content: "→"; font-size: 1.05em; transition: transform .2s var(--ease-out); }
.btn--next:hover { background: var(--blush-10); }
.btn--next:hover::after { transform: translateX(3px); }
.btn--text { background: none; color: var(--ink-60); box-shadow: none; text-decoration: underline; text-underline-offset: 3px; }
.btn--sm { min-height: 44px; padding: .65em 1.15em; font-size: .8rem; letter-spacing: .05em; }
.btn--big { min-height: 56px; padding: 1em 2.1em; font-size: 1rem; letter-spacing: .12em; }

/* three little window controls — a heart, a gold bead, a blush bead */
.dots { display: inline-flex; gap: 7px; align-items: center; flex: none; }
.dots i { width: 11px; height: 11px; border-radius: 50%; background: var(--blush); box-shadow: inset 0 -1px 0 rgba(0,0,0,.08); }
.dots i:nth-child(1) {
  background: var(--cherry); border-radius: 0; width: 11px; height: 10px;
  clip-path: path("M5.5 10 C2 7.4 0 5.6 0 3.3 C0 1.4 1.5 0 3.2 0 C4.2 0 5 .5 5.5 1.3 C6 .5 6.8 0 7.8 0 C9.5 0 11 1.4 11 3.3 C11 5.6 9 7.4 5.5 10Z");
}
.dots i:nth-child(2) { background: var(--gold); }

.scene { position: relative; z-index: 1; }


/* ---------- 04 · opening ---------- */
.scene--intro {
  position: fixed; inset: 0; z-index: 5;
  display: grid; place-items: center;
  padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom));
  overflow: hidden;
}
.intro__deco { position: absolute; pointer-events: none; opacity: .95; }
.intro__deco--a { width: clamp(70px, 11vw, 150px); top: 8%; right: 8%; animation: bob 6s ease-in-out infinite; }
.intro__deco--b { width: clamp(64px, 9vw, 130px); bottom: 9%; left: 7%; animation: bob 7s ease-in-out infinite reverse; }
.intro__deco--c { width: clamp(56px, 7vw, 110px); top: 10%; left: 9%; transform: rotate(-14deg); animation: bob 8s ease-in-out infinite; }
@keyframes bob { 0%,100% { translate: 0 0; } 50% { translate: 0 -10px; } }

.browser {
  position: relative; width: min(100%, 440px);
  background: var(--white); border-radius: var(--r-lg);
  border: 1.5px solid var(--line-2); box-shadow: var(--sh-win);
  transform-origin: 50% 55%;
  animation: popIn .8s var(--ease-back) both .15s;
}
@keyframes popIn { from { opacity: 0; transform: translateY(18px) scale(.94); } to { opacity: 1; transform: none; } }
.browser__bar {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  border-bottom: 1.5px solid var(--line);
  background: linear-gradient(180deg, #FFFFFF, var(--blush-10));
  border-radius: calc(var(--r-lg) - 2px) calc(var(--r-lg) - 2px) 0 0;
}
.browser__url {
  flex: 1; min-width: 0; padding: 6px 12px; border-radius: 999px;
  font-size: .74rem; font-weight: 600; color: var(--ink-60);
  background: var(--cream); box-shadow: inset 0 0 0 1px var(--line);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.browser__url span { color: var(--rose); margin-right: 2px; }
.chip-edit {
  flex: none; min-height: 32px; padding: 0 10px; border: 0; border-radius: 999px;
  font-size: .72rem; font-weight: 700; color: var(--cherry); background: var(--blush-20);
}
.chip-edit:hover { background: var(--blush); color: var(--wine); }
.browser__body { padding: clamp(18px, 5vw, 30px) clamp(18px, 6vw, 36px) clamp(24px, 6vw, 36px); text-align: center; }
.intro__art { width: clamp(120px, 34vw, 170px); height: auto; margin: 0 auto 6px; filter: drop-shadow(0 10px 14px rgba(100,21,37,.14)); }
.intro__hey { margin: 0; font-family: var(--f-hand); font-weight: 600; font-size: clamp(1.35rem, 5vw, 1.6rem); color: var(--ink-60); }
.intro__ask { margin: .15rem 0 1.3rem; font: 400 clamp(1.9rem, 8vw, 2.5rem)/1.08 var(--f-serif); color: var(--wine); }
.intro__choices { display: flex; justify-content: center; align-items: center; gap: 14px; flex-wrap: wrap; min-height: 56px; }
.intro__choices .btn { min-width: 122px; }
#btnNo { position: relative; z-index: 3; transition: transform .38s var(--ease-back), background-color .2s, color .2s; }
.intro__note { min-height: 1.4em; margin: .9rem 0 0; font-family: var(--f-hand); font-size: 1.2rem; color: var(--rose); }

/* the window opens */
.browser.is-opening { animation: openUp 1s var(--ease-out) forwards; }
@keyframes openUp {
  0%   { transform: scale(1); opacity: 1; }
  30%  { transform: scale(1.04); opacity: 1; }
  100% { transform: scale(1.9); opacity: 0; filter: blur(4px); }
}
.scene--intro.is-leaving .intro__deco { transition: opacity .6s; opacity: 0; }

.float-heart {
  position: fixed; bottom: -30px; z-index: 6; pointer-events: none;
  font-size: var(--s, 18px); color: var(--c, var(--rose));
  animation: floatUp var(--d, 3.2s) ease-in forwards;
}
@keyframes floatUp {
  0%   { transform: translate(0, 0) rotate(0); opacity: 0; }
  12%  { opacity: 1; }
  100% { transform: translate(var(--dx, 0px), -105vh) rotate(var(--rot, 20deg)); opacity: 0; }
}

.come-in {
  position: fixed; inset: 0; z-index: 60; display: grid; place-items: center;
  pointer-events: none; opacity: 0; visibility: hidden;
  background: radial-gradient(closest-side, rgba(255,253,251,.95), rgba(255,247,241,.0));
}
.come-in p { margin: 0; font: 400 clamp(1.8rem, 7vw, 3rem)/1.1 var(--f-serif); color: var(--wine); text-align: center; padding: 0 20px; }
.come-in.is-on { visibility: visible; animation: comeIn 1.9s var(--ease-out) forwards; }
@keyframes comeIn {
  0%   { opacity: 0; transform: translateY(8px); }
  22%  { opacity: 1; transform: none; }
  78%  { opacity: 1; }
  100% { opacity: 0; transform: translateY(-6px); }
}


/* ---------- 05 · desktop ---------- */
.scene--desktop { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.scene--desktop.is-entering .us-card,
.scene--desktop.is-entering .sticky { animation: popIn .8s var(--ease-back) both; }
.scene--desktop.is-entering .sticky { animation-delay: .25s; }
.scene--desktop.is-entering .icon { animation: iconPop .6s var(--ease-back) both; animation-delay: calc(.35s + var(--i, 0) * .08s); }
@keyframes iconPop { from { opacity: 0; transform: translateY(14px) scale(.8); } to { opacity: 1; transform: none; } }

.menubar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  min-height: 46px; padding: max(6px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) 6px max(14px, env(safe-area-inset-left));
  background: rgba(255, 253, 251, .78);
  -webkit-backdrop-filter: blur(12px) saturate(1.2); backdrop-filter: blur(12px) saturate(1.2);
  border-bottom: 1px solid var(--line);
  font-size: .8rem; font-weight: 700;
}
.menubar__brand { display: flex; align-items: center; gap: 6px; color: var(--wine); letter-spacing: .02em; white-space: nowrap; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.menubar__right { display: flex; align-items: center; gap: 8px; min-width: 0; }
.menubar__progress { color: var(--ink-60); white-space: nowrap; font-weight: 600; }
.menubar__clock { color: var(--ink-60); font-variant-numeric: tabular-nums; white-space: nowrap; font-weight: 600; }
.menubar__edit {
  width: 36px; height: 36px; border: 0; border-radius: 50%; background: var(--blush-10); color: var(--cherry); font-size: .95rem;
}
.menubar__edit:hover { background: var(--blush-20); }
.now-playing {
  display: inline-flex; align-items: center; gap: 6px; max-width: 42vw; min-height: 32px;
  padding: 0 10px; border: 0; border-radius: 999px; font-size: .74rem; font-weight: 700;
  color: #fff; background: var(--cherry); box-shadow: 0 6px 14px -8px rgba(169,30,59,.8);
}
.now-playing__label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.now-playing.is-paused { background: var(--ink-40); }

.desk {
  position: relative; flex: 1;
  display: grid; gap: clamp(18px, 3vw, 28px);
  grid-template-columns: 1fr;
  align-content: start;
  width: 100%; max-width: 1180px; margin: 0 auto;
  padding: clamp(16px, 4vw, 40px) max(16px, env(safe-area-inset-right)) clamp(28px, 6vw, 56px) max(16px, env(safe-area-inset-left));
}
.desk__deco { position: absolute; pointer-events: none; z-index: 0; }
.desk__deco--stars { width: 150px; top: 8px; right: 4%; opacity: .75; }
.desk__deco--rose  { width: 96px; bottom: 10px; right: 3%; transform: rotate(18deg); }
.desk__deco--spark { width: 80px; top: 34%; left: 2%; opacity: .8; }

/* phones + tablets: card → icons → note (the note waits at the end) */
.desk__center { display: contents; }
.us-card { order: 1; justify-self: center; z-index: 1; }
.icons   { order: 2; }
.sticky  { order: 3; justify-self: center; z-index: 1; margin-top: 6px; }

.us-card {
  position: relative; width: min(100%, 460px);
  background: var(--white); border-radius: var(--r-lg);
  border: 1.5px solid var(--line-2); box-shadow: var(--sh-win);
}
.mini-bar {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px;
  border-bottom: 1.5px solid var(--line); border-radius: calc(var(--r-lg) - 2px) calc(var(--r-lg) - 2px) 0 0;
  background: linear-gradient(180deg, #FFFFFF, var(--blush-10));
}
.mini-bar__title { flex: 1; text-align: center; margin-right: 47px; font-size: .74rem; font-weight: 700; color: var(--ink-60); letter-spacing: .04em; }
.us-card__body {
  position: relative; padding: 14px clamp(16px, 5vw, 28px) 22px; text-align: center;
  background: radial-gradient(circle at 50% 38%, var(--blush-10), transparent 62%);
  border-radius: 0 0 var(--r-lg) var(--r-lg);
}
.us-card__ribbon { position: absolute; width: 62px; top: -26px; right: 14px; transform: rotate(14deg); filter: drop-shadow(0 4px 6px rgba(100,21,37,.18)); }
.us-card__art { width: clamp(140px, 42vw, 250px); height: auto; margin: 0 auto 4px; filter: drop-shadow(0 12px 16px rgba(100,21,37,.16)); }
.us-card__names { margin: 0; font: 400 clamp(1.75rem, 7vw, 2.4rem)/1.1 var(--f-serif); color: var(--wine); overflow-wrap: anywhere; }
.us-card__names .amp { color: var(--rose); font-size: .8em; }
.us-card__since { margin: .35rem 0 0; font-size: .9rem; font-weight: 700; color: var(--ink); }
.us-card__days { margin: .1rem 0 0; font-size: .82rem; color: var(--ink-60); }
.us-card__tag { margin: .5rem 0 0; font-size: 1.45rem; color: var(--rose); line-height: 1; }

.sticky {
  position: relative; width: min(100%, 300px); padding: 16px 18px 14px 18px;
  background: linear-gradient(180deg, #FFF3C9, #FDE9AE);
  border-radius: 4px 4px 18px 4px;
  box-shadow: 0 1px 1px rgba(0,0,0,.06), 0 12px 20px -12px rgba(120, 80, 10, .45);
  transform: rotate(-1.6deg);
}
.sticky::before { /* tape */
  content: ""; position: absolute; top: -10px; left: 50%; width: 78px; height: 22px; translate: -50% 0; rotate: 3deg;
  background: repeating-linear-gradient(45deg, rgba(243,169,186,.8) 0 7px, rgba(255,255,255,.6) 7px 14px);
  box-shadow: 0 1px 2px rgba(0,0,0,.06);
}
.sticky p { margin: 0; font-size: 1.3rem; line-height: 1.2; color: #5B3A12; }
.sticky b { color: var(--cherry); font-weight: 700; }
.sticky__hearts { position: absolute; width: 46px; right: -14px; bottom: -14px; transform: rotate(10deg); }

.icons {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px 8px;
  width: min(100%, 520px); margin: 0 auto;
}
/* five files: three on top, two centred beneath */
.icons .icon { grid-column: span 2; }
.icons .icon:nth-child(4) { grid-column: 2 / span 2; }
.icon {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px;
  min-height: 112px; padding: 10px 4px 8px; border: 0; border-radius: var(--r-md);
  background: transparent; color: var(--ink);
  transition: background-color .2s, transform .2s var(--ease-out);
}
.icon:hover { background: rgba(255,253,251,.7); box-shadow: inset 0 0 0 1px var(--line); }
.icon:active { transform: scale(.96); }
.icon__img { display: flex; align-items: center; justify-content: center; width: 70px; height: 64px; }
.icon__img img { max-width: 100%; max-height: 100%; width: auto; height: auto; filter: drop-shadow(0 6px 8px rgba(100,21,37,.18)); transition: transform .3s var(--ease-back); }
.icon:hover .icon__img img { transform: translateY(-3px) rotate(-3deg); }
.icon__label {
  padding: 3px 7px; border-radius: 7px; font-size: .68rem; font-weight: 800; letter-spacing: .07em; line-height: 1.2; text-align: center;
  background: rgba(255,253,251,.85); box-shadow: 0 0 0 1px var(--line);
}
.icon__seen {
  position: absolute; top: 6px; right: calc(50% - 44px);
  display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%;
  font-size: .7rem; color: #fff; background: var(--rose); box-shadow: 0 0 0 2px var(--white);
  transform: scale(0); transition: transform .35s var(--ease-back);
}
.icon.is-seen .icon__seen { transform: scale(1); }
.icon.is-next .icon__img img { animation: nudge 2.4s ease-in-out infinite 1.5s; }
@keyframes nudge { 0%,72%,100% { transform: none; } 78% { transform: translateY(-6px) rotate(-4deg); } 86% { transform: translateY(0) rotate(3deg); } 92% { transform: translateY(-2px); } }


/* ---------- 06 · windows ---------- */
.win-layer { position: fixed; inset: 0; z-index: 50; }
.win-backdrop {
  position: absolute; inset: 0;
  background: rgba(53, 21, 29, .26);
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
  animation: fadeIn .3s ease both;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* phones first: every window is a full-screen card */
.win {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  background: var(--white);
  animation: sheetUp .45s var(--ease-out) both;
  outline: none;
}
@keyframes sheetUp { from { opacity: 0; transform: translateY(26px); } to { opacity: 1; transform: none; } }
.win__bar {
  position: relative; flex: none; display: flex; align-items: center; gap: 10px;
  min-height: 54px; padding: max(8px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right)) 8px max(14px, env(safe-area-inset-left));
  border-bottom: 1.5px solid var(--line);
  background: linear-gradient(180deg, #FFFFFF, var(--blush-10));
  user-select: none; touch-action: none;
}
.win__bar::after { /* glass highlight */
  content: ""; position: absolute; left: 12px; right: 12px; top: 3px; height: 40%;
  border-radius: 12px; background: linear-gradient(180deg, rgba(255,255,255,.75), rgba(255,255,255,0)); pointer-events: none;
}
.win__title {
  flex: 1; min-width: 0; margin: 0; text-align: center;
  font-size: .8rem; font-weight: 800; letter-spacing: .06em; color: var(--ink-60);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.win__close {
  position: relative; z-index: 1; flex: none; display: grid; place-items: center;
  width: 44px; height: 44px; border: 0; border-radius: 50%;
  background: transparent; color: var(--ink-60); font-size: 1rem; font-weight: 700;
}
.win__close:hover { background: var(--blush-20); color: var(--cherry); }
.win__body {
  position: relative; flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden;
  overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
  padding: clamp(18px, 5vw, 32px) max(16px, env(safe-area-inset-right)) 28px max(16px, env(safe-area-inset-left));
}
.win__foot {
  flex: none; display: flex; justify-content: center;
  padding: 10px 16px max(12px, env(safe-area-inset-bottom));
  border-top: 1.5px solid var(--line); background: var(--cream);
}

/* bigger screens: floating windows you can drag by the title bar */
@media (min-width: 768px) {
  .win {
    inset: auto; left: 50%; top: 50%;
    width: min(calc(100vw - 64px), 820px);
    max-height: calc(100dvh - 72px);
    transform: translate(calc(-50% + var(--dx, 0px)), calc(-50% + var(--dy, 0px)));
    border-radius: var(--r-lg); border: 1.5px solid var(--line-2); box-shadow: var(--sh-win);
    animation: winIn .42s var(--ease-back) both;
  }
  @keyframes winIn {
    from { opacity: 0; transform: translate(calc(-50% + var(--dx, 0px)), calc(-50% + var(--dy, 0px) + 14px)) scale(.95); }
    to   { opacity: 1; transform: translate(calc(-50% + var(--dx, 0px)), calc(-50% + var(--dy, 0px))) scale(1); }
  }
  .win__bar { min-height: 50px; padding: 8px 8px 8px 16px; border-radius: calc(var(--r-lg) - 2px) calc(var(--r-lg) - 2px) 0 0; }
  .win__foot { border-radius: 0 0 calc(var(--r-lg) - 2px) calc(var(--r-lg) - 2px); }
  .win__body { padding: 30px 36px 32px; }
}
.win.is-settled { animation: none; }
@media (min-width: 768px) and (pointer: fine) {
  .win__bar { cursor: grab; }
  .win.is-dragging .win__bar { cursor: grabbing; }
  .win.is-dragging { transition: none; }
}


/* ---------- 07 · our memories ---------- */
.win__body--scrap {
  background:
    radial-gradient(rgba(100,21,37,.09) 1px, transparent 1.3px) 0 0 / 20px 20px,
    var(--cream);
}
.scrap__head {
  position: relative; display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 12px;
  max-width: 720px; margin: 0 auto 22px; padding-right: 64px;
}
.scrap__couple { width: clamp(86px, 24vw, 128px); height: auto; filter: drop-shadow(0 8px 10px rgba(100,21,37,.16)); }
.scrap__head .h-serif { font-size: clamp(1.7rem, 6vw, 2.3rem); color: var(--wine); }
.scrap__sub { margin: .2rem 0 0; font-size: 1.3rem; color: var(--rose); line-height: 1.1; }
.scrap__cam { position: absolute; right: 0; top: 50%; width: clamp(52px, 12vw, 76px); translate: 0 -50%; rotate: 10deg; }
.scrap__tip { margin: 22px 0 0; text-align: center; font-size: .8rem; color: var(--ink-40); }

.polaroids {
  list-style: none; margin: 0 auto; padding: 8px 8px 0;
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 26px 16px;
  max-width: 760px;
}
.polaroid {
  --r: 0deg;
  position: relative; display: block; width: 100%; padding: 8px 8px 0; border: 0;
  background: #fff; border-radius: 3px; text-align: center; color: var(--ink);
  box-shadow: var(--sh-card);
  transform: rotate(var(--r));
  transition: transform .35s var(--ease-back), box-shadow .3s;
}
.polaroid:hover, .polaroid:focus-visible { transform: rotate(0) scale(1.035); z-index: 2; box-shadow: 0 2px 2px rgba(53,21,29,.06), 0 22px 34px -16px rgba(100,21,37,.5); }
.polaroid__img { display: block; aspect-ratio: 4 / 5; overflow: hidden; background: var(--blush-10); }
.polaroid__img img { width: 100%; height: 100%; object-fit: cover; }
.polaroid__cap { display: block; padding: .45em .2em .6em; font-family: var(--f-hand); font-weight: 600; font-size: clamp(1.05rem, 3.6vw, 1.3rem); line-height: 1.1; min-height: 2.4em; display: grid; place-items: center; }
.polaroid::before { /* washi tape */
  content: ""; position: absolute; top: -11px; left: 50%; width: 62px; height: 22px; translate: -50% 0; rotate: var(--tr, -4deg);
  background: var(--tape, repeating-linear-gradient(45deg, rgba(243,169,186,.82) 0 6px, rgba(255,255,255,.6) 6px 12px));
  box-shadow: 0 1px 2px rgba(0,0,0,.07); z-index: 1;
}
.polaroids li:nth-child(3n+2) .polaroid::before { --tape: repeating-linear-gradient(90deg, rgba(215,170,85,.72) 0 5px, rgba(255,247,241,.72) 5px 10px); --tr: 5deg; }
.polaroids li:nth-child(3n) .polaroid::before   { --tape: rgba(217,79,112,.5); --tr: -9deg; left: 24%; }
.polaroid__sticker { position: absolute; width: 38px; right: -10px; bottom: 2.6em; rotate: 12deg; pointer-events: none; }

/* lightbox */
.lightbox {
  position: fixed; inset: 0; z-index: 70;
  display: grid; grid-template-columns: 1fr; place-items: center;
  padding: 64px 16px 72px;
  background: rgba(53, 21, 29, .82);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  animation: fadeIn .25s ease both;
}
.lightbox__card {
  position: relative; margin: 0; padding: 12px 12px 0; background: #fff; border-radius: 4px;
  width: min(100%, calc((100dvh - 200px) * .8), 560px);
  box-shadow: 0 30px 60px -20px rgba(0,0,0,.5);
  animation: lbIn .4s var(--ease-back) both;
}
.lightbox__card.is-swap { animation: lbSwap .35s var(--ease-out) both; }
@keyframes lbIn { from { opacity: 0; transform: scale(.9) rotate(-2deg); } to { opacity: 1; transform: rotate(-.6deg); } }
@keyframes lbSwap { from { opacity: 0; transform: translateX(var(--from, 20px)) rotate(-.6deg); } to { opacity: 1; transform: rotate(-.6deg); } }
.lightbox__card img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; background: var(--blush-10); }
.lightbox__card figcaption { padding: .5em .3em .7em; text-align: center; font-size: clamp(1.3rem, 5vw, 1.7rem); line-height: 1.1; color: var(--ink); }
.lightbox__tape { position: absolute; top: -12px; left: 50%; width: 90px; height: 26px; translate: -50% 0; rotate: -3deg; background: repeating-linear-gradient(45deg, rgba(243,169,186,.85) 0 7px, rgba(255,255,255,.65) 7px 14px); }
.lightbox__close, .lightbox__nav {
  position: absolute; display: grid; place-items: center; width: 48px; height: 48px; border: 0; border-radius: 50%;
  background: rgba(255,253,251,.14); color: #fff; font-size: 1.1rem; font-weight: 700;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.25);
}
.lightbox__close:hover, .lightbox__nav:hover { background: rgba(255,253,251,.26); }
.lightbox__close { top: max(12px, env(safe-area-inset-top)); right: 12px; }
.lightbox__nav { bottom: max(14px, env(safe-area-inset-bottom)); font-size: 1.9rem; line-height: 1; padding-bottom: 4px; }
.lightbox__nav--prev { left: calc(50% - 110px); }
.lightbox__nav--next { right: calc(50% - 110px); }
.lightbox__count { position: absolute; bottom: max(26px, calc(env(safe-area-inset-bottom) + 12px)); left: 50%; translate: -50% 0; margin: 0; color: rgba(255,255,255,.75); font-size: .78rem; }
@media (min-width: 768px) {
  .lightbox { padding: 48px 110px; }
  .lightbox__nav { top: 50%; bottom: auto; translate: 0 -50%; }
  .lightbox__nav--prev { left: 28px; }
  .lightbox__nav--next { right: 28px; }
  .lightbox__count { bottom: 18px; }
}


/* ---------- 08 · the letter ---------- */
.win__body--letter { background: radial-gradient(circle at 50% 22%, var(--blush-10), transparent 55%), var(--white); }
.env-stage { display: grid; justify-items: center; text-align: center; padding: 6px 0 10px; }
.env-stage__to { margin: 0 0 18px; font-size: clamp(1.8rem, 7vw, 2.4rem); line-height: 1.05; color: var(--wine); }
.envelope {
  position: relative; width: min(78vw, 330px); aspect-ratio: 640 / 506; padding: 0; border: 0; background: none;
  margin-top: clamp(56px, 12vw, 80px);
  filter: drop-shadow(0 16px 20px rgba(100,21,37,.2));
  animation: envFloat 3.2s ease-in-out infinite;
}
.envelope:hover { animation-play-state: paused; }
@keyframes envFloat { 0%,100% { transform: translateY(0) rotate(-1deg); } 50% { transform: translateY(-7px) rotate(1deg); } }
.envelope img { position: absolute; left: 50%; bottom: 0; translate: -50% 0; width: 100%; height: auto; transition: opacity .35s ease, transform .5s var(--ease-back); }
.envelope__open { width: 66% !important; opacity: 0; transform: scale(.9); transform-origin: 50% 100%; }
.envelope__paper {
  position: absolute; left: 50%; bottom: 18%; width: 50%; aspect-ratio: 3 / 3.4; translate: -50% 0;
  display: grid; place-items: start center; padding-top: 12%;
  background: repeating-linear-gradient(transparent 0 13px, rgba(169,30,59,.12) 13px 14px), #FFFCF7;
  border-radius: 4px; box-shadow: 0 2px 8px rgba(100,21,37,.15);
  opacity: 0; transform: translateY(0); transition: transform .8s var(--ease-out), opacity .3s;
  z-index: -1;
}
.envelope__paper .hand { font-size: 1.2rem; color: var(--cherry); }
.envelope.is-wiggle { animation: wiggle .6s ease-in-out; }
@keyframes wiggle { 0%,100% { transform: rotate(0); } 20% { transform: rotate(-6deg) scale(1.03); } 40% { transform: rotate(5deg); } 60% { transform: rotate(-4deg); } 80% { transform: rotate(2deg); } }
.envelope.is-open { animation: none; cursor: default; }
.envelope.is-open .envelope__closed { opacity: 0; transform: scale(.94); }
.envelope.is-open .envelope__open { opacity: 1; transform: scale(1); }
.envelope.is-open .envelope__paper { opacity: 1; transform: translateY(-50%); }

.letter { position: relative; max-width: 640px; margin: 0 auto; animation: letterIn .8s var(--ease-out) both; }
@keyframes letterIn { from { opacity: 0; transform: translateY(40px) scale(.96); } to { opacity: 1; transform: none; } }
.letter__paper {
  position: relative; z-index: 1;
  padding: 30px clamp(20px, 5vw, 44px) 32px clamp(30px, 7vw, 60px);
  background:
    linear-gradient(90deg, transparent calc(clamp(20px, 5vw, 42px) - 1px), rgba(217,79,112,.35) calc(clamp(20px, 5vw, 42px) - 1px) clamp(20px, 5vw, 42px), transparent clamp(20px, 5vw, 42px)),
    repeating-linear-gradient(180deg, transparent 0 31px, rgba(100,21,37,.09) 31px 32px),
    #FFFCF7;
  background-position: 0 0, 0 25px, 0 0; /* rules sit under each 32px line */
  border-radius: 6px;
  box-shadow: 0 1px 0 rgba(255,255,255,.8) inset, 0 2px 2px rgba(53,21,29,.05), 0 24px 40px -22px rgba(100,21,37,.45);
}
.letter__greet { margin: 0; font-size: 1.75rem; line-height: 32px; color: var(--cherry); }
.letter__text p {
  margin: 0 0 32px; font-size: clamp(1rem, 3.6vw, 1.07rem); line-height: 32px; color: var(--ink);
  opacity: 0; transform: translateY(8px); transition: opacity .9s ease, transform .9s var(--ease-out);
}
.letter__text p.is-in { opacity: 1; transform: none; }
.letter__sign { margin: 0; text-align: right; line-height: 32px; font-size: 1.55rem; color: var(--ink-60); opacity: 0; transition: opacity 1s ease; }
.letter__sign.is-in { opacity: 1; }
.letter__signer { color: var(--cherry); font-size: 1.9rem; }
.letter__sticker { position: relative; z-index: 2; width: 120px; height: auto; margin: -8px auto -26px; filter: drop-shadow(0 8px 10px rgba(100,21,37,.18)); }
.letter__rose { position: absolute; z-index: 2; width: 64px; right: 4px; bottom: -24px; rotate: 24deg; pointer-events: none; }
@media (min-width: 560px) { .letter__rose { width: 72px; right: -10px; } }
@media (min-width: 900px) {
  .letter { padding-right: 0; }
  .letter__sticker { position: absolute; width: 150px; left: -128px; top: 40px; margin: 0; rotate: -6deg; }
  .win__body--letter .letter { margin-left: max(120px, calc(50% - 250px)); }
}


/* ---------- 09 · our song ---------- */
.win__body--song { background: radial-gradient(circle at 50% 0%, var(--blush-10), transparent 60%), var(--white); }
.song { display: grid; gap: 22px; justify-items: center; max-width: 720px; margin: 0 auto; }
.song__art-wrap { position: relative; }
.song__art { width: clamp(170px, 50vw, 240px); height: auto; filter: drop-shadow(0 12px 16px rgba(100,21,37,.16)); }
.song__notes-art { position: absolute; width: 64px; right: -38px; top: 0; rotate: 10deg; animation: bob 5s ease-in-out infinite; }

.player {
  position: relative; width: min(100%, 440px); padding: 20px;
  border-radius: 26px; color: var(--ink);
  background: linear-gradient(160deg, #FFFFFF 0%, var(--blush-10) 100%);
  box-shadow: inset 0 0 0 1.5px var(--line), 0 1px 0 #fff inset, 0 24px 40px -24px rgba(100,21,37,.5);
  transition: box-shadow .6s ease;
}
.player.is-playing {
  box-shadow: inset 0 0 0 1.5px rgba(217,79,112,.4), 0 0 0 6px rgba(243,169,186,.22), 0 0 44px 4px rgba(217,79,112,.28), 0 24px 40px -24px rgba(100,21,37,.5);
  animation: glowPulse 3.2s ease-in-out infinite;
}
@keyframes glowPulse { 50% { box-shadow: inset 0 0 0 1.5px rgba(217,79,112,.4), 0 0 0 9px rgba(243,169,186,.16), 0 0 60px 8px rgba(215,170,85,.26), 0 24px 40px -24px rgba(100,21,37,.5); } }
.player__top { display: flex; align-items: center; gap: 16px; }
.vinyl {
  position: relative; flex: none; width: 88px; height: 88px; border-radius: 50%;
  background:
    radial-gradient(circle, var(--cherry) 0 22%, transparent 22.5%),
    repeating-radial-gradient(circle, #2a0f16 0 2px, #3a1520 2px 4px);
  box-shadow: 0 8px 16px -6px rgba(53,21,29,.6), inset 0 0 0 3px #1d0a0f;
  animation: spin 3.4s linear infinite; animation-play-state: paused;
}
.vinyl::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: conic-gradient(from 30deg, transparent 0 10%, rgba(255,255,255,.14) 14%, transparent 20% 60%, rgba(255,255,255,.1) 64%, transparent 70%); }
.vinyl__label { position: absolute; inset: 0; display: grid; place-items: center; color: var(--gold); font-size: .9rem; }
.player.is-playing .vinyl { animation-play-state: running; }
@keyframes spin { to { transform: rotate(360deg); } }
.player__meta { min-width: 0; }
.player__title { margin: 0; font: 400 clamp(1.35rem, 5vw, 1.6rem)/1.15 var(--f-serif); color: var(--wine); overflow-wrap: anywhere; }
.player__artist { margin: 2px 0 8px; font-size: .84rem; color: var(--ink-60); }

.eq { display: inline-flex; align-items: flex-end; gap: 3px; height: 18px; }
.eq i { width: 4px; height: 30%; border-radius: 2px; background: linear-gradient(180deg, var(--gold), var(--rose)); transition: height .3s; }
.is-playing .eq i, .now-playing:not(.is-paused) .eq i { animation: eq 1s ease-in-out infinite; }
.eq i:nth-child(2) { animation-delay: -.3s !important; }
.eq i:nth-child(3) { animation-delay: -.6s !important; }
.eq i:nth-child(4) { animation-delay: -.15s !important; }
.eq i:nth-child(5) { animation-delay: -.45s !important; }
@keyframes eq { 0%,100% { height: 25%; } 50% { height: 100%; } }
.eq--mini { height: 12px; }
.eq--mini i { width: 3px; background: #fff; }

.player__progress { margin-top: 16px; }
.player__times { display: flex; justify-content: space-between; margin-top: 4px; font-size: .74rem; font-weight: 700; color: var(--ink-60); font-variant-numeric: tabular-nums; }
.range {
  --p: 0%;
  -webkit-appearance: none; appearance: none; display: block; width: 100%; height: 28px; margin: 0; background: transparent; cursor: pointer;
}
.range::-webkit-slider-runnable-track { height: 6px; border-radius: 999px; background: linear-gradient(90deg, var(--rose), var(--cherry)) 0 0 / var(--p) 100% no-repeat, rgba(100,21,37,.12); }
.range::-moz-range-track { height: 6px; border-radius: 999px; background: rgba(100,21,37,.12); }
.range::-moz-range-progress { height: 6px; border-radius: 999px; background: linear-gradient(90deg, var(--rose), var(--cherry)); }
.range::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; margin-top: -6px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 2px var(--cherry), 0 3px 6px rgba(100,21,37,.35); }
.range::-moz-range-thumb { width: 16px; height: 16px; border: 0; border-radius: 50%; background: #fff; box-shadow: 0 0 0 2px var(--cherry), 0 3px 6px rgba(100,21,37,.35); }

.player__controls { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 10px; }
.play {
  display: inline-flex; align-items: center; gap: 10px; min-height: 54px; padding: 0 22px 0 16px; border: 0; border-radius: 999px;
  font-weight: 800; letter-spacing: .12em; font-size: .9rem; color: #fff;
  background: linear-gradient(180deg, #C12A4C, var(--cherry) 60%, #97182F);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 4px 0 var(--wine), 0 14px 22px -12px rgba(100,21,37,.7);
  transition: transform .15s;
}
.play:active { transform: translateY(3px); box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 1px 0 var(--wine); }
.play__icon { width: 22px; height: 22px; fill: currentColor; }
.play__icon--pause { display: none; }
.player.is-playing .play__icon--play { display: none; }
.player.is-playing .play__icon--pause { display: block; }
.vol { display: flex; align-items: center; gap: 6px; flex: 1; max-width: 170px; min-width: 0; }
.vol__btn { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 50%; background: transparent; color: var(--cherry); }
.vol__btn:hover { background: var(--blush-20); }
.vol__btn svg { width: 22px; height: 22px; fill: currentColor; }
.vol__btn.is-muted .vol__wave { opacity: .15; }
.player__err { margin: 12px 0 0; font-size: .8rem; color: var(--cherry); text-align: center; }
.player__err code { font-size: .74rem; background: var(--blush-10); padding: 1px 5px; border-radius: 5px; }

.player__notes { position: absolute; inset: 0; pointer-events: none; overflow: visible; }
.note {
  position: absolute; bottom: calc(100% - 6px); left: var(--x, 20%); font-size: var(--s, 18px); color: var(--c, var(--rose));
  animation: noteUp var(--d, 3s) ease-out forwards; opacity: 0;
}
@keyframes noteUp {
  0% { transform: translate(0, 0) rotate(0); opacity: 0; }
  15% { opacity: .95; }
  100% { transform: translate(var(--dx, 10px), -120px) rotate(var(--rot, 15deg)); opacity: 0; }
}


/* ---------- 10 · one more thing ---------- */
.win__body--surprise { display: grid; background: radial-gradient(circle at 50% 30%, var(--gold-20), transparent 60%), var(--white); }
.surprise { display: grid; align-content: center; justify-items: center; text-align: center; min-height: min(62dvh, 520px); gap: 8px; }
.s-load { display: grid; justify-items: center; gap: 6px; width: min(100%, 360px); }
.s-wait { font-size: clamp(2.4rem, 11vw, 3.6rem); color: var(--wine); opacity: 0; }
.s-more { margin: 0; font-size: clamp(1.05rem, 4vw, 1.25rem); font-weight: 700; color: var(--ink); opacity: 0; }
.s-in { animation: rise .8s var(--ease-out) forwards; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.loadbar { width: 100%; height: 12px; margin-top: 18px; padding: 2px; border-radius: 999px; background: var(--white); box-shadow: inset 0 0 0 1.5px var(--line-2); opacity: 0; }
.loadbar i { display: block; height: 100%; width: 0; border-radius: 999px; background: repeating-linear-gradient(-45deg, var(--rose) 0 8px, var(--cherry) 8px 16px); transition: width .2s linear; }
.s-pct { margin: 4px 0 0; font-size: .74rem; color: var(--ink-60); opacity: 0; }

.s-gift { display: grid; justify-items: center; gap: 20px; animation: rise .7s var(--ease-out) both; }
.gift { position: relative; width: clamp(170px, 48vw, 230px); aspect-ratio: 547 / 600; }
.gift img { position: absolute; left: 50%; bottom: 0; translate: -50% 0; height: auto; transition: opacity .3s, transform .6s var(--ease-back); }
.gift__closed { width: 100%; animation: giftBob 2.2s ease-in-out infinite; transform-origin: 50% 100%; }
.gift__open { width: 80%; opacity: 0; transform: scale(.85); transform-origin: 50% 100%; }
.gift__glow { position: absolute; inset: -20%; border-radius: 50%; background: radial-gradient(circle, rgba(215,170,85,.55), rgba(243,169,186,.25) 45%, transparent 68%); opacity: 0; transform: scale(.6); transition: opacity .6s, transform .9s var(--ease-out); }
@keyframes giftBob { 0%,100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-8px) rotate(-2deg); } }
.gift.is-shake .gift__closed { animation: shake .55s ease-in-out; }
@keyframes shake { 0%,100% { transform: rotate(0); } 20% { transform: rotate(-7deg) scale(1.03); } 40% { transform: rotate(6deg) scale(1.05); } 60% { transform: rotate(-5deg) scale(1.06); } 80% { transform: rotate(3deg) scale(1.04); } }
.gift.is-open .gift__closed { opacity: 0; transform: scale(1.1); animation: none; }
.gift.is-open .gift__open { opacity: 1; transform: scale(1); }
.gift.is-open .gift__glow { opacity: 1; transform: scale(1); animation: halo 3s ease-in-out infinite 1s; }
@keyframes halo { 50% { transform: scale(1.08); opacity: .8; } }
.s-gift.is-done { gap: 0; }
.s-gift.is-done .gift { width: clamp(120px, 30vw, 160px); transition: width .6s var(--ease-out); }

.s-reveal { display: grid; justify-items: center; gap: 10px; width: min(100%, 420px); margin-top: 8px; }
.notif {
  display: flex; gap: 12px; align-items: flex-start; width: 100%; padding: 14px 16px; text-align: left;
  background: rgba(255,255,255,.92); border-radius: 20px;
  box-shadow: inset 0 0 0 1px var(--line), 0 20px 36px -18px rgba(100,21,37,.45);
  animation: notifIn .7s var(--ease-back) both;
}
@keyframes notifIn { from { opacity: 0; transform: translateY(-24px) scale(.94); } to { opacity: 1; transform: none; } }
.notif__icon { flex: none; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; color: #fff; font-size: 1.2rem; background: linear-gradient(160deg, var(--rose), var(--cherry)); box-shadow: inset 0 1px 0 rgba(255,255,255,.35); }
.notif__body { min-width: 0; flex: 1; }
.notif__top { display: flex; justify-content: space-between; gap: 8px; margin: 0; font-size: .72rem; color: var(--ink-60); text-transform: uppercase; letter-spacing: .06em; }
.notif__top strong { font-weight: 800; }
.notif__from { margin: 3px 0 0; font-weight: 800; font-size: .95rem; }
.notif__text { margin: 1px 0 0; font-size: clamp(1rem, 3.8vw, 1.1rem); line-height: 1.35; }
.s-after { margin: 10px 0 0; font-size: clamp(1.4rem, 5.4vw, 1.75rem); line-height: 1.1; color: var(--wine); opacity: 0; }
.s-couple { width: clamp(150px, 42vw, 200px); height: auto; opacity: 0; filter: drop-shadow(0 12px 14px rgba(100,21,37,.16)); }
.s-pop { animation: iconPop .7s var(--ease-back) forwards; }


/* ---------- 11 · secret + quiz ---------- */
.win__body--secret { background: radial-gradient(circle at 50% 0%, var(--blush-10), transparent 55%), var(--white); }
.lock, .granted, .quiz { display: grid; justify-items: center; text-align: center; max-width: 440px; margin: 0 auto; }
.lock__art { width: clamp(78px, 22vw, 104px); height: auto; margin-bottom: 10px; filter: drop-shadow(0 10px 12px rgba(100,21,37,.2)); }
.lock.is-shake .lock__art, .lock.is-shake .pin { animation: shakeX .45s ease-in-out; }
@keyframes shakeX { 20% { transform: translateX(-9px); } 40% { transform: translateX(8px); } 60% { transform: translateX(-6px); } 80% { transform: translateX(4px); } }
.lock.is-open .lock__art { animation: unlock .7s var(--ease-back) forwards; }
@keyframes unlock { 40% { transform: translateY(-6px) rotate(-10deg) scale(1.1); } 100% { transform: scale(0); opacity: 0; } }
.lock__title { font-size: clamp(1.6rem, 6.5vw, 2rem); color: var(--wine); }
.lock__hint { margin: 8px 0 18px; font-size: .88rem; color: var(--ink-60); }
.pin { display: flex; gap: 12px; justify-content: center; min-height: 20px; }
.pin i { width: 16px; height: 16px; border-radius: 50%; box-shadow: inset 0 0 0 2px var(--rose); transition: background-color .15s, transform .2s var(--ease-back); }
.pin i.is-on { background: var(--cherry); box-shadow: inset 0 0 0 2px var(--cherry); transform: scale(1.12); }
.lock.is-open .pin i { background: var(--gold); box-shadow: inset 0 0 0 2px var(--gold); }
.pin__msg { min-height: 1.5em; margin: 8px 0 6px; font-family: var(--f-hand); font-size: 1.25rem; color: var(--cherry); }
.keypad { display: grid; grid-template-columns: repeat(3, 64px); gap: 12px; justify-content: center; }
.keypad button {
  width: 64px; height: 64px; border: 0; border-radius: 50%;
  font-size: 1.4rem; font-weight: 700; color: var(--wine);
  background: var(--white); box-shadow: inset 0 0 0 1.5px var(--line-2), 0 3px 0 rgba(100,21,37,.12);
  transition: transform .1s, background-color .15s;
}
.keypad button:hover { background: var(--blush-10); }
.keypad button:active { transform: translateY(2px); box-shadow: inset 0 0 0 1.5px var(--line-2); background: var(--blush-20); }
.keypad .keypad__ok { color: #fff; background: var(--cherry); box-shadow: 0 3px 0 var(--wine); }
.keypad .keypad__ok:hover { background: #bb2446; }

.granted { animation: rise .7s var(--ease-out) both; }
.granted__stamp {
  display: inline-block; margin: 4px 0 16px; padding: .5em 1em; border-radius: 10px;
  font-size: .95rem; font-weight: 800; color: var(--wine); background: var(--gold-20); box-shadow: inset 0 0 0 1.5px rgba(215,170,85,.75), 0 6px 14px -8px rgba(215,170,85,.8);
  animation: stamp .55s var(--ease-back) both;
}
@keyframes stamp { from { opacity: 0; transform: scale(1.6) rotate(-6deg); } to { opacity: 1; transform: rotate(-2deg); } }
.granted__intro { font-size: clamp(1.45rem, 5.6vw, 1.85rem); color: var(--wine); opacity: 0; animation: rise .9s var(--ease-out) .6s forwards; }
.granted__note {
  position: relative; margin: 18px 0 22px; padding: 22px 22px 22px 26px; text-align: left;
  font-size: clamp(1rem, 3.8vw, 1.08rem); line-height: 1.7; color: var(--ink);
  background: #FFFCF7; border-radius: 6px; box-shadow: var(--sh-card);
  border-left: 4px solid var(--gold);
  opacity: 0; animation: rise 1s var(--ease-out) 1.5s forwards;
}
#btnQuiz { opacity: 0; animation: rise .8s var(--ease-out) 2.6s forwards; }

.quiz { animation: rise .6s var(--ease-out) both; }
.quiz__title { font-size: clamp(1.45rem, 6vw, 1.9rem); color: var(--wine); letter-spacing: .01em; }
.quiz__steps { display: flex; gap: 8px; list-style: none; padding: 0; margin: 14px 0 18px; }
.quiz__steps li { width: 26px; height: 6px; border-radius: 999px; background: rgba(100,21,37,.12); transition: background-color .3s; }
.quiz__steps li.is-done { background: var(--rose); }
.quiz__steps li.is-now { background: var(--gold); }
.quiz__card { width: 100%; }
.quiz__q { margin: 0 0 14px; font: 400 clamp(1.3rem, 5.4vw, 1.6rem)/1.2 var(--f-serif); color: var(--ink); animation: rise .45s var(--ease-out) both; }
.quiz__opts { display: grid; gap: 10px; }
.quiz__opt {
  min-height: 52px; padding: .7em 1em; border: 0; border-radius: 16px;
  font-weight: 800; font-size: 1rem; color: var(--wine); background: var(--white);
  box-shadow: inset 0 0 0 1.5px var(--line-2), 0 3px 0 rgba(100,21,37,.1);
  transition: transform .15s, background-color .2s, color .2s, box-shadow .2s;
  animation: rise .45s var(--ease-out) both; animation-delay: calc(var(--i) * .07s);
}
.quiz__opt:hover:not(:disabled) { background: var(--blush-10); }
.quiz__opt.is-picked { color: #fff; background: var(--cherry); box-shadow: 0 3px 0 var(--wine); }
.quiz__opt.is-wrong { color: var(--ink-60); background: var(--blush-10); }
.quiz__opt:disabled { cursor: default; }
.quiz__reply { min-height: 1.3em; margin: 14px 0 0; font-family: var(--f-hand); font-size: 1.4rem; line-height: 1.15; color: var(--cherry); animation: rise .5s var(--ease-out) both; }
.quiz__done { display: grid; justify-items: center; gap: 4px; animation: rise .7s var(--ease-out) both; }
.quiz__score { margin: 20px 0 2px; font: 400 clamp(1.8rem, 8vw, 2.5rem)/1.1 var(--f-serif); color: var(--cherry); animation: stamp .6s var(--ease-back) both; }
.quiz__line { margin: 0; font-size: clamp(1.4rem, 5.4vw, 1.7rem); color: var(--wine); }
.quiz__couple { width: clamp(140px, 40vw, 180px); height: auto; margin: 6px 0 14px; }


/* ---------- 12 · final reveal ---------- */
.scene--finale {
  position: fixed; inset: 0; z-index: 80; overflow-y: auto; overflow-x: hidden;
  display: grid; place-items: center;
  padding: max(28px, env(safe-area-inset-top)) 20px max(32px, env(safe-area-inset-bottom));
  color: var(--cream);
  background:
    radial-gradient(900px 520px at 50% -8%, rgba(217,79,112,.38), transparent 62%),
    radial-gradient(900px 600px at 50% 112%, rgba(169,30,59,.75), transparent 62%),
    radial-gradient(600px 400px at 50% 42%, rgba(215,170,85,.12), transparent 70%),
    linear-gradient(180deg, #43091A 0%, var(--wine) 48%, #7A1730 100%);
  animation: fadeIn 1.4s ease both;
}
.scene--finale::before { content: ""; position: fixed; inset: 0; background: var(--paper-noise); opacity: .6; pointer-events: none; mix-blend-mode: soft-light; }
.finale__glitter { position: fixed; inset: 0; pointer-events: none; }
.finale__glitter .twinkle { opacity: .7; }
.finale__inner { position: relative; display: grid; justify-items: center; text-align: center; width: min(100%, 560px); }
.finale__art {
  width: clamp(150px, 42vw, 230px); height: auto; margin-bottom: 18px;
  filter: drop-shadow(0 0 26px rgba(215,170,85,.45)) drop-shadow(0 16px 20px rgba(0,0,0,.3));
  opacity: 0; animation: rise 1.4s var(--ease-out) .6s forwards;
}
.finale__lines { display: grid; gap: 6px; min-height: 5.6em; }
.finale__lines p { margin: 0; font-size: clamp(1.05rem, 4.2vw, 1.3rem); color: rgba(255,247,241,.86); opacity: 0; transform: translateY(8px); transition: opacity 1.1s ease, transform 1.1s var(--ease-out); }
.finale__lines p:last-child { font: 400 clamp(1.7rem, 7vw, 2.5rem)/1.15 var(--f-serif); color: #fff; margin-top: 6px; }
.finale__lines p.is-in, .finale__names.is-in, .finale__msg.is-in, #btnReplay.is-in { opacity: 1; transform: none; }
.finale__names {
  margin: 22px 0 6px; font: italic 400 clamp(1.8rem, 8vw, 2.7rem)/1.1 var(--f-serif);
  color: var(--gold);
  background: linear-gradient(90deg, #C99440, #F4DDA2 45%, #D7AA55 70%, #C99440);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  opacity: 0; transform: translateY(8px); transition: opacity 1.2s ease, transform 1.2s var(--ease-out);
  overflow-wrap: anywhere;
}
.finale__names .amp { -webkit-text-fill-color: var(--blush); font-style: normal; font-size: .75em; }
.finale__msg { margin: 0 0 26px; max-width: 30ch; font-family: var(--f-hand); font-size: clamp(1.45rem, 5.4vw, 1.9rem); line-height: 1.2; color: var(--blush); opacity: 0; transform: translateY(8px); transition: opacity 1.2s ease, transform 1.2s var(--ease-out); }
#btnReplay { opacity: 0; transform: translateY(8px); transition: opacity 1s ease, transform 1s var(--ease-out); white-space: normal; text-align: center; }
.scene--finale.is-leaving { animation: fadeOut .9s ease forwards; }
@keyframes fadeOut { to { opacity: 0; } }


/* ---------- 13 · editor, toast ---------- */
.editor { position: fixed; inset: 0; z-index: 100; background: rgba(53,21,29,.35); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); animation: fadeIn .25s ease both; }
.editor__panel {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  background: var(--white); animation: sheetUp .4s var(--ease-out) both;
}
@media (min-width: 768px) {
  .editor__panel { inset: 16px 16px 16px auto; width: min(460px, calc(100vw - 32px)); border-radius: var(--r-lg); box-shadow: var(--sh-win); overflow: hidden; }
}
.editor__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: max(14px, env(safe-area-inset-top)) 12px 10px 20px; border-bottom: 1.5px solid var(--line); background: linear-gradient(180deg, #fff, var(--blush-10)); }
.editor__head .h-serif { font-size: 1.6rem; color: var(--wine); }
.editor__tabs { display: flex; gap: 6px; overflow-x: auto; padding: 10px 14px; border-bottom: 1px solid var(--line); scrollbar-width: none; }
.editor__tabs::-webkit-scrollbar { display: none; }
.editor__tabs button { flex: none; min-height: 38px; padding: 0 14px; border: 0; border-radius: 999px; font-size: .8rem; font-weight: 800; color: var(--ink-60); background: transparent; box-shadow: inset 0 0 0 1px var(--line); }
.editor__tabs button[aria-selected="true"] { color: #fff; background: var(--cherry); box-shadow: none; }
.editor__body { flex: 1; min-height: 0; overflow-y: auto; padding: 16px 20px 24px; overscroll-behavior: contain; }
.epane { display: none; }
.epane.is-on { display: grid; gap: 14px; }
.epane__note { margin: 0; font-size: .84rem; color: var(--ink-60); line-height: 1.5; }
.field { display: grid; gap: 5px; }
.field > span { font-size: .75rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--cherry); }
.field small { font-size: .74rem; color: var(--ink-40); }
.field input[type="text"], .field input[type="date"], .field textarea, .ed-mem input, .ed-q input {
  width: 100%; min-height: 44px; padding: 10px 12px; border: 0; border-radius: 12px;
  font-size: 16px; background: var(--cream); box-shadow: inset 0 0 0 1.5px var(--line-2);
}
.field textarea { resize: vertical; line-height: 1.5; }
.field input:focus, .field textarea:focus, .ed-mem input:focus, .ed-q input:focus { outline: none; box-shadow: inset 0 0 0 2px var(--rose); background: #fff; }
.field--file input { font-size: .85rem; }
.ed-mems { display: grid; gap: 12px; }
.ed-mem { display: grid; grid-template-columns: 72px 1fr auto; gap: 10px; align-items: center; padding: 8px; border-radius: 14px; background: var(--cream); box-shadow: inset 0 0 0 1px var(--line); }
.ed-mem__thumb { position: relative; width: 72px; aspect-ratio: 4 / 5; border-radius: 6px; overflow: hidden; background: var(--blush-10); cursor: pointer; }
.ed-mem__thumb img { width: 100%; height: 100%; object-fit: cover; }
.ed-mem__thumb span { position: absolute; inset: auto 0 0; padding: 2px; font-size: .62rem; font-weight: 800; text-align: center; color: #fff; background: rgba(100,21,37,.7); }
.ed-mem__thumb input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.ed-mem__del { width: 40px; height: 40px; border: 0; border-radius: 50%; background: transparent; color: var(--ink-60); }
.ed-mem__del:hover { background: var(--blush-20); color: var(--cherry); }
.ed-quiz { display: grid; gap: 12px; margin-top: 6px; }
.ed-quiz > p { margin: 8px 0 0; font-size: .75rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--cherry); }
.ed-q { display: grid; gap: 6px; padding: 10px; border-radius: 14px; background: var(--cream); box-shadow: inset 0 0 0 1px var(--line); }
.ed-q small { font-size: .72rem; color: var(--ink-40); }
.ed-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.ed-import { position: relative; overflow: hidden; }
.ed-import input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.editor__foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 16px max(12px, env(safe-area-inset-bottom)) 20px; border-top: 1.5px solid var(--line); background: var(--cream); }
.editor__status { margin: 0; font-size: .8rem; color: var(--cherry); min-width: 0; flex: 1; }
.editor__foot-btns { display: flex; gap: 8px; flex: none; }
.ed-steps { margin: 0; padding-left: 1.2em; display: grid; gap: 10px; font-size: .88rem; line-height: 1.5; color: var(--ink); }
.ed-steps b { color: var(--cherry); }
.ed-steps li::marker { color: var(--rose); font-weight: 800; }

.toast {
  position: fixed; left: 50%; bottom: max(20px, env(safe-area-inset-bottom)); z-index: 110;
  max-width: calc(100vw - 32px); padding: 12px 18px; border-radius: 14px;
  font-size: .88rem; font-weight: 700; color: #fff; background: var(--ink);
  box-shadow: 0 16px 30px -12px rgba(53,21,29,.6);
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none; transition: opacity .3s, transform .3s var(--ease-out);
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }


/* ---------- 14 · responsive ---------- */
@media (max-width: 359px) {
  .icons { gap: 10px 4px; }
  .icon__label { font-size: .6rem; letter-spacing: .04em; padding: 3px 5px; }
  .icon__img { width: 60px; height: 56px; }
  .keypad { grid-template-columns: repeat(3, 58px); gap: 10px; }
  .keypad button { width: 58px; height: 58px; }
  .menubar__progress { display: none; }
  .intro__choices .btn { min-width: 108px; }
  .polaroids { gap: 22px 12px; }
  .player { padding: 16px; }
  .vinyl { width: 72px; height: 72px; }
  .vol { max-width: 110px; }
}
@media (max-width: 479px) {
  .intro__deco--c { display: none; }
  .desk__deco--spark { display: none; }
  .desk__deco--stars { width: 96px; right: 2%; top: 2px; opacity: .55; }
  .desk__deco--rose { width: 64px; bottom: 4px; right: 2%; }
  .menubar__clock { display: none; }
  .play__text { display: none; }
  .play { padding: 0 16px; }
}
@media (min-width: 560px) {
  .polaroids { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 30px 20px; }
}
@media (min-width: 768px) {
  .icons { grid-template-columns: repeat(5, minmax(0, 1fr)); width: min(100%, 680px); }
  .icons .icon, .icons .icon:nth-child(4) { grid-column: auto; }
  .icon { min-height: 124px; }
  .icon__img { width: 78px; height: 70px; }
  .polaroid { padding: 10px 10px 0; }
  .polaroids { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 34px 22px; }
  .song { grid-template-columns: auto 1fr; align-items: center; gap: 32px; }
  .song__art { width: 230px; }
}
@media (min-width: 1024px) {
  .desk {
    grid-template-columns: 200px minmax(0, 1fr); column-gap: 24px;
    grid-template-areas: "icons center";
    align-items: start; align-content: center; min-height: calc(100dvh - 46px);
    padding-top: 36px; padding-bottom: 48px;
  }
  .icons { grid-area: icons; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; gap: 14px 10px; margin: 0; }
  .icons .icon:last-child { grid-column: 1 / -1; }
  .desk__center { position: relative; z-index: 1; display: grid; grid-area: center; grid-template-columns: minmax(0, 430px) minmax(170px, 224px); align-items: start; justify-content: center; gap: 22px; }
  .us-card { width: 100%; }
  .sticky { margin-top: 70px; }
  .desk__deco--stars { width: 190px; right: 3%; top: 16px; }
  .desk__deco--rose { width: 120px; right: 4%; bottom: 36px; }
  .desk__deco--spark { width: 100px; top: auto; bottom: 60px; left: 26%; }
  .us-card__art { width: 270px; }
}
@media (min-width: 1280px) {
  .desk { grid-template-columns: 232px minmax(0, 1fr); column-gap: 32px; }
  .desk__center { grid-template-columns: minmax(0, 480px) 250px; gap: 28px; }
}
@media (min-width: 1440px) {
  .desk { max-width: 1320px; grid-template-columns: 260px minmax(0, 1fr); }
  .desk__center { grid-template-columns: minmax(0, 520px) 270px; gap: 40px; }
  .us-card__art { width: 300px; }
  .win { width: min(calc(100vw - 64px), 900px); }
}
/* short, wide screens (landscape phones) */
@media (max-height: 520px) and (orientation: landscape) {
  .intro__art { width: 96px; }
  .intro__ask { margin-bottom: .8rem; }
  .browser__body { padding-top: 12px; padding-bottom: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important; animation-iteration-count: 1 !important;
    animation-delay: 0s !important; transition-duration: .15s !important; scroll-behavior: auto !important;
  }
  .twinkle { opacity: .5; }
}
