/* ==========================================================================
   PEBBLE 2 · oddlyplay design language, assets/pebble.css
   Ported from Claude Design's "oddlyplay redesign". The block between
   "PEBBLE 2 · START" and "PEBBLE 2 · END" is the design's own stylesheet; the
   few lines in it that were adapted to our pages are marked "ADAPTED".
   Below it, in order: LEGACY ALIASES (old token names, so nothing resolves to
   nothing), the .pb ROOT, the WORDMARK and its logo hop, the COMFORT PANEL, and
   LEGACY COMPAT (old class names re-skinned in the new language, so pages that
   have not been restructured yet look like the same family).

   The rules the design is built on, which every change must keep:
   - orange means one thing: the act (play, record, the main step on a page) and
     the logo. Selection, focus and controls are ink.
   - nothing moves until the person acts, with ONE deliberate exception the
     founder decided: the lifted "d" in the header logo hops every 10 to 14
     seconds, and once more when hovered, focused or tapped. It stays still under
     prefers-reduced-motion, a Motion dial at or below the low motion threshold
     (data-low-motion), high contrast (data-hc), Clean screen and recording.
   - depth is layered and ink tinted; dark mode is designed, not inverted.
   ========================================================================== */
/* ======================================================================== PEBBLE 2 · START ======
   oddlyplay · assets/pebble.css · version 2
   Tokens first, then base, then components. Plain CSS custom properties; no build step.
   Orange means one thing: the act (play, record, the main step on a page) and the logo. Nothing moves until the person acts.
   ============================================================================================== */

/* ---------- tokens: colour, light ---------- */
:root {
  color-scheme: light;
  --paper: #F3F4F1;            /* the page */
  --surface: #FAFAF8;          /* raised: panels, menus, the header once scrolled */
  --surface-2: #ECEDE9;        /* sunk: wells and quiet blocks */
  --well: #E3E5E0;             /* deepest: behind a toy */
  --ink: #15181F;              /* text, 16.6:1 on paper */
  --ink-2: #474D5B;            /* secondary text, 7.7:1 */
  --ink-3: #626876;            /* meta text, 5.1:1 */
  --line: rgba(21, 24, 31, 0.12);         /* hairlines */
  --line-strong: rgba(21, 24, 31, 0.26);
  --accent: #C74D06;           /* the act. 4.6:1 on paper as text, 5.1:1 under white */
  --on-accent: #FFFFFF;
  --accent-soft: rgba(199, 77, 6, 0.09);
  --focus: #15181F;            /* focus rings are ink: orange keeps its one meaning */
  --logo-oddly: #C74D06;
  --logo-play: #15181F;
  /* depth: ink-tinted, layered, with a fine top highlight; never one grey box shadow */
  --shadow-1: inset 0 1px 0 rgba(255, 255, 255, 0.75), 0 1px 2px rgba(21, 24, 31, 0.06), 0 2px 8px rgba(21, 24, 31, 0.04);
  --shadow-2: inset 0 1px 0 rgba(255, 255, 255, 0.75), 0 2px 4px rgba(21, 24, 31, 0.05), 0 10px 28px rgba(21, 24, 31, 0.08);
  --shadow-3: inset 0 1px 0 rgba(255, 255, 255, 0.6), 0 6px 12px rgba(21, 24, 31, 0.06), 0 28px 64px rgba(21, 24, 31, 0.16);
  --sunk: inset 0 2px 6px rgba(21, 24, 31, 0.10), inset 0 0 0 1px var(--line);
}
/* ---------- tokens: colour, dark (designed, not inverted: deeper graphite, lighter surfaces carry depth) ---------- */
:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #111316; --surface: #191C21; --surface-2: #0C0E10; --well: #07080A;
  --ink: #F1F2EE; --ink-2: #B7BCC6; --ink-3: #8F95A1;
  --line: rgba(241, 242, 238, 0.10); --line-strong: rgba(241, 242, 238, 0.24);
  --accent: #F07A35; --on-accent: #15171C; --accent-soft: rgba(240, 122, 53, 0.13); --focus: #F1F2EE;
  --logo-oddly: #F07A35; --logo-play: #F1F2EE;
  --shadow-1: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 0 0 1px var(--line), 0 2px 8px rgba(0, 0, 0, 0.35);
  --shadow-2: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 0 0 1px var(--line), 0 12px 32px rgba(0, 0, 0, 0.45);
  --shadow-3: inset 0 1px 0 rgba(255, 255, 255, 0.07), 0 0 0 1px var(--line), 0 30px 70px rgba(0, 0, 0, 0.6);
  --sunk: inset 0 2px 10px rgba(0, 0, 0, 0.55), inset 0 0 0 1px var(--line);
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]):not([data-theme="dark"]) {
  color-scheme: dark;
  --paper: #111316; --surface: #191C21; --surface-2: #0C0E10; --well: #07080A;
  --ink: #F1F2EE; --ink-2: #B7BCC6; --ink-3: #8F95A1;
  --line: rgba(241, 242, 238, 0.10); --line-strong: rgba(241, 242, 238, 0.24);
  --accent: #F07A35; --on-accent: #15171C; --accent-soft: rgba(240, 122, 53, 0.13); --focus: #F1F2EE;
  --logo-oddly: #F07A35; --logo-play: #F1F2EE;
  --shadow-1: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 0 0 1px var(--line), 0 2px 8px rgba(0, 0, 0, 0.35);
  --shadow-2: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 0 0 1px var(--line), 0 12px 32px rgba(0, 0, 0, 0.45);
  --shadow-3: inset 0 1px 0 rgba(255, 255, 255, 0.07), 0 0 0 1px var(--line), 0 30px 70px rgba(0, 0, 0, 0.6);
  --sunk: inset 0 2px 10px rgba(0, 0, 0, 0.55), inset 0 0 0 1px var(--line);
} }
/* ---------- tokens: type, space, radius, motion ---------- */
:root {
  --font-display: "Bricolage Grotesque", ui-sans-serif, system-ui, sans-serif;
  --font-text: "Atkinson Hyperlegible Next", ui-sans-serif, system-ui, sans-serif;
  --t-hero: clamp(3rem, 1.4rem + 6.2vw, 6.75rem);
  --t-display: clamp(2.375rem, 1.5rem + 3.4vw, 4.25rem);
  --t-h2: clamp(1.625rem, 1.25rem + 1.4vw, 2.375rem);
  --t-h3: clamp(1.1875rem, 1.08rem + 0.45vw, 1.4375rem);
  --t-lead: clamp(1.125rem, 1.04rem + 0.35vw, 1.3125rem);
  --t-body: 1.0625rem; --t-small: 0.9375rem; --t-micro: 0.8125rem;
  --lh-tight: 0.96; --lh-head: 1.12; --lh-body: 1.6;
  --track-tight: -0.025em;
  --measure: 64ch;
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px; --s8: 64px; --s9: 96px; --s10: 144px;
  --gutter: clamp(20px, 4vw, 56px);
  --max: 1320px;
  --r-1: 6px; --r-2: 12px; --r-3: 20px; --r-4: 30px; --r-pill: 999px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);          /* settle: most things */
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);   /* sheets and panels */
  --fast: 150ms; --mid: 240ms; --slow: 400ms;
  --hit: 44px;
  --motion: 1;                                      /* the Comfort motion dial, 0 to 1 */
}
/* ---------- Comfort switches ---------- */
:root.cf-contrast, :root.cf-contrast:not([data-theme="light"]):not([data-theme="dark"]) { --ink-2: var(--ink); --ink-3: var(--ink); --line: var(--ink); --line-strong: var(--ink); --shadow-1: 0 0 0 1px var(--ink); --shadow-2: 0 0 0 2px var(--ink); --shadow-3: 0 0 0 2px var(--ink); }
:root.cf-large { font-size: 112.5%; }
:root.cf-wide { --lh-body: 1.8; }
:root.cf-wide body { letter-spacing: 0.03em; word-spacing: 0.12em; }
:root.cf-wide p, :root.cf-wide li { margin-block: 0 1.1em; }
:root.cf-still { --motion: 0; }
@media (prefers-reduced-motion: reduce) { :root { --motion: 0.25; } }

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(env(safe-area-inset-top, 0px) + 84px); }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 var(--t-body) / var(--lh-body) var(--font-text); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
h1, h2, h3, .display, .hero-title { font-family: var(--font-display); font-weight: 760; letter-spacing: var(--track-tight); line-height: var(--lh-head); margin: 0; text-wrap: balance; font-optical-sizing: auto; }
h1 { font-size: var(--t-display); line-height: 1.02; }
h2 { font-size: var(--t-h2); }
h3 { font-size: var(--t-h3); letter-spacing: -0.01em; }
p { margin: 0 0 1em; text-wrap: pretty; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.18em; text-decoration-color: var(--line-strong); transition: text-decoration-color calc(var(--fast) * var(--motion)) var(--ease); }
a:hover { text-decoration-color: currentColor; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 4px; }
main:focus { outline: none; }   /* the skip link moves focus here (tabindex="-1"); a ring round the whole page body helps nobody */
/* A toy canvas fills its frame, and the frame clips (overflow: hidden), so the ring above would be drawn outside the box and
   cut away. Inside the canvas instead: a 3px ring on its own edge (a negative outline-offset stays inside the frame; this also
   covers a browser without :has), and the frame's ::after repeats it with a paper ring just inside it (an inset shadow on a
   replaced element like canvas sits under its pixels, so it cannot be drawn on the canvas), so the pair reads on a dark scene and on a bright one. */
.pb canvas:focus-visible { outline: 3px solid var(--focus); outline-offset: -3px; border-radius: 0; }
.pb :is(.field, .stage, .op-stage):has(canvas:focus-visible)::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 3px var(--focus), inset 0 0 0 6px var(--paper); pointer-events: none; z-index: 3; }
img, svg, canvas, video { display: block; max-width: 100%; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: var(--s4); top: -100px; z-index: 50; padding: var(--s3) var(--s4); background: var(--ink); color: var(--paper); border-radius: var(--r-2); }
.skip:focus { top: var(--s4); }

