/* Design tokens — single source of truth for spacing, type, colour, layout. */
:root {
  --color-bg: #ffffff;
  --color-surface: #f4f6f9;
  --color-surface-raised: #ffffff;
  --color-border: #d9dee5;
  --color-border-strong: #7a8492; /* >=3:1 on white — WCAG 1.4.11 non-text contrast */
  --color-text: #10161d;
  --color-text-muted: #4b5563;
  --color-text-on-primary: #ffffff;
  --color-primary: #0a5fd6;
  --color-primary-dark: #08469e;
  --color-primary-surface: #eaf2fe;
  --color-success: #0a7d3c;
  --color-success-surface: #e7f6ed;
  --color-danger: #b3261e;
  --color-focus: #0a5fd6;
  --color-link: var(--color-primary);

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --text-xs: 0.8125rem;
  --text-sm: 0.9375rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.375rem;
  --text-2xl: 1.75rem;
  --text-3xl: 2.25rem;
  --text-4xl: 2.875rem;
  --leading-tight: 1.2;
  --leading-normal: 1.55;

  --space-3xs: 0.25rem;
  --space-2xs: 0.5rem;
  --space-xs: 0.75rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2.5rem;
  --space-xl: 4rem;
  --space-2xl: 6rem;

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

  --shadow-sm: 0 1px 2px rgba(16, 24, 32, 0.07);
  --shadow-md: 0 6px 20px rgba(16, 24, 32, 0.09);

  --content-width: 1180px;
  --content-width-narrow: 760px;
  --border-width: 1px;

  --duration-fast: 120ms;
}

@media (prefers-color-scheme: dark) {
  :root {
    --color-bg: #0b0f14;
    --color-surface: #121822;
    --color-surface-raised: #171f2b;
    --color-border: #2a3441;
    --color-border-strong: #5a7089; /* >=3:1 on dark bg — WCAG 1.4.11 non-text contrast */
    --color-text: #eef2f6;
    --color-text-muted: #a7b1bd;
    --color-primary: #4a90ff;
    --color-primary-dark: #2f6fe0;
    --color-primary-surface: #17233a;
    --color-success: #3fcf7f;
    --color-success-surface: #10291b;
    --color-danger: #ff6b63;
    --color-focus: #4a90ff;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
