/* ============================================================================
   THE BROADCAST — Luke Spooner
   Palette, type scale and layout carried from the original casting
   (commons/basket/The Broadcast (2).html, 2026-07-17).

   One visual world, deliberately: this is a dark instrument panel, not a
   theme-switching document. Every colour is painted explicitly so the page
   holds on any host ground.

   Every value below the token layer is a token. A raw px, hex or duration
   further down is a bug: add a token or use an existing one.
   ============================================================================ */

@layer tokens {
  :root {
    /* ── colour: ground and structure ── */
    --ground:      #12151c;
    --ground-deep: #0e1117;
    --card:        #1a1f29;
    --card-hi:     #1f2530;
    --rule:        #2a3140;
    --rule-soft:   #232937;
    --dash:        #6b7a99;              /* dashed borders: non-text, ≥3:1 on card */
    --header-bg:   rgba(18, 21, 28, 0.92);
    --shadow:      0 10px 28px rgba(0, 0, 0, 0.35);

    /* ── colour: ink. Every text ink is ≥4.5:1 on --card (WCAG AA) ── */
    --cream:       #e8e4d8;              /* 13.9:1 on card */
    --body:        #c9c5b8;              /*  9.6:1 */
    --muted:       #9a9789;              /*  5.6:1 */
    --faint:       #8a887c;              /*  4.6:1 */

    /* ── colour: node types, carried verbatim from the casting's C map ── */
    --thesis:      #e0c56a;
    --charter:     #7fb4d9;
    --artifact:    #9d7bd8;
    --paper:       #d4af37;
    --dispatch:    #5cb87a;
    --door:        #d08770;

    --gold:        #e0c56a;
    --gold-hi:     #ead483;
    --blue:        #7fb4d9;
    --link-line:   rgba(127, 180, 217, 0.45);

    /* ── colour: the three reading states. One treatment everywhere:
          current = solid green, stale = solid amber, dark = dashed slate
          with the word DARK. Dark is a state, never a zero. ── */
    --state-current:      #5cb87a;
    --state-current-line: #2f5f42;
    --state-stale:        #e0c56a;
    --state-stale-line:   #4a4326;
    --state-dark:         #8190ae;       /* 5.1:1 on card: readable, never bright */
    --state-dark-line:    var(--dash);
    --state-cold:         #d08770;       /* a service that answered "down" */
    --pulse-ring:         rgba(92, 184, 122, 0.55);
    --pulse-ring-0:       rgba(92, 184, 122, 0);

    /* old names, kept so frame.js and the screens read the same tokens */
    --live:     var(--state-current);
    --live-dim: var(--state-current-line);
    --warn:     var(--state-stale);
    --cold:     var(--state-cold);
    --dark-ink: var(--state-dark);

    /* ── type ── */
    --mono:  'JetBrains Mono', ui-monospace, 'Cascadia Mono', Consolas, monospace;
    --serif: 'Source Serif 4', Georgia, 'Times New Roman', serif;

    --fs-label:   11px;                  /* caps labels, chips, tags */
    --fs-meta:    12px;                  /* mono metadata, nav, kickers */
    --fs-ui:      13px;                  /* tables, code, mono lines */
    --fs-small:   0.94rem;
    --fs-body:    1rem;
    --fs-h3:      1.05rem;
    --fs-h4:      1.15rem;
    --fs-law:     1.35rem;
    --fs-value:   1.9rem;
    --fs-lede:    clamp(1.12rem, 2.3vw, 1.55rem);
    --fs-screen:  clamp(1.5rem, 3.4vw, 2.1rem);
    --fs-display: clamp(2.4rem, 6vw, 4rem);
    --fs-root:    17px;
    --fs-root-sm: 16px;

    --lh-tight: 1.1;
    --lh-snug:  1.35;
    --lh-body:  1.6;

    --track-tight: 0.03em;
    --track:       0.06em;
    --track-wide:  0.12em;
    --track-caps:  0.16em;
    --track-eyebrow: 0.22em;

    /* ── space: one scale, 4px steps at the bottom ── */
    --sp-0:  2px;
    --sp-1:  4px;
    --sp-2:  8px;
    --sp-3:  12px;
    --sp-4:  16px;
    --sp-5:  20px;
    --sp-6:  24px;
    --sp-7:  32px;
    --sp-8:  40px;
    --sp-9:  48px;
    --sp-10: 64px;
    --sp-11: 96px;

    --tap:    40px;                      /* phone tap target */
    --led:    7px;
    --stripe: 3px;                       /* the left status stripe on a card */
    --hair:   1px;
    --focus:  2px;                       /* focus ring and rail width */
    --blur:   10px;

    /* ── column minimums ── */
    --col-two:   300px;
    --col-three: 240px;
    --col-term:  150px;
    --col-term-max: 200px;
    --col-key:   130px;
    --col-key-max: 180px;
    --cell-max:  240px;
    --cell-max-sm: 220px;
    --menu-min:  150px;
    --canvas-h:  220px;

    /* ── print: paper is white ── */
    --print-ground: #fff;
    --print-ink:    #111;
    --print-soft:   #222;
    --print-rule:   #ccc;

    /* ── shape ── */
    --radius-sm: 2px;
    --radius:    3px;
    --radius-round: 50%;

    /* ── motion ── */
    --dur-fast:  140ms;
    --dur-pulse: 2.4s;
    --ease:      ease;
    --ease-out:  ease-out;

    /* ── measure ── */
    --maxw:      940px;
    --maxw-wide: 1140px;
    --measure:   760px;
    --measure-sub: 680px;
    --bp-phone:  640px;                  /* documentary: media queries cannot read vars */
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--ground);
  color: var(--body);
  font-family: var(--serif);
  font-size: var(--fs-root);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }
