:root {
  color-scheme: light;
  /* ──── Primary Color Scale (change --color-primary to re-theme the entire site) ──── */
  --color-primary: #7a9cbd;
  --color-primary-light: #9bb8d4;
  --color-primary-lighter: #c0d5e8;
  --color-primary-dark: #5a7d9e;
  --color-primary-darker: #3d5f7e;
  --color-primary-50: #f0f6fb;
  --color-primary-100: #daeaf5;
  --color-primary-200: #b5d5eb;
  --color-primary-900: #1a3350;

  /* ──── Neutrals ──── */
  --color-gray-50: #f8f9fa;
  --color-gray-100: #f1f3f5;
  --color-gray-200: #e9ecef;
  --color-gray-300: #dee2e6;
  --color-gray-400: #ced4da;
  --color-gray-500: #adb5bd;
  --color-gray-600: #868e96;
  --color-gray-700: #495057;
  --color-gray-800: #343a40;
  --color-gray-900: #212529;

  /* ──── Semantic ──── */
  --color-success: #37b24d;
  --color-warning: #f59f00;
  --color-danger: #f03e3e;
  --color-info: #1c7ed6;

  /* ──── Background & Text ──── */
  --bg-primary: #ffffff;
  --bg-secondary: #f7f9fc;
  --bg-tertiary: #eef2f7;
  --bg-card: #ffffff;
  --bg-input: #ffffff;
  --bg-overlay: rgba(15, 25, 40, 0.6);
  --text-primary: #1a2332;
  --text-secondary: #4a5568;
  --text-muted: #718096;
  --text-inverse: #ffffff;
  --border-color: #e2e8f0;

  /* ──── Shadows ──── */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.07), 0 2px 4px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.09), 0 4px 10px rgba(0, 0, 0, 0.06);
  --shadow-xl: 0 20px 50px rgba(0, 0, 0, 0.12), 0 8px 20px rgba(0, 0, 0, 0.07);

  /* ──── Border Radius ──── */
  --radius-xs: 4px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-2xl: 32px;
  --radius-full: 9999px;

  /* ──── Spacing ──── */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 5rem;
  --space-4xl: 7rem;

  /* ──── Typography ──── */
  --font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-heading: 'DM Serif Display', Georgia, serif;
  --font-size-xs: 0.75rem;
  --font-size-sm: 0.875rem;
  --font-size-md: 1rem;
  --font-size-lg: 1.125rem;
  --font-size-xl: 1.25rem;
  --font-size-2xl: 1.5rem;
  --font-size-3xl: 2rem;
  --font-size-4xl: 2.75rem;
  --font-size-5xl: clamp(2.5rem, 6vw, 4rem);
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;
  --line-height: 1.65;
  --line-height-tight: 1.3;

  /* ──── Layout ──── */
  --container-max: 1200px;
  --container-narrow: 780px;
  --header-height: 72px;
  --sidebar-width: 260px;
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
  --transition-slow: 0.4s ease;
}

/* ──── Dark Mode: system preference (when no explicit data-theme set) ──── */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    color-scheme: dark;
    --bg-primary: #0d1824;
    --bg-secondary: #131f2e;
    --bg-tertiary: #1a2a3d;
    --bg-card: #172030;
    --bg-input: #1a2a3d;
    --bg-overlay: rgba(0, 0, 0, 0.75);
    --text-primary: #e2e8f0;
    --text-secondary: #a0aec0;
    --text-muted: #718096;
    --border-color: #243448;
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4), 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.4);
    --shadow-xl: 0 20px 50px rgba(0, 0, 0, 0.5);
    --color-gray-50: #172030;
    --color-gray-100: #1a2a3d;
    --color-gray-200: #243448;
    --color-gray-300: #2e4460;
  }
}

/* ──── Dark Mode: explicit choice (JS-set data-theme overrides system) ──── */
[data-theme="dark"] {
  color-scheme: dark;
  --bg-primary: #0d1824;
  --bg-secondary: #131f2e;
  --bg-tertiary: #1a2a3d;
  --bg-card: #172030;
  --bg-input: #1a2a3d;
  --bg-overlay: rgba(0, 0, 0, 0.75);
  --text-primary: #e2e8f0;
  --text-secondary: #a0aec0;
  --text-muted: #718096;
  --border-color: #243448;
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4), 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.4);
  --shadow-xl: 0 20px 50px rgba(0, 0, 0, 0.5);
  --color-gray-50: #172030;
  --color-gray-100: #1a2a3d;
  --color-gray-200: #243448;
  --color-gray-300: #2e4460;
}

/* Force light when user explicitly chose it (overrides system dark) */
[data-theme="light"] {
  color-scheme: light;
  --bg-primary: #ffffff;
  --bg-secondary: #f7f9fc;
  --bg-tertiary: #eef2f7;
  --bg-card: #ffffff;
  --bg-input: #ffffff;
  --bg-overlay: rgba(15, 25, 40, 0.6);
  --text-primary: #1a2332;
  --text-secondary: #4a5568;
  --text-muted: #718096;
  --border-color: #e2e8f0;
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.07), 0 2px 4px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.09), 0 4px 10px rgba(0, 0, 0, 0.06);
  --shadow-xl: 0 20px 50px rgba(0, 0, 0, 0.12), 0 8px 20px rgba(0, 0, 0, 0.07);
  --color-gray-50: #f8f9fa;
  --color-gray-100: #f1f3f5;
  --color-gray-200: #e9ecef;
  --color-gray-300: #dee2e6;
}
