/* ==========================================================================
   Design tokens — the single source of colours, type, spacing, radii, shadows.
   Light theme on :root, dark theme on [data-theme="dark"].
   Documented in docs/design-system.md and shown live on /style-guide.
   ========================================================================== */
:root {
  /* Brand palette (raw) */
  --navy-950: #0c0a2b;
  --navy-900: #14124a;
  --navy-800: #1e1b6b;   /* primary — deep indigo from the crest (names kept from the first palette) */
  --navy-700: #2d2a9a;
  --navy-600: #3b39c4;
  --navy-100: #e7e6fb;
  --gold-300: #f9a8d4;
  --gold-400: #f68fc5;
  --gold-500: #f472b6;   /* accent — crest pink (fills with dark text, text on indigo) */
  --gold-700: #a21caf;   /* accent for TEXT on light backgrounds (fuchsia, AA contrast) */
  --gold-100: #fce7f3;
  --ivory-50: #fdfcff;
  --ivory-100: #f7f6fc;  /* page background — cool near-white */
  --ivory-200: #eeecf8;
  --green-600: #1a6b43;  /* success / Cameroon / growth */
  --green-100: #dcefe4;
  --red-600: #b42318;
  --red-100: #fde4e1;
  --amber-600: #8a4f06;
  --amber-100: #fdf0d5;
  --ink-900: #141b29;
  --ink-700: #3a4457;
  --ink-500: #5f6b7f;
  --ink-300: #c5ccd8;
  --ink-200: #dde2ea;
  --white: #ffffff;

  /* Semantic colours (use THESE in components) */
  --color-bg: var(--ivory-100);
  --color-bg-alt: var(--ivory-200);
  --color-surface: var(--white);
  --color-surface-raised: var(--white);
  --color-text: var(--ink-900);
  --color-text-muted: var(--ink-500);
  --color-heading: var(--navy-800);
  --color-border: var(--ink-200);
  --color-border-strong: var(--ink-300);
  --color-primary: var(--navy-800);
  --color-primary-hover: var(--navy-700);
  --color-on-primary: var(--ivory-50);
  --color-accent: var(--gold-500);
  --color-accent-hover: var(--gold-400);
  --color-on-accent: var(--navy-950);
  --color-accent-text: var(--gold-700);
  --color-link: var(--navy-600);
  --color-success: var(--green-600);
  --color-success-bg: var(--green-100);
  --color-danger: var(--red-600);
  --color-danger-bg: var(--red-100);
  --color-warning: var(--amber-600);
  --color-warning-bg: var(--amber-100);
  --color-info-bg: var(--navy-100);
  --color-focus: var(--gold-500);
  --color-hero-bg: var(--navy-800);
  --color-hero-text: var(--ivory-50);
  --color-skeleton: var(--ink-200);
  --color-overlay: rgb(12 10 43 / 0.6);

  /* Typography */
  --font-heading: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --fs-xs: 0.8125rem;   /* 13px */
  --fs-sm: 0.9375rem;   /* 15px */
  --fs-base: 1rem;      /* 16px — never smaller for body text */
  --fs-lg: 1.125rem;
  --fs-xl: 1.375rem;
  --fs-2xl: clamp(1.5rem, 1.2rem + 1.2vw, 2rem);
  --fs-3xl: clamp(1.875rem, 1.4rem + 2vw, 2.75rem);
  --fs-4xl: clamp(2.25rem, 1.5rem + 3.6vw, 4rem);
  --lh-tight: 1.15;
  --lh-base: 1.6;

  /* Spacing scale (4px base) */
  --sp-1: 0.25rem; --sp-2: 0.5rem; --sp-3: 0.75rem; --sp-4: 1rem; --sp-5: 1.5rem;
  --sp-6: 2rem; --sp-7: 3rem; --sp-8: 4rem; --sp-9: 6rem;

  /* Shape & depth */
  --radius-sm: 6px; --radius: 12px; --radius-lg: 20px; --radius-full: 999px;
  --shadow-sm: 0 1px 2px rgb(30 27 107 / 0.06), 0 1px 3px rgb(30 27 107 / 0.08);
  --shadow: 0 4px 12px rgb(30 27 107 / 0.08), 0 2px 4px rgb(30 27 107 / 0.06);
  --shadow-lg: 0 18px 40px rgb(30 27 107 / 0.14);

  /* Layout */
  --container: 1200px;
  --gutter: 1rem;
  --header-h: 64px;

  /* Motion */
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --dur-fast: 150ms; --dur: 250ms; --dur-slow: 600ms;

  --z-header: 50; --z-menu: 60; --z-modal: 80; --z-toast: 90;

  color-scheme: light;
}

@media (min-width: 768px) { :root { --gutter: 1.5rem; --header-h: 72px; } }

[data-theme='dark'] {
  --color-bg: #0d0b26;
  --color-bg-alt: #121033;
  --color-surface: #17153f;
  --color-surface-raised: #1e1b4f;
  --color-text: #e9eef6;
  --color-text-muted: #a3afc2;
  --color-heading: #f5ecff;
  --color-border: #2b2860;
  --color-border-strong: #3a3680;
  --color-primary: var(--gold-500);
  --color-primary-hover: var(--gold-400);
  --color-on-primary: var(--navy-950);
  --color-accent: var(--gold-500);
  --color-accent-hover: var(--gold-300);
  --color-on-accent: var(--navy-950);
  --color-accent-text: var(--gold-400);
  --color-link: var(--gold-300);
  --color-success: #4cc38a;
  --color-success-bg: #12352a;
  --color-danger: #ff8a7a;
  --color-danger-bg: #3d1a1a;
  --color-warning: #f2b552;
  --color-warning-bg: #3a2a10;
  --color-info-bg: #1d1a52;
  --color-hero-bg: var(--navy-950);
  --color-skeleton: #2b2860;
  --color-overlay: rgb(0 0 0 / 0.7);
  --shadow-sm: 0 1px 2px rgb(0 0 0 / 0.4);
  --shadow: 0 4px 14px rgb(0 0 0 / 0.35);
  --shadow-lg: 0 18px 40px rgb(0 0 0 / 0.5);
  color-scheme: dark;
}
