/* ==========================================================================
   Mycelic — css/styles.css

   Paper-first design system for mycelicmemory.com. One stylesheet, no build.

   Contents
     1. Design tokens (light only — one palette, on :root, no dark variant)
     2. Base: reset, type scale, links, focus, code
     3. Layout: container, prose measure, sections, lineage-thread divider, skip link
     4. Navigation (.nav) and theme toggle
     5. Hero, buttons, status strip, banner
     6. Evidence components: stat tile, caveat card, mechanism card, evidence
        table, chip, pill, ladder, hatched fill
     7. Figures, citations, footnotes / sidenotes, source ledger
     8. CTA band and footer
     9. Utilities
    10. Print
    11. Motion

   Rules baked in here:
     - Colour never carries meaning alone (teal = evidence, gold = inquiry,
       grey = baseline; every state also has text, outline style or hatching).
     - Hatched fill is reserved for proposed / unimplemented elements.
     - Every text/background pair is >= 4.5:1 in both themes.
     - Only transitions are 120 ms colour/opacity, removed under reduced motion.
   ========================================================================== */


/* --------------------------------------------------------------------------
   1. Design tokens
   -------------------------------------------------------------------------- */

:root {
  color-scheme: light;

  /* Palette — LIGHT (default, printable) */
  --bg: #F7F5F0;               /* warm paper */
  --surface: #FFFFFF;
  --surface-2: #EFECE4;        /* code, tables, caveat backgrounds */
  --ink: #15171B;
  --ink-2: #4F555E;
  --ink-3: #7A808A;            /* muted, captions (4.6:1 on --bg) */
  --rule: #D8D3C8;
  --accent-evidence: #1F7A78;  /* teal: evidence, Mycelic conditions, primary button */
  --accent-inquiry: #9A6A12;   /* gold: questions, proposed, in progress, caveat rule */
  --baseline: #9AA0A8;         /* neutral grey for every baseline series */
  --focus: #1F7A78;
  --on-accent: #FFFFFF;        /* text on a teal or gold fill (5.2:1 / 4.8:1) */
  --hatch-ink: rgba(154, 106, 18, 0.35);   /* --accent-inquiry at 35 % */
  --edge-shadow: rgba(21, 23, 27, 0.14);   /* table-scroll edge fade */

  /* Hatched fill: reserved for proposed / unimplemented elements. 6 px pitch. */
  --hatch: repeating-linear-gradient(45deg, var(--hatch-ink) 0 1.5px, transparent 1.5px 6px);

  /* Typography — IBM Plex superfamily with system fallbacks */
  --font-sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-serif: "IBM Plex Serif", Georgia, "Times New Roman", Times, serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

  /* Type scale — ratio 1.25 from a 17 px base (html font-size is 106.25 %,
     so 1rem = 17 px and every value below lands on the pixel size the spec names). */
  --t-xs: 0.75rem;    --lh-xs: 1.4;    /* 12.75 px — chip text, never smaller */
  --t-sm: 0.85rem;    --lh-sm: 1.45;   /* 14.45 px — captions, footnotes, table cells */
  --t-base: 1rem;     --lh-base: 1.55; /* 17 px — body */
  --t-md: 1.2rem;     --lh-md: 1.35;   /* 20.4 px — H3 */
  --t-lg: 1.6rem;     --lh-lg: 1.25;   /* 27.2 px — H2 */
  --t-xl: clamp(2rem, 3.4vw, 2.75rem);      --lh-xl: 1.15;   /* H1 */
  --t-stat: clamp(2.25rem, 4vw, 3.25rem);   --lh-stat: 1.05; /* stat tile figure */

  /* Spacing — 8 px base unit */
  --s-1: 0.5rem;
  --s-2: 1rem;
  --s-3: 1.5rem;
  --s-4: 2rem;
  --s-6: 3rem;
  --s-8: 4rem;

  /* Layout */
  --container: 1120px;
  --gutter: 16px;              /* 32 px from 720 px, 48 px from 1100 px */
  --measure: 68ch;
  --nav-h: 56px;
  --sidenote-w: 240px;         /* 240 + 40 gap = the 280 px right margin */
  --sidenote-gap: 40px;
  --radius: 2px;
  --touch: 44px;

  --transition: 120ms ease;
}

@media (min-width: 720px)  { :root { --gutter: 32px; } }
@media (min-width: 1100px) { :root { --gutter: 48px; } }

/* Light only: one palette, no dark variant, no prefers-color-scheme branch, no toggle. */


/* --------------------------------------------------------------------------
   2. Base
   -------------------------------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; }

html {
  font-size: 106.25%;                 /* 17 px at the browser default; respects user zoom */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--nav-h) + var(--s-2));
}

body {
  margin: 0;
  background: var(--bg);              /* explicit background on body */
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--t-base);
  line-height: var(--lh-base);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
}

img, svg, video, canvas { max-width: 100%; height: auto; }
svg { overflow: visible; }

h1, h2, h3, h4 {
  font-weight: 600;
  margin: 0 0 var(--s-2);
  overflow-wrap: anywhere;
  color: var(--ink);
}
h1 { font-size: var(--t-xl); line-height: var(--lh-xl); letter-spacing: -0.01em; max-width: 24ch; }
h2 { font-size: var(--t-lg); line-height: var(--lh-lg); max-width: 32ch; }
h3 { font-size: var(--t-md); line-height: var(--lh-md); }
h4 { font-size: var(--t-base); line-height: var(--lh-md); }

/* Paper register: research pages set <body class="research"> */
.research h1, .research h2, .pull-quote { font-family: var(--font-serif); }

p, ul, ol, dl, blockquote, figure { margin: 0 0 var(--s-2); }
p, li, dd { overflow-wrap: anywhere; }
ul, ol { padding-left: 1.4rem; }
li { margin: 0.25rem 0; }
small { font-size: var(--t-sm); }
strong, b { font-weight: 600; }
hr { border: 0; border-top: 1px solid var(--rule); margin: var(--s-4) 0; }

