/* tokens.css — resolved parameters as custom properties.
   Values adjudicated in RECONCILIATION.md; conflict IDs cited inline.
   Defined ONCE. Templates never redefine these and never introduce magic numbers. */

:root {

  /* ── Palette — monochrome, no accent (C5) ─────────────────────────────── */
  --paper:     #F5F5F5;                 /* measured, "softer than pure white" (C6) */
  --ink:       #171717;                 /* never pure #000 */
  --ink-soft:  rgba(23, 23, 23, .62);   /* = #6B6B6B, 4.89:1 on paper. Passes 4.5:1
                                           with only .39 of headroom — do NOT lighten */
  --rule:      rgba(23, 23, 23, .22);   /* hairlines are the only ornament */
  /* NO --accent. Wayfinding is carried by weight, underline and position.
     Anything that would key off an accent uses currentColor instead. */

  /* ── Space — measured 1 / 2 / 4 system on a 13.5px base (C7) ──────────── */
  --u-half: 6.75px;
  --u1:     13.5px;   /* local padding, rail item separation */
  --u2:     27px;     /* column gutters, gallery gaps */
  --u4:     54px;     /* major section intervals (54–58 observed) */
  /* The A§4 six-step px ladder and its space_scale formula are deliberately
     discarded. Do not reintroduce them. */

  /* ── Faces — three faces, five roles (C3) ─────────────────────────────────
     CJK families come AFTER the Latin ones: Latin glyphs resolve from the
     grotesque/serif, Han from the CJK family. Without an explicit CJK entry the
     browser substitutes arbitrarily. */
  /* register: mono. One face across all five roles.
     NOTE this collapses the "sans = data, serif = argument" split that the rest
     of the system was built on — see CLAUDE.md. Hierarchy now rests entirely on
     case, weight, italic and size. Roboto Mono ships true italics and 100–700
     weights, so all four Latin registers survive; Chinese still keeps only two.
     CJK has no monospace here: Han is full-width by construction, so the CJK
     fallbacks below sit naturally beside a mono Latin face. */
  --f-sans:  "Roboto Mono", ui-monospace, SFMono-Regular, Menlo, Consolas,
             "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC",
             monospace;
  --f-serif: var(--f-sans);
  --f-mono:  var(--f-sans);
  /* Headings — a geometric sans after antheaxin.com (Futura there; Jost is the
     open substitute). Series and group titles, work captions, painting names on
     the stage. Never body, metadata or argument — those stay mono. (C18) */
  --f-head: "Jost", "Futura", "Century Gothic",
            "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC",
            sans-serif;

  /* ── Type — sans = data, serif = argument. No exceptions. ─────────────── */
  --t-caption:  13.5px;   /* labels evidence. The floor — never go below */
  --t-meta:     15px;     /* dates, roles, credits, specs, routes (C2) */
  --t-thesis:   18px;     /* argument, interpretation (C2). Mono reads larger */
  --t-wordmark: 30px;    /* = 2 × --t-meta. The nearest value in the type
                            system to a 20% step; 27px (2 × base unit) was the
                            alternative and lands further from it. */
  --t-title:    46px;     /* 19.5 × 2.6 — the one display move (C4).
                             PROJECT PAGE ONLY. The home page has no work title
                             and therefore no display type: the index is the
                             content, and it presents rather than announces. */

  --lh-body:   1.55;
  --lh-thesis: 1.33;      /* measured 20/26 */
  --lh-tight:  1.15;
  --track:     .08em;     /* Latin only. Mono is already wide — less tracking */

  --thumb:     640px;     /* index plate. Uniform 3:2 source assets, so the
                             column is regular without any cropping (C10) */
  --measure:   62ch;      /* in mono, ch is literal: 62 characters per line (52 + 20%, client) */
  --gallery-measure: calc(86 * .6 * var(--t-meta));   /* 774px — the gallery statement's width
                       (86ch of the 15px mono body). Prose on the offering pages uses it too. */

  /* ── Shell (C1) ───────────────────────────────────────────────────────── */
  --rail:  15%;
  --field: 70%;
  --hair:  1px;
  --glyph-h: 46px;   /* the 昕 mark in the rail head; the local rail aligns to it */
  --bp-collapse: 800px;
  --bp-tight:    520px;

  /* ── Motion — budget raised 30 → 45 for the aural panel ────────────────
     A-band motion permits hover-reveal plus an opacity fade. The panel glide
     adds a short transform, which is above that; the parameter moves with it
     rather than the build quietly exceeding a stated budget. Still nowhere near
     the refused vocabulary: no parallax, no scroll-jack, no reveal cascades.
     Raised again 45 → 80 for the immersive stage — see immersive.css, C16/C17. */
  --fade:  220ms;
  --glide: 260ms;
  --ease:  cubic-bezier(.16, .84, .44, 1);
}

/* ── Dark palette ─────────────────────────────────────────────────────────
   Inverted paper/ink with the rule opacity raised, per CARGO-SENSIBILITY §6:
   "If you go dark, invert --paper/--ink and drop rule opacity to ~0.28."
   LIGHT IS THE DEFAULT (client, C78), whatever the system preference; dark is
   the option. Only an explicit data-theme="dark" (the rail toggle, stored)
   applies it. With JS off no attribute is set, so those readers get light. */
:root[data-theme="dark"] {
  --paper:    #111013;
  --ink:      #E8E4DA;
  --ink-soft: rgba(232, 228, 218, .66);
  --rule:     rgba(232, 228, 218, .28);
}

*, *::before, *::after { box-sizing: border-box; }

html { background: var(--paper); }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: var(--t-meta) / var(--lh-body) var(--f-sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, video, iframe { display: block; max-width: 100%; }
img, video { height: auto; }

a { color: inherit; text-decoration: none; }

/* The UA gives [hidden] `display: none` at the lowest possible specificity, so
   any component rule that sets display silently defeats it. Everything here is
   toggled by the hidden attribute, so make it win. */
[hidden] { display: none !important; }

h1, h2, h3 { font-size: inherit; font-weight: inherit; margin: 0; }
ul, ol { list-style: none; margin: 0; padding: 0; }
/* The UA gives <figure> `margin: 1em 40px`, which insets every plate from the
   column it is supposed to align to. Media must be flush with the text edge. */
figure, blockquote { margin: 0; }
p { margin: 0; }

/* Read aloud, never seen — e.g. "(external site)" after the Shop link. */
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%);
  white-space: nowrap;
}

/* Focus resolves to currentColor because there is no accent (C5). */
:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: .001ms !important;
    animation-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}
