/* ============================================================
   AMERICAN PULSE — Design Tokens
   A civic data instrument. Sober, precise, non-partisan by design:
   blue/red are used only as literal party-data encodings, never
   as brand or decorative color. The brand accent is amber —
   a neutral "signal" color evoking gauges, dashboards, instrumentation.
   ============================================================ */

:root, [data-theme="light"] {
  /* Surfaces */
  --color-bg: #f5f4f1;
  --color-surface: #ffffff;
  --color-surface-2: #fbfaf8;
  --color-surface-offset: #ecebe6;
  --color-surface-offset-2: #e3e1da;
  --color-surface-dynamic: #d8d6cd;
  --color-divider: #ddd9d1;
  --color-border: #cfccc2;

  /* Text */
  --color-text: #1c1b18;
  --color-text-muted: #625f56;
  --color-text-faint: #a19d90;
  --color-text-inverse: #f8f7f3;

  /* Primary accent — Signal Amber (instrumentation, not partisan) */
  --color-primary: #a15c00;
  --color-primary-hover: #7c4700;
  --color-primary-active: #5e3600;
  --color-primary-highlight: #e9dcc4;

  /* Data encodings — ONLY used for party/political data series */
  --color-party-r: #b3413a;
  --color-party-r-soft: #e3c3c0;
  --color-party-d: #2f5f8a;
  --color-party-d-soft: #c3d2df;
  --color-party-i: #6b6456;
  --color-party-i-soft: #dcd8cd;

  /* Status */
  --color-success: #3d7a3f;
  --color-success-hover: #2c5c2e;
  --color-success-highlight: #cfe0cd;
  --color-warning: #a1690a;
  --color-warning-hover: #7c5108;
  --color-warning-highlight: #e9dcc0;
  --color-error: #a1332c;
  --color-error-hover: #7c2620;
  --color-error-highlight: #e3c7c4;
  --color-notification: #a1332c;

  /* Chart categorical sequence (non-partisan data) */
  --color-chart-1: #a15c00;
  --color-chart-2: #2f6b6f;
  --color-chart-3: #6b4a8a;
  --color-chart-4: #4a6b3d;
  --color-chart-5: #8a5a4a;
  --color-chart-6: #4a5a8a;

  --radius-sm: 0.3125rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-full: 9999px;

  --transition-interactive: 160ms cubic-bezier(0.16, 1, 0.3, 1);

  --shadow-sm: 0 1px 2px oklch(0.2 0.01 80 / 0.07);
  --shadow-md: 0 4px 14px oklch(0.2 0.01 80 / 0.09);
  --shadow-lg: 0 16px 40px oklch(0.2 0.01 80 / 0.14);

  --content-narrow: 640px;
  --content-default: 960px;
  --content-wide: 1280px;
  --content-full: 100%;

  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'Inter', 'Helvetica Neue', sans-serif;
  --font-mono: 'IBM Plex Mono', 'SF Mono', monospace;
}

[data-theme="dark"] {
  --color-bg: #14130f;
  --color-surface: #1a1915;
  --color-surface-2: #1f1e19;
  --color-surface-offset: #201f1a;
  --color-surface-offset-2: #26251f;
  --color-surface-dynamic: #302e26;
  --color-divider: #2a2921;
  --color-border: #3a382e;

  --color-text: #e8e5db;
  --color-text-muted: #a19d8e;
  --color-text-faint: #6b6858;
  --color-text-inverse: #1c1b18;

  --color-primary: #d99a3f;
  --color-primary-hover: #e9b164;
  --color-primary-active: #f3c583;
  --color-primary-highlight: #3a3020;

  --color-party-r: #d97a72;
  --color-party-r-soft: #4a2e2c;
  --color-party-d: #7fa8cc;
  --color-party-d-soft: #263647;
  --color-party-i: #a39c8a;
  --color-party-i-soft: #35332a;

  --color-success: #7fb37f;
  --color-success-hover: #9bc99b;
  --color-success-highlight: #26351f;
  --color-warning: #d99a3f;
  --color-warning-hover: #e9b164;
  --color-warning-highlight: #3a3020;
  --color-error: #d9756c;
  --color-error-hover: #e69a92;
  --color-error-highlight: #3f2622;
  --color-notification: #d9756c;

  --color-chart-1: #d99a3f;
  --color-chart-2: #5fa3a8;
  --color-chart-3: #a389c4;
  --color-chart-4: #8fb37a;
  --color-chart-5: #c48a75;
  --color-chart-6: #8a9bce;

  --shadow-sm: 0 1px 2px oklch(0 0 0 / 0.3);
  --shadow-md: 0 4px 14px oklch(0 0 0 / 0.35);
  --shadow-lg: 0 16px 40px oklch(0 0 0 / 0.5);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --color-bg: #14130f;
    --color-surface: #1a1915;
    --color-surface-2: #1f1e19;
    --color-surface-offset: #201f1a;
    --color-surface-offset-2: #26251f;
    --color-surface-dynamic: #302e26;
    --color-divider: #2a2921;
    --color-border: #3a382e;
    --color-text: #e8e5db;
    --color-text-muted: #a19d8e;
    --color-text-faint: #6b6858;
    --color-text-inverse: #1c1b18;
    --color-primary: #d99a3f;
    --color-primary-hover: #e9b164;
    --color-primary-active: #f3c583;
    --color-primary-highlight: #3a3020;
    --color-party-r: #d97a72;
    --color-party-r-soft: #4a2e2c;
    --color-party-d: #7fa8cc;
    --color-party-d-soft: #263647;
    --color-party-i: #a39c8a;
    --color-party-i-soft: #35332a;
    --color-success: #7fb37f;
    --color-warning: #d99a3f;
    --color-error: #d9756c;
    --color-chart-1: #d99a3f;
    --color-chart-2: #5fa3a8;
    --color-chart-3: #a389c4;
    --color-chart-4: #8fb37a;
    --color-chart-5: #c48a75;
    --color-chart-6: #8a9bce;
    --shadow-sm: 0 1px 2px oklch(0 0 0 / 0.3);
    --shadow-md: 0 4px 14px oklch(0 0 0 / 0.35);
    --shadow-lg: 0 16px 40px oklch(0 0 0 / 0.5);
  }
}

:root {
  --text-xs: clamp(0.75rem, 0.7rem + 0.2vw, 0.8125rem);
  --text-sm: clamp(0.8125rem, 0.78rem + 0.2vw, 0.9375rem);
  --text-base: clamp(0.9375rem, 0.9rem + 0.2vw, 1rem);
  --text-lg: clamp(1.0625rem, 1rem + 0.4vw, 1.25rem);
  --text-xl: clamp(1.375rem, 1.2rem + 0.9vw, 1.875rem);
  --text-2xl: clamp(1.75rem, 1.3rem + 1.8vw, 2.75rem);

  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
}
