/* Braid design system — canonical token source
   DES-b3c1a143ddee4014b4b17dedc2318d61 · v6 · registry D-053
   REQ-DESIGN-SYSTEM-CANON · AC-1
   Ledger with TOK ids and measured contrast: braid-tokens.md

   v5, 2026-08-10, on Jamie's ruling "promote the 5 tokens proposed" (BB-023).
   Five values that were live in the estate and off-palette are now declared:
   --accent-fill and the four surface-ramp steps. An asset_versions row for v5
   is OWED and not written from here.

   v5.1, 2026-09-03, on Jamie's ruling (DR-0007, "execute them all 1 by 1"):
   - --card declares the BB-063 white card surface (#ffffff). Cards bind to
     --card, never to --paper.
   - --paper is confirmed as the recessed fill and on-fill ink (#f4f6f6):
     input fields, wells-on-cards, text on filled buttons.
   - --surface is the blessed alias of --surface-graphite (consumers used both).
   - --shadow-card carries the BB-063 card resting shadow (was --rest in draft 85
     and a page local in the served app).
   - --shadow-raise is promoted provisionally from the requirement-card redesign
     draft (85); it is confirmed when that draft is ratified.
   v6, 2026-09-03 (DR-0007, Move 3): type scale (16 named rungs), space scale
   (12 steps), and motion tokens ratified from estate measurement. The half-pixel
   strays migrate to the nearest rung across all canvas copies; DESIGN.md §3/§4
   rewritten to match. Single hand-edited source: every other token artifact
   derives from this file.

   Consume as: color:var(--muted-faint,rgba(27,33,36,.64))
   The inline fallback is required, not optional: it keeps the correct value
   painting if this sheet has not landed when a page starts streaming. */

:root{
  /* accent — one accent hue, three steps. There is no --accent-2. */
  --accent:#2f6b80;
  --accent-deep:#255767;
  --accent-fill:#1f4f61;

  /* ink and surfaces */
  --ink:#1b2124;
  --surface-graphite:#23282b;
  --surface:#23282b; /* alias of --surface-graphite (DR-0007) */
  --card:#ffffff; /* BB-063 white card surface (DR-0007) */
  --paper:#f4f6f6; /* recessed field fill + on-fill ink — never a card */
  --paper-raised:#fbfcfc;
  --canvas:#e7eaeb;
  --canvas-alt:#eceeef;

  /* surface ramp, promoted v5 — the four steps the estate was already using.
     Ordered light to dark. --muted-faint FAILS on --well; see the ledger. */
  --band-alt:#f2f5f5;
  --control-disabled:#e9edee;
  --header-fill:#e6ebec;
  --well:#dfe4e5;

  /* text ink ramp — two steps, both AA on all four surfaces */
  --muted:rgba(27,33,36,.78);
  --muted-faint:rgba(27,33,36,.64);

  /* lines and marks — not text. Never raise a rule to a text alpha. */
  --line:rgba(27,33,36,.08);
  --line-strong:rgba(27,33,36,.14);
  --mark-empty:rgba(27,33,36,.16);
  --mark-idle:rgba(27,33,36,.34);
  --tint-ink:rgba(27,33,36,.06);

  /* truth layers — hues mark, inks type. No exceptions. */
  --layer-working:#b8703c;
  --layer-working-ink:#8a5227;
  --layer-synthesis:#2f6b80;
  --layer-synthesis-ink:#255767;
  --layer-canonical:#2f8a5b;
  --layer-canonical-ink:#256b45;
  --layer-risk:#8a3d3d;
  --layer-risk-ink:#7a3535;

  /* radius — six steps, closed scale. Bezels 36-46 sit outside it. */
  --r-chip:5px;
  --r-control:8px;
  --r-control-lg:11px;
  --r-panel:14px;
  --r-surface:18px;
  --r-pill:999px;

  /* elevation — card resting + raise join the four tiers (DR-0007) */
  --shadow-card:0 1px 1px rgba(42,50,54,.025),0 3px 8px -5px rgba(27,33,36,.28);
  --shadow-raise:0 2px 3px rgba(27,33,36,.06),0 10px 20px -12px rgba(27,33,36,.5); /* provisional, draft 85 */
  --shadow-chip:0 6px 18px -10px rgba(27,33,36,.4);
  --shadow-panel:0 18px 44px -16px rgba(27,33,36,.42);
  --shadow-sheet:0 24px 60px -44px rgba(27,33,36,.5);
  --shadow-ink:0 20px 44px -20px rgba(27,33,36,.7);

  /* on dark — the graphite surfaces and the dark mobile card */
  --on-dark:rgba(255,255,255,.92);
  --on-dark-muted:rgba(255,255,255,.66);
  --accent-on-dark:#9ccada;
  --accent-on-dark-hover:#b6dbe5;

  /* type */
  --font-sans:'Instrument Sans',ui-sans-serif,system-ui,sans-serif;
  --font-mono:'IBM Plex Mono',monospace;

  /* type scale — v6 (DR-0007). Sixteen named rungs ratified from estate evidence.
     Pre-v6 strays (7/8/9.5/10.5/11.5/12.5/13.5/14.5/15.5/16.5/18/20/23/24/25/26/27/
     29/30/32/33) migrate to the nearest rung, ties up. Display one-offs (36-64)
     stay literal per drawing. Weights/leading per DESIGN.md §3.2. */
  --text-stamp:8.5px;   /* mono 500 — register column headers */
  --text-tag:9px;       /* mono 500 — state tags, tiny stamps */
  --text-chip:10px;     /* mono 500 — chip labels */
  --text-label:11px;    /* mono 500 — badges, uppercase labels (.14em) */
  --text-caption:12px;  /* 400 — captions, secondary labels */
  --text-body:13px;     /* 400 — BASE body */
  --text-body-lg:14px;  /* 500 — long-form body, prose */
  --text-emphasis:15px; /* 600 — body emphasis */
  --text-title-sm:16px; /* 600 — card title, feature name */
  --text-metric:17px;   /* 600 — metric name, hero label */
  --text-title:19px;    /* 600 — stat values, card titles in truth-ink */
  --text-panel:21px;    /* 600 — panel heading */
  --text-screen:22px;   /* 600 — screen title, subsection h2 */
  --text-section:28px;  /* 600 — shell overview heading */
  --text-display:34px;  /* 600 — section title */
  --text-hero:44px;     /* 600 — page title */

  /* space scale — v6 (DR-0007). Twelve steps covering ~87% of measured
     padding/margin/gap usage. 9px stays: the dense-control tradition is real
     (770 uses). 3/5/7/11/13 fold to neighbors opportunistically — no mass
     migration; new and touched components bind to tokens. */
  --space-1:2px;
  --space-2:4px;
  --space-3:6px;
  --space-4:8px;
  --space-5:9px;
  --space-6:10px;
  --space-7:12px;
  --space-8:14px;
  --space-9:16px;
  --space-10:22px;
  --space-11:32px;
  --space-12:44px;

  /* motion — v6 (DR-0007). One easing, five durations. */
  --ease-standard:cubic-bezier(.2,.9,.25,1.06);
  --dur-instant:.2s;  /* brd-pop, small entrances */
  --dur-fast:.3s;     /* brd-toast, brd-msg */
  --dur-base:.4s;     /* brd-fade, view transitions */
  --dur-spin:.8s;     /* brd-spin */
  --dur-loop:3.6s;    /* brd-pulse */
}
