:root {
  /* Colors — neutral platform palette.
     brand.js overrides the four --brand-* roots from the organization's card
     (CATALOG.org.colors: primary, accent, surface, cta) and derives the
     light/dark steps. Defaults are deliberately neutral. */
  --brand-primary: #2E3A4B;
  --brand-primary-light: #45566C;
  --brand-primary-dark: #1C2633;
  /* Text and icons on the primary colour (chat header, filled chat buttons). brand.js recomputes
     it for each organization (white or near-black, whichever contrasts more). */
  --brand-on-primary: #FFFFFF;
  --brand-accent: #2F7F7A;
  --brand-accent-light: #4FA39D;
  --brand-accent-dark: #1F5E5A;
  --brand-surface: #F3F1EC;
  --brand-surface-dark: #E4E0D6;
  --brand-cta: #C2612C;
  --brand-cta-light: #D9804F;
  --brand-cta-dark: #9A4B20;
  /* Text on the call-to-action colour. brand.js recomputes it for each organization's
     colour (white or near-black, whichever contrasts more). */
  --brand-on-cta: #FFFFFF;

  /* Legacy names, kept as aliases so files not yet migrated keep working.
     New code uses the --brand-* names. */
  --navy: var(--brand-primary);
  --navy-light: var(--brand-primary-light);
  --navy-dark: var(--brand-primary-dark);
  --teal: var(--brand-accent);
  --teal-light: var(--brand-accent-light);
  --teal-dark: var(--brand-accent-dark);
  --sand: var(--brand-surface);
  --sand-dark: var(--brand-surface-dark);
  --gold: var(--brand-cta);
  --gold-light: var(--brand-cta-light);
  --gold-dark: var(--brand-cta-dark);
  --white: #FFFFFF;
  --gray-50: #F9FAFB;
  --gray-100: #F3F4F6;
  --gray-200: #E5E7EB;
  --gray-300: #D1D5DB;
  --gray-400: #9CA3AF;
  --gray-500: #6B7280;
  --gray-600: #4B5563;
  --gray-700: #374151;
  --gray-800: #1F2937;
  --gray-900: #111827;
  --success: #059669;
  --warning: #D97706;
  --error: #DC2626;

  /* Typography */
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-size-xs: 0.75rem;
  --font-size-sm: 0.875rem;
  --font-size-base: 1rem;
  --font-size-lg: 1.125rem;
  --font-size-xl: 1.25rem;
  --font-size-2xl: 1.5rem;
  --font-size-3xl: 1.875rem;
  --font-size-4xl: 2.25rem;
  --font-size-5xl: 3rem;
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;
  --line-height-tight: 1.25;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.75;

  /* 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;

  /* Border Radius */
  --radius-sm: 0.25rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-2xl: 1.5rem;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-normal: 300ms ease;
  --transition-slow: 500ms ease;

  /* Container */
  --container-max: 1200px;
  --container-narrow: 800px;

  /* ── Flavor tokens (docs/design/flavors.md) ──────────────────────────────
     Layer 1 of the sitecraft Flavor System: these :root values ARE the Base
     flavor «modern», the original look; each one reproduces what the rules used
     before flavors existed. The Thematic flavor «elegant» overrides them below in
     one block, :root[data-flavor="elegant"]. The build sets data-flavor on <html>
     from the organization card's `flavor`; the panel never carries the attribute. */

  /* Warm neutral scale: a palette, used by «elegant»; modern keeps the cool grays above.
     Contrast on white / on #F3F1EC: 500 = 5.6 / 4.9, 600 = 7.1 / 6.3, 900 = 16.4 / 14.5.
     400 is for disabled text and lines only (3.1). */
  --neutral-0: #FFFFFF;
  --neutral-25: #FFFEFC;
  --neutral-50: #F9F7F3;
  --neutral-100: #F2EEE8;
  --neutral-200: #E7E2D9;
  --neutral-300: #D6CFC4;
  --neutral-400: #A39B90;
  --neutral-500: #6E675D;
  --neutral-600: #5E574E;
  --neutral-700: #4A443C;
  --neutral-800: #36312B;
  --neutral-900: #221F1B;

  /* Colour roles */
  --color-paper: var(--white);
  --color-ink: var(--gray-800);
  --color-ink-soft: var(--gray-700);
  --color-ink-muted: var(--gray-500);
  --color-line: var(--gray-200);
  --color-line-strong: var(--gray-300);

  /* Type */
  --font-display: var(--font-family);
  --font-weight-display: var(--font-weight-bold);
  --text-h1: var(--font-size-4xl);
  --text-h2: var(--font-size-3xl);
  --text-h3: var(--font-size-2xl);
  --text-small: var(--font-size-sm);
  --text-eyebrow: var(--font-size-sm);
  --leading-display: var(--line-height-tight);
  --leading-heading: var(--line-height-tight);
  --leading-body: var(--line-height-relaxed);
  --tracking-display: normal;
  --tracking-eyebrow: normal;
  --tracking-label: normal;
  --measure: none;

  /* Lucide icons: read by the ICON helper (js/icons.js) and the public stroke rule (pages.css). */
  --icon-stroke: 2;
  --icon-stroke-sm: 2;

  /* Spacing rhythm: page sections, blocks inside a section, card padding. */
  --space-section: var(--space-16);
  --space-block: var(--space-10);
  --space-stack: var(--space-4);
  --space-card: var(--space-6);
}

/* ── Flavor «elegant» (Thematic; Layer 3) ─────────────────────────────────
   Newsreader display headings, spaced-capital labels, a fluid type scale, a
   wider rhythm, warm neutrals under the broker's colours, Lucide at stroke 1.5.
   Light only: the public sites have no dark theme yet (docs/design/flavors.md). */
:root[data-flavor="elegant"] {
  --gray-50: var(--neutral-50);
  --gray-100: var(--neutral-100);
  --gray-200: var(--neutral-200);
  --gray-300: var(--neutral-300);
  --gray-400: var(--neutral-400);
  --gray-500: var(--neutral-500);
  --gray-600: var(--neutral-600);
  --gray-700: var(--neutral-700);
  --gray-800: var(--neutral-800);
  --gray-900: var(--neutral-900);

  --color-paper: var(--neutral-25);
  --color-ink: var(--neutral-900);
  --color-ink-soft: var(--neutral-700);
  --color-ink-muted: var(--neutral-500);
  --color-line: var(--neutral-200);
  --color-line-strong: var(--neutral-300);

  --font-display: 'Newsreader', 'Iowan Old Style', Georgia, 'Times New Roman', serif;
  --font-weight-display: 500;
  --text-h1: clamp(2rem, 1.55rem + 1.8vw, 2.875rem);
  --text-h2: clamp(1.5rem, 1.3rem + 0.9vw, 2rem);
  --text-h3: clamp(1.1875rem, 1.1rem + 0.35vw, 1.375rem);
  --text-small: 0.875rem;
  --text-eyebrow: 0.75rem;
  --leading-display: 1.12;
  --leading-heading: 1.25;
  --leading-body: 1.65;
  --tracking-display: -0.01em;
  --tracking-eyebrow: 0.14em;
  --tracking-label: 0.04em;
  --measure: 68ch;

  --icon-stroke: 1.5;
  --icon-stroke-sm: 1.75;

  --space-section: clamp(3rem, 2rem + 4vw, 6rem);
  --space-block: clamp(2.25rem, 1.75rem + 2vw, 3.5rem);
  --space-card: clamp(1.25rem, 1rem + 1vw, 2rem);
}