.pull-quote {
  font-style: italic;
  font-size: var(--t-md);
  line-height: var(--lh-md);
  border-left: 3px solid var(--accent-evidence);
  padding: var(--s-1) var(--s-3);
  margin: var(--s-4) 0;
  color: var(--ink-2);
  max-width: var(--measure);
}
.pull-quote p { margin: 0; }
.pull-quote cite { display: block; font-style: normal; font-family: var(--font-mono); font-size: var(--t-sm); margin-top: var(--s-1); }

/* Links: underlined, never colour-only */
a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.15em;
}
a:hover, a:focus-visible { color: var(--accent-evidence); }

/* Focus: one ring everywhere */
:focus { outline: 2px solid var(--focus); outline-offset: 3px; }
:focus:not(:focus-visible) { outline: none; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }

/* Numbers are always mono with tabular figures */
.mono, .num, code, kbd, samp, pre,
.chip, .pill, .cite, .eyebrow, .status-strip, .stat-figure, .caveat-line,
.where, .footnote, .source-ledger, .site-status, .evidence-table td, .evidence-table th,
.rung-head, .wordmark, .banner .pill, .code-toolbar {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}
.num { text-align: right; }

/* Code */
pre {
  background: var(--surface-2);
  border: 1px solid var(--rule);
  padding: var(--s-2);
  margin: 0 0 var(--s-2);
  overflow-x: auto;
  font-size: var(--t-sm);
  line-height: 1.5;
  tab-size: 2;
  max-width: 100%;
}
pre:focus-visible { outline-offset: -2px; }
code, kbd, samp { font-size: 0.92em; }
:not(pre) > code, kbd {
  background: var(--surface-2);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 0.05em 0.3em;
}
.code-block { margin: 0 0 var(--s-2); }
.code-block pre { margin: 0; }
.code-toolbar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: var(--s-1);
  background: var(--surface-2);
  border: 1px solid var(--rule);
  border-bottom: 0;
  padding: 0 var(--s-1);
  font-size: var(--t-xs);
  color: var(--ink-3);
}
.copy-btn {
  font: inherit;
  font-family: var(--font-mono);
  font-size: var(--t-xs);
  min-height: var(--touch);
  padding: 0 var(--s-2);
  background: transparent;
  color: var(--ink);
  border: 0;
  border-radius: var(--radius);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 0.15em;
  text-decoration-thickness: 1px;
}
.copy-btn:hover, .copy-btn:focus-visible { color: var(--accent-evidence); }

/* Details / summary: 44 px targets, custom marker so display:flex keeps an affordance */
details { margin: 0 0 var(--s-2); }
summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: var(--touch);
  font-weight: 500;
}
summary::-webkit-details-marker { display: none; }
summary::before {
  content: "\25B8";                   /* ▸ */
  font-family: var(--font-mono);
  color: var(--ink-3);
  flex: none;
  width: 1ch;
}
details[open] > summary::before { content: "\25BE"; }  /* ▾ */
summary:hover { color: var(--accent-evidence); }

table { border-collapse: collapse; border-spacing: 0; }


/* --------------------------------------------------------------------------
   3. Layout
   -------------------------------------------------------------------------- */

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.prose { max-width: var(--measure); }
.prose > :last-child { margin-bottom: 0; }

main { display: block; }
.section { padding-block: var(--s-3); }
.section > h2:first-child { margin-top: 0; }
.section-lede { color: var(--ink-2); max-width: var(--measure); }

/* Lineage-thread divider between H2 sections: 1 px rule, solid teal origin
   dot at the left, two hollow dots along it. Pure background painting.
   Sits inside the container width; section padding + these margins = --s-8. */
.lineage-thread {
  border: 0;
  height: 9px;
  width: min(calc(100% - 2 * var(--gutter)), calc(var(--container) - 2 * var(--gutter)));
  margin: var(--s-1) auto;
  background:
    radial-gradient(circle, var(--accent-evidence) 0 3.6px, transparent 4.2px) 0 50% / 9px 9px no-repeat,
    radial-gradient(circle, var(--bg) 0 2.4px, var(--accent-evidence) 2.6px 3.6px, transparent 4.2px) 40% 50% / 9px 9px no-repeat,
    radial-gradient(circle, var(--bg) 0 2.4px, var(--accent-evidence) 2.6px 3.6px, transparent 4.2px) 70% 50% / 9px 9px no-repeat,
    linear-gradient(var(--rule), var(--rule)) 0 50% / 100% 1px no-repeat;
}

/* Skip link: first focusable element on every page */
.skip-link {
  position: absolute;
  top: -100px;
  left: var(--s-2);
  z-index: 100;
  padding: 0.6rem 1rem;
  background: var(--ink);
  color: var(--bg);
  font-family: var(--font-mono);
  font-size: var(--t-sm);
  text-decoration: none;
  border-radius: var(--radius);
}
.skip-link:focus { top: var(--s-1); outline-color: var(--accent-evidence); }


/* --------------------------------------------------------------------------
   4. Navigation and theme toggle
   -------------------------------------------------------------------------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg);
  border-bottom: 1px solid var(--rule);
}
.nav-inner {
  min-height: var(--nav-h);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 var(--s-2);
  position: relative;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  min-height: var(--touch);
  text-decoration: none;
  color: var(--ink);
}
.logo:hover, .logo:focus-visible { color: var(--accent-evidence); }
.logo-mark { width: 28px; height: 28px; flex: none; display: block; }
.wordmark {
  font-size: var(--t-sm);
  font-weight: 500;
  letter-spacing: 0.01em;      /* tight: the letters read as one word */
  text-transform: lowercase;   /* the wordmark is set lower case */
  line-height: 1;
  padding-left: 0;
}

.nav-toggle { display: none; }   /* shown by JS under 720 px */

.nav-menu {
  margin-left: auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 var(--s-1);
}
.nav-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0 0.125rem;
}
.nav-links li { margin: 0; }
.nav-links a {
  display: inline-flex;
  align-items: center;
  min-height: var(--touch);
  padding: 0 0.6rem;
  font-size: var(--t-sm);
  color: var(--ink-2);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}
