/* Tiny Planet UI: soft paper panels over a full-screen canvas. Same fonts and colours as the
   portfolio page (Bricolage Grotesque, Atkinson Hyperlegible, indigo ink, mustard, tomato).
   Panels sit on a light glass surface so they read the same over the clay and smooth looks. */
:root {
  --paper: #F6F3EA; --surface: #FFFDF7; --ink: #1C2140; --ink-soft: #505774; --ink-mute: #767B94;
  --line: #E3DFD1; --line-2: #CFCAB8;
  --sweater: #D9981B; --blob: #2F66AE; --tomato: #E8633A;
  --live: #2D7A4B; --live-bg: #DCEFE2; --store: #2F66AE; --store-bg: #DDE8F6;
  --private: #7B4BB0; --private-bg: #EDE3F7; --early: #8A6512; --early-bg: #F6EACB;
  --sky-top: #BFDDEB; --sky-bottom: #F4EBD8;
  --glass: rgb(255 253 247 / .92);
  --shadow-1: 0 1px 2px rgb(28 33 64 / .10), 0 6px 16px -6px rgb(28 33 64 / .24);
  --shadow-2: 0 2px 6px rgb(28 33 64 / .10), 0 24px 48px -18px rgb(28 33 64 / .42);
  --r-2: 14px; --r-3: 20px; --r-4: 28px;
  --display: "Bricolage Grotesque", "Avenir Next", system-ui, sans-serif;
  --body: "Atkinson Hyperlegible Next", "Atkinson Hyperlegible", "Helvetica Neue", Arial, sans-serif;
  --mono: "Atkinson Hyperlegible Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --ease-out: cubic-bezier(.2, .8, .2, 1);
  --ease-pop: cubic-bezier(.3, 1.4, .5, 1);
  --safe-t: env(safe-area-inset-top, 0px); --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; overflow: hidden; overscroll-behavior: none; }
