/* ggautomata design tokens: Instrument, with The Patch's diff vocabulary.
 *
 * Custom properties only. A product copies this file and pins its version;
 * no product loads it from this repository at runtime.
 *
 * Contract: the names Ingest's pages already use (--color-bg, --color-text,
 * --color-link, --space-4, ...) keep their meaning, so this file replaces a
 * product's placeholder tokens without a page change. New names are additive.
 *
 * Theme: the page follows the visitor's system setting. Dark is the brand's
 * primary presentation (mockups, images, the mark); light carries the same
 * roles. Every text pair meets WCAG AA; run scripts/check-contrast.py.
 *
 * Layout steps: 30rem, 48rem, 56rem, 64rem. CSS cannot read a custom
 * property inside @media, so products write these values in their queries. */

:root {
  color-scheme: light dark;

  /* Color, light. */
  --color-bg: #f3f3ee;
  --color-surface: #ffffff;
  --color-text: #101211;
  --color-text-muted: #4a504c;
  --color-text-faint: #5f655f;
  --color-border: #d6d8d1;
  --color-border-control: #80857e;
  --color-link: #101211;
  --color-link-hover: #8a5200;
  --color-code-bg: #e9e9e2;
  --color-code-text: #101211;

  /* The signal is for actions and live data only, never decoration.
     --color-signal is a fill; text on it uses --color-on-signal.
     --color-signal-text is the signal as text, dark enough to read. */
  --color-signal: #ffb020;
  --color-on-signal: #101211;
  --color-signal-text: #8a5200;
  /* Not used by The Patch, which has no verdict colors. Kept for products
     that need a destructive state. */
  --color-danger: #b42318;
  --color-focus: #8a5200;
  /* The front g of the ggautomata mark. A graphic, never text: 3:1 on bg
     and surface. marks/ggautomata.svg reads it when inlined. */
  --color-gg: #c27c00;

  /* The Patch: pages read as a diff. These roles alias the colors above, so
     the dark theme follows without restating them. No red or green diff. */
  --color-struck: var(--color-text-faint);
  --color-added-bg: var(--color-surface);
  --color-plate-bg: var(--color-text);
  --color-plate-text: var(--color-bg);

  /* The cell grid as texture. */
  --grid-cell: 2rem;
  --grid-line: rgb(16 18 17 / 0.06);

  /* Type. Geist and Geist Mono are SIL OFL 1.1; products self-host them. */
  --font-body: "Geist", "Geist Fallback", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "Geist Mono", "Geist Mono Fallback", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* Character cells. Gutters measured in the element's own font, usually
     --font-mono: a mark, a line number, a hunk header. */
  --cell-1: 1ch;
  --cell-mark: 2ch;
  --cell-number: 4ch;
  --cell-hunk: 5ch;

  --text-xs: 0.8125rem;
  --text-sm: 0.9375rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.375rem;
  --text-2xl: 1.875rem;
  --text-3xl: 2.5rem;
  --text-display: clamp(2.5rem, 1.6rem + 3.6vw, 3.75rem);
  --text-mono: 0.9em;

  --leading-tight: 1.05;
  --leading-heading: 1.25;
  --leading-body: 1.55;
  --tracking-display: -0.033em;
  --tracking-wordmark: -0.015em;
  --tracking-label: 0.08em;
  --weight-regular: 400;
  --weight-medium: 600;

  /* Space: a 4px base. */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4rem;
  --space-9: 6.5rem;

  /* Instrument is square. The names stay so products keep working. */
  --radius-sm: 0;
  --radius-md: 0;

  --border-width: 1px;
  --border-width-strong: 2px;
  --outline-width: 2px;

  --measure: 38rem;
  --page-max: 44rem;
  --page-wide: 80rem;
  --gutter: clamp(1rem, 5vw, 4rem);

  /* Motion. State changes, and the strike: the brand's one motion, drawn on
     load. Run the strike only under prefers-reduced-motion: no-preference. */
  --duration-state: 120ms;
  --ease-state: ease-out;
  --duration-strike: 420ms;
  --ease-strike: ease-out;
  --delay-strike: 360ms;
  --delay-strike-step: 160ms;
}

@media (prefers-color-scheme: dark) {
  :root {
    --color-bg: #0b0d0c;
    --color-surface: #111413;
    --color-text: #ecece6;
    --color-text-muted: #a9afab;
    --color-text-faint: #8d938f;
    --color-border: #262a28;
    --color-border-control: #666d69;
    --color-link: #ecece6;
    --color-link-hover: #ffb020;
    --color-code-bg: #111413;
    --color-code-text: #c9cec9;

    --color-signal: #ffb020;
    --color-on-signal: #0b0d0c;
    --color-signal-text: #ffb020;
    --color-danger: #ff6b5e;
    --color-focus: #ffb020;
    --color-gg: #ffb020;

    --grid-line: rgb(255 255 255 / 0.05);
  }
}
