/*
 * The design tokens — one value per role, for the whole product.
 *
 * ⚠ WHY THIS FILE EXISTS. Four stylesheets each defined the same roles under
 * different names and different values: `--ink` was #202923 on the console,
 * #16211d in the interview room, #171e1b on the landing page and #17211d at the
 * door. Four near-identical darks, none of them chosen against the others.
 * `--rule` and `--line` were the same hairline; `--lift` and `--shadow` the same
 * elevation; `--teal` and `--accent` the same green.
 *
 * That is why the halves of this product do not quite read as one thing —
 * console.css has said "same ink as the interview room" in its own header for
 * months, and it has not been true.
 *
 * ⚠ LAYERED ON PURPOSE, AND THAT IS THE MIGRATION PLAN. Unlayered CSS beats
 * layered CSS regardless of specificity, so every page sheet's own `:root`
 * still wins over this file today and nothing moves underfoot. A sheet
 * converges by DELETING its override, one token at a time, and letting the
 * shared value take effect. What remains is then deliberate rather than
 * accidental — which is the whole difference this file makes.
 *
 * The values are the console's, because they are the most recently argued: its
 * ink was taken to near-black after a green cast "read as washed rather than as
 * text", and no other sheet had that pass.
 */

@layer tokens {
  :root {
    color-scheme: light;

    /* ── Ink ─────────────────────────────────────────────────────────────── */

    /* The darkest thing on a page, barely warm enough not to look blue against
       beige. --ink-soft is for labels and hints and still clears 6:1 on paper
       and on the rail (6.4 and 6.1; AA with room, not AAA), because
       "secondary" should mean quieter, not fainter. */
    --ink: #202923;
    --ink-soft: #5d5950;

    /* ── Surfaces ────────────────────────────────────────────────────────── */

    /* Warm neutrals, one temperature with the leader rail and the painting;
       the green accent is the only cool colour left on a page. */
    --paper: #f7f4ee;
    --card: #ffffff;
    --sunk: #f1ece2;
    --rule: #e4ddd0;

    /* Over artwork. Every surface carrying text sets its own near-opaque veil,
       which is what lets the background scrim go as thin as it does. */
    --card-veil: #ffffff;
    --sunk-veil: #f1ece2;
    --scrim: rgba(242, 236, 217, 0.32);

    /* ── Accents ─────────────────────────────────────────────────────────── */

    /* ⚠ ONE warm accent per view. The teal carries every ordinary affirmative;
       the coral is reserved for the single most consequential control on a
       screen, and a page with two of them has decided nothing. */
    --teal: #245b43;
    --coral: #ad3931;
    --green: #245b43;

    /* ── Type ────────────────────────────────────────────────────────────── */

    /* Serif for reading, mono only for the machine's own labels — fingerprints,
       counts, state. A sans is deliberately absent: where one appeared it was
       for want of a decision rather than because the serif had failed. */
    --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Charter, Georgia, serif;
    --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

    /* A scale rather than a pile of one-off sizes. --fs-ui is the default for
       working text: dense screens want it smaller than prose. Whole pixels
       (12 / 13 / 14 / 15): steps a third of a pixel apart read as mistakes. */
    --fs-eyebrow: 0.75rem;
    /* ⚠ THE MONO EYEBROW IS ITS OWN SIZE, and that is not a duplicate of the
       line above. Mono glyphs are wider and optically larger, so a mono label
       set at --fs-eyebrow reads bigger than a sans one — and seven of the nine
       console eyebrows had been hand-shrunk away from it to compensate,
       independently, to six different values: 0.6 / 0.62 / 0.62 / 0.64 / 0.66 /
       0.68 / 0.72rem, which is 9.6 / 9.92 / 9.92 / 10.24 / 10.56 / 10.88 /
       11.52px. Every one is a fractional pixel, the mistake the note above
       warns about, and none was a decision anybody made twice. The other two
       stayed on --fs-eyebrow and were correspondingly too LARGE, which is the
       same evidence from the other side.

       11px: the only whole pixel inside that spread that does not shrink the
       smallest labels, which are already at the floor of what a leader should
       be asked to read. Retune HERE, once, rather than at nine call sites. */
    --fs-eyebrow-mono: 0.6875rem;
    /* Uppercase mono needs the letters opened up or it sets as a block. The
       nine call sites had five values — 0.08 / 0.1 / 0.12 / 0.14 / 0.16em —
       and this is the mode, at three of them. */
    --tracking-eyebrow: 0.12em;
    --fs-label: 0.8125rem;
    /* The secondary line under something: a caption, a rail blurb, the note
       beneath a field. It sat as a hand-picked 0.86 in four places and there
       was a 0.22rem hole in the scale exactly where the product's explanatory
       text lives — the writing that has to be READ by somebody who does not
       know what this is, so it cannot fall to --fs-label's 0.72. */
    --fs-small: 0.875rem;
    --fs-ui: 0.9375rem;
    --fs-body: 1rem;
    --fs-lead: 1.12rem;
    --fs-title: 1.35rem;
    --fs-display: 2rem;

    /* ── Space and shape ─────────────────────────────────────────────────── */

    --space-1: 0.3rem;
    --space-2: 0.55rem;
    --space-3: 0.9rem;
    --space-4: 1.4rem;
    --space-5: 2.2rem;

    /* Cards gently rounded, inputs less so, pills fully. Three radii and no
       fourth — a page with five is a page where nobody decided. */
    --radius-card: 12px;
    --radius-input: 8px;
    --radius-pill: 100px;

    --lift: 0 1px 0 rgba(22, 33, 29, 0.03), 0 6px 20px rgba(22, 33, 29, 0.06);
  }
}

