/* Voult design tokens. Source of truth: voult-landing/public/css/tokens.css.
   Edit only there, then run scripts/sync-tokens.mjs in voult and voult-playground.
   Light is the base (warm paper); dark overrides (deep neutral). Components only reference tokens.
   Rules and meanings: voult/docs/design/DESIGN_SYSTEM.md */
:root {
  color-scheme: light;
  --bg: #f6f5f1;
  --bg-alt: #efede7;
  --surface: #fffefb;
  --surface-2: #f8f7f3;
  --surface-3: #eceae3;
  --border: #e2dfd6;
  --border-strong: #cdc9bd;
  --text: #17160f;
  --text-2: #48463f;
  --text-3: #67645b;

  --accent: #a3530a;
  --accent-bg: #f8ead6;
  --accent-border: #e8c79a;
  --ok: #17704a;
  --ok-bg: #e3f1e8;
  --warn: #85560a;
  --warn-bg: #f7eed8;
  --bad: #b42318;
  --bad-bg: #fbe9e7;

  --primary: #17160f;
  --primary-fg: #f6f5f1;
  --primary-hover: #34322a;

  --code-bg: #faf9f5;
  --tk-k: #9a3412;
  --tk-s: #17704a;
  --tk-f: #1d4ed8;
  --tk-n: #7c3aed;
  --tk-c: #67645b;

  --shadow-sm: 0 1px 2px rgba(23, 22, 15, 0.05);
  --shadow-lg: 0 1px 2px rgba(23, 22, 15, 0.04), 0 24px 48px -24px rgba(23, 22, 15, 0.22);

  --font-sans: 'Instrument Sans', 'Instrument Sans Fallback', ui-sans-serif, system-ui, sans-serif;
  --font-mono: 'IBM Plex Mono', 'IBM Plex Mono Fallback', ui-monospace, Menlo, monospace;

  /* Type scale. Three weights only: 400 body, 500 UI, 600 headings. */
  --t-display: clamp(2.5rem, 1.55rem + 3.4vw, 4.25rem);
  --t-h1: clamp(2.125rem, 1.6rem + 2vw, 3rem);
  --t-h2: clamp(1.625rem, 1.3rem + 1.15vw, 2.25rem);
  --t-h3: 1.1875rem;
  --t-lede: clamp(1.0625rem, 1rem + 0.35vw, 1.1875rem);
  --t-body: 1rem;
  --t-ui: 0.9375rem;
  --t-small: 0.875rem;
  --t-xs: 0.8125rem;
  --t-micro: 0.75rem;
  --t-code: 0.84375rem;
  --t-code-sm: 0.78125rem;
  --w-regular: 400;
  --w-medium: 500;
  --w-semibold: 600;
  --measure: 36em;
  --radius-sm: 4px;
  --radius: 6px;
  --radius-lg: 10px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --nav-h: 60px;
  --gutter: 24px;

  /* ---- Added in Phase 4 (names for values the dashboard needs; nothing above changed) ---- */
  --border-width: 1px;
  --border-control: #8f8c82; /* form field outlines: 3:1 on every surface (WCAG 1.4.11); --border/--border-strong are for dividers */
  --focus: var(--accent);
  --focus-width: 2px;
  --focus-offset: 2px;
  --overlay: rgba(23, 22, 15, 0.42);

  /* Severity, mapped from AuditLog.riskLevel. Low/medium/high reuse the status colours. */
  --sev-low: var(--text-3);
  --sev-low-bg: var(--surface-3);
  --sev-medium: var(--warn);
  --sev-medium-bg: var(--warn-bg);
  --sev-high: var(--bad);
  --sev-high-bg: var(--bad-bg);
  --sev-critical: #8a1c12;
  --sev-critical-bg: #f9dcd8;

  /* Spacing (4px base) */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;

  /* Density: the dashboard is compact by default */
  --row-compact: 36px;
  --row: 44px;
  --control-sm: 30px;
  --control: 36px;

  /* Layout */
  --page-narrow: 720px;
  --page: 1120px;
  --sidebar: 240px;

  /* Motion */
  --dur-fast: 120ms;
  --dur: 180ms;
}

[data-theme='dark'] {
  color-scheme: dark;
  --bg: #0e0f11;
  --bg-alt: #121316;
  --surface: #16171a;
  --surface-2: #1b1c20;
  --surface-3: #24252a;
  --border: #2a2b30;
  --border-strong: #3b3d43;
  --text: #ecebe8;
  --text-2: #b4b2ac;
  --text-3: #8f8d87;

  --accent: #eda84a;
  --accent-bg: rgba(237, 168, 74, 0.1);
  --accent-border: rgba(237, 168, 74, 0.32);
  --ok: #5fd08f;
  --ok-bg: rgba(95, 208, 143, 0.1);
  --warn: #e8c35a;
  --warn-bg: rgba(232, 195, 90, 0.1);
  --bad: #f2837a;
  --bad-bg: rgba(242, 131, 122, 0.12);

  --primary: #ecebe8;
  --primary-fg: #0e0f11;
  --primary-hover: #ffffff;

  --code-bg: #111215;
  --tk-k: #eda84a;
  --tk-s: #8fd9ac;
  --tk-f: #9cc3ff;
  --tk-n: #c9b8ff;
  --tk-c: #858379;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 0 0 1px rgba(255, 255, 255, 0.02), 0 32px 64px -24px rgba(0, 0, 0, 0.75);

  --overlay: rgba(0, 0, 0, 0.6);
  --border-control: #67696c;
  --sev-critical: #ff7b6e;
  --sev-critical-bg: rgba(255, 123, 110, 0.18);
}
