/* Design tokens: the single place to restyle the product.
   Edit here, or tweak live in /staff/design and export this file.
   Colours that end in -soft / -strong / -line are derived with color-mix, so one brand colour re-themes everything. */

/* Archivo (SIL OFL 1.1, fonts/Archivo-OFL.txt): one variable file, weight 400-800 and width 75-125%, Latin subset (75 KB).
   Wide cuts set measured quantities, narrow cuts set annotations, normal width is for reading. */
@font-face {
  font-family: "Archivo";
  src: url("/fonts/archivo-var-latin.woff2") format("woff2");
  font-weight: 400 800;
  font-stretch: 75% 125%;
  font-style: normal;
  font-display: swap;
}

:root {
  /* brand & text */
  --brand: #1f4fff;          /* drafting blue: links, primary actions, the measured range */
  --on-brand: #ffffff;
  --accent: #ffb020;         /* surveyor's amber: only the "most likely" marker and the chosen words */
  --on-accent: #14213d;
  --ink: #14213d;            /* main text: navy drafting ink */
  --muted: #56617a;          /* secondary text */
  /* surfaces */
  --bg: #f3f5f8;             /* page: cool drafting paper */
  --card: #ffffff;           /* cards, inputs */
  --line: #dce2ea;           /* borders, rules, grid */
  --inverse: #14213d;        /* dark panels: totals, live bar, selected states */
  --on-inverse: #ffffff;
  /* meaning */
  --ok: #0e7a55;
  --warn: #a15c07;
  --bad: #b42318;
  /* service groups */
  --run: #0e7a55;
  --grow: #7a3ff2;
  --build: #1f4fff;
  /* type */
  --font: "Archivo", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: var(--font);
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --text-base: 17px;
  --display-weight: 760;
  --display-tracking: -0.025em;
  --display-width: 116%;     /* font-stretch for headings and figures */
  --label-width: 82%;        /* font-stretch for annotations */
  /* shape */
  --radius: 10px;
  --shadow-strength: 6%;

  /* derived: change the inputs above, not these */
  --brand-strong: color-mix(in srgb, var(--brand) 80%, var(--ink));
  --brand-soft: color-mix(in srgb, var(--brand) 9%, var(--card));
  --brand-line: color-mix(in srgb, var(--brand) 22%, var(--card));
  --accent-soft: color-mix(in srgb, var(--accent) 22%, var(--card));
  --ok-soft: color-mix(in srgb, var(--ok) 11%, var(--card));
  --warn-soft: color-mix(in srgb, var(--warn) 12%, var(--card));
  --bad-soft: color-mix(in srgb, var(--bad) 10%, var(--card));
  --grow-soft: color-mix(in srgb, var(--grow) 9%, var(--card));
  --surface-2: color-mix(in srgb, var(--ink) 5%, var(--card));
  --line-strong: color-mix(in srgb, var(--ink) 25%, var(--card));
  --grid: color-mix(in srgb, var(--brand) 9%, transparent);
  --on-inverse-muted: color-mix(in srgb, var(--on-inverse) 65%, var(--inverse));
  --code-bg: #0e1830;
  --code-ink: #d7e0f2;
  --radius-sm: calc(var(--radius) * 0.84);
  --radius-xs: calc(var(--radius) * 0.67);
  --shadow: 0 1px 2px color-mix(in srgb, var(--ink) var(--shadow-strength), transparent), 0 4px 16px color-mix(in srgb, var(--ink) var(--shadow-strength), transparent);
  --shadow-up: 0 -4px 16px color-mix(in srgb, var(--ink) var(--shadow-strength), transparent);
  color-scheme: light;
}

/* dark mode: follows the OS unless a page forces data-theme="light" */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --brand: #7c96ff; --on-brand: #0d1526; --accent: #ffc04d; --on-accent: #0d1526; --ink: #e6ebf4; --muted: #98a3ba;
    --bg: #0d1526; --card: #131d33; --line: #26324b; --inverse: #2a3b69; --on-inverse: #ffffff;
    --ok: #3ccf98; --warn: #f0a841; --bad: #ff7a6e; --run: #3ccf98; --grow: #b494ff; --build: #7c96ff;
    --code-bg: #070c18; --shadow-strength: 30%; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --brand: #7c96ff; --on-brand: #0d1526; --accent: #ffc04d; --on-accent: #0d1526; --ink: #e6ebf4; --muted: #98a3ba;
  --bg: #0d1526; --card: #131d33; --line: #26324b; --inverse: #2a3b69; --on-inverse: #ffffff;
  --ok: #3ccf98; --warn: #f0a841; --bad: #ff7a6e; --run: #3ccf98; --grow: #b494ff; --build: #7c96ff;
  --code-bg: #070c18; --shadow-strength: 30%; color-scheme: dark;
}
