:root {
  /* ---- Brand colors ---- */
  --navy-900: #011C40;
  --mint-500: #0FAE93;
  --brick-500: #B23A2E;
  --amber-500: #B9791E;
  --ink-900: #10182A;

  /* ---- Cool greys ---- */
  --gray-0: #FFFFFF;
  --gray-50: #F5F7FA;
  --gray-100: #E8EBF0;
  --gray-200: #D1D6DE;
  --gray-300: #A8B0BD;
  --gray-400: #7A8494;
  --gray-500: #5A6474;
  --gray-600: #424C5C;
  --gray-700: #2E3848;
  --gray-800: #1C2636;
  --gray-900: #10182A;

  /* ---- Typography ---- */
  --font-headline: 'Fraunces', Georgia, serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'IBM Plex Mono', 'SF Mono', monospace;

  /* ---- Font sizes (rem = 16px base) ---- */
  --text-xs: 0.75rem;   /* 12px */
  --text-sm: 0.875rem;  /* 14px */
  --text-base: 1rem;    /* 16px */
  --text-lg: 1.125rem;  /* 18px */
  --text-xl: 1.25rem;   /* 20px */
  --text-2xl: 1.5rem;   /* 24px */
  --text-3xl: 1.875rem; /* 30px */
  --text-4xl: 2.25rem;  /* 36px */
  --text-5xl: 3rem;     /* 48px */

  /* ---- Line heights ---- */
  --leading-tight: 1.2;
  --leading-snug: 1.35;
  --leading-normal: 1.6;
  --leading-relaxed: 1.75;

  /* ---- Spacing ---- */
  --space-1: 0.25rem;  /* 4px */
  --space-2: 0.5rem;   /* 8px */
  --space-3: 0.75rem;  /* 12px */
  --space-4: 1rem;     /* 16px */
  --space-5: 1.25rem;  /* 20px */
  --space-6: 1.5rem;   /* 24px */
  --space-8: 2rem;     /* 32px */
  --space-10: 2.5rem;  /* 40px */
  --space-12: 3rem;    /* 48px */
  --space-16: 4rem;    /* 64px */

  /* ---- Layout ---- */
  --container-max: 75rem; /* 1200px */
  --container-narrow: 42rem; /* ~672px for body text */
  --radius-sm: 0.25rem;
  --radius-md: 0.5rem;

  /* ---- Theme mapping (light default) ---- */
  --color-bg: var(--gray-0);
  --color-surface: var(--gray-50);
  --color-surface-raised: var(--gray-100);
  --color-border: var(--gray-200);
  --color-border-strong: var(--gray-300);
  --color-text: var(--ink-900);
  --color-text-secondary: var(--gray-500);
  --color-text-muted: var(--gray-400);
  --color-accent: var(--mint-500);
  --color-accent-hover: #0D9680;
  --color-header-bg: var(--navy-900);
  --color-header-text: var(--gray-0);
  --color-footer-bg: var(--navy-900);
  --color-footer-text: var(--gray-200);
  --color-link: var(--mint-500);
  --color-link-hover: var(--color-accent-hover);
  --color-urgent: var(--brick-500);
  --color-opinion: var(--amber-500);
}

/* ---- Dark theme ---- */
[data-theme="dark"] {
  --color-bg: #0B1120;
  --color-surface: var(--gray-800);
  --color-surface-raised: var(--gray-700);
  --color-border: var(--gray-700);
  --color-border-strong: var(--gray-600);
  --color-text: var(--gray-100);
  --color-text-secondary: var(--gray-300);
  --color-text-muted: var(--gray-400);
  --color-accent: var(--mint-500);
  --color-accent-hover: #11C4A6;
  --color-header-bg: #000D1F;
  --color-header-text: var(--gray-0);
  --color-footer-bg: #000D1F;
  --color-footer-text: var(--gray-300);
  --color-link: var(--mint-500);
  --color-link-hover: var(--color-accent-hover);
  --color-urgent: #D14A3E;
  --color-opinion: #D4902E;
}

/* Respect OS preference when no explicit data-theme is set */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --color-bg: #0B1120;
    --color-surface: var(--gray-800);
    --color-surface-raised: var(--gray-700);
    --color-border: var(--gray-700);
    --color-border-strong: var(--gray-600);
    --color-text: var(--gray-100);
    --color-text-secondary: var(--gray-300);
    --color-text-muted: var(--gray-400);
    --color-accent: var(--mint-500);
    --color-accent-hover: #11C4A6;
    --color-header-bg: #000D1F;
    --color-header-text: var(--gray-0);
    --color-footer-bg: #000D1F;
    --color-footer-text: var(--gray-300);
    --color-link: var(--mint-500);
    --color-link-hover: var(--color-accent-hover);
    --color-urgent: #D14A3E;
    --color-opinion: #D4902E;
  }
}
