/* ============================================================================
   Pulpum — Design Tokens
   AI Agent Operating System design system · control-room dark (default)
   Single source of truth. No scattered hex/px anywhere else.
   ========================================================================== */

:root {
  /* ---- Background / surfaces (neutral; mechanics pop) ---- */
  --bg-base:   #0a0c10;   /* the one canvas, under every section */
  --bg-900:    var(--bg-base);
  --bg-800:    var(--bg-base);
  --surface-1: #131822;
  --surface-2: #1a212d;
  --surface-3: #222b3a;
  --canvas:    #0b0e13;

  /* ---- Text ---- */
  --text-primary:   #eef2f8;
  --text-secondary: #aeb7c7;
  --text-muted:     #828c9e;
  --text-faint:     #7d8798;
  --text-on-accent: #04121f;

  /* ---- Borders / grid (panel + node/edge — NEVER between sections) ---- */
  --border-subtle:  #191b1e;
  --border-default: #25272a;
  --border-strong:  #36383b;
  --grid-line:      #16181c;
  --ring:           #5b9dff;

  /* ---- Accent (the ACTIVE PATH / primary action) ---- */
  --accent:       #5b9dff;
  --accent-hover: #74acff;
  --accent-press: #4a87ec;
  --accent-soft:  #152031;   /* opaque tint of the accent on the canvas */

  /* ---- AGENT STATUS (always paired with icon + text label) ---- */
  --st-queued:  #828c9e;  --st-queued-soft:  #1d2027;
  --st-running: #5b9dff;  --st-running-soft: #172336;
  --st-waiting: #38bdf8;  --st-waiting-soft: #112835;
  --st-approve: #f5a524;  --st-approve-soft: #302413;
  --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:        #36383b;
  --edge-active: var(--accent);
  --edge-wrap:   #375c93;   /* the accent stepped down toward the canvas */
  --run-done:    #185c4a;   /* 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 ---- */
  --font-sans: "Lato", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               Helvetica, Arial, sans-serif;
  /* Literata carries the headlines: a text serif with real optical sizing —
     the register of paper itself, against a plant-grade interface. Lato
     carries running and interface text, and Courier Prime carries basis
     weights, moisture readings and reel numbers. */
  --font-display: "Literata", Georgia, "Times New Roman", serif;
  --font-mono: "Courier Prime", "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 borders; no shadows,
     gradients or opacity anywhere. ---- */
  --hairline: none;
  --shadow-1: none;
  --shadow-2: none;
  --shadow-3: none;
  --scrim:    #06080c;

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

/* ---- Optional light theme (control-room dark remains the identity) ---- */
[data-theme="light"] {
  --bg-base: #f7f9fc;  --bg-900: var(--bg-base);  --bg-800: var(--bg-base);
  --surface-1: #ffffff; --surface-2: #f3f6fb; --surface-3: #e9eef7;
  --canvas: #f8fafd;
  --text-primary: #0a0c10; --text-secondary: #3a4252; --text-muted: #5d6678;
  --text-faint: #7b8494; --text-on-accent: #ffffff;
  --border-subtle: #e6e8eb;
  --border-default: #d6d8db;
  --border-strong: #c3c5c8;
  --grid-line: #e9ebee;
  --accent: #2563eb; --accent-hover: #1d4ed8; --accent-press: #1e40af;
  --accent-soft: #dee7fa;
  --st-queued: #5d6678; --st-running: #2563eb; --st-waiting: #0284c7;
  --st-approve: #b45309; --st-success: #0f766e; --st-failed: #be123c;
  --st-blocked: #9f1239;
  --st-queued-soft: #dee1e7;  --st-running-soft: #d5e1f9; --st-waiting-soft: #d0e6f4;
  --st-approve-soft: #ecded5; --st-success-soft: #d2e4e5; --st-failed-soft: #eed4dd;
  --st-blocked-soft: #e9d4dd;
  --edge: #c3c5c8;
  --edge-wrap: #84a6f3;
  --run-done: #9ac5c3;
  --scrim: #f7f9fc;
}
