/* tokens.css — DESIGN-SYSTEM-V2 tokens (see /DESIGN-SYSTEM-V2.md, verified 2026-10-11).
   New names are canonical; legacy aliases at the bottom keep the pre-overhaul views
   coherent inside the /vote/design/ preview. */

@font-face {
  font-family: 'Inter';
  src: url('assets/Inter-var.woff2') format('woff2-variations');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Surfaces (dark, default) */
  --bg: #04080d;
  --surface: #0a1620;
  --raised: #12293a;
  --overlay: #0b1e2b;
  --scrim: #04080d99;

  /* Text */
  --text: #e2e8f0;
  --text-2: #9ca3af;
  --text-3: #8592a6;

  /* Lines */
  --hairline: #1e3a4f;
  --border-ui: #5a7a92;

  /* Brand + status */
  --accent: #22d3ee;
  --accent-ink: #04141a;
  --ok: #34d399;
  --warn: #fbbf24;
  --err: #f87171;

  /* Mood ramp — 8 families (DESIGN-SYSTEM-V2 §1) */
  --mood-1: #94a3b8; /* Slate   dark bleak brooding somber noir */
  --mood-2: #fb7185; /* Crimson anguished aggressive visceral raw romantic */
  --mood-3: #fb7350; /* Rust    tense gritty suspenseful chaotic (redder than Amber, 2026-10-11) */
  --mood-4: #fbbf24; /* Amber   euphoric playful triumphant passionate */
  --mood-5: #f9a8d4; /* Rose    tender */
  --mood-6: #34d399; /* Emerald hopeful uplifting peaceful serene cozy */
  --mood-7: #c4b5fd; /* Violet  dreamy mysterious reverent cosmic whimsical */
  --mood-8: #67e8f9; /* Cyan    melancholic bittersweet nostalgic intimate epic */

  /* Space (4px grid) */
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px;
  --s-5: 24px; --s-6: 32px; --s-7: 48px;

  /* Radius */
  --r-sm: 6px; --r-md: 10px; --r-lg: 16px;

  /* Elevation ladder (dark): bg #04080d < surface #0a1620 < overlay #0b1e2b
     < raised #12293a. Depth reads as LIGHTNESS, not shadow; --overlay sits above
     the scrim, so it only needs to out-light --surface. */
  /* Elevation */
  --e1: 0 1px 2px #00000066;
  --e2: 0 16px 40px #00000080;

  /* Motion (MODERN-DESIGN-2026.md §4): spatial springs may overshoot, effects
     springs may not; entrances decelerate, exits accelerate and stay uniform.
     Springs are baked linear() strings so they run off the main thread.
     Curves generated by design-qa/gen-tokens.py — do not hand-edit. */
  --dur-fast: 120ms; --dur-base: 200ms; --dur-slow: 280ms;
  --ease-out: cubic-bezier(0.2, 0, 0, 1);
  --ease-in: cubic-bezier(0.4, 0, 1, 1);
  --spring-spatial: linear(0, 0.241, 0.477, 0.683, 0.848, 0.968, 1.047, 1.092, 1.11, 1.109, 1.096, 1.078, 1.057, 1.038, 1.022, 1.009, 1, 0.995, 0.992, 0.991, 0.991, 0.992, 0.994, 0.996, 1);
  --spring-effects: linear(0, 0.312, 0.527, 0.675, 0.776, 0.846, 0.894, 0.927, 0.95, 0.966, 0.976, 0.984, 0.989, 0.992, 0.995, 0.996, 0.997, 0.998, 0.999, 0.999, 0.999, 1, 1, 1, 1);
  --motion-in: 420ms var(--spring-spatial);   /* panel/sheet entrances */
  --motion-out: 160ms var(--ease-in);         /* exits: uniform, never bouncy */
  --stagger: 50ms;                            /* list/rail entrance step */

  /* Pattern fills (VOCAB-UPGRADES.md asset #9): a per-family background motif so the
     8 families stay decodable with hue removed (shape-first, colour-second). Angles
     0/45/90/135 x fine/coarse = 8 distinct textures; colour rides --mood.
     Opacities bumped to 24-34% after first QA: at 14% the texture rendered but was
     invisible at chip size (Director round, 2026-10-11). */
  --pat-1: repeating-linear-gradient(45deg, color-mix(in srgb, var(--mood) 24%, transparent) 0 1.5px, transparent 1.5px 5.5px);
  --pat-2: repeating-linear-gradient(45deg, color-mix(in srgb, var(--mood) 30%, transparent) 0 2.5px, transparent 2.5px 10px);
  --pat-3: repeating-linear-gradient(135deg, color-mix(in srgb, var(--mood) 24%, transparent) 0 1.5px, transparent 1.5px 5.5px);
  --pat-4: radial-gradient(color-mix(in srgb, var(--mood) 34%, transparent) 1.2px, transparent 1.7px);
  --pat-5: repeating-linear-gradient(90deg, color-mix(in srgb, var(--mood) 28%, transparent) 0 1.5px, transparent 1.5px 5px);
  --pat-6: repeating-linear-gradient(0deg, color-mix(in srgb, var(--mood) 24%, transparent) 0 1.5px, transparent 1.5px 5.5px);
  --pat-7: repeating-linear-gradient(135deg, color-mix(in srgb, var(--mood) 32%, transparent) 0 2.5px, transparent 2.5px 11px);
  --pat-8: radial-gradient(color-mix(in srgb, var(--mood) 32%, transparent) 1.8px, transparent 2.2px);

  /* ---- legacy aliases (pre-overhaul views) ---- */
  --elevated: var(--raised);
  --border: var(--border-ui);
  --muted: var(--text-2);
  --cyan: var(--accent);
  --accent-solid: var(--accent);
  --green: var(--ok);
  --red: var(--err);
  --orange: var(--warn);
  --gold: #fbbf24;
  --radius: var(--r-lg);
}