.nav-links a:hover, .nav-links a:focus-visible { color: var(--accent-evidence); }
.nav-links a[aria-current="page"] {
  color: var(--ink);
  border-bottom-color: var(--accent-evidence);
}
.nav-links a.nav-github { gap: 0.4rem; }
.nav-links a.nav-github svg { flex: none; }

/* Tablet range: all seven links do not fit beside the lockup, so the toggle joins
   the logo row and the links take a second row (display: contents flattens the
   menu wrapper into the flex row; the wrapper has no semantics of its own). */
@media (min-width: 720px) and (max-width: 999.98px) {
  .nav-menu { display: contents; }
  .nav-links {
    order: 3;
    flex-basis: 100%;
    margin-left: -0.6rem;
    border-top: 1px solid var(--rule);
  }
}

@media (max-width: 719.98px) {
  .js .nav-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
    min-height: var(--touch);
    padding: 0 0.7rem;
    font: inherit;
    font-family: var(--font-mono);
    font-size: var(--t-sm);
    color: var(--ink);
    background: transparent;
    border: 1px solid var(--rule);
    border-radius: var(--radius);
    cursor: pointer;
  }
  .js .nav-toggle svg { width: 18px; height: 18px; }
  .js .nav-toggle[aria-expanded="true"] { border-color: var(--ink); }
  .js .nav-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin: 0;
    padding: var(--s-1) var(--gutter) var(--s-2);
    background: var(--bg);
    border-bottom: 1px solid var(--rule);
    flex-direction: column;
    align-items: stretch;
  }
  .js .nav.is-open .nav-menu { display: flex; }
  /* Without JS the menu simply stacks under the logo and stays visible. */
  .nav-menu { flex-basis: 100%; }
  .nav-links { flex-direction: column; }
  .nav-links a { min-height: var(--touch); width: 100%; padding-inline: 0.25rem; }
}


/* --------------------------------------------------------------------------
   5. Hero, buttons, status strip, banner
   -------------------------------------------------------------------------- */

.hero { padding-block: var(--s-6) var(--s-4); }
.eyebrow {
  font-size: var(--t-sm);
  color: var(--ink-3);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin: 0 0 var(--s-2);
}
.hero h1 { margin-bottom: var(--s-3); }
.hero-sub {
  max-width: 60ch;
  font-size: var(--t-md);
  line-height: var(--lh-md);
  color: var(--ink-2);
  margin-bottom: var(--s-3);
}
.hero-actions, .cta-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-2);
  margin: 0 0 var(--s-3);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: var(--touch);
  padding: 0.55rem 1.2rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font: inherit;
  font-weight: 500;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  text-align: center;
}
.btn-primary {
  background: var(--accent-evidence);
  color: var(--on-accent);
  border-color: var(--accent-evidence);
}
.btn-primary:hover, .btn-primary:focus-visible {
  color: var(--on-accent);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}
.btn-secondary {
  background: transparent;
  color: var(--ink);
  border-color: var(--rule);
}
.btn-secondary:hover, .btn-secondary:focus-visible {
  color: var(--accent-evidence);
  border-color: var(--ink);
}

/* Status strip: one mono line that wraps; items separated by a middle dot */
.status-strip {
  list-style: none;
  margin: var(--s-3) 0 0;
  padding: 0.6rem var(--s-2);
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  font-size: var(--t-sm);
  line-height: var(--lh-sm);
  color: var(--ink-2);
  background: var(--surface-2);
  border-radius: var(--radius);
}
.status-strip li { margin: 0.15rem 0; }
/* Trailing separator so a wrapped line ends with the dot rather than starting with it */
.status-strip li:not(:last-child)::after {
  content: "\00B7";                   /* · */
  margin: 0 0.6rem;
  color: var(--ink-3);
}

/* Banner: page-level notice (in progress, superseded, gated). Not dismissible. */
.banner {
  background: var(--surface-2);
  border-bottom: 1px solid var(--rule);
  padding: 0.6rem 0;
}
.banner-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem var(--s-2);
  font-size: var(--t-sm);
  color: var(--ink-2);
}
.banner p { margin: 0; max-width: var(--measure); }


/* --------------------------------------------------------------------------
   6. Evidence components
   -------------------------------------------------------------------------- */

/* Grids */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
  gap: var(--s-2);
  margin: 0 0 var(--s-3);
}
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
  gap: var(--s-2);
  margin: 0 0 var(--s-3);
}
/* A number beside the caveat that qualifies it: same row from 720 px, below on phones */
.qualified {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--s-2);
  margin: 0 0 var(--s-3);
}
@media (min-width: 720px) {
  .qualified { grid-template-columns: minmax(220px, 1fr) minmax(220px, 1.4fr); align-items: start; }
}

/* Stat tile */
.stat-tile {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: var(--s-3);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-width: 0;
}
.stat-figure {
  font-size: var(--t-stat);
  line-height: var(--lh-stat);
  font-weight: 500;
  letter-spacing: -0.01em;
  margin: 0;
  color: var(--ink);
}
.stat-figure small { font-size: 0.45em; font-weight: 400; color: var(--ink-2); margin-left: 0.2em; }
.stat-label { font-size: var(--t-base); margin: 0; }
.stat-tile .footnote { margin-top: auto; }
.caveat-line {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  margin: 0;
  font-size: var(--t-sm);
  line-height: var(--lh-sm);
  color: var(--ink-2);
}
.caveat-line .chip { flex: none; }

/* Caveat card: gold left rule, serif italic; never in a footer */
.caveat-card {
  background: var(--surface-2);
  border-left: 3px solid var(--accent-inquiry);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: var(--s-2) var(--s-3);
  font-family: var(--font-serif);
  font-style: italic;
  color: var(--ink-2);
  min-width: 0;
}
.caveat-card > :last-child { margin-bottom: 0; }
.caveat-card .caveat-label {
  display: block;
  font-family: var(--font-mono);
  font-style: normal;
  font-size: var(--t-xs);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent-inquiry);
  margin-bottom: 0.35rem;
}