a:focus-visible,
button:focus-visible,
summary:focus-visible,
input:focus-visible {
  outline: var(--focus) solid var(--gold);
  outline-offset: var(--radius);
}

h1, h2, h3, h4 {
  font-family: var(--mono);
  color: var(--cream);
  text-wrap: balance;
  margin: 0;
}

/* A link inside a sentence: blue and underlined, so it reads as a link without
   relying on colour alone (WCAG 1.4.1). Links that are chips, buttons or card
   titles carry a class and keep their own look. */
.wrap p a:not([class]),
.wrap li a:not([class]),
.wrap dd a:not([class]),
.wrap td a:not([class]),
.wrap .type-tag a:not([class]),
.wrap .age a:not([class]),
.edge-line a:not([class]),
.new-here a {
  color: var(--blue);
  text-decoration: underline;
  text-decoration-color: var(--link-line);
  text-decoration-thickness: var(--hair);
  text-underline-offset: var(--radius);
  transition: color var(--dur-fast) var(--ease), text-decoration-color var(--dur-fast) var(--ease);
}
.wrap p a:not([class]):hover,
.wrap li a:not([class]):hover,
.wrap dd a:not([class]):hover,
.wrap td a:not([class]):hover,
.wrap .type-tag a:not([class]):hover,
.wrap .age a:not([class]):hover,
.edge-line a:not([class]):hover,
.new-here a:hover { color: var(--cream); text-decoration-color: currentColor; }

/* ─────────────────────────────── header ─────────────────────────────── */
/* One header, one nav and one footer on every route: the server paints them
   from public/index.html and the SPA only fills the nav and <main>. */

header.top {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--header-bg);
  backdrop-filter: blur(var(--blur));
  border-bottom: var(--hair) solid var(--rule);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-5);
  padding: var(--sp-3) var(--sp-7);
  flex-wrap: wrap;
}

.brand {
  font-family: var(--mono);
  font-weight: 700;
  font-size: var(--fs-meta);
  letter-spacing: var(--track);
  color: var(--cream);
  white-space: nowrap;
}
.brand .dot { color: var(--gold); }

nav.main {
  display: flex;
  gap: var(--sp-4);
  flex-wrap: wrap;
  font-family: var(--mono);
  font-size: var(--fs-meta);
  letter-spacing: var(--track-tight);
}
nav.main a { color: var(--muted); padding: var(--sp-0) 0; border-bottom: var(--hair) solid transparent; transition: color var(--dur-fast) var(--ease); }
nav.main a:hover { color: var(--cream); }
nav.main a.on { color: var(--cream); border-bottom-color: var(--gold); }

/* ─────────────────────── the three reading states ────────────────────── */
/* current · stale · dark, one treatment on every route: the header pulse,
   instruments, frame tiles, chips inside a sentence and the talks record.
   A chip carries the word; a container carries the stripe. Dark is a dashed
   outline with the word DARK in it: a visible state, never a 0. */

.state,
.dark-chip,
.frame-state {
  display: inline-block;
  font-family: var(--mono);
  font-size: var(--fs-label);
  font-weight: 500;
  font-style: normal;
  line-height: var(--lh-snug);
  letter-spacing: var(--track-wide);
  text-transform: uppercase;
  white-space: nowrap;
  background: transparent;
  border: var(--hair) solid currentColor;
  border-radius: var(--radius-sm);
  padding: var(--sp-0) var(--sp-2);
  vertical-align: middle;
}
.state-current, .frame-state-current { color: var(--state-current); border-color: var(--state-current-line); }
.state-stale,   .frame-state-stale   { color: var(--state-stale);   border-color: var(--state-stale); }
.state-dark,    .frame-state-dark,
.dark-chip                           { color: var(--state-dark);    border: var(--hair) dashed var(--state-dark-line); }

/* the ink alone, for a word inside a line of counts */
.ink-current { color: var(--state-current); }
.ink-stale   { color: var(--state-stale); }
.ink-dark    { color: var(--state-dark); }
.ink-cold    { color: var(--state-cold); }

/* containers: the left stripe says the state of what is inside */
.is-current, .is-live, .row-live { border-left: var(--stripe) solid var(--state-current); }
.is-stale, .row-warn             { border-left: var(--stripe) solid var(--state-stale); }
.is-dark, .row-dark              { border-left: var(--stripe) dashed var(--state-dark-line); }
.is-cold, .row-cold              { border-left: var(--stripe) solid var(--state-cold); }
.is-stale .value                 { color: var(--state-stale); }
.is-dark .value                  { color: var(--state-dark); }

/* the live pulse in the header — the hive's heartbeat, always on screen.
   Same chip as every other state; it only adds the LED. */
