/* ============================================================================
   FULCRUM — BRAND TOKENS · v1.0 · 2026-09-12
   THIS FILE IS THE BRAND GUIDE. The document is the explanation; this is the law.

   THE ONE RULE: this is the only file in the repository allowed to contain a
   hex literal, a raw font-size, a raw radius, or an rgba(). Everything else
   uses var(). brand/check-tokens.ps1 enforces it and fails loudly.

   GROUND MODEL — explicit, never automatic:
     <html>                    → paper. Everything read, sent or printed.
     <html data-ground="ink">  → ink.   Surfaces worked in for hours (the cockpit).
   prefers-color-scheme is deliberately NOT wired: the ground is a property of
   the surface's job, not of the viewer's OS setting.

   PROVENANCE: values marked [X] are Xander's word. Everything else is a
   proposal standing until he overrules it (root CLAUDE.md, 2026-09-09).
   ========================================================================= */

/* 2026-09-19 — GROUND ISLANDS. A ground may also be declared on any element, so one page
   can hold a stage (ink) and a reading section (paper). Only colour + elevation live in the
   ground blocks; type, space, shape, anatomy and motion stay on :root so the valves below
   keep working inside an island. No token was added or removed by this change. */
:root, [data-ground="paper"] {
  /* ---- GROUND: paper -------------------------------------------------- */
  --ground:        #FAF8F4;   /* [X] white */
  --surface:       #FFFFFF;
  --sunk:          #F5F3EF;
  --rule:          #E2DED6;

  --ink:           #0E0E0E;   /* [X] black. --ink ALWAYS means TEXT. Never a background. */
  --body:          #3A352E;   /* 11.5:1 */
  --muted:         #6E675E;   /*  5.26:1 */

  --accent:        #8A6A2E;   /* [X] gold — the deep gold, because it touches paper. 4.73:1 */
  --accent-dim:    #A37C36;   /* 3.60:1 — non-text only */
  --on-accent:     #FFFFFF;   /* 5.02:1 on --accent */

  --good:          #1F6B3F;   /* 6.12:1 */
  --attention:     #9A4B10;   /* 5.84:1 */
  --bad:           #A32020;   /* 7.11:1 */
  --info:          #1E5A8A;   /* 6.86:1 */

  --hover:         #F2EFE9;
  --selected:      #E9E5DC;
  --pressed:       #E1DCD1;
  --ink-disabled:  #A39C92;
  --scrim:         rgba(14,14,14,.55);   /* the ONLY legal alpha in the codebase */

  --e-raise: 0 1px 2px rgba(0,0,0,.06);
  --e-pop:   0 4px 12px rgba(0,0,0,.10);
  --e-modal: 0 16px 40px rgba(0,0,0,.16);
}

:root {
  /* ---- TYPE ----------------------------------------------------------- */
  /* Three faces. The serif never enters the cockpit; the serif never sets a
     eyebrow. Both are choices, not capability gaps — Newsreader ships tabular
     figures by default (verified 2026-09-12, delta 0.00px on a 10-digit probe). */
  --f-sans:      'Fira Sans', 'Segoe UI', system-ui, sans-serif;
  --f-display:   'Newsreader', Georgia, 'Times New Roman', serif;
  --f-mono:      'Fira Mono', ui-monospace, Consolas, monospace;
  --f-signature: 'Newsreader', Georgia, serif;   /* used at 400 italic, one place only */

  /* SIX sizes. There are no others. 15, 16, 16.5, 17.6, 20, 32, 33 do not exist. */
  --t-display: 42px;   /* one per screen, never two */
  --t-title:   27px;
  --t-head:    21px;
  --t-body:    17px;   /* BASE — ratio 1.25, documented not computed */
  --t-small:   14px;
  --t-eyebrow: 11px;   /* uppercase, 600, .12em */
  --t-micro:   11px;   /* sentence case, 400 */

  --lh-flat:  1.05;
  --lh-tight: 1.12;
  --lh-head:  1.30;
  --lh-body:  1.55;

  --w-regular: 400;
  --w-medium:  500;
  --w-label:   600;   /* already agreed by the codebase: 314 of 475 declarations */

  --track-eyebrow: .12em;
  --track-wordmark: .005em;

  /* ---- SPACE · 4px base ----------------------------------------------- */
  --s1: 4px;  --s2: 8px;  --s3: 12px;  --s4: 16px;  --s5: 24px;  --s6: 40px;
  /* 20 and 32 do not exist. If a layout only works at 32, the layout is wrong. */
  --card-pad: var(--s5);
  --gutter:   16px;

  /* ---- SHAPE ---------------------------------------------------------- */
  --r-sm:   4px;    /* inputs, bars, thumbnails */
  --r-md:   8px;    /* every card, panel, tile, popover, modal */
  --r-lg:   16px;   /* full-bleed only */
  --r-pill: 999px;  /* buttons, tabs, chips — kept; 252 declarations already agree */

  /* ---- ANATOMY -------------------------------------------------------- */
  --control-h:    40px;
  --control-h-sm: 30px;
  --pill-h:       24px;
  --hairline:     1px;
  --ring:         2px solid var(--accent);
  --ring-offset:  2px;
  --tap-min:      44px;

  /* ---- MOTION --------------------------------------------------------- */
  --m-fast: 120ms;
  --m-slow: 260ms;
  --m-step: 40ms;    /* stagger between siblings */
  --ease:   cubic-bezier(.2,.6,.2,1);
}

