/* Bearing Identity System — v1.15
   Everything is placed on the calculated grid of js/grid.js:
   --mod   one module (≈ 20 px, tuned so the page is a whole number of modules)
   --m     margin (3 modules; 2 on tablets, 1 on phones)
   --top   where content starts (5 modules), --content-h its height (whole modules)
   --dial  the dial and the rail row (6 modules)
   Every chapter uses four zones: head (cols 1–4, top), stage (cols 5–12),
   text (cols 1–4, bottom) and rail (cols 5–10, bottom). Colours from tokens.css. */

:root {
  --paper: var(--tb-color-core-white-lithium-grease, #F5F4F1);
  --ink: var(--tb-color-core-dead-metal-spark, #131313);
  --red: var(--tb-color-core-red-hot-bearing, #D12B27);
  --purple: var(--tb-color-core-purple-flame, #48479D);
  --grey: var(--tb-color-core-titanium-grey, #9A9FA6);
  --red-300: var(--tb-color-extended-red-300, #E8867A);
  --n500: var(--tb-color-extended-neutral-500, #686766);
  --sans: "Nitride", system-ui, sans-serif;
  --display: "Apsis", "Nitride", system-ui, sans-serif;
  --pixel: "Apsis Pixel", var(--display);
  --dot: "Apsis Dot", var(--display);
  /* fallbacks until js/grid.js has measured the screen */
  --mod: 20px; --m: 60px; --col: 80px; --cols: 12;
  --bar: 60px; --top: 100px; --content-h: calc(100vh - 140px); --bottom: 40px; --dial: 120px;
  --ease: cubic-bezier(0.1, 0.7, 0.2, 1);
  --ease-std: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-bearing: cubic-bezier(0.65, 0, 0.15, 1);
  --t-fast: 120ms; --t-base: 240ms; --t-slow: 480ms;
  color-scheme: dark;
}

/* ------------------------------------------------------------------ themes */
[data-theme="dark"], [data-theme="codex"] {
  --bg: var(--ink); --fg: var(--paper); --muted: #A8A7A4; --line: rgba(245, 244, 241, 0.16);
  --accent: var(--red); --accent-text: var(--red-300); --wm: var(--paper); --wm-accent: var(--red); --btn-fg: var(--ink);
}
[data-theme="codex"] { --bg: #070707; }
[data-theme="light"] {
  --bg: var(--paper); --fg: var(--ink); --muted: var(--n500); --line: rgba(19, 19, 19, 0.14);
  --accent: var(--red); --accent-text: var(--red); --wm: var(--ink); --wm-accent: var(--red); --btn-fg: var(--paper);
  color-scheme: light;
}
[data-theme="red"] {
  --bg: var(--red); --fg: var(--paper); --muted: rgba(245, 244, 241, 0.78); --line: rgba(245, 244, 241, 0.34);
  --accent: var(--paper); --accent-text: var(--paper); --wm: var(--paper); --wm-accent: var(--paper); --btn-fg: var(--red);
}

/* ------------------------------------------------------------------ base */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg); color: var(--fg);
  font-family: var(--sans); font-weight: 400; font-size: 16px; line-height: 1.5; letter-spacing: 0;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  overflow: hidden; overscroll-behavior: none;
  transition: background-color var(--t-slow) var(--ease), color var(--t-slow) var(--ease);
}
img, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
button, input { font: inherit; letter-spacing: inherit; color: inherit; }
kbd { font-family: var(--sans); font-size: 0.85em; border: 1px solid var(--line); border-radius: 3px; padding: 0 5px; }
code { font-family: var(--sans); font-weight: 500; font-size: 0.92em; letter-spacing: 0; }
:focus-visible { outline: 2px solid var(--purple); outline-offset: 3px; }
[data-theme="dark"] :focus-visible, [data-theme="codex"] :focus-visible, [data-theme="red"] :focus-visible { outline-color: var(--paper); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: fixed; left: var(--m); top: 8px; z-index: 100; background: var(--fg); color: var(--bg); padding: 6px 12px; transform: translateY(-200%); }
.skip:focus { transform: none; }
.symbols { position: absolute; width: 0; height: 0; }
[hidden] { display: none !important; }

/* ------------------------------------------------------------------ stage + grid overlay */
.stage { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 0; pointer-events: none; }
.no-webgl .stage { display: none; }
.grid-overlay { position: fixed; inset: 0; z-index: 70; pointer-events: none; display: none;
  --gl: rgba(72, 71, 157, 0.22);
  background-image: linear-gradient(to right, var(--gl) 1px, transparent 1px), linear-gradient(to bottom, var(--gl) 1px, transparent 1px);
  background-size: var(--mod) var(--mod); }
.grid-overlay__cols { position: absolute; left: var(--m); right: var(--m); top: var(--top); height: var(--content-h);
  background: repeating-linear-gradient(to right, rgba(72, 71, 157, 0.10) 0 var(--col), transparent var(--col) calc(var(--col) + var(--mod)));
  box-shadow: inset 0 0 0 1px rgba(72, 71, 157, 0.55); }
[data-theme="dark"] .grid-overlay, [data-theme="codex"] .grid-overlay, [data-theme="red"] .grid-overlay { filter: invert(1) hue-rotate(180deg); }
.show-grid .grid-overlay { display: block; }

/* ------------------------------------------------------------------ chrome: the bar is 3 modules, on the columns */
.bar { position: fixed; z-index: 60; left: 0; right: 0; top: 0; height: var(--bar); padding: 0 var(--m);
  display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); column-gap: var(--mod); align-items: center; }
.bar__brand { grid-column: 1 / span 2; display: flex; align-items: center; text-decoration: none; min-width: 0; }
.bar__word { width: calc(var(--mod) * 6); height: auto; color: var(--wm); flex: none; }
.bar__item { grid-column: 5 / span 4; margin: 0; font-size: 12px; font-weight: 300; letter-spacing: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar__item b { font-weight: 300; color: var(--muted); }
.bar__tools { grid-column: 9 / -1; justify-self: end; display: flex; gap: 2px; margin-right: -10px; }
.tool { background: none; border: 0; padding: 8px 10px; font-size: 13px; cursor: pointer; border-radius: 3px; position: relative; white-space: nowrap; }
.tool:hover { background: var(--line); }
.tool[aria-pressed="true"]::before, .tool[aria-expanded="true"]::before { content: ""; position: absolute; left: 50%; bottom: 2px; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: var(--accent); }
.tool--quiet { color: var(--muted); }
.tool__b { display: none; }
.spec-open .tool__a { display: none; }
.spec-open .tool__b { display: inline; }
@media (max-width: 899px) { .bar__brand { grid-column: 1 / span 3; } .bar__item { display: none; } .bar__tools { grid-column: 4 / -1; } }
@media (max-width: 599px) { .bar__brand { grid-column: 1 / span 2; } .bar__tools { grid-column: 3 / -1; } .tool--quiet:not([data-action="lite"]) { display: none; } }

/* ------------------------------------------------------------------ dial: columns 11–12, on the bottom line */
.dial { position: fixed; z-index: 55; right: var(--m); bottom: var(--bottom); width: var(--dial); height: var(--dial); touch-action: none; cursor: grab; border-radius: 50%; }
.dial:active { cursor: grabbing; }
.dial svg { width: 100%; height: 100%; overflow: visible; }
.dial__race { fill: none; stroke: var(--line); stroke-width: 1.5; }
.dial__tick { stroke: var(--line); stroke-width: 2; transition: stroke var(--t-base) var(--ease); }
.dial__tick.is-on { stroke: var(--accent); stroke-width: 4; }
.dial__housing { fill: var(--fg); transition: fill var(--t-slow) var(--ease); }
.dial__dot { fill: var(--accent); }
.dial__num { position: absolute; left: 0; right: 0; bottom: 9%; text-align: center; font-family: var(--pixel); font-weight: 700; font-size: calc(var(--dial) * 0.1); line-height: 1; letter-spacing: 0; pointer-events: none; }
.dial__hub { cursor: pointer; }
/* the ball's own offset is driven per-frame by JS physics (deck.js dialHub), not
   a CSS animation: it composes on this wrapper so the hub's own base transform
   (translate(-60 -60) scale(.4), positioning the dot glyph) is never clobbered —
   that clobbering is what used to make a tap "teleport" the ball to a fixed spot */
.dial__hubwrap { transform-box: fill-box; transform-origin: center; }
.dial.is-open .dial__rotor { opacity: 0.18; }
.dial__static { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 2; width: 88%; aspect-ratio: 1; border-radius: 50%;
  border: 0; background: var(--red); color: var(--paper); cursor: pointer; font-family: var(--dot); font-weight: 700; font-size: 14px; line-height: 1; letter-spacing: -0.005em;
  animation: open 480ms var(--ease-bearing); }
[data-theme="red"] .dial__static { background: var(--paper); color: var(--red); }
@keyframes open { from { transform: translate(-50%, -50%) scale(0.2); opacity: 0; } }

/* ------------------------------------------------------------------ index + toast */
.index { position: fixed; z-index: 80; inset: 0; background: var(--bg); padding: var(--top) var(--m) calc(var(--mod) * 2); overflow: auto; }
.index__list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 var(--mod); }
@media (max-width: 899px) { .index__list { grid-template-columns: 1fr; } }
.index__list button { display: flex; align-items: baseline; gap: var(--mod); width: 100%; min-height: calc(var(--mod) * 4); text-align: left; background: none; border: 0; border-top: 1px solid var(--line); padding: calc(var(--mod) * .6) 0; cursor: pointer; }
.index__list button:hover .index__t, .index__list button.is-cur .index__t { color: var(--accent-text); }
.index__no { font-family: var(--pixel); font-weight: 700; font-size: 20px; color: var(--muted); width: calc(var(--mod) * 2); flex: none; }
.index__t { font-family: var(--display); font-weight: 700; font-size: calc(var(--mod) * 1.7); line-height: 1; letter-spacing: -0.008em; }
.index__keys { margin-top: calc(var(--mod) * 2); font-size: 13px; color: var(--muted); }
.toast { position: fixed; z-index: 90; left: 50%; bottom: calc(var(--bottom) + var(--dial) + var(--mod)); transform: translate(-50%, 20px); opacity: 0; background: var(--fg); color: var(--bg); padding: 8px 14px; border-radius: 3px; font-size: 13px; transition: opacity var(--t-base) var(--ease), transform var(--t-base) var(--ease); pointer-events: none; max-width: calc(100vw - 2 * var(--m)); }
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* the applications lightbox: always a dark scrim regardless of the active
   chapter's theme (chapter 11 is permanently light) — an image viewer needs
   that contrast, unlike .index above which is a full-page view and adopts
   whichever theme is current. The piece on the left, what it is on the right.
   It arrives the way the studio makes things: printed in, layer by layer,
   with a red print head at the front of the reveal. */
.lightbox { position: fixed; z-index: 85; inset: 0; }
.lightbox__scrim { position: absolute; inset: 0; background: rgba(19, 19, 19, 0.955); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.lightbox__panel { position: relative; z-index: 1; height: 100%; box-sizing: border-box; color: var(--paper);
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 340px); column-gap: calc(var(--mod) * 2.4); align-items: center;
  padding: calc(var(--mod) * 3) var(--m) calc(var(--mod) * 2); }
.lightbox__fig { margin: 0; min-width: 0; min-height: 0; display: flex; align-items: center; justify-content: center; }
.lightbox__stage { position: relative; display: flex; box-shadow: 0 40px 90px -30px rgba(0, 0, 0, 0.7); }
.lightbox__img { display: block; max-width: 100%; max-height: calc(100vh - var(--mod) * 6); object-fit: contain; background: var(--paper); }
/* the print head: a red hairline at the front of the reveal, on the image's own edge */
.lightbox__head { position: absolute; z-index: 2; pointer-events: none; background: var(--red); opacity: 0; box-shadow: 0 0 14px 1px rgba(209, 43, 39, 0.75); }
.lightbox__head.is-v { left: -6px; right: -6px; height: 2px; bottom: 0; }
.lightbox__head.is-h { top: -6px; bottom: -6px; width: 2px; left: 0; }
.lightbox__info { min-width: 0; max-height: calc(100vh - var(--mod) * 5); overflow-y: auto; scrollbar-width: thin; padding-right: 2px; }
.lightbox__no { margin: 0 0 calc(var(--mod) * .5); font-family: var(--pixel); font-weight: 700; font-size: 12px; line-height: var(--mod); letter-spacing: 0; color: rgba(245, 244, 241, .55); }
.lightbox__title { margin: 0; font-family: var(--display); font-weight: 700; font-size: calc(var(--mod) * 2); line-height: 1; letter-spacing: -0.008em; color: var(--paper); }
.lightbox__spec { margin: calc(var(--mod) * .8) 0 0; font-size: 13px; line-height: calc(var(--mod) * 1.1); font-weight: 300; letter-spacing: 0; color: rgba(245, 244, 241, .62); }
.lightbox__spec b { font-weight: 300; color: rgba(245, 244, 241, .4); }
.lightbox__about { margin: calc(var(--mod) * .9) 0 0; font-size: 14px; line-height: calc(var(--mod) * 1.15); letter-spacing: 0; color: rgba(245, 244, 241, .88); }
.lightbox__rows { margin: calc(var(--mod) * 1.1) 0 0; padding: 0; border-top: 1px solid rgba(245, 244, 241, .16); }
.lightbox__rows div { display: grid; grid-template-columns: 8.5ch minmax(0, 1fr); column-gap: calc(var(--mod) * .6); padding: calc(var(--mod) * .45) 0; border-bottom: 1px solid rgba(245, 244, 241, .16); }
.lightbox__rows dt { margin: 0; font-size: 12px; line-height: calc(var(--mod) * 1.05); color: rgba(245, 244, 241, .5); letter-spacing: 0; }
.lightbox__rows dd { margin: 0; font-size: 13px; line-height: calc(var(--mod) * 1.05); color: var(--paper); letter-spacing: 0; overflow-wrap: anywhere; }
.lightbox__flip { margin-top: calc(var(--mod) * .9); background: none; border: 1px solid rgba(245, 244, 241, .4); color: var(--paper); border-radius: 3px; padding: 0 calc(var(--mod) * .7); height: calc(var(--mod) * 1.8); font-size: 12px; font-weight: 500; cursor: pointer; }
.lightbox__flip:hover { background: var(--paper); color: var(--ink); }
.lightbox__nav { display: flex; align-items: center; gap: calc(var(--mod) * .7); margin-top: calc(var(--mod) * 1.4); }
.lightbox__keys { flex: 1; margin: 0; font-size: 12px; line-height: var(--mod); letter-spacing: 0; color: rgba(245, 244, 241, .45); text-align: center; }
.lightbox__keys kbd { font: inherit; border: 1px solid rgba(245, 244, 241, .3); border-radius: 3px; padding: 0 4px; color: rgba(245, 244, 241, .7); }
.lightbox__close { position: absolute; top: var(--mod); right: var(--m); z-index: 2; background: none; border: 1px solid rgba(245, 244, 241, 0.4); color: var(--paper); border-radius: 3px; padding: 0 calc(var(--mod) * .7); height: calc(var(--mod) * 2); font-size: 13px; cursor: pointer; }
.lightbox__close:hover { background: var(--paper); color: var(--ink); }
.lightbox__prev, .lightbox__next { flex: none; width: calc(var(--mod) * 2.2); height: calc(var(--mod) * 2.2); border-radius: 50%; border: 1px solid rgba(245, 244, 241, 0.4); background: rgba(19, 19, 19, 0.4); color: var(--paper); font-size: 20px; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.lightbox__prev:hover, .lightbox__next:hover { background: var(--paper); color: var(--ink); }
@media (max-width: 899px) {
  .lightbox__panel { display: block; overflow-y: auto; padding: calc(var(--mod) * 3) calc(var(--mod) * .8) calc(var(--mod) * 1.5); }
  .lightbox__fig { justify-content: flex-start; }
  .lightbox__img { max-height: 46vh; }
  .lightbox__info { max-height: none; overflow: visible; margin-top: calc(var(--mod) * 1.2); }
  .lightbox__close { right: calc(var(--mod) * .3); top: calc(var(--mod) * .5); }
}

/* ------------------------------------------------------------------ chapters: the four zones */
.deck { position: relative; z-index: 10; }
.ch { position: fixed; inset: 0; visibility: hidden; opacity: 0; transition: opacity var(--t-slow) var(--ease), visibility 0s linear var(--t-slow); color: var(--fg); }
.ch.is-active { visibility: visible; opacity: 1; transition: opacity var(--t-slow) var(--ease) 80ms, visibility 0s; }
body:not(.is-ready) .ch { opacity: 0; }
.ch__xp { position: absolute; inset: 0; padding: var(--top) var(--m) var(--bottom); overflow: hidden; }
.xp { height: var(--content-h); display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); grid-template-rows: auto minmax(0, 1fr) var(--dial); gap: var(--mod); }
.xp > * { min-width: 0; min-height: 0; }
.xp__head { grid-column: 1 / span 4; grid-row: 1; }
.xp__text { grid-column: 1 / span 4; grid-row: 3; align-self: end; margin: 0; }
.xp__stage { grid-column: 5 / -1; grid-row: 1 / span 2; }
.xp__side { grid-column: 10 / -1; grid-row: 1 / span 2; }
.xp__side ~ .xp__stage, .xp__stage:has(~ .xp__side) { grid-column: 5 / span 5; }
/* the rail is columns 5–10 again divided into their 6 columns: every control spans whole columns */
.xp__rail { grid-column: 5 / span 6; grid-row: 3; align-self: stretch; border-top: 1px solid var(--line); padding-top: var(--mod);
  display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: var(--mod); align-content: start; align-items: center; }
.xp__rail > * { grid-column: span 2; min-width: 0; }
.xp__rail > .range--wide, .xp__rail > .ramps { grid-column: 1 / -1; }
.xp__rail .btn { width: 100%; }
.rail__label { font-size: 12px; font-weight: 500; color: var(--muted); letter-spacing: 0; white-space: nowrap; }
.rail__readout { margin: 0; display: flex; align-items: baseline; gap: calc(var(--mod) * .5); }
.readout { font-family: var(--pixel); font-weight: 700; font-size: calc(var(--mod) * 1.4); line-height: 1; letter-spacing: 0; }

/* type, in modules */
.display { font-family: var(--display); font-weight: 700; margin: 0; font-kerning: normal; text-wrap: balance; }
.display--xl { font-size: calc(var(--mod) * 5); line-height: calc(var(--mod) * 4.8); letter-spacing: -0.01em; }
.display--l { font-size: calc(var(--mod) * 3.3); line-height: calc(var(--mod) * 3.2); letter-spacing: -0.008em; }
.display--m { font-size: calc(var(--mod) * 2.1); line-height: calc(var(--mod) * 2.2); letter-spacing: 0; }
.dw { white-space: nowrap; display: inline-block; }
.dc { display: inline; }
.dc.s0 { opacity: 0; }
.dc.s1 { font-family: "Apsis Dot", var(--display); }
.dc.s2 { font-family: "Apsis Mesh", var(--display); }
.dc.s3 { font-family: "Apsis Pixel", var(--display); }
.dc.s4 { font-family: "Apsis Line", var(--display); }
.dc.s5 { font-family: "Apsis Mesh", var(--display); }
.dc.s6 { font-family: "Apsis Line", var(--display); }
[data-skin="pixel"] { font-family: var(--pixel); }
.chno { margin: 0 0 var(--mod); font-family: var(--pixel); font-weight: 700; font-size: calc(var(--mod) * 1.5); line-height: calc(var(--mod) * 1.5); letter-spacing: 0; color: var(--accent-text); }
.lede { font-size: var(--mod); line-height: calc(var(--mod) * 1.5); font-weight: 300; max-width: 36ch; margin: var(--mod) 0 0; text-wrap: pretty; }
.xp__text.lede { margin: 0; }
.kicker { font-size: 13px; font-weight: 300; color: var(--muted); margin: 0; letter-spacing: 0; line-height: var(--mod); }
.kicker--on { color: var(--fg); font-weight: 500; }
.label { font-size: 12px; font-weight: 500; color: var(--muted); margin: 0 0 calc(var(--mod) * .5); letter-spacing: 0; line-height: var(--mod); }
.note { font-size: 13px; color: var(--muted); font-weight: 300; }
.hint { margin: var(--mod) 0 0; font-size: 13px; color: var(--muted); line-height: var(--mod); }
.xp__hint { margin: 0; font-size: 13px; line-height: var(--mod); color: var(--muted); }
.hint__touch { display: none; }
@media (pointer: coarse) { .hint__pointer { display: none; } .hint__touch { display: inline; } }

/* controls: 2 modules tall */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; background: transparent; border: 1px solid currentColor; border-radius: 3px; padding: 0 calc(var(--mod) * .7); height: calc(var(--mod) * 2); font-size: 13px; font-weight: 500; cursor: pointer; white-space: nowrap; transition: background-color var(--t-fast) var(--ease-std), color var(--t-fast) var(--ease-std); }
.btn:hover, .btn[aria-pressed="true"] { background: var(--fg); color: var(--btn-fg); }
.btns { display: flex; flex-wrap: wrap; gap: calc(var(--mod) * .5); }
.btns--grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--mod); }
.btns--grid .btn { width: 100%; padding: 0 4px; }
.seg { border: 0; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px; align-items: center; min-width: 0; }
.seg legend { float: left; font-size: 12px; font-weight: 500; color: var(--muted); padding: 0; margin-right: calc(var(--mod) * .5); letter-spacing: 0; line-height: calc(var(--mod) * 2); }
.seg button, .seg__file span { background: none; border: 1px solid var(--line); border-radius: 3px; padding: 0 calc(var(--mod) * .45); height: calc(var(--mod) * 1.6); font-size: 13px; cursor: pointer; display: inline-flex; align-items: center; }
.seg button:hover, .seg__file:hover span { border-color: var(--fg); }
.seg button[aria-pressed="true"] { background: var(--fg); color: var(--btn-fg); border-color: var(--fg); }
.seg__file { position: relative; display: inline-flex; }
.seg__file input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.seg__file.is-on span { background: var(--fg); color: var(--btn-fg); border-color: var(--fg); }
.seg__file input:focus-visible + span { outline: 2px solid var(--paper); outline-offset: 2px; }
.toggle { display: inline-flex; gap: 6px; align-items: center; font-size: 13px; cursor: pointer; white-space: nowrap; }
.toggle input { accent-color: var(--red); width: 16px; height: 16px; }
.range { display: flex; align-items: center; gap: calc(var(--mod) * .6); font-size: 13px; }
.range span { color: var(--muted); white-space: nowrap; }
.range--wide { flex: 1; }
input[type="range"] { -webkit-appearance: none; appearance: none; background: transparent; flex: 1; min-width: calc(var(--mod) * 6); height: calc(var(--mod) * 2); cursor: pointer; margin: 0; }
input[type="range"]::-webkit-slider-runnable-track { height: 1px; background: var(--fg); }
input[type="range"]::-moz-range-track { height: 1px; background: var(--fg); }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%; background: var(--accent); margin-top: -7.5px; border: 0; }
input[type="range"]::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; background: var(--accent); border: 0; }

