/* Snuggle Sanctuary. Colours are taken from the shopfront painting:
   plum woodwork, honey lamplight, dusky rose, cream plaster, deep night blue. */

@font-face { font-family: "Fraunces"; font-style: normal; font-weight: 300 700; font-display: swap; src: url(../fonts/fraunces-normal-latin.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Fraunces"; font-style: normal; font-weight: 300 700; font-display: swap; src: url(../fonts/fraunces-normal-latin-ext.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Fraunces"; font-style: italic; font-weight: 300 700; font-display: swap; src: url(../fonts/fraunces-italic-latin.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Fraunces"; font-style: italic; font-weight: 300 700; font-display: swap; src: url(../fonts/fraunces-italic-latin-ext.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Nunito"; font-style: normal; font-weight: 400 800; font-display: swap; src: url(../fonts/nunito-normal-latin.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Nunito"; font-style: normal; font-weight: 400 800; font-display: swap; src: url(../fonts/nunito-normal-latin-ext.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Nunito"; font-style: italic; font-weight: 400 800; font-display: swap; src: url(../fonts/nunito-italic-latin.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --paper: #f6ecdc;
  --paper-2: #efe2c9;
  --card: #fbf5ea;
  --ink: #3a2a33;
  --ink-soft: #6f5a64;
  --plum: #6e2f4f;
  --plum-2: #8a4466;
  --rose: #c9858f;
  --honey: #e0a650;
  --heart: #b8323b;
  --kraft: #d9bb8e;
  --line: #c9b49a;
  --night: #1f2540;
  --sea: #8fb2c9;
  --land: #e2d3b2;
  --btn: var(--plum);
  --btn-ink: #fbf1e3;
  --soft-btn: #ead8bf;
  --soft-ink: var(--plum);
  --shadow: 0 2px 0 rgba(58, 42, 51, .08), 0 8px 24px rgba(58, 42, 51, .10);
  --radius: 16px;
  --display: "Fraunces", Georgia, "Times New Roman", serif;
  --body: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #1f2338; --paper-2: #2a2e47; --card: #2b2a42; --ink: #f3e7d6; --ink-soft: #c4b3bd;
    --plum: #d7a3bd; --plum-2: #e6b9cf; --line: #5b5470; --btn: #a2557c; --btn-ink: #fff4e8;
    --soft-btn: #3a3653; --soft-ink: #f0d7e2; --land: #3d3c56; --sea: #2f4a66; --kraft: #b89a6f;
    --shadow: 0 2px 0 rgba(0, 0, 0, .2), 0 8px 24px rgba(0, 0, 0, .35);
  }
}
:root[data-theme="dark"] {
  --paper: #1f2338; --paper-2: #2a2e47; --card: #2b2a42; --ink: #f3e7d6; --ink-soft: #c4b3bd;
  --plum: #d7a3bd; --plum-2: #e6b9cf; --line: #5b5470; --btn: #a2557c; --btn-ink: #fff4e8;
  --soft-btn: #3a3653; --soft-ink: #f0d7e2; --land: #3d3c56; --sea: #2f4a66; --kraft: #b89a6f;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100dvh; background: var(--paper); color: var(--ink);
  font: 400 1.0625rem/1.5 var(--body); -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}
body.locked { overflow: hidden; }
#app { max-width: 480px; margin: 0 auto; min-height: 100dvh; }
h1, h2, .greeting, .cover-title, .cert-title, .cert-name { font-family: var(--display); font-weight: 600; letter-spacing: .005em; }
h1 { font-size: 1.35rem; margin: 0; }
h2 { font-size: 1.2rem; margin: 0 0 .25rem; }
p { margin: .4rem 0; }
em { font-style: italic; }
img { max-width: 100%; display: block; }
button { font: inherit; color: inherit; }
.small { font-size: .875rem; color: var(--ink-soft); }
.loading { min-height: 100dvh; background: var(--paper); }
.boot-error { padding: 2rem 1rem; font-family: var(--display); font-size: 1.2rem; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  min-height: 48px; padding: .7rem 1.1rem; border: 0; border-radius: 999px;
  background: var(--btn); color: var(--btn-ink); font-weight: 700; font-size: 1rem;
  box-shadow: 0 2px 0 rgba(0, 0, 0, .15); cursor: pointer; width: 100%; text-align: center;
  touch-action: manipulation;
}
.btn.soft { background: var(--soft-btn); color: var(--soft-ink); box-shadow: none; }
.btn.glow { background: linear-gradient(180deg, #e9b562, #d18f3a); color: #3a2410; }
.btn:disabled { opacity: .45; }
.btn:active { transform: translateY(1px); }
.btn svg, .link svg { width: 18px; height: 18px; }
.btn.huge { min-height: 72px; font-size: 1.4rem; }
.link { background: none; border: 0; padding: .6rem 0; min-height: 44px; color: var(--plum); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; display: inline-flex; gap: .35rem; align-items: center; }
.icon-btn { width: 44px; height: 44px; border: 0; border-radius: 50%; background: transparent; display: grid; place-items: center; cursor: pointer; color: var(--ink); }
.icon-btn svg { width: 24px; height: 24px; }
.row2 { display: flex; gap: .6rem; margin: .6rem 0; }
.row2 > * { flex: 1; }
.choice {
  display: flex; align-items: center; gap: .6rem; width: 100%; min-height: 48px; margin: .4rem 0; padding: .7rem .9rem;
  border: 2px solid var(--line); border-radius: 14px; background: var(--card); text-align: left; cursor: pointer; font-family: var(--display); font-size: 1.02rem;
}
.choice img { width: 48px; height: 48px; object-fit: contain; }
.choice.picked { border-color: var(--plum); background: color-mix(in srgb, var(--rose) 18%, var(--card)); }
.field { display: block; margin: .8rem 0; }
.field span { display: block; font-size: .95rem; color: var(--ink-soft); margin-bottom: .3rem; }
.field input, .field textarea {
  width: 100%; font: 400 1.05rem/1.4 var(--display); padding: .7rem .8rem; border-radius: 12px;
  border: 2px solid var(--line); background: var(--card); color: var(--ink);
}
.switch { display: flex; gap: .7rem; align-items: center; min-height: 44px; }
.switch input { width: 22px; height: 22px; accent-color: var(--plum); }
.tick { display: flex; gap: .6rem; align-items: center; min-height: 44px; margin: .5rem 0; }
.tick input { width: 22px; height: 22px; accent-color: var(--plum); }

/* ---------- the shopfront ---------- */
.shopfront { padding-bottom: calc(1.2rem + var(--safe-bottom)); }
.scene { position: relative; aspect-ratio: 2 / 3; overflow: hidden; background: var(--night); }
.scene-art { width: 100%; height: 100%; object-fit: cover; }
.scene-layer { position: absolute; inset: 0; }
.settings-btn { position: absolute; top: calc(8px + var(--safe-top)); right: 8px; background: rgba(251, 245, 234, .82); color: #3a2a33; z-index: 3; }
.hotspot { position: absolute; border: 0; background: transparent; padding: 0; cursor: pointer; min-width: 44px; min-height: 44px; }
.hotspot svg, .hotspot img { width: 100%; height: auto; filter: drop-shadow(0 3px 3px rgba(0, 0, 0, .25)); }
.doorstep-item { animation: settle .8s ease-out both; }
.doorstep-item .mini-tag { position: absolute; right: 8%; top: 18%; width: 22%; height: 26%; background: var(--kraft); border-radius: 3px 6px 6px 3px; transform: rotate(14deg); box-shadow: 0 1px 2px rgba(0, 0, 0, .3); }
.envelope { animation: slide-in 1s ease-out both; }
.window-toy { position: absolute; transform: translateY(-100%); -webkit-mask-image: radial-gradient(closest-side, #000 62%, transparent 100%); mask-image: radial-gradient(closest-side, #000 62%, transparent 100%); filter: saturate(1.1); }
.figure { position: absolute; width: 10%; opacity: .85; }
.lamp-glow { position: absolute; width: 1px; height: 1px; pointer-events: none; }
.lamp-glow::after {
  content: ""; position: absolute; left: -60px; top: -60px; width: 120px; height: 120px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 214, 140, calc(.12 + var(--lamp, 3) * .1)) 0%, rgba(255, 214, 140, 0) 70%);
  animation: lamp 4s ease-in-out infinite alternate;
}
.night-veil { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(12, 16, 40, .55), rgba(12, 16, 40, .25)); pointer-events: none; }
.detail { position: absolute; pointer-events: none; }
.detail-fairy-lights { left: 40%; top: 48%; width: 31%; height: 8px; background: radial-gradient(circle, #ffe9a8 2px, transparent 3px) 0 0 / 14px 8px repeat-x; filter: drop-shadow(0 0 4px #ffd27a); }
.detail-candle { left: 66%; top: 61%; width: 6px; height: 14px; background: #f4e7cf; border-radius: 2px; box-shadow: 0 -8px 8px #ffcf6a; }
.detail-window-cat { left: 47%; top: 69%; width: 12%; height: 4%; background: #6d5a50; border-radius: 50% 50% 10% 10%; }
.detail.painted { background: none; height: auto; border-radius: 0; filter: drop-shadow(0 2px 2px rgba(0,0,0,.25)); }
.detail-window-cat.painted { left: 60%; top: 62.5%; width: 10%; }
.detail-geranium.painted { left: 65%; top: 36%; width: 6%; }
.detail-bunting { left: 2%; top: 37%; width: 96%; height: 5%; background: linear-gradient(135deg, var(--rose) 25%, transparent 25%) 0 0 / 24px 20px, linear-gradient(225deg, var(--honey) 25%, transparent 25%) 12px 0 / 24px 20px; }

.voice { display: flex; gap: .8rem; align-items: flex-start; padding: 1rem 16px .2rem; }
.mrs-p { width: 64px; height: 64px; object-fit: cover; object-position: 50% 15%; border-radius: 50%; background: var(--card); box-shadow: var(--shadow); flex: none; }
.bubble-text { flex: 1; }
.greeting { font-size: 1.12rem; line-height: 1.4; margin: 0 0 .35rem; }
.summary { color: var(--ink-soft); margin: 0; }
.rooms-nav { padding: .6rem 16px 0; display: grid; gap: .1rem; }
.count-dots { letter-spacing: .15em; color: var(--honey); }
.cards-below { padding: 0 16px; }
.note-card { background: var(--card); border-radius: var(--radius); padding: .9rem 1rem; margin: .9rem 0; box-shadow: var(--shadow); }
.note-card .quote { font-family: var(--display); font-style: italic; }
.note-card.birthday { background: color-mix(in srgb, var(--honey) 25%, var(--card)); }
.deco .choices { display: grid; gap: .1rem; }

/* ---------- pages ---------- */
.page { min-height: 100dvh; padding-bottom: calc(1.5rem + var(--safe-bottom)); background: var(--paper); animation: fade-in .25s ease-out; }
.page-head { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: .3rem; padding: calc(6px + var(--safe-top)) 8px 6px; background: var(--paper); border-bottom: 1px solid color-mix(in srgb, var(--line) 50%, transparent); }
.page-head h1 { flex: 1; text-align: center; font-size: 1.2rem; }
.page-head .spacer { width: 44px; }
.page-body { padding: 0 16px; }
.room-art { width: calc(100% + 32px); margin: 0 -16px; aspect-ratio: 2 / 3; object-fit: cover; max-height: 46vh; }
.empty-room { color: var(--ink-soft); font-family: var(--display); font-style: italic; padding: 1.2rem .2rem; }

/* ---------- toy cards ---------- */
.toy-card { background: var(--card); border-radius: 20px; box-shadow: var(--shadow); margin: 1rem 0; overflow: hidden; }
.toy-pic { position: relative; aspect-ratio: 1; overflow: hidden; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; touch-action: none; }
.toy-card .toy-pic { touch-action: auto; }
.toy-pic img { width: 100%; height: 100%; object-fit: cover; transition: filter .6s, transform .3s; filter: saturate(calc(.9 + var(--warm, 0) * .04)) brightness(calc(.98 + var(--warm, 0) * .008)); pointer-events: none; }
.toy-pic.shy img { transform: scaleX(-1) rotate(-4deg); filter: saturate(.8) brightness(.95); }
.toy-pic.cuddling img { transform: scale(.94, .9); filter: saturate(1.15) sepia(.12); animation: beat .7s ease-in-out infinite; }
.toy-pic.cuddled img { transform: none; }
.toy-pic.sleepy img { filter: brightness(.85) saturate(.9); }
.toy-pic.sleepy::after { content: "z z z"; position: absolute; right: 18%; top: 14%; font-family: var(--display); font-style: italic; color: var(--plum); font-size: 1.4rem; animation: float 2s ease-in-out infinite; }
.toy-pic.drying::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(255, 200, 120, .35), transparent 60%); animation: fade-in 1.2s; }
.toy-pic .after-img { position: absolute; inset: 0; opacity: 0; transition: opacity 1.4s ease-in-out; }
.toy-pic.transform .after-img { opacity: 1; }
.toy-pic .worn { position: absolute; left: 30%; top: 40%; width: 40%; height: auto; }
.worn-chip { position: absolute; left: 10px; bottom: 10px; background: var(--kraft); color: #3a2a33; font-family: var(--display); font-size: .85rem; padding: .2rem .6rem; border-radius: 4px; }
.nightcap { position: absolute; left: 34%; top: 2%; width: 32%; transform: rotate(-12deg); }
.toy-info { padding: .8rem 1rem 1rem; }
.toy-line { font-family: var(--display); font-style: italic; font-size: 1.08rem; color: var(--ink); }
.stitches { width: 150px; height: 16px; display: block; margin: .15rem 0 .35rem; }
.care-btns { display: grid; gap: .5rem; margin: .7rem 0 .3rem; }
.story-so-far summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; color: var(--plum); font-weight: 700; }
.story-so-far p { font-family: var(--display); }
.room-foot { margin: 1rem 0; }
.decor-note { color: var(--ink-soft); font-size: .95rem; }

/* care gestures */
.hold-ring { position: absolute; inset: 8%; pointer-events: none; opacity: 0; }
.hold-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.hold-ring circle { fill: none; stroke: var(--heart); stroke-width: 2; stroke-dasharray: 290; stroke-dashoffset: 290; opacity: .7; }
.hold-ring.go { opacity: 1; }
.hold-ring.go circle { transition: stroke-dashoffset var(--ms, 1.4s) linear; stroke-dashoffset: 0; }
.stitch-layer { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.stitch-guide { stroke: #fff; stroke-width: 1.4; stroke-dasharray: 2 2.4; fill: none; opacity: .9; filter: drop-shadow(0 0 1px #000); }
.stitch-done path { stroke: var(--heart); stroke-width: 1.6; stroke-linecap: round; }
.bubble-layer { position: absolute; inset: 0; pointer-events: none; }
.bubble { position: absolute; border-radius: 50%; background: radial-gradient(circle at 30% 30%, #fff 0 15%, rgba(255, 255, 255, .35) 40%, rgba(180, 210, 255, .25) 70%); border: 1px solid rgba(255, 255, 255, .7); animation: bubble 2.6s ease-out forwards; }
.care-sheet .toy-pic.big { border-radius: 20px; max-width: 360px; margin: 0 auto; touch-action: none; }
.care-sheet .hint, .first-cuddle .hint { text-align: center; color: var(--ink-soft); }
.care-sheet .headline { font-family: var(--display); font-size: 1.3rem; text-align: center; margin-top: 1rem; }
.care-sheet .story, .reveal .story { font-family: var(--display); }
.told { font-family: var(--display); font-style: italic; text-align: center; }

/* ---------- sheets ---------- */
.sheet-wrap { position: fixed; inset: 0; z-index: 50; }
.sheet-dim { position: absolute; inset: 0; background: rgba(20, 16, 30, .45); opacity: 0; transition: opacity .2s; }
.sheet { position: absolute; left: 0; right: 0; bottom: 0; max-width: 480px; margin: 0 auto; max-height: 92dvh; overflow: auto; background: var(--paper); border-radius: 22px 22px 0 0; padding: 0 16px calc(1.2rem + var(--safe-bottom)); transform: translateY(100%); transition: transform .25s cubic-bezier(.2, .8, .2, 1); box-shadow: 0 -10px 40px rgba(0, 0, 0, .25); }
.sheet-wrap.tall .sheet { min-height: 70dvh; }
.sheet-wrap.open .sheet { transform: none; }
.sheet-wrap.open .sheet-dim { opacity: 1; }
.sheet-wrap.closing .sheet { transform: translateY(100%); }
.sheet-wrap.closing .sheet-dim { opacity: 0; }
.sheet-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; padding: .7rem 0 .4rem; background: var(--paper); }
.sheet-head h2 { margin: 0; font-size: 1.2rem; }
.sheet-head::before { content: ""; position: absolute; top: 6px; left: 50%; width: 40px; height: 4px; margin-left: -20px; border-radius: 4px; background: var(--line); }

/* ---------- the luggage tag ---------- */
.tag { position: relative; background: var(--kraft); color: #3a2a33; padding: 1rem 1rem 1rem 2.6rem; margin: .8rem 0; clip-path: polygon(22px 0, 100% 0, 100% 100%, 22px 100%, 0 calc(100% - 18px), 0 18px); transform: rotate(-.6deg); box-shadow: var(--shadow); }
.tag-hole { position: absolute; left: 14px; top: 50%; width: 14px; height: 14px; margin-top: -7px; border-radius: 50%; background: var(--paper); box-shadow: 0 0 0 3px #b9965f; }
.tag-text p { margin: .2rem 0; }
.tag-line { font-family: var(--display); font-size: 1.05rem; }
.tag.big .tag-line { font-size: 1.15rem; }
.tag-by, .tag-when { font-size: .9rem; color: #5d4a40; }
.tag-name { font-family: var(--display); font-weight: 600; font-size: 1.1rem; }
.first-cuddle .toy-pic { border-radius: 20px; max-width: 320px; margin: .4rem auto; }
.reveal { animation: fade-in .6s ease-out; }

/* ---------- window ---------- */
.window-view { position: relative; margin: 0 -16px; }
.window-frame { aspect-ratio: 4 / 3; background: linear-gradient(180deg, #2a2f52, #4c3d5c 60%, #7a4a58); padding: 18px; border-bottom: 14px solid var(--plum); }
.window-frame .pane { height: 100%; border: 10px solid var(--plum); border-radius: 50% 50% 6px 6px / 22% 22% 6px 6px; background: radial-gradient(circle at 70% 70%, #ffd791, #e9a35b 40%, #9c5c4b 100%); }
.seat { position: absolute; left: 12%; right: 12%; bottom: 13%; display: flex; justify-content: center; gap: 4%; }
.seat-toy { width: 42%; -webkit-mask-image: radial-gradient(closest-side, #000 60%, transparent 100%); mask-image: radial-gradient(closest-side, #000 60%, transparent 100%); animation: settle .8s ease-out both; }
.window-cards { margin-top: .6rem; }
.letter-card .btn { margin-top: .5rem; }

/* ---------- takeovers (opaque from the first frame) ---------- */
.takeover { position: fixed; inset: 0; z-index: 60; background: var(--paper); overflow: auto; max-width: 480px; margin: 0 auto; padding-bottom: calc(1.5rem + var(--safe-bottom)); }
.take-body { padding: 0 16px; }
.lead { font-family: var(--display); font-size: 1.1rem; }
.letter { background: var(--card); border-radius: 6px; padding: 1.1rem 1.1rem 1rem; margin: 1rem 0; box-shadow: var(--shadow); background-image: repeating-linear-gradient(transparent 0 31px, color-mix(in srgb, var(--line) 40%, transparent) 31px 32px); background-position: 0 10px; }
.letter-from { font-size: .9rem; color: var(--ink-soft); }
.letter-body { font-family: var(--display); font-size: 1.12rem; line-height: 32px; }
.cert-frame { background: var(--card) center / 100% 100% no-repeat; border: 3px double var(--rose); border-radius: 8px; padding: 1.6rem 1.2rem; text-align: center; margin: 1rem 0; }
.cert-title { font-size: 1.5rem; color: var(--plum); margin-bottom: .6rem; }
.cert-name { font-size: 2rem; color: var(--plum); margin: .2rem 0; }
.cert-line { margin: .2rem 0; }
.cert-date { font-family: var(--display); font-style: italic; color: var(--ink-soft); }
.sig-wrap { margin-top: 1rem; }
.sig { width: 100%; height: auto; aspect-ratio: 600 / 180; background: rgba(255, 255, 255, .35); border-bottom: 2px solid var(--ink-soft); touch-action: none; border-radius: 8px 8px 0 0; }
.sig-line { font-size: .85rem; color: var(--ink-soft); }
.goodbye { text-align: center; }
.goodbye .toy-pic { border-radius: 20px; max-width: 320px; margin: 1rem auto; }
.toy-pic.leaving img { transition: transform 1s ease-in, opacity 1s ease-in; transform: translateX(60%) scale(.6); opacity: 0; }
.polaroid { background: #fffdf7; padding: 12px 12px 18px; box-shadow: var(--shadow); transform: rotate(-1.5deg); margin: 1rem auto; max-width: 360px; color: #3a2a33; }
.polaroid img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
.polaroid figcaption { font-family: var(--display); font-style: italic; text-align: center; margin-top: .5rem; }
.card-preview img { width: 100%; border-radius: 8px; box-shadow: var(--shadow); margin-bottom: .8rem; }
.image-view img { width: 100%; padding: 16px; }

/* ---------- album ---------- */
.album-cover { text-align: center; padding: 1.6rem 1rem; margin: 1rem 0; background: var(--card); border-radius: 8px 18px 18px 8px; box-shadow: var(--shadow); border-left: 10px solid var(--plum); }
.cover-title { font-size: 1.8rem; color: var(--plum); margin: 0; }
.cover-line { font-family: var(--display); font-style: italic; }
.heart-mark { width: 28px; height: 28px; margin: .4rem auto 0; display: block; }
.album-page { background: var(--paper-2) center / cover; border-radius: 6px; padding: 1rem; margin: 1.2rem 0; box-shadow: var(--shadow); }
.album-meta { font-family: var(--display); text-align: center; }
.postcard-mini { display: flex; gap: .7rem; align-items: center; width: 100%; background: #fbf5e8; color: #3a2a33; border: 0; border-radius: 6px; padding: .5rem; margin: .5rem 0; text-align: left; font-family: var(--display); font-size: .95rem; box-shadow: var(--shadow); cursor: pointer; }
.postcard-mini img { width: 84px; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 3px; flex: none; }
.finder-note { font-family: var(--display); font-style: italic; color: var(--ink-soft); }
.postcard-sheet .pc-front { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 6px; }
.pc-back { position: relative; background: #fbf5e8; color: #3a2a33; padding: 1rem 5.5rem 1rem 1rem; border-radius: 6px; margin-top: .6rem; font-family: var(--display); font-size: 1.05rem; box-shadow: var(--shadow); }
.pc-back .stamp { position: absolute; right: 12px; top: 12px; width: 62px; }
.gift-note { font-family: var(--display); font-style: italic; }
.map svg { width: 100%; height: auto; border-radius: 8px; box-shadow: var(--shadow); }
.map-label { font: 600 9px var(--body); fill: var(--ink); }
.map figcaption { font-family: var(--display); font-style: italic; text-align: center; color: var(--ink-soft); }

/* ---------- welcome back, gate, shutters, helpers ---------- */
.welcome, .gate, .shutters-room { display: flex; flex-direction: column; }
.fireside img { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; max-height: 58dvh; }
.mrs-p-big { width: min(70%, 300px); margin: calc(2rem + var(--safe-top)) auto 0; cursor: default; }
.welcome-text { padding: 1rem 16px; }
.three { padding-left: 1.1rem; font-family: var(--display); font-size: 1.05rem; }
.three li { margin: .4rem 0; }
.shutter-art { height: 46dvh; background: repeating-linear-gradient(180deg, #7a4a64 0 18px, #5f3650 18px 22px); border-bottom: 10px solid var(--plum); }
.helpers .helper-toys { padding: 0 16px; }
.helper-card { text-align: center; margin: 1rem 0 2rem; }
.helper-card .toy-pic { border-radius: 24px; }
.big-name { font-family: var(--display); font-size: 2rem; margin: .5rem 0; }
.big-text { font-family: var(--display); font-size: 1.6rem; text-align: center; padding: 3rem 1rem; }

/* ---------- toasts, sparkles ---------- */
.toast { position: fixed; left: 50%; bottom: calc(24px + var(--safe-bottom)); transform: translate(-50%, 20px); max-width: min(440px, calc(100% - 32px)); background: var(--ink); color: var(--paper); padding: .8rem 1rem; border-radius: 14px; opacity: 0; transition: .3s; z-index: 90; font-family: var(--display); text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.sparkle-layer { position: fixed; inset: 0; pointer-events: none; z-index: 95; }
.sparkle { position: absolute; color: #f6cf6b; text-shadow: 0 0 6px #ffe7a0; animation: sparkle 1.3s ease-out both; }

/* ---------- debug ---------- */
.debug { position: fixed; left: 0; top: 42%; z-index: 99; max-width: 464px; font: 12px/1.4 ui-monospace, Menlo, monospace; }
.dbg-toggle { background: #222; color: #eee; border: 0; border-radius: 0 8px 8px 0; width: 28px; min-height: 36px; opacity: .6; }
.dbg-when { background: #222; color: #eee; padding: 4px 8px; border-radius: 6px; margin-left: 4px; }
.dbg-body { background: rgba(20, 20, 30, .94); color: #eee; padding: 8px; border-radius: 8px; margin-top: 4px; }
.dbg-row { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.dbg-row button { background: #444; color: #fff; border: 0; border-radius: 6px; padding: 6px 8px; min-height: 36px; }

/* ---------- motion ---------- */
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
/* Never start invisible: if the page is in the background the animation may not run, and the item must still show. */
@keyframes settle { from { transform: translateY(-8px); } to { transform: none; } }
.window-toy, .seat-toy { animation-name: settle; }
@keyframes slide-in { from { transform: translateX(-20px); } to { transform: none; } }
@keyframes lamp { from { opacity: .85; } to { opacity: 1; } }
@keyframes beat { 0%, 100% { transform: scale(.94, .9); } 30% { transform: scale(.97, .94); } }
@keyframes float { 0%, 100% { transform: translateY(0); opacity: .7; } 50% { transform: translateY(-6px); opacity: 1; } }
@keyframes bubble { from { opacity: 1; transform: scale(.6); } to { opacity: 0; transform: translateY(-40px) scale(1.2); } }
@keyframes sparkle { 0% { opacity: 0; transform: scale(.2) rotate(0); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateY(-30px) scale(1.1) rotate(90deg); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .2s !important; }
  .toy-pic.cuddling img { transform: none; }
  .toy-pic.leaving img { transform: none; }
}

/* ---------- preview mode (Josh only: ?preview) ---------- */
.pv-bar { position: fixed; right: 8px; bottom: calc(8px + var(--safe-bottom)); z-index: 98; display: flex; align-items: center; gap: 4px; padding: 4px; border-radius: 999px; background: rgba(30, 26, 44, .82); color: #f3eadb; font: 600 12px/1.2 system-ui, sans-serif; box-shadow: 0 4px 18px rgba(0, 0, 0, .3); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.pv-when { padding: 0 6px 0 8px; opacity: .8; white-space: nowrap; }
.pv-btn { min-width: 44px; min-height: 44px; border: 0; border-radius: 999px; background: rgba(255, 255, 255, .12); color: inherit; font: inherit; font-size: 14px; padding: 0 12px; cursor: pointer; }
.pv-btn.pv-next { background: #f3d37a; color: #2a2440; }
@media (max-width: 380px) { .pv-when { display: none; } }
.pv-menu h3 { font-family: var(--display); font-size: 1rem; margin: 1.1rem 0 .4rem; }
.pv-menu .btn { margin-top: .4rem; }
.pv-small { font-size: .85rem; color: var(--ink-soft); }
.pv-notes-list .note-card { margin-bottom: .6rem; white-space: pre-wrap; }
.pv-later { position: fixed; inset: 0; z-index: 97; background: #241f36; color: #f6ecdc; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 2rem; transition: opacity .55s; }
.pv-later.go { opacity: 0; }
.pv-later-head { font-family: var(--display); font-style: italic; font-size: 2rem; margin: 0; }
.pv-later-sub { font-family: var(--display); font-size: 1.05rem; opacity: .75; margin-top: .6rem; }
.pv-finger { position: fixed; left: 50%; top: 70%; z-index: 99; width: 38px; height: 38px; margin: -19px 0 0 -19px; border-radius: 50%; background: rgba(255, 255, 255, .5); border: 2px solid rgba(60, 40, 60, .45); box-shadow: 0 2px 10px rgba(0, 0, 0, .25); pointer-events: none; opacity: 0; transition-property: left, top, transform, opacity; transition-timing-function: cubic-bezier(.4, 0, .2, 1); transform: scale(1); }
.pv-finger.on { opacity: 1; }
.pv-finger.press { transform: scale(.72); background: rgba(255, 236, 190, .75); }
.pv-caption { position: fixed; left: 50%; top: calc(10px + env(safe-area-inset-top, 0px)); transform: translateX(-50%); z-index: 98; max-width: min(440px, calc(100% - 32px)); background: rgba(30, 26, 44, .85); color: #f6ecdc; padding: .5rem .9rem; border-radius: 12px; font-family: var(--display); font-size: .95rem; text-align: center; pointer-events: none; }
/* Room under the preview bar so it never covers a button (only while the bar shows). */
body.pv-shown .sheet { padding-bottom: calc(4.6rem + var(--safe-bottom)); }
body.pv-shown .page-body, body.pv-shown .panel, body.pv-shown .takeover .take-body, body.pv-shown .intro-foot { padding-bottom: 4.6rem; }


/* =====================================================================
   The rework (0.7): every room is one scene with the next thing to do
   always in view; what wants her glows; thread is gold, never red.
   ===================================================================== */
:root { --thread: #e9b949; --thread-dark: #8a5a1c; --glow: #ffd98a; }

/* ---------- rooms as scenes ---------- */
.room { height: 100dvh; display: flex; flex-direction: column; overflow: hidden; background: var(--paper); animation: fade-in .25s ease-out; }
.room.shopfront { padding: 0; }
.room .scene { position: relative; flex: 1 1 auto; min-height: 36dvh; max-height: calc(min(100vw, 480px) * 1.5); aspect-ratio: auto; overflow: hidden; container-type: size; background: var(--night); }
/* The painting keeps its shape; when the scene is shorter than the painting, more is trimmed from the top than the bottom. */
.scene-canvas { position: absolute; left: 0; width: 100%; height: 150cqw; top: min(0px, calc((100cqh - 150cqw) * var(--focus, .6))); }
.scene-canvas .scene-art { width: 100%; height: 100%; object-fit: cover; }
.panel { position: relative; z-index: 4; flex: 0 1 auto; max-height: 64dvh; overflow: auto; margin-top: -20px; padding: 14px 16px calc(14px + var(--safe-bottom)); background: var(--paper); border-radius: 22px 22px 0 0; box-shadow: 0 -8px 26px rgba(30, 20, 30, .3); }
.float-btn { position: absolute; top: calc(8px + var(--safe-top)); z-index: 3; background: rgba(251, 245, 234, .9); color: #3a2a33; box-shadow: 0 2px 8px rgba(0, 0, 0, .25); }
.float-btn.back, .float-btn.guide-btn { left: 8px; }
.float-btn.settings-btn { right: 8px; }
.room-title { position: absolute; top: calc(12px + var(--safe-top)); left: 50%; transform: translateX(-50%); z-index: 3; margin: 0; padding: .3rem 1rem; border-radius: 999px; background: rgba(251, 245, 234, .9); color: #3a2a33; font-size: 1.02rem; white-space: nowrap; box-shadow: 0 2px 8px rgba(0, 0, 0, .25); }

/* ---------- what glows wants her ---------- */
.btn.cta { animation: cta-glow 2.2s ease-in-out infinite; box-shadow: 0 2px 0 rgba(0, 0, 0, .15), 0 0 0 3px rgba(255, 205, 120, .35), 0 0 14px 2px rgba(255, 205, 120, .4); }
.btn.cta:disabled { animation: none; box-shadow: none; }
@keyframes cta-glow { 0%, 100% { box-shadow: 0 2px 0 rgba(0, 0, 0, .15), 0 0 0 2px rgba(255, 205, 120, .25), 0 0 10px 1px rgba(255, 205, 120, .3); } 50% { box-shadow: 0 2px 0 rgba(0, 0, 0, .15), 0 0 0 6px rgba(255, 205, 120, .5), 0 0 26px 8px rgba(255, 205, 120, .6); } }
.hotspot, .table-toy { isolation: isolate; }
.glow-me::before, .glow-area::before, .table-toy.wants::before, .table-toy.is-glowing::before { content: ""; position: absolute; inset: -22%; z-index: -1; border-radius: 50%; background: radial-gradient(circle, rgba(255, 226, 150, .9) 0%, rgba(255, 205, 120, .5) 38%, rgba(255, 205, 120, 0) 68%); animation: halo 1.9s ease-in-out infinite; pointer-events: none; }
.glow-area::before { inset: -6% -18%; border-radius: 46% 46% 12% 12%; }
.glow-me img, .glow-me svg { filter: drop-shadow(0 0 7px #ffd98a) drop-shadow(0 3px 3px rgba(0, 0, 0, .25)); animation: item-bob 1.9s ease-in-out infinite; }
@keyframes halo { 0%, 100% { opacity: .55; transform: scale(.86); } 50% { opacity: 1; transform: scale(1.08); } }
@keyframes item-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3%); } }
@keyframes dot-pulse { 0%, 100% { box-shadow: 0 0 0 2px rgba(233, 185, 73, .35); } 50% { box-shadow: 0 0 0 6px rgba(233, 185, 73, .55), 0 0 12px 3px rgba(255, 217, 138, .7); } }
.doorstep-item .mini-tag { display: none; }
.window-toy.cut { -webkit-mask-image: none; mask-image: none; filter: drop-shadow(0 0 6px rgba(255, 214, 140, .85)); }

/* ---------- the shopfront panel ---------- */
.panel .voice { display: flex; gap: .7rem; align-items: center; padding: 0; }
.panel .mrs-p { width: 50px; height: 50px; }
.panel .greeting { font-size: .98rem; font-style: italic; font-weight: 400; color: var(--ink-soft); margin: 0; line-height: 1.3; }
.today { margin: .7rem 0 .2rem; }
.today-text { font-family: var(--display); font-size: 1.2rem; font-weight: 600; line-height: 1.3; margin: 0 0 .65rem; }
.today.rest .today-text { font-weight: 400; font-size: 1.06rem; }
.tip { background: color-mix(in srgb, var(--honey) 20%, var(--card)); border-left: 4px solid var(--honey); border-radius: 10px; padding: .55rem .8rem; font-size: .95rem; margin: 0 0 .65rem; }
.tip-who { display: block; font-size: .7rem; letter-spacing: .07em; text-transform: uppercase; font-weight: 800; color: var(--ink-soft); }
.panel .cards-below { padding: 0; }
.panel .note-card { margin: .6rem 0; }
.residents { display: flex; gap: .5rem; margin: .8rem 0 0; }
.resident { flex: 1 1 0; min-width: 0; display: flex; align-items: center; gap: .4rem; min-height: 50px; padding: .3rem .7rem .3rem .3rem; border: 0; border-radius: 999px; background: var(--card); box-shadow: var(--shadow); text-align: left; cursor: pointer; }
.resident.wants { box-shadow: 0 0 0 2px var(--honey), 0 0 12px rgba(255, 205, 120, .6); }
.res-pic { width: 42px; height: 42px; flex: none; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--honey) 40%, var(--card)), var(--card)); }
.res-pic img { width: 100%; height: 100%; object-fit: contain; }
.res-text { min-width: 0; }
.res-text strong { display: block; font-size: .9rem; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.res-text span { display: block; font-size: .76rem; color: var(--ink-soft); line-height: 1.15; }
.panel .rooms-nav { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; margin-top: .7rem; padding: 0; }
.room-chip { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .1rem; min-height: 62px; padding: .35rem .2rem; border: 0; border-radius: 14px; background: var(--soft-btn); color: var(--soft-ink); font-weight: 700; font-size: .84rem; cursor: pointer; }
.chip-pic { height: 28px; display: grid; place-items: center; }
.chip-pic img { height: 28px; width: auto; }

/* ---------- toys sitting in a scene ---------- */
.table-toy { position: absolute; aspect-ratio: 1; transform: translate(-50%, -93%); border: 0; background: none; padding: 0; cursor: pointer; }
.table-toy > img:not(.worn) { width: 100%; height: 100%; object-fit: contain; filter: saturate(calc(.9 + var(--warm, 0) * .04)) drop-shadow(0 5px 4px rgba(40, 20, 10, .35)); }
.table-toy .worn { position: absolute; left: 30%; top: 40%; width: 40%; height: auto; }
.toy-shadow { position: absolute; left: 12%; right: 12%; bottom: 3%; height: 11%; z-index: -1; border-radius: 50%; background: radial-gradient(ellipse, rgba(40, 20, 10, .5), rgba(40, 20, 10, 0) 70%); }
.table-toy.behind > img:not(.worn) { filter: brightness(.88) drop-shadow(0 4px 3px rgba(40, 20, 10, .35)); }
.table-toy.front { animation: settle .5s ease-out both; }
.table-toy.is-glowing::before { inset: -12%; }
div.table-toy { cursor: default; }

/* ---------- the toy panel ---------- */
.toy-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.toy-head h2 { font-size: 1.45rem; margin: 0; }
.toy-head .link { padding: 0; }
.toy-panel .toy-line { margin: .1rem 0 .3rem; }
.journey { list-style: none; display: flex; margin: .35rem 0 .5rem; padding: 0; }
.journey li { flex: 1; position: relative; text-align: center; font-size: .68rem; line-height: 1.2; color: var(--ink-soft); padding-top: 21px; }
.journey li::before { content: ""; position: absolute; top: 7px; left: -50%; width: 100%; border-top: 2px dashed var(--line); }
.journey li:first-child::before { display: none; }
.journey li.done::before, .journey li.next::before { border-top-color: var(--thread); }
/* Each stop is a little sewing button (two holes), so it never reads as something to tick. */
.journey .dot { position: absolute; top: 0; left: 50%; width: 16px; height: 16px; margin-left: -8px; z-index: 1; border-radius: 50%; border: 2px solid var(--line);
  background: radial-gradient(circle at 34% 50%, var(--line) 1.4px, transparent 1.9px), radial-gradient(circle at 66% 50%, var(--line) 1.4px, transparent 1.9px), var(--paper); }
.journey li.done .dot { border-color: var(--thread-dark); background: radial-gradient(circle at 34% 50%, var(--thread-dark) 1.4px, transparent 1.9px), radial-gradient(circle at 66% 50%, var(--thread-dark) 1.4px, transparent 1.9px), var(--thread); }
.journey li.next .dot { border-color: var(--thread-dark); animation: dot-pulse 1.9s ease-in-out infinite; box-shadow: 0 0 0 3px rgba(233, 185, 73, .4); }
.journey li.done .lbl { color: var(--ink); }
.journey li.next .lbl { color: var(--ink); font-weight: 800; }
.journey.flow { margin: .8rem 0 1rem; }
.now-box { background: var(--card); border-radius: 16px; padding: .7rem .8rem .75rem; box-shadow: var(--shadow); margin: .5rem 0; }
.now-box.wants { background: color-mix(in srgb, var(--honey) 15%, var(--card)); }
.status { font-family: var(--display); font-size: 1.1rem; line-height: 1.35; margin: 0 0 .55rem; }
.status.small { font-size: .98rem; color: var(--ink-soft); font-style: italic; }
.now-box .care-btns { margin: 0; }
.now-box .row2 { margin: 0; }
.extras-note { margin: 0; }
.care-ico { width: 24px; height: 24px; object-fit: contain; flex: none; display: inline-grid; place-items: center; }
.care-ico svg { width: 20px; height: 20px; }
.link.tidy { display: flex; margin: .2rem auto 0; font-weight: 600; color: var(--ink-soft); }
.story-sheet .story { font-family: var(--display); font-size: 1.08rem; }

/* ---------- the stage: a toy in the lamplight, inside the room painting ---------- */
.stage-spot { position: relative; margin: 0 -16px; height: min(44dvh, 100vw); display: grid; place-items: end center; overflow: hidden;
  background: #9b6a4c var(--room-mending, linear-gradient(180deg, #e7b877, #9b5f52)) 18% 92% / 200% auto no-repeat; }
.stage-spot::before { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 55%, rgba(255, 226, 160, .28) 0%, rgba(40, 20, 30, .0) 45%, rgba(40, 20, 30, .5) 100%); pointer-events: none; }
.stage-spot.small { height: min(30dvh, 70vw); }
.goodbye .stage-spot { background-image: var(--room-window, linear-gradient(180deg, #e7b877, #9b5f52)); background-position: 50% 78%; background-size: 170% auto; }
.stage-spot .toy-pic, .care-sheet .stage-spot .toy-pic.big, .first-cuddle .stage-spot .toy-pic, .goodbye .stage-spot .toy-pic { height: 92%; width: auto; aspect-ratio: 1; max-width: none; margin: 0 0 1.5%; border-radius: 0; }
.toy-pic.cut { overflow: visible; }
.toy-pic img { position: relative; z-index: 1; }
.toy-pic.cut img { object-fit: contain; filter: saturate(calc(.9 + var(--warm, 0) * .04)) drop-shadow(0 8px 6px rgba(40, 20, 10, .4)); }
.toy-pic.cut .before { transition: opacity 1.4s ease-in-out, filter .6s, transform .3s; }
.toy-pic.cut.transform .before { opacity: 0; }
.toy-pic.cut.glowing::before, .toy-pic.cut.cuddled::before { content: ""; position: absolute; inset: -4%; border-radius: 50%; background: radial-gradient(circle, rgba(255, 226, 150, .8) 0%, rgba(255, 205, 120, .35) 45%, rgba(255, 205, 120, 0) 70%); animation: halo 2.6s ease-in-out infinite; }
.big-hint { font-family: var(--display); font-size: 1.2rem; font-weight: 600; line-height: 1.3; text-align: center; color: var(--ink); margin: .3rem 0 .7rem; }
.sheet-wrap.care-wrap .sheet { min-height: 100dvh; max-height: 100dvh; border-radius: 0; }
.care-sheet .after { padding-top: .2rem; text-align: center; }
.care-sheet .after .btn { margin-top: .6rem; }
.care-extra { text-align: center; padding-top: .4rem; }
.doorstep-pic { width: 44%; margin: .2rem auto -.6rem; }
.doorstep-pic img, .doorstep-pic svg { width: 100%; height: auto; }

/* The cuddle: a warm glow swells behind the toy. No rings, nothing red. */
.hold-glow { position: absolute; inset: -8%; z-index: 0; border-radius: 50%; pointer-events: none; opacity: 0; transform: scale(.3);
  background: radial-gradient(circle, rgba(255, 236, 170, 1) 0%, rgba(255, 208, 120, .7) 38%, rgba(255, 208, 120, 0) 70%); }
.hold-glow.go { opacity: 1; transform: scale(1.18); transition: transform var(--ms, 1.4s) ease-out, opacity .35s; }
.hold-glow.done { opacity: 0; transform: scale(1.7); transition: transform .9s ease-out, opacity .9s; }
.press-hint, .rub-hint { position: absolute; left: 50%; top: 54%; z-index: 3; width: 52px; height: 52px; margin: -26px 0 0 -26px; border-radius: 50%; pointer-events: none; background: rgba(255, 255, 255, .5); border: 2px solid rgba(255, 255, 255, .9); box-shadow: 0 0 14px 4px rgba(255, 217, 138, .8); }
.press-hint { animation: press-hint 1.7s ease-in-out infinite; }
.rub-hint { animation: rub-hint 1.5s ease-in-out infinite; }
@keyframes press-hint { 0%, 100% { transform: scale(1); box-shadow: 0 0 10px 2px rgba(255, 217, 138, .6); } 45%, 70% { transform: scale(.78); box-shadow: 0 0 0 12px rgba(255, 217, 138, .35), 0 0 26px 10px rgba(255, 217, 138, .7); } }
@keyframes rub-hint { 0%, 100% { transform: translate(-70%, -30%); } 25% { transform: translate(70%, -10%); } 50% { transform: translate(-60%, 20%); } 75% { transform: translate(65%, 40%); } }
/* The stitching: cream guide, gold thread. */
.stitch-layer { z-index: 2; overflow: visible; }
.stitch-guide-under { stroke: rgba(50, 30, 20, .55); stroke-width: 3.4; stroke-linecap: round; fill: none; }
.stitch-guide { stroke: #fff6dc; stroke-width: 1.5; stroke-dasharray: 2 2.4; fill: none; opacity: 1; filter: none; }
.stitch-done path { stroke: var(--thread); stroke-width: 1.7; stroke-linecap: round; }
.stitch-done path.under { stroke: var(--thread-dark); stroke-width: 3; }
.stitch-start { fill: var(--glow); stroke: #fff; stroke-width: .8; animation: start-pulse 1.4s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.stitch-runner { fill: #fff; filter: drop-shadow(0 0 2px #ffd98a); }
@keyframes start-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.5); } }
.bubble-layer { z-index: 2; }

/* ---------- the luggage tag: a brass eyelet with string through it ---------- */
.tag-wrap { position: relative; margin: 1.5rem 0 .9rem; transform: rotate(-.6deg); filter: drop-shadow(0 3px 5px rgba(58, 42, 51, .22)); }
.tag-wrap .tag { margin: 0; transform: none; box-shadow: none; padding: .9rem 1rem .9rem 3.3rem; min-height: 72px; clip-path: polygon(22px 0, 100% 0, 100% 100%, 22px 100%, 0 calc(100% - 22px), 0 22px); }
.tag-string { position: absolute; left: 2px; top: 50%; width: 48px; height: 42px; margin-top: -34px; pointer-events: none; }

/* ---------- letters: the lines sit under the writing ---------- */
.letter { background-image: none; padding: 1.1rem 1.2rem 1.2rem; }
.letter-body { margin: .3rem 0 1rem; line-height: 2rem; background: repeating-linear-gradient(transparent 0 calc(2rem - 1px), color-mix(in srgb, var(--line) 45%, transparent) calc(2rem - 1px) 2rem) 0 0 / 100% 2rem; }

/* ---------- the certificate, sized to its painted frame ---------- */
.cert-frame.painted { position: relative; width: min(100%, calc(60dvh * 1120 / 1500)); aspect-ratio: 1120 / 1500; margin: .2rem auto .6rem; padding: 0; border: 0; border-radius: 4px; background: none; container-type: inline-size; color: #3a2a33; box-shadow: var(--shadow); }
.cert-art { position: absolute; inset: 0; width: 100%; height: 100%; }
.cert-frame.painted .cert-inner { position: absolute; inset: 0; }
.cert-frame.painted .cert-title { position: absolute; left: 37%; right: 14%; top: 12.5%; margin: 0; font-size: 6.6cqw; line-height: 1.12; text-align: center; color: #6e2f4f; }
.cert-frame.painted .cert-words { position: absolute; left: 18.5%; right: 18.5%; top: 31%; text-align: center; }
.cert-frame.painted .cert-line { font-family: var(--display); font-size: 3.9cqw; line-height: 1.35; margin: 0; }
.cert-frame.painted .cert-name { font-size: 9cqw; line-height: 1.1; margin: 1.2cqw 0 1.6cqw; color: #6e2f4f; text-wrap: balance; }
.cert-frame.painted .cert-name.long { font-size: 7.2cqw; }
.cert-frame.painted .cert-name.xlong { font-size: 6cqw; }
.cert-frame.painted .cert-date { font-size: 3.5cqw; margin: 1.6cqw 0 0; color: #6f5a64; }
.cert-frame.painted .sig-wrap { position: absolute; left: 24%; right: 24%; bottom: 15%; margin: 0; text-align: center; }
.cert-frame.painted .sig { display: block; background: rgba(255, 255, 255, .5); border-bottom-color: #6f5a64; }
.cert-frame.painted .sig-line { display: block; font-size: 2.9cqw; line-height: 1.5; color: #6f5a64; }
.certificate .row2 { margin-top: .2rem; }

/* ---------- the album page, sized to its painted paper ---------- */
.album-entry { margin: 1.4rem 0 2.2rem; }
.album-page.painted { position: relative; aspect-ratio: 1120 / 1500; padding: 0; margin: 0 0 .8rem; background: none; box-shadow: none; container-type: inline-size; color: #3a2a33; filter: drop-shadow(0 4px 10px rgba(58, 42, 51, .18)); }
.page-art { position: absolute; inset: 0; width: 100%; height: 100%; }
.album-page.painted .page-inner { position: absolute; inset: 8% 14% 11%; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.album-page.painted .polaroid { width: 72%; max-width: none; margin: 0; padding: 2.2cqw 2.2cqw 1.4cqw; }
.album-page.painted .polaroid figcaption { font-size: 4.8cqw; line-height: 1.2; margin-top: 1cqw; }
.album-page.painted .album-meta { font-size: 3.9cqw; line-height: 1.3; margin: 3cqw 0 0; text-wrap: balance; }

/* ---------- the welcome and the guide ---------- */
.intro { display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.intro-page { flex: 1; overflow: auto; padding-bottom: 1rem; }
.intro-page.turn { animation: page-turn .45s ease-out; }
@keyframes page-turn { from { opacity: .2; transform: translateX(14px); } to { opacity: 1; transform: none; } }
.intro-art.full img { width: 100%; height: 54dvh; object-fit: cover; object-position: 50% 66%; }
.intro-art.person { display: grid; place-items: center; height: 42dvh; padding-top: calc(1.2rem + var(--safe-top)); background: radial-gradient(ellipse at 50% 62%, color-mix(in srgb, var(--honey) 45%, var(--paper)) 0%, var(--paper) 68%); }
.intro-art.person img { height: 100%; width: auto; object-fit: contain; }
.intro-art.person img.round { height: 82%; aspect-ratio: 1; object-fit: cover; object-position: 50% 12%; border-radius: 50%; box-shadow: var(--shadow); }
.intro-text { padding: 1rem 22px 0; }
.intro-text.top { padding-top: calc(1.5rem + var(--safe-top)); }
.intro-text h1 { font-size: 1.65rem; line-height: 1.2; margin-bottom: .5rem; color: var(--plum); }
.intro-text p { font-family: var(--display); font-size: 1.12rem; line-height: 1.45; }
.past { display: flex; flex-direction: column; gap: 1.1rem; padding: .9rem 22px 0; }
.past figure { display: flex; gap: 1rem; align-items: center; margin: 0; }
.past figure:nth-child(even) { flex-direction: row-reverse; }
.past img { width: 40%; flex: none; border-radius: 3px; box-shadow: var(--shadow); transform: rotate(-2deg); }
.past figure:nth-child(even) img { transform: rotate(1.8deg); }
.past figcaption { font-family: var(--display); font-size: 1.02rem; line-height: 1.35; }
.past figcaption strong { display: block; font-size: 1.2rem; color: var(--plum); }
.intro-foot { flex: none; padding: .6rem 16px calc(.8rem + var(--safe-bottom)); background: var(--paper); border-top: 1px solid color-mix(in srgb, var(--line) 50%, transparent); }
.intro-foot .row2 { margin: 0; }
.intro-foot .prev { flex: 0 0 30%; }
.intro-dots { display: flex; justify-content: center; gap: 6px; margin-bottom: .55rem; }
.intro-dots i { width: 8px; height: 8px; border-radius: 8px; background: var(--line); transition: width .25s, background .25s; }
.intro-dots i.on { width: 22px; background: var(--plum); }
.steps { list-style: none; margin: .7rem 0; padding: 0 22px; }
.steps li { position: relative; display: flex; gap: .85rem; align-items: center; padding: .45rem 0; }
.steps li + li::before { content: ""; position: absolute; left: 27px; top: -9px; height: 18px; border-left: 2px dashed var(--thread); }
.step-pic { width: 56px; height: 56px; flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--card); box-shadow: var(--shadow); }
.step-pic img { max-width: 38px; max-height: 38px; }
.step-text strong { display: block; font-family: var(--display); font-size: 1.1rem; line-height: 1.25; }
.step-text span { display: block; font-size: .95rem; line-height: 1.35; color: var(--ink-soft); }
.guide .steps { padding: 0; }
.guide-hero { display: flex; gap: .9rem; align-items: center; padding-top: .9rem; }
.guide-hero img { width: 84px; flex: none; }
.guide-hero .greeting { margin: 0; }
.guide .note-card p { margin: .5rem 0; }
.album .tip { margin-top: 1rem; }
.intro-art.full { overflow: hidden; }
.intro-art.full img { transform: scale(1.09); }
.intro-art.person { box-sizing: border-box; }
.intro-art.person img { height: calc(42dvh - 2.4rem - var(--safe-top)); max-width: 80%; }
.intro-art.person img.round { height: calc(36dvh - 2.4rem); width: auto; }
.panel { flex: 1 0 auto; }
/* Zoom the painting a touch so its paper edge never shows; everything placed on it zooms with it. */
.scene-canvas { transform: scale(1.07); transform-origin: 50% 62%; }
.detail-bunting.painted { left: 4%; top: 34%; width: 92%; height: auto; }
/* The scene is as tall as its painting when there is room, and gives way to the panel when there isn't. */
.room .scene { flex: 0 1 calc(min(100vw, 480px) * 1.5); }
.stage-spot { background-position: 40% 66%; }
.table-toy.front { animation: none; }
.care-sheet .stage-spot { height: min(50dvh, 108vw); }
.stage-spot { --stage-h: min(44dvh, 100vw); height: var(--stage-h); }
.stage-spot.small { --stage-h: min(30dvh, 70vw); height: var(--stage-h); }
.care-sheet .stage-spot { --stage-h: min(50dvh, 108vw); height: var(--stage-h); }
.stage-spot .toy-pic, .care-sheet .stage-spot .toy-pic.big, .first-cuddle .stage-spot .toy-pic, .goodbye .stage-spot .toy-pic { width: calc(var(--stage-h) * .92); height: calc(var(--stage-h) * .92); }
.cert-frame.painted .sig-wrap { bottom: 17%; }