body { background: linear-gradient(180deg, var(--sky-top), var(--sky-bottom) 75%); color: var(--ink); font-family: var(--body); font-size: 16px; line-height: 1.45; -webkit-tap-highlight-color: transparent; -webkit-font-smoothing: antialiased; touch-action: manipulation; }
#app { position: fixed; inset: 0; overflow: hidden; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.sheet-panel, .card { -webkit-user-select: text; user-select: text; }
#scene { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; outline: none; }
button { font: inherit; color: inherit; cursor: pointer; }
a { color: inherit; }
h1, h2, h3, p, ul, ol, dl { margin: 0; }
:focus-visible { outline: 3px solid var(--blob); outline-offset: 3px; }
.cover :focus-visible, .toast :focus-visible, .book-nav :focus-visible { outline-color: var(--surface); }      /* on dark: the cover, and the dimmed scene under the page buttons */
.skip { position: absolute; z-index: 40; left: 12px; top: -80px; padding: 12px 18px; border-radius: 999px; background: var(--ink); color: var(--paper); font-weight: 700; text-decoration: none; box-shadow: var(--shadow-2); transition: top .15s; }
.skip:focus { top: calc(var(--safe-t) + 10px); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* icons */
.ico { display: inline-flex; align-items: center; justify-content: center; flex: none; }
.ico-svg { width: 1.25em; height: 1.25em; flex: none; }
.ico.big .ico-svg { width: 2.6em; height: 2.6em; }

/* chips */
.chip { display: inline-flex; align-items: center; font: 600 .68rem/1 var(--mono); letter-spacing: .05em; text-transform: uppercase; padding: 5px 9px; border-radius: 999px; white-space: nowrap; }
.chip.live, .chip.done { color: var(--live); background: var(--live-bg); }
.chip.store { color: var(--store); background: var(--store-bg); }
.chip.private { color: var(--private); background: var(--private-bg); }
.chip.early { color: var(--early); background: var(--early-bg); }
.chip.plain { color: var(--ink-soft); box-shadow: inset 0 0 0 1px var(--line-2); }
.facts-chips { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.facts-chips li { font-weight: 700; font-size: .8rem; line-height: 1; padding: 7px 11px; border-radius: 999px; color: var(--ink); background: color-mix(in srgb, var(--c, var(--sweater)) 13%, var(--surface)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c, var(--sweater)) 22%, transparent); }

/* buttons: solid ink is the main action, soft is secondary, ghost is quiet */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 20px; border-radius: 999px; border: 1.5px solid var(--ink); background: transparent; color: var(--ink); font: 700 .95rem/1 var(--body); text-decoration: none; text-align: center; transition: transform .16s var(--ease-out), background .16s, box-shadow .16s, border-color .16s; }
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-1); }
.btn:active { transform: translateY(1px) scale(.98); box-shadow: none; }
.btn.primary { background: var(--ink); color: var(--paper); }
.btn.link { background: var(--blob); border-color: var(--blob); color: #fff; }
.btn.soft { border-color: transparent; background: color-mix(in srgb, var(--ink) 8%, transparent); }
.btn.soft:hover { background: color-mix(in srgb, var(--ink) 13%, transparent); }
.btn.ghost { border-color: var(--line-2); }
.btn.ghost:hover { border-color: var(--ink); }
.btn:disabled { opacity: .55; pointer-events: none; }
.btn .lbl { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.btn kbd { margin-left: 2px; }
.icon-btn { position: relative; width: 44px; height: 44px; border-radius: 50%; border: 0; background: color-mix(in srgb, var(--ink) 8%, transparent); display: grid; place-items: center; padding: 0; flex: none; transition: background .15s, transform .15s var(--ease-out); }
.icon-btn:hover { background: color-mix(in srgb, var(--ink) 15%, transparent); }
.icon-btn:active { transform: scale(.94); }
.icon-btn.small { width: 34px; height: 34px; }
.icon-btn.small::after { content: ""; position: absolute; inset: -5px; }
kbd { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 6px; background: var(--surface); border: 1px solid var(--line-2); box-shadow: 0 1px 0 var(--line-2); font: 600 .7rem/1 var(--mono); color: var(--ink); }
.btn.primary kbd { background: rgb(255 253 247 / .16); border-color: rgb(255 253 247 / .3); box-shadow: none; color: var(--paper); }
body.touch kbd, body.touch .keys { display: none; }

/* panels: light, nearly opaque glass (no backdrop blur: it costs a lot over a live 3D canvas
   and at this opacity it wouldn't show) */
.panel { background: var(--glass); border: 1px solid rgb(28 33 64 / .09); border-radius: var(--r-3); box-shadow: var(--shadow-2); }

/* labels over the stops */
.labels { position: absolute; inset: 0; z-index: 2; pointer-events: none; overflow: hidden; }
.plabel { position: absolute; left: 0; top: 0; will-change: transform; transition: opacity .25s ease; }
.plabel.hide, .plabel.hide .pill { opacity: 0; pointer-events: none; }
.plabel .pill { position: relative; display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px 6px 8px; margin-bottom: 8px; font: 700 .8rem/1 var(--display); color: var(--ink); background: var(--surface); border: 1px solid rgb(28 33 64 / .12); border-radius: 999px; box-shadow: var(--shadow-1); white-space: nowrap; pointer-events: none; transition: transform .2s var(--ease-pop), background .15s, color .15s; }
.plabel .pill::after { content: ""; position: absolute; left: 50%; bottom: -5px; width: 9px; height: 9px; background: inherit; border-right: 1px solid rgb(28 33 64 / .12); border-bottom: 1px solid rgb(28 33 64 / .12); transform: translateX(-50%) rotate(45deg); border-bottom-right-radius: 3px; transition: background .15s; }
.plabel .dot { width: 12px; height: 12px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 2px var(--surface); display: grid; place-items: center; color: #fff; transition: box-shadow .15s; }
.plabel.done .dot { width: 16px; height: 16px; }
.plabel .dot .ico-svg { display: none; width: 11px; height: 11px; stroke-width: 3.4; }
.plabel.done .dot .ico-svg { display: block; }
.plabel.big { pointer-events: auto; }
.plabel.big .pill { font-size: .9rem; padding: 7px 14px 7px 9px; cursor: pointer; pointer-events: auto; }
.plabel.big:hover .pill, .plabel.hot .pill { background: var(--ink); color: var(--paper); transform: translateY(-4px) scale(1.07); border-color: var(--ink); }
.plabel.big:hover .dot, .plabel.hot .dot { box-shadow: 0 0 0 2px var(--ink); }
.plabel.big .pill:active { transform: translateY(-1px) scale(.96); }
.plabel.pulse .pill { animation: label-pulse .6s var(--ease-pop); }
.you { position: absolute; left: 0; top: 0; will-change: transform; transition: opacity .3s; pointer-events: none; }
.you.hide { opacity: 0; }
.you-dot { position: absolute; left: -9px; top: -9px; width: 18px; height: 18px; border-radius: 50%; background: var(--sweater); border: 3px solid var(--surface); box-shadow: var(--shadow-1); }
.you-dot::before { content: ""; position: absolute; inset: -9px; border-radius: 50%; border: 2px solid var(--sweater); opacity: 0; animation: you-ring 2.2s ease-out infinite; }
.you-tag { position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%); padding: 4px 9px; border-radius: 999px; background: var(--ink); color: var(--paper); font: 600 .66rem/1 var(--mono); letter-spacing: .05em; text-transform: uppercase; white-space: nowrap; box-shadow: var(--shadow-1); }
.taps { position: absolute; inset: 0; z-index: 3; pointer-events: none; overflow: hidden; }
.tap { position: absolute; width: 18px; height: 18px; margin: -9px 0 0 -9px; border-radius: 50%; border: 3px solid var(--sweater); background: rgb(217 152 27 / .28); animation: tap .65s ease-out both; }

/* top bar */
.top { position: absolute; z-index: 5; top: calc(var(--safe-t) + 14px); left: 18px; right: 18px; display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; pointer-events: none; }
.top > * { pointer-events: auto; }
.brand { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 6px 18px 6px 9px; border-radius: 999px; background: var(--glass); border: 1px solid rgb(28 33 64 / .07); box-shadow: var(--shadow-1); }
.brand .mark { width: 32px; height: 32px; flex: none; }
.who { display: grid; line-height: 1.15; }
.name { font-family: var(--display); font-weight: 780; font-size: 1.05rem; letter-spacing: -.01em; }
.role { font: 600 .62rem/1.25 var(--mono); letter-spacing: .07em; text-transform: uppercase; color: var(--ink-soft); }
.tools { display: flex; gap: 8px; align-items: center; }
.pill-btn { display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 16px 0 14px; border-radius: 999px; border: 1px solid rgb(28 33 64 / .07); background: var(--glass); box-shadow: var(--shadow-1); font-weight: 700; font-size: .92rem; transition: transform .16s var(--ease-out), box-shadow .16s, background .16s; }
.pill-btn:hover { background: var(--surface); transform: translateY(-1px); box-shadow: var(--shadow-2); }
.pill-btn:active { transform: scale(.97); }
.count.bump { animation: bump .6s var(--ease-pop); }
.count { font: 600 .74rem/1 var(--mono); background: var(--sweater); color: var(--ink); border-radius: 999px; padding: 4px 8px; }
.seg { display: inline-flex; align-items: stretch; gap: 2px; padding: 2px; min-height: 48px; border-radius: 999px; background: var(--glass); border: 1px solid rgb(28 33 64 / .07); box-shadow: var(--shadow-1); }
.seg button { padding: 0 14px; border: 0; border-radius: 999px; background: transparent; font-weight: 700; font-size: .86rem; color: var(--ink-soft); transition: background .16s, color .16s; }
.seg button:hover { color: var(--ink); }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }

/* dock: the small round tools down the right edge */
.dock { position: absolute; z-index: 5; right: 18px; top: calc(var(--safe-t) + 74px); display: flex; flex-direction: column; gap: 10px; }
.round-btn { width: 46px; height: 46px; border-radius: 50%; border: 1px solid rgb(28 33 64 / .07); background: var(--glass); box-shadow: var(--shadow-1); display: grid; place-items: center; padding: 0; transition: transform .16s var(--ease-out), box-shadow .16s, background .16s; }
.round-btn .ico-svg { width: 22px; height: 22px; }
.round-btn:hover { background: var(--surface); transform: translateY(-1px); box-shadow: var(--shadow-2); }
.round-btn:active { transform: scale(.94); }
.round-btn[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
#btn-look { display: none; }

/* intro: the title card on the planet view */
.intro { position: absolute; z-index: 4; left: 50%; bottom: calc(var(--safe-b) + 26px); translate: -50% 0; width: min(560px, calc(100% - 32px)); padding: 24px 28px 22px; background: rgb(255 253 247 / .74); border: 1px solid rgb(28 33 64 / .08); border-radius: var(--r-4); box-shadow: 0 1px 2px rgb(28 33 64 / .06), 0 24px 48px -24px rgb(28 33 64 / .3); display: grid; gap: 12px; justify-items: center; text-align: center; transition: opacity .4s ease, transform .4s var(--ease-out); }
body[data-intro="side"] .intro { left: clamp(28px, 5vw, 84px); top: 50%; bottom: auto; translate: 0 -50%; width: min(440px, 40vw); justify-items: start; text-align: left; }
.intro.gone { opacity: 0; pointer-events: none; transform: translateY(18px); }
body[data-intro="side"] .intro.gone { transform: translateX(-22px); }
.kicker { font: 600 .72rem/1.3 var(--mono); letter-spacing: .09em; text-transform: uppercase; color: var(--ink-soft); }
.intro h1 { font-family: var(--display); font-weight: 780; font-size: clamp(2rem, 3.3vw, 3rem); line-height: 1.02; letter-spacing: -.02em; text-wrap: balance; font-variation-settings: "opsz" 96, "wdth" 88; }
.stitched { position: relative; display: inline-block; }
.knit { display: block; background: var(--sweater); -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='14'%3E%3Cellipse cx='3.6' cy='7' rx='2.3' ry='5.4' transform='rotate(-26 3.6 7)'/%3E%3Cellipse cx='8.4' cy='7' rx='2.3' ry='5.4' transform='rotate(26 8.4 7)'/%3E%3C/svg%3E") 0 0 / 12px 14px repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='14'%3E%3Cellipse cx='3.6' cy='7' rx='2.3' ry='5.4' transform='rotate(-26 3.6 7)'/%3E%3Cellipse cx='8.4' cy='7' rx='2.3' ry='5.4' transform='rotate(26 8.4 7)'/%3E%3C/svg%3E") 0 0 / 12px 14px repeat; }
.stitched .knit { position: absolute; left: -2px; right: -2px; bottom: -.16em; height: 12px; border-radius: 4px; }
.lede { font-size: 1.06rem; line-height: 1.45; color: var(--ink-soft); max-width: 36ch; text-wrap: pretty; }
.intro-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 4px; }
body:not([data-intro="side"]) .intro-actions { justify-content: center; }
.cta { min-height: 58px; padding: 0 36px; border: 0; border-radius: 999px; background: var(--tomato); color: #fff; font: 780 1.3rem/1 var(--display); box-shadow: 0 12px 24px -12px rgb(232 99 58 / .9), inset 0 -3px 0 rgb(0 0 0 / .13); transition: transform .16s var(--ease-out), filter .16s; }
.cta:disabled { opacity: .55; cursor: progress; box-shadow: none; }
.cta:hover:not(:disabled) { transform: translateY(-2px); filter: brightness(1.05); }
.cta:active { transform: translateY(1px) scale(.98); }
.hint { font: 400 .84rem/1.35 var(--body); color: var(--ink-soft); }

@media (max-height: 820px) { body:not([data-intro="side"]) .intro .hint { display: none; } }

/* driving */
.drive-ui { position: absolute; inset: 0; z-index: 4; pointer-events: none; }
.drive-ui > * { pointer-events: auto; }
.keys { position: absolute; left: 50%; bottom: calc(var(--safe-b) + 16px); translate: -50% 0; display: flex; gap: 16px; margin: 0; padding: 8px 18px; border-radius: 999px; background: var(--glass); box-shadow: var(--shadow-1); font-size: .8rem; line-height: 1; color: var(--ink-soft); white-space: nowrap; }
.keys span { display: inline-flex; align-items: center; gap: 4px; }
.keys kbd + kbd { margin-left: -1px; }
.compass { position: absolute; left: 50%; bottom: calc(var(--safe-b) + 66px); translate: -50% 0; display: flex; align-items: center; gap: 12px; padding: 6px 18px 6px 6px; border-radius: 999px; background: var(--glass); border: 1px solid rgb(28 33 64 / .07); box-shadow: var(--shadow-1); animation: rise .35s var(--ease-out) both; }
.compass-ring { width: 46px; height: 46px; border-radius: 50%; background: var(--ink); display: grid; place-items: center; box-shadow: inset 0 0 0 2px rgb(255 253 247 / .12); }
.compass-arrow { width: 26px; height: 26px; fill: var(--sweater); stroke: var(--sweater); stroke-width: 1.4; stroke-linejoin: round; transition: transform .1s linear; }
.compass-text { display: grid; gap: 2px; line-height: 1.1; }
.compass-k { font: 600 .62rem/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-soft); }
.compass-name { font: 700 1rem/1.1 var(--display); max-width: 15ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.round-btn.honk { position: absolute; right: 22px; bottom: calc(var(--safe-b) + 40px); width: 74px; height: 74px; font: 780 1rem/1 var(--display); background: var(--sweater); border-color: transparent; display: none; box-shadow: var(--shadow-2), inset 0 -4px 0 rgb(0 0 0 / .12); }
.round-btn.honk:hover { background: var(--sweater); }
.stick { position: absolute; left: 36px; bottom: calc(var(--safe-b) + 40px); width: 120px; height: 120px; border-radius: 50%; background: rgb(255 253 247 / .38); border: 1.5px solid rgb(28 33 64 / .26); display: none; transition: opacity .2s; }
.stick .knob { position: absolute; left: 50%; top: 50%; width: 54px; height: 54px; margin: -27px 0 0 -27px; border-radius: 50%; background: var(--surface); border: 1px solid var(--line-2); box-shadow: var(--shadow-1); }
body.touch .stick { display: block; }
body.touch .round-btn.honk { display: grid; }

/* the stop card */
.card { position: absolute; z-index: 6; right: 84px; top: calc(var(--safe-t) + 76px); width: min(392px, calc(100% - 120px)); max-height: calc(100% - var(--safe-t) - var(--safe-b) - 96px); overflow: auto; padding: 14px 18px 18px 18px; display: grid; gap: 9px; border-left: 6px solid var(--c, var(--sweater)); transform-origin: 92% 0; animation: pop .5s var(--ease-pop) both; }
.card-head { display: flex; align-items: center; gap: 10px; }
.stamp-badge { width: 46px; height: 46px; flex: none; transform: rotate(-8deg); }
.stamp-badge .stamp-art { width: 100%; height: 100%; }
.stamp-badge.fresh { animation: thunk .8s var(--ease-pop) .25s both; }
.card-chips { display: flex; flex-wrap: wrap; gap: 6px; flex: 1; min-width: 0; }
.card h2 { font: 780 1.65rem/1.04 var(--display); letter-spacing: -.012em; text-wrap: balance; }
.card .tag { font-weight: 700; font-size: 1rem; line-height: 1.3; }
.card .body { color: var(--ink-soft); font-size: .95rem; line-height: 1.5; }
.card .note { display: flex; gap: 8px; font-size: .88rem; line-height: 1.4; color: var(--ink-soft); }
.card .note::before { content: ""; flex: none; width: 4px; border-radius: 2px; background: var(--c, var(--sweater)); }
.card-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.card-actions .watch { flex: 1 1 100%; }
.card-actions .go { flex: 1 1 auto; min-width: 0; }
.card-actions .more { flex: 0 0 auto; }
.card-actions.no-link .more { flex: 1 1 auto; }
.card[data-state="watch"] .card-actions .watch { flex: 0 1 auto; }
.card[data-state="watch"] .card-actions .go { flex: 1 1 auto; }
.btn.watch .ico-svg { width: 1.1em; height: 1.1em; }

/* expanded: the project's section. Wide screens: a tall side panel beside the screen */
.card.expanded { width: min(440px, calc(100% - 120px), 38vw); min-width: min(360px, calc(100% - 120px)); max-height: calc(100% - var(--safe-t) - var(--safe-b) - 94px); overscroll-behavior: contain; scrollbar-width: thin; }
.card-sec { display: grid; gap: 14px; margin-top: 6px; padding-top: 14px; border-top: 1px solid var(--line); }
.sec-desc { color: var(--ink-soft); font-size: .96rem; line-height: 1.55; text-wrap: pretty; }
.sec-quote { padding-left: 12px; border-left: 3px solid var(--c, var(--sweater)); font: italic 600 1rem/1.4 var(--display); color: var(--ink); }
.sec-built { list-style: none; padding: 0; display: grid; gap: 8px; font-size: .9rem; line-height: 1.45; color: var(--ink-soft); }
.sec-built li { padding-left: 14px; position: relative; }
.sec-built li::before { content: ""; position: absolute; left: 0; top: .55em; width: 6px; height: 6px; border-radius: 50%; background: var(--c, var(--sweater)); }
.sec-built b { color: var(--ink); }
.sec-gal { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.sec-gal.n1 { grid-template-columns: 1fr; }
.sec-gal.n3 .thumb:first-child, .sec-gal.n5 .thumb:first-child { grid-column: 1 / -1; }
.thumb { position: relative; display: block; padding: 0; border: 0; border-radius: 12px; overflow: hidden; aspect-ratio: 16 / 9; background: color-mix(in srgb, var(--c) 16%, var(--paper)); cursor: zoom-in; box-shadow: inset 0 0 0 1px rgb(28 33 64 / .08); }
.thumb img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .35s var(--ease-out); }
.thumb:hover img { transform: scale(1.04); }
.thumb .zoom { position: absolute; right: 6px; bottom: 6px; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: rgb(28 33 64 / .78); color: var(--paper); opacity: 0; transition: opacity .2s; }
.thumb .zoom .ico-svg { width: 16px; height: 16px; }
.thumb:hover .zoom, .thumb:focus-visible .zoom { opacity: 1; }
body.touch .thumb .zoom { opacity: 1; }
.thumb:focus-visible { outline-offset: 2px; }
.card .d-facts { padding: 12px 14px; }
.sec-pitch { font-weight: 700; line-height: 1.45; }
.sec-tech { display: grid; gap: 4px; font-size: .9rem; line-height: 1.45; color: var(--ink); }
.sec-tech .k { font: 600 .7rem/1.4 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-soft); }
.sec-links, .sec-foot { display: flex; flex-wrap: wrap; gap: 8px; }
.sec-links .btn, .sec-foot .btn { min-height: 44px; padding: 0 16px; font-size: .9rem; }
.card .d-nolink .ico { color: var(--c); }

