/*
 * Probable Cause design tokens. Every color, size, radius, shadow and timing
 * in the app comes from here. Dark-first "night shift" theme with a full light
 * mode. Color rules: one accent for actions; green = facts you asked; red =
 * facts you missed; amber = flags. Nothing else gets color.
 */
:root {
  /* Type */
  --font-ui: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-law: "Source Serif 4", "Source Serif Pro", Georgia, "Times New Roman", serif;
  --font-mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, monospace;
  --text-xs: 0.75rem;   /* 12 */
  --text-sm: 0.875rem;  /* 14 */
  --text-md: 1rem;      /* 16 */
  --text-lg: 1.125rem;  /* 18 */
  --text-xl: 1.375rem;  /* 22 */
  --text-2xl: 1.75rem;  /* 28 */
  --text-3xl: 2.25rem;  /* 36 */
  --text-4xl: 3rem;     /* 48 */
  --leading-tight: 1.2;
  --leading-normal: 1.5;
  --leading-law: 1.7;
  --weight-regular: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;

  /* 8-point spacing */
  --space-0: 0;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 16px;
  --space-4: 24px;
  --space-5: 32px;
  --space-6: 40px;
  --space-7: 48px;
  --space-8: 64px;

  /* Radius scale */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-pill: 999px;

  /* Layout */
  --tap: 44px;
  --content-max: 1200px;
  --gutter: 16px;

  /* Motion: 150-300ms, ease-out or a gentle spring */
  --dur-fast: 150ms;
  --dur-base: 220ms;
  --dur-slow: 300ms;
  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
  --ease-spring: cubic-bezier(0.34, 1.3, 0.64, 1);

  color-scheme: dark;
  /* Night shift (dark, default): deep navy and charcoal, never pure black */
  --bg: #0b1220;
  --bg-elevated: #0f1829;
  --surface-1: #121c2e;
  --surface-2: #172338;
  --surface-3: #1d2b44;
  --border: #26354f;
  --border-strong: #34476a;
  --text-1: #e8edf6;
  --text-2: #a9b6cc;
  --text-3: #7d8ca6;
  --accent: #5b9bff;
  --accent-strong: #7cb0ff;
  --accent-soft: rgba(91, 155, 255, 0.14);
  --on-accent: #06101f;
  --asked: #3ccb94;
  --asked-soft: rgba(60, 203, 148, 0.14);
  --missed: #f2707b;
  --missed-soft: rgba(242, 112, 123, 0.14);
  --flag: #f2b84b;
  --flag-soft: rgba(242, 184, 75, 0.14);
  --focus: #9cc3ff;
  --scrim: rgba(3, 7, 15, 0.6);
  --illus-sky: #16233a;
  --illus-far: #1f2f4b;
  --illus-near: #2a3d5e;
  --illus-line: #3d5580;
  --illus-light: #f6d27a;
  --map-state: #1b2840;
  --map-state-hover: #24365a;
  --map-stroke: #0b1220;

  /* Three elevation levels */
  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.35), 0 1px 1px rgba(0, 0, 0, 0.2);
  --shadow-2: 0 6px 16px rgba(0, 0, 0, 0.35), 0 2px 4px rgba(0, 0, 0, 0.25);
  --shadow-3: 0 18px 48px rgba(0, 0, 0, 0.5), 0 6px 12px rgba(0, 0, 0, 0.3);
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f3f5f9;
  --bg-elevated: #ffffff;
  --surface-1: #ffffff;
  --surface-2: #f0f3f8;
  --surface-3: #e6ebf3;
  --border: #d8dfea;
  --border-strong: #bcc7d8;
  --text-1: #0e1726;
  --text-2: #435069;
  --text-3: #536079;
  --accent: #1f5fd6;
  --accent-strong: #174bab;
  --accent-soft: rgba(31, 95, 214, 0.1);
  --on-accent: #ffffff;
  --asked: #0f7a55;
  --asked-soft: rgba(15, 122, 85, 0.1);
  --missed: #c42d3b;
  --missed-soft: rgba(196, 45, 59, 0.09);
  --flag: #9a5f00;
  --flag-soft: rgba(176, 112, 0, 0.12);
  --focus: #1f5fd6;
  --scrim: rgba(14, 23, 38, 0.35);
  --illus-sky: #dfe6f2;
  --illus-far: #c8d3e5;
  --illus-near: #aebdd6;
  --illus-line: #8597b7;
  --illus-light: #e9a93a;
  --map-state: #dde4ef;
  --map-state-hover: #cdd7e7;
  --map-stroke: #f3f5f9;
  --shadow-1: 0 1px 2px rgba(15, 23, 42, 0.08), 0 1px 1px rgba(15, 23, 42, 0.04);
  --shadow-2: 0 6px 16px rgba(15, 23, 42, 0.1), 0 2px 4px rgba(15, 23, 42, 0.06);
  --shadow-3: 0 18px 48px rgba(15, 23, 42, 0.18), 0 6px 12px rgba(15, 23, 42, 0.08);
}

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