html.light,
[data-theme='light'] {
  --bg: #f0f4f8;
  --surface: #f8fafc;
  --raised: #e2e8f0;
  --overlay: #ffffff;
  --scrim: #0f172a80;

  --text: #0f172a;
  --text-2: #475569;
  --text-3: #4b5563;   /* darkened one step 2026-10-11: the old #5b6778 sat at 4.85:1 on --bg */

  --hairline: #cbd5e1;
  --border-ui: #66748a;

  --accent: #0a7a96;
  --accent-ink: #ffffff;
  --ok: #036b4f;
  --warn: #92400e;
  --err: #b91c1c;

  --mood-1: #475569; --mood-2: #be123c; --mood-3: #b03a0a; --mood-4: #92400e;
  --mood-5: #be185d; --mood-6: #036b4f; --mood-7: #6d28d9; --mood-8: #0b6478;

  --e1: 0 1px 2px #0f172a1f;
  --e2: 0 16px 40px #0f172a2e;
}

/* OKLCH perceptual upgrade (2026-10-11, MODERN-DESIGN-2026.md §4): the hex values
   above remain the sRGB fallback. These are the designed values — perceptual L,
   so a dark/light variant is one lightness step, not a re-guess. The mood ramp
   is the part that matters (it is generated); light-theme status stays hex.
   Generated by design-qa/gen-tokens.py — do not hand-edit. */
@supports (color: oklch(0 0 0)) {
  :root {
    --mood-1: oklch(71.1% 0.035 256.8);
    --mood-2: oklch(71.9% 0.169 13.4);
    --mood-3: oklch(71.2% 0.174 35.5);
    --mood-4: oklch(83.7% 0.164 84.4);
    --mood-5: oklch(82.3% 0.110 346.0);
    --mood-6: oklch(77.3% 0.153 163.2);
    --mood-7: oklch(81.1% 0.101 293.6);
    --mood-8: oklch(86.5% 0.115 207.1);
    --accent: oklch(79.7% 0.134 211.5);
    --ok: oklch(77.3% 0.153 163.2);
    --warn: oklch(83.7% 0.164 84.4);
    --err: oklch(71.1% 0.166 22.2);
  }
  html.light,
  [data-theme='light'] {
    --mood-1: oklch(44.6% 0.037 257.3);
    --mood-2: oklch(51.4% 0.198 16.9);
    --mood-3: oklch(51.5% 0.162 38.3);
    --mood-4: oklch(47.3% 0.125 46.2);
    --mood-5: oklch(52.5% 0.199 4.0);
    --mood-6: oklch(46.9% 0.095 167.0);
    --mood-7: oklch(49.1% 0.241 292.6);
    --mood-8: oklch(46.6% 0.081 218.6);
  }
}