/* watch mode: a slim player strip under the screen, in the space the panel leaves */
.player { position: absolute; z-index: 7; left: calc((100% - var(--inset-r, 0px)) / 2); bottom: calc(var(--inset-b, 0px) + var(--safe-b) + 16px); translate: -50% 0; width: min(580px, calc(100% - var(--inset-r, 0px) - 32px)); display: flex; align-items: center; gap: 4px; padding: 6px 12px 6px 6px; border-radius: 999px; animation: rise .35s var(--ease-out) both; }
.pl-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; flex: none; min-width: 44px; height: 44px; padding: 0 10px; border: 0; border-radius: 999px; background: transparent; color: var(--ink); transition: background .15s, transform .15s var(--ease-out); }
.pl-btn:hover { background: color-mix(in srgb, var(--ink) 9%, transparent); }
.pl-btn:active { transform: scale(.94); }
.pl-btn .lbl, .pl-btn kbd { display: none; }
.pl-btn .ico-svg { width: 22px; height: 22px; }
#pl-play { width: 44px; padding: 0; background: var(--ink); color: var(--paper); }
#pl-play .ico-svg { width: 20px; height: 20px; }
.player.muted #pl-mute { background: var(--sweater); }
.pl-time { flex: none; padding: 0 6px; font: 600 .74rem/1 var(--mono); color: var(--ink-soft); white-space: nowrap; font-variant-numeric: tabular-nums; }
.pl-seek { flex: 1; min-width: 60px; height: 44px; margin: 0 6px; background: transparent; -webkit-appearance: none; appearance: none; cursor: pointer; }
.pl-seek::-webkit-slider-runnable-track { height: 6px; border-radius: 3px; background: linear-gradient(to right, var(--sweater) var(--p, 0%), var(--line-2) var(--p, 0%)); }
.pl-seek::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; margin-top: -6px; border-radius: 50%; background: var(--ink); border: 3px solid var(--surface); box-shadow: 0 0 0 1px rgb(28 33 64 / .2); }
.pl-seek::-moz-range-track { height: 6px; border-radius: 3px; background: var(--line-2); }
.pl-seek::-moz-range-progress { height: 6px; border-radius: 3px; background: var(--sweater); }
.pl-seek::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: var(--ink); border: 3px solid var(--surface); }
.pl-seek:focus-visible { outline-offset: -2px; border-radius: 8px; }

