/* DemandScout — design tokens
   Load fonts.css first (self-hosted IBM Plex).
   Every color, size, space and radius used by components.css lives here.
   Light is the default; [data-theme="dark"] overrides colors only.
   Fonts: IBM Plex Sans + IBM Plex Mono (SIL OFL 1.1, self-hostable). */

:root,
[data-theme="light"] {
  color-scheme: light;

  /* Neutral ground — one cool tint (hue ~220) across the product */
  --bg: #f9fafb;
  --surface: #ffffff;
  --surface-2: #f2f4f6;          /* hover, evidence, code */
  --surface-3: #e8ebef;          /* pressed, selected row */
  --border: #e1e4e8;
  --border-strong: #c9ced6;
  --text: #13161b;
  --text-2: #464d5a;             /* secondary */
  --text-3: #626a78;             /* meta, labels — 5.3:1 on surface */
  --overlay: rgba(19, 22, 27, 0.32);

  /* The single accent — main action, active nav, links, the metric line */
  --accent: #1f5fbf;
  --accent-hover: #194f9f;
  --accent-weak: #e9f0fb;
  --accent-text: #1a55ad;
  --on-accent: #ffffff;

  /* State colors — for state only, never decoration */
  --critical: #b42318;
  --critical-weak: #fdecea;
  --important: #8a5300;          /* amber, darkened for text contrast */
  --important-mark: #d98a00;     /* amber for marks and bars */
  --important-weak: #fdf2de;
  --minor: #626a78;
  --minor-weak: #eef0f3;
  --success: #1c7339;
  --success-weak: #e5f3ea;
  --neutral: #464d5a;
  --neutral-weak: #eef0f3;

  /* Charts — one accent line, comparison in gray */
  --chart-line: var(--accent);
  --chart-compare: #a3aab5;
  --chart-grid: #e8ebef;
  --chart-marker: #13161b;

  --shadow-float: 0 8px 24px rgba(19, 22, 27, 0.12), 0 1px 2px rgba(19, 22, 27, 0.08);
  --focus: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent);
}

[data-theme="dark"] {
  color-scheme: dark;

  --bg: #0e1014;
  --surface: #14171c;
  --surface-2: #1b1f26;
  --surface-3: #242932;
  --border: #272c35;
  --border-strong: #3a414c;
  --text: #e6e8ec;
  --text-2: #abb1bc;
  --text-3: #8c93a0;
  --overlay: rgba(0, 0, 0, 0.56);

  --accent: #6ea2ef;
  --accent-hover: #8db6f4;
  --accent-weak: #18263c;
  --accent-text: #7fadf1;
  --on-accent: #0a1322;

  --critical: #ec8a80;
  --critical-weak: #351917;
  --important: #e0b058;
  --important-mark: #c99640;
  --important-weak: #2f2412;
  --minor: #8c93a0;
  --minor-weak: #1f232a;
  --success: #6dbf88;
  --success-weak: #142a1c;
  --neutral: #abb1bc;
  --neutral-weak: #1f232a;

  --chart-line: var(--accent);
  --chart-compare: #59606c;
  --chart-grid: #232831;
  --chart-marker: #e6e8ec;

  --shadow-float: 0 8px 24px rgba(0, 0, 0, 0.5), 0 0 0 1px #2c323c;
  --focus: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent);
}

:root {
  /* Type — one sans for UI, mono only for evidence (observed values, URLs, code) */
  --font-sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  /* Four sizes, two weights */
  --fs-meta: 12px;               /* labels, meta, badges */
  --fs-table: 13px;              /* tables, dense lists, code */
  --fs-body: 14px;               /* base */
  --fs-title: 20px;              /* screen titles, headline metric */
  --lh-tight: 1.3;
  --lh-body: 1.5;
  --fw-regular: 400;
  --fw-strong: 600;

  /* Space — multiples of 4 */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 20px;
  --s-6: 24px;
  --s-8: 32px;
  --s-10: 40px;
  --s-12: 48px;

  /* Shape */
  --radius: 4px;
  --on-mark: #13161b;           /* text on amber marks, both themes */
  --line: 1px;

  /* Sizes */
  --row-h: 38px;                 /* table row on desktop */
  --control-h: 32px;             /* buttons, inputs on desktop */
  --touch: 44px;                 /* minimum touch target on phone */
  --sidebar-w: 232px;
  --sidebar-w-collapsed: 56px;
  --measure: 68ch;               /* reading width */
  --page-max: 1280px;

  /* Motion — short, only to explain state changes */
  --dur: 120ms;
  --ease: cubic-bezier(0.2, 0, 0, 1);
}

@media (prefers-reduced-motion: reduce) {
  :root { --dur: 0ms; }
}