.pulse {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-family: var(--mono);
  font-size: var(--fs-label);
  letter-spacing: var(--track);
  color: var(--muted);
  border: var(--hair) solid var(--rule);
  border-radius: var(--radius-sm);
  padding: var(--sp-1) var(--sp-3);
  white-space: nowrap;
}
.pulse .led {
  width: var(--led); height: var(--led); border-radius: var(--radius-round);
  background: var(--state-dark);
  box-shadow: 0 0 0 0 var(--pulse-ring);
  flex: none;
}
.pulse.is-live,
.pulse.is-stale,
.pulse.is-dark { border-left-width: var(--hair); }
.pulse.is-live { color: var(--body); border-style: solid; border-color: var(--state-current-line); }
.pulse.is-live .led { background: var(--state-current); animation: beat var(--dur-pulse) var(--ease-out) infinite; }
.pulse.is-stale { color: var(--state-stale); border-style: solid; border-color: var(--state-stale-line); }
.pulse.is-stale .led { background: var(--state-stale); }
.pulse.is-dark { color: var(--state-dark); border-style: dashed; border-color: var(--state-dark-line); }
.pulse.is-dark .led { background: transparent; border: var(--hair) dashed var(--state-dark-line); }

/* a small round LED inside a line of text */
.led-dot {
  display: inline-block;
  width: var(--led); height: var(--led);
  border-radius: var(--radius-round);
  margin-right: var(--sp-2);
  background: var(--state-dark);
}
.led-dot.ink-current { background: var(--state-current); }
.led-dot.ink-stale   { background: var(--state-stale); }
.led-dot.ink-cold    { background: var(--state-cold); }

@keyframes beat {
  0%   { box-shadow: 0 0 0 0 var(--pulse-ring); }
  70%  { box-shadow: 0 0 0 var(--led) var(--pulse-ring-0); }
  100% { box-shadow: 0 0 0 0 var(--pulse-ring-0); }
}
@media (prefers-reduced-motion: reduce) {
  .pulse.is-live .led { animation: none; }
  * { scroll-behavior: auto !important; transition: none !important; }
}

/* ─────────────────────────────── layout ─────────────────────────────── */

main { min-height: 70vh; }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: var(--sp-10) var(--sp-7) var(--sp-11); }
.wrap.wide { max-width: var(--maxw-wide); }

/* the page header: eyebrow (optional), one h1, one lede. Same on every route. */
.eyebrow {
  font-family: var(--mono);
  font-size: var(--fs-meta);
  letter-spacing: var(--track-eyebrow);
  color: var(--gold);
  margin-bottom: var(--sp-4);
  text-transform: uppercase;
}

h1.display {
  font-family: var(--mono);
  font-weight: 700;
  font-size: var(--fs-display);
  line-height: 1.02;
  letter-spacing: 0.01em;
  margin: 0 0 var(--sp-6);
  color: var(--cream);
}

.screen {
  font-family: var(--mono);
  font-weight: 700;
  font-size: var(--fs-screen);
  line-height: var(--lh-snug);
  letter-spacing: 0.02em;
  margin: 0 0 var(--sp-4);
  color: var(--cream);
}

.lede {
  font-size: var(--fs-lede);
  line-height: 1.5;
  max-width: var(--measure);
  margin: 0 0 var(--sp-4);
  color: var(--cream);
}
.lede.lede-sm { font-size: var(--fs-h4); }
.sub { font-size: var(--fs-body); color: var(--muted); max-width: var(--measure-sub); margin: 0 0 var(--sp-9); }

.section-rule {
  border: 0;
  border-top: var(--hair) solid var(--rule);
  margin: var(--sp-9) 0 var(--sp-7);
}

/* a section heading: the kicker. The server paints it as a bare <h2> under
   .wrap; the SPA as h2.kicker after a rule. Both read the same. */
.kicker,
.wrap > h2:not([class]),
.wrap > section:not(.card) > h2:not([class]) {
  font-family: var(--mono);
  font-size: var(--fs-meta);
  font-weight: 500;
  letter-spacing: var(--track-caps);
  line-height: var(--lh-body);
  color: var(--muted);
  text-transform: uppercase;
  margin: 0 0 var(--sp-4);
}
.wrap > h2:not([class]),
.wrap > section:not(.card) > h2:not([class]) {
  border-top: var(--hair) solid var(--rule);
  padding-top: var(--sp-7);
  margin-top: var(--sp-9);
}

/* a sub-section heading inside a page (detail pages, Speaking, papers) */
.subhead,
.prose h3,
.prose:not(.paper) > h2,
.wrap > h3:not([class]) {
  font-family: var(--mono);
  font-size: var(--fs-meta);
  letter-spacing: var(--track-caps);
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
  margin: var(--sp-7) 0 var(--sp-3);
}

/* ──────────────────────────────── cards ─────────────────────────────── */

.card {
  display: block;
  background: var(--card);
  border: var(--hair) solid var(--rule);
  border-left: var(--stripe) solid var(--muted);
  border-radius: var(--radius);
  padding: var(--sp-5) var(--sp-6);
  margin-bottom: var(--sp-3);
  color: inherit;
  transition: border-color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
}
.grid > .card { margin-bottom: 0; }
a.card:hover { background: var(--card-hi); }
.card h2,
.card h3 {
  font-family: var(--mono);
  font-weight: 700;
  font-size: var(--fs-h3);
  letter-spacing: 0.04em;
  color: var(--cream);
  margin: 0 0 var(--sp-2);
}
.card-head h2, .card-head h3 { margin: 0; }
.card p { margin: 0; color: var(--body); font-size: var(--fs-body); }
.card p + p { margin-top: var(--sp-3); }
.card.compact { padding: var(--sp-3) var(--sp-4); }
.card.quiet { border-left-color: var(--rule); }
.card.faded { opacity: 0.75; }