/* Mechanism card */
.mechanism-card {
  position: relative;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: var(--s-3);
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.mechanism-card h3 { margin-top: 0; padding-right: var(--s-4); }
.mechanism-card p { color: var(--ink-2); }
.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0 0 var(--s-2);
  padding: 0;
  list-style: none;
}
.pill-row li { margin: 0; }
.where {
  margin: auto 0 0;
  font-size: var(--t-sm);
  line-height: var(--lh-sm);
  color: var(--ink-2);
}
.where b { font-weight: 500; color: var(--ink-3); }
/* In a stat tile the file path gets its own line: it is long, and a mid-token
   break after "Source:" reads worse than a full-width line. */
.stat-tile .where .path { display: block; }
/* Hatched corner ribbon marks a proposed mechanism */
.ribbon {
  position: absolute;
  top: 0;
  right: 0;
  width: 64px;
  height: 64px;
  clip-path: polygon(100% 0, 0 0, 100% 100%);
  background: var(--surface-2) var(--hatch);
  pointer-events: none;
}

/* Evidence table */
.table-scroll {
  overflow-x: auto;
  max-width: 100%;
  container-type: inline-size;   /* captions and caveat rows size against this box, see below */
  margin: 0 0 var(--s-3);
  /* Edge fade that only shows when there is more to scroll (background-attachment trick) */
  background:
    linear-gradient(to right, var(--bg) 40%, rgba(255, 255, 255, 0)) left / 32px 100% no-repeat local,
    linear-gradient(to left, var(--bg) 40%, rgba(255, 255, 255, 0)) right / 32px 100% no-repeat local,
    linear-gradient(to right, var(--edge-shadow), rgba(0, 0, 0, 0)) left / 14px 100% no-repeat scroll,
    linear-gradient(to left, var(--edge-shadow), rgba(0, 0, 0, 0)) right / 14px 100% no-repeat scroll;
}
.table-scroll:focus-visible { outline-offset: 2px; }
.evidence-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: var(--t-sm);
  line-height: var(--lh-sm);
  caption-side: top;
  text-align: left;
}
.evidence-table caption {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: var(--t-base);
  line-height: var(--lh-md);
  color: var(--ink-2);
  text-align: left;
  padding: 0 0 0.6rem;
  caption-side: top;
  /* keep the caption readable when the table itself is wider than the viewport
     (viewport fallback; the container-query rule below is the real limit) */
  max-width: min(calc(100vw - 2 * var(--gutter)), calc(var(--container) - 2 * var(--gutter)));
}
@supports (container-type: inline-size) {
  /* The scroll box may sit inside a padded .figure or a card, so its width is
     not the viewport minus the gutters. Size against the box itself. */
  .evidence-table caption, .evidence-table .caveat-body { max-width: 100cqw; }
}
.evidence-table th, .evidence-table td {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
  white-space: nowrap;
}
.evidence-table thead th {
  font-weight: 600;
  font-size: var(--t-xs);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-2);
  border-bottom: 2px solid var(--ink);
}
.evidence-table .num, .evidence-table td[data-num] { text-align: right; }
.evidence-table th.num { text-align: right; }
.evidence-table tbody th { font-weight: 500; }
.evidence-table .wrap { white-space: normal; min-width: 18ch; }
/* First column stays put on horizontal scroll */
.evidence-table th:first-child, .evidence-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  background: var(--bg);
  box-shadow: 1px 0 0 var(--rule);
}
.evidence-table thead th:first-child { box-shadow: none; }
/* Caveat row under the body: gold left rule, surface-2, sticks with the viewport */
.evidence-table .caveat-row td {
  position: static;
  padding: 0;
  background: var(--surface-2);
  box-shadow: none;
  white-space: normal;
  border-bottom: 1px solid var(--rule);
}
.evidence-table .caveat-body {
  position: sticky;
  left: 0;
  box-sizing: border-box;
  max-width: min(calc(100vw - 2 * var(--gutter)), calc(var(--container) - 2 * var(--gutter)));
  padding: 0.6rem 0.75rem 0.6rem calc(0.75rem + 3px);
  box-shadow: inset 3px 0 0 var(--accent-inquiry);
  font-family: var(--font-serif);
  font-style: italic;
  font-size: var(--t-sm);
  color: var(--ink-2);
}

/* Evidence class chip: mono, monochrome, 1 px outline, 2 px radius */
.chip {
  display: inline-block;
  font-size: var(--t-xs);
  line-height: var(--lh-xs);
  font-weight: 500;
  padding: 0 0.35em;
  border: 1px solid var(--ink-2);
  border-radius: 2px;
  color: var(--ink);
  background: transparent;
  white-space: nowrap;
  vertical-align: 0.05em;
}
.chip-legend { list-style: none; padding: 0; margin: 0 0 var(--s-2); display: grid; gap: 0.35rem; font-size: var(--t-sm); }
.chip-legend li { margin: 0; display: flex; gap: 0.6rem; align-items: baseline; }

/* Status pill: shape + text carry the state; colour is secondary */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  font-size: var(--t-xs);
  line-height: var(--lh-xs);
  font-weight: 500;
  padding: 0.15em 0.6em;
  border: 1px solid var(--baseline);
  border-radius: 999px;
  color: var(--ink);
  background-color: transparent;
  white-space: nowrap;
  vertical-align: middle;
}
.pill-measured, .pill-pass  { border-color: var(--accent-evidence); }
.pill-simulated             { border-color: var(--baseline); }
.pill-implemented           { background-color: var(--ink); color: var(--bg); border-color: var(--ink); }
.pill-tested                { border-color: var(--ink); }
.pill-proposed              { border-color: var(--accent-inquiry); border-style: dashed; background-color: var(--surface); background-image: var(--hatch); }
.pill-in-progress           { background-color: var(--accent-inquiry); color: var(--on-accent); border-color: var(--accent-inquiry); }
.pill-superseded            { border-color: var(--baseline); color: var(--ink-2); text-decoration: line-through; }
.pill-planned, .pill-not-started { border-color: var(--baseline); border-style: dashed; }
.pill-configuration         { border-color: var(--baseline); }
.pill-design                { border-color: var(--baseline); }

/* Hatched fill: proposed or unimplemented. Never for shipped elements. */
.hatched { background-color: var(--surface); background-image: var(--hatch); }