/* ---------- layout ---------- */
.wrap { width: min(100% - 2 * var(--gutter), var(--max)); margin-inline: auto; }
.wrap-read { width: min(100% - 2 * var(--gutter), 720px); margin-inline: auto; }
.stack > * + * { margin-top: var(--stack, var(--s5)); }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s3); }
.section { padding-block: clamp(var(--s8), 8vw, var(--s10)); }
.section + .section { border-top: 1px solid var(--line); }
.lead { font-size: var(--t-lead); line-height: 1.5; color: var(--ink-2); max-width: 56ch; }
.muted { color: var(--ink-2); }
.meta { font-size: var(--t-small); color: var(--ink-3); }
.measure { max-width: var(--measure); }

/* ---------- the wordmark: ADAPTED, see WORDMARK below (our inline svg and its .mk-* hooks) ---------- */

/* ---------- header and nav ---------- */
.hd { position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--paper) 86%, transparent); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px); border-bottom: 1px solid transparent; transition: border-color calc(var(--mid) * var(--motion)) var(--ease), background-color calc(var(--mid) * var(--motion)) var(--ease); padding-top: env(safe-area-inset-top, 0px); }
.hd.is-scrolled { border-bottom-color: var(--line); }
.hd-in { display: flex; align-items: center; gap: var(--s6); min-height: 76px; }
.nav { display: flex; gap: var(--s1); margin-right: auto; }
.nav a { position: relative; display: inline-flex; align-items: center; min-height: var(--hit); padding: 0 var(--s4); border-radius: var(--r-pill); text-decoration: none; font-weight: 700; color: var(--ink-2); transition: color calc(var(--fast) * var(--motion)) var(--ease), background-color calc(var(--fast) * var(--motion)) var(--ease); }
.nav a:hover { color: var(--ink); background: var(--surface-2); }
/* you are here: the wordmark's shadow dash, under the current section */
.nav a[aria-current="page"] { color: var(--ink); }
.nav a[aria-current="page"]::after { content: ""; position: absolute; left: 50%; bottom: 5px; width: 18px; height: 3px; margin-left: -9px; border-radius: 3px; background: var(--ink); }
.hd-tools { display: flex; gap: var(--s2); align-items: center; }

/* ---------- buttons ---------- */
.btn { --b-bg: var(--surface); --b-fg: var(--ink); display: inline-flex; align-items: center; justify-content: center; gap: var(--s2); min-height: 48px; padding: 0 var(--s5); border: 1px solid var(--line-strong); border-radius: var(--r-pill); background: var(--b-bg); color: var(--b-fg); font: 700 1rem/1 var(--font-text); text-decoration: none; cursor: pointer; box-shadow: var(--shadow-1); transition: transform calc(var(--fast) * var(--motion)) var(--ease), box-shadow calc(var(--mid) * var(--motion)) var(--ease), background-color calc(var(--fast) * var(--motion)) var(--ease); -webkit-tap-highlight-color: transparent; }
.btn:hover { box-shadow: var(--shadow-2); }
.btn:active { transform: translateY(1px) scale(0.985); box-shadow: var(--shadow-1); }
.btn-primary { --b-bg: var(--accent); --b-fg: var(--on-accent); border-color: transparent; }
.btn-quiet { --b-bg: transparent; border-color: transparent; box-shadow: none; }
.btn-quiet:hover { background: var(--surface-2); box-shadow: none; }
.btn-lg { min-height: 56px; padding: 0 var(--s6); font-size: 1.0625rem; }
.btn-icon { width: var(--hit); min-height: var(--hit); padding: 0; }
.btn-block { width: 100%; }
.btn[aria-pressed="true"] { --b-bg: var(--ink); --b-fg: var(--paper); border-color: var(--ink); }
.btn svg { width: 18px; height: 18px; flex: none; }

/* ---------- chips: filters, categories, choices ---------- */
.chip { display: inline-flex; align-items: center; gap: var(--s2); min-height: var(--hit); padding: 0 var(--s4); border: 1px solid var(--line-strong); border-radius: var(--r-pill); background: transparent; color: var(--ink); font: 700 var(--t-small)/1 var(--font-text); text-decoration: none; cursor: pointer; white-space: nowrap; transition: background-color calc(var(--fast) * var(--motion)) var(--ease), color calc(var(--fast) * var(--motion)) var(--ease), border-color calc(var(--fast) * var(--motion)) var(--ease); }
.chip:hover { background: var(--surface-2); }
.chip[aria-pressed="true"], .chip[aria-current="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.chip .n { font-weight: 400; color: inherit; opacity: 0.7; }

/* ---------- badges ---------- */
.badge { display: inline-flex; align-items: center; min-height: 26px; padding: 0 10px; border-radius: var(--r-pill); background: var(--surface-2); color: var(--ink-2); font: 700 var(--t-micro)/1 var(--font-text); }

/* ---------- cards: used sparingly. A tile is a game; an entry is a line of reading ---------- */
.card { background: var(--surface); border-radius: var(--r-3); box-shadow: var(--shadow-1); padding: var(--s6); }
.tile { position: relative; display: grid; gap: var(--s3); text-decoration: none; color: inherit; }
.tile-art { position: relative; aspect-ratio: 4 / 3; border-radius: var(--r-3); background: var(--well); box-shadow: var(--sunk); overflow: hidden; transition: transform calc(var(--mid) * var(--motion)) var(--ease), box-shadow calc(var(--mid) * var(--motion)) var(--ease); }
.tile:hover .tile-art { transform: translateY(-2px); box-shadow: var(--sunk), var(--shadow-2); }
.tile-name { font: 760 var(--t-h3)/1.15 var(--font-display); letter-spacing: -0.01em; }
.tile-line { color: var(--ink-2); font-size: var(--t-small); margin: 0; }
.tile a.cover { position: absolute; inset: 0; border-radius: var(--r-3); }   /* the whole tile is one link */
.entry { display: grid; gap: var(--s2); padding-block: var(--s5); border-top: 1px solid var(--line); text-decoration: none; color: inherit; }
.entry:hover .entry-title { text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 0.18em; }
.entry-title { font: 760 var(--t-h3)/1.2 var(--font-display); }

/* ---------- the toy frame: the toy is the hero, sitting in a deep, softly lit well ---------- */
.toy { position: relative; border-radius: var(--r-4); background: var(--well); box-shadow: var(--sunk); padding: clamp(6px, 1vw, 10px); }
.toy-stage { position: relative; aspect-ratio: 16 / 10; border-radius: calc(var(--r-4) - 8px); overflow: hidden; background: var(--paper); box-shadow: 0 0 0 1px var(--line), var(--shadow-2); }
.toy-stage canvas { width: 100%; height: 100%; touch-action: none; }
.toy-bar { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; padding: var(--s3) var(--s2) var(--s1); }
.toy-bar .status { margin: 0 auto 0 var(--s2); color: var(--ink-2); font-size: var(--t-small); min-height: 1.4em; }

/* ---------- panels: controls, Comfort, video export ---------- */
.panel { background: var(--surface); border-radius: var(--r-3); box-shadow: var(--shadow-1); padding: var(--s5); }
.panel + .panel { margin-top: var(--s4); }
.panel-title { font: 760 1.125rem/1.2 var(--font-display); margin: 0 0 var(--s4); }
.seg { display: inline-flex; padding: 4px; border-radius: var(--r-pill); background: var(--surface-2); box-shadow: var(--sunk); }
.seg button { min-height: var(--hit); min-width: var(--hit); padding: 0 var(--s4); border: 0; border-radius: var(--r-pill); background: transparent; color: var(--ink-2); font: 700 var(--t-small)/1 var(--font-text); cursor: pointer; transition: background-color calc(var(--fast) * var(--motion)) var(--ease), color calc(var(--fast) * var(--motion)) var(--ease), box-shadow calc(var(--fast) * var(--motion)) var(--ease); }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); }
/* faders: the Comfort dials, set like the controls on a good piece of audio equipment */
.fader { display: grid; grid-template-columns: 6.5rem 1fr 3.5rem; align-items: center; gap: var(--s3); min-height: var(--hit); }
.fader label { font-weight: 700; }
.fader output { text-align: right; color: var(--ink-2); font-variant-numeric: tabular-nums; font-size: var(--t-small); }
.fader input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: var(--hit); background: transparent; cursor: pointer; }
.fader input[type="range"]::-webkit-slider-runnable-track { height: 6px; border-radius: 6px; background: linear-gradient(to right, var(--ink) var(--fill, 50%), var(--surface-2) var(--fill, 50%)); box-shadow: inset 0 0 0 1px var(--line); }
.fader input[type="range"]::-moz-range-track { height: 6px; border-radius: 6px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); }
.fader input[type="range"]::-moz-range-progress { height: 6px; border-radius: 6px; background: var(--ink); }
.fader input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 24px; height: 24px; margin-top: -9px; border-radius: 50%; background: var(--surface); box-shadow: 0 0 0 1px var(--line-strong), 0 2px 6px rgba(21, 24, 31, 0.2); }
.fader input[type="range"]::-moz-range-thumb { width: 24px; height: 24px; border: 0; border-radius: 50%; background: var(--surface); box-shadow: 0 0 0 1px var(--line-strong), 0 2px 6px rgba(21, 24, 31, 0.2); }
.fader input[type="range"]:focus-visible { outline: none; }
.fader input[type="range"]:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 2px var(--paper), 0 0 0 4px var(--focus); }
.fader input[type="range"]:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 2px var(--paper), 0 0 0 4px var(--focus); }
/* every other slider (a toy's own settings) gets the same 44 px touch height, 6 px track and 24 px thumb as the Comfort faders.
   Lower specificity than the .fader rules above, so those keep their filled track. */
