/* Design tokens: colors, spacing, typography, radii, shadows.
   Light theme is the default; dark theme follows prefers-color-scheme
   unless the user picked a theme explicitly (data-theme on <html>). */

:root {
  color-scheme: light;

  --font-sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  --brand-primary: #3b82f6;
  --brand-primary-strong: #1d4ed8;
  --brand-accent: #22c55e;
  --brand-accent-strong: #15803d;

  --bg: #f8fafc;
  --bg-elevated: #ffffff;
  --bg-muted: #f1f5f9;
  --bg-inset: #e9eef6;
  --bg-inverse: #0f172a;

  --border: #e2e8f0;
  --border-strong: #cbd5e1;

  --text: #0f172a;
  --text-muted: #475569;
  --text-subtle: #64748b;
  --text-inverse: #f8fafc;

  --success: #15803d;
  --warning: #b45309;
  --danger: #b91c1c;
  --info: #1d4ed8;

  --focus-ring: #2563eb;
  --overlay: rgba(15, 23, 42, 0.55);

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.08);
  --shadow-md: 0 12px 32px rgba(15, 23, 42, 0.12);
  --shadow-lg: 0 24px 60px rgba(15, 23, 42, 0.18);

  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-pill: 999px;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 72px;

  --container: 1180px;
  --container-narrow: 820px;
  --header-height: 68px;

  --transition: 160ms ease;
  --transition-slow: 280ms ease;
}

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

  --brand-primary: #60a5fa;
  --brand-primary-strong: #93c5fd;
  --brand-accent: #4ade80;
  --brand-accent-strong: #86efac;

  --bg: #0b1220;
  --bg-elevated: #111c30;
  --bg-muted: #16233a;
  --bg-inset: #0e1728;
  --bg-inverse: #f8fafc;

  --border: #1f2c45;
  --border-strong: #2c3d5b;

  --text: #e8eef8;
  --text-muted: #a9b7cc;
  --text-subtle: #8b9ab1;
  --text-inverse: #0b1220;

  --success: #4ade80;
  --warning: #fbbf24;
  --danger: #f87171;
  --info: #93c5fd;

  --focus-ring: #93c5fd;
  --overlay: rgba(2, 6, 23, 0.7);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.5);
  --shadow-md: 0 16px 40px rgba(0, 0, 0, 0.55);
  --shadow-lg: 0 28px 70px rgba(0, 0, 0, 0.6);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    color-scheme: dark;

    --brand-primary: #60a5fa;
    --brand-primary-strong: #93c5fd;
    --brand-accent: #4ade80;
    --brand-accent-strong: #86efac;

    --bg: #0b1220;
    --bg-elevated: #111c30;
    --bg-muted: #16233a;
    --bg-inset: #0e1728;
    --bg-inverse: #f8fafc;

    --border: #1f2c45;
    --border-strong: #2c3d5b;

    --text: #e8eef8;
    --text-muted: #a9b7cc;
    --text-subtle: #8b9ab1;
    --text-inverse: #0b1220;

    --success: #4ade80;
    --warning: #fbbf24;
    --danger: #f87171;
    --info: #93c5fd;

    --focus-ring: #93c5fd;
    --overlay: rgba(2, 6, 23, 0.7);

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.5);
    --shadow-md: 0 16px 40px rgba(0, 0, 0, 0.55);
    --shadow-lg: 0 28px 70px rgba(0, 0, 0, 0.6);
  }
}