/* Ladder: rungs listed in DOM order (Gate 0 first), rendered bottom-up */
.ladder {
  list-style: none;
  margin: 0 0 var(--s-3);
  padding: 0 0 0 1.75rem;
  display: flex;
  flex-direction: column-reverse;
  max-width: var(--measure);
}
.ladder > li {
  position: relative;
  margin: 0;
  padding: 0.6rem 0.75rem 0.6rem 0.5rem;
  border-radius: var(--radius);
}
.ladder > li + li { margin-bottom: 0.25rem; }
/* rung dot */
.ladder > li::before {
  content: "";
  position: absolute;
  left: calc(-1.75rem + 3px);
  top: 1.05rem;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent-evidence);
  border: 1px solid var(--accent-evidence);
  z-index: 1;
}
/* thread: each rung draws its own full-height segment so segments abut;
   the bottom rung (first in DOM) starts at its dot, the top rung ends at its dot */
.ladder > li::after {
  content: "";
  position: absolute;
  left: calc(-1.75rem + 7px);
  top: -0.25rem;
  bottom: 0;
  border-left: 1px solid var(--accent-evidence);
}
.ladder > li:first-child::after { top: -0.25rem; bottom: auto; height: calc(0.25rem + 1.05rem + 5px); }
.ladder > li:last-child::after { top: calc(1.05rem + 5px); }
.ladder > li:only-child::after { display: none; }
.ladder > .rung-not-started { background-image: var(--hatch); }
.ladder > .rung-not-started::before { background: var(--bg); border-color: var(--baseline); border-style: dashed; }
.ladder > .rung-not-started::after { border-left-style: dashed; border-left-color: var(--baseline); }
.rung-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.6rem;
  font-size: var(--t-sm);
  font-weight: 500;
}
.rung-req { margin: 0.3rem 0 0; font-size: var(--t-sm); color: var(--ink-2); }


/* --------------------------------------------------------------------------
   7. Figures, citations, footnotes / sidenotes, source ledger
   -------------------------------------------------------------------------- */

.figure {
  margin: var(--s-4) 0;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: var(--s-2);
  color: var(--ink);                  /* currentColor strokes inherit this */
  min-width: 0;
}
.figure svg { display: block; width: 100%; height: auto; }
.figure figcaption {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: var(--t-sm);
  line-height: var(--lh-sm);
  color: var(--ink-2);
  margin-top: var(--s-2);
}
.figure figcaption .fig-source { font-family: var(--font-mono); font-style: normal; display: block; margin-top: 0.25rem; }
.figure .data-table { margin: var(--s-1) 0 0; }
.figure .data-table summary { font-size: var(--t-sm); }
.figure .data-table .table-scroll { margin: 0; }
.figure-legend {
  list-style: none;
  margin: 0.5rem 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem var(--s-2);
  font-family: var(--font-mono);
  font-size: var(--t-xs);
  color: var(--ink-2);
}
.figure-legend li { margin: 0; display: inline-flex; align-items: center; gap: 0.4rem; }
.swatch { display: inline-block; width: 14px; height: 14px; border: 1px solid var(--ink-2); border-radius: 2px; flex: none; }
.swatch-evidence { background: var(--accent-evidence); border-color: var(--accent-evidence); }
.swatch-inquiry { background: var(--accent-inquiry); border-color: var(--accent-inquiry); }
.swatch-baseline { background: var(--baseline); border-color: var(--baseline); }
.swatch-hatched { background: var(--surface) var(--hatch); border-style: dashed; }
.swatch-solid { background: var(--surface-2); }
.swatch-dotted { background: var(--surface-2); border-style: dotted; }

/* Citation superscript. Renders as [n] so the link is not colour-only. */
.cite {
  font-size: var(--t-xs);
  line-height: 0;
  vertical-align: super;
  text-decoration: none;
  color: var(--accent-evidence);
  padding: 0 0.1em;
  white-space: nowrap;
}
.cite::before { content: "["; }
.cite::after { content: "]"; }
.cite:hover, .cite:focus-visible { text-decoration: underline; }

/* Footnote (inline details below 1100 px; margin sidenote at 1100 px and up) */
.footnote {
  margin: 0.25rem 0 var(--s-2);
  padding-left: 0.75rem;
  border-left: 2px solid var(--rule);
  font-size: var(--t-sm);
  line-height: var(--lh-sm);
  color: var(--ink-2);
  scroll-margin-top: calc(var(--nav-h) + var(--s-2));
}
.footnote > summary { color: var(--ink); font-weight: 500; }
.footnote > summary::before { content: "\25B8"; }
.footnote[open] > summary::before { content: "\25BE"; }
.footnote:target { border-left-color: var(--accent-evidence); }
.footnote dl {
  margin: 0.25rem 0 0.5rem;
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 0.2rem 0.75rem;
}
.footnote dt { color: var(--ink-3); }
.footnote dd { margin: 0; color: var(--ink); overflow-wrap: anywhere; }
.footnote .path { color: var(--ink); }
.footnote-num { color: var(--accent-evidence); }
.noted { margin: 0 0 var(--s-2); }
.noted > p { margin-bottom: 0.5rem; }

@media (min-width: 1100px) {
  .noted {
    display: grid;
    grid-template-columns: minmax(0, var(--measure)) var(--sidenote-w);
    column-gap: var(--sidenote-gap);
    align-items: start;
  }
  .noted > * { grid-column: 1; min-width: 0; }
  .noted > .footnote {
    grid-column: 2;
    margin: 0;
    padding-left: 0.75rem;
    border-left: 2px solid var(--rule);
  }
  .noted > .footnote > summary { min-height: 0; padding: 0.25rem 0; }
}

/* Source ledger: every file cited on the page, once, with sections */
.source-ledger {
  margin-top: var(--s-8);
  padding-top: 0;
  border-top: 0;
  font-size: var(--t-sm);
  line-height: var(--lh-sm);
  color: var(--ink-2);
}
/* Top rule drawn on the content box so it lines up with .lineage-thread and
   the footer rule (inset by the gutter), not on the padded .container box. */
