/* ============================================================================
   DIRECTION 01 — FOUNDRY
   "Instrument-grade calm."

   A precision workspace for people who run plants. Cool graphite neutrals so
   that the only saturated colour on screen is information: signal amber for
   the thing you are doing, and a strict semantic set for the state of things
   that are running. Geometry is drafted rather than drawn — small radii,
   butt-terminated icon strokes, mitred joins, a 4px spatial grid.

   Every identifier, digest, path, revision and metric is typeset in mono with
   tabular figures, because in this product those strings are read character by
   character and compared against a terminal.

   Shell: 56px product rail + contextual panel. Inner products (Design, Team)
   surrender their own sidebars and fill the contextual panel instead, which is
   what makes the bundle read as one application.
   ========================================================================== */

:root {
  color-scheme: dark;

  /* -- type ------------------------------------------------------------ */
  --font-ui: "Inter", "SF Pro Text", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Inter", "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", "SFMono-Regular", "SF Mono", Menlo, Consolas, "Liberation Mono", ui-monospace, monospace;

  --fs-10: 10px;  --fs-11: 11px;  --fs-12: 12px;  --fs-13: 13px;
  --fs-14: 14px;  --fs-16: 16px;  --fs-22: 21px;  --fs-28: 27px;  --fs-32: 32px;
  --lh-tight: 1.22;
  --lh-body: 1.55;
  --tr-tight: -0.014em;
  --tr-wide: 0.07em;
  --tr-btn: 0.005em;
  --fw-display: 620;
  --fw-btn: 500;
  --fw-nav-active: 550;

  /* -- space (4px grid, tight-but-breathing) --------------------------- */
  --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px; --sp-4: 16px; --sp-5: 24px;
  --sp-6: 32px; --sp-7: 44px; --sp-8: 56px; --sp-9: 72px;

  /* -- radius (drafted, not rounded) ----------------------------------- */
  --r-xs: 3px; --r-sm: 4px; --r-md: 6px; --r-lg: 9px; --r-xl: 13px; --r-full: 999px;
  --avatar-radius: 5px;

  /* -- control heights (min 28px hit target, 38px for nav/inputs) ------ */
  --h-xs: 22px; --h-sm: 26px; --h-md: 30px; --h-lg: 36px;

  /* -- shell metrics --------------------------------------------------- */
  --titlebar-h: 34px; --topbar-h: 46px; --nav-head-h: 60px;
  --rail-w: 56px; --nav-w: 248px; --ops-w: 300px;
  --page-pad-x: 32px; --page-pad-y: 28px; --page-max: 1180px;

  /* -- icons: drafting-table geometry ---------------------------------- */
  --icon-stroke: 1.5; --icon-cap: butt; --icon-join: miter;

  /* -- motion: short, mechanical, no bounce ---------------------------- */
  --dur-1: 90ms; --dur-2: 150ms; --dur-3: 230ms;
  --ease: cubic-bezier(.2, .6, .3, 1);

  /* -- colour: cool graphite ------------------------------------------- */
  --bg:          #0e1014;
  --bg-sunken:   #0a0c0f;
  --surface:     #14171c;
  --surface-2:   #1a1e24;
  --surface-3:   #222730;
  --overlay:     #171b21;
  --line-soft:   #21262e;
  --line:        #2b313b;
  --line-strong: #3a4250;
  --text:        #eef1f5;
  --text-2:      #a3adba;
  --text-3:      #6f7a88;

  --accent:      #f0a030;
  --accent-fg:   #f0a030;   /* accent used AS TEXT — see base.css */
  --accent-hover:#ffb149;
  --accent-ink:  #1a1206;
  --accent-soft: rgba(240, 160, 48, .13);
  --accent-line: rgba(240, 160, 48, .32);
  --focus:       #6fb4ff;

  --ok: #46c88a;        --ok-soft: rgba(70, 200, 138, .12);   --ok-line: rgba(70, 200, 138, .3);
  --warn: #e8b13c;      --warn-soft: rgba(232, 177, 60, .12); --warn-line: rgba(232, 177, 60, .3);
  --danger: #f2695f;    --danger-soft: rgba(242, 105, 95, .12);--danger-line: rgba(242, 105, 95, .32);
  --info: #63a8ff;      --info-soft: rgba(99, 168, 255, .12); --info-line: rgba(99, 168, 255, .3);
  --running: #7aa2ff;   --running-soft: rgba(122, 162, 255, .12); --running-line: rgba(122, 162, 255, .32);

  --nav-active-bg: var(--surface-3);
  --nav-active-text: var(--text);
  --nav-active-icon: var(--accent-fg);
  --input-bg: #10131890;
  --composer-bg: #14171c;
  --bubble-user: #1a1e24;
  --code-bg: #0a0c0f;
  --empty-bg: #10131750;
  --toggle-knob: #eef1f5;
  --agent-bg: rgba(122, 162, 255, .13);
  --agent-fg: #9dbaff;
  --agent-line: rgba(122, 162, 255, .28);
  --canvas-bg: #0b0e12;
  --canvas-dot: #1c222b;
  --tip-bg: #eef1f5; --tip-fg: #0e1014;
  --mark-counter: #0e1014;

  --scrim: rgba(6, 8, 11, .62);
  --scrim-blur: 3px;
  --sh-1: 0 1px 0 rgba(0,0,0,.24);
  --sh-2: 0 2px 6px rgba(0,0,0,.34);
  --sh-3: 0 12px 34px rgba(0,0,0,.5), 0 2px 6px rgba(0,0,0,.4);
  --sh-accent: inset 0 1px 0 rgba(255,255,255,.16);

  --thumb-ink: rgba(255,255,255,.82);
  --thumb-g1: linear-gradient(140deg, #253044, #131922);
  --thumb-g2: linear-gradient(140deg, #3a2f1c, #191512);
  --thumb-g3: linear-gradient(140deg, #1e3630, #121b19);
  --thumb-g4: linear-gradient(140deg, #322436, #1a151d);
  --thumb-g5: linear-gradient(140deg, #2a3348, #14181f);
  --thumb-g6: linear-gradient(140deg, #3a2a28, #1c1615);
}

/* ------------------------------------------------------------- light --- */
[data-theme="light"] {
  color-scheme: light;
  --bg:          #f4f5f7;
  --bg-sunken:   #eceef1;
  --surface:     #ffffff;
  --surface-2:   #f4f5f7;
  --surface-3:   #e7eaee;
  --overlay:     #ffffff;
  --line-soft:   #e4e7ec;
  --line:        #d5dae1;
  --line-strong: #b9c1cb;
  --text:        #171b21;
  --text-2:      #545e6b;
  --text-3:      #7b8593;

  --accent:      #96570a;
  --accent-fg:   #8a4f06;
  --accent-hover:#7d4906;
  --accent-ink:  #ffffff;
  --accent-soft: rgba(150, 87, 10, .09);
  --accent-line: rgba(150, 87, 10, .26);
  --focus:       #1f6fd0;

  --ok: #1a7f52;        --ok-soft: rgba(26, 127, 82, .09);    --ok-line: rgba(26, 127, 82, .26);
  --warn: #9a6a0a;      --warn-soft: rgba(154, 106, 10, .1);  --warn-line: rgba(154, 106, 10, .26);
  --danger: #c33a2f;    --danger-soft: rgba(195, 58, 47, .08);--danger-line: rgba(195, 58, 47, .24);
  --info: #1c62b8;      --info-soft: rgba(28, 98, 184, .08);  --info-line: rgba(28, 98, 184, .24);
  --running: #2f5fd0;   --running-soft: rgba(47, 95, 208, .09); --running-line: rgba(47, 95, 208, .26);

  --nav-active-bg: #e7eaee;
  --input-bg: #ffffff;
  --composer-bg: #ffffff;
  --bubble-user: #eef0f3;
  --code-bg: #f7f8fa;
  --empty-bg: #fafbfc;
  --toggle-knob: #ffffff;
  --agent-bg: rgba(47, 95, 208, .09);
  --agent-fg: #2f5fd0;
  --agent-line: rgba(47, 95, 208, .24);
  --canvas-bg: #fbfcfd;
  --canvas-dot: #dfe3e9;
  --tip-bg: #171b21; --tip-fg: #ffffff;
  --mark-counter: #ffffff;

  --scrim: rgba(23, 27, 33, .3);
  --sh-1: 0 1px 2px rgba(23,27,33,.05);
  --sh-2: 0 2px 8px rgba(23,27,33,.08);
  --sh-3: 0 16px 40px rgba(23,27,33,.16), 0 2px 6px rgba(23,27,33,.08);
  --sh-accent: inset 0 1px 0 rgba(255,255,255,.2);

  --thumb-ink: rgba(23,27,33,.7);
  --thumb-g1: linear-gradient(140deg, #dde5f2, #f2f5fa);
  --thumb-g2: linear-gradient(140deg, #f4e8d4, #fbf6ee);
  --thumb-g3: linear-gradient(140deg, #d9ece4, #f0f8f4);
  --thumb-g4: linear-gradient(140deg, #e9dff0, #f7f2fa);
  --thumb-g5: linear-gradient(140deg, #dee5f0, #f3f6fb);
  --thumb-g6: linear-gradient(140deg, #f2e2de, #fbf4f2);
}

/* --------------------------------------------------- direction accents -- */
/* Structural identifiers are always mono in Foundry. */
.fd-id, .deploy-id, .kv dd { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* The rail carries a hairline machined edge. */
[data-direction="foundry"] .rail { box-shadow: inset -1px 0 0 var(--line-soft); }

/* Page headers get a rule, like a drawing sheet. */
[data-direction="foundry"] .page-head { padding-bottom: var(--sp-4); border-bottom: 1px solid var(--line-soft); }

/* Section heads are labelled with a leading tick. */
[data-direction="foundry"] .section-head .sh-title { position: relative; padding-left: 11px; }
[data-direction="foundry"] .section-head .sh-title::before {
  content: ""; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 3px; height: 12px; background: var(--accent); border-radius: 1px;
}

/* Stats read like instrument read-outs. */
[data-direction="foundry"] .stat .s-val { font-family: var(--font-mono); font-weight: 500; letter-spacing: -0.02em; }