/* watch mode: the rest of the HUD steps back, and the edges of the scene dim like a drive-in at dusk */
#app::before { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none; opacity: 0; transition: opacity .5s ease; background: radial-gradient(ellipse 58% 62% at calc((100% - var(--inset-r, 0px)) / 2) calc((100% - var(--inset-b, 0px)) / 2 + 12px), transparent 60%, rgb(20 22 44 / .42)); }
#app[data-view="watch"]::before { opacity: 1; }
#app:has(.card.expanded) .keys { display: none; }       /* the section panel reaches the bottom */
#app[data-view="watch"] :is(.top, .dock) { opacity: .3; transition: opacity .3s; }
#app[data-view="watch"] :is(.top, .dock):is(:hover, :focus-within) { opacity: 1; }
#app[data-view="watch"] :is(.compass, .keys, .minimap, .onboard, .round-btn.honk), #app[data-view="watch"] .stick:not(.on) { display: none; }

/* the mini map: round, heading up, bottom left on a desktop */
.minimap { position: absolute; left: 18px; bottom: calc(var(--safe-b) + 18px); width: 156px; height: 156px; padding: 0; border: 3px solid var(--surface); border-radius: 50%; background: #A8CD86; box-shadow: var(--shadow-2); cursor: pointer; transition: transform .18s var(--ease-out), box-shadow .18s; animation: fade .4s both; }
.minimap canvas { display: block; width: 100%; height: 100%; border-radius: 50%; }
.minimap::after { content: "Map"; position: absolute; left: 50%; bottom: -9px; translate: -50% 0; padding: 4px 9px; border-radius: 999px; background: var(--ink); color: var(--paper); font: 600 .62rem/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; box-shadow: var(--shadow-1); }
body:not(.touch) .minimap::after { content: "Map · M"; }
.minimap:hover { transform: scale(1.04); box-shadow: 0 2px 6px rgb(28 33 64 / .12), 0 28px 50px -18px rgb(28 33 64 / .5); }
.minimap:active { transform: scale(.97); }
.minimap:focus-visible { outline-offset: 4px; }
body.touch .minimap { left: 12px; top: calc(var(--safe-t) + 70px); bottom: auto; width: 108px; height: 108px; }

/* the full map */
.sheet-panel.map { width: min(1040px, 100%); }
.fmap-frame { position: relative; border-radius: 16px; overflow: hidden; background: #A8CD86; box-shadow: inset 0 0 0 1px rgb(28 33 64 / .1); }
.fmap-canvas { display: block; width: 100%; height: auto; }
.fmap-pins { list-style: none; margin: 0; padding: 0; position: absolute; inset: 0; }
.fmap-pins li { position: absolute; width: 0; height: 0; }
.fmap-pin { position: absolute; left: 0; top: 0; transform: translate(-22px, -22px); display: flex; align-items: center; height: 44px; min-width: 44px; padding: 0; border: 0; background: none; border-radius: 999px; }
.fmap-pin.left { flex-direction: row-reverse; transform: translate(calc(-100% + 22px), -22px); }
.fm-dot { flex: none; width: 32px; height: 32px; margin: 6px; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, var(--c) 62%, #1C2140); border: 3px solid var(--surface); box-shadow: 0 0 0 1.5px var(--c), var(--shadow-1); color: #fff; font: 800 .72rem/1 var(--display); transition: transform .18s var(--ease-pop); }
.fm-ok .ico-svg { width: 15px; height: 15px; stroke-width: 3.2; }
.fm-name { padding: 5px 10px; border-radius: 999px; background: var(--surface); box-shadow: var(--shadow-1); font: 700 .8rem/1 var(--display); white-space: nowrap; }
.fmap-pin:hover .fm-dot, .fmap-pin:focus-visible .fm-dot { transform: scale(1.14); }
.fmap-pin:hover .fm-name { background: var(--ink); color: var(--paper); }
.fmap-you { position: absolute; width: 0; height: 0; pointer-events: none; }
.fy-arrow { position: absolute; left: -15px; top: -15px; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--ink); box-shadow: 0 0 0 3px rgb(224 165 38 / .45), var(--shadow-1); }
.fy-arrow svg { width: 18px; height: 18px; fill: #E0A526; }
.fy-tag { position: absolute; left: 0; top: 18px; translate: -50% 0; padding: 3px 7px; border-radius: 999px; background: var(--ink); color: var(--paper); font: 600 .6rem/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; }
.fmap-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-top: 12px; font-size: .86rem; color: var(--ink-soft); }
.fmap-legend span { display: inline-flex; align-items: center; gap: 6px; }
.fmap-legend .lg-hint { margin-left: auto; }
.lg-dot { width: 16px; height: 16px; border-radius: 50%; background: var(--ink-mute); border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--line-2); display: grid; place-items: center; color: #fff; }
.lg-dot.done { background: var(--ink); }
.lg-dot .ico-svg { width: 9px; height: 9px; stroke-width: 4; }
.lg-you { width: 14px; height: 14px; border-radius: 50%; background: var(--ink); box-shadow: 0 0 0 2px rgb(224 165 38 / .6); }

/* an enlarged screenshot */
.sheet-panel.photo { width: min(1120px, 100%); }
.ph { margin: 0; display: grid; gap: 10px; }
.ph-img { display: block; width: 100%; max-height: calc(100vh - 230px); object-fit: contain; border-radius: 14px; background: var(--ink); }
.ph-cap { font-size: .94rem; line-height: 1.45; color: var(--ink-soft); }
.ph-nav { display: flex; justify-content: space-between; gap: 10px; margin-top: 14px; }

/* toasts */
.toast { position: absolute; z-index: 8; left: 50%; bottom: calc(var(--safe-b) + 132px); translate: -50% 0; display: flex; align-items: center; gap: 10px; max-width: min(520px, calc(100% - 32px)); padding: 10px 20px 10px 12px; border-radius: 999px; background: var(--ink); color: var(--paper); font-weight: 700; font-size: .92rem; line-height: 1.25; box-shadow: var(--shadow-2); animation: pop .4s var(--ease-pop) both; }
.toast:not(:has(.toast-ico)) { padding-left: 20px; }
.toast-ico { width: 28px; height: 28px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--sweater); color: var(--ink); }
.toast.critter .toast-ico { background: #8FD3A5; }
.toast-ico .ico-svg { width: 16px; height: 16px; stroke-width: 2.6; }

/* first-visit tips */
.onboard { position: absolute; z-index: 6; left: 50%; top: calc(var(--safe-t) + 76px); translate: -50% 0; width: min(620px, calc(100% - 36px)); padding: 16px 52px 16px 20px; animation: rise .5s var(--ease-out) .3s both; }
.onboard #onboard-x { position: absolute; top: 8px; right: 8px; }
.steps { list-style: none; padding: 0; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 18px; }
.steps li { display: flex; gap: 10px; align-items: flex-start; }
.steps .n { width: 26px; height: 26px; flex: none; border-radius: 50%; background: var(--ink); color: var(--paper); display: grid; place-items: center; font: 700 .78rem/1 var(--mono); }
.steps .t { display: grid; gap: 2px; font-size: .84rem; line-height: 1.3; color: var(--ink-soft); }
.steps .t b { font: 700 1rem/1.2 var(--display); color: var(--ink); }

/* sheets: passport, glovebox, postcard */
.sheet { position: absolute; inset: 0; z-index: 20; display: grid; place-items: center; padding: max(16px, var(--safe-t)) 16px max(16px, var(--safe-b)); background: rgb(28 33 64 / .48); animation: fade .25s both; }
.sheet-panel { position: relative; width: min(560px, 100%); max-height: 100%; overflow: auto; background: var(--paper); border-radius: var(--r-4); border: 1px solid rgb(28 33 64 / .1); box-shadow: var(--shadow-2); animation: rise .38s var(--ease-out) both; outline: none; }
.sheet-panel.book { width: min(720px, 100%); height: min(770px, 100%); overflow: visible; background: transparent; border: 0; box-shadow: none; }
.sheet-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 20px 20px 2px 24px; }
.sheet-head h2 { font: 780 1.7rem/1.08 var(--display); letter-spacing: -.01em; }
.sheet-sub { margin-top: 4px; color: var(--ink-soft); font-size: .95rem; }
.sheet-body { padding: 14px 20px 22px 24px; }
.stops { list-style: none; padding: 0; display: grid; gap: 8px; }
.stop-row { width: 100%; display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 8px 14px 8px 10px; text-align: left; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); transition: transform .16s var(--ease-out), border-color .16s, box-shadow .16s; }
.stop-row:hover { border-color: var(--c, var(--ink)); transform: translateX(2px); box-shadow: var(--shadow-1); }
.stop-mini { width: 44px; height: 44px; flex: none; }
.stop-mini .stamp-art { width: 100%; height: 100%; }
.stop-text { display: grid; flex: 1; min-width: 0; }
.stop-text .nm { font-weight: 700; }
.stop-text .st { font: 600 .68rem/1.5 var(--mono); color: var(--ink-soft); text-transform: uppercase; letter-spacing: .06em; }
.stop-row .go { display: inline-flex; align-items: center; gap: 2px; font-size: .82rem; font-weight: 700; color: var(--ink-soft); white-space: nowrap; }
.sheet .foot { margin-top: 18px; display: grid; gap: 12px; justify-items: start; }
.sheet .foot .mail { display: inline-flex; align-items: center; gap: 8px; color: var(--blob); font-weight: 700; min-height: 44px; }
.postcard .card-photo img { display: block; width: 100%; height: auto; border-radius: 14px; box-shadow: var(--shadow-1); }
.postcard .row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.postcard { width: min(680px, 100%); }

