/* Shared My CVE navy/copper identity. Severity and chart semantics remain
   separate from brand accents. Dark is the default; the theme bootstrap
   applies a saved preference before first paint. */

:root {
  /* Type families */
  --font-display: "IBM Plex Sans", "Avenir Next", system-ui, sans-serif;
  --font-sans: "IBM Plex Sans", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* Spacing (4px base) */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-6: 24px;
  --space-8: 32px;
  --space-12: 48px;
  --space-16: 64px;

  /* Radius */
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 10px;
  --radius-pill: 999px;
}

:root,
[data-theme="dark"] {
  color-scheme: dark;
  --bg: #101d2b;
  --surface: #192d3d;
  --surface-raised: #21394b;
  --border: #344c60;
  --border-strong: #71899c;
  --ink: #f4f3ee;
  --ink-muted: #b8c9d9;
  --fizz: #f58852;
  --fizz-hover: #ffa271;
  --fizz-text: #ffa271;
  --on-fizz: #101d2b;
  --grape: #ffa271;
  --grape-wash: #263849;
  --citrus: #ffd23f;
  --on-citrus: #101d2b;
  --sev-critical: #e5194a;
  --on-sev-critical: #ffffff;
  --sev-high: #ff5b45;
  --sev-medium: #f2c230;
  --sev-low: #5fb0ff;
  --sev-none: #344c60;
  --on-sev: #101d2b;
  --patched: #3fd68a;
  --danger-text: #ff7a96;
  --danger-wash: #33121f;
  --warn-text: #ffc861;
  --warn-wash: #30240f;
  --patched-wash: #10291c;
  --focus: #ffa271;
  --shadow-card: 0 1px 0 rgba(255,255,255,0.04) inset, 0 8px 24px rgba(0,0,0,0.35);
  --shadow-pop: 0 12px 32px rgba(0,0,0,0.5);
}

[data-theme="light"] {
  color-scheme: light;
  --bg: #f7f5f0;
  --surface: #ffffff;
  --surface-raised: #eef2f5;
  --border: #d8e0e6;
  --border-strong: #778b9b;
  --ink: #101d2b;
  --ink-muted: #52697d;
  --fizz: #f58852;
  --fizz-hover: #f99a6b;
  --fizz-text: #974019;
  --on-fizz: #101d2b;
  --grape: #974019;
  --grape-wash: #f7e9df;
  --citrus: #ffd23f;
  --on-citrus: #101d2b;
  --sev-critical: #c8133f;
  --on-sev-critical: #ffffff;
  --sev-high: #ff5b45;
  --sev-medium: #f2c230;
  --sev-low: #5fb0ff;
  --sev-none: #d8e0e6;
  --on-sev: #101d2b;
  --patched: #11713f;
  --danger-text: #b3123a;
  --danger-wash: #fde9ee;
  --warn-text: #8a5300;
  --warn-wash: #fff3d9;
  --patched-wash: #e4f5eb;
  --focus: #974019;
  --shadow-card: 0 1px 2px rgba(26,19,38,0.06), 0 8px 24px rgba(26,19,38,0.06);
  --shadow-pop: 0 12px 32px rgba(26,19,38,0.14);
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme]) {
    color-scheme: light;
    --bg: #f7f5f0;
    --surface: #ffffff;
    --surface-raised: #eef2f5;
    --border: #d8e0e6;
    --border-strong: #778b9b;
    --ink: #101d2b;
    --ink-muted: #52697d;
    --fizz: #f58852;
    --fizz-hover: #f99a6b;
    --fizz-text: #974019;
    --on-fizz: #101d2b;
    --grape: #974019;
    --grape-wash: #f7e9df;
    --citrus: #ffd23f;
    --on-citrus: #101d2b;
    --sev-critical: #c8133f;
    --on-sev-critical: #ffffff;
    --sev-high: #ff5b45;
    --sev-medium: #f2c230;
    --sev-low: #5fb0ff;
    --sev-none: #d8e0e6;
    --on-sev: #101d2b;
    --patched: #11713f;
    --danger-text: #b3123a;
    --danger-wash: #fde9ee;
    --warn-text: #8a5300;
    --warn-wash: #fff3d9;
    --patched-wash: #e4f5eb;
    --focus: #974019;
    --shadow-card: 0 1px 2px rgba(26,19,38,0.06), 0 8px 24px rgba(26,19,38,0.06);
    --shadow-pop: 0 12px 32px rgba(26,19,38,0.14);
  }
}

