/* =====================================================================
   book.css: Rhett Brewer's portfolio as a blueprint book.
   One page you scroll through: a cover, his face and a short bio,
   contents, four chapters (Hexapod, 3D Simulation, Robot Joint,
   RC Plane), skills, contact. The sheets lie one after another and
   the page scrolls normally; the desk shows between them, with trim
   marks at the seams.

   Documented in .claude/skills/blueprint-book-design (look) and
   .claude/skills/book-scroll-motion (mechanics + animation).
   Mechanics and animation hooks live in js/book.js.

   Mode classes on <html> (set by the inline head script, then js/book.js):
     .js        JavaScript runs
     .mo        motion allowed: pending (not-yet-revealed) states apply
     .rm        prefers-reduced-motion: nothing pending, nothing moves
     .paper-bm  the paper tooth is drawn from bitmaps (book.js makePaper)
   Without JS none of these is set: the same stack of sheets, fully drawn.
   Every pending state below is scoped to html.mo, so no-JS and reduced
   motion always show the finished drawing.
   ===================================================================== */

/* ------------------------------------------------------------------ 1. TOKENS */
:root {
  /* the desk under the book (seen at the spine, the fore-edge and in the seams between sheets) */
  --desk: #061A33;

  /* paper: every page is a cyanotype sheet; each chapter has its own blue family,
     openers are a deeper exposure, and tones b/c vary sheet to sheet */
  --pp-cover: #0C2950;      /* boards: front and back cover */
  --pp-front: #123A6E;      /* title page: face + bio */
  --pp-contents: #10346A;
  --pp-1-open: #143379;     /* 1 Hexapod: ultramarine */
  --pp-1: #1A4290;
  --pp-1b: #183D86;
  --pp-1c: #1D4796;
  --pp-2-open: #0A3350;     /* 2 3D Simulation: teal-leaning Prussian */
  --pp-2: #0B3A5A;
  --pp-2b: #0E4262;
  --pp-2c: #0A3654;
  --pp-3-open: #1A2C66;     /* 3 Robot Joint: indigo steel */
  --pp-3: #1F3878;
  --pp-3b: #23407F;
  --pp-3c: #1C3470;
  --pp-4-open: #134476;     /* 4 RC Plane: cerulean, the lightest family */
  --pp-4: #1A5088;
  --pp-4b: #1D5790;
  --pp-4c: #174A80;
  --pp-end: #0F3060;        /* skills (data-ch="end") */
  --pp-end-b: #14386C;      /* contact (data-ch="end" data-tone="b"): skills and contact never share a paper */
  --well: #081E3E;          /* inside a media frame before its picture loads */
  --paper-white: #E6ECEF;   /* uncoated paper: the portrait mount, the tissue guard */

  /* line and lettering (ink-2 is >= 4.8:1 on the lightest paper, --pp-4b) */
  --ink: #EEF5FF;           /* body text, heavy line */
  --ink-2: #B9D3F3;         /* secondary text, captions, labels */
  --line: #D8E8FF;          /* drawing line, frames */
  --line-2: #8EB3E6;        /* construction lines, rules, ticks (non-text only) */
  --hair: rgba(216, 232, 255, .16);
  --ghost: rgba(216, 232, 255, .17);   /* opener ghost drawings */

  /* the only warm colours, each with one job */
  --accent: #FFC24B;        /* results only: measured numbers, PASS, "it walks" */
  --redline: #FFB8A8;       /* struck-out decisions and corrections only */

  /* cyanotype tone curve for prints (photos and video before they develop) */
  --cy-dark: #0D3A8C;
  --cy-light: #D4E4FF;

  /* type */
  --f-disp: "Barlow Condensed", "Arial Narrow", "Helvetica Neue", sans-serif;
  --f-body: "IBM Plex Serif", Georgia, "Times New Roman", serif;
  --f-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --t-mega: clamp(68px, 10.5vw, 164px);   /* chapter opener title */
  --t-h1: clamp(46px, 6.2vw, 92px);       /* title page name, contents heading */
  --t-h2: clamp(30px, 3.3vw, 46px);       /* sheet title */
  --t-lede: clamp(19px, 1.45vw, 22px);
  --t-body: 18px;
  --t-small: 15.5px;
  --t-cap: 13.5px;                         /* mono captions, table data */
  --t-label: 11.5px;                       /* mono labels (aria-hidden furniture may go to 10.5) */
  --lh: 1.55;
  --measure: 34em;

  /* line weights (CSS px and SVG user units match at 1:1) */
  --lw-hair: 1px;           /* rules, ticks, grid */
  --lw: 1.5px;              /* borders, table rules, frames */
  --lw-heavy: 2px;          /* drawing outlines, strike lines */
  --lw-out: 3px;            /* the heavy outline that marks the output / the subject */

  /* spacing */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px; --s8: 72px;
  /* page side padding; on a very wide window (above about 1900 px) it grows so the content stays
     about 1700 px wide instead of running rows and leaders across 2400 px */
  --pad-x: max(clamp(18px, 4.4vw, 68px), calc((100vw - 1760px) / 2));
  --pad-top: 60px;                          /* room for the running head */
  --pad-bot: 68px;                          /* room for the folio */
  --tap: 44px;

  /* book geometry */
  --spine: 22px;            /* left strip: the binding and the stack of read pages */
  --edge: 30px;             /* right strip: the fore-edge and the thumb index */
  --gap: clamp(36px, 3.4vw, 52px);   /* the desk between two sheets (the seam) */

  /* motion */
  --ease: cubic-bezier(.65, 0, .35, 1);     /* drafting: lines that draw */
  --ease-out: cubic-bezier(.2, .7, .2, 1);  /* things that land */
  --ease-io: cubic-bezier(.45, 0, .25, 1);  /* prints developing */

  color-scheme: dark;
}

/* ------------------------------------------------------------------ 2. BASE */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; background: var(--desk); }
body {
  margin: 0;
  background: var(--desk);
  color: var(--ink);
  font: 400 var(--t-body)/var(--lh) var(--f-body);
  font-variant-numeric: lining-nums;
}
img, video, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
p { margin: 0 0 .8em; }
h1, h2, h3, h4 { margin: 0; font-weight: 700; }
button { font: inherit; color: inherit; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.nobr { white-space: nowrap; }
.skip { position: fixed; left: 12px; top: -80px; z-index: 200; padding: 12px 16px; background: var(--ink); color: var(--pp-cover); font: 600 14px var(--f-mono); }
.skip:focus { top: 12px; }
.defs { position: absolute; width: 0; height: 0; overflow: hidden; }

/* ------------------------------------------------------------------ 3. THE BOOK AND ITS PAGES */
.book {
  position: relative;
  isolation: isolate;
  z-index: 1;
  padding: 0 var(--edge) var(--gap) var(--spine);
  overflow-x: clip;          /* nothing ever makes a sideways scroll */
}
/* a sheet is as tall as its content (only the cover fills the window). It clips what runs off its
   edges (an opener's ghost), as a sheet of paper would. */
.page {
  --paper: var(--pp-1);
  position: relative;
  isolation: isolate;
  display: flow-root;
  overflow: clip;
  padding: var(--pad-top) var(--pad-x) var(--pad-bot);
  background-color: var(--paper);
  color: var(--ink);
  scroll-margin-top: 0;      /* a jump to a sheet lands with its top edge at the top of the window */
}
.page [id] { scroll-margin-top: 28px; }   /* a jump to something inside a sheet leaves it some room */
/* book.js keeps the reader's place itself when something above them changes height (keepPlace). The
   browser's own scroll anchoring skipped corrections whenever its anchor was moving by transform as it
   drew in (a frame's zone band, a reveal): opened at #joint, the page jumped 60 px down when the OpenArm
   figure above mounted its controls. Both at once would correct twice, so the browser's is off. */
html { overflow-anchor: none; }
.page + .page { margin-top: var(--gap); }   /* no JS: the desk shows between sheets (with JS, the .seam does) */

/* paper per chapter (data-ch) and per sheet (data-tone) */
.page[data-ch="front"] { --paper: var(--pp-front); }
.page[data-ch="front"][data-tone="b"] { --paper: var(--pp-contents); }
.page[data-ch="1"] { --paper: var(--pp-1); }
.page[data-ch="1"][data-tone="b"] { --paper: var(--pp-1b); }
.page[data-ch="1"][data-tone="c"] { --paper: var(--pp-1c); }
.page[data-ch="2"] { --paper: var(--pp-2); }
.page[data-ch="2"][data-tone="b"] { --paper: var(--pp-2b); }
.page[data-ch="2"][data-tone="c"] { --paper: var(--pp-2c); }
.page[data-ch="3"] { --paper: var(--pp-3); }
.page[data-ch="3"][data-tone="b"] { --paper: var(--pp-3b); }
.page[data-ch="3"][data-tone="c"] { --paper: var(--pp-3c); }
.page[data-ch="4"] { --paper: var(--pp-4); }
.page[data-ch="4"][data-tone="b"] { --paper: var(--pp-4b); }
.page[data-ch="4"][data-tone="c"] { --paper: var(--pp-4c); }
.page[data-ch="end"] { --paper: var(--pp-end); }
.page[data-ch="end"][data-tone="b"] { --paper: var(--pp-end-b); }
.page.opener[data-ch="1"] { --paper: var(--pp-1-open); }
.page.opener[data-ch="2"] { --paper: var(--pp-2-open); }
.page.opener[data-ch="3"] { --paper: var(--pp-3-open); }
.page.opener[data-ch="4"] { --paper: var(--pp-4-open); }
.page.cover { --paper: var(--pp-cover); }

/* cyanotype exposure: fine paper tooth + slow blotches of uneven coating.
   Static SVG noise, never animated. js/book.js offsets the blotches per page (--bx) so no
   two pages carry the same mottling. */
.page::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .86 0 0 0 0 .93 0 0 0 0 1 1.5 0 0 0 -.74'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)'/%3E%3C/svg%3E"),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='900' height='900'%3E%3Cfilter id='b'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.0045' numOctaves='3' seed='7' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .01 0 0 0 0 .05 0 0 0 0 .16 1.6 0 0 0 -.7'/%3E%3C/filter%3E%3Crect width='900' height='900' filter='url(%23b)'/%3E%3C/svg%3E");
  background-size: 300px 300px, 900px 900px;
  background-position: var(--tx, 0 0), var(--bx, 0 0);
  opacity: .55;
}
.page.opener::before, .page.cover::before { opacity: .8; }
/* the same tooth and blotches as bitmaps, once book.js has drawn them (makePaper): the SVG turbulence
   is rendered again at every raster of a page */
