/* ============================================================================
   theme.css — the shared Datum component kit (canonical: packages/ui).
   ----------------------------------------------------------------------------
   Loaded after tokens.css on marketing pages and the workbench. Owns the
   components that repeat across surfaces: nav, footer, cards + registration
   ticks, labels and eyebrows, traces, chips, buttons, gauges, form fields,
   agent run states, the telemetry ticker, and the motion layer (scroll
   reveals + micro-interactions). Page / route files keep only their
   surface-specific layout.
   Datum rules kept here: chrome is ink, the signal orange marks live state
   only, physics colours are data, hairlines instead of shadows (the lifted
   shadow is for overlays), one focus ring (--focus-ring), and motion that
   animates transform and opacity only. Every rule reads palette tokens, so a
   .night band or .screen inset nested in a paper page re-skins itself.
   Marketing HTML keeps the stable URL /assets/theme.css via
   tools/deploy/sync-ui-tokens.mjs — edit this file, then re-sync.
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  background: rgb(var(--canvas));
  color: rgb(var(--ink));
  font-family: var(--font-ui);
  font-size: var(--fs-base);
  line-height: var(--leading-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: rgb(var(--accent) / 0.16); }

.num, .spec, .dim, code, kbd {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

/* long unbroken tokens (paths, URLs, commands) must wrap, never force
   sideways scroll on narrow viewports */
code, kbd, pre {
  overflow-wrap: break-word;
}

/* faint drafting grid — apply to a full-bleed background element */
.grid-bg {
  background-image:
    linear-gradient(rgb(var(--ink) / 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgb(var(--ink) / 0.05) 1px, transparent 1px);
  background-size: 32px 32px;
}

/* route boundary fade+rise (guidelines/route-transition.html) */
.page-main {
  animation: route-in var(--dur-base) var(--ease) both;
}

@keyframes route-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .page-main { animation: none; }
}

/* ~390px: enter fade was too subtle at --dur-base (220ms) in Reel QA — use
   --dur-slow + a slightly taller rise so Docs↔Contact reads without demo padding. */
@media (max-width: 480px) {
  .page-main {
    animation-name: route-in-mobile;
    animation-duration: var(--dur-slow);
  }
}

@keyframes route-in-mobile {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

@media (max-width: 480px) and (prefers-reduced-motion: reduce) {
  .page-main { animation: none; }
}


h1,
h2,
h3,
.display {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: var(--tracking-tight);
  line-height: var(--leading-tight);
  color: rgb(var(--ink));
}

.prose {
  font-family: var(--font-ui);
  color: rgb(var(--ink-dim));
  max-width: 56ch;
}

/* In-prose links need a non-color cue (WCAG 1.4.1 / axe link-in-text-block). */
.prose a {
  text-decoration: underline;
  text-underline-offset: 0.16em;
}

a {
  color: inherit;
  text-decoration: none;
}

.wrap {
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* one focus ring everywhere (--focus-ring: ink on paper, bone on night). The
   transparent outline keeps a visible ring in forced-colors mode. */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid transparent;
  outline-offset: var(--focus-offset);
  box-shadow: var(--focus-ring);
}

/* --- top nav ---------------------------------------------------------------
   Paper glass; its hairline firms up once you scroll (.scrolled is toggled
   by theme.js). The 2px signal rule under it is the scroll-progress meter
   (scaleX driven by theme.js via --progress). */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  background: var(--glass-bg);
  border-bottom: 1px solid rgb(var(--hairline));
}

.nav.scrolled {
  border-bottom-color: rgb(var(--hairline-strong));
}

.nav::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: rgb(var(--signal));
  transform: scaleX(var(--progress, 0));
  transform-origin: left;
  pointer-events: none;
}

.nav .wrap {
  display: flex;
  align-items: center;
  gap: var(--space-6);
  height: 60px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  font-family: var(--font-display);
  font-weight: var(--fw-bold);
  letter-spacing: var(--tracking-tight);
  font-size: 1.5rem;
  color: rgb(var(--ink));
}

.brand .carry {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
}

.brand .carry svg {
  width: 100%;
  height: 100%;
  display: block;
}

.brand .dot {
  color: rgb(var(--ink-mute));
}

