/* Touchstone — the material system. Everything shared by every page.
   Linked FIRST, before any page's own sheet.

   THE GOVERNING IDEA: the identity owns no hue. A touchstone has no streak
   colour of its own — the assayer streaks the sample across the stone and reads
   it against needles of known alloy. The stone contributes darkness, flatness
   and fine grain: the conditions under which a mark can be read. So the only
   saturated colour on this site is measurement output, and a site whose only
   colours are its own measurements cannot be accused of dressing the data.

   Companion rule: stone is machine territory, paper is prose territory, in both
   themes. You streak on the stone; you read the report on paper.

   This file exists because the spine and the bench need the same palette, and
   two stylesheets each carrying their own copy is the drift shape this project
   has been bitten by more than once. There is exactly one copy. */

/* ---------- the two faces, served same-origin ----------
   No font CDN: a standard that phones a vendor to render its own specification
   has conceded the argument before the reader reaches the arithmetic. */
@font-face {
  font-family:"Source Serif 4"; font-style:normal; font-weight:200 900; font-display:swap;
  src:url("/fonts/source-serif-4-latin-roman.woff2") format("woff2");
}
@font-face {
  font-family:"Source Serif 4"; font-style:italic; font-weight:200 900; font-display:swap;
  src:url("/fonts/source-serif-4-latin-italic.woff2") format("woff2");
}
@font-face {
  font-family:"IBM Plex Mono"; font-style:normal; font-weight:400; font-display:swap;
  src:url("/fonts/ibm-plex-mono-latin-400.woff2") format("woff2");
}
@font-face {
  font-family:"IBM Plex Mono"; font-style:normal; font-weight:600; font-display:swap;
  src:url("/fonts/ibm-plex-mono-latin-600.woff2") format("woff2");
}

/* ---------- palette ----------
   Basanite is lydite: green-black, deliberately not the steward's near-black.
   Contrast, computed: Ink/Paper 14.55 · Chalk/Basanite 14.71 · Slate/Paper 5.96 ·
   Ash/Basanite 7.81 · errors 6.64/5.85. All AA; the body pairs are AAA. */
:root {
  --basanite:#171A16; --stone-up:#1E221D; --chalk:#EDEBE3; --ash:#A9AFA2;
  --paper:#F7F6F1;    --paper-down:#EFEDE5; --ink:#20241F;  --slate:#5A605A;

  --serif:"Source Serif 4", Georgia, "Times New Roman", serif;
  --mono:"IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --type-00:.75rem; --type-0:.875rem; --type-1:1.0625rem;
  --type-2:1.25rem; --type-3:1.5625rem; --type-4:1.953rem;
  --type-5:clamp(2.4rem, 6vw, 3rem);   /* root headline only */

  /* Light is the default because the spec must read printed. Dark is not the
     brand; it is one of two grounds the identity composes for. */
  --bg:var(--paper); --bg-up:var(--paper-down); --fg:var(--ink); --muted:var(--slate);
  --line:#20241F26;          /* Ink 15% */
  --accent:var(--ink);       /* achromatic inversion accent — never a hue */
  --on-accent:var(--paper);
  --error:#9E3218;

  /* Stone panels are theme-INVARIANT: the machine surface stays the machine
     surface in both themes, which is what teaches a reader that a dark panel
     means executable. */
  --stone-fg:var(--chalk); --stone-muted:var(--ash); --stone-line:#EDEBE329;

  /* ---------- the six ratified bands ----------
     Validated computationally against the Machado (2009) deuteranopia model:
     worst adjacent-pair separation ΔE 14.4 against a target of ≥8, so every
     neighbour stays distinguishable to the roughly one male collector in twelve
     with a colour vision deficiency. These values do not move.

     THE COEXISTENCE LAW, forced by arithmetic rather than asserted: no band
     colour passes contrast as text on both grounds — gold is 1.94:1 on Paper,
     blue 2.78:1 on Basanite, bronze fails both at 3.69/4.40. Therefore band
     colour is NEVER text: only a filled shape, always keylined 1px in the
     ground's own ink, with a numeral computed per band, at ≥19px bold, and the
     same number repeated in body ink beside it. Colour may speak first; it must
     never speak alone. */
  --band-gold:#D4AF37; --band-blue:#2F5FA8; --band-green:#009E73;
  --band-violet:#7A4FA0; --band-bronze:#8F6E1C; --band-wine:#8A3A62;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg:var(--basanite); --bg-up:var(--stone-up); --fg:var(--chalk); --muted:var(--ash);
    --line:#EDEBE329;      /* Chalk 16% */
    --accent:var(--chalk); --on-accent:var(--basanite);
    --error:#E07856;
  }
}
:root[data-theme="dark"] {
  --bg:var(--basanite); --bg-up:var(--stone-up); --fg:var(--chalk); --muted:var(--ash);
  --line:#EDEBE329; --accent:var(--chalk); --on-accent:var(--basanite); --error:#E07856;
}
:root[data-theme="light"] {
  --bg:var(--paper); --bg-up:var(--paper-down); --fg:var(--ink); --muted:var(--slate);
  --line:#20241F26; --accent:var(--ink); --on-accent:var(--paper); --error:#9E3218;
}