/* ---- GROUND: ink ------------------------------------------------------ */
/* Only colour and elevation are redefined. Type, space, shape, motion and
   anatomy are ground-independent by design — that is what makes them Fulcrum's
   rather than a theme's. */
:root[data-ground="ink"], [data-ground="ink"] {
  --ground:        #100E0C;   /* [X] black */
  --surface:       #1A1714;
  --sunk:          #0A0908;
  --rule:          #2B2621;

  --ink:           #FAF8F4;   /* 16.8:1 */
  --body:          #C9C2B8;   /* 10.9:1 */
  --muted:         #8E877C;   /*  5.42:1 */

  --accent:        #C6A15B;   /* [X] gold — the light gold, because it touches ink. 7.94:1 */
  --accent-dim:    #8A6A2E;   /* 3.83:1 — non-text only */
  --on-accent:     #100E0C;   /* 7.94:1 */

  --good:          #56C08A;
  --attention:     #F2A33C;
  --bad:           #FF6B5E;
  --info:          #6FB8F0;

  --hover:         #201C18;
  --selected:      #2A251F;
  --pressed:       #171310;
  --ink-disabled:  #5A5A54;
  --scrim:         rgba(0,0,0,.62);

  /* Depth on ink is the --surface ↔ --ground step. Shadows do not read on black. */
  --e-raise: none;
  --e-pop:   0 4px 12px rgba(0,0,0,.45);
  --e-modal: 0 16px 40px rgba(0,0,0,.60);
}

/* ---- THE PRESSURE VALVE ----------------------------------------------- */
/* The scale forked last time because a real client said "the wording is too
   small" and there was no legal move. This is the only legal move. It is an
   ENUMERATED second block, never a multiplier — multipliers always drift. */
:root[data-type="large"] {
  --t-body:    19px;
  --t-small:   15px;
  --t-eyebrow: 12px;
  --t-micro:   12px;
  /* --t-title and --t-display deliberately unchanged: the complaint is always
     about reading text, never about headlines. */
}

/* ---- THE STAGE VALVE (proposed 2026-09-19, his call) -------------------- */
/* The six sizes were set for surfaces that are read and worked in. A marketing
   stage seen from across a room needs a larger display, and the legal move is
   the same as above: an ENUMERATED block, never a new token or a multiplier.
   Only the homepage declares it. Body, small and eyebrow are untouched. */
:root[data-type="stage"] {
  --t-display: clamp(42px, 5.4vw, 84px);
  --t-title:   clamp(27px, 3vw, 42px);
}

/* ---- PRINT ------------------------------------------------------------ */
@media print {
  :root {
    --ground: #FFFFFF; --surface: #FFFFFF; --ink: #000000;
    --t-body: 11pt; --t-small: 10pt; --t-eyebrow: 9.5pt; --t-micro: 9.5pt;
    --e-raise: none; --e-pop: none; --e-modal: none;
  }
  /* The mark prints solid --ink. Gold is dropped: it renders muddy on
     uncoated stock and costs a second pass for nothing. */
}

/* ---- REDUCED MOTION --------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  :root { --m-fast: 1ms; --m-slow: 1ms; --m-step: 0ms; }
}

/* ============================================================================
   BANNED — the migration map. check-tokens.ps1 fails on any of these.
     --bg  --bone  --card  --raise      → --ground / --surface / --ink
     --text  --dim  --faint             → --ink / --body / --muted
     --gold  --gold-rgb                 → --accent
     --line  --line-solid               → --rule
     --felt  --mint  --flag             → --good / --attention
     --hs  --hw                         → deleted; use data-type="large"
     --ink as a BACKGROUND              → --ground. --ink is text. Always.
   ========================================================================= */