/* card stripes by node type (see TYPE_COLOR in app.js) */
.card.t-artifact { border-left-color: var(--artifact); }
.card.t-paper    { border-left-color: var(--paper); }
.card.t-thesis   { border-left-color: var(--thesis); }
.card.t-charter  { border-left-color: var(--charter); }
.card.t-dispatch { border-left-color: var(--dispatch); }
.card.t-door     { border-left-color: var(--door); }
.card.t-gold     { border-left-color: var(--gold); }

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  margin-bottom: var(--sp-2);
  flex-wrap: wrap;
}

.grid { display: grid; gap: var(--sp-3); }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(var(--col-two), 1fr)); }
.grid.three { grid-template-columns: repeat(auto-fit, minmax(var(--col-three), 1fr)); }

/* status badges — the casting's own three-tier rule */
.badge {
  font-family: var(--mono);
  font-size: var(--fs-label);
  font-weight: 500;
  letter-spacing: var(--track);
  padding: var(--sp-0) var(--sp-2);
  border-radius: var(--radius-sm);
  white-space: nowrap;
}
.badge.solid   { background: var(--cream); color: var(--ground); border: var(--hair) solid var(--cream); }
.badge.outline { background: transparent; color: var(--cream); border: var(--hair) solid var(--muted); }
.badge.ghost   { background: transparent; color: var(--muted); border: var(--hair) dashed var(--dash); }

.type-tag {
  font-family: var(--mono);
  font-size: var(--fs-label);
  letter-spacing: var(--track-wide);
  text-transform: uppercase;
  color: var(--muted);
}
.card .type-tag { margin-top: var(--sp-2); }

/* ───────────────────────── the live instrument ──────────────────────── */
/* Everything in here obeys the fog law: a number that was not measured
   renders as DARK, never as zero, and every reading carries its age. */

.inst {
  background: var(--card);
  border: var(--hair) solid var(--rule);
  border-radius: var(--radius);
  padding: var(--sp-4) var(--sp-5);
}
.inst.is-current, .inst.is-live, .inst.row-live { border-left: var(--stripe) solid var(--state-current); }
.inst.is-stale, .inst.row-warn { border-left: var(--stripe) solid var(--state-stale); }
.inst.is-dark, .inst.row-dark { border-left: var(--stripe) dashed var(--state-dark-line); }
.inst.is-cold, .inst.row-cold { border-left: var(--stripe) solid var(--state-cold); }
.inst .label {
  font-family: var(--mono);
  font-size: var(--fs-label);
  letter-spacing: var(--track-caps);
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: var(--sp-2);
}
.inst .value {
  font-family: var(--mono);
  font-weight: 700;
  font-size: var(--fs-value);
  line-height: var(--lh-tight);
  color: var(--cream);
  font-variant-numeric: tabular-nums;
}
.inst .value .unit { font-size: var(--fs-small); font-weight: 400; color: var(--muted); margin-left: var(--sp-1); }
.inst .value .dark-chip { font-size: var(--fs-meta); }
.inst .age {
  font-family: var(--mono);
  font-size: var(--fs-label);
  color: var(--faint);
  margin-top: var(--sp-2);
  font-variant-numeric: tabular-nums;
}
.inst-line { font-family: var(--mono); font-size: var(--fs-ui); color: var(--body); margin-top: var(--sp-1); }
.inst-title { font-family: var(--mono); font-size: var(--fs-body); color: var(--cream); margin: var(--sp-2) 0 var(--sp-1); }

table.ledger {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--mono);
  font-size: var(--fs-ui);
}
table.ledger th {
  text-align: left;
  font-weight: 500;
  font-size: var(--fs-label);
  letter-spacing: var(--track-wide);
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: var(--hair) solid var(--rule);
  padding: var(--sp-2) var(--sp-3) var(--sp-2) 0;
}
table.ledger td {
  padding: var(--sp-3) var(--sp-3) var(--sp-3) 0;
  border-bottom: var(--hair) solid var(--rule-soft);
  color: var(--body);
  vertical-align: top;
}
table.ledger td.num { font-variant-numeric: tabular-nums; text-align: right; padding-right: var(--sp-4); }
.scroll-x { overflow-x: auto; }

