/* Attention Lens design tokens.
   Dark is the default, light is toggled via [data-theme="light"].
   All text on bg pairs verified at 4.5 to 1 or better, all UI pairs at 3 to 1. */

:root,
[data-theme="dark"] {
  --bg: #0F0F17;
  --surface: #1C1C2A;
  --surface-2: #23233A;
  --surface-3: #2D2D47;
  --text: #F5F5F4;
  --text-secondary: #C7C2BD;
  --text-tertiary: #A8A29E;
  --accent: #A78BFA;
  --accent-strong: #C4B5FD;
  --accent-muted: rgba(167, 139, 250, 0.18);
  --accent-faint: rgba(167, 139, 250, 0.08);
  --border: rgba(245, 245, 244, 0.08);
  --border-strong: rgba(245, 245, 244, 0.18);
  --focus-ring-colour: #60A5FA;
  --ok: #4ADE80;
  --warn: #FBBF24;
  --err: #F87171;
  --heatmap-start: #0F0F17;
  --heatmap-end: #C4B5FD;
}

[data-theme="light"] {
  --bg: #FAFAF9;
  --surface: #FFFFFF;
  --surface-2: #F5F5F4;
  --surface-3: #E7E5E4;
  --text: #1C1917;
  --text-secondary: #44403C;
  --text-tertiary: #57534E;
  --accent: #6D28D9;
  --accent-strong: #5B21B6;
  --accent-muted: rgba(109, 40, 217, 0.15);
  --accent-faint: rgba(109, 40, 217, 0.06);
  --border: rgba(28, 25, 23, 0.08);
  --border-strong: rgba(28, 25, 23, 0.18);
  --focus-ring-colour: #2563EB;
  --ok: #15803D;
  --warn: #B45309;
  --err: #B91C1C;
  --heatmap-start: #FFFFFF;
  --heatmap-end: #5B21B6;
}

:root {
  /* Typography */
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  /* Fluid font scale, following the brief. */
  --fs-display: 36px;
  --fs-h1: 28px;
  --fs-h2: 20px;
  --fs-h3: 16px;
  --fs-body: 14px;
  --fs-small: 12px;
  --fs-micro: 11px;

  --fw-regular: 400;
  --fw-medium: 500;
  --fw-semibold: 600;
  --fw-bold: 700;

  --ls-tight: -0.02em;
  --ls-wide: 0.06em;

  --lh-tight: 1.1;
  --lh-normal: 1.5;
  --lh-relaxed: 1.7;

  /* Legacy step aliases kept in sync with the new scale. */
  --step-xs: 0.75rem;
  --step-sm: 0.875rem;
  --step-md: 1rem;
  --step-lg: 1.25rem;
  --step-xl: 1.5rem;
  --step-2xl: 2rem;
  --step-3xl: 2.75rem;

  /* Spacing scale, only these values allowed in component CSS. */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;

  /* Radii, per brief. */
  --radius-xs: 2px;  /* inputs */
  --radius-sm: 4px;  /* chips */
  --radius-md: 8px;  /* cards */
  --radius-lg: 12px;
  --radius-xl: 16px;

  /* Shadow */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.12);
  --shadow-md: 0 6px 18px rgba(0, 0, 0, 0.22);

  /* Focus ring */
  --focus-ring-width: 3px;
  --focus-ring-offset: 2px;

  /* Motion */
  --t-fast: 120ms;
  --t-med: 150ms;
  --t-slow: 260ms;
  --easing: cubic-bezier(0.2, 0.8, 0.2, 1);

  /* Layout */
  --page-max: 1280px;
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --t-fast: 1ms;
    --t-med: 1ms;
    --t-slow: 1ms;
  }
}
