/* ============================================================
   Design tokens + accessibility baseline — whatsup.ai

   Loaded FIRST by every page, before base.css / nav.css / the page
   stylesheet (tools/sync-nav.mjs --check verifies the <link>).
   This is the single source for the shared palette, type and shape.
   Page stylesheets keep a :root block only for variables that are
   theirs alone (e.g. the layoffs reason colours).
   ============================================================ */

:root {
  /* --- Brand --- */
  --accent: #1A6FE0;         /* fills, borders, focus rings */
  --accent-text: #1560C8;    /* accent as text on --bg / --card (5.6:1) */
  --accent-2: #7B4BB3;
  --blue: #1A6FE0;
  --purple: #7B4BB3;

  /* --- Semantic --- (green and red pass 4.5:1 as text on --bg and --card) */
  --green: #177A46;
  --red: #C23A24;
  --gold: #B8930A;           /* fills only: too light to read as text */
  --gold-text: #7A6200;
  --amber-text: #9A5B00;

  /* --- Neutrals --- */
  --ink: #0F1B2D;
  --dim: #3D5068;
  --muted: #5A6B80;          /* was #7B8FA6 (3.1:1); now 5.2:1 on --bg */
  --border: #D4E1F0;
  --border-strong: #C3D3E6;  /* form controls */
  --hairline: #E4ECF6;       /* dividers inside a card */
  --surface: #EFF5FB;
  --card: #FFFFFF;
  --bg: #F6F9FE;
  --ring-bg: #DAE5F2;

  /* --- Type --- */
  --sans: 'DM Sans', system-ui, sans-serif;
  --display: 'Instrument Serif', Georgia, serif;
  /* Legacy families: pages rebuilt on the two-font system (home, city pages)
     no longer load these. Use them only on pages whose font <link> still does. */
  --mono: 'JetBrains Mono', monospace;
  --body: 'Source Serif 4', Georgia, serif;

  --text-xs: 13px;           /* smallest text on rebuilt pages (other pages: 12px floor) */
  --text-sm: 14px;
  --text-md: 16px;
  --text-lg: 18px;

  /* --- Shape --- */
  --radius: 14px;
  --radius-lg: 16px;         /* cards on rebuilt pages */
  --radius-sm: 10px;         /* controls */
  --tap: 44px;               /* minimum touch target */
}

/* --- Keyboard focus: always visible --- */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
/* Sliders reset `outline` in page CSS; restore it for keyboard users. */
input[type="range"]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

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