/* ------------------------------------------------------------------ 00 boot */
.xp--boot .xp__head { grid-column: 1 / span 8; }
.boot__text { grid-column: 1 / span 8; grid-row: 2 / span 2; }
.boot__text .lede { max-width: 30ch; }

/* ------------------------------------------------------------------ 01 manifesto: pull */
.xp--manifesto .pull__hint { grid-column: 5 / span 4; grid-row: 1; align-self: start; }
.pull { grid-column: 1 / -1; grid-row: 2; align-self: center; cursor: ew-resize; touch-action: pan-y; user-select: none; outline-offset: 12px; --t: 1; }
.pull p { margin: 0; }
.pull__a, .pull__b { font-weight: 500; font-size: calc(var(--mod) * 4); line-height: calc(var(--mod) * 4); letter-spacing: -0.02em; white-space: nowrap; will-change: transform; }
/* at rest (t = 1) both lines sit on the margins; pushed in they close up, pulled out they slide past */
.pull__a { transform: translateX(calc((var(--t) - 1) * var(--col))); }
.pull__b { text-align: right; transform: translateX(calc((1 - var(--t)) * var(--col))); }
.pull__mid { height: calc(var(--mod) * 4 * min(var(--t), 1)); overflow: hidden; display: flex; align-items: center; justify-content: center; }
.pull__txt { font-family: var(--display); font-weight: 700; font-style: italic; font-size: calc(var(--mod) * 2.5); line-height: calc(var(--mod) * 3); letter-spacing: 0; white-space: nowrap; transition: letter-spacing var(--t-base) var(--ease); }
.pull[data-skin="dot"] .pull__txt { font-family: "Apsis Dot", var(--display); }
.pull[data-skin="dot25"] .pull__txt { font-family: "Apsis Mesh", var(--display); letter-spacing: 0.02em; }
.mf-lines { grid-column: 1 / span 10; grid-row: 3; align-self: end; list-style: none; margin: 0; padding: 0; counter-reset: mf;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--mod); }
.mf-lines li { counter-increment: mf; border-top: 1px solid var(--line); padding-top: calc(var(--mod) * .5); font-size: 15px; line-height: var(--mod); min-height: calc(var(--dial) - var(--mod)); }
.mf-lines li::before { content: counter(mf, decimal-leading-zero); display: block; font-family: var(--pixel); font-weight: 700; font-size: 13px; line-height: var(--mod); margin-bottom: calc(var(--mod) * .5); color: var(--muted); }