input[type="range"] { -webkit-appearance: none; appearance: none; height: var(--hit); background: transparent; cursor: pointer; }
input[type="range"]::-webkit-slider-runnable-track { height: 6px; border-radius: 6px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line-strong); }
input[type="range"]::-moz-range-track { height: 6px; border-radius: 6px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line-strong); }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 24px; height: 24px; margin-top: -9px; border-radius: 50%; background: var(--ink); border: 0; box-shadow: 0 0 0 2px var(--paper), 0 2px 6px rgba(21, 24, 31, 0.2); }
input[type="range"]::-moz-range-thumb { width: 24px; height: 24px; border: 0; border-radius: 50%; background: var(--ink); box-shadow: 0 0 0 2px var(--paper), 0 2px 6px rgba(21, 24, 31, 0.2); }
input[type="range"]:focus-visible { outline: none; }
input[type="range"]:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 2px var(--paper), 0 0 0 4px var(--focus); }
input[type="range"]:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 2px var(--paper), 0 0 0 4px var(--focus); }
/* switches */
.switch { display: flex; align-items: center; justify-content: space-between; gap: var(--s4); width: 100%; min-height: var(--hit); padding: 0; border: 0; background: none; color: var(--ink); font: 700 1rem/1.3 var(--font-text); text-align: left; cursor: pointer; }
.switch .track { flex: none; position: relative; width: 46px; height: 28px; border-radius: 28px; background: var(--surface-2); box-shadow: var(--sunk), inset 0 0 0 1.5px var(--ink-3); transition: background-color calc(var(--mid) * var(--motion)) var(--ease); }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: var(--surface); box-shadow: 0 0 0 1px var(--ink-3), 0 2px 4px rgba(21, 24, 31, 0.18); transition: transform calc(var(--mid) * var(--motion)) var(--ease); }
.switch[aria-checked="true"] .track { background: var(--ink); box-shadow: var(--sunk); }
.switch[aria-checked="true"] .track::after { transform: translateX(18px); }
.comfort .switch + .switch { border-top: 1px solid var(--line); }
/* sheets: the Comfort panel and the export panel open as a side sheet on wide screens, a bottom sheet on phones */
.sheet { position: fixed; z-index: 60; inset: auto 0 0 0; max-height: 86vh; overflow: auto; padding: var(--s6) var(--gutter) calc(var(--s6) + env(safe-area-inset-bottom, 0px)); background: var(--surface); border-radius: var(--r-4) var(--r-4) 0 0; box-shadow: var(--shadow-3); transform: translateY(104%); visibility: hidden; transition: transform calc(var(--slow) * var(--motion)) var(--ease-in-out), visibility 0s linear calc(var(--slow) * var(--motion)); }
.sheet.is-open { transform: none; visibility: visible; transition: transform calc(var(--slow) * var(--motion)) var(--ease-in-out), visibility 0s; }
@media (min-width: 760px) { .sheet { inset: var(--s4) var(--s4) var(--s4) auto; width: 400px; max-height: none; border-radius: var(--r-4); transform: translateX(calc(100% + 24px)); } }
.scrim { position: fixed; inset: 0; z-index: 55; background: rgba(10, 12, 15, 0.32); opacity: 0; pointer-events: none; transition: opacity calc(var(--mid) * var(--motion)) var(--ease); }
.scrim.is-open { opacity: 1; pointer-events: auto; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--s5); }
/* video export */
.rec-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); flex: none; }
.export .options { display: grid; gap: var(--s4); margin-bottom: var(--s5); }
.export .opt-label { display: block; font-weight: 700; margin-bottom: var(--s2); }

/* ---------- Clean screen: every control hidden, the toy alone, for recording ---------- */
:root.is-clean .hd, :root.is-clean .ft, :root.is-clean .chrome, :root.is-clean .toy-bar, :root.is-clean .op-bar, :root.is-clean .op-dock { display: none !important; }
:root.is-clean .toy { padding: 0; box-shadow: none; background: none; }
:root.is-clean .toy-stage { border-radius: 0; box-shadow: none; }
.clean-note { position: fixed; left: 50%; bottom: var(--s5); z-index: 70; transform: translate(-50%, 8px); padding: var(--s3) var(--s4); border-radius: var(--r-pill); background: var(--ink); color: var(--paper); font-size: var(--t-small); opacity: 0; pointer-events: none; transition: opacity calc(var(--mid) * var(--motion)) var(--ease), transform calc(var(--mid) * var(--motion)) var(--ease); }
.clean-note.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- footer ---------- */
.ft { margin-top: var(--s9); padding-block: var(--s8) var(--s7); border-top: 1px solid var(--line); color: var(--ink-2); font-size: var(--t-small); }
.ft-grid { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: var(--s6); }
.ft h2 { font: 700 var(--t-small)/1.4 var(--font-text); color: var(--ink); letter-spacing: 0; margin-bottom: var(--s3); }
.ft ul { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s1); }
.ft a { text-decoration: none; display: inline-block; padding-block: 6px; }
.ft li a { display: inline-flex; align-items: center; min-height: var(--hit); min-width: var(--hit); padding-block: 0; }   /* a 44 px target both ways, the same as every other control: a short word like "Tools" is only 35 px wide */
.ft a:hover { color: var(--ink); text-decoration: underline; }
@media (max-width: 760px) { .ft-grid { grid-template-columns: 1fr 1fr; } .ft-grid > :first-child { grid-column: 1 / -1; } }

/* ---------- page layouts: home ---------- */
.home-hero { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); grid-template-areas: "copy toy"; gap: clamp(var(--s6), 5vw, var(--s9)); align-items: center; padding-block: clamp(var(--s6), 5vw, var(--s8)) clamp(var(--s7), 7vw, var(--s9)); }
.home-hero .copy { grid-area: copy; }
.home-hero .toy { grid-area: toy; }
.home-hero .hero-title { font-size: var(--t-hero); line-height: var(--lh-tight); margin-bottom: var(--s5); }
.home-hero .actions { display: flex; flex-wrap: wrap; gap: var(--s3); margin-top: var(--s6); }
.home-hero .fine { margin-top: var(--s5); }
@media (max-width: 900px) { .home-hero { grid-template-columns: 1fr; grid-template-areas: "copy" "toy"; gap: var(--s5); padding-top: var(--s5); } .home-hero .hero-title { margin-bottom: var(--s3); } .home-hero .actions { margin-top: var(--s4); } }
@media (max-width: 640px) { .home-hero .toy-stage { aspect-ratio: 4 / 3; } .home-hero .lead { font-size: 1.0625rem; } }
.sec-head { display: flex; align-items: end; justify-content: space-between; gap: var(--s5); flex-wrap: wrap; margin-bottom: var(--s6); }
.sec-head p { margin: var(--s2) 0 0; color: var(--ink-2); max-width: 52ch; }
.doors { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--s4); }
.door { position: relative; display: grid; gap: var(--s3); align-content: start; text-decoration: none; color: inherit; }
.door-line { color: var(--ink-2); font-size: var(--t-small); }
.door-name { font: 760 1.125rem/1.2 var(--font-display); }
.door-n { color: var(--ink-3); font-size: var(--t-small); }
@media (max-width: 1000px) { .doors { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 560px) { .doors { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.feature { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(var(--s6), 5vw, var(--s9)); align-items: center; }
.feature .tile-art { aspect-ratio: 16 / 10; border-radius: var(--r-4); }
@media (max-width: 900px) { .feature { grid-template-columns: 1fr; } }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(var(--s6), 5vw, var(--s9)); }
@media (max-width: 800px) { .pair { grid-template-columns: 1fr; } }
/* ---------- page layouts: the Play hub ---------- */
.cat-bar { position: sticky; top: calc(76px + env(safe-area-inset-top, 0px)); z-index: 20; background: color-mix(in srgb, var(--paper) 90%, transparent); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.cat-bar .row { flex-wrap: nowrap; overflow-x: auto; padding-block: var(--s3); scrollbar-width: none; }
.cat-bar .row::-webkit-scrollbar { display: none; }
/* A text link that goes with a heading ("Browse every toy", "All tools"). Not a padded button: no side padding, so it lines up with the text above it.
   .col-head is the heading row for it: the link sits on the heading's baseline at the right, or flush left under the heading when the row wraps. */
.pb .col-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--s1) var(--s5); }
.pb .col-head .links { display: flex; flex-wrap: wrap; gap: 0 var(--s5); }
.pb .link-more { display: inline-flex; align-items: center; min-height: var(--hit); font-weight: 700; color: var(--ink); text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 0.22em; }
.pb .link-more:hover { text-decoration-color: currentColor; }
.shelf { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: var(--s7) var(--s5); }
@media (max-width: 560px) { .shelf { grid-template-columns: 1fr 1fr; gap: var(--s6) var(--s4); } .tile-name { font-size: 1.0625rem; } }
.cat { scroll-margin-top: 150px; }
.tile.is-soon .tile-art { box-shadow: none; }
.tile.is-soon .tile-name { color: var(--ink-2); }
.resume { display: grid; grid-template-columns: 200px 1fr auto; gap: var(--s5); align-items: center; padding: var(--s3); padding-right: var(--s5); border-radius: var(--r-4); background: var(--surface); box-shadow: var(--shadow-1); }
.resume .tile-art { aspect-ratio: 16 / 10; border-radius: var(--r-3); }
@media (max-width: 640px) { .resume { grid-template-columns: 96px 1fr; } .resume .btn { grid-column: 1 / -1; } }

/* ---------- page layouts: a game page ---------- */
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); margin: 0 0 var(--s4); padding: 0; list-style: none; font-size: var(--t-small); color: var(--ink-3); }
.crumbs li + li::before { content: "/"; margin-right: var(--s2); color: var(--line-strong); }
/* The link is a 44 px target, and the negative margins give back the space its padding takes, so the line stays one text line tall. */
.crumbs a { color: var(--ink-2); text-decoration: none; display: inline-block; padding: 12px 9px; margin: -12px -9px; }
.crumbs a:hover { color: var(--ink); text-decoration: underline; }
.game-head { padding-block: var(--s5) var(--s5); display: grid; gap: var(--s3); max-width: 60rem; }
.game-head .lead { margin: 0; }
.game-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: var(--s6); align-items: start; }
.game-side { position: sticky; top: 96px; }
@media (max-width: 1000px) { .game-grid { grid-template-columns: 1fr; } .game-side { position: static; } }
.howto { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s6); margin: 0; }
.howto div { padding-top: var(--s4); border-top: 1px solid var(--line); }
.howto dt { font: 760 1.125rem/1.2 var(--font-display); margin-bottom: var(--s2); }
.howto dd { margin: 0; color: var(--ink-2); }
@media (max-width: 800px) { .howto { grid-template-columns: 1fr; gap: var(--s4); } }
kbd { font: 700 0.85em/1 var(--font-text); padding: 0.18em 0.45em; border-radius: 6px; background: var(--surface); box-shadow: 0 0 0 1px var(--line-strong), 0 1px 0 var(--line-strong); }
.readable { max-width: var(--measure); }

