/* ============================================================================
   Brewira — Design Tokens
   AI Agent Operating System design system · brewery taproom light (default)
   Single source of truth. No scattered hex/px anywhere else.
   Palette from logo/LOGO_RESEARCH.md, light-background values: liquid #6FAF2A,
   headspace / wordmark ink #173D2A. The page is straw paper, the ink is the
   deep hop green of the wordmark, the action colour is a hop green dark
   enough to read on paper, and amber (the wort) marks the numbers.
   ========================================================================== */

:root {
  /* ---- Background / surfaces (green-leaning neutrals) ---- */
  --bg-base: #f6f1e4;
  --bg-900:    var(--bg-base);
  --bg-800:    var(--bg-base);
  --surface-1: #fffdf7;
  --surface-2: #f0e9d8;
  --surface-3: #e6dcc6;
  --canvas: #faf6ec;

  /* ---- Text ---- */
  --text-primary: #173d2a;
  --text-secondary: #3d5747;
  --text-muted: #5b6e61;
  --text-faint: #6f8275;
  --text-on-accent: #ffffff;

  /* ---- Borders / grid (panel + node/edge; never between sections) ---- */
  --border-subtle: #e9e1cf;
  --border-default: #d9cfb8;
  --border-strong: #bfb195;
  --grid-line: #ece5d4;
  --ring: #3f7a14;

  /* ---- Brand (the mark) ---- */
  --brand-liquid: #6faf2a;   /* liquid, dark-background value */
  --brand-head: #173d2a;   /* headspace, dark-background value */
  --brand-amber:  #b8690f;   /* the wort: underlines every number */

  /* ---- Accent (the ACTIVE PATH / primary action) ---- */
  --accent: #3f7a14;
  --accent-hover: #4f8f1c;
  --accent-press: #336410;
  --accent-soft: #e3eed2;   /* opaque tint of the accent on the canvas */

  /* ---- AGENT STATUS (always paired with icon + text label) ---- */
  --st-queued: #5b6e61;  --st-queued-soft: #e9e4d6;
  --st-running: #3f7a14;  --st-running-soft: #e3eed2;
  --st-waiting: #0e7490;  --st-waiting-soft: #d5eaef;
  --st-approve: #b8690f;  --st-approve-soft: #f6e6cb;
  --st-success: #0f7a5a;  --st-success-soft: #d5eae1;
  --st-failed: #b42339;  --st-failed-soft: #f5d9de;
  --st-blocked: #9a2b48;  --st-blocked-soft: #eed7dd;

  /* ---- Product marks (from products_raw/*/logo-brief.md) ---- */
  --prod-sealix:  #3d6bf0;
  --prod-fermix:  #e8a33d;
  --prod-carbyn:  #17b0a6;
  --prod-pastura: #e0533a;
  --prod-cuvera:  #8a5bf0;

  /* ---- Graph nodes / edges ---- */
  --node-bg:     var(--surface-3);
  --node-border: var(--border-default);
  --node-active: var(--accent);
  --edge: #bfb195;
  --edge-active: var(--accent);
  --edge-wrap: #8fbf5a;   /* the accent stepped down toward the canvas */
  --run-done: #9fcdb6;   /* 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 ---- */
  /* Vollkorn carries the headlines: a sturdy old-style serif with the register
     of a beer label. Karla carries running and interface text, and Recursive,
     locked to its mono axis, carries gravity readings, CO2 volumes,
     pasteurization units and batch numbers. */
  --font-sans: "Karla", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-display: "Vollkorn", Georgia, "Times New Roman", serif;
  --font-mono: "Recursive", "SF Mono", ui-monospace, Menlo, Consolas, monospace;

  --fs-display: clamp(2.75rem, 1.7rem + 4.4vw, 5rem);
  --fs-h1: clamp(2.25rem, 1.6rem + 2.8vw, 3.5rem);
  --fs-h2: clamp(1.75rem, 1.3rem + 1.9vw, 2.75rem);
  --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.45vw, 1.25rem);
  --fs-body:    0.9375rem;
  --fs-body-lg: 1.0625rem;
  --fs-small:   0.8125rem;
  --fs-mono:    0.8125rem;
  --fs-micro:   0.6875rem;
  --fs-metric: clamp(2rem, 1.5rem + 2.2vw, 3.25rem);
  --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: 4px; --radius-md: 6px; --radius-lg: 10px; --radius-xl: 14px;
  --radius-pill: 999px;
  --radius-btn: 6px;   /* buttons, command trigger, "built for" tags */
  --radius-node: 6;   /* graph node rx, in SVG user units */

  /* ---- 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(64px, 7vw, 112px);
  --section-y-lg: clamp(72px, 8vw, 128px);
  --nav-h: 68px;

  /* ---- Control-room density ---- */
  --panel-gap:  clamp(12px, 1.2vw, 20px);
  --panel-pad: clamp(20px, 2vw, 28px);
  --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; nothing is
     raised, blurred or translucent. ---- */
  --hairline: none;
  --shadow-1: none;
  --shadow-2: none;
  --shadow-3: none;
  --scrim: #f6f1e4;

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

/* ---- Optional dark theme (the former cellar palette) ---- */
[data-theme="dark"] {
  --bg-base: #0a100c;  --bg-900: var(--bg-base);  --bg-800: var(--bg-base);
  --surface-1: #121a15; --surface-2: #19231c; --surface-3: #212e25;
  --canvas: #0c1210;
  --text-primary: #eaf5de; --text-secondary: #b3c2ad; --text-muted: #86957f;
  --text-faint: #7e8d78; --text-on-accent: #0b1406;
  --border-subtle: #1b261e; --border-default: #283528; --border-strong: #3a4a3e;
  --grid-line: #171f1a; --ring: #86c83a;
  --brand-liquid: #86c83a; --brand-head: #cfe8b0; --brand-amber: #e8a33d;
  --accent: #86c83a; --accent-hover: #9ad554; --accent-press: #74b32c; --accent-soft: #1a2a14;
  --st-queued: #86957f; --st-queued-soft: #1d251f; --st-running: #86c83a; --st-running-soft: #1a2a14;
  --st-waiting: #4fc3e8; --st-waiting-soft: #112a36; --st-approve: #e8a33d; --st-approve-soft: #302412;
  --st-success: #3cc9a2; --st-success-soft: #102c27; --st-failed: #f0566f; --st-failed-soft: #2f171f;
  --st-blocked: #bf5a70; --st-blocked-soft: #27181f;
  --edge: #3a4a3e; --edge-wrap: #4f7a2a; --run-done: #1b5c4b; --scrim: #060907;
}