.nav-links {
  display: flex;
  gap: var(--space-5);
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: var(--fw-medium);
  text-transform: uppercase;
  letter-spacing: var(--tracking-eyebrow);
  color: rgb(var(--ink-dim));
}

.nav-links a {
  position: relative;
  padding: 4px 0;
}

.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  height: 1.5px;
  width: 100%;
  background: rgb(var(--ink));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--dur-base) var(--ease-out);
}

.nav-links a:hover,
.nav-links a:focus-visible,
.nav-links a[aria-current="page"] {
  color: rgb(var(--ink));
}

.nav-links a:hover::after,
.nav-links a:focus-visible::after,
.nav-links a[aria-current="page"]::after {
  transform: scaleX(1);
}

.nav-profile {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  min-width: var(--touch-min);
  min-height: var(--touch-min);
  color: rgb(var(--ink-dim));
  border: 1px solid rgb(var(--hairline));
  border-radius: var(--radius-sm);
}

.nav-profile:hover,
.nav-profile[aria-current="page"] {
  color: rgb(var(--ink));
  background: rgb(var(--surface));
}

.nav-profile:focus-visible {
  outline: 2px solid rgb(var(--ink));
  outline-offset: var(--space-1);
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: 600;
  color: rgb(var(--green));
  letter-spacing: 0.06em;
}

.status .led {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgb(var(--green));
  box-shadow: 0 0 0 3px rgb(var(--green) / 0.18);
  animation: pulse 2.4s var(--ease) infinite;
}

@media (prefers-reduced-motion: reduce) {
  .status .led { animation: none; }
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.4;
  }
}

/* --- labels and the eyebrow -------------------------------------------------
   .mono-label is the label voice (Plex Mono 500, 12px, uppercase, 0.08em,
   ink-mute). .eyebrow is the same voice led by the three Carry cells, drawn
   as one bar plus two box-shadow copies (deep, middle, light). */
.mono-label,
.eyebrow {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: var(--fw-medium);
  line-height: var(--leading-snug);
  text-transform: uppercase;
  letter-spacing: var(--tracking-eyebrow);
  color: rgb(var(--ink-mute));
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
}

.eyebrow::before {
  content: "";
  flex: none;
  width: 3px;
  height: 10px;
  margin-right: 10px;
  border-radius: 1px;
  background: rgb(var(--carry-1));
  box-shadow: 5px 0 0 rgb(var(--carry-2)), 10px 0 0 rgb(var(--carry-3));
}

/* --- breadcrumb: page-level wayfinding, first thing under the nav bar on
   every page (top of <main>, or a .wrap div before a full-bleed hero) —
   never inside the nav bar itself. See nav.js renderCrumb(). */
.of-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  margin: 0 0 var(--space-5);
  padding-top: var(--space-4);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
}

.of-breadcrumb__back {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  color: rgb(var(--accent));
  text-decoration: none;
  white-space: nowrap;
}

.of-breadcrumb__back:hover {
  text-decoration: underline;
}

.of-breadcrumb__back:focus-visible {
  outline: 2px solid transparent;
  box-shadow: var(--focus-ring);
  border-radius: var(--radius-xs);
}

.of-breadcrumb__trail {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  margin: 0;
  padding: 0;
  list-style: none;
  color: rgb(var(--ink-mute));
}