.source-ledger::before {
  content: "";
  display: block;
  height: 1px;
  background: var(--rule);
  margin: 0 0 var(--s-3);
}
.source-ledger h2 { font-family: var(--font-sans); font-size: var(--t-md); }
.source-ledger ol { padding-left: 1.6rem; margin: 0; }
.source-ledger li { margin: 0.35rem 0; }
.source-ledger .path { color: var(--ink); }


/* --------------------------------------------------------------------------
   8. CTA band and footer
   -------------------------------------------------------------------------- */

.cta-band {
  background: var(--surface-2);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  padding-block: var(--s-6);
  margin-top: var(--s-8);
}
.cta-band h2 { margin-top: 0; }
.cta-band p { max-width: var(--measure); color: var(--ink-2); }
.cta-actions { margin: 0; }

.footer {
  padding-block: var(--s-6) var(--s-4);
  font-size: var(--t-sm);
  line-height: var(--lh-sm);
  color: var(--ink-2);
}
.footer-cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr));
  gap: var(--s-3) var(--s-4);
  margin-bottom: var(--s-4);
}
.footer-col h2 {
  font-family: var(--font-mono);
  font-size: var(--t-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 0 0 0.5rem;
}
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li { margin: 0; }
.footer-col a { display: inline-block; padding: 0.4rem 0; color: var(--ink); }
.footer-col a:hover, .footer-col a:focus-visible { color: var(--accent-evidence); }
.footer-legal {
  padding-top: var(--s-2);
  border-top: 1px solid var(--rule);
}
.footer-legal p { margin: 0 0 0.5rem; max-width: none; }
.site-status { font-size: var(--t-sm); color: var(--ink-3); }
.footer-correction { color: var(--ink-2); }


/* --------------------------------------------------------------------------
   9. Utilities
   -------------------------------------------------------------------------- */

.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;
}
.muted { color: var(--ink-3); }
.ink-2 { color: var(--ink-2); }
.measure { max-width: var(--measure); }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.stack > * + * { margin-top: var(--s-2); }
.flow-2 { margin-block: var(--s-2); }
.flow-4 { margin-block: var(--s-4); }


/* --------------------------------------------------------------------------
   10. Print — ink on white; docs.html and research.html add tuning of their own
   -------------------------------------------------------------------------- */