/* Mood classes: one line per mood, straight from vocab.MOODS (34) */
.m-dark { --mood: var(--mood-1); --mood-pattern: var(--pat-1); }
.m-bleak { --mood: var(--mood-1); --mood-pattern: var(--pat-1); }
.m-brooding { --mood: var(--mood-1); --mood-pattern: var(--pat-1); }
.m-somber { --mood: var(--mood-1); --mood-pattern: var(--pat-1); }
.m-noir { --mood: var(--mood-1); --mood-pattern: var(--pat-1); }
.m-anguished { --mood: var(--mood-2); --mood-pattern: var(--pat-2); }
.m-aggressive { --mood: var(--mood-2); --mood-pattern: var(--pat-2); }
.m-visceral { --mood: var(--mood-2); --mood-pattern: var(--pat-2); }
.m-raw { --mood: var(--mood-2); --mood-pattern: var(--pat-2); }
.m-romantic { --mood: var(--mood-2); --mood-pattern: var(--pat-2); }
.m-tense { --mood: var(--mood-3); --mood-pattern: var(--pat-3); }
.m-gritty { --mood: var(--mood-3); --mood-pattern: var(--pat-3); }
.m-suspenseful { --mood: var(--mood-3); --mood-pattern: var(--pat-3); }
.m-chaotic { --mood: var(--mood-3); --mood-pattern: var(--pat-3); }
.m-euphoric { --mood: var(--mood-4); --mood-pattern: var(--pat-4); }
.m-playful { --mood: var(--mood-4); --mood-pattern: var(--pat-4); }
.m-triumphant { --mood: var(--mood-4); --mood-pattern: var(--pat-4); }
.m-passionate { --mood: var(--mood-4); --mood-pattern: var(--pat-4); }
.m-tender { --mood: var(--mood-5); --mood-pattern: var(--pat-5); }
.m-hopeful { --mood: var(--mood-6); --mood-pattern: var(--pat-6); }
.m-uplifting { --mood: var(--mood-6); --mood-pattern: var(--pat-6); }
.m-peaceful { --mood: var(--mood-6); --mood-pattern: var(--pat-6); }
.m-serene { --mood: var(--mood-6); --mood-pattern: var(--pat-6); }
.m-cozy { --mood: var(--mood-6); --mood-pattern: var(--pat-6); }
.m-dreamy { --mood: var(--mood-7); --mood-pattern: var(--pat-7); }
.m-mysterious { --mood: var(--mood-7); --mood-pattern: var(--pat-7); }
.m-reverent { --mood: var(--mood-7); --mood-pattern: var(--pat-7); }
.m-cosmic { --mood: var(--mood-7); --mood-pattern: var(--pat-7); }
.m-whimsical { --mood: var(--mood-7); --mood-pattern: var(--pat-7); }
.m-melancholic { --mood: var(--mood-8); --mood-pattern: var(--pat-8); }
.m-bittersweet { --mood: var(--mood-8); --mood-pattern: var(--pat-8); }
.m-nostalgic { --mood: var(--mood-8); --mood-pattern: var(--pat-8); }
.m-intimate { --mood: var(--mood-8); --mood-pattern: var(--pat-8); }
.m-epic { --mood: var(--mood-8); --mood-pattern: var(--pat-8); }

/* ---- base ---- */
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.5 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.num { font-variant-numeric: tabular-nums; }

/* icon helper: <svg class="i"><use href="/static/icons.svg#i-home"/></svg> */
.i {
  width: 20px; height: 20px; flex: none;
  stroke: currentColor; fill: none;
  stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round;
  display: inline-block; vertical-align: -4px;
}
.i-16 { width: 16px; height: 16px; }
.i-24 { width: 24px; height: 24px; }
.i-32 { width: 32px; height: 32px; }

@media (prefers-reduced-motion: reduce) {
  :root {
    /* per-token reduce (MODERN-DESIGN-2026.md): springs become plain ease */
    --spring-spatial: ease;
    --spring-effects: ease;
    --motion-in: 1ms ease;
    --motion-out: 1ms ease;
  }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 80ms !important;
    scroll-behavior: auto !important;
  }
}
