/* ============================================================================
   Waferira — Design Tokens
   AI Agent Operating System design system · control-room dark (default)
   Single source of truth. No scattered hex/px anywhere else.
   Brand: wafer rim #13307F/#A9C1FF, dies #1F4FD8/#4F7FF5, flagged die #62D0FF/#A8E6FF,
   wordmark ink #0E1B45/#E6ECFF, from logo/LOGO_RESEARCH.md.
   ========================================================================== */

:root {
  /* ---- Background / surfaces (navy-black; the dies pop) ---- */
  --bg-base: #080b14;
  --bg-900: var(--bg-base);
  --bg-800: var(--bg-base);
  --surface-1: #10141f;
  --surface-2: #161c2a;
  --surface-3: #1e2636;
  --canvas: #0a0e18;

  /* ---- Text (wordmark ink on dark #E6ECFF) ---- */
  --text-primary: #e6ecff;
  --text-secondary: #b4bfdb;
  --text-muted: #8491b3;
  --text-faint: #7a86a6;
  --text-on-accent: #061024;

  /* ---- Borders / grid (1px, opaque, never between sections) ---- */
  --border-subtle: #1a2030;
  --border-default: #262e42;
  --border-strong: #384259;
  --grid-line: #161c2a;
  --ring: #4f7ff5;

  /* ---- Accent: the dies, #4F7FF5 on dark from logo/LOGO_RESEARCH.md ---- */
  --accent: #4f7ff5;
  --accent-hover: #6a93f7;
  --accent-press: #3b69e0;
  --accent-soft: #16213a;

  /* ---- Brand mark fills (rim, dies, flagged die) ---- */
  --brand-rim: #a9c1ff;
  --brand-die: var(--accent);
  --brand-flag: #a8e6ff;

  /* ---- Agent status (always paired with icon + text label); waiting carries the flagged-die cyan ---- */
  --st-queued: #8491b3;
  --st-queued-soft: #1b2130;
  --st-running: #4f7ff5;
  --st-running-soft: #16213a;
  --st-waiting: #a8e6ff;
  --st-waiting-soft: #13303b;
  --st-approve: #f5b942;
  --st-approve-soft: #302713;
  --st-success: #2dd4a0;
  --st-success-soft: #102c27;
  --st-failed: #f4516c;
  --st-failed-soft: #2f171f;
  --st-blocked: #c0566b;
  --st-blocked-soft: #27181f;

  /* ---- Graph nodes / edges ---- */
  --node-bg: var(--surface-3);
  --node-border: var(--border-default);
  --node-active: var(--accent);
  --edge: #384259;
  --edge-active: var(--accent);
  --edge-wrap: #35508f;
  --run-done: #185c4a;

  /* ---- Generic semantic ---- */
  --good: var(--st-success);
  --warn: var(--st-approve);
  --bad: var(--st-failed);
  --info: var(--st-waiting);

  /* ---- Type: Exo 2 carries the headlines (squared technical caps, in the register of the Orbitron wordmark), Hind carries interface and running text, Share Tech Mono carries tool names, lot numbers and nanometres ---- */
  --font-sans: "Hind", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-display: "Exo 2", "Avenir Next", "Segoe UI", Helvetica, Arial, sans-serif;
  --font-mono: "Share Tech Mono", "SF Mono", ui-monospace, Menlo, Consolas, monospace;
  --fs-display: clamp(2.4rem, 1.6rem + 3.6vw, 4.1rem);
  --fs-h1: clamp(2.1rem, 1.6rem + 2.6vw, 3.25rem);
  --fs-h2: clamp(1.6rem, 1.25rem + 1.7vw, 2.4rem);
  --fs-h3: clamp(1.25rem, 1.1rem + 0.8vw, 1.625rem);
  --fs-h4: clamp(1.0625rem, 1rem + 0.4vw, 1.25rem);
  --fs-lead: clamp(1.0625rem, 1rem + 0.5vw, 1.3125rem);
  --fs-body: 0.9375rem;
  --fs-body-lg: 1.0625rem;
  --fs-small: 0.8125rem;
  --fs-mono: 0.8125rem;
  --fs-micro: 0.6875rem;
  --fs-metric: clamp(1.85rem, 1.4rem + 2vw, 3rem);
  --fs-price: clamp(2.25rem, 1.8rem + 2vw, 3.4rem);

  /* ---- Spacing: 4-pt base / 8-pt rhythm ---- */
  --space-0: 0;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;
  --space-20: 80px;
  --space-24: 96px;
  --space-28: 112px;
  --space-32: 128px;
  --space-40: 160px;

  /* ---- Radii (square-ish, like the dies) ---- */
  --radius-sm: 3px;
  --radius-md: 5px;
  --radius-lg: 8px;
  --radius-xl: 12px;
  --radius-pill: 999px;

  /* ---- Containers ---- */
  --container-sm: 680px;
  --container-md: 840px;
  --container-lg: 1080px;
  --container-xl: 1240px;
  --container-2xl: 1440px;
  --gutter: clamp(20px, 4vw, 40px);

  /* ---- Section rhythm ---- */
  --section-y: clamp(52px, 5.6vw, 88px);
  --section-y-lg: clamp(72px, 8vw, 132px);
  --nav-h: 64px;

  /* ---- Control-room density ---- */
  --panel-gap: clamp(12px, 1.2vw, 20px);
  --panel-pad: clamp(16px, 1.6vw, 24px);
  --log-line-y: 4px;
  --node-pad: var(--space-3) var(--space-4);
  --step-gap: var(--space-4);
  --stack: clamp(12px, 1.4vw, 20px);

  /* ---- Motion ---- */
  --dur-fast: 120ms;
  --dur-base: 220ms;
  --dur-slow: 380ms;
  --dur-run: 600ms;
  --ease-out: cubic-bezier(0.2, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --pulse: 1.6s;

  /* ---- Elevation: flat by rule. Edges are 1px opaque borders; no shadows, no colour ramps, no translucency anywhere. ---- */
  --hairline: none;
  --shadow-1: none;
  --shadow-2: none;
  --shadow-3: none;
  --scrim: #060810;

  /* ---- Grid ---- */
  --grid-cols: 12;
  --grid-gap: var(--panel-gap);

}

/* ---- Optional light theme (control-room dark remains the identity) ---- */
[data-theme="light"] {
  --bg-base: #f6f8fd;
  --bg-900: var(--bg-base);
  --bg-800: var(--bg-base);
  --surface-1: #ffffff;
  --surface-2: #eef2fa;
  --surface-3: #e2e8f5;
  --canvas: #f9fbfe;
  --text-primary: #0e1b45;
  --text-secondary: #2f3b63;
  --text-muted: #56628a;
  --text-faint: #7580a3;
  --text-on-accent: #ffffff;
  --border-subtle: #e3e8f3;
  --border-default: #d1d9ea;
  --border-strong: #b9c4dd;
  --grid-line: #e7ecf6;
  --accent: #1f4fd8;
  --accent-hover: #1a44bd;
  --accent-press: #163a9f;
  --accent-soft: #dfe7fb;
  --ring: #1f4fd8;
  --brand-rim: #13307f;
  --brand-flag: #62d0ff;
  --st-queued: #56628a;
  --st-running: #1f4fd8;
  --st-waiting: #0284c7;
  --st-approve: #a16207;
  --st-success: #0f766e;
  --st-failed: #be123c;
  --st-blocked: #9f1239;
  --st-queued-soft: #e0e5f0;
  --st-running-soft: #dfe7fb;
  --st-waiting-soft: #d0e8f6;
  --st-approve-soft: #efe4c9;
  --st-success-soft: #d2e4e5;
  --st-failed-soft: #eed4dd;
  --st-blocked-soft: #e9d4dd;
  --edge: #b9c4dd;
  --edge-wrap: #8aa6ee;
  --run-done: #9ac5c3;
  --scrim: #f6f8fd;
}