/* behind an open sheet the HUD steps aside, so only the dimmed scene shows */
#app.sheet-open :is(.top, .dock, .card, .drive-ui, .onboard, .intro, .labels, .toast) { visibility: hidden; }

/* stamps: inked when collected, a soft silhouette when not */
.stamp-art { display: block; width: 100%; height: 100%; overflow: visible; }
.stamp-art .s-fill { fill: color-mix(in srgb, var(--c) 9%, var(--surface)); }
.stamp-art .s-ring { fill: none; stroke: var(--c); stroke-width: 3.4; }
.stamp-art .s-ring2 { fill: none; stroke: var(--c); stroke-width: 1.2; stroke-dasharray: 1.4 3.2; stroke-linecap: round; }
.stamp-art .s-arc { font: 700 6.6px var(--mono); fill: var(--c); }
.stamp-art .s-mono { font-family: var(--display); font-weight: 800; fill: var(--c); }
.stamp-art.sm .s-ring { stroke-width: 5.4; }
.stamp-art.sm .s-ring2 { stroke-width: 2.2; stroke-dasharray: 2.2 4.6; }
.stamp-art.locked .s-fill { fill: rgb(28 33 64 / .045); }
.stamp-art.locked .s-ring { stroke: var(--line-2); stroke-dasharray: 6 4.5; stroke-width: 2.6; }
.stamp-art.locked .s-ring2 { stroke: var(--line); }
.stamp-art.locked .s-arc, .stamp-art.locked .s-mono { fill: var(--line-2); }