/* ------------------------------------------------------------------ 02 architecture */
.xp--arch { grid-template-rows: auto minmax(0, 1fr) auto; }
.subs { grid-column: 1 / span 9; grid-row: 3; list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--mod); }
.sub { display: block; width: 100%; padding: var(--mod) 0 0; background: none; border: 0; border-top: 1px solid var(--line); cursor: pointer; color: var(--fg); transition: border-color var(--t-base) var(--ease); }
.sub__lk { display: block; }
.sub__lk svg { width: 100%; height: auto; transition: transform var(--t-slow) var(--ease); }
.sub__txt { margin: calc(var(--mod) * .5) 0 0; font-size: 14px; line-height: var(--mod); color: var(--muted); max-width: 34ch; }
.sub__txt b { color: var(--fg); font-weight: 500; }
.subs li.is-on .sub { border-top-color: var(--accent); }
.subs li.is-on .sub svg { transform: translateY(calc(var(--mod) * -.3)); }
.lk { overflow: visible; }

/* ------------------------------------------------------------------ 03 logo */
.logo__stage { display: grid; place-items: center; }
.con { width: 100%; height: 100%; overflow: visible; }
.con__grid line { stroke: var(--grey); stroke-width: 1; opacity: calc(0.35 + var(--explode, 0) * 0.5); }
.con__guides circle { fill: none; stroke: var(--purple); stroke-width: 1.5; stroke-dasharray: 4 5; opacity: calc(0.25 + var(--explode, 0) * 0.75); }
.con__a path, .con__b path { fill: var(--red); }
.con__dot { fill: var(--red); }
.con__labels text { font-family: var(--sans); font-size: 18px; fill: var(--purple); opacity: var(--explode, 0); letter-spacing: 0; }
.con__labels .con__lt { fill: var(--paper); font-size: 16px; }
.con__space rect { fill: rgba(72, 71, 157, 0.14); stroke: var(--purple); stroke-width: 1; }
.con__space .con__space-edge { fill: none; stroke-dasharray: 3 4; }
.con__space { opacity: 0; transition: opacity var(--t-base) var(--ease); }
.con.show-space .con__space { opacity: 1; }
.misuse-try { align-self: start; border-top: 1px solid var(--line); padding-top: calc(var(--mod) * .5); display: flex; flex-direction: column; height: 100%; min-height: 0; }
.misuse-try__stage { height: calc(var(--mod) * 8); flex: none; display: grid; place-items: center; overflow: visible; position: relative; background-color: transparent; background-position: center; background-size: cover; border: 1px solid transparent; transition: background-color var(--t-base) var(--ease), border-color var(--t-base) var(--ease); }
.misuse-try__word { width: 72%; color: var(--ink); transition: transform var(--t-slow) var(--ease), filter var(--t-base), color var(--t-base) var(--ease); }
.misuse-try__word.is-outline { color: transparent; stroke: var(--ink); stroke-width: 6; --wm-accent: transparent; }
.misuse-try__word.is-gradient { color: var(--purple); --wm-accent: #FF7A2E; }
.misuse-try__word.is-shadow { filter: drop-shadow(6px 8px 0 rgba(19,19,19,.55)) drop-shadow(-3px -2px 0 var(--red)); }
.misuse-try__word.is-low-contrast { color: var(--grey); --wm-accent: var(--grey); }
.misuse-try__stage.is-purple-red { background-color: var(--red); border-color: var(--red); }
.misuse-try__stage.is-purple-red .misuse-try__word { color: var(--purple); --wm-accent: var(--purple); }
.misuse-try__stage.is-busy { background-image: url("../../guidelines/img/misuse/misuse-7-busy-photo.svg"); border-color: var(--line); }
.misuse-try__fake { position: absolute; inset: 0; margin: 0; display: none; align-items: center; justify-content: center; flex-direction: column; gap: 2px; font-family: var(--display); font-weight: 700; font-size: calc(var(--mod) * 1.6); letter-spacing: 0; line-height: 1; color: var(--ink); text-align: center; }
.misuse-try__fake span { font-family: var(--sans); font-weight: 500; font-size: 13px; letter-spacing: 0; color: var(--red); font-style: italic; }
.misuse-try__stage.is-new-lockup .misuse-try__word { opacity: 0; }
.misuse-try__stage.is-new-lockup .misuse-try__fake { display: flex; }
.misuse-try .btns--grid { grid-template-columns: repeat(2, minmax(0, 1fr)); flex: none; margin-top: calc(var(--mod) * .5); }
.misuse-try .btns--grid .btn { font-size: 12px; padding: 0 6px; }
.misuse-try__msg { min-height: calc(var(--mod) * 2.5); margin: calc(var(--mod) * .5) 0 0; font-size: 13px; line-height: var(--mod); color: var(--accent-text); }

/* ------------------------------------------------------------------ 04 colour */
.colour__stage { display: grid; grid-template-rows: minmax(0, 1.2fr) minmax(0, 1fr); gap: var(--mod); }
.ratio-bar { display: flex; min-height: 0; border: 1px solid var(--line); }
.ratio-bar__seg { position: relative; border: 0; padding: calc(var(--mod) * .6); text-align: left; cursor: copy; display: flex; flex-direction: column; justify-content: flex-end; overflow: hidden; min-width: 0; transition: flex-grow var(--t-slow) var(--ease); }
/* 150 is above every resting ratio (the largest is 60), so a hot segment always
   grows and always still contains the pointer that made it hot. The old hover
   grew to 30, which is LESS than white's own 60: hovering white shrank it. */
.ratio-bar__seg.is-hot { flex-grow: 150 !important; }
.ratio-bar__name { font-family: var(--display); font-weight: 700; font-size: calc(var(--mod) * 1.5); line-height: 0.96; letter-spacing: -0.008em; white-space: nowrap; }
.ratio-bar__hex { font-size: 12px; white-space: nowrap; letter-spacing: 0; }
.contrast { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: var(--mod); min-height: 0; }
.contrast__pick { grid-column: span 3; }
.contrast fieldset { border: 0; padding: 0; margin: 0 0 var(--mod); }
.contrast legend { font-size: 12px; color: var(--muted); margin-bottom: calc(var(--mod) * .3); }
.chips { display: flex; gap: calc(var(--mod) * .4); flex-wrap: wrap; }
.chip-b { width: calc(var(--mod) * 1.6); height: calc(var(--mod) * 1.6); border-radius: 50%; border: 1px solid var(--line); cursor: pointer; }
.chip-b[aria-pressed="true"] { outline: 2px solid var(--fg); outline-offset: 2px; }
.contrast__out { grid-column: span 5; padding: var(--mod); border: 1px solid var(--line); display: flex; flex-direction: column; justify-content: space-between; transition: background-color var(--t-base) var(--ease), color var(--t-base) var(--ease); }
.contrast__sample { margin: 0; font-family: var(--display); font-weight: 700; font-size: calc(var(--mod) * 2.5); line-height: 0.96; letter-spacing: -0.008em; }
.contrast__ratio { margin: 0; font-size: 13px; }
.codex-ramps { row-gap: calc(var(--mod) * .5); }
.codex-ramps .rail__label { grid-column: 1 / -1; margin: 0; line-height: var(--mod); }
.ramps { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: calc(var(--mod) * .5); width: 100%; }
.ramp { height: calc(var(--mod) * 2); position: relative; }
.ramp span { position: absolute; left: 0; top: 100%; margin-top: 4px; font-size: 12px; color: var(--muted); letter-spacing: 0; }

/* ------------------------------------------------------------------ 05 type */
.xp--type { grid-template-rows: auto minmax(0, 1fr) auto; }
.xp--type .xp__head { grid-row: 1 / span 2; }
.tl { display: flex; flex-direction: column; min-height: 0; }
.tl__input { display: block; }
.tl__input .label { display: block; }
.tl__input input { width: 100%; background: none; border: 0; border-bottom: 1px solid var(--line); font-size: 14px; height: calc(var(--mod) * 2); padding: 0; color: var(--fg); }
.tl__out { flex: 1; min-height: 0; margin: 0; display: flex; align-items: center; line-height: 0.95; overflow-wrap: anywhere; font-kerning: normal; overflow: hidden; }
.tl__spec { margin: 0 0 calc(var(--mod) * .5); font-size: 13px; line-height: var(--mod); color: var(--muted); }
.tl__ctrl { border-top: 1px solid var(--line); padding-top: calc(var(--mod) * .5); display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: calc(var(--mod) * .5) var(--mod); }
.tl__ctrl .seg[data-tl="skin"] { grid-column: 1 / span 5; }
.tl__ctrl .seg[data-tl="density"] { grid-column: 6 / span 3; }
.tl__ctrl .seg[data-tl="weight"] { grid-column: 1 / span 3; }
.tl__more { grid-column: 4 / span 5; display: flex; align-items: center; gap: var(--mod); flex-wrap: wrap; }
.range--s input { width: calc(var(--mod) * 6); flex: none; }
.inuse { grid-column: 1 / span 10; grid-row: 3; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--mod); }
.use { margin: 0; min-width: 0; }
.use__art { height: calc(var(--mod) * 6); display: flex; flex-direction: column; justify-content: center; gap: 4px; padding: calc(var(--mod) * .6); border: 1px solid var(--line); overflow: hidden; }
.use figcaption { margin-top: calc(var(--mod) * .3); font-size: 12px; line-height: calc(var(--mod) * .8); color: var(--muted); letter-spacing: 0; }
.use figcaption b { color: var(--fg); font-weight: 500; }
.px-apsis { font-family: "Apsis", var(--display); }
.px-pixel { font-family: "Apsis Pixel", var(--display); }
.px-line { font-family: "Apsis Line", var(--display); }
.use--title .use__art span { font-size: calc(var(--mod) * 1.9); line-height: 0.96; letter-spacing: -0.01em; }
.use--poster .use__art { background: var(--red); color: var(--paper); border-color: var(--red); }
.use--poster .use__art .px-apsis { font-size: calc(var(--mod) * 1.8); line-height: 0.96; letter-spacing: -0.008em; }
.use__small { font-size: 11px; line-height: 1.35; letter-spacing: 0; }
.use__sup { font-size: 10px; color: var(--muted); letter-spacing: 0; }
.use--sub .use__art .px-apsis { font-size: calc(var(--mod) * 1.5); line-height: 1; letter-spacing: -0.005em; }
.use--desc .use__art { color: var(--ink); }
.use--desc .use__art svg { width: 100%; height: auto; }
.use--codex .use__art { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.use--codex .px-pixel { font-size: calc(var(--mod) * 1.1); line-height: 0.95; }
.use--codex .px-line { font-size: calc(var(--mod) * .85); color: var(--red-300); }

/* 06 Nitride: the variable tester, its grid lines, and the text system in use */
.xp--nitride { grid-template-rows: auto minmax(0, 1fr) auto; }
.xp--nitride .xp__head { grid-row: 1 / span 2; }
.nt { display: flex; flex-direction: column; min-height: 0; font-family: "Nitride Variable", var(--sans); }
.nt__stage { position: relative; flex: 1; min-height: calc(var(--mod) * 6); overflow: hidden; }
.nt__out { position: absolute; inset: 0; display: flex; align-items: center; margin: 0; padding-left: calc(var(--mod) * 2.6); white-space: nowrap; overflow: hidden; line-height: 1.3; font-kerning: normal; font-family: "Nitride Variable", var(--sans); }
.nt__line { display: block; }
.nt__base { display: inline-block; width: 0; height: 0; vertical-align: baseline; }
.nt__grid { position: absolute; inset: 0; pointer-events: none; transition: opacity var(--t-base) var(--ease); }
.nt__grid[hidden] { display: block; opacity: 0; }
.nt__ln { position: absolute; left: 0; right: 0; height: 0; border-top: 1px solid rgba(209, 43, 39, .7); }
.nt__ln span { position: absolute; left: 0; bottom: 2px; font: 500 11px/1 var(--sans); letter-spacing: 0; color: var(--red-300); white-space: nowrap; }
.nt__ln span b { font-weight: 700; color: var(--red); margin-right: 4px; }
.nt__ln--b { border-top-color: var(--red); }
.nt__ln { border-top-color: rgba(209, 43, 39, .7); }
.nt__ln--t { border-top-style: dashed; }
.nt__ln--under span { bottom: auto; top: 3px; }
.nt__ctrl { border-top: 1px solid var(--line); padding-top: calc(var(--mod) * .5); display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: calc(var(--mod) * .5) var(--mod); align-items: center; }
.nt__wght { grid-column: 1 / span 4; }
.nt__wght input { flex: 1; min-width: 0; accent-color: var(--red); }
.nt__wght .readout { width: 3.2ch; text-align: right; font-size: calc(var(--mod) * 1.1); }
.nt__named { grid-column: 5 / span 4; }
.nt__ctrl .tl__more { grid-column: 1 / -1; }
.inuse--nt .use__art { color: var(--fg); font-family: var(--sans); }
.inuse--nt .use__art p { margin: 0; }
.use--nbody .use__art p { font-size: 12px; line-height: 16px; max-width: 40ch; }
.use--nhead .use__art p { font-size: calc(var(--mod) * 1.1); line-height: 1.2; font-weight: 500; }
.use--nlabel .use__art .nl { font-size: 11px; font-weight: 500; color: var(--muted); }
.use--nlabel .use__art .nc { font-size: 11px; font-weight: 500; text-transform: uppercase; letter-spacing: .06em; font-feature-settings: "case"; }
.use--nfig .use__art { gap: 0; }
.use--nfig .use__art p { display: flex; justify-content: space-between; font-size: 13px; line-height: 18px; font-variant-numeric: tabular-nums; white-space: pre; }
.use--nfig .use__art p:last-child { border-top: 1px solid var(--line); font-weight: 500; }
.use--nblack .use__art { background: var(--red); border-color: var(--red); color: var(--paper); align-items: flex-start; }
.use--nblack .use__art p { font-weight: 900; font-size: calc(var(--mod) * 4.2); line-height: .8; letter-spacing: -0.02em; }
.sheet pre.code { margin: 0; padding: calc(var(--mod) * .7); background: rgba(19, 19, 19, .04); border: 1px solid var(--line); overflow-x: auto; font-size: 12.5px; line-height: 1.55; }
.sheet pre.code code { font-weight: 400; font-size: inherit; }

/* ------------------------------------------------------------------ 06 motion */
.spinner { display: grid; place-items: center; cursor: grab; touch-action: none; user-select: none; position: relative; }
.spinner:active { cursor: grabbing; }
/* the svg fills the stage box exactly and letterboxes the mark inside it (preserveAspectRatio meet), so on a wide,
   short screen it cannot grow taller than the stage and run over the rail; its viewBox leaves room for the turning corners */
.spinner svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.spinner__rotor path { fill: var(--ink); }
.spinner__dot { fill: var(--red); transform-box: fill-box; transform-origin: center; transition: transform .5s var(--ease-bearing), opacity .4s var(--ease); }
.spinner__piece { transform-box: fill-box; transform-origin: center; transition: transform 1.1s cubic-bezier(.15,.75,.3,1), opacity 1s ease; }
.spinner.is-exploded { cursor: default; }
.spinner.is-exploded .spinner__piece--a { transform: translate(46px, -34px) rotate(140deg) scale(.6); opacity: 0; }
.spinner.is-exploded .spinner__piece--b { transform: translate(-50px, 38px) rotate(-160deg) scale(.6); opacity: 0; }
.spinner.is-exploded .spinner__dot { transform: scale(2.2); opacity: 0; }
.spinner__warn { position: absolute; left: 50%; bottom: 6%; margin: 0; transform: translateX(-50%); font-size: 12px; letter-spacing: 0; color: var(--red); text-align: center; opacity: 0; transition: opacity var(--t-base) var(--ease); pointer-events: none; white-space: nowrap; }
.spinner.is-exploded .spinner__warn { opacity: 1; }
.curves { display: grid; grid-template-rows: repeat(3, minmax(0, 1fr)); gap: var(--mod); }
.curve { margin: 0; min-height: 0; display: flex; flex-direction: column; }
.curve svg { width: 100%; flex: 1; min-height: 0; background: var(--paper); border: 1px solid var(--line); }
.curve__axis { fill: none; stroke: var(--grey); stroke-width: 1; }
.curve__line { fill: none; stroke: var(--ink); stroke-width: 2; vector-effect: non-scaling-stroke; }
.curve__dot { fill: var(--red); }
.curve figcaption { font-size: 12px; line-height: var(--mod); color: var(--muted); margin-top: calc(var(--mod) * .2); letter-spacing: 0; }
.curve figcaption b { color: var(--fg); font-weight: 500; }

/* ------------------------------------------------------------------ 07 voice */
.xp--voice { grid-template-rows: auto minmax(0, 1fr) auto; }
.xp--voice .xp__head { grid-row: 1 / span 2; }
.rewrite { display: flex; flex-direction: column; justify-content: center; }
.rewrite__head { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--mod); margin: 0; font-size: 12px; font-weight: 500; color: var(--muted); letter-spacing: 0; line-height: calc(var(--mod) * 1.5); }
.rewrite__list { list-style: none; margin: 0; padding: 0; }
.rw { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--mod); width: 100%; text-align: left; background: none; border: 0; border-top: 1px solid var(--line); padding: calc(var(--mod) * .7) 0; min-height: calc(var(--mod) * 4); cursor: pointer; align-items: start; }
.rw s { font-size: 17px; line-height: calc(var(--mod) * 1.25); color: var(--muted); text-decoration-color: var(--red); text-decoration-thickness: 2px; }
.rw span { font-size: 17px; line-height: calc(var(--mod) * 1.25); color: var(--fg); opacity: 0; transform: translateX(calc(var(--mod) * -.5)); transition: opacity var(--t-slow) var(--ease), transform var(--t-slow) var(--ease); }
.rw[aria-pressed="true"] span { opacity: 1; transform: none; }
.rw[aria-pressed="true"] s { opacity: .55; }
.rw:hover span { opacity: .35; }
.rw[aria-pressed="true"]:hover span { opacity: 1; }
.rewrite__all { align-self: flex-start; margin-top: var(--mod); }
.values { grid-column: 1 / span 10; grid-row: 3; list-style: none; margin: 0; padding: 0; counter-reset: v; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--mod); }
.values li { border-top: 1px solid var(--line); padding-top: calc(var(--mod) * .5); counter-increment: v; min-height: calc(var(--dial) - var(--mod)); }
.values li::before { content: counter(v, decimal-leading-zero); display: block; font-family: var(--pixel); font-weight: 700; color: var(--accent-text); font-size: 13px; line-height: var(--mod); margin-bottom: calc(var(--mod) * .5); }
.values h3 { margin: 0; font-size: 18px; font-weight: 500; line-height: var(--mod); letter-spacing: -0.02em; }
.values p { margin: calc(var(--mod) * .25) 0 0; font-size: 14px; line-height: var(--mod); color: var(--muted); }

