/* ── SecurePeak colour system ─────────────────────────────────────────
   Base ramps first, semantic aliases second. Two surface modes:
   TERMINAL (dark, default for product/marketing) and PAPER (light, for
   contracts, reports and anything that prints). */
:root{
  /* Ink — the dark end. Cold, green-shifted black; never pure #000. */
  --ink-1000:#060A08;
  --ink-950:#080D0A;
  --ink-900:#0B120E;
  --ink-850:#0F1A14;
  --ink-800:#14231C;
  --ink-700:#1A2E25;
  --ink-600:#223B30;
  --ink-500:#2C4B3D;
  --ink-400:#3B6252;

  /* Neutral — the paper end. Warm-free greys with a faint green cast. */
  --neutral-000:#FFFFFF;
  --neutral-050:#F7F9F7;
  --neutral-100:#F4F6F3;
  --neutral-150:#EDEEEB;
  --neutral-200:#E4E6E1;
  --neutral-300:#DCE4DE;
  --neutral-400:#B9BCB6;
  --neutral-500:#9BA09B;
  --neutral-600:#8A8E8A;
  --neutral-700:#6E726E;
  --neutral-800:#5E625E;
  --neutral-900:#2B2E2B;

  /* Signal green — the single brand hue. --signal-500 is the logo green. */
  --signal-050:#EAF4EF;
  --signal-100:#D3EBDF;
  --signal-200:#A6D9C1;
  --signal-300:#6FC5A3;
  --signal-400:#35B289;
  --signal-500:#1E8E68;
  --signal-600:#177656;
  --signal-700:#14664B;
  --signal-800:#0E4A37;
  --signal-900:#0A3225;
  /* Terminal glow — only ever on ink surfaces, never on paper. */
  --signal-beam:#4FE0A8;

  /* Severity — findings, alerts, risk ratings. Serious, not carnival. */
  --sev-critical:#C4453C;
  --sev-critical-dim:#8E2E27;
  --sev-critical-tint:#FBECEA;
  --sev-high:#C97A2B;
  --sev-high-dim:#8E5417;
  --sev-high-tint:#FBF1E6;
  --sev-medium:#B99320;
  --sev-medium-dim:#836811;
  --sev-medium-tint:#FAF5E3;
  --sev-low:#1E8E68;
  --sev-low-dim:#14664B;
  --sev-low-tint:#EAF4EF;
  --sev-info:#4E7B91;
  --sev-info-dim:#365B6D;
  --sev-info-tint:#EDF3F6;

  /* Tint EDGE. A tint band needs a hairline, and every attempt to draw one
     without a token produced an eyeballed hex: the retest report had reached
     #EDD9BE and #D6E2E8 by hand, which is where a systematic step lands anyway.
     One per severity so nobody invents a sixth. Never for text or fills. */
  --sev-critical-line:#F0D2CE;
  --sev-high-line:#EDD9BE;
  --sev-medium-line:#EFE4BE;
  --sev-low-line:#CFE6DB;
  --sev-info-line:#D6E2E8;

  /* Classification bands — used on tape, headers, watermarks. */
  --class-public:#4E7B91;
  --class-internal:#1E8E68;
  --class-confidential:#B99320;
  --class-restricted:#C97A2B;
  --class-secret:#C4453C;

  /* ── Semantic: PAPER (light) — documents, reports, contracts ── */
  --surface-page:var(--neutral-000);
  --surface-card:var(--neutral-000);
  --surface-sunken:var(--neutral-100);
  --surface-tint:var(--signal-050);
  --border-hairline:var(--neutral-150);
  --border-rule:var(--neutral-200);
  --border-strong:var(--neutral-400);
  --border-accent:var(--signal-400);
  --text-display:var(--ink-800);
  --text-body:var(--neutral-900);
  --text-muted:var(--neutral-800);
  --text-faint:var(--neutral-700);
  /* signal-500 measures 4.10:1 on white — under AA for text below 24px.
     signal-600 (5.58:1) is the paper accent; the raw hue stays available
     as --signal-500 for fills, rules and large display type. */
  --text-accent:var(--signal-600);
  --text-link:var(--signal-600);
  --text-link-hover:var(--signal-700);
  --text-on-signal:var(--neutral-000);
  /* Primary action fill. Surface-aware because the label colour flips with
     it: on paper the label is white, so the fill must be dark enough
     (signal-600 = 5.58:1); on ink the label is ink-1000, so the fill must
     stay light enough (signal-500 = 4.86:1). Hover moves away from the
     label on both — darker on paper, lighter on ink. */
  --action-primary:var(--signal-600);
  --action-primary-hover:var(--signal-700);
  /* Severity as TEXT on paper. The display hues (--sev-*) are calibrated as
     fills and rules; as small text on white or on their own tint they fall
     under 4.5:1. These are the darkened text-safe twins — use them for any
     severity word, score or label under 24px on a light ground. Above 24px
     the 3.0 threshold applies and the display hue is fine, except medium,
     which needs --sev-medium-display to stay separable from high. */
  --sev-critical-text:#A62B23;
  --sev-high-text:#8F5415;
  --sev-medium-text:#5A3208;
  --sev-medium-display:#9A7A15;
  --sev-low-text:var(--sev-low-dim);
  --sev-info-text:#3D6273;

  /* ── Semantic: TERMINAL (dark) — product UI, marketing, decks ── */
  --term-page:var(--ink-950);
  --term-surface:var(--ink-900);
  --term-raised:var(--ink-850);
  --term-inset:var(--ink-1000);
  --term-border:var(--ink-700);
  --term-border-strong:var(--ink-500);
  --term-border-accent:var(--signal-600);
  --term-text:#DCE7E0;
  --term-text-strong:#F2F7F4;
  --term-text-muted:#8FA79A;
  --term-text-faint:#6B8779;
  --term-accent:var(--signal-400);
  --term-accent-beam:var(--signal-beam);

  /* Focus ring — identical in both modes so keyboard users never lose it.
     Reads --text-accent, not the raw hue: signal-400 measures 2.66:1 on
     paper, under the 3:1 floor for a focus indicator. The alias resolves
     to signal-600 on paper (5.58:1) and signal-400 on ink (7.35:1). */
  --focus-ring:0 0 0 2px var(--surface-page), 0 0 0 4px var(--text-accent); /* @kind shadow */
}

