/* ============================================================================
   Pildeon — Design Tokens
   AI Agent Operating System design system · control-room dark (default)
   Single source of truth. No scattered hex/px anywhere else.
   Brand palette from logo/LOGO_RESEARCH.md: deep ink #1A2238, punch steel
   #DCE3EE, coated-tablet coral #FF6A45. The accent is the coral.
   ========================================================================== */

:root {
  /* ---- Background / surfaces (ink-leaning neutrals; the coral pops) ---- */
  --bg-base:   #0b0e16;   /* the one canvas, under every section */
  --bg-900:    var(--bg-base);
  --bg-800:    var(--bg-base);
  --surface-1: #141a28;
  --surface-2: #1a2238;   /* the logo tile colour */
  --surface-3: #232d46;
  --canvas:    #0d1119;

  /* ---- Text ---- */
  --text-primary:   #eef1f7;   /* ink (wordmark, dark) from the logo */
  --text-secondary: #b1bace;
  --text-muted:     #8691a8;
  --text-faint:     #717c93;
  --text-on-accent: #1a1208;

  /* ---- Borders / grid (panel + node/edge — NEVER between sections) ---- */
  --border-subtle:  #1b2234;
  --border-default: #273047;
  --border-strong:  #384361;
  --grid-line:      #171e2f;
  --ring:           #ff6a45;

  /* ---- Accent (the ACTIVE PATH / primary action): coated-tablet coral ---- */
  --accent:       #ff6a45;
  --accent-hover: #ff8363;
  --accent-press: #e85a37;
  --accent-soft:  #3a2422;   /* opaque tint of the coral on the canvas */

  /* ---- AGENT STATUS (always paired with icon + text label) ---- */
  --st-queued:  #8691a8;  --st-queued-soft:  #1d2434;
  --st-running: #5b9dff;  --st-running-soft: #172540;
  --st-waiting: #38bdf8;  --st-waiting-soft: #112a3d;
  --st-approve: #f5a524;  --st-approve-soft: #30261a;
  --st-success: #2dd4a0;  --st-success-soft: #112e2c;
  --st-failed:  #f4516c;  --st-failed-soft:  #2f1824;
  --st-blocked: #c0566b;  --st-blocked-soft: #271923;

  /* ---- Graph nodes / edges ---- */
  --node-bg:     var(--surface-3);
  --node-border: var(--border-default);
  --node-active: var(--accent);
  --edge:        #384361;
  --edge-active: var(--accent);
  --edge-wrap:   #9a4a37;   /* the coral stepped down toward the canvas */
  --run-done:    #1b5c4e;   /* success stepped down toward the canvas */

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

  /* ---- Type ---- */
  /* Instrument Sans carries the headlines and the wordmark (LOGO_RESEARCH.md:
     crisp, neutral, slightly condensed, right for a GMP buyer). Atkinson
     Hyperlegible carries running and interface text, chosen for legibility
     at control-room distance. B612 Mono carries batch numbers, forces,
     spectra and audit timestamps. */
  --font-sans: "Atkinson Hyperlegible", -apple-system, BlinkMacSystemFont, "Segoe UI",
               Roboto, Helvetica, Arial, sans-serif;
  --font-display: "Instrument Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-mono: "B612 Mono", "SF Mono", ui-monospace, Menlo, Consolas, monospace;

  --fs-display: clamp(2.25rem, 1.5rem + 3.4vw, 3.75rem);
  --fs-h1:      clamp(2rem, 1.5rem + 2.4vw, 3rem);
  --fs-h2:      clamp(1.5rem, 1.2rem + 1.6vw, 2.25rem);
  --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.75rem, 1.35rem + 1.9vw, 2.75rem);
  --fs-price:   clamp(2.25rem, 1.8rem + 2vw, 3.25rem);

  /* ---- 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 ---- */
  --radius-sm: 6px; --radius-md: 8px; --radius-lg: 12px; --radius-xl: 16px;
  --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 opaque 1px borders; no shadows,
     colour blends or translucency anywhere. ---- */
  --hairline: none;
  --shadow-1: none;
  --shadow-2: none;
  --shadow-3: none;
  --scrim:    #070a10;

  --grid-cols: 12;
  --grid-gap: var(--panel-gap);
}

/* ---- Optional light theme (control-room dark remains the identity) ---- */
[data-theme="light"] {
  --bg-base: #f7f8fb;  --bg-900: var(--bg-base);  --bg-800: var(--bg-base);
  --surface-1: #ffffff; --surface-2: #f1f3f8; --surface-3: #e6e9f1;
  --canvas: #f9fafc;
  --text-primary: #1a2238; --text-secondary: #3b4458; --text-muted: #5e687c;
  --text-faint: #7b8497; --text-on-accent: #ffffff;
  --border-subtle: #e4e7ee;
  --border-default: #d3d7e1;
  --border-strong: #bfc5d2;
  --grid-line: #e8ebf1;
  --accent: #d94a26; --accent-hover: #c2401f; --accent-press: #a8361a;
  --accent-soft: #fbe4dc;
  --ring: #d94a26;
  --st-queued: #5e687c; --st-running: #2563eb; --st-waiting: #0284c7;
  --st-approve: #b45309; --st-success: #0f766e; --st-failed: #be123c;
  --st-blocked: #9f1239;
  --st-queued-soft: #dfe2e9;  --st-running-soft: #d6e2fa; --st-waiting-soft: #d1e7f5;
  --st-approve-soft: #eddfd4; --st-success-soft: #d3e5e4; --st-failed-soft: #efd5dc;
  --st-blocked-soft: #ead5dc;
  --edge: #bfc5d2;
  --edge-wrap: #e59a85;
  --run-done: #9bc6c2;
  --scrim: #f7f8fb;
}