/* ------------------------------------------------------------------ 08 art */
.xp--art .display--l { font-size: calc(var(--mod) * 2.6); line-height: calc(var(--mod) * 2.6); }
.art__stage { grid-column: 5 / span 4 !important; display: grid; place-items: center; }
.art__side { grid-column: 9 / -1; display: flex; flex-direction: column; gap: var(--mod); }
.poster { position: relative; height: 100%; max-width: 100%; aspect-ratio: 4 / 5; overflow: hidden; background: var(--paper); box-shadow: 0 0 0 1px var(--line); }
.poster__cv { position: absolute; inset: 0; width: 100%; height: 100%; }
.art-read { margin: 0; font-family: var(--display); font-weight: 700; font-size: calc(var(--mod) * 1.5); line-height: calc(var(--mod) * 1.5); letter-spacing: -0.005em; min-height: calc(var(--mod) * 3); }
.art-type { margin: 0; font-size: 13px; line-height: var(--mod); color: var(--muted); }
.meet { flex: 1; min-height: calc(var(--mod) * 4); border: 1px solid var(--line); position: relative; overflow: hidden; }
.meet canvas { display: block; width: 100%; height: 100%; cursor: pointer; outline: none; }
/* Meet, the pattern game on the Section pattern */
.tg__hud { display: flex; align-items: baseline; gap: var(--mod); margin: 0; font-variant-numeric: tabular-nums; }
.tg__hud p { margin: 0; white-space: nowrap; }
.tg__hud b { font-family: var(--pixel); font-weight: 700; font-size: calc(var(--mod) * 1.1); line-height: 1; letter-spacing: 0; }
.tg__of { color: var(--muted); font-size: 12px; }
.tg__time.is-low b { color: var(--red); }
.tg__boardbtn { margin-left: auto; }
.tg__over { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--mod); pointer-events: none; }
.tg__over > * { pointer-events: auto; }
.tg__go { width: calc(var(--mod) * 4.4); height: calc(var(--mod) * 4.4); border-radius: 50%; border: 0; background: var(--red); color: var(--paper); font: 500 13px/1 var(--sans); letter-spacing: 0; cursor: pointer;
  box-shadow: 0 0 0 calc(var(--mod) * .5) rgba(209, 43, 39, .14); transition: transform var(--t-fast) var(--ease-std), box-shadow var(--t-fast) var(--ease-std); }