.of-breadcrumb__trail li {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.of-breadcrumb__trail li:not(:first-child)::before {
  content: "/";
  /* --hairline is a border token: 1.36:1 as text, unreadable in both themes.
     --ink-mute is the dimmest neutral that still clears AA (4.58 worst case),
     so the separator stays quieter than the crumb it follows and is legible. */
  color: rgb(var(--ink-mute));
}

.of-breadcrumb__trail a {
  color: rgb(var(--ink-mute));
  text-decoration: none;
}

.of-breadcrumb__trail a:hover {
  color: rgb(var(--accent));
  text-decoration: underline;
}

.of-breadcrumb__trail [aria-current="page"] {
  color: rgb(var(--ink));
}

/* --- card + registration corner ticks (the drafting-mark motif) -----------
   Cards are flat: surface, one hairline, --radius, no shadow. A .card.screen
   or a card inside .night picks up the night palette from tokens.css. */
.card {
  position: relative;
  background: rgb(var(--surface));
  border: 1px solid rgb(var(--hairline));
  border-radius: var(--radius);
  box-shadow: none;
}

.card.screen {
  background: rgb(var(--canvas));
}

/* overlays are the only lifted layer: menus, dialogs, toasts, popovers */
.overlay {
  background: rgb(var(--surface));
  border: 1px solid rgb(var(--hairline));
  border-radius: var(--radius);
  box-shadow: var(--shadow-lifted);
}

/* The ticker and footer.bench are night regions without the .night class:
   they take the night palette from the --screen-* mirrors in tokens.css, and
   re-derive the focus ring so it reads bone on the dark ground. Their rules
   below read palette tokens only, like any .night band. */
.ticker,
footer.bench {
  --canvas: var(--screen);
  --hairline: var(--screen-edge);
  --ink: var(--screen-ink);
  --ink-dim: var(--screen-dim);
  --ink-mute: var(--screen-dim);
  --signal: var(--screen-amber);
  --amber: var(--screen-amber);
  --cyan: var(--screen-cyan);
  --accent: var(--ink);
  --focus-ring: 0 0 0 2px rgb(var(--canvas)), 0 0 0 4px rgb(var(--accent) / 0.9);
  color-scheme: dark;
  background: rgb(var(--canvas));
  color: rgb(var(--ink));
}

.card.ticks::before,
.card.ticks::after,
.card.ticks>.tick-bl,
.card.ticks>.tick-br {
  content: "";
  position: absolute;
  width: 9px;
  height: 9px;
  border-color: rgb(var(--ink) / 0.30);
  pointer-events: none;
}

.card.ticks::before {
  top: 7px;
  left: 7px;
  border-top: 1.5px solid;
  border-left: 1.5px solid;
}

.card.ticks::after {
  top: 7px;
  right: 7px;
  border-top: 1.5px solid;
  border-right: 1.5px solid;
}

.card.ticks>.tick-bl {
  bottom: 7px;
  left: 7px;
  border-bottom: 1.5px solid;
  border-left: 1.5px solid;
}

.card.ticks>.tick-br {
  bottom: 7px;
  right: 7px;
  border-bottom: 1.5px solid;
  border-right: 1.5px solid;
}

.card.ticks:hover::before,
.card.ticks:hover::after,
.card.ticks:hover>.tick-bl,
.card.ticks:hover>.tick-br {
  border-color: rgb(var(--ink) / 0.6);
}

/* --- trace divider (PCB line + via dots) ----------------------------------- */
.trace {
  display: flex;
  align-items: center;
  gap: 0;
  margin: var(--space-10) 0;
  /* contrast-ok: not text — this colour only feeds currentColor to the 1px rule
     and via dots below. A decorative divider carries no information. */
  color: rgb(var(--ink) / 0.28);
}

.trace .line {
  height: 1px;
  background: currentColor;
  flex: 1;
}

.trace .via {
  width: 7px;
  height: 7px;
  border: 1.5px solid currentColor;
  border-radius: 50%;
  flex: none;
}

.trace .seg {
  width: 14px;
  height: 14px;
  border-left: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-7px);
  flex: none;
}

.trace .label {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: 500;
  color: rgb(var(--ink-mute));
  padding: 0 var(--space-3);
  white-space: nowrap;
  letter-spacing: var(--tracking-eyebrow);
}

/* --- BOM rows --------------------------------------------------------------- */
.bom {
  display: flex;
  flex-direction: column;
}

.bomrow {
  display: grid;
  grid-template-columns: 22px 1fr auto;
  gap: var(--space-4);
  align-items: start;
  padding: var(--space-4) var(--space-4);
  border-top: 1px solid rgb(var(--hairline));
  cursor: default;
}

.bomrow:first-child {
  border-top: none;
}

.bomrow:hover,
.bomrow.hot {
  background: rgb(var(--elevated));
}

.bomrow-link {
  display: contents;
  color: inherit;
  text-decoration: none;
}

.bomrow .idx {
  font-family: var(--font-mono);
  color: rgb(var(--ink-mute));
  font-size: var(--fs-xs);
  padding-top: 3px;
}