/* dam / door list */
.dam {
  display: flex;
  gap: var(--sp-3);
  align-items: baseline;
  padding: var(--sp-3) var(--sp-4);
  background: var(--card);
  border: var(--hair) solid var(--rule);
  border-left: var(--stripe) solid var(--state-cold);
  border-radius: var(--radius);
}
.dam .key {
  font-family: var(--mono);
  font-size: var(--fs-meta);
  color: var(--gold);
  white-space: nowrap;
}
.dam .what { flex: 1; font-size: var(--fs-small); color: var(--body); }
.dam .waited {
  font-family: var(--mono);
  font-size: var(--fs-meta);
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* prose blocks on detail pages */
.prose p { color: var(--body); margin: 0 0 var(--sp-3); }
.prose ul { margin: 0 0 var(--sp-3); padding-left: var(--sp-5); color: var(--body); }
.prose li { margin-bottom: var(--sp-2); overflow-wrap: anywhere; }
.prose h4 { font-size: var(--fs-body); color: var(--cream); font-weight: 600; margin: var(--sp-6) 0 var(--sp-2); }
/* a paper's full text (public/markdown.js): tables, code, rules and numbered lists as the draft has them */
.prose.paper h2 { font-size: var(--fs-h4); margin: var(--sp-8) 0 var(--sp-3); }
.prose ol { margin: 0 0 var(--sp-3); padding-left: var(--sp-6); color: var(--body); }
.prose hr { border: 0; border-top: var(--hair) solid var(--rule-soft); margin: var(--sp-6) 0; }
.prose code, code.code { overflow-wrap: anywhere; font-family: var(--mono); font-size: 0.9em; color: var(--cream); background: var(--card); border: var(--hair) solid var(--rule-soft); border-radius: var(--radius-sm); padding: 0 var(--sp-1); }
.prose pre { max-width: 100%; font-family: var(--mono); font-size: var(--fs-ui); line-height: 1.5; color: var(--cream); background: var(--card); border: var(--hair) solid var(--rule-soft); border-radius: var(--radius-sm); padding: var(--sp-3) var(--sp-4); overflow-x: auto; margin: 0 0 var(--sp-4); }
.prose pre code { border: 0; background: none; padding: 0; font-size: inherit; }
/* wide tables scroll inside the column at phone width instead of widening the page */
.prose table { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; font-size: var(--fs-ui); margin: 0 0 var(--sp-4); }
.prose th { text-align: left; font-weight: 500; font-size: var(--fs-label); letter-spacing: var(--track-wide); text-transform: uppercase; color: var(--muted); border-bottom: var(--hair) solid var(--rule); padding: var(--sp-2) var(--sp-3) var(--sp-2) 0; }
.prose td { padding: var(--sp-2) var(--sp-3) var(--sp-2) 0; border-bottom: var(--hair) solid var(--rule-soft); color: var(--body); vertical-align: top; }
.prose.paper em { color: var(--cream); }
.paper-source { font-family: var(--mono); font-size: var(--fs-meta); margin-top: var(--sp-4); }
/* a figure is evidence: it sits with the links, never decorates the lede */
figure.evidence { margin: var(--sp-4) 0 var(--sp-6); }
figure.evidence img { display: block; max-width: 100%; height: auto; border: var(--hair) solid var(--rule); border-radius: var(--radius-sm); }
figure.evidence figcaption { font-family: var(--mono); font-size: var(--fs-meta); color: var(--muted); margin-top: var(--sp-2); line-height: 1.5; }
.stack-row { display: flex; flex-wrap: wrap; gap: var(--sp-2); }

.edge-line {
  font-family: var(--mono);
  font-size: var(--fs-meta);
  color: var(--muted);
  padding: var(--sp-2) 0;
  border-bottom: var(--hair) solid var(--rule-soft);
}
.edge-line .rel { color: var(--faint); }

.back {
  font-family: var(--mono);
  font-size: var(--fs-meta);
  letter-spacing: var(--track);
  color: var(--muted);
  display: inline-block;
  margin-bottom: var(--sp-6);
}
.back:hover { color: var(--cream); }

.filter-row { display: flex; gap: var(--sp-2); flex-wrap: wrap; margin-bottom: var(--sp-5); }
.chip {
  display: inline-block;
  font-family: var(--mono);
  font-size: var(--fs-label);
  letter-spacing: var(--track);
  padding: var(--sp-1) var(--sp-3);
  border: var(--hair) solid var(--rule);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}
.chip:hover { color: var(--cream); border-color: var(--muted); }
.chip.on { color: var(--ground); background: var(--cream); border-color: var(--cream); }
span.chip { cursor: default; }

/* the search box on Projects */
.field {
  display: block;
  width: 100%;
  padding: var(--sp-3) var(--sp-4);
  margin: var(--sp-4) 0;
  font: inherit;
  background: var(--card);
  color: var(--body);
  border: var(--hair) solid var(--rule);
  border-radius: var(--radius-sm);
}

footer.bot {
  border-top: var(--hair) solid var(--rule);
  padding: var(--sp-7) var(--sp-7) var(--sp-9);
  color: var(--faint);
  font-family: var(--mono);
  font-size: var(--fs-meta);
  line-height: 1.8;
  text-align: center;
}
footer.bot a { color: var(--muted); }
footer.bot a:hover { color: var(--cream); }
footer.bot .dot { color: var(--gold); }
footer.bot .foot-links { margin-top: var(--sp-2); }
footer.bot .foot-law { margin: var(--sp-3) auto 0; max-width: var(--measure); }

.loop-line {
  font-family: var(--mono);
  font-size: var(--fs-ui);
  color: var(--body);
  padding: var(--sp-3) 0 var(--sp-3) var(--sp-4);
  border-left: var(--focus) solid var(--rule);
}
.loop-line:hover, .loop-line.on { border-left-color: var(--gold); }

/* the one-line live reading under a project card */
.live-line {
  margin-top: var(--sp-3);
  padding-top: var(--sp-3);
  border-top: var(--hair) solid var(--rule-soft);
  font-family: var(--mono);
  font-size: var(--fs-meta);
  color: var(--muted);
}
.dam.is-stale { border-left: var(--stripe) solid var(--state-stale); }
.card.is-current { border-left: var(--stripe) solid var(--state-current); }
.card.is-stale   { border-left: var(--stripe) solid var(--state-stale); }
.card.is-dark    { border-left: var(--stripe) dashed var(--state-dark-line); }

/* ─────────────────────────── words (the glossary) ──────────────────────── */
/* A glossed term keeps its font, size and colour — only the underline is
   added, so marking a first use never moves the line it sits in. */
abbr.gloss {
  text-decoration: underline dotted;
  text-decoration-color: var(--dash);
  text-decoration-thickness: var(--hair);
  text-underline-offset: var(--radius);
  cursor: help;
}
abbr.gloss:hover { text-decoration-color: var(--gold); }

.new-here {
  font-family: var(--mono);
  font-size: var(--fs-meta);
  letter-spacing: var(--track-tight);
  color: var(--muted);
  margin: 0 0 var(--sp-3);
}

dl.words { margin: 0; }
.word {
  display: grid;
  grid-template-columns: minmax(var(--col-term), var(--col-term-max)) 1fr;
  gap: var(--sp-2) var(--sp-6);
  padding: var(--sp-3) 0;
  border-top: var(--hair) solid var(--rule-soft);
}
.word:last-child { border-bottom: var(--hair) solid var(--rule-soft); }
.word dt {
  font-family: var(--mono);
  font-size: var(--fs-ui);
  letter-spacing: 0.04em;
  color: var(--cream);
  margin: 0;
}
.word dd { margin: 0; color: var(--body); font-size: var(--fs-small); line-height: 1.55; }
@media (max-width: 640px) { .word { grid-template-columns: 1fr; gap: var(--sp-1); } }

/* the law screen: the spec rendered, nothing moved */
.law-h {
  font-family: var(--serif);
  font-weight: 600;
  font-size: var(--fs-law);
  color: var(--cream);
  margin: 0 0 var(--sp-3);
}
.law-inv .law-enf { margin-top: var(--sp-3); }
.law-enf ul { list-style: none; margin: var(--sp-2) 0 0; padding: 0; }
.law-enf li {
  font-family: var(--mono);
  font-size: var(--fs-meta);
  color: var(--muted);
  padding: var(--sp-0) 0;
}
.law-note { margin-top: var(--sp-3) !important; font-size: var(--fs-small) !important; color: var(--muted) !important; font-style: italic; }
.law-tag {
  display: inline-block;
  font-family: var(--mono);
  font-size: var(--fs-label);
  letter-spacing: var(--track);
  text-transform: uppercase;
  color: var(--gold);
  border: var(--hair) solid var(--gold);
  border-radius: var(--radius-sm);
  padding: 0 var(--sp-2);
  margin-top: var(--sp-1);
}
.law-code {
  font-family: var(--mono);
  font-size: var(--fs-meta);
  color: var(--cream);
  background: var(--card);
  border: var(--hair) solid var(--rule-soft);
  border-radius: var(--radius-sm);
  padding: 0 var(--sp-2);
}
table.law-params td, table.law-classes td { font-size: var(--fs-meta); }
table.law-params td:nth-child(5), table.law-params td:nth-child(6) { max-width: var(--cell-max); }
table.law-classes td:nth-child(7) { max-width: var(--cell-max-sm); }
.law-pgeo, .law-pbar, .law-pin { display: inline-block; vertical-align: middle; }
dl.law-policy { margin: 0 0 var(--sp-2); }
dl.law-policy > div {
  display: grid;
  grid-template-columns: minmax(var(--col-key), var(--col-key-max)) 1fr;
  gap: var(--sp-2) var(--sp-6);
  padding: var(--sp-3) 0;
  border-top: var(--hair) solid var(--rule-soft);
}
dl.law-policy > div:last-child { border-bottom: var(--hair) solid var(--rule-soft); }
dl.law-policy dt {
  font-family: var(--mono);
  font-size: var(--fs-meta);
  letter-spacing: var(--track);
  text-transform: uppercase;
  color: var(--muted);
  margin: 0;
}
dl.law-policy dd { margin: 0; color: var(--body); font-size: var(--fs-small); line-height: 1.55; }
ul.law-list { margin: 0; padding-left: var(--sp-5); color: var(--body); }
ul.law-list li { margin-bottom: var(--sp-3); line-height: 1.5; }
@media (max-width: 640px) { dl.law-policy > div { grid-template-columns: 1fr; gap: var(--sp-1); } }

/* ─────────────────────────── the portfolio front door ───────────────────── */
/* The exits a visitor needs in the first screen: projects, CV, code, hire,
   mail. One row, one gold button. */
.cta-row { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin: 0 0 var(--sp-6); }
.cta {
  display: inline-block;
  font-family: var(--mono);
  font-size: var(--fs-meta);
  letter-spacing: var(--track);
  padding: var(--sp-2) var(--sp-4);
  border: var(--hair) solid var(--rule);
  border-radius: var(--radius-sm);
  color: var(--cream);
  background: var(--card);
  transition: background var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}
.cta:hover { border-color: var(--muted); background: var(--card-hi); }
.cta.gold { background: var(--gold); color: var(--ground); border-color: var(--gold); }
.cta.gold:hover { background: var(--gold-hi); }

/* a card whose title is the link, so the evidence links inside stay clickable */
.card.linkable h3 a, .card h2 a, .card h3 a { color: var(--cream); transition: color var(--dur-fast) var(--ease); }
.card.linkable h3 a:hover, .card h2 a:hover, .card h3 a:hover { color: var(--gold); }
.proof-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2) var(--sp-4);
  margin-top: var(--sp-3);
  font-family: var(--mono);
  font-size: var(--fs-meta);
  letter-spacing: var(--track-tight);
}
.proof-links .proof { color: var(--blue); }
.proof-links .proof:hover { color: var(--cream); }

