/* ============================================================
   Iterate design system - tokens (canonical single source)
   Dark-first aubergine. Consumed by every Iterate service.
   Light is a theme: set data-theme="light" on <html>.
   Var names match the existing restore.iterate.nz / iterate.nz
   vocabulary so consumers adopt it with no rename.
   ============================================================ */
:root{
  /* --- primitives (fixed brand values) --- */
  --paper:#F6F2EE; --ink:#241A28;
  --primary:#533362; --primary-600:#412750; --primary-300:#8a6aa0;
  --accent:#E6A15C; --accent-deep:#D98A3D;
  --dark:#221629; --dark-2:#2C1D34; --dark-3:#1A1020;
  --radius:16px; --maxw:1140px;
  --sans:"Geist",system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif;
  --mono:"Geist Mono",ui-monospace,"JetBrains Mono",monospace;

  /* --- semantic (dark by default) --- */
  --bg:var(--dark-3);
  --surface:#271831;
  --surface-2:#31203b;
  --text:var(--paper);
  --line:rgba(246,242,238,.12);
  --line-2:rgba(246,242,238,.20);
  --muted:rgba(246,242,238,.60);
  /* .55 not .42: at .42 this failed WCAG AA on every dark surface
     (3.58-3.78:1 at 11-12px, needs 4.5). .55 passes on --bg, --surface
     and --surface-2 (worst case 5.10:1). The tertiary tier is therefore
     only slightly dimmer than --muted - on a dark ground you cannot have
     a legible tier much dimmer than that. Raised 09/08/2026. */
  --muted-2:rgba(246,242,238,.55);
  --on-accent:#2a1c10;   /* text on gold */
  /* Gold used as TEXT. Distinct from --accent-deep, which is a brand fill and
     is only 2.46:1 on --paper: it fails WCAG AA wherever it sets a text colour
     on a light surface. On dark, plain --accent is 8.44:1, so it stands.
     Found 09/08/2026 by the axe-core scan on LXC 225 (iterate.nz `em`). */
  --accent-text:var(--accent);
  --danger:#ff7a5c;
  --success:#3fbe7e;
  --warn:#e0a54a;
}

/* --- light theme (marketing surfaces, e.g. iterate.nz) --- */
:root[data-theme="light"]{
  --bg:var(--paper);
  --surface:#FFFFFF;
  --surface-2:#F6F2EE;
  --text:var(--ink);
  --line:#E7DFE0;
  --line-2:#DBD1D3;
  --muted:#6E6172;
  --muted-2:#766A79;
  --danger:#D0402B;
  --success:#1e9e63;
  --warn:#c9860f;
  /* Darkened gold for text on light surfaces: 4.58:1 on --paper, 5.10:1 on
     white. Same hue as --accent-deep, dropped in value until it clears AA. */
  --accent-text:#9A6129;
}