/* the booklet */
.book { position: relative; width: 100%; height: 100%; display: grid; grid-template-rows: minmax(0, 1fr) auto; gap: 12px; }
.book-stage { position: relative; min-height: 0; perspective: 1900px; perspective-origin: 50% 40%; }
.book-close { position: absolute; top: 12px; right: 12px; z-index: 6; background: var(--surface); box-shadow: var(--shadow-1); }
.book-close:hover { background: var(--paper); }
.page { position: absolute; inset: 0; overflow: auto; border-radius: var(--r-4); background: linear-gradient(90deg, rgb(28 33 64 / .07), transparent 24px), var(--surface); border: 1px solid rgb(28 33 64 / .09); box-shadow: var(--shadow-2); transform-origin: 0 50%; backface-visibility: hidden; -webkit-backface-visibility: hidden; outline: none; scrollbar-width: thin; overscroll-behavior: contain; }
.page.under { z-index: 1; }
.page.turn-out { z-index: 3; animation: turn-out .6s cubic-bezier(.5, .05, .75, .45) both; }
.page.turn-in { z-index: 3; animation: turn-in .6s cubic-bezier(.2, .7, .3, 1) both; }
.page.turn-out::after, .page.turn-in::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; background: linear-gradient(90deg, rgb(28 33 64 / .3), rgb(28 33 64 / 0) 75%); }
.page.turn-out::after { animation: shade-in .6s both; }
.page.turn-in::after { animation: shade-out .6s both; }
.page-head { padding: 26px 76px 0 32px; }
.page-head h2 { font: 780 1.8rem/1.05 var(--display); letter-spacing: -.012em; }
.page-head p { margin-top: 4px; font-size: .95rem; color: var(--ink-soft); }
.page-lede { padding: 10px 28px 0 32px; font-size: .95rem; color: var(--ink-soft); }

.cover { background: var(--ink); color: var(--paper); border-color: transparent; display: grid; grid-template-rows: auto 1fr auto; }
.cover-inner { display: grid; justify-items: center; align-content: center; gap: 16px; padding: 20px 28px; text-align: center; }
.knit-strip { height: 14px; background: var(--sweater); -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='14'%3E%3Cellipse cx='3.6' cy='7' rx='2.3' ry='5.4' transform='rotate(-26 3.6 7)'/%3E%3Cellipse cx='8.4' cy='7' rx='2.3' ry='5.4' transform='rotate(26 8.4 7)'/%3E%3C/svg%3E") 0 0 / 12px 14px repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='14'%3E%3Cellipse cx='3.6' cy='7' rx='2.3' ry='5.4' transform='rotate(-26 3.6 7)'/%3E%3Cellipse cx='8.4' cy='7' rx='2.3' ry='5.4' transform='rotate(26 8.4 7)'/%3E%3C/svg%3E") 0 0 / 12px 14px repeat; margin-top: 18px; }
.knit-strip.bottom { margin: 0 0 18px; }
.emblem { width: 76px; height: 76px; padding: 14px; border-radius: 50%; background: rgb(255 253 247 / .08); box-shadow: inset 0 0 0 2px rgb(217 152 27 / .55); }
.cover-title h2 { font: 800 2.3rem/1 var(--display); letter-spacing: .16em; text-transform: uppercase; color: var(--sweater); }
.cover-title p { margin-top: 8px; font: 600 .74rem/1.3 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: rgb(255 253 247 / .72); }
.ring { position: relative; width: 178px; height: 178px; margin: 4px 0; }
.ring svg { width: 100%; height: 100%; }
.ring-track { fill: none; stroke: rgb(255 253 247 / .14); stroke-width: 8; }
.ring-val { fill: none; stroke: var(--sweater); stroke-width: 8; stroke-linecap: round; transition: stroke-dasharray 1.2s var(--ease-out) .3s; }
.ring-text { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; gap: 2px; }
.ring-text b { font: 800 3.6rem/1 var(--display); }
.ring-text span { font: 600 .7rem/1.2 var(--mono); letter-spacing: .09em; text-transform: uppercase; color: rgb(255 253 247 / .75); }
.cover-note { max-width: 30ch; font-size: .98rem; line-height: 1.4; color: rgb(255 253 247 / .9); text-wrap: balance; }
.cover-crit { display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: 999px; background: rgb(255 253 247 / .1); font-size: .86rem; font-weight: 700; }
.cover-mail { color: var(--sweater); font-weight: 700; font-size: .92rem; overflow-wrap: anywhere; }
.cover-open { display: inline-flex; align-items: center; gap: 8px; min-height: 52px; padding: 0 26px; margin-top: 4px; border: 0; border-radius: 999px; background: var(--sweater); color: var(--ink); font: 700 1.02rem/1 var(--body); transition: transform .16s var(--ease-out); }
.cover-open:hover { transform: translateY(-2px); }