/* Type styles */
.t-display-xl { font-family: var(--font-display); font-size: 56px; line-height: 60px; font-weight: 800; letter-spacing: -0.02em; }
.t-display { font-family: var(--font-display); font-size: 40px; line-height: 44px; font-weight: 800; letter-spacing: -0.015em; }
.t-heading { font-family: var(--font-display); font-size: 28px; line-height: 34px; font-weight: 700; letter-spacing: -0.01em; }
.t-subheading { font-family: var(--font-display); font-size: 20px; line-height: 28px; font-weight: 700; letter-spacing: normal; }
.t-body-lg { font-family: var(--font-sans); font-size: 17px; line-height: 26px; font-weight: 400; letter-spacing: normal; }
.t-body { font-family: var(--font-sans); font-size: 15px; line-height: 22px; font-weight: 400; letter-spacing: normal; }
.t-body-sm { font-family: var(--font-sans); font-size: 13px; line-height: 20px; font-weight: 400; letter-spacing: normal; }
.t-label { font-family: var(--font-sans); font-size: 12px; line-height: 16px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; }
.t-mono { font-family: var(--font-mono); font-size: 13px; line-height: 20px; font-weight: 500; letter-spacing: normal; }

/* Chart tokens (docs/DASHBOARDS.md "Colour", common::charts::SeriesColor).
   Categorical slots are the dataviz reference palette, validated against
   our surfaces (#192d3d dark, #ffffff light): all checks pass in dark;
   in light, slots 3/4/5 are under 3:1, so charts using them must show
   direct labels or the table view (every chart has one). Severity charts
   use the design-system colours, except dark critical: #e5194a sits too
   close to sev-high (#ff5b45, deltaE 11 < 15), so charts use #c0145a
   (deltaE 18.4). Severity is always labelled (word or letter). Status
   tones are fixed in both themes and always come with an icon. */
:root,
[data-theme="dark"] {
  --viz-1: #3987e5;
  --viz-2: #d95926;
  --viz-3: #199e70;
  --viz-4: #c98500;
  --viz-5: #d55181;
  --viz-6: #008300;
  --viz-7: #9085e9;
  --viz-8: #e66767;
  --viz-sev-critical: #c0145a;
  --viz-sev-high: var(--sev-high);
  --viz-sev-medium: var(--sev-medium);
  --viz-sev-low: var(--sev-low);
  --viz-sev-none: var(--sev-none);
  --viz-seq-1: #0d366b;
  --viz-seq-2: #184f95;
  --viz-seq-3: #1c5cab;
  --viz-seq-4: #256abf;
  --viz-seq-5: #3987e5;
  --viz-seq-6: #6da7ec;
  --viz-seq-7: #9ec5f4;
  --viz-muted: #91a6b9;
  --viz-accent: var(--grape);
  --viz-grid: #344c60;
  --viz-axis: var(--border);
  --viz-surface: var(--surface);
  --viz-status-good: #0ca30c;
  --viz-status-warning: #fab219;
  --viz-status-serious: #ec835a;
  --viz-status-critical: #d03b3b;
}

[data-theme="light"] {
  --viz-1: #2a78d6;
  --viz-2: #eb6834;
  --viz-3: #1baf7a;
  --viz-4: #eda100;
  --viz-5: #e87ba4;
  --viz-6: #008300;
  --viz-7: #4a3aa7;
  --viz-8: #e34948;
  --viz-sev-critical: var(--sev-critical);
  --viz-seq-1: #cde2fb;
  --viz-seq-2: #9ec5f4;
  --viz-seq-3: #6da7ec;
  --viz-seq-4: #3987e5;
  --viz-seq-5: #256abf;
  --viz-seq-6: #1c5cab;
  --viz-seq-7: #104281;
  --viz-muted: #52697d;
  --viz-grid: #e0e6eb;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme]) {
    --viz-1: #2a78d6;
    --viz-2: #eb6834;
    --viz-3: #1baf7a;
    --viz-4: #eda100;
    --viz-5: #e87ba4;
    --viz-6: #008300;
    --viz-7: #4a3aa7;
    --viz-8: #e34948;
    --viz-sev-critical: var(--sev-critical);
    --viz-seq-1: #cde2fb;
    --viz-seq-2: #9ec5f4;
    --viz-seq-3: #6da7ec;
    --viz-seq-4: #3987e5;
    --viz-seq-5: #256abf;
    --viz-seq-6: #1c5cab;
    --viz-seq-7: #104281;
    --viz-muted: #52697d;
    --viz-grid: #e0e6eb;
  }
}