/* the More menu: the rest of the site, one click away */
nav.main details.more { position: relative; }
nav.main details.more summary {
  list-style: none;
  cursor: pointer;
  color: var(--muted);
  padding: var(--sp-0) 0;
  border-bottom: var(--hair) solid transparent;
  user-select: none;
}
nav.main details.more summary::-webkit-details-marker { display: none; }
nav.main details.more summary::after { content: ' ▾'; color: var(--faint); }
nav.main details.more summary:hover { color: var(--cream); }
nav.main details.more summary.on { color: var(--cream); border-bottom-color: var(--gold); }
nav.main details.more .more-menu {
  position: absolute;
  top: var(--sp-7);
  left: calc(-1 * var(--sp-3));
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  min-width: var(--menu-min);
  padding: var(--sp-3) var(--sp-4);
  background: var(--card);
  border: var(--hair) solid var(--rule);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* positioning tags under the CV line — labels, not measurements */
.cv-tags { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin: var(--sp-0) 0 var(--sp-4); }
.cv-tag {
  font-family: var(--mono);
  font-size: var(--fs-label);
  letter-spacing: var(--track);
  color: var(--muted);
  border: var(--hair) solid var(--rule);
  border-radius: var(--radius-sm);
  padding: var(--sp-1) var(--sp-2);
}

/* ─────────────────────────────── utilities ──────────────────────────────── */
/* Small, token-only helpers the screens use instead of inline style="". */
.mono { font-family: var(--mono); }
.t-label { font-size: var(--fs-label); }
.t-meta  { font-size: var(--fs-meta); }
.t-ui    { font-size: var(--fs-ui); }
.t-small { font-size: var(--fs-small); }
.t-body  { font-size: var(--fs-body); }
.t-h4    { font-size: var(--fs-h4); }
.t-caps  { letter-spacing: var(--track); }
.lh-snug { line-height: var(--lh-snug); }
.ink-cream { color: var(--cream); }
.ink-body  { color: var(--body); }
.ink-muted { color: var(--muted); }
.ink-faint { color: var(--faint); }
.ink-gold  { color: var(--gold); }
.ink-blue  { color: var(--blue); }
.struck    { text-decoration: line-through; }
.ta-r { text-align: right; }
.ta-l { text-align: left; }
.nowrap { white-space: nowrap; }
.m-0  { margin: 0; }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: var(--sp-1); }
.mt-2 { margin-top: var(--sp-2); }
.mt-3 { margin-top: var(--sp-3); }
.mt-4 { margin-top: var(--sp-4); }
.mt-5 { margin-top: var(--sp-5); }
.mt-6 { margin-top: var(--sp-6); }
.mt-7 { margin-top: var(--sp-7); }
.mt-8 { margin-top: var(--sp-8); }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: var(--sp-1); }
.mb-2 { margin-bottom: var(--sp-2); }
.mb-3 { margin-bottom: var(--sp-3); }
.mb-4 { margin-bottom: var(--sp-4); }
.mb-5 { margin-bottom: var(--sp-5); }
.mb-6 { margin-bottom: var(--sp-6); }
.mb-7 { margin-bottom: var(--sp-7); }
.mb-8 { margin-bottom: var(--sp-8); }
.mb-9 { margin-bottom: var(--sp-9); }
.my-2 { margin-top: var(--sp-2); margin-bottom: var(--sp-2); }
.my-6 { margin-top: var(--sp-6); margin-bottom: var(--sp-6); }
.gap-2 { gap: var(--sp-2); }
.gap-3 { gap: var(--sp-3); }
.row { display: flex; gap: var(--sp-3); align-items: center; flex-wrap: wrap; }