.stamps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px 6px; padding: 18px 26px 30px 30px; }
.stamp-btn { display: grid; justify-items: center; align-content: start; gap: 5px; min-height: 44px; padding: 10px 4px 8px; border: 0; border-radius: 18px; background: transparent; text-align: center; transition: transform .25s var(--ease-pop), background .15s; }
.stamp-btn:hover { background: color-mix(in srgb, var(--c) 9%, transparent); transform: translateY(-3px); }
.stamp-btn .art { display: block; width: 104px; height: 104px; transform: rotate(var(--rot, 0deg)); transition: transform .25s var(--ease-pop); }
.stamp-btn:hover .art { transform: rotate(0deg) scale(1.06); }
.stamp-btn .nm { font-weight: 700; font-size: .86rem; line-height: 1.2; color: var(--ink); text-wrap: balance; }
.stamp-btn .kd { font: 600 .62rem/1.2 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-soft); }
.stamp-btn.locked .nm { color: var(--ink-soft); }
.stamp-btn.fresh .art { animation: thunk .8s var(--ease-pop) .35s both; }

.meter { height: 10px; margin: 16px 30px 6px 32px; border-radius: 999px; background: var(--line); overflow: hidden; }
.meter span { display: block; height: 100%; border-radius: inherit; background: var(--sweater); transition: width .6s var(--ease-out); }
.crits { list-style: none; padding: 8px 22px 28px 28px; display: grid; gap: 8px; }
.crits li { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 16px; background: var(--paper); border: 1px solid var(--line); }
.crits .ci { width: 40px; height: 40px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--line); color: var(--ink-mute); }
.crits li.found .ci { background: var(--live-bg); color: var(--live); }
.crits .ct { display: grid; flex: 1; min-width: 0; }
.crits .ct b { font-size: .95rem; }
.crits .ct span { font-size: .86rem; color: var(--ink-soft); }
.crits .ck { color: var(--live); }
.empty { display: grid; justify-items: center; align-content: center; gap: 12px; min-height: 52%; padding: 44px 36px 52px; text-align: center; color: var(--ink-soft); }
.empty p { max-width: 32ch; text-wrap: balance; }
.empty .ico { color: var(--line-2); }

.d-top { position: sticky; top: 0; z-index: 3; display: flex; justify-content: space-between; align-items: center; padding: 10px 76px 4px 16px; background: linear-gradient(var(--surface) 72%, transparent); }
.crumb { display: inline-flex; align-items: center; gap: 2px; min-height: 44px; padding: 0 14px 0 6px; border: 0; border-radius: 999px; background: transparent; font-weight: 700; font-size: .92rem; color: var(--ink-soft); }
.crumb:hover { color: var(--ink); background: color-mix(in srgb, var(--ink) 6%, transparent); }
.d-count { font: 600 .74rem/1 var(--mono); letter-spacing: .05em; color: var(--ink-soft); }
.hero { position: relative; margin: 0 22px 0 26px; border-radius: 18px; overflow: hidden; aspect-ratio: 2.5 / 1; background: color-mix(in srgb, var(--c) 18%, var(--paper)); box-shadow: inset 0 0 0 1px rgb(28 33 64 / .08); }
.hero img { display: block; width: 100%; height: 100%; object-fit: cover; }
.hero .chip.kind { position: absolute; left: 12px; top: 12px; background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); }
.d-body { display: grid; gap: 13px; padding: 18px 24px 8px 30px; }
.d-title { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; }
.d-head .chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 9px; }
.d-head h3 { font: 780 2rem/1.03 var(--display); letter-spacing: -.014em; text-wrap: balance; }
.d-tag { margin-top: 6px; font-weight: 700; line-height: 1.3; }
.d-stamp { width: 86px; height: 86px; flex: none; transform: rotate(var(--rot, -6deg)); }
.d-cols { display: grid; gap: 13px; align-items: start; }
.d-left, .d-right { display: grid; gap: 13px; align-content: start; min-width: 0; }
.d-text { color: var(--ink-soft); line-height: 1.55; text-wrap: pretty; }
.d-facts { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 9px 18px; padding: 14px 16px; border-radius: 14px; background: var(--paper); border: 1px solid var(--line); }
.d-facts dt { padding-top: 2px; font: 600 .7rem/1.5 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-soft); }
.d-facts dd { margin: 0; font-weight: 600; font-size: .92rem; line-height: 1.4; overflow-wrap: anywhere; }
.d-facts dd a { color: var(--blob); }
.mini { position: relative; min-height: 32px; padding: 0 12px; margin-left: 4px; border: 1px solid var(--line-2); border-radius: 999px; background: var(--surface); font: 700 .72rem/1 var(--body); }
.mini::after { content: ""; position: absolute; inset: -6px -4px; }      /* a 44px hit area around the small pill */
.mini:hover { border-color: var(--ink); }
.d-note, .d-nolink { display: flex; gap: 8px; align-items: flex-start; font-size: .9rem; line-height: 1.4; color: var(--ink-soft); }
.d-note .ico, .d-nolink .ico { margin-top: 1px; color: var(--c); }
.d-links { display: flex; flex-wrap: wrap; gap: 8px; }
.d-actions { position: sticky; bottom: 0; z-index: 3; display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; padding: 16px 22px 14px 28px; background: linear-gradient(transparent, var(--surface) 36%); }

.book-nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 2px; }
.nav-btn { display: inline-flex; align-items: center; gap: 4px; min-height: 46px; max-width: 38%; padding: 0 16px; border: 0; border-radius: 999px; background: var(--surface); box-shadow: var(--shadow-1); font-weight: 700; font-size: .9rem; transition: transform .16s var(--ease-out), opacity .2s; }
.nav-btn:hover { transform: translateY(-1px); }
.nav-btn:disabled { visibility: hidden; }
.nav-btn .nl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.book-nav .mid { display: flex; flex: none; align-items: center; gap: 8px; white-space: nowrap; }
.book-nav .dot { width: 8px; height: 8px; border-radius: 999px; background: rgb(255 253 247 / .55); transition: width .25s var(--ease-out), background .25s; }
.book-nav .dot.on { width: 24px; background: var(--sweater); }
.book-nav .count { color: var(--paper); font: 600 .78rem/1 var(--mono); letter-spacing: .06em; }