.bomrow .part {
  font-family: var(--font-mono);
  font-weight: 700;
  color: rgb(var(--ink));
}

.bomrow .why {
  font-family: var(--font-ui);
  color: rgb(var(--ink-dim));
  font-size: var(--fs-sm);
  margin-top: 3px;
  max-width: 60ch;
}

.bomrow .tag {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: 600;
  color: rgb(var(--cyan));
  white-space: nowrap;
  padding-top: 3px;
}

/* --- chips (status pills) ---------------------------------------------------
   Mono 600 at 11px on --radius-xs. A physics chip is the colour on its own
   -soft tint (4.5:1 on every ground, ui-kit.selfcheck guard 5). The bare
   .chip (or .chip.mute) is the neutral: elevated fill, ink-dim text. */
.chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: var(--fw-semibold);
  line-height: var(--leading-snug);
  letter-spacing: var(--tracking-wide);
  padding: 3px var(--space-2);
  border-radius: var(--radius-xs);
  border: 0;
  color: rgb(var(--ink-dim));
  background: rgb(var(--elevated));
}

.chip.ok,
.chip.green {
  color: rgb(var(--green));
  background: var(--green-soft);
}

.chip.warn {
  color: rgb(var(--warn));
  background: var(--warn-soft);
}

.chip.bad,
.chip.red {
  color: rgb(var(--red));
  background: var(--red-soft);
}

.chip.cyan {
  color: rgb(var(--cyan));
  background: var(--cyan-soft);
}

.chip.amber {
  color: rgb(var(--amber));
  background: var(--amber-soft);
}

/* --- buttons ----------------------------------------------------------------
   One system, shared with .of-btn in components.css (keep them in step).
   Primary (bare .btn) = ink fill, paper text. .secondary = surface fill and
   the strong hairline. .ghost = underlined text. Sans 500, sentence case.
   Height is --control-h in apps; .lg is the 44px marketing and auth size;
   .block fills its row (auth submit = class="btn lg block").
   .data / .cyan are retired aliases of .secondary: cyan is data, not chrome. */
.btn {
  display: inline-flex;
  gap: var(--space-2);
  align-items: center;
  justify-content: center;
  min-height: var(--control-h);
  padding: var(--space-2) var(--space-4);
  font-family: var(--font-ui);
  font-weight: var(--fw-medium);
  font-size: var(--fs-sm);
  line-height: var(--leading-snug);
  text-decoration: none;
  white-space: nowrap;
  color: var(--text-on-accent);
  background: rgb(var(--accent));
  border: 1px solid rgb(var(--accent));
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: transform var(--dur-micro) var(--ease);
}

.btn:hover {
  background-image: linear-gradient(rgb(var(--paper-hi) / 0.12) 0 0);
}

.btn:active {
  transform: translateY(1px);
}

.btn>span:last-child {
  transition: transform var(--dur-base) var(--ease-out);
}

.btn:hover>span:last-child {
  transform: translateX(3px);
}

.btn.secondary,
.btn.data,
.btn.cyan {
  color: rgb(var(--ink));
  background: rgb(var(--surface));
  border-color: rgb(var(--hairline-strong));
}

.btn.secondary:hover,
.btn.data:hover,
.btn.cyan:hover {
  background: rgb(var(--elevated));
}

.btn.ghost {
  color: rgb(var(--ink));
  background: transparent;
  border-color: transparent;
  padding-inline: var(--space-1);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

.btn.ghost:hover {
  background: transparent;
  text-decoration-thickness: 2px;
}

.btn.lg {
  min-height: var(--touch-min);
  padding-inline: var(--space-5);
  font-size: var(--fs-base);
}

.btn.block {
  display: flex;
  width: 100%;
}

.btn[disabled],
.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  background-image: none;
}

/* in-flight submit/save: the button itself carries the pending state
   (distinct from disabled 0.45 — pending stays legible as "working") */
.btn.pending {
  opacity: 0.85;
  cursor: progress;
  transform: none;
  background-image: none;
}

.btn.pending::before {
  content: "";
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 1.5px solid currentColor;
  border-top-color: transparent;
  display: inline-block;
  flex: none;
  animation: btn-spin calc(var(--dur-slow) + var(--dur-base)) linear infinite;
}

