/* =================================================================
   BASE.CSS — Design tokens & reset
   ================================================================= */

:root {
  /* TYPE SCALE — fluid */
  --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.4rem + 2.5vw, 3.5rem);
  --text-3xl: clamp(2.5rem, 1.4rem + 4vw, 5rem);
  --text-hero: clamp(3rem, 1rem + 7vw, 8rem);

  /* 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;

  /* RADIUS */
  --radius-sm: 0.25rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;

  /* TRANSITION */
  --transition-interactive: 220ms cubic-bezier(0.16, 1, 0.3, 1);
  --transition-slow: 480ms cubic-bezier(0.16, 1, 0.3, 1);

  /* CONTENT WIDTHS */
  --content-narrow: 640px;
  --content-default: 1100px;
  --content-wide: 1320px;

  /* FONTS */
  --font-display: 'Cormorant Garamond', 'Times New Roman', Georgia, serif;
  --font-body: 'Switzer', 'Inter', -apple-system, sans-serif;

  /* SHADOWS */
  --shadow-sm: 0 1px 2px oklch(0.2 0.02 240 / 0.05);
  --shadow-md: 0 6px 20px oklch(0.2 0.02 240 / 0.08);
  --shadow-lg: 0 18px 50px oklch(0.15 0.04 240 / 0.18);
}

/* =================================================================
   LIGHT MODE — Statesman / editorial palette
   Inspired by the Prevail navy with editorial cream surface
   ================================================================= */
:root,
[data-theme='light'] {
  --color-bg: #f7f5f1;
  --color-surface: #ffffff;
  --color-surface-2: #f1ede5;
  --color-surface-offset: #e9e4d9;
  --color-divider: #d4cec0;
  --color-border: #c4bca8;

  --color-text: #1a1f2e;
  --color-text-muted: #5a6175;
  --color-text-faint: #8a8e9a;
  --color-text-inverse: #f7f5f1;

  --color-primary: #1b2d50;        /* Deep statesman navy (Prevail thread) */
  --color-primary-hover: #243962;
  --color-primary-soft: #e4e6ed;

  --color-accent: #b08948;         /* Warm brass — legacy/heritage signal */
  --color-accent-hover: #c4994f;
  --color-accent-soft: #f0e4cf;

  --color-ink-deep: #0d1320;       /* For hero hero overlays */
}

/* =================================================================
   DARK MODE
   ================================================================= */
[data-theme='dark'] {
  --color-bg: #0d1320;
  --color-surface: #131a2a;
  --color-surface-2: #1a2236;
  --color-surface-offset: #1f2841;
  --color-divider: #2a3553;
  --color-border: #3a466b;

  --color-text: #e8e4d8;
  --color-text-muted: #9aa3b7;
  --color-text-faint: #5a6175;
  --color-text-inverse: #0d1320;

  --color-primary: #6b8ec7;
  --color-primary-hover: #88a3d4;
  --color-primary-soft: #1f2841;

  --color-accent: #d4a85f;
  --color-accent-hover: #e2bb74;
  --color-accent-soft: #2a2218;

  --color-ink-deep: #050810;

  --shadow-sm: 0 1px 2px oklch(0 0 0 / 0.4);
  --shadow-md: 0 6px 20px oklch(0 0 0 / 0.5);
  --shadow-lg: 0 18px 50px oklch(0 0 0 / 0.7);
}

/* =================================================================
   RESET & BASE
   ================================================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
  scroll-padding-top: var(--space-20);
}

body {
  min-height: 100dvh;
  line-height: 1.6;
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--color-text);
  background-color: var(--color-bg);
  transition: background-color var(--transition-slow), color var(--transition-slow);
}

img, picture, video, canvas, svg {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition-interactive), background var(--transition-interactive), border-color var(--transition-interactive);
}

h1, h2, h3, h4, h5, h6 {
  text-wrap: balance;
  line-height: 1.1;
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: -0.01em;
}

p, li, figcaption { text-wrap: pretty; }

::selection {
  background: var(--color-accent);
  color: var(--color-ink-deep);
}

:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

button {
  cursor: pointer;
  background: none;
  border: none;
  font: inherit;
  color: inherit;
}

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

/* =================================================================
   CONTAINER
   ================================================================= */
.container {
  width: 100%;
  max-width: var(--content-wide);
  margin-inline: auto;
  padding-inline: clamp(var(--space-5), 4vw, var(--space-12));
}