@media (max-width: 640px) {
  header.top { padding: var(--sp-3) var(--sp-4); gap: var(--sp-3); }
  .wrap { padding: var(--sp-9) var(--sp-4) var(--sp-10); }
  body { font-size: var(--fs-root-sm); }
  nav.main { gap: var(--sp-1) var(--sp-3); }
  footer.bot { padding: var(--sp-7) var(--sp-4) var(--sp-9); }
}

/* phones: every control is a ≥40px tap target. Padding and min-height only;
   no wording, order or status changes. */
@media (max-width: 640px) {
  .brand, .pulse, nav.main a, nav.main details.more summary, nav.main details.more .more-menu a,
  .back, .chip, .cta, .proof-links a, footer.bot a, .card h3 a, .card h2 a, .card a {
    display: inline-flex;
    align-items: center;
    min-height: var(--tap);
  }
  .brand { white-space: normal; gap: 0.5em; }
  nav.main a, nav.main details.more summary { padding: 0; }
  nav.main details.more .more-menu { top: var(--tap); gap: 0; }
  .proof-links { gap: 0 var(--sp-4); margin-top: var(--sp-2); }
  footer.bot a { padding: 0 var(--sp-2); }
  /* links inside a sentence: 40px of hit area, no change to line spacing */
  .wrap p a:not(.cta):not(.chip), .wrap li a:not(.cta):not(.chip) {
    display: inline-block;
    padding: var(--sp-3) 0;
    margin: calc(-1 * var(--sp-3)) 0;
    max-width: 100%;
    overflow-wrap: anywhere;
  }
}

/* ───────────────────────────── frame/1 grid ─────────────────────────────── */
/* Painted by public/frame.js from any frame/1 document. Same fog law as the
   instruments above: dark is a dashed chip, never a 0; stale is marked, not
   hidden. Tiles reuse .inst so a Frame and the Engine Room read as one hand. */