@media print {
  :root {
    --bg: #FFFFFF; --surface: #FFFFFF; --surface-2: #FFFFFF;
    --ink: #000000; --ink-2: #000000; --ink-3: #333333;
    --rule: #999999;
    --accent-evidence: #000000; --accent-inquiry: #000000; --baseline: #666666;
    --on-accent: #FFFFFF;
    --hatch-ink: rgba(0, 0, 0, 0.35);
    --edge-shadow: transparent;
  }
  html { font-size: 11pt; }
  body { background: #FFFFFF; color: #000000; }
  .nav, .nav-toggle, .cta-band, .skip-link, .code-toolbar, .copy-btn { display: none !important; }
  a { color: #000000; }
  a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-family: var(--font-mono);
    font-size: var(--t-xs);
    word-break: break-all;
  }
  .cite::after { content: "]"; }
  /* sidenotes forced inline */
  .noted { display: block; }
  .noted > .footnote { margin: 0.25rem 0 1rem; }
  /* details forced open where the browser exposes ::details-content
     (Chromium 131+, Safari 18.4+, Firefox 138+); older engines print them closed */
  details::details-content { content-visibility: visible; display: block; }
  summary::before { display: none; }
  table, figure, .figure, .stat-tile, .mechanism-card, .caveat-card, pre, .ladder > li { break-inside: avoid; page-break-inside: avoid; }
  h1, h2, h3 { break-after: avoid; page-break-after: avoid; }
  .table-scroll { overflow: visible; background: none; }
  .evidence-table th:first-child, .evidence-table td:first-child { position: static; box-shadow: none; }
  .evidence-table th, .evidence-table td { white-space: normal; }
  .evidence-table .caveat-body { position: static; max-width: none; border-left: 3px solid #000; box-shadow: none; }
  .stat-tile, .mechanism-card, .figure { border-color: #999999; }
  .caveat-card { border-left-color: #000000; background: #FFFFFF; }
  .banner { border: 1px solid #999999; }
  .pill-in-progress, .pill-implemented { background: #FFFFFF; color: #000000; border: 1px solid #000000; }
}


/* --------------------------------------------------------------------------
   11. Motion — only 120 ms colour/opacity, and none under reduced motion
   -------------------------------------------------------------------------- */

a, .btn, .pill, .chip, .nav-links a, .nav-toggle, .copy-btn, summary, .logo {
  transition: color var(--transition), background-color var(--transition),
              border-color var(--transition), opacity var(--transition);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition: none !important;
    animation: none !important;
    scroll-behavior: auto !important;
  }
}

/* --------------------------------------------------------------------------
   12. New components (blog buyer's-guide, benchmarks market-comparison,
   ambient background canvas): built on the same tokens as everything above,
   one palette, no overrides.
   -------------------------------------------------------------------------- */

/* Ambient fabric canvas: a faint drifting mesh behind content, referencing the
   "fabric" in the brand name. Fixed, non-interactive, very low contrast so it
   never competes with text; off entirely when motion is reduced. */
#fabric-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.5;
}
@media (prefers-reduced-motion: reduce) {
  #fabric-bg { display: none; }
}

/* Blog / buyer's-guide layout */
.guide-hero { max-width: 78ch; }
.decision-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s-3);
  margin: var(--s-4) 0;
}
.pick-card {
  border: 1px solid var(--rule);
  border-top: 3px solid var(--accent-evidence);
  border-radius: var(--radius);
  background: var(--surface);
  padding: var(--s-3);
}
.pick-card h3 { margin-top: 0; }
.small-note { color: var(--ink-2); font-size: var(--t-sm); }

/* Market-comparison section (benchmarks.html) */
.market-compare { margin-block: var(--s-6); }
.compare-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s-4);
  margin: var(--s-3) 0 var(--s-4);
}
.bar-chart { display: grid; gap: 0.6rem; margin: var(--s-2) 0; }
.bar-row {
  display: grid;
  grid-template-columns: minmax(150px, 1.1fr) minmax(120px, 2fr) 4.5rem;
  align-items: center;
  gap: 0.75rem;
  font: 500 var(--t-sm)/1.3 var(--font-mono);
  color: var(--ink);
}
.bar-row i {
  display: block;
  height: 10px;
  width: calc(var(--v) * 1%);
  max-width: 100%;
  background: var(--accent-evidence);
  border-radius: 999px;
}
.bar-row b { text-align: right; font-variant-numeric: tabular-nums; }
.bar-row--self i { background: var(--accent-inquiry, #9A6A12); }
.bar-row--self span { font-weight: 700; }
.compare-grid--single { grid-template-columns: minmax(0, 1fr); max-width: 640px; }
.latency-points {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
  margin: var(--s-3) 0;
  border-radius: var(--radius);
  overflow: hidden;
}
.latency-points > div { background: var(--surface); padding: var(--s-2); }
.latency-points strong { display: block; font-size: var(--t-sm); }
.latency-points span {
  display: block;
  font: 600 clamp(1.25rem, 2vw, 1.7rem)/1.15 var(--font-mono);
  margin: 0.4rem 0;
  color: var(--ink);
}
.latency-points small { display: block; color: var(--ink-2); line-height: 1.45; font-size: var(--t-xs); }
.pricing-table td, .pricing-table th { vertical-align: top; }

@media (max-width: 820px) {
  .compare-grid, .decision-grid { grid-template-columns: 1fr; }
  .latency-points { grid-template-columns: 1fr 1fr; }
  .bar-row { grid-template-columns: 120px 1fr 3.6rem; }
}
@media (max-width: 520px) {
  .latency-points { grid-template-columns: 1fr; }
  .bar-row { grid-template-columns: 100px 1fr 3.2rem; font-size: var(--t-xs); }
}

/* ===========================================================================
   13. Instrument plate — the light inset that carries the tesseract and the
   interactive Pareto plot.

   Paper, like the rest of the site: a white plate with a ruled border, the
   tesseract drawn in faint ink behind it. The display face is a condensed
   grotesque in sentence case (no all-caps anywhere). The two data hues are
   the validated pair blue #1064BE / gold #9A6A12 — all six checks pass on
   white: chroma >= 0.1, CVD dE 25.2 protan, 27.7 normal, both >= 3:1.
   =========================================================================== */
:root {
  --plate-bg: #FFFFFF;
  --plate-rule: var(--rule);
  --plate-ink: var(--ink);
  --plate-ink-2: var(--ink-2);
  --data-self: #9A6A12;   /* gold — local-first (the site's inquiry accent) */
  --data-other: #1064BE;  /* blue — cloud or self-host */
  --font-display: "Oswald", "IBM Plex Sans Condensed", "Arial Narrow", sans-serif;
  --font-plate-mono: "Special Elite", "IBM Plex Mono", ui-monospace, monospace;
}

.plate {
  position: relative;
  isolation: isolate;
  background: var(--plate-bg);
  color: var(--plate-ink);
  border: 1px solid var(--rule);
  border-top: 3px solid var(--data-self);
  border-radius: var(--radius);
  overflow: hidden;
  margin: var(--s-6) 0;
  padding: clamp(1.5rem, 4vw, 2.75rem) clamp(1rem, 3vw, 2.25rem);
}
/* Faint blueprint rule grid, then the tesseract canvas, then the content. */
.plate::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image:
    linear-gradient(rgba(16, 100, 190, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(16, 100, 190, 0.05) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse 75% 65% at 50% 45%, #000 40%, transparent 100%);
}
#plate-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  opacity: 0.9;
  pointer-events: none;
}
.plate > * { position: relative; z-index: 1; }

.plate-eyebrow {
  font-family: var(--font-plate-mono);
  font-size: var(--t-xs);
  letter-spacing: 0.12em;
  color: var(--data-self);
  margin: 0 0 0.6rem;
}
.plate h2 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.8rem, 4.6vw, 2.9rem);
  line-height: 1.08;
  letter-spacing: 0.002em;
  color: var(--ink);
  margin: 0 0 0.7rem;
  max-width: 24ch;
}
.plate h3 {
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--ink);
  font-size: var(--t-md);
  margin: 0 0 0.4rem;
}
.plate p { color: var(--ink-2); max-width: 66ch; }
.plate strong { color: var(--ink); }

/* --- Pareto plot ---------------------------------------------------------- */
.pareto-mode {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: var(--s-3) 0 var(--s-2);
}
.pareto-mode button {
  font-family: var(--font-plate-mono);
  font-size: var(--t-xs);
  letter-spacing: 0.06em;
  color: var(--ink-2);
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 999px;
  padding: 0.55rem 1.1rem;
  min-height: var(--touch);
  cursor: pointer;
}
.pareto-mode button:hover { color: var(--ink); border-color: var(--data-other); }
.pareto-mode button[aria-pressed="true"] {
  color: var(--on-accent);
  background: var(--data-self);
  border-color: var(--data-self);
}
.pareto-plot { margin: var(--s-2) 0; }
.pareto-svg { width: 100%; height: auto; display: block; overflow: hidden; }
.po-tick { font-family: var(--font-mono); font-size: 11px; fill: var(--ink-3); }
.po-axis { font-family: var(--font-plate-mono); font-size: 12px; fill: var(--ink-2); letter-spacing: 0.04em; }
.po-label { font-family: var(--font-display); font-size: 15px; font-weight: 500; fill: var(--ink); letter-spacing: 0.01em; }
.po-label-self { fill: var(--data-self); font-weight: 600; }
.po-label-muted { fill: var(--ink-3); font-size: 12px; font-family: var(--font-mono); }
.po-value { font-family: var(--font-mono); font-size: 11px; fill: var(--ink-3); }
.po-rail-head { font-family: var(--font-plate-mono); font-size: 10px; fill: var(--ink-3); letter-spacing: 0.06em; }
.po-pt { cursor: pointer; }
.po-pt:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
.po-front { animation: po-march 2.6s linear infinite; }
@keyframes po-march { to { stroke-dashoffset: -20; } }