/*
 * ⚠ STILL NO AUTOMATIC DARK SCHEME, and that part of the old decision stands.
 * The console once had one: on a Mac in dark mode it was what everybody
 * actually saw — olive surfaces under an olive scrim with the painting reduced
 * to a smear — and the scheme nobody had designed against was the one on
 * screen. `prefers-color-scheme` is therefore still not honoured anywhere, and
 * `color-scheme: light` above keeps form controls and scrollbars light.
 *
 * ⚠ WHAT IS NEW (asked for 2026-09-20) is a dusk theme a leader turns ON, from
 * the rail, per browser. Being explicit is the whole difference: it is chosen,
 * it is the only dark thing the product has, and it was measured rather than
 * inverted. It is NOT a conventional dark mode — the painting stays, under a
 * night scrim, and the cards become dark glass over it. The rail does not
 * change at all: it is already dark glass in both.
 *
 * ⚠ Its numbers, against the BRIGHTEST pixel of the painting (light text fails
 * at the bright end, where a dark card sits lightest): --ink 7.7:1,
 * --ink-soft 5.7:1, the mint accent 4.7:1. Re-measure before making the glass
 * any clearer.
 */
html[data-theme="dark"] {
  color-scheme: dark;

  --ink: #f1ece0;
  --ink-soft: #c9cec4;

  /* The painting at dusk rather than a dark rectangle: the scrim is what turns
     the sunset down, and the cards go dark over what is left. */
  --scrim: rgba(10, 21, 18, 0.55);
  --paper: #0d1714;
  --card: #16241f;
  --card-veil: rgba(20, 32, 27, 0.82);
  --sunk: rgba(255, 255, 255, 0.07);
  --sunk-veil: rgba(255, 255, 255, 0.07);
  --rule: rgba(255, 255, 255, 0.16);

  /* ⚠ The accent INVERTS. --teal is a deep green — the dark theme's own
     ground — so every accent drawn in it would vanish. Mint carries, and
     anything filled with it takes dark ink (see recipes.css). */
  --teal: #9dc4ad;
  --green: #9dc4ad;
  --coral: #ffb4a8;

  --lift: 0 1px 0 rgba(0, 0, 0, 0.2), 0 6px 20px rgba(0, 0, 0, 0.35);
}