/* ---------- page layouts: reading (Learn, guides, About) ---------- */
.article { padding-block: var(--s6) var(--s8); }
.article-head { display: grid; gap: var(--s4); margin-bottom: var(--s7); }
.article-head h1 { font-size: clamp(2.25rem, 1.4rem + 3vw, 3.75rem); }
.prose { font-size: 1.125rem; line-height: 1.7; }
.prose h2 { margin: var(--s8) 0 var(--s4); }
.prose p, .prose ul, .prose ol { max-width: var(--measure); }
.prose li { margin-bottom: var(--s2); }
.figure { margin: var(--s7) 0; }
.figure-wide { width: min(100vw - 2 * var(--gutter), 960px); margin-inline: calc((min(100vw - 2 * var(--gutter), 960px) - 100%) / -2); }
.figure .plate { border-radius: var(--r-4); background: var(--well); box-shadow: var(--sunk); padding: var(--s5); }
.figure figcaption { margin-top: var(--s3); font-size: var(--t-small); color: var(--ink-3); max-width: 60ch; }
.try { display: grid; grid-template-columns: 140px 1fr; gap: var(--s5); align-items: center; margin: var(--s7) 0; padding: var(--s3); padding-right: var(--s5); border-radius: var(--r-4); background: var(--surface); box-shadow: var(--shadow-1); }
.try .tile-art { aspect-ratio: 1; }
.try p { margin: var(--s1) 0 var(--s3); color: var(--ink-2); }
@media (max-width: 560px) { .try { grid-template-columns: 88px 1fr; } }
/* ---------- page layouts: Tools ---------- */
.tool-groups { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s7) var(--s6); }
.tool-groups h2 { font-size: var(--t-h3); margin-bottom: var(--s2); }
@media (max-width: 900px) { .tool-groups { grid-template-columns: 1fr; } }
.pacer { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(var(--s6), 5vw, var(--s9)); align-items: center; }
@media (max-width: 800px) { .pacer { grid-template-columns: 1fr; } }
.pacer-well { position: relative; aspect-ratio: 1; border-radius: var(--r-4); background: var(--well); box-shadow: var(--sunk); display: grid; place-items: center; }
.pacer-orb { width: 44%; aspect-ratio: 1; border-radius: 50%; background: var(--surface); box-shadow: var(--shadow-2); transform: scale(0.7); transition: transform 4s cubic-bezier(0.45, 0, 0.55, 1); }
.pacer-word { position: absolute; bottom: 12%; left: 0; right: 0; text-align: center; font: 760 var(--t-h3)/1 var(--font-display); color: var(--ink-2); }
/* ---------- page layouts: About ---------- */
.principles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s7) var(--s8); }
.principles div { padding-top: var(--s4); border-top: 1px solid var(--line); }
.principles h3 { margin-bottom: var(--s2); }
.principles p { color: var(--ink-2); margin: 0; }
@media (max-width: 760px) { .principles { grid-template-columns: 1fr; gap: var(--s5); } }
.placeholder { background: var(--accent-soft); border-radius: 4px; padding: 0 4px; }

/* ---------- the phone kit (structure unchanged; colours and depth now come from the tokens) ---------- */
.op-shell { background: var(--paper); color: var(--ink); }
.op-bar { background: color-mix(in srgb, var(--paper) 88%, transparent); border-bottom: 1px solid var(--line); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.op-title { font-family: var(--font-display); font-weight: 760; letter-spacing: -0.01em; }
.op-dock { background: var(--surface); box-shadow: var(--shadow-3); border-radius: var(--r-4) var(--r-4) 0 0; }
.op-sheet { background: var(--surface); box-shadow: var(--shadow-3); border-radius: var(--r-4) var(--r-4) 0 0; }
.op-scrim { background: rgba(10, 12, 15, 0.32); }
.op-back, .op-more, .op-done { min-width: var(--hit); min-height: var(--hit); border-radius: var(--r-pill); }

/* ---------- motion respects everyone ---------- */
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; } }
/* ======================================================================== PEBBLE 2 · END ======== */

/* ======================================================================== LEGACY ALIASES ======
   Old Pebble 1 token names that pages, inline <style> blocks and a few scripts still use, kept so
   nothing resolves to nothing. Delete an alias once `grep` shows no page or script reads it.
   Renamed, not aliased (every use was migrated): old --surface (the page) is now --paper, and old
   --surface-2 (a raised card) is now --surface. Old --accent was blue and marked controls and focus;
   those uses now say --ink or --focus, and --accent is the brand orange (the act only).
   --o --y --t --n --v --c, the six categorical inks, live on .pb below because they mix by --chroma. */