.frame-head { margin-bottom: var(--sp-4); }
.frame-subject {
  font-family: var(--mono);
  font-size: var(--fs-h3);
  letter-spacing: var(--track);
  color: var(--cream);
}
.frame-meta, .frame-counts, .frame-legend, .frame-law, .frame-source {
  font-family: var(--mono);
  font-size: var(--fs-label);
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}
.frame-counts { color: var(--muted); margin-top: var(--sp-1); }
.frame-legend { margin-top: var(--sp-4); line-height: 2; }
.frame-law { margin-top: var(--sp-2); font-style: italic; }
.frame-problems {
  font-family: var(--mono);
  font-size: var(--fs-label);
  color: var(--state-cold);
  border: var(--hair) dashed var(--state-cold);
  border-radius: var(--radius-sm);
  padding: var(--sp-2) var(--sp-3);
  margin-bottom: var(--sp-3);
}
.frame-node-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sp-3);
}
.frame-node-head .label { margin-bottom: var(--sp-2); }
.frame-source { margin-top: var(--sp-2); }

/* ── print: the CV and the story go to paper as documents ── */
@media print {
  body { background: var(--print-ground); color: var(--print-ink); }
  header, nav, #nav, .pulse, .no-print, .filter-row { display: none !important; }
  .wrap { max-width: 100%; padding: 0; }
  .card, .cv-item { break-inside: avoid; border: var(--hair) solid var(--print-rule); }
  a { color: var(--print-ink); text-decoration: none; }
  .screen, .lede, .kicker, strong, h3 { color: var(--print-ink) !important; }
  p, .type-tag { color: var(--print-soft) !important; }
}
/* Semantica illustrative wet membrane (proof-index visual; not LIVE) */
.membrane {
  margin: var(--sp-7) 0 var(--sp-2);
  background: var(--card);
  border: var(--hair) solid var(--rule);
  border-left: var(--stripe) solid var(--artifact);
  border-radius: var(--radius);
  padding: var(--sp-4) var(--sp-4) var(--sp-3);
}
.membrane .label {
  font-family: var(--mono);
  font-size: var(--fs-label);
  letter-spacing: var(--track-caps);
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: var(--sp-3);
}
.membrane canvas {
  display: block;
  width: 100%;
  height: var(--canvas-h);
  background: var(--ground-deep);
  border: var(--hair) solid var(--rule-soft);
  border-radius: var(--radius-sm);
}
.membrane-note {
  font-family: var(--mono);
  font-size: var(--fs-meta);
  line-height: 1.55;
  color: var(--faint);
  margin: var(--sp-3) 0 0;
  max-width: 70ch;
}
/* ───────────────────────────── authority ───────────────────────────── */
/* The featured paper quotes its own opening paragraph; every row carries a proof
   badge that links to its witness; the timeline is one list, newest first. */
.featured { margin: 8px 0 40px; border-left: 3px solid var(--paper); }
.featured h2, .featured .featured-title { margin: 0 0 6px; font-family: var(--mono); font-size: 1.3rem; }
.featured h2 a, .featured .featured-title a { color: var(--cream); }
.paper-quote { margin: 18px 0; padding: 0 0 0 16px; border-left: 1px solid var(--rule); font-family: var(--serif); }
.paper-quote p { font-size: 1.08rem; line-height: 1.55; color: var(--body); }
.paper-quote footer { margin-top: 8px; font-family: var(--mono); font-size: var(--fs-label); color: var(--faint); }
.proof-badge {
  display: inline-block;
  font-family: var(--mono);
  font-size: var(--fs-label);
  letter-spacing: 0.04em;
  padding: 4px 10px;
  margin-top: 8px;
  border: 1px solid var(--live-dim);
  border-radius: 2px;
  color: var(--blue);
}
.proof-badge:hover { border-color: var(--live); color: var(--cream); }
.proof-badge .proof-mark { color: var(--live); text-transform: uppercase; letter-spacing: 0.12em; margin-right: 4px; }
.proof-badge code { font-size: var(--fs-label); color: var(--muted); margin-left: 0.5em; }
.proof-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin-top: 8px; }
.proof-row .proof-badge { margin-top: 0; }
.authority-kinds { list-style: none; padding: 0; margin: 0 0 22px; display: flex; flex-wrap: wrap; gap: 6px 22px; font-family: var(--mono); font-size: var(--fs-meta); color: var(--muted); }
.authority-kinds strong { color: var(--cream); }
.timeline { list-style: none; padding: 0; margin: 0 0 26px; border-left: 1px solid var(--rule); }
.timeline .authority-row { display: grid; grid-template-columns: 110px 1fr; gap: 16px; padding: 14px 0 18px 18px; position: relative; }
.timeline .authority-row::before { content: ''; position: absolute; left: -4px; top: 20px; width: 7px; height: 7px; background: var(--paper); border-radius: 50%; }
.timeline .when { font-family: var(--mono); font-size: var(--fs-meta); color: var(--muted); padding-top: 2px; font-variant-numeric: tabular-nums; }
.timeline h3 { margin: 4px 0 0; font-family: var(--mono); font-size: 1.02rem; }
.timeline h3 a { color: var(--cream); }
@media (max-width: 640px) {
  .timeline .authority-row { grid-template-columns: 1fr; gap: 4px; }
  .wrap a.proof-badge, .wrap .authority-row a.proof-badge { display: inline-flex; align-items: center; min-height: 40px; padding: 4px 10px; margin: 8px 0 0; }
  .wrap .proof-row .proof-badge { margin: 0; }
}
