/* ============================================================================
   Railira — Design Tokens
   AI Agent Operating System design system · control-room dark (default)
   Single source of truth. No scattered hex/px anywhere else.
   Brand: rail green #178A47 / #1F9E55 and safety yellow #F3C12C from logo/LOGO_RESEARCH.md.
   ========================================================================== */

:root {
  /* ---- Background / surfaces (rail graphite; signal green and safety yellow pop) ---- */
  --bg-base: #0b0f0d;
  --bg-900: var(--bg-base);
  --bg-800: var(--bg-base);
  --surface-1: #131916;
  --surface-2: #19211c;
  --surface-3: #212b25;
  --canvas: #0e1512;

  /* ---- Text ---- */
  --text-primary: #eaf6ee;
  --text-secondary: #b5c4ba;
  --text-muted: #879a8e;
  --text-faint: #7e9185;
  --text-on-accent: #0f3b22;

  /* ---- Borders / grid (1px, opaque, never between sections) ---- */
  --border-subtle: #1b231e;
  --border-default: #27322b;
  --border-strong: #38463e;
  --grid-line: #171f1a;
  --ring: #1f9e55;

  /* ---- Accent: rail green from logo/LOGO_RESEARCH.md (dark-background value #1F9E55) ---- */
  --accent: #1f9e55;
  --accent-hover: #2db365;
  --accent-press: #188a48;
  --accent-soft: #153324;

  /* ---- Agent status (always paired with icon + text label); approval is the safety yellow of the mark ---- */
  --st-queued: #879a8e;
  --st-queued-soft: #1e2622;
  --st-running: #1f9e55;
  --st-running-soft: #153324;
  --st-waiting: #38bdf8;
  --st-waiting-soft: #112835;
  --st-approve: #f3c12c;
  --st-approve-soft: #332b12;
  --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: #38463e;
  --edge-active: var(--accent);
  --edge-wrap: #1d6a3f;
  --run-done: #185c4a;

  /* ---- Brand mark fills ---- */
  --mark-tile: #1f9e55;
  --mark-wheel: #f3c12c;

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

  /* ---- Type: Mohave (a condensed grotesk with the register of platform signage) carries the headlines, Yantramanav carries interface and running text, Red Hat Mono carries tags, tolerances and car numbers ---- */
  --font-sans: "Yantramanav", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-display: "Mohave", "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "Red Hat Mono", "SF Mono", ui-monospace, Menlo, Consolas, monospace;
  --fs-display: clamp(2.75rem, 1.8rem + 4.2vw, 4.75rem);
  --fs-h1: clamp(2.4rem, 1.7rem + 3vw, 3.75rem);
  --fs-h2: clamp(1.85rem, 1.4rem + 1.9vw, 2.75rem);
  --fs-h3: clamp(1.35rem, 1.15rem + 0.9vw, 1.8rem);
  --fs-h4: clamp(1.15rem, 1.05rem + 0.4vw, 1.35rem);
  --fs-lead: clamp(1.0625rem, 1rem + 0.5vw, 1.3125rem);
  --fs-body: 1rem;
  --fs-body-lg: 1.125rem;
  --fs-small: 0.875rem;
  --fs-mono: 0.8125rem;
  --fs-micro: 0.6875rem;
  --fs-metric: clamp(2rem, 1.5rem + 2.2vw, 3.25rem);
  --fs-price: clamp(2.5rem, 2rem + 2.2vw, 3.75rem);

  /* ---- 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: 4px;
  --radius-md: 6px;
  --radius-lg: 10px;
  --radius-xl: 14px;
  --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: #070a08;

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

}

/* ---- Optional light theme (control-room dark remains the identity) ---- */
[data-theme="light"] {
  --bg-base: #f4f6f5;
  --bg-900: var(--bg-base);
  --bg-800: var(--bg-base);
  --surface-1: #ffffff;
  --surface-2: #edf1ee;
  --surface-3: #e2e8e4;
  --canvas: #f7f9f8;
  --text-primary: #0f3b22;
  --text-secondary: #2f4a3a;
  --text-muted: #56705f;
  --text-faint: #728a7a;
  --text-on-accent: #ffffff;
  --border-subtle: #e1e7e3;
  --border-default: #cfd8d2;
  --border-strong: #b9c5bd;
  --grid-line: #e5ebe7;
  --accent: #178a47;
  --accent-hover: #147a3e;
  --accent-press: #106734;
  --accent-soft: #d9eee0;
  --ring: #178a47;
  --st-queued: #56705f;
  --st-running: #178a47;
  --st-waiting: #0284c7;
  --st-approve: #a67c00;
  --st-success: #0f766e;
  --st-failed: #be123c;
  --st-blocked: #9f1239;
  --st-queued-soft: #dfe5e1;
  --st-running-soft: #d9eee0;
  --st-waiting-soft: #d0e6f4;
  --st-approve-soft: #f6ecc8;
  --st-success-soft: #d2e4e5;
  --st-failed-soft: #eed4dd;
  --st-blocked-soft: #e9d4dd;
  --edge: #b9c5bd;
  --edge-wrap: #7cc79a;
  --run-done: #9ac5c3;
  --scrim: #f4f6f5;
  --mark-tile: #178a47;
  --mark-wheel: #f3c12c;
}