@keyframes btn-spin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .btn.pending::before { animation: none; }
}

/* --- gauge / meter ----------------------------------------------------------- */
.gauge {
  padding: var(--space-4);
}

.gauge .lab {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: var(--fw-medium);
  text-transform: uppercase;
  letter-spacing: var(--tracking-eyebrow);
  color: rgb(var(--ink-mute));
}

.gauge .big {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: var(--fs-lg);
  line-height: 1.1;
  margin-top: 4px;
  color: rgb(var(--ink));
}

.gauge .big .unit {
  font-size: var(--fs-sm);
  color: rgb(var(--ink-mute));
  font-weight: 500;
}

.gauge .bar {
  height: 5px;
  border-radius: var(--radius-pill);
  background: rgb(var(--ink) / 0.12);
  margin-top: 8px;
  overflow: hidden;
}

.gauge .bar>i {
  display: block;
  height: 100%;
  border-radius: var(--radius-pill);
}

/* meters fill with scaleX when revealed (target width carried in --w) */
.gauge .bar>i.meter {
  width: var(--w, 0%);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--dur-slow) var(--ease);
}

.gauge.in .bar>i.meter,
.gauge .bar>i.meter.in {
  transform: none;
}

/* --- form fields ------------------------------------------------------------- */
.field label,
.auth-form label {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: var(--fw-medium);
  text-transform: uppercase;
  letter-spacing: var(--tracking-eyebrow);
  color: rgb(var(--ink-mute));
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.auth-form label {
  font-family: var(--font-ui);
  text-transform: none;
  letter-spacing: normal;
}

.field input,
.auth-form input {
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  color: rgb(var(--ink));
  background: rgb(var(--surface));
  border: 1px solid rgb(var(--hairline-strong));
  border-radius: var(--radius-sm);
  min-height: var(--control-h);
  padding: var(--space-2) var(--space-3);
}

.field input:hover,
.auth-form input:hover {
  border-color: rgb(var(--ink-mute));
}

.field input:focus,
.auth-form input:focus {
  outline: 2px solid transparent;
  border-color: rgb(var(--ink));
  box-shadow: var(--focus-ring);
}

.field label:focus-within,
.auth-form label:focus-within {
  color: rgb(var(--ink));
}

.form-err,
.form-note {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  line-height: 1.5;
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  margin: 0;
}

.form-err {
  color: rgb(var(--red));
  background: var(--red-soft);
  border: 1px solid rgb(var(--red) / 0.4);
}

.form-note {
  color: rgb(var(--green));
  background: var(--green-soft);
  border: 1px solid rgb(var(--green) / 0.4);
}

/* notes pop in next to the control that settled them (mirrors the design
   system's FormNote of-note-pop) */
.form-err:not([hidden]),
.form-note:not([hidden]) {
  animation: note-pop var(--dur-base) var(--ease-out) both;
}

@keyframes note-pop {
  from {
    opacity: 0;
    transform: translateY(4px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {

  .form-err:not([hidden]),
  .form-note:not([hidden]) {
    animation: none;
  }
}

/* --- agent run states ---------------------------------------------------------
   Markup:
     .run-head > .run-led + .run-title + .run-time   (signal LED, mono elapsed)
     .run-progress[role=progressbar] > i.done | i.active | i  (one cell a step)
     ol.run-steps > li.run-step(.done|.active) > span + .run-t (✓ ● ○, timing)
     .change-card > .mono-label + .change-row(.good|.cost)* + .change-actions
       (Δ rows: green is the good direction, amber is a cost; Apply = .btn,
       Discard = .btn.secondary)
     .stream-in on each appended chunk: a 120ms opacity fade, never a
     per-character typewriter.
   The glyphs are drawn by CSS and hidden from assistive tech, so state the
   step status in text (visually hidden) or aria-label. */
.run-head {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
}

.run-led {
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: var(--radius-pill);
  background: rgb(var(--signal));
  box-shadow: var(--ring-signal);
  animation: pulse 2.4s var(--ease) infinite;
}

.run-led.done {
  background: rgb(var(--ink-mute));
  box-shadow: none;
  animation: none;
}

.run-led.fail {
  background: rgb(var(--red));
  box-shadow: none;
  animation: none;
}

.run-title {
  min-width: 0;
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  color: rgb(var(--ink));
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.run-time,
.run-t {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-variant-numeric: tabular-nums;
  color: rgb(var(--ink-mute));
  white-space: nowrap;
}

.run-progress {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: 2px;
  height: 4px;
  margin-block: var(--space-3);
}

.run-progress>i {
  border-radius: 1px;
  background: rgb(var(--hairline));
}

.run-progress>i.done {
  background: rgb(var(--ink));
}

.run-progress>i.active {
  background: rgb(var(--signal));
}

.run-steps {
  list-style: none;
  margin: 0;
  padding: 0;
}

.run-step {
  display: grid;
  grid-template-columns: var(--space-4) minmax(0, 1fr) auto;
  gap: var(--space-2);
  align-items: baseline;
  padding-block: var(--space-2);
  border-top: 1px solid rgb(var(--hairline));
  font-size: var(--fs-sm);
  color: rgb(var(--ink-mute));
}

.run-step:first-child {
  border-top: 0;
}

.run-step::before {
  content: "○";
  content: "○" / "";
  font-family: var(--font-mono);
  color: rgb(var(--ink-mute));
}

.run-step.done {
  color: rgb(var(--ink-dim));
}

.run-step.done::before {
  content: "✓";
  content: "✓" / "";
  color: rgb(var(--ink));
}

.run-step.active {
  color: rgb(var(--ink));
}

.run-step.active::before {
  content: "●";
  content: "●" / "";
  color: rgb(var(--signal));
}

.change-card {
  padding: var(--space-4);
  background: rgb(var(--surface));
  border: 1px solid rgb(var(--hairline));
  border-radius: var(--radius);
}

.change-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: var(--space-2);
  align-items: baseline;
  padding-block: var(--space-2);
  border-top: 1px solid rgb(var(--hairline));
  font-size: var(--fs-sm);
  color: rgb(var(--ink-dim));
}

.change-row::before {
  content: "Δ";
  content: "Δ" / "";
  font-family: var(--font-mono);
  color: rgb(var(--ink-mute));
}

.change-row>:last-child {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  color: rgb(var(--ink));
}

.change-row.good>:last-child {
  color: rgb(var(--green));
}

.change-row.cost>:last-child {
  color: rgb(var(--amber));
}

.change-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: var(--space-2);
  margin-top: var(--space-4);
}

.stream-in {
  animation: stream-in var(--dur-fast) var(--ease-out) both;
}

@keyframes stream-in {
  from { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .run-led,
  .stream-in { animation: none; }
}

/* --- telemetry ticker --------------------------------------------------------
   A graphite conveyor strip. Markup: .ticker > .ticker-belt > 2× .ticker-run
   (the duplicate run makes the loop seamless), then label.ticker-pause >
   input[type=checkbox] (WCAG 2.2.2). Pauses on hover, while focus is inside
   and while the box is checked; static when the user prefers reduced motion. */
.ticker {
  position: relative;
  overflow: hidden;
  border-block: 1px solid rgb(var(--hairline));
}

.ticker-belt {
  display: flex;
  width: max-content;
  animation: belt 46s linear infinite;
}

.ticker:hover .ticker-belt,
.ticker:focus-within .ticker-belt {
  animation-play-state: paused;
}

.ticker:has(input:checked) .ticker-belt {
  animation-play-state: paused;
}

.ticker-pause {
  position: absolute;
  inset-block: 0;
  inset-inline-end: 0;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-inline-size: var(--touch-min);
  padding-inline: var(--space-3);
  background: rgb(var(--canvas));
  border-inline-start: 1px solid rgb(var(--hairline));
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: var(--tracking-wide);
  color: rgb(var(--ink));
  cursor: pointer;
}

.ticker-pause input {
  margin: 0;
  accent-color: rgb(var(--ink));
}

.ticker-run {
  display: flex;
  align-items: center;
  min-block-size: var(--touch-min);
  gap: var(--space-6);
  padding: 10px var(--space-3) 10px var(--space-6);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: var(--fw-medium);
  letter-spacing: var(--tracking-eyebrow);
  color: rgb(var(--ink-dim));
  white-space: nowrap;
}

.ticker-run b {
  color: rgb(var(--ink));
  font-weight: 600;
}

.ticker-run .tick-sep {
  color: rgb(var(--ink-dim));
}

@keyframes belt {
  to {
    transform: translateX(-50%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .ticker-belt {
    animation: none;
  }
}

/* --- scroll reveals -----------------------------------------------------------
   theme.js flips .in when an element enters the viewport. Stagger with
   --d (e.g. style="--d:120ms"). Falls back to visible when scripting is off. */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity var(--dur-slow) var(--ease) var(--d, 0ms), transform var(--dur-slow) var(--ease) var(--d, 0ms);
}

.reveal.in {
  opacity: 1;
  transform: none;
}

/* already revealed this session (theme.js adds .seen with .in): re-apply
   instantly instead of replaying the entrance — content, never motion */
.reveal.seen {
  transition: none !important;
}

.reveal.seen .gauge .bar>i.meter {
  transition: none;
}

@media (scripting: none) {
  .reveal {
    opacity: 1;
    transform: none;
  }

  .gauge .bar>i.meter {
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
  }

  .gauge .bar>i.meter {
    transform: none;
  }
}

/* --- footer: the bench's anodized base plate ---------------------------------- */
footer.bench {
  margin-top: var(--space-10);
  border-top: 1px solid rgb(var(--hairline));
  color: rgb(var(--ink-dim));
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  padding: var(--space-6) 0;
}

footer.bench .wrap {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-3);
}

footer.bench .brandline {
  color: rgb(var(--ink));
}

footer.bench .brandline .dot {
  color: rgb(var(--ink-dim));
}

footer.bench a {
  color: rgb(var(--ink-dim));
}

footer.bench a:hover,
footer.bench a:focus-visible {
  color: rgb(var(--ink));
}

footer.bench .links a {
  margin-left: var(--space-4);
}

/* --- live row (dashboard telemetry strip) -------------------------------------- */
.live-row {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: var(--tracking-wide);
  color: rgb(var(--ink-mute));
}

.live-row .clock {
  font-weight: 600;
  color: rgb(var(--ink));
  font-variant-numeric: tabular-nums;
}

.live-row .feed {
  color: rgb(var(--ink-dim));
  transition: opacity var(--dur-base) var(--ease);
}

.live-row .feed.swap {
  opacity: 0;
}

@media (max-width: 880px) {
  .nav .wrap {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    column-gap: var(--space-3);
    row-gap: var(--space-1);
    height: auto;
    min-height: 60px;
    padding-block: var(--space-2);
  }

  /* Compact chrome as soon as the nav grids: "Outfrastructure.ai" is ~2.5x
     the old "Outfra" run, so icon-only search + a slightly smaller lockup
     keep brand | search | auth on one row down to ~420px. */
  .nav .brand {
    min-height: var(--touch-min);
    font-size: 1.15rem;
  }

  .nav .brand .carry {
    width: 30px;
    height: 30px;
  }

  .nav-search-label,
  .nav-search kbd {
    display: none;
  }

  .nav-links:not(.nav-auth) {
    grid-column: 1 / -1;
    grid-row: 2;
    display: flex;
    flex-wrap: wrap;
    gap: 0 var(--space-1);
    margin-left: 0;
  }

  .nav-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: var(--touch-min);
    min-height: var(--touch-min);
    /* --space-1 not --space-2: fits 5 signed-out links (About/Pricing/
       Enterprise/Docs) on one row at 320px without dropping the 44px
       touch-target floor (min-width/min-height carry that independently). */
    padding-inline: var(--space-1);
  }

  .nav-search {
    grid-column: 2;
    grid-row: 1;
    justify-content: center;
    min-width: var(--touch-min);
    min-height: var(--touch-min);
  }

  .nav .nav-profile,
  .nav .nav-auth {
    grid-column: 3;
    grid-row: 1;
    display: flex;
  }
}

/* Phone widths: retain the icon Search action for touch-only navigation.
   Tighter column spacing keeps brand | search | auth on one row at 320px;
   the search button keeps the touch-sized target from the rule above. */
@media (max-width: 420px) {
  .nav .wrap {
    column-gap: var(--space-1);
  }

  .nav .brand {
    grid-column: 1;
    grid-row: 1;
    font-size: 1rem;
  }

  .nav .brand .carry {
    width: 26px;
    height: 26px;
  }

  .nav-links:not(.nav-auth) {
    grid-row: 2;
  }
}
/* --- nav search + command palette (nav.js) --------------------------------- */

.nav-search {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: var(--tracking-wide);
  color: rgb(var(--ink-dim));
  background: rgb(var(--elevated) / 0.6);
  border: 1px solid rgb(var(--hairline));
  border-radius: var(--radius-sm);
  padding: 5px 10px;
  cursor: pointer;
}

.nav-search:hover,
.nav-search:focus-visible {
  color: rgb(var(--ink));
  border-color: rgb(var(--hairline-strong));
}

.nav-search svg {
  width: 13px;
  height: 13px;
}

.nav-search kbd,
.palette kbd {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: rgb(var(--ink-mute));
  border: 1px solid rgb(var(--hairline));
  border-radius: var(--radius-sm);
  background: rgb(var(--surface));
  padding: 1px 5px;
}

.nav .nav-auth {
  margin-left: 0;
}

.palette-overlay[hidden] {
  display: none; /* the class's display:flex would otherwise beat the UA [hidden] rule */
}

.palette-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgb(var(--canvas) / 0.65);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 16vh var(--space-4) 0;
}

.palette {
  width: min(92vw, 560px);
  background: rgb(var(--surface));
  border: 1px solid rgb(var(--hairline));
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lifted);
  overflow: hidden;
}

.palette-input {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid rgb(var(--hairline));
}

.palette-input input {
  flex: 1;
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  color: rgb(var(--ink));
  background: none;
  border: none;
  outline: none;
}

.palette-input input::placeholder {
  color: rgb(var(--ink-mute));
}

.palette-results {
  list-style: none;
  margin: 0;
  padding: var(--space-2) 0;
  max-height: 46vh;
  overflow-y: auto;
}

.palette-section {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: var(--fw-medium);
  text-transform: uppercase;
  letter-spacing: var(--tracking-eyebrow);
  color: rgb(var(--ink-mute));
  padding: var(--space-2) var(--space-4) var(--space-1);
}

.palette-item a {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-4);
  text-decoration: none;
  border-left: 2px solid transparent;
}

