/* ============================================================
   DESIGN TOKENS — Edit colors, fonts, and spacing here
   ============================================================ */

:root,
[data-theme='light'] {
  /* Brand colors — change these to rebrand the entire site */
  --color-accent: #1a3a5c;
  --color-accent-hover: #0f2540;
  --color-accent-light: #e8eef5;
  --color-accent-2: #c9822a;   /* secondary warm accent (titles, highlights) */

  /* Surfaces */
  --color-bg: #f8f7f4;
  --color-surface: #ffffff;
  --color-surface-2: #f2f1ee;
  --color-border: #dcdad5;
  --color-divider: #e5e3de;

  /* Text */
  --color-text: #1a1917;
  --color-text-muted: #6b6a67;
  --color-text-faint: #b0afab;
  --color-text-inverse: #f9f8f5;

  /* Type scale */
  --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
  --text-sm: clamp(0.875rem, 0.8rem + 0.35vw, 1rem);
  --text-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --text-lg: clamp(1.125rem, 1rem + 0.75vw, 1.5rem);
  --text-xl: clamp(1.5rem, 1.2rem + 1.25vw, 2.25rem);
  --text-2xl: clamp(2rem, 1.2rem + 2.5vw, 3.5rem);
  --text-hero: clamp(2.5rem, 1rem + 5vw, 5rem);

  /* Spacing */
  --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;
  --space-32: 8rem;

  /* Radii */
  --radius-sm: 0.25rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(26,25,23,0.08);
  --shadow-md: 0 4px 16px rgba(26,25,23,0.1);
  --shadow-lg: 0 12px 40px rgba(26,25,23,0.14);

  /* Layout */
  --content-narrow: 640px;
  --content-default: 960px;
  --content-wide: 1200px;

  /* Fonts — change these to swap typography */
  --font-display: 'Playfair Display', Georgia, serif;
  --font-body: 'Inter', 'Helvetica Neue', sans-serif;

  /* Transitions */
  --transition: 200ms cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme='dark'] {
  --color-accent: #6aade0;
  --color-accent-hover: #8ac3ea;
  --color-accent-light: #1e2d3d;
  --color-accent-2: #ebb96a;

  --color-bg: #131210;
  --color-surface: #1e1c1a;
  --color-surface-2: #252320;
  --color-border: #38352f;
  --color-divider: #2e2c28;

  /* Improved contrast — all pass WCAG AA on dark backgrounds */
  --color-text: #edeae4;        /* was #d8d6d2 — brighter main text */
  --color-text-muted: #b0ada6;  /* was #807e7a — much more legible */
  --color-text-faint: #7a7772;  /* was #4e4c49 — visible for refs/captions */
  --color-text-inverse: #1a1917;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.35);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.5);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.65);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --color-accent: #6aade0;
    --color-accent-hover: #8ac3ea;
    --color-accent-light: #1e2d3d;
    --color-accent-2: #ebb96a;
    --color-bg: #131210;
    --color-surface: #1e1c1a;
    --color-surface-2: #252320;
    --color-border: #38352f;
    --color-divider: #2e2c28;
    --color-text: #edeae4;
    --color-text-muted: #b0ada6;
    --color-text-faint: #7a7772;
    --color-text-inverse: #1a1917;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.35);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.5);
    --shadow-lg: 0 12px 40px rgba(0,0,0,0.65);
  }
}
