/* ==========================================================================
   VIGIL COMMAND — design tokens (the single source of truth for both planes)
   Aesthetic: theme.png — dark near-black monochrome, large legible type, pill
   chips, rounded cards, generous spacing. No CDN, no build; hand-authored.
   Two planes: WORK (offense+defense, cool default) and OWNER (sovereign, gold).
   Theme-aware: dark default + light; the viewer's toggle stamps data-theme.
   ========================================================================== */

:root {
  /* -- type: a refined system grotesque (CSP-clean, no webfont fetch) -------- */
  --font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "JetBrains Mono", "Cascadia Code", Menlo,
               Consolas, monospace;
  /* large, clearly-legible scale (operator asked for clearly visible sizes) */
  --fs-micro: 11px;   /* uppercase labels */
  --fs-xs: 12.5px;
  --fs-sm: 14px;      /* small UI text */
  --fs-md: 15px;      /* body default */
  --fs-lg: 18px;
  --fs-xl: 22px;      /* card titles */
  --fs-2xl: 30px;     /* screen headings */
  --fs-3xl: 40px;     /* hero / display */
  --lh-tight: 1.2;
  --lh: 1.55;
  --tracking-label: .08em;

  /* -- spacing (8pt) + radius (theme.png rounded cards) --------------------- */
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 24px;
  --sp-6: 32px; --sp-7: 48px; --sp-8: 64px;
  --r-1: 8px; --r-2: 12px; --r-3: 16px; --r-4: 22px; --r-pill: 999px;
  --nav-w: 244px; --nav-w-collapsed: 68px; --drawer-w: 460px; --topbar-h: 64px;
  --content-max: 1320px;

  /* -- dark theme (default) — near-black cool monochrome --------------------- */
  --bg-0: #0a0c10;   /* app background (near-black, slight cool) */
  --bg-1: #0f1219;   /* panels / cards */
  --bg-2: #141922;   /* raised */
  --bg-3: #1b212c;   /* hover / inputs */
  --border: #212734;        /* chosen cool neutral, not pure gray */
  --border-strong: #2c3444;
  --text-0: #eef1f6;        /* high-contrast heading/body */
  --text-1: #9aa4b4;        /* secondary */
  --text-2: #626c7c;        /* faint / captions */

  /* primary emphasis = white pill on dark (straight from theme.png) */
  --primary-fg: #0a0c10;
  --primary-bg: #f4f6fa;
  --primary-bg-hover: #ffffff;

  /* OWNER plane accent (sovereign — approvals, keys, kill-switch): gold */
  --owner: #e8b64c;
  --owner-dim: color-mix(in srgb, var(--owner) 22%, transparent);
  --owner-line: color-mix(in srgb, var(--owner) 42%, var(--border));

  /* WORK plane brand hint (kept restrained; chrome stays monochrome) */
  --brand: #cfd6e2;

  /* -- functional six-state status vocabulary (desaturated to fit monochrome) */
  --st-idle: #6b7482;
  --st-queued: #e8b64c;     /* = owner gold: "waiting for you" */
  --st-running: #5b9bd5;    /* calm blue, animated */
  --st-confirmed: #4bbf8a;  /* proven FACT (oracle) */
  --st-refuted: #7c8698;    /* slate, dimmed */
  --st-blocked: #e06a5e;    /* refusal / gate / danger */

  /* severity ramp */
  --sev-critical: #e0574b;
  --sev-high: #e8894c;
  --sev-medium: #e8b64c;
  --sev-low: #5b9bd5;
  --sev-info: #8a94a6;

  --shadow-1: 0 4px 16px rgba(0,0,0,.35);
  --shadow-2: 0 12px 40px rgba(0,0,0,.5);
  --focus: 0 0 0 2px var(--bg-0), 0 0 0 4px var(--st-running);
}

/* explicit dark (toggle wins over the media query in both directions) */
:root[data-theme="dark"] { color-scheme: dark; }

/* -- light theme ----------------------------------------------------------- */
:root[data-theme="light"] {
  color-scheme: light;
  --bg-0: #f5f7fb; --bg-1: #ffffff; --bg-2: #f7f9fc; --bg-3: #eceff5;
  --border: #e3e8f0; --border-strong: #ccd4e0;
  --text-0: #121722; --text-1: #47536a; --text-2: #78849a;
  --primary-fg: #ffffff; --primary-bg: #12151c; --primary-bg-hover: #000000;
  --owner: #b47f12; --owner-dim: color-mix(in srgb, var(--owner) 16%, transparent);
  --owner-line: color-mix(in srgb, var(--owner) 40%, var(--border));
  --brand: #3a4763;
  --st-idle: #7b8598; --st-queued: #b47f12; --st-running: #2b7fc4;
  --st-confirmed: #1c9c68; --st-refuted: #8894a6; --st-blocked: #cf4a3d;
  --sev-critical: #cf4033; --sev-high: #c56a1e; --sev-medium: #b47f12;
  --sev-low: #2b7fc4; --sev-info: #6b7889;
  --shadow-1: 0 4px 16px rgba(20,30,50,.10); --shadow-2: 0 12px 36px rgba(20,30,50,.16);
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --bg-0: #f5f7fb; --bg-1: #ffffff; --bg-2: #f7f9fc; --bg-3: #eceff5;
    --border: #e3e8f0; --border-strong: #ccd4e0;
    --text-0: #121722; --text-1: #47536a; --text-2: #78849a;
    --primary-fg: #ffffff; --primary-bg: #12151c; --primary-bg-hover: #000000;
    --owner: #b47f12; --owner-dim: color-mix(in srgb, var(--owner) 16%, transparent);
    --owner-line: color-mix(in srgb, var(--owner) 40%, var(--border));
    --brand: #3a4763;
    --st-idle: #7b8598; --st-queued: #b47f12; --st-running: #2b7fc4;
    --st-confirmed: #1c9c68; --st-refuted: #8894a6; --st-blocked: #cf4a3d;
    --sev-critical: #cf4033; --sev-high: #c56a1e; --sev-medium: #b47f12;
    --sev-low: #2b7fc4; --sev-info: #6b7889;
    --shadow-1: 0 4px 16px rgba(20,30,50,.10); --shadow-2: 0 12px 36px rgba(20,30,50,.16);
  }
}