/* ---------- base ---------- */
* { box-sizing:border-box; }
html { font-size:17px; }
body {
  background:var(--bg); color:var(--fg); margin:0; line-height:1.65;
  font-family:var(--serif); font-size:var(--type-1);
  -webkit-font-smoothing:antialiased;
}
.hidden { display:none; }

/* Interaction is achromatic: underline, inversion, weight — never a hue. */
a { color:var(--fg); text-decoration:none; border-bottom:1px solid var(--line); padding-bottom:1px; }
a:hover { border-bottom-color:var(--fg); }
:focus-visible { outline:2px solid var(--fg); outline-offset:2px; }

/* ---------- masthead: the standard names itself, and owns no flag ----------
   `TOUCHSTONE 0.1` in letterspaced mono caps, the version always attached —
   the standard naming itself the way it appears in a score result. No logo: a
   standard whose neutrality is the product should not have a flag.

   It links to `/` only because `/` now serves a page. It was plain text for as
   long as the root 404'd, since a masthead pointing at a 404 on every page is
   exactly the defect that killed the predecessor site — fourteen links, fourteen
   dead. The guard asserts the PAIRING, so the link and the page cannot move
   independently of each other. */
.masthead {
  display:inline-block; font-family:var(--mono); font-size:var(--type-00);
  text-transform:uppercase; letter-spacing:.14em; color:var(--muted); border-bottom:none;
}
.masthead:hover { color:var(--fg); }

/* ---------- the nav that carries the spine ----------
   Every destination here is asserted to exist by the served-tree guard, so a
   page cannot ship pointing at one that does not. */
.site-nav { display:flex; gap:18px; flex-wrap:wrap; margin:.9rem 0 0; padding:0; list-style:none; }
.site-nav a {
  font-family:var(--mono); font-size:var(--type-00); text-transform:uppercase;
  letter-spacing:.1em; color:var(--muted); border-bottom:1px solid transparent;
}
.site-nav a:hover { color:var(--fg); border-bottom-color:var(--fg); }
.site-nav a[aria-current="page"] { color:var(--fg); border-bottom-color:var(--fg); }

/* ---------- footer ---------- */
.site-foot {
  border-top:1px solid var(--line); margin-top:4rem; padding-top:1.4rem;
  color:var(--muted); font-size:var(--type-0);
}
.site-foot a { color:var(--muted); }
.site-foot a:hover { color:var(--fg); border-bottom-color:var(--fg); }
.site-foot p { margin:.35rem 0; }

/* ---------- motion discipline ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration:.01ms !important; animation-iteration-count:1 !important;
    transition-duration:.01ms !important;
  }
}
