/* Sentinel-AI — design tokens.
   Graphite instrument panel. Two modes, both solved against contrast floors;
   docs/DESIGN.md carries the measured table. No gradients, no glow, no glass.
   Gate roles (--text, --muted, --primary, --on-primary, --border, --focus)
   hold literal hex so tools/check.py can measure them; the design names
   (--ink, --accent, --line) alias the roles, so there is one source of truth. */

:root {
  color-scheme: light;

  /* surfaces */
  --bg: #F6F6F2;
  --scrim: rgba(16, 20, 22, 0.38);
  --surface: #FFFFFF;
  --surface-2: #EFEFE9;

  /* hairlines */
  --border: #DCDCD2;          /* = --line */
  --line-strong: #BFBFB2;

  /* ink */
  --text: #101416;            /* = --ink */
  --muted: #4A565C;           /* = --ink-2 */
  --ink-3: #5F6D73;           /* brief #6C7A80 measured 4.44:1 on --surface-2; AA needs 4.5 */

  /* signal */
  --primary: #3E5A00;         /* = --accent */
  --on-primary: #F4FFD6;      /* = --on-accent */
  --focus: #3E5A00;

  /* status, re-solved for the light surface */
  --safe: #0F7A55;
  --watch: #8A5A00;
  --warn: #A34A00;
  --danger: #B3261E;
  --critical: #8E0F0A;

  /* aliases — the names the components use */
  --ink: var(--text);
  --ink-2: var(--muted);
  --accent: var(--primary);
  --on-accent: var(--on-primary);
  --line: var(--border);

  /* type */
  --font-display: -apple-system, "Segoe UI Variable Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-body: -apple-system, "Segoe UI Variable Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "Cascadia Mono", "SF Mono", Consolas, monospace;

  /* 8px rhythm */
  --s1: 4px;
  --s2: 8px;
  --s3: 12px;
  --s4: 16px;
  --s5: 24px;
  --s6: 32px;
  --s7: 40px;
  --s8: 56px;

  --r10: 10px;
  --r16: 16px;
  --hairline: 0 1px 0 rgba(16, 20, 22, 0.04);

  --row: 44px;
  --density: regular;

  --t1: 120ms;
  --t2: 180ms;
  --t3: 240ms;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);

  --rail: 232px;
  --page: 880px;
}

/* Explicit dark, chosen by the switch. */
[data-theme="dark"] {
  color-scheme: dark;

  --bg: #0A0D0F;
  --scrim: rgba(0, 0, 0, 0.62);
  --surface: #101518;
  --surface-2: #151C20;

  --border: #232D33;
  --line-strong: #33414A;

  --text: #ECF2F4;
  --muted: #A7B6BE;
  --ink-3: #74858F;

  --primary: #C9F05B;
  --on-primary: #0A0D0F;
  --focus: #C9F05B;

  --safe: #4FD1A5;
  --watch: #F2C149;
  --warn: #FF9558;
  --danger: #FF6B6B;
  --critical: #FF3B30;

  --hairline: 0 1px 0 rgba(0, 0, 0, 0.4);
}

/* The operating system decides until a choice is stored. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;

    --bg: #0A0D0F;
    --scrim: rgba(0, 0, 0, 0.62);
    --surface: #101518;
    --surface-2: #151C20;

    --border: #232D33;
    --line-strong: #33414A;

    --text: #ECF2F4;
    --muted: #A7B6BE;
    --ink-3: #74858F;

    --primary: #C9F05B;
    --on-primary: #0A0D0F;
    --focus: #C9F05B;

    --safe: #4FD1A5;
    --watch: #F2C149;
    --warn: #FF9558;
    --danger: #FF6B6B;
    --critical: #FF3B30;

    --hairline: 0 1px 0 rgba(0, 0, 0, 0.4);
  }
}

/* Density: three working heights, one grid. */
[data-density="compact"] { --row: 36px; --density: compact; }
[data-density="regular"] { --row: 44px; --density: regular; }
[data-density="roomy"] { --row: 56px; --density: roomy; }