.paper-bm .page::before { background-image: var(--pp-tooth), var(--pp-blot); }

/* the gutter: the binding edge of every page (two rules, the inner one dark) */
.page::after {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 10px;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(90deg, rgba(2, 10, 24, .6) 0 1px, transparent 1px 5px, rgba(216, 232, 255, .18) 5px 6px, transparent 6px);
}

/* ------------------------------------------------------------------ 4. BACKGROUNDS (data-bg) */
/* never the same ground on two pages in a row (book.js warns in the console if you do) */
.page[data-bg="grid"] {        /* drafting grid: 24 px minor, 120 px major */
  background-image:
    linear-gradient(rgba(216,232,255,.13) 1px, transparent 1px),
    linear-gradient(90deg, rgba(216,232,255,.13) 1px, transparent 1px),
    linear-gradient(rgba(216,232,255,.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(216,232,255,.05) 1px, transparent 1px);
  background-size: 120px 120px, 120px 120px, 24px 24px, 24px 24px;
  background-position: -1px -1px;
}
.page[data-bg="fine"] {        /* fine graph: 10 px, 50 px emphasis */
  background-image:
    linear-gradient(rgba(216,232,255,.09) 1px, transparent 1px),
    linear-gradient(90deg, rgba(216,232,255,.09) 1px, transparent 1px),
    linear-gradient(rgba(216,232,255,.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(216,232,255,.045) 1px, transparent 1px);
  background-size: 50px 50px, 50px 50px, 10px 10px, 10px 10px;
}
.page[data-bg="coarse"] {      /* coarse graph: 32 / 160 px */
  background-image:
    linear-gradient(rgba(216,232,255,.15) 1px, transparent 1px),
    linear-gradient(90deg, rgba(216,232,255,.15) 1px, transparent 1px),
    linear-gradient(rgba(216,232,255,.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(216,232,255,.06) 1px, transparent 1px);
  background-size: 160px 160px, 160px 160px, 32px 32px, 32px 32px;
}
.page[data-bg="iso"] {         /* isometric construction grid (30, 150, 90 degrees): exploded views */
  background-image:
    repeating-linear-gradient(30deg, transparent 0 33px, rgba(216,232,255,.085) 33px 34px),
    repeating-linear-gradient(150deg, transparent 0 33px, rgba(216,232,255,.085) 33px 34px),
    repeating-linear-gradient(90deg, transparent 0 38.26px, rgba(216,232,255,.05) 38.26px 39.26px);
}
.page[data-bg="dots"] {        /* dot grid: pages of photos and video */
  background-image: radial-gradient(circle, rgba(216,232,255,.24) 1.1px, transparent 1.6px);
  background-size: 22px 22px;
  background-position: 11px 11px;
}
.page[data-bg="ledger"] {      /* ledger rules with a double margin rule: lists, tables, skills */
  background-image:
    linear-gradient(90deg, transparent calc(var(--pad-x) + 76px), rgba(216,232,255,.32) calc(var(--pad-x) + 76px) calc(var(--pad-x) + 77px), transparent calc(var(--pad-x) + 77px) calc(var(--pad-x) + 81px), rgba(216,232,255,.32) calc(var(--pad-x) + 81px) calc(var(--pad-x) + 82px), transparent calc(var(--pad-x) + 82px)),
    linear-gradient(rgba(216,232,255,.09) 1px, transparent 1px);
  background-size: 100% 100%, 100% 46px;
}
.page[data-bg="laid"] {        /* laid paper: fine laid lines and wide chain lines (the title page) */
  background-image:
    linear-gradient(90deg, rgba(216,232,255,.085) 1px, transparent 1px),
    linear-gradient(rgba(216,232,255,.035) 1px, transparent 1px);
  background-size: 128px 100%, 100% 4px;
}
.page[data-bg="polar"] {       /* polar construction: circles and rays about --px --py (mapping, rotation) */
  background-image:
    repeating-radial-gradient(circle at var(--px, 70%) var(--py, 55%), transparent 0 79px, rgba(216,232,255,.1) 79px 80px),
    repeating-conic-gradient(from 0deg at var(--px, 70%) var(--py, 55%), rgba(216,232,255,.07) 0 .25deg, transparent .25deg 15deg);
}
.page[data-bg="folds"] {       /* fold creases: a sheet that was folded in thirds and in half */
  background-image:
    linear-gradient(90deg, transparent calc(33.33% - 1px), rgba(255,255,255,.07) calc(33.33% - 1px) 33.33%, rgba(3,14,31,.32) 33.33% calc(33.33% + 1px), transparent calc(33.33% + 1px)),
    linear-gradient(90deg, transparent calc(66.66% - 1px), rgba(255,255,255,.07) calc(66.66% - 1px) 66.66%, rgba(3,14,31,.32) 66.66% calc(66.66% + 1px), transparent calc(66.66% + 1px)),
    linear-gradient(transparent calc(50% - 1px), rgba(255,255,255,.07) calc(50% - 1px) 50%, rgba(3,14,31,.32) 50% calc(50% + 1px), transparent calc(50% + 1px));
}
.page[data-bg="plain"] { background-image: none; }
/* plate mark: the dent a printing plate leaves around one big figure (two offset hairlines) */
.page[data-mark="plate"] { box-shadow: inset 0 0 0 18px var(--paper), inset 0 0 0 19px rgba(216,232,255,.22), inset 0 0 0 23px var(--paper), inset 0 0 0 24px rgba(2,10,24,.35); }
/* the cover: a cloth board (fine weave), foil double rule, hinge groove near the spine */
.page.cover {
  background-image:
    repeating-linear-gradient(0deg, rgba(216,232,255,.035) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(90deg, rgba(2,10,24,.18) 0 1px, transparent 1px 3px);
}
.cover-rule { position: absolute; inset: 22px 22px 22px 46px; border: 1.5px solid rgba(216,232,255,.5); outline: 1px solid rgba(216,232,255,.28); outline-offset: 5px; pointer-events: none; }
.cover-hinge { position: absolute; left: 22px; top: 0; bottom: 0; width: 6px; border-left: 1px solid rgba(2,10,24,.6); border-right: 1px solid rgba(216,232,255,.16); pointer-events: none; }

/* ------------------------------------------------------------------ 5. FURNITURE (built by book.js) */
/* running head: top of every page except covers and openers */
.rhead, .folio {
  position: absolute;
  left: var(--pad-x);
  right: var(--pad-x);
  z-index: 3;
  display: flex;
  align-items: center;
  gap: var(--s4);
  font: 500 var(--t-label)/1.2 var(--f-mono);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-2);
  pointer-events: none;
}
.rhead { top: 20px; justify-content: space-between; padding-bottom: 9px; }
.rhead::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: rgba(142,179,230,.45); transform-origin: 0 50%; }
.folio { bottom: 20px; }
.folio .f-no { font: 600 15px/1 var(--f-mono); color: var(--ink); letter-spacing: .04em; min-width: 2ch; text-transform: none; }   /* front matter keeps lowercase roman (ii), as the thumb tab (i) */
.folio .f-name { white-space: nowrap; }
.opener .folio .f-name, .cover .folio { display: none; }

/* drawing frame (openers): outer border, zone band (numbers right to left, letters bottom
   to top, skipping I O Q), centre marks. Built by book.js into .frame on data-frame="zones". */
.frame { position: absolute; inset: 12px 12px 12px 18px; z-index: 0; pointer-events: none; }
.frame .fb { position: absolute; background: var(--line-2); }
.frame .fb.t, .frame .fb.b { left: 0; right: 0; height: 1px; }
.frame .fb.l, .frame .fb.r { top: 0; bottom: 0; width: 1px; }
.frame .fb.t { top: 0; transform-origin: 0 50%; } .frame .fb.b { bottom: 0; transform-origin: 100% 50%; }
.frame .fb.l { left: 0; transform-origin: 50% 100%; } .frame .fb.r { right: 0; transform-origin: 50% 0; }
.frame .fi { position: absolute; background: var(--line); }
.frame .fi.t, .frame .fi.b { left: 22px; right: 22px; height: 2px; }
.frame .fi.l, .frame .fi.r { top: 22px; bottom: 22px; width: 2px; }
.frame .fi.t { top: 22px; transform-origin: 0 50%; } .frame .fi.b { bottom: 22px; transform-origin: 100% 50%; }
.frame .fi.l { left: 22px; transform-origin: 50% 100%; } .frame .fi.r { right: 22px; transform-origin: 50% 0; }
.frame .zn { position: absolute; display: grid; place-items: center; width: 22px; height: 22px; font: 500 10.5px/1 var(--f-mono); color: var(--ink-2); letter-spacing: 0; }   /* lettering: ink-2, never line-2 */
.frame .zt { position: absolute; background: var(--line-2); }
.frame .cm { position: absolute; width: 0; height: 0; border: 6px solid transparent; }
.frame .cm.t { top: 22px; left: 50%; margin-left: -6px; border-top-color: var(--line); }
.frame .cm.b { bottom: 22px; left: 50%; margin-left: -6px; border-bottom-color: var(--line); }
.frame .cm.l { left: 22px; top: 50%; margin-top: -6px; border-left-color: var(--line); }
.frame .cm.r { right: 22px; top: 50%; margin-top: -6px; border-right-color: var(--line); }
.page[data-frame="zones"] { --pad-x: clamp(46px, 5vw, 80px); --pad-top: 56px; --pad-bot: 62px; }
.page[data-frame="zones"] .folio { bottom: 40px; }

/* the spine and the fore-edge (built by book.js): the read pages stack up at the spine and the unread
   ones thin out on the right as the reader scrolls, so the edges are the reading progress. A scroll
   timeline drives them where the browser has one (.by-scroll); otherwise book.js writes the same transforms. */
.edges { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
.edges span { position: absolute; top: 8px; bottom: 8px; overflow: hidden; }
.edges .e-l { left: 0; width: var(--spine); }
.edges .e-r { right: 0; width: var(--edge); }
.edges i { position: absolute; inset: 0; background: repeating-linear-gradient(90deg, rgba(142,179,230,.55) 0 1px, transparent 1px 3px); will-change: transform; }
.edges .e-l i { transform: translateX(-100%); }
.edges .e-l::after { content: ""; position: absolute; right: 0; top: 0; bottom: 0; width: 2px; background: rgba(2,10,24,.7); }
@keyframes edge-l { from { transform: translateX(-100%); } to { transform: none; } }
@keyframes edge-r { from { transform: none; } to { transform: translateX(100%); } }
.edges.by-scroll .e-l i { animation: edge-l linear both; animation-timeline: scroll(root block); }
.edges.by-scroll .e-r i { animation: edge-r linear both; animation-timeline: scroll(root block); }

/* thumb index: chapter tabs cut into the fore-edge; the current chapter's tab steps out */
.thumb { position: fixed; z-index: 60; right: 0; top: 50%; transform: translateY(-50%); }
.thumb ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 3px; }
.thumb a {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  width: var(--edge);
  padding: 9px 0 10px;
  border: 1px solid var(--line-2);
  border-right: 0;
  background: var(--tab, var(--pp-cover));
  color: var(--ink);
  text-decoration: none;
  transition: transform .35s var(--ease-out), background-color .35s, color .35s;
}
.thumb a::before { content: ""; position: absolute; top: 0; bottom: 0; right: 0; width: var(--tap); }  /* 44 px hit area */
.thumb b { font: 600 12px/1 var(--f-mono); }
.thumb span { writing-mode: vertical-rl; font: 500 11.5px/1 var(--f-mono);   /* reads top to bottom, like a spine */ letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; }
.thumb a[data-ch="front"] { --tab: var(--pp-front); }
.thumb a[data-ch="1"] { --tab: var(--pp-1); }
.thumb a[data-ch="2"] { --tab: var(--pp-2); }
.thumb a[data-ch="3"] { --tab: var(--pp-3); }
.thumb a[data-ch="4"] { --tab: var(--pp-4); }
.thumb a[data-ch="end"] { --tab: var(--pp-end); }
.thumb a[href="#contact"] { --tab: var(--pp-end-b); }
/* a short window (phone landscape, 200% zoom): the tabs keep only their number or letter, so all of
   them fit; the name stays for screen readers */
@media (max-height: 660px) {
  .thumb ol { gap: 2px; }
  .thumb a { padding: 0; min-height: var(--tap); justify-content: center; }
  .thumb span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}
.thumb a[aria-current] { transform: translateX(-9px); background: var(--ink); color: var(--pp-cover); border-color: var(--ink); }
.thumb a:hover { background-color: color-mix(in srgb, var(--tab, var(--pp-cover)) 80%, white); }
.thumb a[aria-current]:hover { background: var(--ink); }

/* ------------------------------------------------------------------ 6. TYPE */
.kicker { display: flex; align-items: center; gap: var(--s3); margin: 0 0 var(--s4); font: 500 12px/1.2 var(--f-mono); letter-spacing: .2em; text-transform: uppercase; color: var(--ink-2); }
.kicker::before { content: ""; width: 46px; height: 1.5px; background: var(--line); transform-origin: 0 50%; flex: none; }
.label { font: 500 var(--t-label)/1.3 var(--f-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-2); }
.lede { font-size: var(--t-lede); line-height: 1.45; max-width: 30em; }
.measure { max-width: var(--measure); }
.small { font-size: var(--t-small); }
.sheet-title {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin: 0 0 var(--s5);
  font: 700 var(--t-h2)/.98 var(--f-disp);
  text-transform: uppercase;
  letter-spacing: .02em;
}
.sheet-no { font: 600 13px/1 var(--f-mono); letter-spacing: .08em; border: 1.5px solid var(--line); padding: 6px 7px 5px; transform: translateY(-5px); }
em, i { font-style: italic; }
strong, b { font-weight: 500; }

/* layout helpers: asymmetric columns, never rows of identical boxes */
.cols { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: var(--s5) clamp(24px, 4.5vw, 72px); align-items: start; }
.cols.flip { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
.cols.mid { align-items: center; }
.stack > * + * { margin-top: var(--s5); }

/* ------------------------------------------------------------------ 7. COVER (the header) */
.cover-body { position: relative; min-height: calc(100svh - var(--pad-top) - var(--pad-bot)); display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); grid-template-rows: auto 1fr auto; grid-template-areas: "kick kick" "name emblem" "dim tblock"; gap: var(--s5) 5vw; }
.cover { --pad-x: clamp(56px, 6vw, 96px); --pad-top: 52px; --pad-bot: 52px; }
.cover-kicker { grid-area: kick; display: flex; justify-content: space-between; gap: var(--s4); padding-bottom: var(--s3); border-bottom: 1.5px solid var(--line); margin: 0; font: 500 12px/1.2 var(--f-mono); letter-spacing: .28em; text-transform: uppercase; color: var(--ink-2); }
.cover-name { grid-area: name; align-self: center; margin: 0; }
.cover-name svg { width: 100%; height: auto; max-height: 52svh; overflow: visible; }
.cover-line { margin: var(--s4) 0 0; font-size: var(--t-lede); line-height: 1.4; max-width: 24em; }
.cover-emblem { grid-area: emblem; align-self: center; justify-self: center; width: min(100%, 520px); }
.cover-emblem svg { width: 100%; height: auto; overflow: visible; }
.cover-dim { grid-area: dim; align-self: end; }
.cover-tblock { grid-area: tblock; align-self: end; justify-self: end; width: min(100%, 360px); }
.cover-cue { position: absolute; left: 50%; bottom: 18px; z-index: 3; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 8px; margin: 0; font: 500 11px/1 var(--f-mono); letter-spacing: .24em; text-transform: uppercase; color: var(--ink-2); pointer-events: none; }
.cover-cue i { display: block; width: 1.5px; height: 28px; background: var(--ink); transform-origin: 50% 0; }
/* the cue draws itself twice (4.4 s, under WCAG's 5 s for motion without a pause button); it ends drawn */
.mo .cover .cover-cue i { animation: cue 2.2s var(--ease) 2; }
@keyframes cue { 0% { transform: scaleY(0); } 55%, 100% { transform: scaleY(1); } }
.back-body { min-height: calc(100svh - var(--pad-top) - var(--pad-bot)); display: grid; place-content: center; justify-items: center; text-align: center; gap: var(--s3); }
.back-body svg { width: min(70vw, 520px); height: auto; overflow: visible; }

/* big lettering (cover name, opener numerals): SVG text, outline drawn, then the fill floods in */
.letter text { font-family: var(--f-disp); font-weight: 700; fill: var(--ink); stroke: var(--ink); stroke-width: 1.4; stroke-linejoin: round; }
.letter.hatch text { fill: url(#hatch); stroke-width: 2.2; }
.letter.outline text { fill: none; }
.mo .letter:not(.in) text { fill-opacity: 0; stroke-dasharray: 1100; stroke-dashoffset: 1100; }
.mo .letter text { stroke-dasharray: 1100; }
.mo .letter.in text { fill-opacity: 1; stroke-dashoffset: 0; transition: stroke-dashoffset 1.2s var(--ease), fill-opacity .7s ease 1.1s; }
.mo .letter.in text + text { transition-delay: .25s, 1.35s; }
/* once drawn, the outline is a plain stroke: no dash pattern left to show a gap (a glyph whose outline
   ran past the dash, or a draw a background tab paused, read as a broken letter) */
.mo .letter.drawn text { stroke-dasharray: none; transition: none; }

/* ------------------------------------------------------------------ 8. TITLE PAGE: face + bio */
.title-body { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: clamp(28px, 6vw, 96px); align-items: center; min-height: calc(100svh - var(--pad-top) - var(--pad-bot)); }
.bio-name { margin: 0 0 var(--s5); font: 700 var(--t-h1)/.86 var(--f-disp); text-transform: uppercase; letter-spacing: .01em; }
.bio { font-size: var(--t-lede); line-height: 1.5; max-width: 28em; }

/* the portrait: a print mounted on uncoated paper with photo corners; it develops into colour */
.fig-portrait { order: 2; margin: 0; justify-self: center; width: min(100%, 400px); }
.mount { position: relative; padding: 18px 18px 46px; background: var(--paper-white); }
.mount .print { position: relative; aspect-ratio: 4 / 5; }
.mount .corner { position: absolute; width: 34px; height: 34px; z-index: 3; background: var(--pp-cover); }
.mount .corner.c1 { left: 8px; top: 8px; clip-path: polygon(0 0, 100% 0, 0 100%); }
.mount .corner.c2 { right: 8px; top: 8px; clip-path: polygon(0 0, 100% 0, 100% 100%); }
.mount .corner.c3 { left: 8px; bottom: 36px; clip-path: polygon(0 0, 100% 100%, 0 100%); }
.mount .corner.c4 { right: 8px; bottom: 36px; clip-path: polygon(100% 0, 100% 100%, 0 100%); }
.mount .mount-cap { position: absolute; left: 0; right: 0; bottom: 13px; margin: 0; text-align: center; font: 500 11px/1 var(--f-mono); letter-spacing: .2em; text-transform: uppercase; color: var(--pp-cover); }
/* the tissue guard: vellum over the print, hinged at the top; it lifts away when the print is first seen */
.tissue { position: absolute; inset: 0 0 28px; z-index: 5; display: flex; align-items: flex-end; justify-content: center; padding: 22px; background: rgba(222, 234, 248, .74); border-top: 1px solid rgba(12,41,80,.35); transform-origin: 50% 0; pointer-events: none; font: 600 11px/1.3 var(--f-mono); letter-spacing: .28em; text-transform: uppercase; color: var(--pp-cover); }
.tissue::before { content: ""; position: absolute; left: 0; right: 0; top: 10px; border-top: 1px dashed rgba(12,41,80,.3); }
.rm .tissue, html:not(.js) .tissue { display: none; }
.mo .tissue { transition: transform 1.3s var(--ease), opacity .4s ease 1.1s; }
.tissue.lift { transform: perspective(2600px) rotateX(92deg); opacity: 0; }

/* ------------------------------------------------------------------ 9. CONTENTS (the sheet index) */
.contents-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(240px, 300px); grid-template-areas: "h h" "toc side"; gap: 0 clamp(28px, 5vw, 80px); padding-left: clamp(0px, 6vw, 110px); }
.contents-h { grid-area: h; margin: 0 0 4vh; font: 700 var(--t-h1)/.85 var(--f-disp); text-transform: uppercase; letter-spacing: .02em; }
.toc { grid-area: toc; list-style: none; margin: 0; padding: 0; border-top: 1.5px solid var(--line); }
.toc li { border-bottom: 1px solid rgba(142,179,230,.45); }
.toc a { display: grid; grid-template-columns: 4.6em minmax(0, auto) minmax(24px, 1fr) 3em; column-gap: 14px; align-items: start; min-height: var(--tap); padding: 12px 6px 11px; text-decoration: none; }
.toc a:hover { background: rgba(216,232,255,.06); }
.toc-no { font: 500 12px/1.9 var(--f-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-2); }
.toc-t { font: 700 clamp(22px, 2.2vw, 30px)/1.05 var(--f-disp); text-transform: uppercase; letter-spacing: .03em; }
.toc-t em { display: block; margin-top: 4px; font: italic 400 15px/1.35 var(--f-body); text-transform: none; letter-spacing: 0; color: var(--ink-2); }
.toc-lead { height: 1.05em; border-bottom: 2px dotted var(--line-2); transform-origin: 0 50%; }
.toc-pg { font: 600 18px/1.3 var(--f-mono); text-align: right; }
.toc-side { grid-area: side; align-self: end; }
.lof h3, .notes h3 { margin: 0 0 10px; font: 600 12px/1 var(--f-mono); letter-spacing: .2em; text-transform: uppercase; color: var(--ink-2); }
.lof ol { list-style: none; margin: 0 0 var(--s6); padding: 0; border-top: 1.5px solid var(--line); }
.lof li { border-bottom: 1px dashed rgba(142,179,230,.5); }
.lof a { display: flex; align-items: center; gap: 10px; min-height: var(--tap); text-decoration: none; font: 400 15px/1.25 var(--f-body); }
.lof a span { flex: none; white-space: nowrap; min-width: 5.4em; font: 600 11px var(--f-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); }
.lof a b { margin-left: auto; font: 600 13px var(--f-mono); }
/* general notes: the legend of the book's conventions (clouds, amber, strikes) */
.notes ol { margin: 0; padding: 0 0 0 1.6em; font: 400 13.5px/1.5 var(--f-mono); color: var(--ink-2); }
.notes li + li { margin-top: 6px; }
.notes li::marker { color: var(--ink); font-weight: 600; }
/* the legend's own revision cloud: a word inside a small plotted cloud (svg.plot data-plot="in" with one
   .pl path), so the legend is not itself counted as a missing fact */
.lg-cloud { position: relative; display: inline-block; margin: 0 3px 5px 2px; padding: 1px 10px; color: var(--ink); }
.lg-cloud svg { position: absolute; left: -2px; top: -4px; width: calc(100% + 4px); height: calc(100% + 8px); overflow: visible; pointer-events: none; }
.lg-cloud .pl { stroke: var(--ink); stroke-width: 1.3; }
.mo .toc:not(.in) li { opacity: 0; transform: translateX(-14px); }
.mo .toc.in li { transition: opacity .35s calc(var(--i, 0) * 70ms), transform .45s var(--ease-out) calc(var(--i, 0) * 70ms); }
.mo .toc:not(.in) .toc-lead { transform: scaleX(0); }
.mo .toc.in .toc-lead { transition: transform .7s var(--ease) calc(120ms + var(--i, 0) * 60ms); }
.mo .toc:not(.in) .toc-pg { opacity: 0; }
.mo .toc.in .toc-pg { transition: opacity .25s calc(400ms + var(--i, 0) * 60ms); }

/* ------------------------------------------------------------------ 10. CHAPTER OPENER */
.opener-body { position: relative; z-index: 2; min-height: calc(100svh - var(--pad-top) - var(--pad-bot)); display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: 1fr auto; align-items: end; gap: 0 clamp(16px, 2.5vw, 40px); }
.opener-no { margin: 0; align-self: end; display: flex; flex-direction: column; align-items: flex-start; }
.opener-no .label { padding-left: 6px; letter-spacing: .5em; }
.numeral { height: min(54svh, 500px); width: auto; overflow: visible; }
.numeral text { font-size: 300px; }
.opener-text { align-self: end; max-width: 36em; padding-bottom: 2vh; }
.ch-title { margin: 0 0 var(--s4); font: 700 var(--t-mega)/.82 var(--f-disp); text-transform: uppercase; letter-spacing: .005em; }
.ch-sub { font-size: var(--t-lede); line-height: 1.38; max-width: 24em; }
.sheet-list { list-style: none; margin: var(--s3) 0 0; padding: 0; max-width: 440px; border-top: 1.5px solid var(--line); }
.sheet-list li { border-bottom: 1px solid rgba(142,179,230,.45); }
.sheet-list a { display: flex; align-items: center; gap: 12px; min-height: var(--tap); text-decoration: none; font: 500 13.5px/1.2 var(--f-mono); letter-spacing: .06em; text-transform: uppercase; }
.sheet-list a span { min-width: 3em; color: var(--ink-2); }
.sheet-list a b { margin-left: auto; font-weight: 600; }
.sheet-list a:hover { background: rgba(216,232,255,.06); }
.opener .tblock.corner { position: absolute; z-index: 3; right: 36px; bottom: 36px; width: 300px; }
/* between phone and wide desktop the corner title block would sit on the sheet list (its last rows and
   page numbers could not be clicked): there it drops below the text, on the right, and the opener body
   no longer holds a window's height for it */
@media (min-width: 761px) and (max-width: 1180px) {
  .opener > .opener-body { min-height: 0; }
  .opener .tblock.corner { position: relative; right: auto; bottom: auto; width: 300px; margin: var(--s4) 0 0 auto; }
}
.opener-body.has-media { grid-template-columns: auto minmax(0, .95fr) minmax(0, 1.05fr); }
.opener-body.has-media .ch-title { font-size: clamp(56px, 7.2vw, 124px); }
.opener-media { align-self: end; margin-bottom: 2vh; }
/* ghost: a big faint drawing of the chapter's subject, running off the page, plotted by scroll */
.ghost { position: absolute; z-index: 1; pointer-events: none; }
.ghost svg { width: 100%; height: 100%; overflow: visible; }
/* `.ghost .plot` outranks section 12's `.plot .pl` / `.plot .pl.cl` / `.plot .pl.hid` (which come later),
   so ghosts stay faint; `.wet` (the stroke the pen is drawing) is last so it wins over every class */
.ghost .plot .pl { stroke: var(--ghost); stroke-width: 1.6; transition: stroke .9s; }
.ghost .plot .pl.thin { stroke-width: 1.2; }
.ghost .plot .pl.cl, .ghost .plot .pl.hid, .ghost .plot .pl.dimx, .ghost .plot .pl.sec { stroke: rgba(142,179,230,.24); stroke-width: 1; }
.ghost .plot .pl.dot, .ghost .plot .pl.ah { fill: var(--ghost); }
.ghost .plot .pl.trace { stroke: rgba(216,232,255,.34); stroke-width: 2; }
.ghost .plot .pl.fan-p { fill: rgba(216,232,255,.05); }
/* the ghost lies behind the opener's text, and with a plain scroll a reader can stop with it half plotted:
   at full --line the stroke being drawn read as a rule struck through the words ("about $2,500"), so the
   wet stroke and the pen over a ghost are only a little brighter than the dry lines */
.ghost .plot .pl.wet { stroke: rgba(216,232,255,.4); }
.ghost .pen.on { opacity: .45; }
.ghost-right { right: -13vw; top: 50%; width: min(78vw, 1180px); aspect-ratio: 6 / 5; translate: 0 -50%; }   /* translate, not transform: data-scrub-* owns transform */
.ghost-full { inset: 0; }

/* ------------------------------------------------------------------ 11. FIGURES: photo, video, portrait, reserved, strip */
.fig { position: relative; margin: 0; min-width: 0; }
.fig-frame { position: relative; aspect-ratio: var(--ar, 16 / 9); background: var(--well); }
.print { position: absolute; inset: 0; overflow: hidden; overflow: clip; isolation: isolate; background: var(--well); }
.print > img, .print > video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.fig[data-contain] .print > img, .fig[data-contain] .print > video { object-fit: contain; }
/* the cyanotype print: book.js lays a copy of the photo (or of a video's poster) on top, under a
   static SVG filter (#cyano). Developing slides it away from the top down, its top edge drawn as a
   tide line. Transforms only; the filter is never animated; no mix-blend-mode (it made every
   scroll and transform over it a compositor stall). */
.cy { position: absolute; inset: 0; z-index: 2; overflow: hidden; pointer-events: none; transition: transform 1.5s var(--ease-io); }
/* the tide line rides on a pseudo-element: a border would push the copy 2px down and let the colour photo show along the top */
.cy::before { content: ""; position: absolute; z-index: 1; left: 0; right: 0; top: 0; height: 2px; background: transparent; }
.cy-in { position: absolute; inset: 0; transition: transform 1.5s var(--ease-io); }
.cy img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: url(#cyano); }
.fig[data-contain] .cy img { object-fit: contain; }
.print.dev .cy { transform: translateY(100%); }
.print.dev .cy::before { background: rgba(242, 247, 255, .85); }
.print.dev .cy-in { transform: translateY(-100%); }
.print.dev-done .cy { display: none; }   /* developed: the copy leaves the page entirely */
.rm .cy, .rm .cy-in { transition: none; }
/* frame lines overshoot the corners like construction lines; registration marks at two corners */
.fe { position: absolute; z-index: 4; background: var(--line); pointer-events: none; }
.fe.t { top: -1px; left: -12px; right: -12px; height: 1.5px; transform-origin: 0 50%; }
.fe.r { right: -1px; top: -12px; bottom: -12px; width: 1.5px; transform-origin: 50% 0; }
.fe.b { bottom: -1px; left: -12px; right: -12px; height: 1.5px; transform-origin: 100% 50%; }
.fe.l { left: -1px; top: -12px; bottom: -12px; width: 1.5px; transform-origin: 50% 100%; }
.reg { position: absolute; z-index: 4; width: 18px; height: 18px; border: 1px solid var(--line-2); border-radius: 50%; pointer-events: none; }
.reg::before, .reg::after { content: ""; position: absolute; background: var(--line-2); }
.reg::before { left: 50%; top: -6px; bottom: -6px; width: 1px; transform: translateX(-.5px); }
.reg::after { top: 50%; left: -6px; right: -6px; height: 1px; transform: translateY(-.5px); }
.reg.r1 { top: -30px; right: -30px; }
.reg.r2 { bottom: -30px; left: -30px; }
html:not(.js) .fig-frame { outline: 1.5px solid var(--line); }
/* Without JS a video shows its poster (decision D3): the chapter writes style="--poster:url(media/NAME.webp)"
   on the .fig-frame. The rule that paints it lives in an inline <style> in tools/book-template.html (and
   tools/try-book.html), not here: a url() carried in a custom property resolves against the stylesheet
   that uses var(), and from css/ "media/NAME.webp" would point at css/media/. */
/* dimension line: extension ticks at both ends, arrowheads, a label that says something useful
   (duration, speed-up, reach). Never pixel sizes of a photo. */
.dim { position: relative; display: flex; align-items: center; gap: 10px; margin: 0 0 10px; padding: 0 1px; font: 500 11px/1 var(--f-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2);
  background: linear-gradient(var(--line-2), var(--line-2)) left center / 1px 16px no-repeat, linear-gradient(var(--line-2), var(--line-2)) right center / 1px 16px no-repeat; }
.dim::before, .dim::after { content: ""; flex: 1; height: 1px; background: var(--line-2); }
.dim::before { transform-origin: 100% 50%; }
.dim::after { transform-origin: 0 50%; }
.dim > span { white-space: nowrap; }
.dim .ah { position: absolute; top: 50%; width: 0; height: 0; margin-top: -4px; border-top: 4px solid transparent; border-bottom: 4px solid transparent; }
.dim .ah.l { left: 1px; border-right: 9px solid var(--line-2); }
.dim .ah.r { right: 1px; border-left: 9px solid var(--line-2); }
.mo .dim:not(.in)::before, .mo .dim:not(.in)::after { transform: scaleX(0); }
.mo .dim:not(.in) > span, .mo .dim:not(.in) .ah { opacity: 0; }
.mo .dim.in::before, .mo .dim.in::after { transition: transform .6s var(--ease) .1s; }
.mo .dim.in > span, .mo .dim.in .ah { transition: opacity .3s .45s; }
/* caption */
figcaption { margin-top: var(--s3); font: 400 var(--t-cap)/1.45 var(--f-mono); color: var(--ink-2); }
.fig-no { margin-right: 8px; font: 600 12px/1 var(--f-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--ink); }
.fig-no:empty { display: none; }
.tab-no { margin-right: 8px; font: 600 12px/1 var(--f-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--ink); }
/* video controls: a real button and a ruler that is the timeline */
.fig-ctl { display: grid; grid-template-columns: auto minmax(0, 1fr) 7.4ch; align-items: center; gap: 14px; margin-top: 14px; }
.fig-ctl:empty { display: none; }
.play {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: var(--tap);
  min-height: var(--tap);
  padding: 0 13px;
  border: 1.5px solid var(--line);
  background: transparent;
  color: var(--ink);
  font: 600 11.5px/1 var(--f-mono);
  letter-spacing: .14em;
  text-transform: uppercase;
  cursor: pointer;
}
.play:hover { background: rgba(216,232,255,.08); }
.play svg { width: 15px; height: 15px; }
.play svg path { fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; }
.play .i-pause, .play.on .i-play { display: none; }
.play.on .i-pause { display: block; }
.ruler { position: relative; height: 34px; border-top: 1px solid var(--line-2); --n: 30; }
.ruler-ticks { position: absolute; inset: 0 0 auto; height: 14px; transform-origin: 0 50%; background-repeat: repeat-x;
  background-image: linear-gradient(90deg, var(--line-2) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1.5px, transparent 1.5px);
  background-size: calc(100% / var(--n)) 6px, calc(100% * var(--major, 10) / var(--n)) 13px; }
.ruler-lbl { position: absolute; top: 17px; left: calc(var(--at, 0) * 100%); transform: translateX(-50%); font: 500 10.5px/1 var(--f-mono); color: var(--ink-2); white-space: nowrap; }
.ruler-lbl.l0 { transform: none; }
.ruler-lbl.end { transform: translateX(-100%); }   /* the end of a recording, flush with the end of the ruler */
.ruler-ptr { position: absolute; left: 0; top: -9px; height: 28px; width: 0; border-left: 1.5px solid var(--ink); z-index: 1; }
.ruler-ptr::before { content: ""; position: absolute; top: 0; left: -5.5px; border-left: 5px solid transparent; border-right: 5px solid transparent; border-top: 7px solid var(--ink); }
.tc { font: 500 12px/1 var(--f-mono); color: var(--ink-2); text-align: right; white-space: nowrap; }
.tc b { color: var(--ink); font-weight: 600; }
/* two scales: video seconds above the line, recorded time below (for sped-up clips) */
.two-scale .ruler { height: 46px; border-top: 0; }
.two-scale .ruler::before { content: ""; position: absolute; left: 0; right: 0; top: 18px; border-top: 1px solid var(--line-2); }
.two-scale .ruler-ticks { top: 5px; height: 13px; background-position: 0 100%; }
.two-scale .ruler-lbl { top: -6px; }
.two-scale .ruler-lbl.rec { top: 27px; color: var(--ink-2); }
.two-scale .ruler-ptr { top: 2px; height: 38px; }
/* callouts: numbered balloons and leaders drawn over a photo (an SVG in the photo's pixel space) */
.callouts { position: absolute; inset: 0; z-index: 5; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.callouts .pl { stroke: var(--ink); stroke-width: 2.2; }
.callouts .pl.bal { fill: var(--paper); stroke-width: 2; }
.callouts .bal-t { font-size: 21px; }
.key { list-style: none; margin: 0 0 var(--s5); padding: 0; display: grid; gap: 8px; font: 500 14px/1.4 var(--f-mono); }
.key li { display: flex; align-items: flex-start; gap: 12px; }
.key-n { flex: none; width: 28px; height: 28px; border: 1.5px solid var(--ink); border-radius: 50%; display: grid; place-items: center; font: 600 13px/1 var(--f-mono); }
/* reserved: a frame waiting for a photo or video that does not exist yet */
.fig-reserved .fig-frame { display: grid; place-items: center; background-color: transparent; background-image:
  linear-gradient(to top right, transparent calc(50% - 1px), rgba(142,179,230,.3) calc(50% - 1px) calc(50% + 1px), transparent calc(50% + 1px)),
  linear-gradient(to bottom right, transparent calc(50% - 1px), rgba(142,179,230,.3) calc(50% - 1px) calc(50% + 1px), transparent calc(50% + 1px)),
  repeating-linear-gradient(-45deg, rgba(142,179,230,.13) 0 1px, transparent 1px 11px); }
.reserved { position: relative; z-index: 2; margin: 0; padding: 14px 18px; max-width: 90%; display: grid; gap: 8px; text-align: center; background: var(--paper); border: 1px solid var(--line-2); }
.reserved-lbl { font: 600 11px/1 var(--f-mono); letter-spacing: .24em; text-transform: uppercase; color: var(--ink-2); }
/* the file a plate waits for is for the builder (tools/placeholders.py reads it for MEDIA.md), not the reader */
.reserved-spec, .ph-spec { display: none; }
/* contact strip: frames cut from a video, printed small, with timecodes */
.strip { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr)); gap: 12px; }
.strip li { position: relative; padding: 6px 6px 26px; border: 1px solid var(--line-2); }
.strip .fig-frame { --ar: 16 / 9; }
.strip .stc { position: absolute; left: 8px; bottom: 7px; font: 500 11px/1 var(--f-mono); letter-spacing: .1em; color: var(--ink-2); }
.strip li::after { content: ""; position: absolute; right: 8px; bottom: 9px; width: 8px; height: 8px; border: 1px solid var(--line-2); border-radius: 50%; }

/* ------------------------------------------------------------------ 12. LINE DRAWINGS (inline SVG, plotted by book.js) */
.plot .pl { fill: none; stroke: var(--line); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.plot .pl.thin { stroke-width: 1.2; }
.plot .pl.heavy { stroke-width: 3; }
.plot .pl.cl { stroke: var(--line-2); stroke-width: 1.1; stroke-dasharray: 16 5 3 5; }     /* centre / chain line */
.plot .pl.hid { stroke: var(--line-2); stroke-width: 1.2; stroke-dasharray: 6 4; }        /* hidden line */
.plot .pl.dimx { stroke: var(--line-2); stroke-width: 1; }                               /* dimension + extension lines */
.plot .pl.lead { stroke-width: 1.3; }
.plot .pl.bal { fill: var(--paper); stroke-width: 1.6; }
.plot .pl.dot, .plot .pl.ah { fill: var(--ink); stroke: none; }
.plot .pl.sec { stroke: var(--line-2); stroke-width: 1; }                                  /* section hatching on cut material */
.plot .pl.out { stroke: var(--accent); stroke-width: 3; }                                  /* a measured result drawn on a figure */
.plot text { font-family: var(--f-mono); fill: var(--ink-2); }
.plot .t-sm { font-size: 13px; font-weight: 500; letter-spacing: .08em; }
.plot .t-xs { font-size: 11px; font-weight: 500; letter-spacing: .1em; }
.plot .t-dim { font-size: 13px; font-weight: 600; fill: var(--ink); }
.plot .bal-t { font-size: 18px; font-weight: 600; fill: var(--ink); }
.pen { opacity: 0; transition: opacity .35s; pointer-events: none; }
.pen.on { opacity: 1; }
.pen .gx, .pen .gy { stroke: var(--line); stroke-width: .8; opacity: .4; stroke-dasharray: 2 4; }
.pen .nib { fill: none; stroke: var(--ink); stroke-width: 1.5; }
.rm .pen, html:not(.js) .pen { display: none; }
/* until book.js has measured a drawing, it shows blank instead of flashing it drawn */
.mo .plot:not(.armed) { visibility: hidden; }

/* ------------------------------------------------------------------ 13. TABLES: datasheet, parts list, revisions, ledger */
.table-wrap { overflow-x: auto; margin-bottom: var(--s5); }   /* bottom only: `.stack > * + *` sets the top */
.table-wrap:focus-visible { outline-offset: 6px; }
.datasheet, .plist, .revs { width: 100%; border-collapse: collapse; font: 400 15.5px/1.35 var(--f-body); }
.datasheet caption, .plist caption, .revs caption { caption-side: top; text-align: left; padding-bottom: 10px; font: 500 12px/1.3 var(--f-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); }
.datasheet thead th, .plist thead th, .revs thead th { padding: 8px 12px 8px 0; text-align: left; font: 500 11px/1.1 var(--f-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-2); border-top: 1.5px solid var(--line); border-bottom: 1px solid var(--line); }
.datasheet tbody th, .plist tbody th, .revs tbody th { text-align: left; font-weight: 500; padding: 9px 12px 9px 0; vertical-align: top; }
.datasheet td, .plist td, .revs td { padding: 9px 12px 9px 0; vertical-align: top; }
.datasheet tbody tr, .plist tbody tr, .revs tbody tr { border-bottom: 1px dashed rgba(142,179,230,.5); }
.datasheet tbody tr:last-child, .revs tbody tr:last-child { border-bottom: 1.5px solid var(--line); }
.datasheet td.num, .datasheet .res { font: 500 14.5px/1.35 var(--f-mono); white-space: nowrap; }
.datasheet .res { color: var(--accent); font-weight: 600; }
.datasheet small, .plist small { display: block; font: italic 400 13.5px/1.3 var(--f-body); color: var(--ink-2); }
.datasheet tr.res-row th { color: var(--accent); }
.plist .fn { width: 2.6em; font: 600 13px/1.35 var(--f-mono); }
.plist .q { font: 500 14px/1.35 var(--f-mono); text-align: right; white-space: nowrap; padding-right: 0; }
.plist tr.sum { border-top: 1.5px solid var(--line); border-bottom: 1.5px solid var(--line); }
.plist tr.sum .q { font: 700 26px/1 var(--f-disp); }
.revs td:first-child { width: 3.6em; }
/* revision delta: the triangle a drawing uses to mark a revision */
.delta { position: relative; display: inline-grid; place-items: end center; width: 30px; height: 26px; padding-bottom: 3px; font: 600 12px/1 var(--f-mono); }
.delta::before { content: ""; position: absolute; inset: 0; background: var(--line); -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 26'%3E%3Cpath d='M15 1.5L28.5 24.5H1.5Z' fill='none' stroke='black' stroke-width='1.6'/%3E%3C/svg%3E") center / 100% 100% no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 26'%3E%3Cpath d='M15 1.5L28.5 24.5H1.5Z' fill='none' stroke='black' stroke-width='1.6'/%3E%3C/svg%3E") center / 100% 100% no-repeat; }
/* skills ledger: each skill points at the chapters that prove it */
.ledger { margin: 0; border-top: 1.5px solid var(--line); }
.ledger > div { display: grid; grid-template-columns: 10em minmax(0, 1fr) 5.4em; gap: 14px; align-items: baseline; padding: 11px 0 10px; border-bottom: 1px solid rgba(142,179,230,.45); }
.ledger dt { font: 700 21px/1.1 var(--f-disp); text-transform: uppercase; letter-spacing: .04em; }
.ledger dd { margin: 0; }
.ledger .xref { font: 500 12.5px/1.2 var(--f-mono); letter-spacing: .08em; color: var(--ink-2); text-align: right; }
.ledger .xref a { display: inline-block; min-width: 2em; padding: 4px 2px; }
.mo [data-in="stagger"]:not(.in) > * { opacity: 0; transform: translateX(-8px); }
.mo [data-in="stagger"].in > * { transition: opacity .35s ease calc(var(--i, 0) * 80ms), transform .4s var(--ease-out) calc(var(--i, 0) * 80ms); }

/* title block: the box in the corner of a drawing. Openers, the cover and contact only. */
.tblock { margin: 0; border: 1.5px solid var(--line); background: var(--paper); font: 500 11.5px/1.25 var(--f-mono); text-transform: uppercase; letter-spacing: .08em; }
.tblock > div { display: grid; grid-template-columns: 7.2em minmax(0, 1fr); }
.tblock > div + div { border-top: 1px solid var(--line-2); }
.tblock dt { padding: 7px 9px; color: var(--ink-2); border-right: 1px solid var(--line-2); }
.tblock dd { margin: 0; padding: 7px 10px; color: var(--ink); overflow-wrap: anywhere; }
.tblock dd.big { font: 700 26px/1 var(--f-disp); letter-spacing: .03em; }
.mo .tblock:not(.in) > div { opacity: 0; }
.mo .tblock.in > div { transition: opacity .3s linear calc(var(--k, 0) * 70ms); }

/* ------------------------------------------------------------------ 14. RESULTS, PLACEHOLDERS, STRUCK-OUT DECISIONS, NOTES */
.result { color: var(--accent); font-weight: 600; background-image: linear-gradient(var(--accent), var(--accent)); background-repeat: no-repeat; background-position: 0 100%; background-size: 100% 1.5px; }
.mo .result:not(.in) { background-size: 0 1.5px; }
.mo .result.in { transition: background-size .8s var(--ease) .4s; }
.pass { display: inline-block; margin-left: 6px; padding: 3px 6px 2px; border: 1.5px solid var(--accent); color: var(--accent); font: 600 11px/1 var(--f-mono); letter-spacing: .14em; text-transform: uppercase; vertical-align: 2px; }
.result-line { margin: var(--s5) 0 0; padding-top: var(--s3); border-top: 1px dashed var(--line-2); font-size: 17px; line-height: 1.5; }
.result-lbl { display: inline-block; margin-right: 8px; padding: 5px 7px 4px; border: 1.5px solid var(--accent); color: var(--accent); font: 600 11px/1 var(--f-mono); letter-spacing: .14em; text-transform: uppercase; transform: translateY(-2px); }
/* placeholder: every missing fact stays visible, inside a revision cloud (drawn by book.js) */
.tbd:where(:not(text, tspan)) { position: relative; display: inline-block; max-width: 100%; margin: 3px 8px; padding: 3px 11px; font: 500 .8em/1.35 var(--f-mono); letter-spacing: .02em; color: var(--ink); vertical-align: baseline; }
.tbd > svg.cl { position: absolute; left: -6px; top: -6px; overflow: visible; pointer-events: none; fill: none; stroke: var(--ink); stroke-width: 1.3; }
html:not(.js) .tbd, .tbd:not(.clouded) { outline: 1.5px dashed var(--line-2); outline-offset: 2px; }
.mo .tbd:not(.in) > svg.cl path { stroke-dashoffset: var(--len, 400); }
.mo .tbd.in > svg.cl path { transition: stroke-dashoffset 1.1s var(--ease-io) .2s; }
/* inside a drawing (<text class="tbd"> / <tspan class="tbd">): book.js lays the cloud as a path right after the text */
.tbd-cl { fill: none; stroke: var(--ink); stroke-width: 1.3; pointer-events: none; }
.mo text.tbd:not(.in) + .tbd-cl { stroke-dashoffset: var(--len, 400); }
.mo text:has(.tbd:not(.in)) + .tbd-cl { stroke-dashoffset: var(--len, 400); }   /* separate rule: a browser without :has() drops only this one */
.mo .tbd-cl { transition: stroke-dashoffset 1.1s var(--ease-io) .2s; }
/* struck-out decision: a redline through what was tried and removed, with the reason */
.struck { margin: var(--s4) 0; padding-left: 14px; border-left: 2px solid var(--redline); }
.struck del { text-decoration: none; color: var(--ink-2); background-image: linear-gradient(var(--redline), var(--redline)); background-repeat: no-repeat; background-position: 0 55%; background-size: 100% 2px; }
.mo .struck:not(.in) del { background-size: 0 2px; }
.mo .struck.in del { transition: background-size .7s var(--ease) .3s; }
.rev-tag { display: inline-block; margin: 0 6px; padding: 3px 6px 2px; border: 1.5px solid var(--redline); color: var(--redline); font: 600 11px/1 var(--f-mono); letter-spacing: .12em; text-transform: uppercase; vertical-align: 2px; }
/* margin note */
.note { margin: var(--s5) 0; padding: 2px 0 2px 14px; border-left: 2px solid var(--line-2); font-style: italic; font-size: var(--t-small); color: var(--ink); max-width: 30em; }
.note::before { content: "Note"; display: block; margin-bottom: 4px; font: 600 11px/1 var(--f-mono); font-style: normal; letter-spacing: .2em; text-transform: uppercase; color: var(--ink-2); }

/* odometer: each digit of a whole number slides up into its window from blank, like a counter drum
   landing; a still frame never shows a wrong digit (never cost, time or percentages) */
.odo { display: inline-flex; vertical-align: baseline; font-variant-numeric: tabular-nums; }
.odo-d { display: inline-block; height: 1.04em; line-height: 1.04em; overflow: hidden; vertical-align: bottom; }
.odo-s { display: block; transform: translateY(0); }
.odo-s::before { content: "\a0\A" attr(data-d); white-space: pre; display: block; line-height: 1.04em; text-align: center; }
.in .odo-s { transform: translateY(-1.04em); transition: transform .8s cubic-bezier(.2, .75, .1, 1); }
.odo-d:nth-last-child(2) .odo-s { transition-delay: .1s; }
.odo-d:nth-last-child(3) .odo-s { transition-delay: .2s; }

/* ------------------------------------------------------------------ 15. GENERIC REVEALS (data-in) */
/* Plain text is never animated: it is there when the sheet comes up. Use data-in on drawn things:
   figures, rules, tables, numbers. Not on paragraphs. */
.mo [data-in=""]:not(.in), .mo [data-in="rise"]:not(.in) { opacity: 0; transform: translateY(10px); }
.mo [data-in=""].in, .mo [data-in="rise"].in { transition: opacity .5s ease var(--delay, 0s), transform .6s var(--ease-out) var(--delay, 0s); }
.mo [data-in="fade"]:not(.in) { opacity: 0; }
.mo [data-in="fade"].in { transition: opacity .6s ease var(--delay, 0s); }
.mo [data-in="wipe"]:not(.in) { clip-path: inset(0 100% 0 0); }
.mo [data-in="wipe"].in { clip-path: inset(0 0 0 0); transition: clip-path .8s var(--ease) var(--delay, 0s); }
.mo [data-in="rule"]:not(.in) { transform: scaleX(0); transform-origin: 0 50%; }
.mo [data-in="rule"].in { transform-origin: 0 50%; transition: transform .8s var(--ease) var(--delay, 0s); }
.mo [data-in="deal"]:not(.in) > * { opacity: 0; transform: translate(-14px, 10px) rotate(-3deg); }
.mo [data-in="deal"].in > * { transition: opacity .35s ease calc(var(--i, 0) * 140ms + var(--delay, 0s)), transform .5s var(--ease-out) calc(var(--i, 0) * 140ms + var(--delay, 0s)); }
.mo .kicker:not(.in)::before { transform: scaleX(0); }
.mo .kicker.in::before { transition: transform .7s var(--ease); }
.mo .page:not(.open) .rhead::after { transform: scaleX(0); }
.mo .page.open .rhead::after { transition: transform .9s var(--ease) .1s; }
/* frames: edges draw clockwise, registration marks turn in, the dimension line extends */
.mo .fig:not(.in) .fe.t, .mo .fig:not(.in) .fe.b { transform: scaleX(0); }
.mo .fig:not(.in) .fe.r, .mo .fig:not(.in) .fe.l { transform: scaleY(0); }
.mo .fig.in .fe { transition: transform .28s var(--ease); }
.mo .fig.in .fe.r { transition-delay: .15s; }
.mo .fig.in .fe.b { transition-delay: .3s; }
.mo .fig.in .fe.l { transition-delay: .45s; }
.mo .fig:not(.in) .reg { opacity: 0; transform: rotate(-120deg) scale(.4); }
.mo .fig.in .reg { transition: opacity .3s .35s, transform .5s var(--ease-out) .35s; }
.mo .fig:not(.in) .ruler-ticks { transform: scaleX(0); }
.mo .fig.in .ruler-ticks { transition: transform .8s var(--ease) .2s; }
.mo .fig-reserved:not(.in) .reserved { opacity: 0; }
.mo .fig-reserved.in .reserved { transition: opacity .4s .3s; }
/* the portrait print is laid on the page, then the photo corners */
/* no fade: the portrait is the book's one eager image (fetchpriority high), and an opacity-0 start would hold back LCP */
.mo .fig-portrait:not(.in) .mount { transform: translateY(14px) rotate(-1.4deg); }
.mo .fig-portrait.in .mount { transition: transform .7s var(--ease); }
.mo .fig-portrait:not(.in) .corner { transform: scale(0); }
.mo .fig-portrait.in .corner { transition: transform .35s var(--ease) .7s; }
.mo .fig-portrait.in .corner.c2 { transition-delay: .8s; } .mo .fig-portrait.in .corner.c3 { transition-delay: .9s; } .mo .fig-portrait.in .corner.c4 { transition-delay: 1s; }
.mount .corner.c1 { transform-origin: 0 0; } .mount .corner.c2 { transform-origin: 100% 0; } .mount .corner.c3 { transform-origin: 0 100%; } .mount .corner.c4 { transform-origin: 100% 100%; }
/* drawing frame on openers */
.mo .page:not(.open) .frame .fb.t, .mo .page:not(.open) .frame .fb.b, .mo .page:not(.open) .frame .fi.t, .mo .page:not(.open) .frame .fi.b { transform: scaleX(0); }
.mo .page:not(.open) .frame .fb.l, .mo .page:not(.open) .frame .fb.r, .mo .page:not(.open) .frame .fi.l, .mo .page:not(.open) .frame .fi.r { transform: scaleY(0); }
.mo .page.open .frame .fb, .mo .page.open .frame .fi { transition: transform .6s var(--ease); }
.mo .page.open .frame .fi.r { transition-delay: .45s; } .mo .page.open .frame .fi.b { transition-delay: .9s; } .mo .page.open .frame .fi.l { transition-delay: 1.35s; }
.mo .page:not(.open) .frame .zn, .mo .page:not(.open) .frame .zt, .mo .page:not(.open) .frame .cm { opacity: 0; }
.mo .page.open .frame .zn, .mo .page.open .frame .zt, .mo .page.open .frame .cm { transition: opacity .2s calc(var(--k, 0) * 40ms + .15s); }

/* ------------------------------------------------------------------ 16. 3D VIEWPORTS AND ANIMATED DRAWINGS (existing modules) */
/* js/viewports/*.js and js/anim/*.js read these names; inside the book they take the page's blue */
.page { --bp: var(--paper); --bp-line: #CFE0FF; --bp-text: var(--ink); --f-head: var(--f-disp); --rule: 1.5px; --border: 1.5px solid var(--line); --ink-muted: var(--ink-2); }
.viewport { position: relative; overflow: hidden; aspect-ratio: 4 / 3; touch-action: pan-y; user-select: none; -webkit-user-select: none; border: 1.5px solid var(--line); background: var(--paper); }
.viewport.wide { aspect-ratio: 16 / 10; }
.viewport > canvas { position: absolute; inset: 0; width: 100% !important; height: 100% !important; cursor: grab; }
.viewport > canvas:active { cursor: grabbing; }
.vp-label, .vp-tag { position: absolute; top: 0; z-index: 3; padding: 6px 10px; font: 500 11px/1.2 var(--f-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--ink); background: var(--paper); pointer-events: none; }
.vp-label { left: 0; border-right: 1.5px solid var(--line); border-bottom: 1.5px solid var(--line); }
.vp-tag { right: 0; border-left: 1.5px solid var(--line); border-bottom: 1.5px solid var(--line); }
@media (max-width: 360px) { .vp-tag { display: none; } }   /* too narrow for both: the label (what it is, how to use it) stays */
.viewport.is-still > canvas { display: none; }
.vp-still { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 36px 18px 18px; color: var(--bp-line); }
.vp-still svg, .vp-still img { width: 100%; height: 100%; object-fit: contain; }
.viewport.is-live .vp-still { display: none; }
.vp-status { position: absolute; left: 10px; bottom: 8px; z-index: 3; font: 500 11px/1.3 var(--f-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--line); pointer-events: none; }
.vp-note { position: absolute; z-index: 2; padding: 1px 4px; background: var(--paper); font: 500 12px/1.2 var(--f-mono); color: var(--ink); white-space: nowrap; pointer-events: none; transform: translate(-50%, -50%); }
.vp-tools { display: flex; flex-wrap: wrap; margin: 0; border: 1.5px solid var(--line); border-top: 0; background: var(--paper); }
.vp-tools button { appearance: none; min-height: var(--tap); min-width: var(--tap); padding: 0 14px; border: 0; border-right: 1px solid var(--line-2); background: transparent; color: var(--ink); font: 600 11.5px var(--f-mono); letter-spacing: .12em; text-transform: uppercase; cursor: pointer; }
.vp-tools button:hover { background: rgba(216,232,255,.08); }
.vp-tools button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.vp-tools .vp-hint { margin-left: auto; align-self: center; padding: 0 12px; font: 400 12px var(--f-mono); color: var(--ink-2); }
.anim { position: relative; aspect-ratio: 16 / 9; border: 1.5px solid var(--line); background: var(--paper); }
.anim-fallback { margin: 0; padding: 18px; font: 500 13px/1.5 var(--f-mono); }

/* ------------------------------------------------------------------ 17. SEAMS: where one sheet ends and the next begins */
/* Between two sheets the desk shows (--gap). Without JS that is the .page + .page margin. With JS,
   book.js lays a .seam in the gap: a print's trim marks round it (short hairlines continuing each
   sheet's edges, kept clear of the corners) and a register mark in the middle. They draw in as the
   sheet below opens; nothing here follows the scroll. */
.seam { position: relative; height: var(--gap); pointer-events: none; }
.seam + .page { margin-top: 0; }
.tk { position: absolute; background: var(--line-2); opacity: .75; }
.tk.v { width: 1px; height: max(4px, calc(var(--gap) / 2 - 10px)); }
.tk.v.a { top: 6px; transform-origin: 50% 0; }        /* continuing the sides of the sheet above */
.tk.v.b { bottom: 6px; transform-origin: 50% 100%; }  /* and of the sheet below */
.tk.v.l { left: 0; } .tk.v.r { right: 0; }
.tk.h { height: 1px; }
.tk.h.a { top: -1px; } .tk.h.b { bottom: -1px; }     /* continuing the bottom edge above and the top edge below */
.tk.h.l { right: calc(100% + 6px); width: max(0px, calc(var(--spine) - 8px)); transform-origin: 100% 50%; }
.tk.h.r { left: calc(100% + 6px); width: max(0px, calc(var(--edge) - 10px)); transform-origin: 0 50%; }
.sreg { position: absolute; left: 50%; top: 50%; width: 15px; height: 15px; margin: -7.5px 0 0 -7.5px; border: 1px solid var(--line-2); border-radius: 50%; }
.sreg::before, .sreg::after { content: ""; position: absolute; background: var(--line-2); }
.sreg::before { left: 6px; top: -6px; bottom: -6px; width: 1px; }
.sreg::after { top: 6px; left: -6px; right: -6px; height: 1px; }
.mo .seam:not(.in) .tk.v { transform: scaleY(0); }
.mo .seam:not(.in) .tk.h { transform: scaleX(0); }
.mo .seam:not(.in) .sreg { opacity: 0; transform: rotate(-90deg) scale(.4); }
.mo .seam.in .tk { transition: transform .5s var(--ease) .15s; }
.mo .seam.in .sreg { transition: opacity .3s .3s, transform .6s var(--ease-out) .3s; }

/* ------------------------------------------------------------------ 18. PHONE */
@media (max-width: 760px) {
  :root { --spine: 7px; --edge: 24px; --gap: 26px; --pad-x: 16px; --pad-top: 48px; --pad-bot: 56px; --t-body: 17px; }
  .rhead { top: 16px; font-size: 10.5px; letter-spacing: .1em; }
  .rhead span:first-child { display: none; }
  .folio { bottom: 16px; font-size: 10.5px; letter-spacing: .1em; }
  .thumb a { gap: 5px; padding: 7px 0 8px; }
  .thumb b { font-size: 11px; }
  .thumb span { font-size: 11px; letter-spacing: .06em; }
  .thumb a[aria-current] { transform: translateX(-6px); }
  .edges .e-l::after { width: 1px; }
  .tk.h.l { display: none; }   /* no room in a 7 px spine */
  .page[data-frame="zones"] { --pad-x: 30px; --pad-top: 40px; --pad-bot: 48px; }
  .page[data-frame="zones"] .folio { bottom: 26px; }
  .frame { inset: 6px 6px 6px 8px; }
  .frame .fi.t { top: 14px; } .frame .fi.b { bottom: 14px; } .frame .fi.l { left: 14px; } .frame .fi.r { right: 14px; }
  .frame .fi.t, .frame .fi.b { left: 14px; right: 14px; } .frame .fi.l, .frame .fi.r { top: 14px; bottom: 14px; }
  .frame .zn { width: 14px; height: 14px; font-size: 10px; }
  .frame .cm { display: none; }
  .cover { --pad-x: 30px; --pad-top: 40px; --pad-bot: 40px; }
  .cover-rule { inset: 12px 10px 12px 24px; outline-offset: 3px; }
  .cover-hinge { left: 10px; }
  .cover-body { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto; grid-template-areas: "kick" "name" "emblem" "dim" "tblock"; align-content: start; gap: var(--s4); }
  .cover-kicker { font-size: 10.5px; letter-spacing: .16em; }
  .cover-kicker span + span { display: none; }
  .cover-emblem { width: min(78%, 300px); }
  .cover-tblock { justify-self: stretch; width: auto; }
  .cover-cue { display: none; }
  .title-body { grid-template-columns: minmax(0, 1fr); align-content: start; gap: var(--s5); }
  .fig-portrait { order: 0; width: min(74%, 290px); justify-self: start; }
  .contents-body { grid-template-columns: minmax(0, 1fr); grid-template-areas: "h" "toc" "side"; padding-left: 0; }
  .toc-side { margin-top: var(--s6); }
  .toc a { grid-template-columns: 2.6em minmax(0, 1fr) 2.4em; column-gap: 10px; padding: 10px 2px; }
  .toc-lead { display: none; }
  .toc-t { font-size: 23px; }
  .toc-t em { font-size: 14px; }
  /* a phone reads the opener straight down: numeral, title, media, with no window-high spread above */
  .opener-body, .opener-body.has-media { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto; align-content: end; min-height: 0; }
  .opener-no { flex-direction: row; align-items: flex-end; gap: 8px; }
  .numeral { height: 22svh; }
  .opener .tblock.corner { position: relative; right: auto; bottom: auto; width: auto; margin-top: var(--s4); }
  .ghost-right { right: -45vw; width: 165vw; top: 30%; }
  .cols, .cols.flip { grid-template-columns: minmax(0, 1fr); }
  .fig-ctl { grid-template-columns: auto minmax(0, 1fr) 6.4ch; gap: 10px; }
  .play { padding: 0; justify-content: center; }
  .play .t { display: none; }
  .tc { font-size: 11px; }
  .reg { width: 12px; height: 12px; }
  .reg.r1 { top: -16px; right: -9px; } .reg.r2 { bottom: -16px; left: -9px; }
  .fe.t, .fe.b { left: -7px; right: -7px; } .fe.r, .fe.l { top: -7px; bottom: -7px; }
  figcaption { font-size: 12.5px; }
  .ledger > div { grid-template-columns: minmax(0, 1fr) 4.6em; gap: 2px 10px; }
  .ledger dt { grid-column: 1; font-size: 19px; }
  .ledger dd:not(.xref) { grid-column: 1; font-size: 15.5px; }
  .ledger .xref { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
  .strip { gap: 8px; }
  .strip li { padding: 4px 4px 22px; }
  .datasheet, .plist, .revs { font-size: 15px; }
  .callouts .bal-t { font-size: 26px; }
}

/* ------------------------------------------------------------------ 19. REDUCED MOTION */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: 0s !important; transition-delay: 0s !important; }
  .thumb a { transition: none; }
}