.pareto-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.4rem;
  font-family: var(--font-mono);
  font-size: var(--t-xs);
  color: var(--ink-2);
  margin: var(--s-2) 0;
}
.pareto-legend span { display: inline-flex; align-items: center; gap: 0.5rem; }
.pareto-legend i { width: 13px; height: 13px; border-radius: 50%; border: 2.5px solid currentColor; flex: none; }
.pareto-legend .lg-local { color: var(--data-self); }
.pareto-legend .lg-local i { background: var(--data-self); }
.pareto-legend .lg-cloud { color: var(--data-other); }
.pareto-legend .lg-none { color: var(--ink-3); }
.pareto-legend .lg-none i { border-style: dashed; }
.pareto-legend .lg-front { color: var(--data-self); }
.pareto-legend .lg-front i { border-radius: 0; height: 0; width: 22px; border-width: 0 0 2px; border-style: dashed; }

.pareto-readout {
  border: 1px solid var(--rule);
  border-left: 3px solid var(--data-self);
  border-radius: var(--radius);
  padding: var(--s-2) var(--s-3);
  min-height: 7.5rem;
  background: var(--surface-2);
}
.po-name {
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: 0.01em;
  font-size: var(--t-md);
  color: var(--ink) !important;
  margin: 0 0 0.5rem;
}
.po-hint { font-size: var(--t-sm); margin: 0; }
.po-dl { margin: 0; }
.po-dl dt {
  font-family: var(--font-mono);
  font-size: var(--t-xs);
  letter-spacing: 0.04em;
  color: var(--data-self);
}
.po-dl dd { margin: 0.2rem 0 0.7rem; color: var(--ink-2); font-size: var(--t-sm); }
.po-dl b { color: var(--ink); font-family: var(--font-mono); }

/* The base .caveat-line is a flex row for its chip; in the plate it is a full
   paragraph, so it has to lay out as one. */
.plate .caveat-line {
  display: block;
  color: var(--ink-2);
  border-left: 2px solid var(--data-self);
  padding-left: 0.85rem;
  font-size: var(--t-sm);
  max-width: 78ch;
  margin: var(--s-3) 0;
}
.plate .caveat-line .chip { display: inline-block; margin-left: 0.4rem; vertical-align: baseline; }

@media (min-width: 900px) {
  .pareto-grid { display: grid; grid-template-columns: minmax(0, 1fr) 19rem; gap: var(--s-4); align-items: start; }
}
@media (prefers-reduced-motion: reduce) {
  .po-front { animation: none; }
}
@media print {
  .plate::before, #plate-bg, .pareto-mode { display: none !important; }
}

/* ---------------------------------------------------------------------------
   §12  LoCoMo accuracy chart and Track 1 rhythm  (benchmarks.html)

   The earlier scatter plotted twenty figures, several of them the same system
   under different protocols, and drew a computed frontier across them. It read
   as a field of unrelated dots and the frontier was not a claim this evidence
   supports, so both are gone. What replaces them is a ranked bar chart: one
   row per system, one published figure each, the protocol printed under the
   name, and no derived geometry of any kind.
   --------------------------------------------------------------------------- */
.lc-figure { margin: var(--s-3) 0 var(--s-2); }
.lc-plot { margin: 0 0 var(--s-2); }
.lc-svg { width: 100%; height: auto; display: block; }

.lc-row .lc-bar { transition: opacity 0.12s ease; }
.lc-row:hover .lc-bar { opacity: 0.82; }
.lc-row:focus-visible { outline: 2px solid var(--accent-evidence); outline-offset: 2px; }

.lc-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem var(--s-3);
  margin: 0 0 var(--s-2);
  font-size: var(--t-sm);
  color: var(--ink-2);
}
.lc-legend span { display: inline-flex; align-items: center; gap: 0.5rem; }
.lc-legend i { width: 12px; height: 12px; border-radius: 2px; background: currentColor; flex: none; }
.lc-legend .lg-local { color: var(--data-self); }
.lc-legend .lg-cloud { color: var(--data-other); }

.lc-figure figcaption {
  color: var(--ink-2);
  font-size: var(--t-sm);
  line-height: 1.55;
  max-width: 78ch;
  border-top: 1px solid var(--rule);
  padding-top: var(--s-2);
  margin: 0;
}

/* Track 1 (LoCoMo): a stated head instead of a bare H2, and a steady rule
   between each stage of the write-up so the long section reads in steps. */
.track-locomo .track-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.4rem var(--s-3);
  margin-bottom: var(--s-4);
  padding: var(--s-2) var(--s-3);
  border-left: 3px solid var(--accent-evidence);
  border-radius: var(--radius);
  background: var(--surface-2);
}
.track-locomo .track-head h2 { margin: 0; }
.track-locomo .track-head .pill-row { margin: 0; }
.track-locomo > h3 {
  margin-top: var(--s-5);
  padding-top: var(--s-2);
  border-top: 1px solid var(--rule);
}
.track-locomo > h3:first-of-type { margin-top: var(--s-3); }

@media (max-width: 719.98px) {
  .track-locomo .track-head { display: block; }
  .track-locomo .track-head .pill-row { margin-top: 0.5rem; }
}

.lc-legend .lg-range { color: var(--data-other); }
.lc-legend .lg-range i { opacity: 0.32; }

/* Hero banner: repository call-to-action and the local-first headline claim. */
.repo-star { margin: 0 0 var(--s-3); }
.star-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem 1.1rem;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink-2);
  font-size: var(--t-sm);
  text-decoration: none;
  line-height: 1;
}
.star-pill b { color: var(--ink); font-weight: 600; }
.star-pill:hover, .star-pill:focus-visible {
  border-color: var(--accent-evidence);
  color: var(--ink);
}
.hero-claim {
  margin: 0 0 var(--s-3);
  max-width: 34ch;
  font-size: clamp(1.25rem, 3.2vw, 1.6rem);
  line-height: 1.32;
  color: var(--ink-2);
}
.hero-claim b { color: var(--ink); font-weight: 700; }
.claim-figure {
  color: var(--accent-inquiry);
  font-weight: 700;
  border-bottom: 2px dotted var(--accent-inquiry);
  padding-bottom: 0.08em;
}
