/*
 * tokens.css — the Design Machine brand tokens (the Chart system) as CSS custom properties, light and dark.
 * Written by brand/kit/tokens/make-tokens.mjs from brand/kit/shared/kit.js; do not edit by hand, run
 * brand/kit/build.sh. The same values are in tokens.json. Meant for the Mac app (src/app/styles.css; the mapping
 * onto its current variable names is the block at the end of this file) and the releases page.
 *
 * Roles: ground (the page), surface and surface-2 (panels, then raised fields and buttons), line and line-2
 * (rules, then borders), text, muted (secondary type), faint (the quietest type: hints and help), signal (madder:
 * marks, focus rings, square 0, once per composition), signal-fill and signal-ink (a madder fill that carries
 * type, and the type on it). The dark rule: dark swaps each found plate's two inks; the page swaps linen and loom.
 *
 * Contrast (WCAG 2), every text/ground pair the tokens allow. Lowest: dark signal/ground 3.23:1, dark faint/surface-2 4.05:1, light faint/surface-2 4.18:1, dark faint/surface 4.50:1.
 *   dark text on ground                  #ECE5D3 on #1B1A17  13.85:1  (floor 4.5:1)
 *   dark text on surface                 #ECE5D3 on #25231F  12.48:1  (floor 4.5:1)
 *   dark text on surface-2               #ECE5D3 on #2E2B26  11.22:1  (floor 4.5:1)
 *   dark muted on ground                 #A39B87 on #1B1A17   6.29:1  (floor 4.5:1)
 *   dark muted on surface                #A39B87 on #25231F   5.67:1  (floor 4.5:1)
 *   dark muted on surface-2              #A39B87 on #2E2B26   5.10:1  (floor 4.5:1)
 *   dark faint on ground                 #908977 on #1B1A17   5.00:1  (floor 4.5:1)
 *   dark faint on surface                #908977 on #25231F   4.50:1  (floor 4.5:1)
 *   dark faint on surface-2              #908977 on #2E2B26   4.05:1  (floor 3:1)
 *   dark signal on ground                #C4352D on #1B1A17   3.23:1  (floor 3:1)  marks, rings and square 0 only, never small type
 *   dark signal-ink on signal-fill       #ECE5D3 on #B8322A   4.74:1  (floor 4.5:1)
 *   dark ground on text                  #1B1A17 on #ECE5D3  13.85:1  (floor 4.5:1)  the primary button: ground-coloured type on a text-coloured fill
 *   light text on ground                 #1B1A17 on #ECE5D3  13.85:1  (floor 4.5:1)
 *   light text on surface                #1B1A17 on #E5DECB  12.96:1  (floor 4.5:1)
 *   light text on surface-2              #1B1A17 on #DDD6C4  12.01:1  (floor 4.5:1)
 *   light muted on ground                #5E584C on #ECE5D3   5.62:1  (floor 4.5:1)
 *   light muted on surface               #5E584C on #E5DECB   5.26:1  (floor 4.5:1)
 *   light muted on surface-2             #5E584C on #DDD6C4   4.87:1  (floor 4.5:1)
 *   light faint on ground                #686255 on #ECE5D3   4.82:1  (floor 4.5:1)
 *   light faint on surface               #686255 on #E5DECB   4.51:1  (floor 4.5:1)
 *   light faint on surface-2             #686255 on #DDD6C4   4.18:1  (floor 3:1)
 *   light signal on ground               #B8322A on #ECE5D3   4.74:1  (floor 3:1)  marks, rings and square 0 only, never small type
 *   light signal-ink on signal-fill      #ECE5D3 on #B8322A   4.74:1  (floor 4.5:1)
 *   light ground on text                 #ECE5D3 on #1B1A17  13.85:1  (floor 4.5:1)  the primary button: ground-coloured type on a text-coloured fill
 */

