/* ==========================================================================
   Direct Relief Recruitment & Immigration — Design Tokens
   Palette derived from brand mark: deep navy + warm gold, neutral surfaces.
   Typography: Playfair Display (display/headings) + Source Sans 3 (body/UI)
   ========================================================================== */

:root {
  /* ---- Type scale (fluid, clamp-based) ---- */
  --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-3xl: clamp(2.5rem, 1rem + 4vw, 5rem);
  --text-hero: clamp(2.75rem, 1rem + 6vw, 6.5rem);

  /* ---- Spacing (4px system) ---- */
  --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;

  /* ---- Radius ---- */
  --radius-sm: 0.25rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.875rem;
  --radius-xl: 1.25rem;
  --radius-full: 9999px;

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

  /* ---- Content widths ---- */
  --content-narrow: 640px;
  --content-default: 960px;
  --content-wide: 1200px;
  --content-full: 100%;

  /* ---- Fonts ---- */
  --font-display: 'Playfair Display', 'Georgia', serif;
  --font-body: 'Source Sans 3', 'Segoe UI', sans-serif;
}

:root,
[data-theme='light'] {
  /* Surfaces */
  --color-bg: #f8f7f4;
  --color-surface: #ffffff;
  --color-surface-2: #fbfaf7;
  --color-surface-offset: #f1efe9;
  --color-surface-offset-2: #e9e6dd;
  --color-divider: #ded9cd;
  --color-border: #d3cdbd;

  /* Text */
  --color-text: #10182b;
  --color-text-muted: #4c5568;
  --color-text-faint: #8c93a3;
  --color-text-inverse: #f8f7f4;

  /* Primary — Deep Navy */
  --color-primary: #07234a;
  --color-primary-hover: #0d3468;
  --color-primary-active: #051a38;
  --color-primary-highlight: #dbe2ee;

  /* Brand Navy — fixed surface color, does NOT invert in dark mode
     (used for hero/CTA/footer/page-header backgrounds so the brand navy
     always reads as deep navy, never as a washed-out pastel blue) */
  --color-brand-navy: #07234a;
  --color-brand-navy-2: #0a2c58;
  --color-brand-navy-3: #0d3468;
  --color-on-brand-navy: #f2f4f8;
  --color-on-brand-navy-muted: #d7dee9;

  /* Accent — Warm Gold */
  --color-gold: #b8842a;
  --color-gold-hover: #9c6f21;
  --color-gold-active: #7d5817;
  --color-gold-highlight: #f2e6c8;

  /* Semantic */
  --color-success: #3c6e35;
  --color-success-highlight: #dbe8d6;
  --color-warning: #94510f;
  --color-warning-highlight: #f0ddc4;
  --color-error: #9a2a2a;
  --color-error-highlight: #f2d9d9;

  --shadow-sm: 0 1px 2px oklch(0.15 0.03 260 / 0.08);
  --shadow-md: 0 6px 16px oklch(0.15 0.03 260 / 0.10);
  --shadow-lg: 0 16px 40px oklch(0.15 0.03 260 / 0.16);
}

[data-theme='dark'] {
  --color-bg: #0a1428;
  --color-surface: #0e1a33;
  --color-surface-2: #11203c;
  --color-surface-offset: #142443;
  --color-surface-offset-2: #182a4c;
  --color-divider: #24365a;
  --color-border: #2b3d63;

  --color-text: #e9ecf3;
  --color-text-muted: #a8b1c5;
  --color-text-faint: #6c7690;
  --color-text-inverse: #0a1428;

  --color-primary: #7fa0d6;
  --color-primary-hover: #9db8e4;
  --color-primary-active: #b9cced;
  --color-primary-highlight: #1c2c4c;

  --color-gold: #e0b558;
  --color-gold-hover: #ecc879;
  --color-gold-active: #f5da9e;
  --color-gold-highlight: #3a2f16;

  --color-success: #7cb872;
  --color-success-highlight: #1c3320;
  --color-warning: #d99a52;
  --color-warning-highlight: #3a2a16;
  --color-error: #d97a7a;
  --color-error-highlight: #3a1e1e;

  --shadow-sm: 0 1px 2px oklch(0 0 0 / 0.3);
  --shadow-md: 0 6px 16px oklch(0 0 0 / 0.35);
  --shadow-lg: 0 16px 40px oklch(0 0 0 / 0.45);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --color-bg: #0a1428;
    --color-surface: #0e1a33;
    --color-surface-2: #11203c;
    --color-surface-offset: #142443;
    --color-surface-offset-2: #182a4c;
    --color-divider: #24365a;
    --color-border: #2b3d63;

    --color-text: #e9ecf3;
    --color-text-muted: #a8b1c5;
    --color-text-faint: #6c7690;
    --color-text-inverse: #0a1428;

    --color-primary: #7fa0d6;
    --color-primary-hover: #9db8e4;
    --color-primary-active: #b9cced;
    --color-primary-highlight: #1c2c4c;

    --color-gold: #e0b558;
    --color-gold-hover: #ecc879;
    --color-gold-active: #f5da9e;
    --color-gold-highlight: #3a2f16;

    --color-success: #7cb872;
    --color-success-highlight: #1c3320;
    --color-warning: #d99a52;
    --color-warning-highlight: #3a2a16;
    --color-error: #d97a7a;
    --color-error-highlight: #3a1e1e;

    --shadow-sm: 0 1px 2px oklch(0 0 0 / 0.3);
    --shadow-md: 0 6px 16px oklch(0 0 0 / 0.35);
    --shadow-lg: 0 16px 40px oklch(0 0 0 / 0.45);
  }
}
