/* ─────────────────────────────────────────────────────────────────────
   THE RULE — shared token layer.
   A rule is three things at once: the instrument you measure with, the
   line a printer sets between columns, and the principle you are held to.
   One foundation, two faces. This file is the foundation. The faces are
   workshop.css (caelum.codes) and observatory.css (caelum.agency); a page
   loads tokens.css, then exactly one face, then base.css.

   Authored, not harvested. The reasoning is in the comments on purpose so
   the next instance does not undo it. Source of record for the choices:
   the "Sky and Chisel" proposal, 22 Aug 2026.
   ───────────────────────────────────────────────────────────────────── */

:root {
  /* ── Type ──────────────────────────────────────────────────────────
     Display: Instrument Serif — high-contrast, slightly severe, named
       for the thing. Not the cream-and-serif look everything else has.
     Body: Newsreader — optical sizing, reads long without fatigue.
       Explicitly NOT Literata; that is the THD blog's voice.
     Data: Spline Sans Mono — tabular numerals wherever a figure appears.
       Numbers that line up are a claim about care.                    */
  --font-display: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --font-body:    "Newsreader", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --font-mono:    "Spline Sans Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  /* ── Scale ─────────────────────────────────────────────────────────
     Fluid steps. --step-0 is body. Nothing on either face sets a font
     size that is not one of these.                                    */
  --step--1: clamp(.78rem,  .76rem + .10vw, .84rem);
  --step-0:  clamp(1rem,    .97rem + .16vw, 1.09rem);
  --step-1:  clamp(1.2rem,  1.10rem + .40vw, 1.4rem);
  --step-2:  clamp(1.55rem, 1.35rem + .80vw, 2rem);
  --step-3:  clamp(2.1rem,  1.60rem + 2.0vw, 3.2rem);
  --step-4:  clamp(2.9rem,  1.90rem + 4.2vw, 5.4rem);

  /* ── Measure & rhythm ─────────────────────────────────────────── */
  --measure: 66ch;          /* long-form line length               */
  --measure-wide: 78rem;    /* page wrap                            */
  --gutter: clamp(1.1rem, 4vw, 3.5rem);
  --rise: 8px;              /* the ONE motion: an 8px rise on entry */

  /* ── Structure ─────────────────────────────────────────────────────
     Hairline rules, no rounded cards, no shadows. Every division is a
     ruled line. Nothing floats; nothing is a card pretending to be
     paper. radius 0 is a decision, not an omission.                  */
  --hairline: 1px;
  --radius: 0;

  /* ── Colour slots ──────────────────────────────────────────────────
     Declared here so a page that forgets its face still renders with
     something, and so the slot names are the contract. Each face
     overrides every one of these. Values below are the Workshop face,
     because a tool page with no face should still be usable.          */
  --ground:      #EDEFEC;
  --surface:     #F7F8F6;
  --surface-2:   #E3E6E2;
  --ink:         #171B19;
  --ink-muted:   #5A625D;
  --ink-faint:   #5C665F;
  --rule:        #B2B9B0;
  --rule-strong: #8E968F;
  --accent:      #26685F;
  --accent-soft: #DCEAE6;
  --second:      #964E29;
  --second-soft: #F1E3DA;
  /* syntax-only slots; measured on --surface in tests/contrast.py */
  --tk-number:   #5B4A8A;
  --tk-flag:     #3B5E8C;
  --tk-var:      #7A3E6E;
}

/* The one motion. Respect the viewer who asked for none. */
@keyframes rule-rise {
  from { opacity: 0; transform: translateY(var(--rise)); }
  to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  :root { --rise: 0px; }
}