:root {
  /* Steps: every ink the themes are built from. */
  --dm-loom: #1B1A17;
  --dm-heddle: #3A362F;
  --dm-flax: #A39B87;
  --dm-bark: #5E584C;
  --dm-reed: #CFC6B0;
  --dm-linen: #ECE5D3;
  --dm-madder: #C4352D;
  --dm-madder-light: #B8322A;

  /* Faces. Departure Mono only at 11, 22 or 33 px (its 11 px em), so its pixels stay whole. */
  --dm-font-display: "Libre Caslon Display", "Libre Caslon Text", Georgia, "Times New Roman", serif;
  --dm-font-text: "Libre Caslon Text", Georgia, "Times New Roman", serif;
  --dm-font-mono: "Departure Mono", "SF Mono", ui-monospace, Menlo, monospace;
  --dm-mono-1: 11px;
  --dm-mono-2: 22px;
  --dm-mono-3: 33px;

  /* Caslon sizes, leading and tracking. */
  --dm-size-ui-small: 13px;
  --dm-size-ui: 15px;
  --dm-size-body: 18px;
  --dm-size-lead: 30px;
  --dm-size-headline: 52px;
  --dm-size-display: 88px;
  --dm-size-hero: 116px;
  --dm-leading-display: 1;
  --dm-leading-headline: 1.04;
  --dm-leading-body: 1.36;
  --dm-leading-ui: 1.42;
  --dm-leading-mono: 1;
  --dm-tracking-display: -0.015em;
  --dm-tracking-headline: -0.008em;
  --dm-tracking-body: 0em;
  --dm-tracking-dark-open: 0.01em;

  /* Radii. The icon's is a share of its tile. */
  --dm-radius-s: 4px;
  --dm-radius-m: 7px;
  --dm-radius-l: 10px;
  --dm-radius-icon: 22.57%;
}

/* Light is the default; dark follows the system, or is forced with data-theme="dark". */
:root,
:root[data-theme="light"] {
  color-scheme: light;
  --dm-ground: #ECE5D3;
  --dm-surface: #E5DECB;
  --dm-surface-2: #DDD6C4;
  --dm-line: #CFC6B0;
  --dm-line-2: #B3AB97;
  --dm-text: #1B1A17;
  --dm-muted: #5E584C;
  --dm-faint: #686255;
  --dm-signal: #B8322A;
  --dm-signal-fill: #B8322A;
  --dm-signal-ink: #ECE5D3;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --dm-ground: #1B1A17;
    --dm-surface: #25231F;
    --dm-surface-2: #2E2B26;
    --dm-line: #3A362F;
    --dm-line-2: #514C42;
    --dm-text: #ECE5D3;
    --dm-muted: #A39B87;
    --dm-faint: #908977;
    --dm-signal: #C4352D;
    --dm-signal-fill: #B8322A;
    --dm-signal-ink: #ECE5D3;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --dm-ground: #1B1A17;
  --dm-surface: #25231F;
  --dm-surface-2: #2E2B26;
  --dm-line: #3A362F;
  --dm-line-2: #514C42;
  --dm-text: #ECE5D3;
  --dm-muted: #A39B87;
  --dm-faint: #908977;
  --dm-signal: #C4352D;
  --dm-signal-fill: #B8322A;
  --dm-signal-ink: #ECE5D3;
}

/*
 * Mapping onto the app's current variables (src/app/styles.css, read 2026-11-27). The app is dark only, so paste
 * this into its :root in place of the ten lines it replaces, after importing this file (or the dark values). The
 * other app variables (--blue, --ok, --warn, --fail, --radius, the column widths) stay as they are.
 *
 *   --bg: var(--dm-ground);           #1B1A17  the stage behind the artboard
 *   --panel: var(--dm-surface);       #25231F  chat and inspector columns
 *   --panel-2: var(--dm-surface-2);   #2E2B26  fields, buttons, bubbles
 *   --line: var(--dm-line);           #3A362F  1 px rules between areas
 *   --line-2: var(--dm-line-2);       #514C42  borders on fields and buttons
 *   --text: var(--dm-text);           #ECE5D3
 *   --muted: var(--dm-muted);         #A39B87
 *   --faint: var(--dm-faint);         #908977  only on --bg and --panel, never on --panel-2
 *   --accent: var(--dm-text);         #ECE5D3  the primary button is linen, as in round 5's window
 *   --accent-ink: var(--dm-ground);   #1B1A17  type on it (13.85:1)
 *
 * Why --accent is not madder: styles.css uses --accent on every pin, tag, toggle, hover border and selection, and
 * sets small type in it (.brand em, .badge.edit, .empty h1 em). Madder is the brand's one signal per composition,
 * and #C4352D is 3.23:1 on loom black (too low for small type) and 4.29:1 under linen type. Use --dm-signal for
 * the one live thing on screen (the focus ring on the control being changed, as the round 5 mock does), and
 * --dm-signal-fill with --dm-signal-ink where a madder fill carries type (4.74:1).
 * Also, when applying: the hard-coded hover and active greys in styles.css (#222225, #2a2a2e, #3a3a3f, #1b1b1d,
 * #26262a) become --dm-surface-2 and --dm-line-2; rgba(255,106,43,0.06) on .el-box.sel becomes
 * color-mix(in srgb, var(--dm-text) 6%, transparent); and "UI Serif" becomes var(--dm-font-text).
 */