.flash { position: absolute; inset: 0; z-index: 30; background: #fff; opacity: 0; pointer-events: none; }
.flash.on { animation: flash .42s ease-out; }

/* motion */
@keyframes pop { 0% { transform: scale(.7, .5); opacity: 0; } 60% { transform: scale(1.03, .98); opacity: 1; } 100% { transform: scale(1); opacity: 1; } }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes bump { 0% { transform: scale(1); } 35% { transform: scale(1.4); } 100% { transform: scale(1); } }
@keyframes tap { from { transform: scale(.4); opacity: 1; } to { transform: scale(3.6); opacity: 0; } }
@keyframes flash { 0% { opacity: .85; } 100% { opacity: 0; } }
@keyframes label-pulse { 0% { transform: scale(1); } 40% { transform: scale(1.18) translateY(-4px); } 100% { transform: scale(1); } }
@keyframes you-ring { 0% { transform: scale(.5); opacity: .9; } 100% { transform: scale(1.5); opacity: 0; } }
@keyframes thunk { 0% { transform: scale(2.4) rotate(-24deg); opacity: 0; } 55% { transform: scale(.9) rotate(var(--rot, -6deg)); opacity: 1; } 100% { transform: scale(1) rotate(var(--rot, -6deg)); opacity: 1; } }
@keyframes turn-out { from { transform: rotateY(0); } to { transform: rotateY(-112deg); } }
@keyframes turn-in { from { transform: rotateY(-112deg); } to { transform: rotateY(0); } }
@keyframes shade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes shade-out { from { opacity: 1; } to { opacity: 0; } }

/* wide but short screens (a phone on its side) */
@media (max-height: 560px) {
  .top { top: calc(var(--safe-t) + 8px); }
  .dock { top: calc(var(--safe-t) + 62px); gap: 8px; }
  .card { top: calc(var(--safe-t) + 62px); max-height: calc(100% - 74px); overflow: auto; }
  .keys { display: none; }
  #app:has(.card:not([hidden])) .compass { display: none; }
  .intro { padding: 16px 20px; gap: 8px; }
  .intro .lede, .intro .hint { display: none; }
}

/* narrower screens: the top bar sheds its labels first */
@media (max-width: 900px) {
  .keys span:nth-child(n+4) { display: none; }
  .role { display: none; }
}

/* phones */
@media (max-width: 640px) {
  .top { top: calc(var(--safe-t) + 10px); left: 10px; right: 10px; }
  .brand { min-height: 44px; padding: 5px 5px; }
  .brand .who { display: none; }
  .pill-btn { min-height: 44px; padding: 0 14px 0 12px; font-size: .88rem; }
  .pill-btn .ico { display: none; }
  #look-seg { display: none; }
  #btn-look { display: grid; }
  .dock { top: auto; right: 12px; bottom: calc(var(--safe-b) + 128px); flex-direction: column-reverse; gap: 8px; }
  .dock .round-btn { width: 44px; height: 44px; }
  #app[data-mode="planet"] .dock { top: calc(var(--safe-t) + 62px); bottom: auto; }
  .intro { bottom: calc(var(--safe-b) + 14px); width: calc(100% - 24px); padding: 18px 18px 16px; gap: 10px; }
  .intro h1 { font-size: 1.85rem; }
  .lede { font-size: 1rem; }
  .cta { min-height: 54px; padding: 0 30px; font-size: 1.2rem; }
  .card { top: calc(var(--safe-t) + 62px); right: 10px; left: 10px; width: auto; padding: 12px 14px 14px; gap: 8px; transform-origin: 50% 0; }
  .card h2 { font-size: 1.4rem; }
  .stamp-badge { width: 40px; height: 40px; }
  .you-tag { font-size: .58rem; padding: 3px 7px; bottom: 14px; }
  .card .btn { min-height: 44px; padding: 0 14px; font-size: .9rem; }
  /* expanded, the card becomes a bottom sheet */
  .card.expanded { top: auto; bottom: 0; left: 0; right: 0; width: auto; min-width: 0; max-height: 60%; padding: 12px 16px calc(var(--safe-b) + 16px); border-left: 0; border-top: 6px solid var(--c, var(--sweater)); border-radius: 24px 24px 0 0; transform-origin: 50% 100%; animation: rise .35s var(--ease-out) both; }
  .card[data-state="watch"] { max-height: 50%; }
  #app:has(.card.expanded) :is(.dock, .round-btn.honk, .compass, .onboard) { display: none; }
  .sec-gal { grid-template-columns: repeat(2, 1fr); }
  .onboard { top: calc(var(--safe-t) + 62px); padding: 14px 44px 12px 14px; }
  .steps { grid-auto-flow: row; gap: 8px; }
  .steps li { align-items: center; }
  .steps .t { font-size: .8rem; gap: 0; }
  .steps .t b { font-size: .95rem; }
  .toast { bottom: calc(var(--safe-b) + 214px); font-size: .9rem; border-radius: 22px; }
  .compass { bottom: calc(var(--safe-b) + 36px); flex-direction: column; gap: 4px; padding: 0; background: none; border: 0; box-shadow: none; }
  .compass-ring { width: 52px; height: 52px; box-shadow: var(--shadow-1); }
  .compass-text { padding: 3px 10px; border-radius: 999px; background: var(--glass); box-shadow: var(--shadow-1); }
  .compass-k { display: none; }
  .compass-name { font-size: .8rem; max-width: 11ch; }
  #app[data-view="watch"] .dock { display: none; }
  .minimap, body.touch .minimap { left: 10px; top: calc(var(--safe-t) + 64px); width: 96px; height: 96px; }
  /* the stop card and the first tips take the top of a phone: the map steps aside meanwhile */
  #app:has(#card:not([hidden])) .minimap, #app:has(#onboard:not([hidden])) .minimap { display: none; }
  .pl-time { display: none; }
  .player { padding-right: 6px; }
  .fm-name { display: none; }
  .fmap-pin:focus-visible .fm-name { display: block; }
  .fm-dot { width: 28px; height: 28px; margin: 8px; font-size: .64rem; border-width: 2.5px; }
  .fmap-legend .lg-hint { margin-left: 0; flex-basis: 100%; }
  .sheet-panel.map .sheet-body { padding: 12px 12px 20px; }
  .ph-img { max-height: calc(100vh - 260px); }
  .sheet { padding: 0; place-items: end center; }
  .sheet-panel { width: 100%; max-height: 92%; border-radius: 24px 24px 0 0; border-bottom: 0; }
  .sheet-panel.book { height: 100%; max-height: none; border-radius: 0; }
  .book { padding: calc(var(--safe-t) + 8px) 8px calc(var(--safe-b) + 8px); gap: 10px; }
  .page-head { padding: 22px 70px 0 24px; }
  .page-lede { padding: 8px 22px 0 24px; }
  .stamps { grid-template-columns: repeat(3, 1fr); padding: 14px 12px 24px 16px; gap: 4px 2px; }
  .stamp-btn .art { width: 80px; height: 80px; }
  .hero { margin: 0 14px 0 20px; aspect-ratio: 16 / 9; }
  .d-body { padding: 16px 16px 6px 22px; gap: 12px; }
  .d-head h3 { font-size: 1.65rem; }
  .d-stamp { width: 66px; height: 66px; }
  .d-actions { padding: 20px 14px 14px 20px; }
  .d-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .d-actions .btn { padding: 0 10px; font-size: .9rem; }
  .d-actions .btn .ico { display: none; }
  .stop-row .go .lbl { display: none; }
  .d-top { padding-left: 8px; }
  .cover-title h2 { font-size: 2rem; }
  .ring { width: 156px; height: 156px; }
  .ring-text b { font-size: 3.1rem; }
  .crits { padding: 8px 14px 24px 20px; }
  .meter { margin: 14px 22px 6px 24px; }
}

@media (min-width: 700px) {
  .d-cols { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 13px 22px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .you-dot::before { display: none; }
}