.palette-item.is-active a {
  background: rgb(var(--accent) / 0.08);
  border-left-color: rgb(var(--accent));
}

.palette-title {
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  font-weight: 600;
  color: rgb(var(--ink));
}

.palette-path {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: rgb(var(--ink-mute));
}

.palette-empty,
.palette-hint {
  font-family: var(--font-ui);
  font-size: var(--fs-sm);
  color: rgb(var(--ink-dim));
  padding: var(--space-4);
}

/* Content-index hits: a text window around the match, hit wrapped in <mark>. */
.palette-snippet {
  font-family: var(--font-ui);
  font-size: var(--fs-xs);
  color: rgb(var(--ink-dim));
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  text-align: right;
  max-width: 32ch;
}

.palette-snippet mark {
  background: rgb(var(--accent) / 0.18);
  color: inherit;
  font-weight: 600;
}

.palette-foot {
  display: flex;
  gap: var(--space-4);
  padding: var(--space-2) var(--space-4);
  border-top: 1px solid rgb(var(--hairline));
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: rgb(var(--ink-mute));
}

.palette-foot span {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
}

.staging-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 11000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-3) var(--space-4);
  padding-bottom: calc(var(--space-3) + var(--safe-bottom));
  background: rgb(var(--surface));
  color: rgb(var(--ink));
  border-top: 1px solid rgb(var(--accent));
  font-family: var(--font-ui);
  font-size: var(--fs-sm);
  line-height: var(--leading-snug);
}

.staging-banner p {
  margin: 0;
}

.staging-banner__close {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: rgb(var(--ink));
  background: transparent;
  border: 1px solid rgb(var(--hairline));
  border-radius: var(--radius-sm);
  padding: var(--space-2) var(--space-3);
  cursor: pointer;
}