:root {
  --border: 1px;                   /* old outline weight. Pebble 2 draws with hairlines and layered shadow */
  --r: var(--r-3);                 /* old card radius, 20px */
  --font-mono: "Atkinson Hyperlegible Mono", ui-monospace, monospace;
  --logo-o: var(--logo-oddly);     /* the wordmark's orange; scripts that draw the logo read this name */
  --mint: #0A7459;                 /* success and "verified" states; not the act, so not orange */
  --amber: #9A5B00;                /* caution states */
  --wait: #B8BDC6;                 /* the "waiting" grey of a placeholder token */
}
:root[data-theme="dark"] { --mint: #4ED1A5; --amber: #F2B35B; --wait: #5A6070; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]):not([data-theme="dark"]) { --mint: #4ED1A5; --amber: #F2B35B; --wait: #5A6070; } }
:root.cf-contrast { --border: 2px; }

/* ======================================================================== THE .pb ROOT ======
   Every page is wrapped in <div class="pb">. Tokens live on :root; this root carries what must be
   computed here: the Colour dial (--chroma) and the six inks that mix by it. */
.pb {
  --chroma: 0.75;
  --o: color-mix(in oklch, #C74D06 calc(var(--chroma) * 100%), #8E857C);
  --y: color-mix(in oklch, #FAC62C calc(var(--chroma) * 100%), #C9C2A6);
  --t: color-mix(in oklch, #058982 calc(var(--chroma) * 100%), #7E8E8C);
  --n: color-mix(in oklch, #2F47C9 calc(var(--chroma) * 100%), #6F7490);
  --v: color-mix(in oklch, #923AFA calc(var(--chroma) * 100%), #8E7FA6);
  --c: color-mix(in oklch, #3CD5FA calc(var(--chroma) * 100%), #9FB9C2);
  --stage: var(--surface);         /* the recorder paints a clip's background from this */
  --max: 1080px;                   /* LEGACY: page bodies are 1080 wide. Restructured pages use the design's 1320 */
  font-family: var(--font-text); font-size: var(--t-body); line-height: var(--lh-body); color: var(--ink); background: var(--paper);
  /* clip, not hidden: hidden makes this a scroll container and breaks the sticky header and action bar. It still stops the
     full bleed hero figures (100vw, which runs wider than the page by the scrollbar's width) from causing sideways scroll. */
  overflow-x: clip;
}
.pb[data-hc] { --chroma: 1; }
.pb *, .pb *::before, .pb *::after { box-sizing: border-box; }
.pb [hidden] { display: none !important; }   /* an author display:flex or grid would otherwise beat [hidden] at equal specificity */
:where(.pb) :is(button, input, textarea, select) { font: inherit; color: inherit; }   /* zero specificity, so .btn, .chip and every component colour still win */
.pb svg { display: block; }
.pb .vis { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.pb :is(p, ul, ol) { margin: 0; }   /* LEGACY: page bodies space with gap, not margins. The design's p margin returns with the restructured pages */
.pb section { padding-block: var(--s7); }   /* LEGACY: a bare <section> */

/* ======================================================================== WORDMARK ======
   ADAPTED. The design draws the wordmark with a <symbol> and a .brand link. Ours is an inline <svg> inside
   a.logo (the hop below animates paths inside it, which a <use> shadow tree would not allow), so the .brand
   sizing and the .lg-* colours are applied to our .logo and .mk-* hooks instead. */
.brand { display: inline-flex; align-items: center; font-size: 30px; min-height: var(--hit); padding-block: 6px; text-decoration: none; border-radius: var(--r-2); }
.brand svg { height: 1.1em; width: auto; overflow: visible; }   /* our viewBox keeps headroom for the hop, hence 1.1em */
.logo .mk-oddly { fill: var(--logo-o); }
.logo .mk-play { fill: var(--logo-play); }
.pb[data-hc] .logo .mk-oddly { fill: var(--ink); }          /* high contrast: one ink */
@media (forced-colors: active) { .pb .logo .mk-oddly, .pb .logo .mk-play { fill: CanvasText; } }
/* logo hop. The lifted "d" (.mk-jump) drops to the baseline, squashes a little, and springs back to exactly where the
   logo has it; its shadow dash (.mk-dash) widens as it lands. The numbers are the design file's own, over 1.8 s, in SVG
   user units (so they scale with the logo). transform-box: fill-box puts the origin on the d's own box (bottom centre),
   which keeps the rotation from swinging it sideways. First and last frames are the identity: the d ends on its resting
   pose. assets/logo-hop.js decides WHEN, by putting .is-hop on the link for one hop at a time. Nothing runs, and nothing
   is promoted, while the logo rests. */
.pb .logo .mk-jump { transform-box: fill-box; transform-origin: 50% 100%; }
.pb .logo .mk-dash { transform-box: fill-box; transform-origin: 50% 50%; }
@keyframes op-hop {
  0%   { transform: translateY(0) rotate(0) scale(1, 1); animation-timing-function: cubic-bezier(.55, 0, 1, .45); }
  43%  { transform: translateY(27px) rotate(6deg) scale(1.08, .9); animation-timing-function: cubic-bezier(0, .55, .45, 1); }
  54%  { transform: translateY(22.1px) rotate(4deg) scale(.97, 1.05); animation-timing-function: cubic-bezier(0, .55, .45, 1); }
  100% { transform: translateY(0) rotate(0) scale(1, 1); }
}
@keyframes op-dash {
  0%   { transform: scaleX(1); animation-timing-function: cubic-bezier(.55, 0, 1, .45); }
  43%  { transform: scaleX(1.32); }
  100% { transform: scaleX(1); }
}
@media (prefers-reduced-motion: no-preference) {
  .pb .logo.is-hop .mk-jump { animation: op-hop 1.8s 1; }
  .pb .logo.is-hop .mk-dash { animation: op-dash 1.8s 1; }
}
/* The stops, last so they win a tie. Reduced motion never reaches the rule above; recording is its own rule because
   :has() in a selector list would drop the whole list in a browser without it. */
.pb[data-low-motion] .logo :is(.mk-jump, .mk-dash),
.pb[data-hc] .logo :is(.mk-jump, .mk-dash),
.pb.clean .logo :is(.mk-jump, .mk-dash) { animation: none; }
.pb:has(.oprec-pill:not([hidden])) .logo :is(.mk-jump, .mk-dash) { animation: none; }

/* header: on a phone the Comfort label drops to an icon and the row tightens (ADAPTED: the design shows no phone header) */
.hd-in { position: static; }
@media (max-width: 640px) {
  .hd-in { gap: var(--s2); min-height: 64px; }
  .hd .brand { font-size: 24px; }
  .nav a { padding: 0 var(--s3); }
  .hd-tools .comfort > summary { padding: 0; width: var(--hit); min-height: var(--hit); }
  .hd-tools .comfort > summary span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}
@media (max-width: 380px) { .nav a { padding: 0 var(--s2); } .hd .brand { font-size: 21px; } }
/* a hover-less touch screen: keep the dash under the current page clear of the tap target's edge */
.pb.clean .hd, .pb.clean .ft { display: none !important; }
.ft-grid { padding-bottom: var(--s6); border-bottom: 1px solid var(--line); }
.ft-note { margin: var(--s5) 0 0; max-width: 78ch; }
.ft .brand { font-size: 26px; }
/* the footer wordmark is the header's own coloured mark (same inline svg, same .logo hooks), so it hops the same way (assets/logo-hop.js) */
.ft-blurb { margin: var(--s3) 0 0; max-width: 34ch; }
.hd .wrap, .ft .wrap { --max: 1320px; }   /* the header and footer keep the design's width even while page bodies are 1080 */

/* ======================================================================== COMFORT PANEL ======
   ADAPTED. The design's Comfort is a modal side sheet. Ours must stay a <details class="comfort"> because
   assets/phone-layout.js finds .comfort and moves it into the phone sheet, so it opens as a panel under the
   header button, dressed like the design's sheet: surface, layered shadow, large radius, three faders, switches.
   The sticky header's backdrop blur makes it the containing block for anything fixed inside it, which is why
   this is an absolutely positioned popover and not a viewport-fixed sheet. */
.comfort { position: relative; }
.comfort > summary { list-style: none; cursor: pointer; }
.comfort > summary::-webkit-details-marker { display: none; }
.comfort[open] > summary { background: var(--surface-2); }
.comfort .panel { position: absolute; right: 0; top: calc(100% + var(--s2)); z-index: 60; width: min(400px, calc(100vw - 2 * var(--gutter))); max-height: calc(100dvh - 110px); overflow: auto; padding: var(--s5); border-radius: var(--r-4); background: var(--surface); box-shadow: var(--shadow-3); }
.comfort .panel .card { display: grid; gap: var(--s2); padding: 0; background: none; box-shadow: none; border-radius: 0; }
.comfort .panel-title { margin: 0 0 var(--s1); }
.comfort .dial { display: grid; gap: 0; padding: 0 0 var(--s3); border: 0; }
.comfort .dial small { margin: -2px 0 0; padding-left: calc(6.5rem + var(--s3)); color: var(--ink-3); font-size: var(--t-micro); line-height: 1.4; }
.pb .fader label { margin: 0; }
.comfort .switch + .switch { border-top: 1px solid var(--line); }
.comfort-hint { margin: 0 0 var(--s2); }
/* a one line note under a switch (comfort.js adds the one under High contrast) */
.comfort .comfort-note { display: block; margin: -4px 0 var(--s2); color: var(--ink-3); font-size: var(--t-micro); line-height: 1.4; }
.comfort .comfort-note + .switch { border-top: 1px solid var(--line); }
@media (max-width: 760px) {   /* a narrow header has no right edge to hang from: the panel spans the sticky header instead */
  .comfort { position: static; }
  .comfort .panel { left: var(--gutter); right: var(--gutter); width: auto; max-height: calc(100dvh - 90px); }
  .comfort .dial small { padding-left: 0; }
}

/* the dials, as the design's faders. The legacy .dial markup is a label, a range and an output */
.pb .fader output { font-family: var(--font-text); }
/* switches in label and checkbox form (Comfort, and a few tool pages): the same track and thumb as the design's button switch */
.pb label.switch { display: flex; align-items: center; justify-content: space-between; gap: var(--s4); width: 100%; min-height: var(--hit); margin: 0; padding: 0; font-weight: 700; cursor: pointer; }
.pb .switch input[type="checkbox"] { -webkit-appearance: none; appearance: none; flex: none; position: relative; width: 46px; height: 28px; margin: 0; border: 0; border-radius: 28px; background: var(--surface-2); box-shadow: var(--sunk), inset 0 0 0 1.5px var(--ink-3); cursor: pointer; transition: background-color calc(var(--mid) * var(--motion)) var(--ease); }
.pb .switch input[type="checkbox"]::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: var(--surface); box-shadow: 0 0 0 1px var(--ink-3), 0 2px 4px rgba(21, 24, 31, 0.18); transition: transform calc(var(--mid) * var(--motion)) var(--ease); }
.pb .switch input[type="checkbox"]:checked { background: var(--ink); box-shadow: var(--sunk); }
.pb .switch input[type="checkbox"]:checked::after { transform: translateX(18px); }
.pb .switch input[type="checkbox"]:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }

/* ======================================================================== LEGACY COMPAT ======
   Pebble 1 class names that page bodies still use, mapped onto the Pebble 2 components with the same tokens and
   depth, so a page that has not been restructured yet looks like the same family. Each block names its Pebble 2
   twin. When a page is rebuilt from the design's layouts it stops using these; delete a block when nothing does. */

/* .stack, .stack-lg, .row: flex with a gap. Twin: the design's .stack (margin based) and .row. Both read --stack. */
.pb .stack { display: flex; flex-direction: column; gap: var(--stack, var(--s4)); }
.pb .stack > * + * { margin-top: 0; }
.pb .stack-lg { display: flex; flex-direction: column; gap: var(--s6); }
.pb .grid3 { display: grid; gap: var(--s4); grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.pb .wrap { width: min(100% - 2 * var(--gutter), var(--max)); }

/* type. .display = the design's h1 / hero heading; .h2 .h3 = h2 h3; .small .mono .eyebrow = .meta family */
.pb .display { font-family: var(--font-display); font-weight: 760; font-size: var(--t-display); line-height: 1.02; letter-spacing: var(--track-tight); text-wrap: balance; }
.pb .h2 { font: 760 var(--t-h2)/var(--lh-head) var(--font-display); letter-spacing: var(--track-tight); }
.pb .h3 { font: 760 var(--t-h3)/1.2 var(--font-display); letter-spacing: -0.01em; }
.pb .small { font-size: var(--t-small); }
.pb .mono { font-family: var(--font-mono); font-size: var(--t-small); letter-spacing: 0.03em; }
.pb .eyebrow { font-size: var(--t-small); font-weight: 700; color: var(--ink-2); }
.pb #howLink a { display: inline-flex; align-items: center; min-height: var(--hit); }   /* the "How this works" link under every toy: a 44 px target */
.pb .hint { display: block; font-size: var(--t-small); color: var(--ink-2); font-weight: 400; margin-top: var(--s1); }
.pb .meta { font-size: var(--t-small); color: var(--ink-2); }
.pb a { text-decoration-thickness: 1px; }

/* skip link and the old header/footer for any page that still has them. Twin: .skip, .hd, .ft */
.pb .skip { z-index: 90; }
.pb .top:not(.hd) { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s2) var(--s3); min-height: 64px; padding: var(--s2) var(--gutter); background: var(--paper); }
.pb .foot:not(.ft) { padding: var(--s6) var(--gutter); font-size: var(--t-small); color: var(--ink-2); display: grid; gap: var(--s3); border-top: 1px solid var(--line); }

/* buttons. Twin: .btn .btn-primary (the orange act) .btn-quiet .btn-lg. Press is the design's own */
.pb .btn-big { min-height: 56px; padding: 0 var(--s6); font-size: 1.0625rem; }   /* = .btn-lg */
.pb .toggle[aria-pressed="true"] { --b-bg: var(--ink); --b-fg: var(--paper); border-color: var(--ink); }   /* = .btn[aria-pressed] */

/* cards. Twin: .card (layered shadow, no outline). A linked card lifts one step on hover */
.pb a.card { display: block; text-decoration: none; transition: box-shadow calc(var(--mid) * var(--motion)) var(--ease), transform calc(var(--mid) * var(--motion)) var(--ease); }
.pb a.card:hover { box-shadow: var(--shadow-2); transform: translateY(-2px); }
.pb .card { padding: var(--s5); }
.pb .card .dot { display: block; width: 40px; height: 40px; border-radius: 50%; background: var(--surface-2); box-shadow: var(--sunk); margin-bottom: var(--s3); }
.pb .card .eyebrow { display: block; margin-bottom: var(--s2); }
.pb .card h3 { margin-bottom: var(--s2); }
.pb .card.dim { box-shadow: none; background: none; border: 1px dashed var(--line-strong); }
.pb .scene { display: block; width: 100%; height: auto; border-radius: var(--r-2); box-shadow: 0 0 0 1px var(--line); }

/* form controls. A sunk field: the design's well treatment, with a firm 1px outline so the edge keeps 3:1 against the page */
.pb label { display: block; font-weight: 700; margin-bottom: var(--s2); }
.pb .input, .pb select.input { width: 100%; min-height: 56px; padding: var(--s3) var(--s4); border: 1px solid var(--ink-3); border-radius: var(--r-pill); background: var(--surface); color: var(--ink); font-size: 1.125rem; box-shadow: var(--sunk); }
.pb textarea.input { border-radius: var(--r-3); min-height: 150px; font-family: var(--font-mono); font-size: var(--t-small); line-height: 1.6; resize: vertical; }
.pb ::placeholder { color: var(--ink-3); opacity: 1; }
.pb input[type="range"] { accent-color: var(--ink); }

/* the toy frame. Twin: .toy / .toy-stage. The old .field and .stage frames are a lit stage inside the same layered depth */
.pb .hero { display: grid; gap: var(--s5); padding-block: var(--s5) var(--s6); }
.pb .field { position: relative; border-radius: var(--r-3); background: var(--surface); box-shadow: 0 0 0 1px var(--line), var(--shadow-2); overflow: hidden; }
.pb .field svg { display: block; width: 100%; height: auto; }
.pb .field .tap { position: absolute; left: 50%; bottom: var(--s5); transform: translateX(-50%); }
@media (min-width: 900px) { .pb .hero { grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); align-items: center; column-gap: var(--s8); padding-block: var(--s7); } }
.pb .stage { position: relative; width: min(100%, calc((100svh - 240px) * 9 / 16)); margin-inline: auto; aspect-ratio: 9 / 16; border-radius: var(--r-3); background: var(--surface); box-shadow: 0 0 0 1px var(--line), var(--shadow-2); overflow: hidden; }
.pb .stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.pb .stage .poster { position: absolute; inset: 0; }
.pb .stage .poster svg { width: 100%; height: 100%; }

/* the seal: a ticket that always says its state in words. Verified is mint, never orange */
.pb .seal { display: grid; grid-template-columns: auto 1fr; gap: var(--s4); align-items: center; padding: var(--s3) var(--s4); border-radius: var(--r-3); background: var(--surface); box-shadow: var(--shadow-1); transition: box-shadow calc(400ms * var(--motion)) var(--ease); }
.pb .seal .stub { padding-right: var(--s4); border-right: 2px dashed var(--line-strong); }
.pb .seal .stub svg { width: 48px; height: 48px; }
.pb .seal .state { font-weight: 700; }
.pb .seal .hash { font-family: var(--font-mono); font-size: var(--t-small); letter-spacing: 0.04em; overflow-wrap: anywhere; }
.pb .seal.verified { box-shadow: var(--shadow-1), inset 0 0 0 2px var(--mint); }
.pb .seal.verified .state { color: var(--mint); }
.pb .seal .meta { font-size: var(--t-small); color: var(--ink-2); }
.pb .sealBody { display: grid; gap: var(--s2); min-width: 0; }
.pb .seal .witness { font-size: var(--t-small); color: var(--ink-2); }
.pb .seal .witness b { font-family: var(--font-mono); color: var(--ink); letter-spacing: 0.04em; }
.pb .proof > summary { cursor: pointer; font-size: var(--t-small); font-weight: 700; color: var(--ink); text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 0.18em; min-height: 32px; display: inline-flex; align-items: center; list-style: none; }
.pb .proof > summary::-webkit-details-marker { display: none; }
.pb .proof > summary::after { content: "+"; font-family: var(--font-mono); margin-left: 0.4em; }
.pb .proof[open] > summary::after { content: "\2212"; margin-left: 0.4em; }
.pb .proof .hash { display: grid; gap: var(--s3); margin-top: var(--s3); font-size: var(--t-small); color: var(--ink-2); }
.pb .proof .hash p { margin: 0; }
.pb .proof .hash .mono { font-family: var(--font-mono); font-size: 0.8125rem; color: var(--ink); word-break: break-all; line-height: 1.6; }

/* progress: a continuous bar, never a countdown. Heats fill left to right; the current one is the darkest, in ink */
.pb .progress { display: grid; gap: var(--s2); }
.pb .progress .bar { display: flex; gap: 4px; height: 14px; }
.pb .progress .bar span { flex: 1; border-radius: var(--r-pill); background: var(--surface-2); box-shadow: var(--sunk); overflow: hidden; }
.pb .progress .bar span i { display: block; height: 100%; background: var(--ink-3); border-radius: var(--r-pill); }
.pb .progress .bar span[aria-current="step"] i { background: var(--ink); }
.pb .progress .label { display: flex; justify-content: space-between; font-size: var(--t-small); font-weight: 700; }

/* the game layout, the action bar and the standings */
.pb .game { display: grid; gap: var(--s5); }
.pb .actionbar { position: sticky; bottom: 0; z-index: 2; display: flex; gap: var(--s3); padding: var(--s3) var(--s4) calc(var(--s3) + env(safe-area-inset-bottom, 0px)); background: color-mix(in srgb, var(--paper) 90%, transparent); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border-top: 1px solid var(--line); }
.pb .actionbar .btn-primary { flex: 1; }
.pb .standings { list-style: none; padding: 0; display: grid; gap: var(--s2); }
.pb .standings li { display: grid; grid-template-columns: 2rem 28px 1fr auto; align-items: center; gap: var(--s3); min-height: 48px; padding: 0 var(--s4); border-radius: var(--r-pill); background: var(--surface); box-shadow: var(--shadow-1); }
.pb .standings .place { font-family: var(--font-mono); color: var(--ink-2); }
.pb .standings .token { width: 28px; height: 28px; border-radius: 50%; box-shadow: 0 0 0 1px var(--line-strong); }
.pb .standings li.winner { background: var(--ink); color: var(--paper); }
.pb .cluster { display: inline-flex; align-items: center; gap: var(--s2); min-height: 36px; padding: 0 var(--s3) 0 var(--s2); border-radius: var(--r-pill); background: var(--surface); box-shadow: var(--shadow-1); font-weight: 700; font-size: var(--t-small); }
.pb .cluster .blob { width: 22px; height: 22px; border-radius: 50%; background: var(--wait); box-shadow: 0 0 0 1px var(--line-strong); }
@media (min-width: 900px) {
  .pb .game { grid-template-columns: minmax(300px, 440px) minmax(0, 1fr); grid-template-areas: "stage head" "stage aside" "how how"; column-gap: var(--s7); align-items: start; }
  .pb .game .g-head { grid-area: head; } .pb .game .g-stage { grid-area: stage; position: sticky; top: calc(76px + var(--s5));
    /* The sticky stage may never be taller than the window: below the canvas sit the primary buttons (Use my voice, Seal and race),
       and a taller sticky box would pin them off screen for good. Capped to what is visible under the header, it scrolls inside
       itself instead, so mouse, touch and keyboard focus can always reach them. The padding and matching negative margin keep
       focus rings and shadows from being clipped by that scroll box. */
    max-height: calc(100vh - 76px - var(--s5) - var(--s4)); max-height: calc(100svh - 76px - var(--s5) - var(--s4));
    overflow-y: auto; padding: 6px; margin: -6px; } .pb .game .g-aside { grid-area: aside; } .pb .game .g-how { grid-area: how; }
  .pb .actionbar { position: static; border-top: 0; padding-inline: 0; background: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
}
/* A short window (a desktop at 300 to 400 percent zoom is about 320 x 256; a phone held sideways is the same) cannot spare two pinned
   bars: the sticky header (65 px) and a pinned action bar (73 px) would cover over half of it (WCAG 1.4.10 Reflow, 2.4.11 Focus Not
   Obscured). There both scroll away with the page. Where the bar does stay pinned, a focused control scrolls clear of it. */
@media (max-height: 480px) {
  .pb .actionbar { position: static; }
  .hd { position: static; }
}
:root:has(.actionbar) { scroll-padding-bottom: 96px; }

/* a plain state line: explicit, never inferred. Twin: .badge, grown to a pill row */
.pb .state-line { display: flex; align-items: center; gap: var(--s3); padding: var(--s3) var(--s4); border-radius: var(--r-pill); background: var(--surface); box-shadow: var(--shadow-1); font-weight: 700; }
.pb .state-line .dot { width: 14px; height: 14px; border-radius: 50%; background: var(--mint); flex-shrink: 0; }

/* tables and evidence tags */
.pb table { width: 100%; border-collapse: collapse; font-size: var(--t-small); }
.pb th, .pb td { text-align: left; vertical-align: top; padding: var(--s3); border-bottom: 1px solid var(--line); }
.pb th { font-size: 0.8125rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-2); }
.pb .ev { display: inline-block; padding: 2px 10px; border-radius: var(--r-pill); font-weight: 700; font-size: 0.8125rem; box-shadow: inset 0 0 0 1.5px currentColor; }
.pb .ev.strong { color: var(--mint); } .pb .ev.mod { color: var(--ink); } .pb .ev.weak { color: var(--amber); }

/* the picker's result block */
.pb .picked { text-align: center; padding: var(--s6) var(--s4); border-radius: var(--r-3); background: var(--surface); box-shadow: var(--shadow-1); }
.pb .picked .name { font-family: var(--font-display); font-weight: 760; font-size: clamp(1.75rem, 8vw, 2.75rem); line-height: 1.1; letter-spacing: -0.02em; margin-top: var(--s1); }

/* long-form guide. Twin: .prose and the reading column. The cards inside it use the same layered depth */
.pb .prose { max-width: 68ch; font-size: 1.125rem; line-height: 1.7; }
.pb .prose > article > * + * { margin-top: var(--s4); }
.pb .prose h2 { margin-top: var(--s7); }
.pb .prose h3 { margin-top: var(--s5); }
.pb .prose p { text-wrap: pretty; }
.pb .prose ol, .pb .prose ul { padding-left: 1.25em; display: grid; gap: var(--s3); }
.pb .prose .meta { font-size: var(--t-small); color: var(--ink-2); }
.pb .prose .disclosure { font-size: var(--t-small); border: 1px dashed var(--line-strong); border-radius: var(--r-3); padding: var(--s4); color: var(--ink-2); }
.pb .prose .callout { border-radius: var(--r-3); padding: var(--s5); background: var(--surface); box-shadow: var(--shadow-1); }
.pb .prose .picks { display: grid; gap: var(--s4); grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.pb .prose .pick { border-radius: var(--r-3); padding: var(--s5); background: var(--surface); box-shadow: var(--shadow-1); }
.pb .prose .pick .rank { display: block; font-size: var(--t-small); font-weight: 700; color: var(--ink-2); margin-bottom: var(--s1); }
.pb .prose .pick h3 { margin-top: 0; }
.pb .prose .pick .why { margin-top: var(--s3); }
.pb .prose .pick .for { margin-top: var(--s3); font-size: var(--t-small); color: var(--ink-2); }
.pb .prose .faq { display: grid; gap: var(--s2); }
.pb .prose .faq details { border-radius: var(--r-3); background: var(--surface); box-shadow: var(--shadow-1); }
.pb .prose .faq summary { cursor: pointer; font-weight: 700; padding: var(--s4); min-height: 48px; display: flex; align-items: center; }
.pb .prose .faq details[open] summary { border-bottom: 1px solid var(--line); }
.pb .prose .faq details p { padding: var(--s4); margin: 0; color: var(--ink-2); }

/* voice games: level meter, stat rows, theme swatches, creature roster */
.pb .meter { height: 14px; border-radius: var(--r-pill); background: var(--surface-2); box-shadow: var(--sunk); overflow: hidden; }
.pb .meter i { display: block; height: 100%; width: 0%; background: var(--ink); transition: width 60ms linear; }
.pb .stats { list-style: none; padding: 0; display: grid; gap: var(--s2); }
.pb .stats li { display: flex; justify-content: space-between; align-items: center; gap: var(--s3); min-height: 48px; padding: 0 var(--s4); border-radius: var(--r-pill); background: var(--surface); box-shadow: var(--shadow-1); }
.pb .stats li span { color: var(--ink-2); }
.pb .stats li b { font-family: var(--font-mono); font-size: 1.125rem; font-variant-numeric: tabular-nums; }
.pb .themes { display: flex; flex-wrap: wrap; gap: var(--s2); }
.pb .themes button, .pb .themes .sw { width: 48px; height: 48px; border-radius: 50%; border: 1px solid var(--ink-3); cursor: pointer; padding: 0; }
.pb .themes button[aria-pressed="true"] { box-shadow: 0 0 0 3px var(--paper), 0 0 0 5px var(--ink); }
.pb .roster { display: grid; gap: var(--s2); }
.pb .roster .cre { display: grid; grid-template-columns: 48px 1fr 44px; align-items: center; gap: var(--s3); padding: var(--s2) var(--s3); border-radius: var(--r-3); background: var(--surface); box-shadow: var(--shadow-1); }
.pb .roster .cre canvas { width: 48px; height: 48px; }
.pb .roster .cre .nm { display: grid; }
.pb .roster .cre .nm b { font-size: 1.0625rem; }
.pb .roster .cre .nm small { font-family: var(--font-mono); font-size: 0.75rem; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pb .roster .cre button { min-width: 44px; min-height: 44px; border: 1px solid var(--line-strong); border-radius: 50%; background: none; cursor: pointer; font-size: 1.25rem; line-height: 1; }

/* the home page ambient hero and zigzag rows (assets/ribbon.js and the hero-*.js canvases). These two layouts are replaced
   when the home page is rebuilt from the design; until then they keep their structure and sit on the new paper */
.pb .field canvas { display: block; width: 100%; height: auto; aspect-ratio: 1200 / 540; }
.pb .motionToggle { position: absolute; right: var(--s3); bottom: var(--s3); min-height: 44px; padding: 0 var(--s4); font-size: var(--t-small); opacity: 0.55; transition: opacity calc(var(--fast) * var(--motion)) var(--ease); }
.pb .field:hover .motionToggle, .pb .motionToggle:focus-visible { opacity: 1; }
@media (max-width: 640px) {
  .pb .heroFull .field { padding-bottom: var(--s3); }
  .pb .motionToggle { position: static; opacity: 1; display: block; width: max-content; margin: var(--s3) var(--s3) 0 auto; }
}
.pb .heroFull .field canvas { touch-action: none; cursor: grab; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.pb .heroFull .field canvas.holding { cursor: grabbing; }
.pb .ribbonHint { position: absolute; left: var(--s4); bottom: var(--s3); margin: 0; font-size: var(--t-small); color: var(--ink-2); pointer-events: none; }
@media (max-width: 640px) {
  .pb .heroFull .field { display: flex; flex-wrap: wrap; align-items: center; }
  .pb .heroFull .field canvas { flex: 0 0 100%; }
  .pb .ribbonHint { position: static; margin: var(--s3) 0 0 var(--s4); }
}
.pb .raceRow { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s3); }
.pb .raceRow .btn { flex: 1 1 12rem; }
.pb .sealBadge { display: inline-flex; align-items: center; gap: var(--s2); min-height: 44px; padding: 0 var(--s4); border-radius: var(--r-pill); background: var(--surface); box-shadow: var(--shadow-1); color: var(--ink-2); font-size: var(--t-small); font-weight: 700; text-decoration: none; white-space: nowrap; transition: color calc(var(--fast) * var(--motion)) var(--ease), box-shadow calc(var(--fast) * var(--motion)) var(--ease); }
.pb .sealBadge::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--mint); flex-shrink: 0; }
.pb .sealBadge:hover { color: var(--ink); box-shadow: var(--shadow-2); }
.pb .wrap.heroFull, .pb .wrap.zig { width: min(100% - 2 * var(--gutter), 1320px); }
.pb .heroFull { display: grid; gap: var(--s5); padding-block: var(--s5) var(--s7); }
.pb .heroFull .field { position: relative; border: none; border-radius: var(--r-3); background: var(--paper); box-shadow: none; overflow: hidden;
  /* ribbon.js paints its canvas fill from --surface-2 read off this element: the page's own paper, so no seam shows */
  --surface-2: var(--paper); --surface: var(--paper); }
.pb .heroFull .field canvas { -webkit-mask-image: radial-gradient(ellipse 96% 96% at 50% 50%, #000 58%, transparent 100%); mask-image: radial-gradient(ellipse 96% 96% at 50% 50%, #000 58%, transparent 100%); }
.pb .heroFull .heroText { display: grid; gap: var(--s4); align-items: start; align-self: center; }
.pb .heroFull .heroText .display { font-size: clamp(2.5rem, 1.6rem + 5.6vw, 4.5rem); }
.pb .heroFull .heroText .lead { max-width: 46ch; }
.pb .heroFull #quickRace { max-width: 560px; }
@media (min-width: 900px) { .pb .heroFull { grid-template-columns: minmax(0, 1.3fr) minmax(300px, 0.85fr); column-gap: var(--s7); align-items: center; } .pb .heroFull .heroText { grid-template-columns: none; } }
@media (max-width: 899px) { .pb .heroFull .field { width: 100vw; left: 50%; margin-left: -50vw; margin-right: -50vw; border-radius: 0; } }
.pb .zig { display: grid; gap: var(--s5); align-items: center; padding-block: var(--s5); }
.pb .zig .fig { position: relative; border-radius: var(--r-3); background: var(--paper); overflow: hidden; aspect-ratio: 1200 / 540; --surface-2: var(--paper); --surface: var(--paper); }
.pb .zig .fig canvas { display: block; width: 100%; height: 100%; object-fit: cover; -webkit-mask-image: radial-gradient(ellipse 96% 96% at 50% 50%, #000 58%, transparent 100%); mask-image: radial-gradient(ellipse 96% 96% at 50% 50%, #000 58%, transparent 100%); }
.pb .zig .fig:has(#z1) { aspect-ratio: 3 / 2; }
.pb .zig .fig:has(#z3) { aspect-ratio: 9 / 8; }
.pb .zig .say { display: grid; gap: var(--s3); align-content: center; }
.pb .zig .say h2 { max-width: 20ch; }
.pb .zig .say p { max-width: 54ch; }
@media (min-width: 900px) { .pb .zig { grid-template-columns: 1.3fr 1fr; gap: var(--s7); padding-block: var(--s6); } .pb .zig.flip { grid-template-columns: 1fr 1.3fr; } .pb .zig.flip .fig { order: 2; } }
@media (max-width: 899px) { .pb .zig .fig { width: 100vw; left: 50%; margin-left: -50vw; margin-right: -50vw; border-radius: 0; } }

/* Comfort's switches reach the page two ways: the design's classes on <html> (cf-*, --motion, defined above) and the
   attributes on .pb that the games read (data-hc, data-lg, data-wide, data-low-motion, data-motion, .dark). These are
   the attribute side. The Motion dial at or below the low motion threshold holds the whole page still; one boolean,
   written by comfort.js where the games' own check lives, so CSS and JS cannot say different things. */
.pb[data-lg] .display { font-size: clamp(2.4rem, 7vw, 4rem); }
.pb[data-wide] { line-height: 1.75; }
.pb[data-wide] .stack { gap: var(--s5); }
.pb[data-low-motion] *, .pb[data-motion="0"] *, .pb[data-motion="10"] * { transition: none !important; animation: none !important; }
@media (prefers-reduced-motion: reduce) { .pb * { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; } }

/* touch feel: no blue flash on tap, no text selection or callout on a long press in a play area (a long press is a real
   input in a game). Text in articles and inputs stays selectable; only controls and play areas are locked. */
.pb, .pb * { -webkit-tap-highlight-color: transparent; }
.pb button, .pb .btn, .pb summary, .pb label.switch, .pb .chip, .pb .card[href],
.pb canvas, .pb .field, .pb .stage, .pb .toy, .pb .op-stage, .pb .op-dock, .pb .op-bar { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.pb input, .pb textarea, .pb [contenteditable] { -webkit-user-select: text; user-select: text; -webkit-touch-callout: default; }

/* ======================================================================== FORCED COLORS ======
   Windows High Contrast and other forced-colors modes replace every colour and drop box-shadow, so a control drawn from
   backgrounds and shadows (the switch box and thumb, the slider track and thumb, a pressed button) turns blank. Each is
   redrawn here from system colours, with forced-color-adjust: none so the choice of colour is ours and still the user's own
   palette: ButtonText for edges and thumbs, Canvas for the empty part, Highlight for "on". The focus ring is an outline,
   which forced colors keeps. */
@media (forced-colors: active) {
  .pb .switch input[type="checkbox"], .switch .track { forced-color-adjust: none; border: 2px solid ButtonText; background: Canvas; box-shadow: none; }
  .pb .switch input[type="checkbox"]::after, .switch .track::after { background: ButtonText; box-shadow: none; }
  .pb .switch input[type="checkbox"]:checked, .switch[aria-checked="true"] .track { background: Highlight; border-color: Highlight; box-shadow: none; }
  .pb .switch input[type="checkbox"]:checked::after, .switch[aria-checked="true"] .track::after { background: HighlightText; }
  .pb input[type="range"], .pb .fader input[type="range"] { forced-color-adjust: none; }
  .pb input[type="range"]::-webkit-slider-runnable-track, .pb .fader input[type="range"]::-webkit-slider-runnable-track { background: linear-gradient(to right, Highlight var(--fill, 50%), Canvas var(--fill, 50%)); box-shadow: inset 0 0 0 2px ButtonText; }
  .pb input[type="range"]::-moz-range-track, .pb .fader input[type="range"]::-moz-range-track { background: Canvas; box-shadow: inset 0 0 0 2px ButtonText; }
  .pb input[type="range"]::-moz-range-progress, .pb .fader input[type="range"]::-moz-range-progress { background: Highlight; }
  .pb input[type="range"]::-webkit-slider-thumb, .pb .fader input[type="range"]::-webkit-slider-thumb { background: ButtonText; box-shadow: 0 0 0 2px Canvas; }
  .pb input[type="range"]::-moz-range-thumb, .pb .fader input[type="range"]::-moz-range-thumb { background: ButtonText; box-shadow: 0 0 0 2px Canvas; }
  .pb input[type="range"]:focus-visible::-webkit-slider-thumb, .pb .fader input[type="range"]:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 2px Canvas, 0 0 0 5px Highlight; }
  .pb input[type="range"]:focus-visible::-moz-range-thumb, .pb .fader input[type="range"]:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 2px Canvas, 0 0 0 5px Highlight; }
  /* pressed: the selected one is filled with the highlight colour and carries an inner ring, so it differs from its neighbours in
     more than hue */
  .pb button[aria-pressed="true"], .pb .chip[aria-current="true"] { forced-color-adjust: none; background: Highlight; color: HighlightText; border-color: Highlight; box-shadow: inset 0 0 0 2px HighlightText; }
  .pb .themes button[aria-pressed="true"] { outline: 3px solid Highlight; outline-offset: 2px; box-shadow: none; }
}

/* ======================================================================== HUB PAGES ======
   The five category pages (play/cleaning-games/, peeling-games/, cutting-games/, physics-games/, money-counting-games/).
   Every class here starts with "hub" or is scoped under one, so no other page can pick these rules up.
   To add a game: copy one <article class="tile"> inside .hubShelf, change its picture, name, line, chips and link, and add one
   ListItem to the ItemList in the page's JSON-LD. The shelf's n2 / n3 / n4 / n8 class is the card count; it only sets the column
   count (--cols). A card is picture, name, one line, up to three chips and the Play button, which sits at the foot of the card
   so the buttons in a row line up whatever the text above them does. */
/* While the web fonts load, the hub pages set their words in size-matched stand-ins (same recipe as the home page), so the text does not
   jump when the real fonts arrive. The faces are inert on any page that does not use them. */
@font-face { font-family: "Atkinson Stand-in"; font-weight: 400; src: local("Arial"), local("Liberation Sans"), local("Helvetica"); size-adjust: 98%; ascent-override: 100.4%; descent-override: 32.2%; line-gap-override: 0%; }
@font-face { font-family: "Atkinson Stand-in"; font-weight: 700; src: local("Arial Bold"), local("Arial-BoldMT"), local("Liberation Sans Bold"), local("Helvetica Bold"); size-adjust: 98.6%; ascent-override: 99.8%; descent-override: 32%; line-gap-override: 0%; }
@font-face { font-family: "Bricolage Stand-in"; font-weight: 500 800; src: local("Arial Bold"), local("Arial-BoldMT"), local("Liberation Sans Bold"), local("Helvetica Bold"); size-adjust: 100%; ascent-override: 93%; descent-override: 27%; line-gap-override: 0%; }
:root:has(.hubHero) { --font-display: "Bricolage Grotesque", "Bricolage Stand-in", ui-sans-serif, system-ui, sans-serif; --font-text: "Atkinson Hyperlegible Next", "Atkinson Stand-in", ui-sans-serif, system-ui, sans-serif; }
.pb .hubHero { display: grid; gap: var(--s4); justify-items: start; padding-block: var(--s6) var(--s7); }
.pb .hubHero .crumbs { margin: 0; }
.pb .hubHero h1 { margin: 0; }
.pb .hubHero .lead { margin: 0; max-width: 62ch; }
.pb .hubHero .crumbs [aria-current] { color: var(--ink-3); }
.pb .hubSec { padding-block: clamp(var(--s7), 7vw, var(--s9)); }
.pb .hubHero + .hubSec { padding-top: 0; }
.pb .hubSec + .hubSec { border-top: 1px solid var(--line); }
.pb .hubSec .sec-head { margin-bottom: var(--s6); }
.pb .hubShelf { --cols: 2; display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); gap: var(--s7) var(--s5); }
@media (min-width: 900px) { .pb .hubShelf.n3 { --cols: 3; } }
@media (min-width: 1100px) { .pb .hubShelf.n4, .pb .hubShelf.n8 { --cols: 4; } .pb .hubShelf:is(.n4, .n8) .tile-line { font-size: var(--t-small); } }
/* One card across on a phone: two across left descriptions seven or eight lines tall in a 150 px column. */
@media (max-width: 560px) { .pb .hubShelf { --cols: 1; gap: var(--s6); } }
.pb .hubShelf .tile { display: flex; flex-direction: column; align-items: flex-start; gap: var(--s3); }
.pb .hubShelf .tile-art { align-self: stretch; }
.pb .hubShelf .tile-art img { display: block; width: 100%; height: 100%; object-fit: cover; }
.pb .hubShelf .tile-name { margin: var(--s1) 0 0; font-size: var(--t-h3); }
.pb .hubShelf .tile-line { font-size: var(--t-body); }
.pb .tileFacts { display: flex; flex-wrap: wrap; gap: var(--s2); margin: auto 0 0; padding: 0; list-style: none; }   /* auto top margin: chips and button sit at the foot of the card */
.pb .tileFacts li { display: inline-flex; align-items: center; min-height: 30px; padding: 0 var(--s3); border-radius: var(--r-pill); background: var(--surface); box-shadow: var(--shadow-1); font-weight: 700; font-size: var(--t-micro); color: var(--ink-2); }
.pb .hubShelf .tilePlay { position: static; margin-top: var(--s2); }
.pb .hubShelf .tilePlay::after { content: ""; position: absolute; inset: 0; border-radius: var(--r-3); }   /* the whole card is one link, and the button is its one tab stop */
.pb .hubShelf .tile:has(.tilePlay:focus-visible) .tile-art { box-shadow: var(--sunk), 0 0 0 3px var(--focus); }
.pb .hubShelf .tile:has(.tilePlay:focus-visible) .tilePlay { outline: none; }
.pb .hubShelf .tilePlay:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
/* Three cards in two columns would leave one alone: the last takes the whole row, picture beside words once there is room for it. */
@media (max-width: 899px) { .pb .hubShelf.n3 > .tile:last-child { grid-column: 1 / -1; } }
@media (min-width: 561px) and (max-width: 899px) {
  .pb .hubShelf.n3 > .tile:last-child { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: var(--s5); align-content: center; justify-items: start; }
  .pb .hubShelf.n3 > .tile:last-child .tile-art { grid-column: 1; grid-row: 1 / span 4; align-self: center; justify-self: stretch; }
  .pb .hubShelf.n3 > .tile:last-child > :not(.tile-art) { grid-column: 2; margin-top: 0; }
  .pb .hubShelf.n3 > .tile:last-child .tilePlay { margin-top: var(--s2); }
}
/* "Start here" text: a list of three labelled lines (physics) or one short paragraph (peel); the cleaning page uses the shared .howto grid. */
.pb .hubPick { margin: 0; max-width: 760px; }
.pb .hubPick > div { display: grid; grid-template-columns: minmax(0, 15rem) minmax(0, 1fr); gap: var(--s5); padding-block: var(--s4); border-top: 1px solid var(--line); }
.pb .hubPick dt { font: 760 1.125rem/1.2 var(--font-display); }
.pb .hubPick dd { margin: 0; color: var(--ink-2); }
@media (max-width: 700px) { .pb .hubPick > div { grid-template-columns: 1fr; gap: var(--s2); } }
.pb .hubStart { margin: 0; max-width: 62ch; color: var(--ink-2); }
.pb .hubRead { max-width: 760px; }
.pb .hubRead .entry { padding-block: var(--s4); }
.pb .hubRead .entry p { color: var(--ink-2); max-width: 62ch; }
.pb .hubSec .howto dd { margin: 0; }

/* Learn and Guides. Every rule is scoped to .lg-page (the Learn index) or .read (a Learn or Guides article), so no other page is touched.
   Index: articles listed text first under each tool or toy, one small picture per toy, none for the tools. Articles: the page sits on the
   site's 1080 column, the words stay at a reading width, and the breadcrumb is one row whose last item shortens instead of wrapping. */
:root:has(.lg-page, .read) { --font-display: "Bricolage Grotesque", "Bricolage Stand-in", ui-sans-serif, system-ui, sans-serif; --font-text: "Atkinson Hyperlegible Next", "Atkinson Stand-in", ui-sans-serif, system-ui, sans-serif; }
.pb .lg-page .card .h3 { margin-bottom: var(--s2); }
.pb .lg-sec, .pb .lg-group { padding-block: 0; }   /* undo the legacy bare-section padding */
.pb .lg-sec > h2 { margin-bottom: var(--s5); }
.pb .lg-sec + .lg-sec { border-top: 1px solid var(--line); padding-top: var(--s7); }
.pb .lg-tools { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s6) var(--s7); }
.pb .lg-toys { columns: 1; column-gap: var(--s8); }
@media (min-width: 900px) {
  .pb .lg-tools { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .pb .lg-toys { columns: 2; }
}
.pb .lg-group { break-inside: avoid; margin: 0 0 var(--s6); }
.pb .lg-tools .lg-group { margin: 0; }
.pb .lg-head { display: flex; align-items: center; gap: var(--s4); margin-bottom: var(--s3); }
.pb .lg-head h3 { margin: 0 0 var(--s1); }
.pb .lg-head p { margin: 0; font-size: var(--t-small); text-wrap: pretty; }
.pb .lg-thumb { flex: none; display: block; width: 112px; height: auto; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--r-2); border: 1px solid var(--line); background: var(--well); }
.pb .lg-list { list-style: none; margin: 0; padding: 0; }
.pb .lg-list li { padding-block: var(--s3); border-top: 1px solid var(--line); }
.pb .lg-list a { font: 700 1.0625rem/1.3 var(--font-text); color: var(--ink); }
.pb .lg-list p { margin: var(--s1) 0 0; font-size: var(--t-small); text-wrap: pretty; }

.pb main.read { max-width: none; }
.pb .read article > * { max-width: 46rem; }
.pb .read article > h1 { max-width: 60rem; }
.pb .read article > section.stack { max-width: none; }
.pb .read :is(p, li, summary) { text-wrap: pretty; }
.pb .read .crumbs { display: flex; flex-wrap: nowrap; gap: var(--s2); padding: 0; margin-bottom: var(--s4); }
.pb .read .crumbs li { margin: 0; flex: none; white-space: nowrap; }
.pb .read .crumbs [aria-current] { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; color: var(--ink-3); }