/* TERMINAL mode. Put data-mode="terminal" on any element (usually <body>)
   and every semantic alias flips to the dark set — components never branch. */
[data-mode="terminal"]{
  --surface-page:var(--term-page);
  --surface-card:var(--term-surface);
  --surface-sunken:var(--term-inset);
  --surface-tint:var(--ink-800);
  --border-hairline:var(--ink-800);
  --border-rule:var(--term-border);
  --border-strong:var(--term-border-strong);
  --border-accent:var(--signal-600);
  --text-display:var(--term-text-strong);
  --text-body:var(--term-text);
  --text-muted:var(--term-text-muted);
  --text-faint:var(--term-text-faint);
  --text-accent:var(--signal-400);
  --text-link:var(--signal-400);
  --text-link-hover:var(--signal-beam);
  --text-on-signal:var(--ink-1000);
  --action-primary:var(--signal-500);
  --action-primary-hover:var(--signal-400);
  /* On ink the display hues are already legible as text, except critical
     red (4.0:1) and info blue (4.3:1), which lift rather than darken. */
  --sev-critical-text:#E06B60;
  --sev-high-text:var(--sev-high);
  --sev-medium-text:var(--sev-medium);
  --sev-medium-display:var(--sev-medium);
  /* Low lifts for the same reason critical does: --sev-low on its own terminal
     tint measures 3.76:1, under AA for a 12px word. --signal-400 is the lifted
     twin of --sev-low (they are the same hue; --sev-low IS --signal-500) and
     measures 5.78:1. */
  --sev-low-text:var(--signal-400);
  --sev-info-text:#7FA8BC;
  --shadow-card:var(--shadow-term-1);
  /* Composed tokens MUST be re-declared here. A var() inside a :root
     declaration substitutes against :root's own values and inherits down
     already-resolved, so overriding only the inputs on this descendant
     leaves the composed value stuck on its paper form. */
  --focus-ring:0 0 0 2px var(--surface-page), 0 0 0 4px var(--text-accent); /* @kind shadow */
  --shadow-1:var(--shadow-term-1);
  --shadow-2:var(--shadow-term-2);
  --shadow-3:var(--shadow-term-2);
  --sev-critical-tint:#2A100E;
  --sev-high-tint:#2A1A0B;
  --sev-medium-tint:#282009;
  --sev-low-tint:#0A2A1E;
  --sev-info-tint:#0E1E26;
  --sev-critical-line:#4A211D;
  --sev-high-line:#4A2F14;
  --sev-medium-line:#453811;
  --sev-low-line:#164636;
  --sev-info-line:#1D3742;
}