.tg__go:hover { transform: scale(1.05); box-shadow: 0 0 0 calc(var(--mod) * .8) rgba(209, 43, 39, .18); }
.tg__go:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; }
.tg__go[hidden] { display: none; }
.tg__panel { width: min(88%, calc(var(--mod) * 17)); max-height: 70%; overflow: auto; background: var(--paper); border: 1px solid var(--ink); padding: calc(var(--mod) * .8); font-size: 13px; line-height: 1.45; }
.tg__panel[hidden] { display: none; }
.tg__title { margin: 0 0 4px; font-family: var(--display); font-weight: 700; font-size: calc(var(--mod) * 1.3); line-height: 1.05; letter-spacing: -0.008em; }
.tg__text { margin: 0 0 calc(var(--mod) * .6); color: var(--fg); }
.tg__sub { margin: calc(var(--mod) * .6) 0 4px; font-size: 12px; font-weight: 500; color: var(--muted); }
.tg__name { display: flex; gap: 6px; }
.tg__name input { flex: 1; min-width: 0; height: calc(var(--mod) * 1.6); border: 0; border-bottom: 1px solid var(--ink); background: none; font: inherit; color: var(--fg); padding: 0; }
.tg__name input:focus { outline: none; border-bottom-color: var(--red); }
.tg__name .btn { height: calc(var(--mod) * 1.6); }
.tg__board { list-style: none; margin: 0; padding: 0; font-variant-numeric: tabular-nums; }
.tg__board li { display: grid; grid-template-columns: 2.2em 1fr 2.8em 4em; gap: 6px; border-top: 1px solid var(--line); padding: 3px 0; }
.tg__board li span:first-child { color: var(--muted); }
.tg__board li span:last-child { text-align: right; font-weight: 500; }
.tg__board li b { font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tg__board li.is-new { color: var(--red); }
.tg__empty { margin: 0; color: var(--muted); }
.tg__count { position: absolute; inset: 0; margin: 0; display: grid; place-items: center; font-family: var(--display); font-weight: 700; font-size: calc(var(--mod) * 7); line-height: 1; color: var(--red); pointer-events: none; background: rgba(245, 244, 241, .55); }
.tg__count[hidden] { display: none; }
.tg__count.is-tick { animation: tg-tick .9s var(--ease-friction, cubic-bezier(.1,.7,.2,1)) both; }
@keyframes tg-tick { from { transform: scale(1.35); opacity: 0; } 25% { opacity: 1; } to { transform: scale(1); opacity: 1; } }
.tg__flash { position: absolute; right: calc(var(--mod) * .5); top: calc(var(--mod) * .4); font: 500 13px/1 var(--sans); color: var(--red); pointer-events: none; animation: tg-flash .9s ease-out both; }
@keyframes tg-flash { from { transform: translateY(6px); opacity: 0; } 20% { opacity: 1; } to { transform: translateY(-10px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .tg__count.is-tick, .tg__flash { animation: none; } }
.art__side .note { margin: 0; line-height: var(--mod); }

/* ------------------------------------------------------------------ 09 codex */
.ch--codex .ch__xp { background: #070707; }
.codex__cv { position: absolute; inset: 0; width: 100%; height: 100%; background: #070707; touch-action: none; }
.xp--codex { position: relative; pointer-events: none; grid-template-rows: auto minmax(0, 1fr) auto; }
.xp--codex > * { pointer-events: auto; }
.codex__title { color: var(--paper); }
.codex__exp { margin: calc(var(--mod) * .5) 0 0; font-size: 13px; line-height: var(--mod); color: #BDBCB9; letter-spacing: 0; }
.codex__about { margin: calc(var(--mod) * .5) 0 0; font-size: 14px; line-height: var(--mod); color: rgba(245, 244, 241, .78); max-width: 34ch; }
.codex__log { grid-row: 2; align-self: end; margin: 0; font-family: var(--dot); font-weight: 700; font-size: 12px; line-height: calc(var(--mod) * .8); letter-spacing: 0; color: rgba(245, 244, 241, 0.62); white-space: pre; overflow: hidden; max-height: 100%; pointer-events: none; }
.codex__hud { grid-column: 1 / span 4; grid-row: 3; align-self: end; margin: 0; font-size: 12px; line-height: var(--mod); color: #BDBCB9; letter-spacing: 0; }
/* A control plate, not a form: one bordered panel holding labelled modules,
   each module a segmented "switch" (silkscreen label above, buttons in a
   pill strip below) — the reference is the Braun/Teenage Engineering rail
   chapter 07 already names in its own spec, not the plain wrapped checkboxes
   this used to be. */
.codex__rail { grid-column: 5 / span 6; grid-row: 2 / span 2; align-self: end;
  display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: calc(var(--mod) * .9) var(--mod);
  background: rgba(12, 12, 12, .82); backdrop-filter: blur(10px);
  border: 1px solid rgba(245, 244, 241, .14); border-radius: 10px;
  padding: calc(var(--mod) * 1) calc(var(--mod) * 1.1) calc(var(--mod) * 1); }
.codex__rail .seg { flex-direction: column; align-items: stretch; gap: 0; }
.codex__rail .seg legend { float: none; display: block; width: auto; font-family: var(--sans); font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .12em; line-height: 1; color: rgba(245, 244, 241, .45); margin: 0; padding: 0 0 calc(var(--mod) * .5); }
/* a fieldset's legend is not a flex item, so the gap above never reached it: the space under the label has to be its own padding */
.codex__rail .seg__row { display: flex; flex-wrap: wrap; gap: 3px; background: rgba(245, 244, 241, .05); border: 1px solid rgba(245, 244, 241, .14); border-radius: 8px; padding: 3px; }
.codex__rail .seg button, .codex__rail .seg__file span { flex: 1; justify-content: center; border: 0; border-radius: 5px; background: none; color: rgba(245, 244, 241, .68); height: calc(var(--mod) * 1.5); font-size: 12px; transition: background-color var(--t-fast) var(--ease-std), color var(--t-fast) var(--ease-std); }
.codex__rail .seg button:hover { color: var(--paper); }
.codex__rail .seg button[aria-pressed="true"], .codex__rail .seg__file.is-on span { background: var(--red); color: var(--paper); }
.codex__rail .seg--exp { grid-column: 1 / -1; }
.codex__rail .seg--exp .seg__row { flex-wrap: nowrap; }
.codex__rail .seg--exp button { flex: 1 1 0; padding: 0; }
.codex__rail .seg[data-codex="palette"] .seg__row { flex-wrap: nowrap; }
.codex__rail .seg[data-codex="palette"] button { flex: 1 1 0; padding: 0; }
.codex__rail .seg[data-codex="render"] .seg__row, .codex__rail .seg[data-codex="source"] .seg__row { flex-wrap: nowrap; }
.codex__rail .seg[data-codex="render"] button { flex: 1 1 0; padding: 0; }
.codex__btns { gap: calc(var(--mod) * .6); }
/* three rows of modules and no divider: experiment / render + palette / source + the three actions.
   Each label has its own padding underneath (see .seg legend) and each row its own air. */
@media (min-width: 900px) {
  .codex__rail .seg[data-codex="render"] { grid-column: 1 / span 2; grid-row: 2; }
  .codex__rail .seg[data-codex="palette"] { grid-column: 3 / -1; grid-row: 2; }
  .codex__rail .seg[data-codex="source"] { grid-column: 1 / span 2; grid-row: 3; }
  .codex__btns { grid-column: 3 / -1; grid-row: 3; align-self: end; justify-content: stretch; }
}
.seg--dark button, .seg--dark .seg__file span { border-color: rgba(245, 244, 241, 0.22); }
.btn--dark { color: var(--paper); height: calc(var(--mod) * 1.6); padding: 0 calc(var(--mod) * .5); }
.ch--codex.no-webgl .codex__cv { background: #070707 url("../mockups/codex-01.png") center / cover; }

/* ------------------------------------------------------------------ 10 applications */
/* A parts index, not a carousel: a numbered, category-grouped list next to
   one large flat preview. The stage has the full width to itself (the old
   "Name a document" tool was dropped — the spec side already covers the
   numbering system in full). Everything here is flat on purpose: a previous
   version put the business card in a rotating preserve-3d ring, and browsers
   rasterize that kind of element into a lower-resolution backing layer on
   non-retina screens, softening live text no font-size fix could undo. A
   plain image, or two absolutely-stacked faces cross-fading by opacity,
   never enters that code path. Click the preview to open the lightbox. */
.apps__stage { display: grid; grid-template-columns: minmax(180px, 0.8fr) minmax(0, 1.4fr); gap: calc(var(--mod) * 1.6); min-height: 0; }
.apps__idx { min-height: 0; margin: 0; padding-right: calc(var(--mod) * .6); overflow-y: auto; overflow-x: hidden; scrollbar-width: thin; }
.apps__cat { margin: calc(var(--mod) * 1.1) 0 calc(var(--mod) * .2); font-size: 12px; font-weight: 500; color: var(--muted); letter-spacing: 0; line-height: var(--mod); }
.apps__cat:first-child { margin-top: 0; }
.apps__idx button { display: flex; align-items: baseline; gap: calc(var(--mod) * .6); width: 100%; text-align: left; background: none; border: 0; border-top: 1px solid var(--line); padding: calc(var(--mod) * .55) 0; cursor: pointer; }
.apps__no { font-family: var(--pixel); font-weight: 700; font-size: 12px; color: var(--muted); width: calc(var(--mod) * 1.3); flex: none; }
.apps__t { font-size: 14px; line-height: calc(var(--mod) * 1.1); transition: color var(--t-base) var(--ease); }
.apps__idx button:hover .apps__t, .apps__idx button.is-cur .apps__t { color: var(--accent-text); }
.apps__idx button.is-cur .apps__no { color: var(--accent-text); }
.apps__preview { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.apps__viewport { position: relative; flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center;
  background: var(--paper); border: 1px solid var(--line); box-shadow: 0 24px 50px -30px rgba(0, 0, 0, .5); }
.apps__frame { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; padding: calc(var(--mod) * .8);
  border: 0; background: none; cursor: zoom-in; }
.apps__img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; }
.apps__flip { position: absolute; right: calc(var(--mod) * .6); bottom: calc(var(--mod) * .6); z-index: 2;
  background: var(--ink); color: var(--paper); border: 0; border-radius: 3px; padding: 0 calc(var(--mod) * .6); height: calc(var(--mod) * 1.8);
  font-size: 12px; font-weight: 500; cursor: pointer; }
.apps__flip:hover { opacity: .82; }
.apps__caption { margin: calc(var(--mod) * .6) 0 0; font-size: 12px; color: var(--muted); letter-spacing: 0; line-height: var(--mod); text-align: center; }
/* the card's own text scales off its own rendered width (container query
   units), not the viewport, so it stays proportionate at any preview size */
/* .apps__frame is a real <button>, whose UA default text-align: center would
   otherwise be inherited by every line of card copy below */
.card2d { position: relative; width: min(90%, 620px); aspect-ratio: 85 / 55; container-type: inline-size; text-align: left; }
.card2d__face { position: absolute; inset: 0; padding: 6%; box-shadow: 0 1px 0 var(--line), 0 24px 40px -30px rgba(19, 19, 19, 0.6); transition: opacity .25s var(--ease); }
.card2d__front { background: var(--paper); color: var(--ink); border: 1px solid var(--line); opacity: 1; }
.card2d__word { width: 32%; color: var(--ink); }
.card2d__block { position: absolute; left: 6%; bottom: 6%; display: flex; flex-direction: column; gap: 0.6em; }
.card2d__who { margin: 0; font-size: clamp(11px, 3.6cqi, 22px); line-height: 1.4; }
.card2d__who b { font-weight: 500; }
.card2d__how { margin: 0; font-size: clamp(9px, 2.7cqi, 17px); line-height: 1.45; font-weight: 300; letter-spacing: 0; }
.card2d__spec { position: absolute; right: 6%; bottom: 6%; margin: 0; font-size: clamp(7px, 2cqi, 12px); line-height: 1.4; text-align: right; color: var(--n500); letter-spacing: 0; }
.card2d__back { background: var(--red); overflow: hidden; opacity: 0; pointer-events: none; }
.card2d.is-back .card2d__front { opacity: 0; pointer-events: none; }
.card2d.is-back .card2d__back { opacity: 1; pointer-events: auto; }
/* mirrors the front face: wordmark top-left there, mark top-right here */
.card2d__mark { position: absolute; width: 36%; top: 8%; right: 8%; }
.card2d__subs { position: absolute; left: 6%; bottom: 6%; margin: 0; color: var(--paper); font-size: clamp(9px, 2.6cqi, 16px); line-height: 1.4; }
@media (max-width: 899px) {
  /* .xp switches to a flex column with height: auto below this breakpoint
     (see the 899px block further down), so percentage row heights here
     would resolve against an undefined height — cap the index directly */
  .apps__stage { display: flex; flex-direction: column; gap: var(--mod); }
  .apps__idx { max-height: 44vh; }
  .apps__viewport { flex: none; height: 50vh; }
}

/* ------------------------------------------------------------------ 11 close */
.xp--close .xp__head { grid-column: 1 / span 5; }
.close__text { grid-column: 1 / span 8; grid-row: 2 / span 2; }
.contact { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--mod); margin: 0; }
.contact div { border-top: 1px solid var(--line); padding-top: calc(var(--mod) * .4); }
.contact dt { font-size: 12px; color: var(--muted); line-height: var(--mod); }
.contact dd { margin: 0; font-size: 15px; line-height: var(--mod); }
.riddle { margin: 0 0 calc(var(--mod) * 2); font-family: "Apsis Dot", var(--display); font-weight: 700; font-size: 22px; line-height: calc(var(--mod) * 1.5); letter-spacing: -0.005em; color: rgba(245, 244, 241, 0.5); }
.copy { font-size: 12px; color: var(--muted); margin: var(--mod) 0 0; line-height: var(--mod); }

/* ------------------------------------------------------------------ spec side (always paper), on the same columns */
.ch__spec {
  --bg: var(--paper); --fg: var(--ink); --muted: var(--n500); --line: rgba(19, 19, 19, 0.14); --accent: var(--red); --accent-text: var(--red); --btn-fg: var(--paper);
  position: absolute; inset: 0; z-index: 20; background: var(--paper); color: var(--ink); overflow-y: auto; overscroll-behavior: contain;
  padding: var(--top) var(--m) calc(var(--dial) + var(--mod) * 4);
  transform: translateY(101%); visibility: hidden;
  transition: transform var(--t-slow) var(--ease), visibility 0s linear var(--t-slow);
}
.spec-open .ch.is-active .ch__spec { transform: none; visibility: visible; transition: transform var(--t-slow) var(--ease), visibility 0s; }
.spec-open { --wm: var(--ink); --wm-accent: var(--red); }
.spec-open .bar, .spec-open .dial { --fg: var(--ink); --bg: var(--paper); --line: rgba(19, 19, 19, 0.14); --muted: var(--n500); --accent: var(--red); color: var(--ink); }
.spec-open .bar { background: var(--paper); }
.sheet { max-width: none; }
.sheet__head { display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); gap: var(--mod); align-items: baseline; border-bottom: 1px solid var(--ink); padding-bottom: calc(var(--mod) * .6); margin-bottom: calc(var(--mod) * 2); }
.sheet__no { grid-column: 1; margin: 0; font-family: var(--pixel); font-weight: 700; font-size: calc(var(--mod) * 1.5); color: var(--red); }
.sheet__title { grid-column: 2 / -1; margin: 0; font-family: var(--display); font-weight: 700; font-size: calc(var(--mod) * 3); line-height: calc(var(--mod) * 3.5); letter-spacing: -0.008em; }
.sheet__sub { margin: calc(var(--mod) * 2.5) 0 calc(var(--mod) * .8); font-size: 24px; font-weight: 500; line-height: 1.25; }
.sheet h3 { font-size: 20px; font-weight: 500; line-height: 1.25; margin: 0 0 8px; }
.sheet h4 { font-size: 16px; font-weight: 500; margin: 0 0 6px; }
.sheet p, .sheet li { max-width: 68ch; }
.sheet ul, .sheet ol { padding-left: 1.2em; margin: 0; }
.sheet li { margin-bottom: 6px; }
.sheet .lede { margin-top: 0; }
.cols { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--mod); margin-bottom: var(--mod); }
.col-3 { grid-column: span 3; } .col-4 { grid-column: span 4; } .col-5 { grid-column: span 5; } .col-6 { grid-column: span 6; } .col-7 { grid-column: span 7; }
@media (max-width: 899px) { .col-3, .col-4, .col-5, .col-6, .col-7 { grid-column: 1 / -1; } .sheet__head { grid-template-columns: auto 1fr; } .sheet__no { grid-column: 1; } .sheet__title { grid-column: 2; font-size: calc(var(--mod) * 2.2); line-height: 1; } }
.stack > * + * { margin-top: 14px; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 1.45; font-variant-numeric: tabular-nums; }
.tbl th, .tbl td { text-align: left; vertical-align: top; padding: 8px 12px 9px 0; border-top: 1px solid var(--line); }
.tbl thead th { font-weight: 400; color: var(--muted); font-size: 12px; border-top: 1px solid var(--ink); letter-spacing: 0; }
.tbl tbody th { font-weight: 500; }
.tbl--keys td:first-child { white-space: nowrap; }
.tbl--exp tbody th { white-space: nowrap; width: 11em; }
.tbl--palette .sw { display: inline-block; width: 28px; height: 28px; border: 1px solid var(--line); vertical-align: middle; }
.tbl--matrix td { font-weight: 500; }
.tbl--matrix .g-fail { color: var(--n500); font-weight: 300; }
.tbl--matrix .g-AAA { background: rgba(72, 71, 157, 0.07); }
.board { display: grid; gap: var(--mod); margin: calc(var(--mod) * 1.2) 0; }
.board--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.board--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.board--misuse { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.board figure, .mock-grid figure, .codex-shots figure, .skin, .doc-fig { margin: 0; }
.board figcaption, .mock-grid figcaption, .codex-shots figcaption, .skin figcaption, .doc-fig figcaption { font-size: 13px; color: var(--n500); margin-top: 6px; letter-spacing: 0; }
.board img, .doc-fig img { width: 100%; height: auto; }
.doc-fig img { border: 1px solid var(--line); }
.frame { border: 1px solid var(--line); background: var(--paper); aspect-ratio: 4 / 3; display: grid; place-items: center; padding: 8%; }
.frame img { max-height: 100%; object-fit: contain; }
.frame--red { background: var(--red); border-color: var(--red); }
@media (max-width: 899px) { .board--3, .board--4, .board--misuse { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.scales h4 { margin: 20px 0 6px; font-size: 13px; font-weight: 500; }
.scale { display: grid; grid-template-columns: repeat(auto-fit, minmax(72px, 1fr)); }
.chip { padding: 10px 8px 8px; font-size: 11px; line-height: 1.35; letter-spacing: 0; min-height: 76px; }
.chip b { display: block; font-weight: 600; }
.dd { display: grid; grid-template-columns: 1fr 1fr; gap: var(--mod); }
.dd blockquote { margin: 0 0 10px; padding: 10px 12px; border-left: 2px solid var(--ink); font-size: 14px; }
.dd > div:last-child blockquote { border-left-color: var(--red); color: var(--n500); text-decoration: line-through; text-decoration-color: var(--red); }
blockquote.note { margin: 6px 0 0; }
.specimen-text { font-size: calc(var(--mod) * 4.5); font-weight: 300; line-height: 0.9; margin: 0; letter-spacing: -0.015em; }
.specimen-display { font-family: var(--display); font-weight: 700; font-size: calc(var(--mod) * 3.8); line-height: 0.96; margin: 0; letter-spacing: -0.01em; }
.sheet > .lede { max-width: 48em; margin-bottom: calc(var(--mod) * 2); }
.specimen-schwa { display: flex; flex-direction: column; margin: 0; font-family: var(--display); font-weight: 700; font-size: calc(var(--mod) * 3); line-height: 1; letter-spacing: -0.008em; }
.specimen-schwa i { font-style: normal; color: var(--red); }
.specimen-schwa .ss01, .ss01 { font-feature-settings: "ss01"; }
.kit-line { display: flex; flex-direction: column; margin: 0 0 24px; font-family: "Apsis Kit"; font-size: 28px; line-height: 1; letter-spacing: 0; color: var(--ink); overflow: hidden; white-space: nowrap; }
.weights p { margin: 0; padding: 6px 0; border-top: 1px solid var(--line); font-size: 22px; display: flex; gap: 16px; align-items: baseline; }
.weights span { font-size: 12px; color: var(--n500); width: 96px; flex: none; font-weight: 400; letter-spacing: 0; }
.skins-spec { display: grid; gap: 0; margin: 16px 0 24px; }
.skin { display: grid; grid-template-columns: 200px auto; align-items: baseline; border-top: 1px solid var(--line); padding: 6px 0; }
.skin figcaption { order: -1; margin: 0; }
.skin__art { margin: 0; font-size: 64px; line-height: 1; font-weight: 700; letter-spacing: -0.008em; white-space: nowrap; box-shadow: 1px 0 0 var(--red); width: max-content; max-width: 100%; overflow: hidden; }
.manifesto--spec { font-size: 17px; }
.manifesto__thesis { font-size: 26px; line-height: 1.25; font-weight: 500; letter-spacing: -0.01em; margin: 0 0 20px; }
.manifesto__lines { padding-left: 1.6em !important; margin-bottom: 16px !important; }
.filename { font-size: 22px; font-weight: 500; letter-spacing: -0.01em; margin: 0; }
.filename span { color: var(--purple); }
.mock-grid, .codex-shots { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--mod); margin-top: calc(var(--mod) * 1.2); }
.codex-shots { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.mock-grid img, .codex-shots img { width: 100%; height: auto; border: 1px solid var(--line); }
@media (max-width: 899px) { .mock-grid, .codex-shots { grid-template-columns: 1fr 1fr; } .dd { grid-template-columns: 1fr; } }

/* ------------------------------------------------------------------ below 900 px: one column, chapters scroll inside */
@media (max-width: 899px) {
  .ch__xp { overflow-y: auto; -webkit-overflow-scrolling: touch; padding-bottom: calc(var(--dial) + var(--mod) * 2); }
  .xp { height: auto; min-height: var(--content-h); display: flex; flex-direction: column; gap: var(--mod); }
  .xp__head { order: 1; } .xp__stage, .tl, .nt, .pull, .rewrite { order: 2; } .xp__side { order: 3; } .xp__rail { order: 4; } .xp__text, .inuse, .values, .subs, .mf-lines { order: 5; }
  .display--xl { font-size: calc(var(--mod) * 2.7); line-height: calc(var(--mod) * 2.6); }
  .display--l, .xp--art .display--l { font-size: calc(var(--mod) * 2); line-height: calc(var(--mod) * 1.9); }
  .xp__rail { align-self: auto; }
  .logo__stage, .spinner { height: 44vh; }
  .poster { height: 56vh; margin: 0 auto; }
  .colour__stage { grid-template-rows: calc(var(--mod) * 7) auto; }
  .contrast { grid-template-columns: 1fr; } .contrast__pick, .contrast__out { grid-column: auto; }
  .curves { grid-template-rows: none; grid-template-columns: repeat(3, minmax(0, 1fr)); } .curve svg { height: calc(var(--mod) * 4); flex: none; }
  .tl__out { min-height: calc(var(--mod) * 6); }
  .tl__ctrl { grid-template-columns: 1fr; } .tl__ctrl > * { grid-column: 1 / -1 !important; }
  .nt__ctrl { grid-template-columns: 1fr; } .nt__ctrl > * { grid-column: 1 / -1 !important; }
  .nt__stage { min-height: calc(var(--mod) * 8); }
  .inuse, .values, .mf-lines { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .inuse .use:last-child, .values li:last-child { grid-column: 1 / -1; }
  .subs { grid-template-columns: 1fr; }
  .pull__a, .pull__b { font-size: calc(var(--mod) * 1.8); line-height: calc(var(--mod) * 2); white-space: normal; }
  .pull__mid { height: calc(var(--mod) * 3.6 * min(var(--t), 1)); }
  .pull__txt { font-size: calc(var(--mod) * 1.1); line-height: calc(var(--mod) * 1.4); white-space: normal; text-align: center; }
  .rw { grid-template-columns: 1fr; } .rw span { opacity: 1; transform: none; } .rewrite__head { display: none; }
  .apps__no { width: calc(var(--mod) * 1.1); }
  .contact { grid-template-columns: 1fr 1fr; }
  .codex__rail { grid-template-columns: 1fr; } .codex__rail > * { grid-column: 1 / -1 !important; }
  .codex__log { display: none; }
  .xp--codex { min-height: var(--content-h); justify-content: space-between; }
  .art__side .meet, .art__side .tg__hud, .art__side [data-tg="note"] { display: none; }  /* Meet needs a pointer and room: desktop only */
}

/* ------------------------------------------------------------------ reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 1ms !important; animation-duration: 1ms !important; }
}
.codex__btns { flex-wrap: nowrap; }
.codex__rail .seg__file { flex: 1 1 0; min-width: 0; }
.codex__rail .seg__file span { width: 100%; }
.codex__rail .codex__btns .btn { width: auto; flex: 1; height: calc(var(--mod) * 1.5 + 8px); }
.codex__rail .seg button, .codex__rail .seg__file span { padding: 0 calc(var(--mod) * .32); font-size: 12px; }
