/*
  CSI Atlas design tokens.

  Light is the default theme. Dark is opt-in only, through
  :root[data-theme="dark"], set by theme-init.js from the shared
  localStorage key "csi-atlas-theme". Nothing here reacts to
  prefers-color-scheme.

  Sources: docs/design/DESIGN.md (token table, crime-class palette,
  motion) and the six approved design pages, whose token blocks agree
  apart from the light-dark() form used on the landing page.
*/

:root {
  color-scheme: light;

  --bg: #F4F7FC;
  --surface: #FFFFFF;
  --surface-2: #EAF0F8;
  --surface-warm: #EAF0F8;
  --fg: #0A1020;
  --fg-2: #2C3A52;
  --muted: #5A6B82;
  --meta: #1D63D8;
  --border: #D7E1EE;
  --border-soft: #E6EDF6;
  --accent: #1D63D8;
  --accent-on: #FFFFFF;
  --accent-hover: color-mix(in oklab, var(--accent), black 8%);
  --accent-active: color-mix(in oklab, var(--accent), black 14%);
  --success: #0B7A45;
  --warn: #8F5E00;
  --danger: #B3261E;
  --focus-ring: 0 0 0 4px rgba(29, 99, 216, 0.35);

  /* Crime class palette. Fixed across themes. */
  --class-ransomware: #FF6B6B;
  --class-breach: #FFB020;
  --class-crypto-theft: #8B7CF6;
  --class-crypto-fraud: #E86FB0;
  --class-illicit-finance: #38BDF8;
  --class-sanctions: #60A5FA;
  --class-vulnerability: #A3B93C;
  --class-malware: #7C8CF8;
  --class-platform: #94A3B8;
  --class-other: #94A3B8;
  --class-social-engineering: #F59E6B;

  /* Type */
  --font-display: "Plex Serif", "Noto Serif", Georgia, serif;
  --font-body: "Plex Sans", "Noto Sans", system-ui, sans-serif;
  --font-mono: "Plex Mono", "Noto Sans Mono", ui-monospace, monospace;
  --text-2xs: 9px;
  --text-micro: 10px;
  --text-xs: 11px;
  --text-sm: 12px;
  --text-base: 14px;
  --text-lg: 16px;
  --text-xl: 20px;
  --text-2xl: 28px;
  --text-3xl: 40px;
  --text-4xl: 56px;
  --leading-body: 1.5;
  --leading-tight: 1.08;
  --tracking-display: -0.025em;

  /* Space */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-12: 48px;
  --space-16: 64px;
  --space-20: 80px;

  /* Radii */
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-pill: 9999px;

  /* Motion: DESIGN.md section 4. */
  --motion-fast: 120ms;
  --motion-base: 180ms;
  --motion-theme: 200ms;
  --motion-chart: 600ms;
  --motion-count: 700ms;
  --motion-stagger: 40ms;
  --ease-standard: cubic-bezier(0.2, 0, 0, 1);

  /* Layout */
  --container-max: 1280px;
  --container-gutter-desktop: 36px;
  --container-gutter-tablet: 24px;
  --container-gutter-phone: 16px;
  --content-max: 1040px;
  --section-y-desktop: 80px;
  --section-y-tablet: 60px;
  --section-y-phone: 42px;

  /* Elevation: flat surfaces, one ring for grouped controls. */
  --elev-flat: none;
  --elev-ring: 0 0 0 1px var(--border);
  --elev-raised: 0 24px 72px rgba(15, 35, 70, 0.14);
}

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

  --bg: #090B12;
  --surface: #121722;
  --surface-2: #1B2233;
  --surface-warm: #1B2233;
  --fg: #F8FAFC;
  --fg-2: #CBD5E1;
  --muted: #94A3B8;
  --meta: #60A5FA;
  --border: #2A3447;
  --border-soft: #1D2636;
  --accent: #60A5FA;
  --accent-on: #06101D;
  --accent-hover: color-mix(in oklab, var(--accent), black 8%);
  --accent-active: color-mix(in oklab, var(--accent), black 14%);
  --success: #26DE81;
  --warn: #FBBF24;
  --danger: #FF4757;
  --focus-ring: 0 0 0 4px rgba(96, 165, 250, 0.28);
  --elev-raised: 0 24px 72px rgba(0, 0, 0, 0.42);
}
