/* ============================================================================
   Chassira — Stylesheet · "The Line"
   Light silver and white, graphite ink, one pack-violet accent.
   Extended display type for the nameplate register, a conveyor "rail" with
   station ticks as the section separator, pill controls, flat paint-shop
   surfaces. All values come from tokens.css.
   Part 1: base + shared components (used by every page).
   Part 2: homepage "line" components (prefix ln-).
   ========================================================================== */

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
[id] { scroll-margin-top: calc(var(--nav-h) + var(--space-6)); }
body {
  margin: 0;
  background: var(--bg-base);
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-stretch: var(--wdth-body);
  font-size: var(--fs-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, svg { max-width: 100%; }
img { height: auto; display: block; }

h1, h2, h3, h4 {
  color: var(--text-primary);
  font-family: var(--font-display);
  margin: 0 0 var(--space-4);
  text-wrap: balance;
}
h1, h2 {
  font-stretch: var(--wdth-display);
  font-weight: 650;
  letter-spacing: -0.02em;
}
h1 { font-size: var(--fs-h1); line-height: 1.06; }
h2 { font-size: var(--fs-h2); line-height: 1.1; }
h3 { font-size: var(--fs-h3); line-height: 1.25; font-weight: 650; font-stretch: 108%; letter-spacing: -0.01em; }
h4 { font-size: var(--fs-h4); line-height: 1.3; font-weight: 650; }
p  { margin: 0 0 var(--space-4); max-width: 68ch; }
ul, ol { margin: 0 0 var(--space-4); padding-left: var(--space-5); }
li { margin-bottom: var(--space-2); }
a { color: var(--accent); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--accent-hover); }
strong, b { color: var(--text-primary); font-weight: 650; }

code, pre, .mono { font-family: var(--font-mono); }
.metric, .ts, .num, td.num, .price__amount { font-variant-numeric: tabular-nums; }

/* Eyebrow: a short violet rail tick and sentence-case label, never shouting */
.eyebrow {
  display: inline-flex; align-items: center; gap: var(--space-3);
  font-family: var(--font-sans); font-size: var(--fs-small); font-weight: 600;
  font-stretch: 112%;
  color: var(--accent);
  margin-bottom: var(--space-4);
}
.eyebrow::before { content: ""; width: 18px; height: 2px; background: currentColor; flex: none; }
p.eyebrow, span.eyebrow { display: flex; }
.section__head--center .eyebrow, [style*="text-align:center"].eyebrow { justify-content: center; }

.lead { font-size: var(--fs-lead); color: var(--text-secondary); max-width: 60ch; line-height: 1.55; }
.muted { color: var(--text-muted); }
.small { font-size: var(--fs-small); }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: var(--space-4); top: -60px; z-index: 200;
  background: var(--accent); color: var(--text-on-accent);
  padding: var(--space-3) var(--space-5); border-radius: var(--radius-pill);
  font-weight: 600; text-decoration: none;
  transition: top var(--dur-base) var(--ease-out);
}
.skip-link:focus { top: var(--space-4); color: var(--text-on-accent); }

:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* ---------- Layout ---------- */
.container {
  width: 100%; max-width: var(--container-xl);
  margin-inline: auto; padding-inline: var(--gutter);
}
.container--wide { max-width: var(--container-xl); }
.container--md { max-width: var(--container-md); }

/* Sections sit on the silver floor; alternates are white. Every section after
   the first carries the conveyor rail: a graphite-alloy hairline with station
   ticks every 80px. */
.section { padding-block: var(--section-y); position: relative; }
.section--lg { padding-block: var(--section-y-lg); }
.section--alt { background: var(--surface-1); }
.section--canvas { background: var(--canvas); }
.section--deep { background: var(--bg-800); }
.section + .section::before {
  content: ""; position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: min(var(--container-xl), 100%); height: 7px; pointer-events: none;
  background:
    linear-gradient(var(--border-default), var(--border-default)) top / 100% 1px no-repeat,
    repeating-linear-gradient(90deg, var(--rail-tick) 0 1px, transparent 1px 80px) top / 100% 7px no-repeat;
}

.section__head { max-width: 62ch; margin-bottom: var(--space-12); }
.section__head--center { margin-inline: auto; text-align: center; }
.section__head--center .lead { margin-inline: auto; }

.grid { display: grid; gap: var(--grid-gap); grid-template-columns: repeat(var(--grid-cols), 1fr); }
.cols-2 { display: grid; gap: var(--grid-gap); grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols-3 { display: grid; gap: var(--grid-gap); grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cols-4 { display: grid; gap: var(--grid-gap); grid-template-columns: repeat(4, minmax(0, 1fr)); }
.cols--stretch { align-items: stretch; }
.cols--stretch > .stretch { display: flex; }
.cols--stretch > .stretch > .console { flex: 1; display: flex; flex-direction: column; }
.cols--stretch > .stretch .log { max-height: none; flex: 1; }
.split  { display: grid; gap: clamp(28px, 5vw, 72px); grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; }
.split--reverse > :first-child { order: 2; }
.split--top { align-items: start; }
.workspace { display: grid; gap: var(--panel-gap); grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }
.span-8 { grid-column: span 8; } .span-6 { grid-column: span 6; }
.span-4 { grid-column: span 4; } .span-5 { grid-column: span 5; }
.span-7 { grid-column: span 7; } .span-12 { grid-column: span 12; }
.stack > * + * { margin-top: var(--stack); }
.flow > * + * { margin-top: var(--space-6); }
.row { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: center; }

/* ---------- Panels: white body panels, hairline edge, no drop shadow ---------- */
.panel {
  background: var(--surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--panel-pad);
}
.section--alt .panel { background: var(--bg-base); border-color: var(--border-subtle); }
.section--alt .panel .panel, .section--alt .console .panel { background: var(--surface-1); }
.panel--raised { background: var(--surface-2); }
.panel--flush { padding: 0; overflow: hidden; }
.panel--hover { transition: border-color var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out); }
.panel--hover:hover { border-color: var(--accent); }
.panel__title { margin: 0 0 var(--space-2); font-size: var(--fs-h4); }
.panel__head {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-3);
  padding: var(--space-3) var(--space-5);
  background: var(--surface-2);
  border-bottom: 1px solid var(--border-subtle);
}
.panel__head h3 { margin: 0; font-size: var(--fs-small); font-family: var(--font-mono); font-stretch: 100%; }
.panel__body { padding: var(--panel-pad); }

/* Console: an instrument panel, white with a brushed-alloy title bar */
.console {
  background: var(--canvas);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: relative;
  min-width: 0;
}
.console > * { position: relative; }

/* ---------- Buttons: pill, confident, violet ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  font-family: var(--font-sans); font-stretch: 112%; font-weight: 600; font-size: var(--fs-body);
  line-height: 1; min-height: 48px;
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-pill); border: 1.5px solid transparent;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}
.btn-primary { background: var(--accent); color: var(--text-on-accent); }
.btn-primary:hover { background: var(--accent-hover); color: var(--text-on-accent); }
.btn-primary:active { background: var(--accent-press); }
.btn-secondary { background: transparent; color: var(--text-primary); border-color: var(--text-primary); }
.btn-secondary:hover { background: var(--text-primary); color: var(--surface-1); }
.btn-ghost { background: transparent; color: var(--text-primary); border-color: var(--border-default); }
.btn-ghost:hover { border-color: var(--text-primary); color: var(--text-primary); }
.btn-sm { min-height: 40px; padding: var(--space-2) var(--space-5); font-size: var(--fs-small); }
.btn-lg { min-height: 58px; padding: var(--space-4) var(--space-8); font-size: var(--fs-body-lg); }

/* ---------- Status chip (colour + glyph + label, never colour alone) ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-mono); font-size: 0.6875rem; font-weight: 500;
  letter-spacing: 0.02em; line-height: 1;
  padding: 5px 9px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-default);
  color: var(--text-secondary); background: var(--surface-2);
  white-space: nowrap;
}
.chip .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
.chip .glyph { font-size: 0.7rem; line-height: 1; }
.chip--queued  { color: var(--st-queued);  background: var(--st-queued-soft);  border-color: transparent; }
.chip--running { color: var(--st-running); background: var(--st-running-soft); border-color: transparent; }
.chip--waiting { color: var(--st-waiting); background: var(--st-waiting-soft); border-color: transparent; }
.chip--approve { color: var(--st-approve); background: var(--st-approve-soft); border-color: transparent; }
.chip--success { color: var(--st-success); background: var(--st-success-soft); border-color: transparent; }
.chip--failed  { color: var(--st-failed);  background: var(--st-failed-soft);  border-color: transparent; }
.chip--blocked { color: var(--st-blocked); background: var(--st-blocked-soft); border-color: transparent; }
.chip--queued .dot { border-radius: 1px; }
.chip--approve .dot { border-radius: 1px; transform: rotate(45deg); }
.chip--failed .dot { clip-path: polygon(50% 0, 100% 100%, 0 100%); border-radius: 0; }
.chip--running .dot { animation: pulse var(--pulse) var(--ease-in-out) infinite; }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(0.55); } }

/* Tag: a part-number plate */
.tag {
  display: inline-flex; align-items: center; gap: var(--space-2);
  font-family: var(--font-mono); font-size: 0.6875rem;
  color: var(--text-secondary);
  background: var(--surface-1); border: 1px solid var(--border-default);
  border-radius: var(--radius-sm); padding: 3px 8px;
}
.section--alt .tag { background: var(--bg-base); }

/* ---------- Navbar ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--surface-1);
  border-bottom: 1px solid var(--border-subtle);
  transition: box-shadow var(--dur-base) var(--ease-out);
}
.site-header.is-scrolled { box-shadow: 0 10px 30px -26px rgba(23, 21, 43, 0.6); }
.nav { display: flex; align-items: center; gap: var(--space-6); min-height: var(--nav-h); }
.brand {
  display: inline-flex; align-items: center; gap: var(--space-3);
  color: var(--text-primary); text-decoration: none; flex: none;
}
.brand__logo { display: block; height: 28px; width: auto; max-width: none; }
.nav__list { display: flex; align-items: center; gap: 2px; list-style: none; margin: 0; padding: 0; }
.nav__list li { margin: 0; }
.nav__link {
  display: inline-flex; align-items: center; gap: var(--space-2);
  color: var(--text-secondary); text-decoration: none;
  font-size: var(--fs-small); font-weight: 550; font-stretch: 108%;
  padding: var(--space-2) var(--space-3); border-radius: var(--radius-pill);
  background: none; border: 0; cursor: pointer; font-family: inherit; min-height: 40px;
}
.nav__link:hover { color: var(--text-primary); background: var(--surface-2); }
.nav__link[aria-current="page"] { color: var(--accent); }
.nav__caret { width: 10px; height: 10px; transition: transform var(--dur-fast) var(--ease-out); }
.nav__link[aria-expanded="true"] { color: var(--text-primary); background: var(--surface-2); }
.nav__link[aria-expanded="true"] .nav__caret { transform: rotate(180deg); }
.nav__spacer { flex: 1; }
.nav__actions { display: flex; align-items: center; gap: var(--space-2); }

.has-menu { position: relative; }
.megamenu {
  position: absolute; top: calc(100% + 10px); left: 0; z-index: 110;
  min-width: 580px; padding: var(--space-6);
  background: var(--surface-1); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-3);
  display: none; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-6);
}
.megamenu.is-open { display: grid; }
.megamenu h4 { font-size: var(--fs-small); color: var(--text-muted); font-weight: 600; margin-bottom: var(--space-3); padding-left: var(--space-3); }
.megamenu ul { list-style: none; margin: 0; padding: 0; }
.megamenu li { margin: 0; }
.megamenu a {
  display: block; padding: var(--space-2) var(--space-3); border-radius: var(--radius-md);
  color: var(--text-primary); text-decoration: none; font-size: var(--fs-small); font-weight: 600;
}
.megamenu a:hover { background: var(--surface-2); color: var(--accent); }
.megamenu a span { display: block; color: var(--text-muted); font-size: var(--fs-micro); font-weight: 400; margin-top: 2px; }

.kbd {
  font-family: var(--font-mono); font-size: var(--fs-micro);
  background: var(--surface-2); border: 1px solid var(--border-default);
  border-radius: var(--radius-sm); padding: 2px 6px; color: var(--text-secondary);
}
.nav__hamburger { display: none; }

.mobile-menu {
  position: fixed; inset: 0; z-index: 120; background: var(--surface-1);
  padding: var(--space-5) 0 var(--space-16);
  overflow-y: auto; display: none;
}
.mobile-menu.is-open { display: block; }
.mobile-menu__top { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--space-8); }
.mobile-menu ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 0 var(--space-4); }
.mobile-menu li { margin: 0; border-bottom: 1px solid var(--border-subtle); }
.mobile-menu a {
  display: block; padding: var(--space-3) 0; color: var(--text-primary);
  text-decoration: none; font-size: var(--fs-body); font-weight: 550;
}
.mobile-menu a:hover { color: var(--accent); }
.mobile-menu a.btn { display: inline-flex; padding: var(--space-3) var(--space-6); margin-top: var(--space-4); }
.mobile-menu a.btn-primary, .mobile-menu a.btn-primary:hover { color: var(--text-on-accent); }
.mobile-menu__group { margin-bottom: var(--space-8); }
.mobile-menu__group > h4 { font-size: var(--fs-small); color: var(--accent); margin-bottom: var(--space-2); }

/* ---------- Breadcrumbs ---------- */
.breadcrumb { padding-top: var(--space-6); }
.breadcrumb ol { display: flex; flex-wrap: wrap; gap: var(--space-2); list-style: none; margin: 0; padding: 0;
  font-size: var(--fs-micro); color: var(--text-muted); }
.breadcrumb li { margin: 0; display: flex; gap: var(--space-2); align-items: center; }
.breadcrumb li + li::before { content: "/"; color: var(--text-faint); }
.breadcrumb a { color: var(--text-muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--text-primary); }

/* ---------- Sub-page hero ---------- */
.hero { padding-block: clamp(48px, 6vw, 96px) clamp(56px, 6vw, 104px); position: relative; isolation: isolate; }
.hero__grid { display: grid; gap: clamp(32px, 4vw, 64px); grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); align-items: center; }
.hero__grid > * { min-width: 0; }
.hero h1 { font-size: clamp(2rem, 1.2rem + 2.6vw, 3.25rem); line-height: 1.04; letter-spacing: -0.025em; }
.hero .lead { font-size: var(--fs-lead); }
.hero__cta { display: flex; flex-wrap: wrap; gap: var(--space-3); margin-top: var(--space-8); }
.hero__meta {
  display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-8); align-items: center;
  font-size: var(--fs-micro); color: var(--text-muted);
}
.hero__meta > span {
  display: inline-flex; align-items: center; gap: var(--space-2);
  padding: 4px 12px; border: 1px solid var(--border-default); border-radius: var(--radius-pill);
  background: var(--surface-1);
}
.hero__meta > span:has(.chip) { padding-left: 4px; }

/* ---------- Agent graph (inline SVG) ---------- */
.graph { width: 100%; height: auto; display: block; }
.graph__wrap { padding: var(--space-5) var(--space-5) var(--space-4); overflow-x: auto; min-width: 0; }
.graph .edge { stroke: var(--edge); stroke-width: 1.5; fill: none; }
.graph .edge--dashed { stroke-dasharray: 6 6; }
.graph .edge--active { stroke: var(--edge-active); stroke-width: 1.75; }
.graph .edge--wrap { stroke: var(--edge-wrap); stroke-width: 1.5; stroke-dasharray: 5 5; }
.graph .node { cursor: pointer; }
.graph .node-box { fill: var(--node-bg); stroke: var(--node-border); stroke-width: 1; }
.graph .node.is-active .node-box { stroke: var(--node-active); stroke-width: 2; fill: var(--accent-soft); }
.graph .node.is-done .node-box { fill: var(--surface-1); }
.graph .node .node-box { transition: stroke var(--dur-base) var(--ease-out), fill var(--dur-base) var(--ease-out); }
.graph .node:hover .node-box { stroke: var(--accent); }
.graph .node[aria-pressed="true"] .node-box { stroke: var(--accent); stroke-width: 2; fill: var(--accent-soft); }
.graph .node:focus { outline: none; }
.graph .node:focus-visible .node-box { stroke: var(--ring); stroke-width: 3; }
.graph .node-label { font-family: var(--font-mono); font-size: 12px; fill: var(--text-primary); font-weight: 500; }
.graph .node-sub { font-family: var(--font-mono); font-size: 10px; fill: var(--text-muted); }
.graph .node-status { font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.05em; font-weight: 500; }
.graph .lane-label { font-family: var(--font-sans); font-size: 10px; fill: var(--text-faint); }
.graph .grid-line { stroke: var(--grid-line); stroke-width: 1; }
.st-queued  { fill: var(--st-queued); }
.st-running { fill: var(--st-running); }
.st-waiting { fill: var(--st-waiting); }
.st-approve { fill: var(--st-approve); }
.st-success { fill: var(--st-success); }
.st-failed  { fill: var(--st-failed); }

/* ---------- Run timeline (<ol>): stations on a vertical line ---------- */
.run { list-style: none; margin: 0; padding: 0; position: relative; }
.run > li { position: relative; margin: 0; padding: 0 0 var(--step-gap) var(--space-10); }
.run > li::before {
  content: ""; position: absolute; left: 13px; top: 24px; bottom: 2px;
  width: 2px; background: var(--border-default);
}
.run > li:last-child::before { display: none; }
.run > li.is-done::before { background: var(--accent-line); }
.run__dot {
  position: absolute; left: 6px; top: 5px; width: 16px; height: 16px;
  border-radius: 4px; border: 2px solid var(--border-strong); background: var(--surface-1);
}
.run > li.is-done .run__dot { border-color: var(--accent); background: var(--accent); }
.run > li.is-active .run__dot { border-color: var(--accent); background: var(--surface-1); box-shadow: 0 0 0 4px var(--accent-soft); }
.run > li.is-approve .run__dot { border-color: var(--st-approve); background: var(--st-approve); transform: rotate(45deg); }
.run__head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); }
.run__idx { font-family: var(--font-mono); font-size: var(--fs-micro); color: var(--text-faint); }
.run__name { font-family: var(--font-mono); font-size: var(--fs-small); color: var(--text-primary); font-weight: 500; }
.run__dur { font-family: var(--font-mono); font-size: var(--fs-micro); color: var(--text-muted);
  font-variant-numeric: tabular-nums; margin-left: auto; }
.run__detail { margin: var(--space-2) 0 0; font-size: var(--fs-small); color: var(--text-muted); max-width: 64ch; }
.run__agent { font-family: var(--font-mono); font-size: var(--fs-micro); color: var(--accent); }

/* ---------- Tool-call stream / console log ---------- */
.log {
  font-family: var(--font-mono); font-size: var(--fs-mono); line-height: 1.55;
  padding: var(--space-4) var(--space-5); margin: 0; max-height: 340px; min-height: 340px; overflow-y: auto;
  scrollbar-width: thin; color: var(--text-secondary); list-style: none;
}
.log li { margin: 0; padding: var(--log-line-y) 0; display: flex; gap: var(--space-3); align-items: flex-start; }
.log .ts { color: var(--text-faint); font-size: var(--fs-micro); flex: none; padding-top: 2px; min-width: 68px; }
.log .arrow { color: var(--text-faint); flex: none; }
.log .call { color: var(--text-primary); }
.log .fn { color: var(--accent); }
.log .ret { color: var(--text-muted); }
.log .ok { color: var(--st-success); }
.log .warnline { color: var(--st-approve); }
.log__body { min-width: 0; word-break: break-word; }
.console__bar {
  display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap;
  padding: var(--space-3) var(--space-5); background: var(--surface-2);
  border-bottom: 1px solid var(--border-subtle);
  font-family: var(--font-mono); font-size: var(--fs-micro); color: var(--text-muted);
}
.console__bar .dots { display: flex; gap: 5px; }
.console__bar .dots i { width: 14px; height: 4px; border-radius: 2px; background: var(--border-default); display: block; }
.console__bar .dots i:first-child { background: var(--accent); }
.console__bar .spacer { flex: 1; }

/* ---------- Reasoning trace ---------- */
.trace { font-family: var(--font-mono); font-size: var(--fs-mono); }
.trace details { border-bottom: 1px solid var(--border-subtle); }
.trace details:last-child { border-bottom: 0; }
.trace summary {
  cursor: pointer; padding: var(--space-3) var(--space-2); min-height: 44px;
  display: flex; align-items: center; gap: var(--space-3); color: var(--text-primary); list-style: none;
}
.trace summary::-webkit-details-marker { display: none; }
.trace summary::before { content: "▸"; color: var(--accent); }
.trace details[open] summary::before { content: "▾"; }
.trace__kind { color: var(--text-muted); font-size: var(--fs-micro); min-width: 76px; }
.trace__body { padding: 0 var(--space-2) var(--space-4) var(--space-8); color: var(--text-muted);
  font-size: var(--fs-mono); line-height: 1.6; }

/* ---------- Inspector ---------- */
@media (min-width: 1025px) {
  .inspector { position: sticky; top: calc(var(--nav-h) + var(--space-6)); align-self: start; }
}
.inspector dl { display: grid; grid-template-columns: auto 1fr; gap: var(--space-2) var(--space-4);
  margin: 0; font-size: var(--fs-small); }
.inspector dt { color: var(--text-muted); font-size: var(--fs-micro); }
.inspector dd { margin: 0; color: var(--text-primary); font-family: var(--font-mono); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }

.panel > dl { display: grid; grid-template-columns: minmax(0, auto) minmax(0, 1fr);
  gap: var(--space-3) var(--space-5); margin: var(--space-4) 0 0; align-items: baseline; }
.panel > dl > dt { color: var(--text-muted); font-size: var(--fs-small); }
.panel > dl > dd { margin: 0; color: var(--text-primary); font-size: var(--fs-small); overflow-wrap: anywhere; }
.panel > dl + p { margin-top: var(--space-5); }
@media (max-width: 480px) { .panel > dl { grid-template-columns: 1fr; gap: 2px var(--space-4); }
  .panel > dl > dd { margin-bottom: var(--space-3); } }

/* ---------- Command palette ---------- */
.cmdk-trigger {
  display: inline-flex; align-items: center; gap: var(--space-3);
  background: var(--surface-2); border: 1px solid var(--border-default);
  border-radius: var(--radius-pill); color: var(--text-muted);
  padding: var(--space-2) var(--space-4); min-height: 40px; cursor: pointer;
  font-family: var(--font-sans); font-size: var(--fs-small);
}
.cmdk-trigger:hover { color: var(--text-primary); border-color: var(--border-strong); }
.cmdk {
  position: fixed; inset: 0; z-index: 150; display: none;
  align-items: flex-start; justify-content: center;
  padding: clamp(48px, 12vh, 140px) var(--space-4) var(--space-4);
  background: var(--scrim);
}
.cmdk.is-open { display: flex; }
.cmdk__panel {
  width: 100%; max-width: 640px; background: var(--surface-1);
  border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-3);
}
.cmdk__input {
  width: 100%; border: 0; background: var(--surface-1); color: var(--text-primary);
  font-family: var(--font-sans); font-size: var(--fs-body-lg); padding: var(--space-5) var(--space-6);
  border-bottom: 1px solid var(--border-subtle); outline: none; min-height: 60px;
}
.cmdk__input:focus-visible { box-shadow: inset 0 -2px 0 var(--accent); }
.cmdk__list { list-style: none; margin: 0; padding: var(--space-2); max-height: 44vh; overflow-y: auto; }
.cmdk__group { font-size: var(--fs-micro); font-weight: 600; color: var(--text-muted); padding: var(--space-3) var(--space-3) var(--space-1); margin: 0; }
.cmdk__opt {
  display: flex; align-items: center; gap: var(--space-3); min-height: 44px;
  padding: var(--space-2) var(--space-3); border-radius: var(--radius-md);
  color: var(--text-secondary); cursor: pointer; font-size: var(--fs-small); margin: 0;
}
.cmdk__opt .mono { color: var(--text-faint); font-size: var(--fs-micro); margin-left: auto; }
.cmdk__opt.is-active, .cmdk__opt:hover { background: var(--accent-soft); color: var(--text-primary); }
.cmdk__foot { display: flex; flex-wrap: wrap; gap: var(--space-4); padding: var(--space-3) var(--space-6); margin: 0; max-width: none;
  background: var(--surface-2); font-size: var(--fs-micro); color: var(--text-muted); }

/* ---------- Metrics / stats ---------- */
.metric { display: block; font-family: var(--font-display); font-stretch: var(--wdth-display); font-size: var(--fs-metric);
  font-weight: 650; color: var(--text-primary); line-height: 1; letter-spacing: -0.02em; }
.metric__label { display: block; margin-top: var(--space-3); font-size: var(--fs-small); color: var(--text-muted); }
.stat { display: flex; flex-direction: column; justify-content: space-between; gap: var(--space-4);
  min-height: 168px; padding: var(--space-6); }
.stat .metric__label { margin-top: 0; text-wrap: balance; }

/* ---------- Tables: spec-sheet rows ---------- */
.table-wrap { overflow-x: auto; border-radius: var(--radius-lg); border: 1px solid var(--border-subtle); background: var(--surface-1); }
table { width: 100%; border-collapse: collapse; font-size: var(--fs-small); }
caption { text-align: left; padding: var(--space-4) var(--space-5); color: var(--text-muted); font-size: var(--fs-small); }
th, td { text-align: left; padding: var(--space-3) var(--space-5); border-bottom: 1px solid var(--border-subtle); vertical-align: top; }
thead th { background: var(--surface-2); color: var(--text-primary); font-size: var(--fs-micro); font-weight: 650; font-stretch: 112%; }
tbody tr:last-child td { border-bottom: 0; }
tbody td { color: var(--text-secondary); }
tbody th { color: var(--text-primary); font-weight: 600; }
td .mono, th .mono { font-family: var(--font-mono); }

/* ---------- Cards ---------- */
.card { display: flex; flex-direction: column; }
.card__icon { width: 32px; height: 32px; margin-bottom: var(--space-4); color: var(--accent); }
.card__meta { font-family: var(--font-mono); font-size: var(--fs-micro); color: var(--accent); margin-bottom: var(--space-3); }
.card p:last-child { margin-bottom: 0; }
.card > .row { margin-top: auto; padding-top: var(--space-4); }
.card > .row + p { margin-top: var(--space-4) !important; }
.card--lead { grid-column: 1 / -1; background: var(--c-graphite) !important; border-color: var(--c-graphite) !important; color: var(--band-muted); }
.card--lead h3, .card--lead strong { color: var(--band-text); }
.card--lead .card__meta { color: var(--c-violet-bright); }
.card--lead .muted { color: var(--band-muted); }
.card--lead .tag { background: transparent; color: var(--band-text); border-color: var(--band-line); }
@media (min-width: 861px) {
  .card--lead { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: var(--space-10); align-items: start; }
  .card--lead > .card__meta, .card--lead > h3, .card--lead > .small.muted { grid-column: 1; }
  .card--lead > p:not(.card__meta):not(.small) { grid-column: 2; grid-row: 1 / span 3; margin-top: 0; }
  .card--lead > .row { grid-column: 2; margin-top: var(--space-4); padding-top: 0; }
  .card--lead > .row + p { grid-column: 2; }
}
.checklist { list-style: none; padding: 0; }
.checklist li { position: relative; padding-left: var(--space-6); }
.checklist li::before {
  content: ""; position: absolute; left: 2px; top: 0.5em; width: 10px; height: 6px;
  border-left: 2px solid var(--accent); border-bottom: 2px solid var(--accent); transform: rotate(-45deg);
}
.numlist { list-style: none; padding: 0; counter-reset: n; }
.numlist li { counter-increment: n; position: relative; padding-left: var(--space-12); margin-bottom: var(--space-5); }
.numlist li::before {
  content: counter(n, decimal-leading-zero); position: absolute; left: 0; top: 1px;
  font-family: var(--font-mono); font-size: 0.6875rem; color: var(--accent);
  border: 1px solid var(--accent-line); border-radius: var(--radius-sm); padding: 3px 5px; line-height: 1;
}

/* ---------- Bento ---------- */
.bento { display: grid; gap: var(--panel-gap); grid-template-columns: repeat(6, minmax(0, 1fr)); }
.bento > * { grid-column: span 2; }
.bento .b-wide { grid-column: span 4; }
.bento .b-full { grid-column: span 6; }
.bento > .panel { display: flex; flex-direction: column; }
.bento .b-metric { justify-content: center; gap: var(--space-3); min-height: 156px; }
.bento .b-metric .metric__label { margin-top: 0; }
.bento .b-wide > .row, .bento .b-full > .row { margin-top: auto; padding-top: var(--space-5); }
@media (max-width: 900px) { .bento { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bento > *, .bento .b-wide, .bento .b-full { grid-column: span 2; } }

/* ---------- Logos strip ---------- */
.logos { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: center; justify-content: center; }
.section--strip { padding-block: clamp(36px, 4vw, 60px); }
.logos span { font-size: var(--fs-small); font-weight: 600; font-stretch: 112%; color: var(--text-secondary);
  padding: 6px 14px; border: 1px solid var(--border-default); border-radius: var(--radius-pill); }

/* ---------- Quotes ---------- */
blockquote { margin: 0; }
blockquote p { color: var(--text-primary); font-size: var(--fs-body-lg); line-height: 1.55; }
cite { display: block; font-style: normal; font-size: var(--fs-small); font-weight: 600; color: var(--text-muted); margin-top: var(--space-4); }

/* ---------- Pricing (sub-pages) ---------- */
.price__amount { font-family: var(--font-display); font-stretch: var(--wdth-display); font-size: var(--fs-price);
  font-weight: 650; color: var(--text-primary); letter-spacing: -0.03em; line-height: 1; display: block; }
.price__unit { font-size: var(--fs-small); color: var(--text-muted); display: block; margin-top: var(--space-3); }
.tier { position: relative; display: flex; flex-direction: column; }
.tier .btn { width: 100%; margin-top: auto; }
.tier .price__unit { min-height: 2.8em; }
.tier--featured { border: 2px solid var(--accent); }
.tier__badge {
  position: absolute; top: -13px; left: var(--panel-pad);
  padding: 4px 12px; border-radius: var(--radius-pill);
  background: var(--accent); color: var(--text-on-accent);
  font-size: var(--fs-micro); font-weight: 650; white-space: nowrap;
}
.toggle { display: inline-flex; background: var(--surface-1); border: 1px solid var(--border-default) !important;
  border-radius: var(--radius-pill); padding: 4px !important; gap: 2px; margin: 0; min-width: 0; }
.toggle label { position: relative; }
.toggle input { position: absolute; inset: 0; margin: 0; appearance: none; -webkit-appearance: none;
  background: none; border: 0; cursor: pointer; }
.toggle span { display: flex; align-items: center; padding: 0 var(--space-5); border-radius: var(--radius-pill);
  font-size: var(--fs-small); font-weight: 600; color: var(--text-secondary); cursor: pointer; min-height: 38px; white-space: nowrap; }
.toggle input:checked + span { background: var(--text-primary); color: var(--surface-1); }
.toggle input:focus-visible + span { outline: 2px solid var(--ring); outline-offset: 2px; }

/* ---------- FAQ accordion ---------- */
.faq { max-width: var(--container-md); }
.faq__item { border-bottom: 1px solid var(--border-default); }
.faq__item:first-child { border-top: 1px solid var(--border-default); }
.faq__q {
  width: 100%; text-align: left; display: flex; align-items: center; justify-content: space-between;
  gap: var(--space-4); min-height: 56px; cursor: pointer;
  background: none; border: 0; color: var(--text-primary);
  font-family: var(--font-sans); font-stretch: 104%; font-size: var(--fs-body-lg); font-weight: 600;
  padding: var(--space-4) 0;
}
.faq__q:hover { color: var(--accent); }
.faq__q .sign {
  flex: none; width: 30px; height: 30px; border-radius: 50%; border: 1.5px solid currentColor;
  display: inline-grid; place-items: center; font-family: var(--font-mono); font-size: 1rem; line-height: 1;
}
.faq__q[aria-expanded="true"] .sign { background: var(--accent); border-color: var(--accent); color: var(--text-on-accent); }
.faq__a { padding: 0 var(--space-12) var(--space-5) 0; }
.faq__a[hidden] { display: none; }

/* ---------- Code / terminal ---------- */
pre {
  margin: 0; padding: var(--space-5); overflow-x: auto;
  font-family: var(--font-mono); font-size: var(--fs-mono); line-height: 1.65;
  color: var(--text-secondary); background: var(--canvas);
}
pre code { font-family: inherit; }
:not(pre) > code { font-size: 0.9em; background: var(--surface-2); padding: 1px 5px; border-radius: var(--radius-sm); color: var(--text-primary); }
.tok-key { color: var(--accent); }
.tok-str { color: var(--st-success); }
.tok-com { color: var(--text-faint); font-style: italic; }
.tok-fn  { color: var(--st-waiting); }

/* ---------- Forms ---------- */
.field { display: block; margin-bottom: var(--space-5); }
.field > span { display: block; font-size: var(--fs-small); font-weight: 600; color: var(--text-primary); margin-bottom: var(--space-2); }
input[type="text"], input[type="email"], input[type="search"], select, textarea {
  width: 100%; min-height: 48px; padding: var(--space-3) var(--space-4);
  background: var(--surface-1); color: var(--text-primary);
  border: 1px solid var(--border-strong); border-radius: var(--radius-md);
  font-family: var(--font-sans); font-size: var(--fs-body);
}
input:focus-visible, select:focus-visible, textarea:focus-visible { border-color: var(--accent); outline-offset: 1px; }
::placeholder { color: var(--text-faint); }
textarea { min-height: 132px; resize: vertical; }
.section--alt form.panel input, .section--alt form.panel select, .section--alt form.panel textarea { background: var(--surface-1); }

/* ---------- Footer ---------- */
.site-footer { background: var(--surface-1); padding-block: var(--space-20) var(--space-10); position: relative; border-top: 1px solid var(--border-subtle); }
.footer__grid { display: grid; gap: var(--space-8); grid-template-columns: 1.4fr repeat(4, minmax(0, 1fr)); }
.footer__grid h4 { font-size: var(--fs-small); color: var(--text-primary); margin-bottom: var(--space-4); }
.footer__grid ul { list-style: none; margin: 0; padding: 0; }
.footer__grid li { margin-bottom: var(--space-2); }
.footer__grid a { color: var(--text-secondary); text-decoration: none; font-size: var(--fs-small); }
.footer__grid a:hover { color: var(--accent); }
.footer__bottom {
  display: flex; flex-wrap: wrap; gap: var(--space-4); align-items: center;
  justify-content: space-between; margin-top: var(--space-16); padding-top: var(--space-6);
  border-top: 1px solid var(--border-subtle);
  font-size: var(--fs-micro); color: var(--text-muted);
}
.footer__bottom a { color: var(--text-muted); }
.footer__status { display: inline-flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
@media (max-width: 900px) { .footer__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .footer__grid > :first-child { grid-column: 1 / -1; } }

/* ---------- Motion helpers ---------- */
.js [data-reveal] { opacity: 0; transform: translateY(16px);
  transition: opacity var(--dur-slow) var(--ease-out), transform var(--dur-slow) var(--ease-out); }
.js [data-reveal].in { opacity: 1; transform: none; }

@keyframes logIn { from { clip-path: inset(0 0 100% 0); transform: translateY(6px); } to { clip-path: inset(0 0 0 0); transform: none; } }
.log.is-playing > li { animation: logIn 240ms var(--ease-out) both; animation-delay: calc(var(--i, 0) * 150ms); }
.log.is-paused > li { animation-play-state: paused; }
.offscreen-opt { content-visibility: auto; contain-intrinsic-size: 640px; }

/* ---------- Page-specific helpers ---------- */
.container--md.article, article .container--md { max-width: var(--container-md); }
article .container--md p { font-size: var(--fs-body-lg); line-height: 1.7; }
.hero .panel .numlist li { margin-bottom: var(--space-3); }
.cols-2 > *, .cols-3 > *, .cols-4 > *, .split > *, .bento > *, .workspace > * { min-width: 0; }
.split table, .panel table { display: block; overflow-x: auto; }
.split table thead, .split table tbody, .split table tr, .panel table thead, .panel table tbody, .panel table tr { display: table; width: 100%; table-layout: fixed; }

/* ---------- Responsive (shared) ---------- */
@media (max-width: 1024px) {
  .hero__grid { grid-template-columns: minmax(0, 1fr); }
  .workspace { grid-template-columns: minmax(0, 1fr); }
  .span-8, .span-4, .span-5, .span-7, .span-6 { grid-column: span 12; }
}
@media (max-width: 1080px) {
  .nav__list, .nav__actions .btn-primary, .cmdk-trigger { display: none; }
  .nav__hamburger { display: inline-flex; }
}
@media (max-width: 900px) { .cols-3, .cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) {
  .split, .cols-2 { grid-template-columns: minmax(0, 1fr); }
  .split--reverse > :first-child { order: 0; }
  .cols-3, .cols-4 { grid-template-columns: minmax(0, 1fr); }
  .megamenu { min-width: 0; }
  .graph { width: 720px; max-width: none; }
  .graph__wrap { padding-inline: var(--space-4); }
  .log { font-size: var(--fs-micro); min-height: 280px; }
  .stat { min-height: 132px; }
  .faq__a { padding-right: 0; }
}
@media (max-width: 520px) {
  .hero__cta .btn { width: 100%; }
  .footer__grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .mobile-menu ul { grid-template-columns: 1fr; }
}

/* ===========================================================================
   Part 2 · Homepage: "The Line"
   ========================================================================== */
.line-page > section { position: relative; }

/* ---------- Hero: nameplate headline over the moving line ---------- */
.ln-hero { background: var(--bg-base); padding-top: clamp(56px, 7vw, 112px); overflow: hidden; }
.ln-hero__kicker { font-size: var(--fs-small); font-weight: 600; font-stretch: 112%; color: var(--accent); margin-bottom: var(--space-5); }
.ln-hero__title {
  font-size: var(--fs-hero); line-height: 0.98; letter-spacing: -0.035em; font-weight: 700;
  max-width: 15ch; margin-bottom: var(--space-10);
}
.ln-hero__sub { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: var(--space-10); align-items: end; }
.ln-hero__sub .lead { margin: 0; }
.ln-hero__sub .hero__cta { margin: 0; justify-content: flex-end; }

.ln-stage { margin-top: clamp(40px, 5vw, 72px); background: var(--surface-1); border-top: 1px solid var(--border-subtle); padding-bottom: var(--space-8); }
.ln-stage__svg { display: block; width: 100%; height: auto; margin-top: -1px; }
.ln-gantry path { fill: none; stroke: var(--c-alloy); stroke-width: 5; stroke-linejoin: round; }
.ln-gantry-head rect { fill: var(--c-graphite); }
.ln-beams path { stroke: var(--accent); stroke-width: 1.5; stroke-dasharray: 3 5; opacity: 0.55; }
.ln-car__body { fill: var(--surface-1); stroke: var(--c-ink); stroke-width: 2.5; stroke-linejoin: round; }
.ln-car__glass { fill: var(--accent); }
.ln-car__line { stroke: var(--c-alloy); stroke-width: 1.5; }
.ln-car__wheel { fill: var(--c-graphite); }
.ln-car__hub { fill: var(--c-alloy); }
.ln-car { transform: translateX(950px); }
@media (prefers-reduced-motion: no-preference) {
  .ln-car { animation: ln-drive 22s var(--ease-in-out) infinite; }
}
/* Move, dwell one takt, move: stations at x = 120, 360, 600, 840, 1080 (car centre +130) */
@keyframes ln-drive {
  0%   { transform: translateX(-300px); }
  7%   { transform: translateX(-10px); }
  15%  { transform: translateX(-10px); }
  21%  { transform: translateX(230px); }
  29%  { transform: translateX(230px); }
  35%  { transform: translateX(470px); }
  43%  { transform: translateX(470px); }
  49%  { transform: translateX(710px); }
  57%  { transform: translateX(710px); }
  63%  { transform: translateX(950px); }
  80%  { transform: translateX(950px); }
  92%, 100% { transform: translateX(1260px); }
}
.ln-stage__stations {
  list-style: none; margin: var(--space-3) 0 0; padding: 0;
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
  text-align: center; font-weight: 650; font-stretch: 112%; color: var(--text-primary); font-size: var(--fs-small);
}
.ln-stage__stations li { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.ln-st { font-family: var(--font-mono); font-size: 0.6875rem; font-weight: 500; color: var(--accent); }

/* ---------- Takt band: the andon board ---------- */
.ln-takt { background: var(--band); color: var(--band-muted); padding-block: var(--section-y); }
.ln-takt__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: clamp(32px, 6vw, 96px); align-items: center; }
.ln-takt__label { font-size: var(--fs-small); font-weight: 600; font-stretch: 112%; color: var(--band-text); margin-bottom: var(--space-2); }
.ln-takt__time {
  margin: 0; font-family: var(--font-display); font-stretch: var(--wdth-display); font-weight: 700;
  font-size: var(--fs-takt); line-height: 0.95; letter-spacing: -0.04em; color: var(--band-text);
  font-variant-numeric: tabular-nums; max-width: none;
}
.ln-takt.is-final .ln-takt__time { color: var(--c-violet-bright); }
.ln-takt__bar { height: 6px; background: var(--band-line); border-radius: 3px; overflow: hidden; margin-top: var(--space-5); }
.ln-takt__bar span { display: block; height: 100%; background: var(--c-violet-bright); transform: scaleX(0); transform-origin: left; transition: transform 1s linear; }
.ln-takt__count { margin-top: var(--space-4); font-size: var(--fs-small); color: var(--band-muted); }
.ln-takt__count span { color: var(--band-text); font-weight: 650; font-variant-numeric: tabular-nums; }
.ln-takt.is-static .ln-takt__count { display: none; }
.ln-takt__h { color: var(--band-text); font-size: var(--fs-h2); }
.ln-takt__copy > p { color: var(--band-muted); }
.ln-takt__facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-6); margin: var(--space-8) 0 var(--space-4); padding-top: var(--space-6); border-top: 1px solid var(--band-line); }
.ln-takt__facts div { min-width: 0; }
.ln-takt__facts dt { font-family: var(--font-display); font-stretch: var(--wdth-display); font-weight: 650; font-size: var(--fs-metric); color: var(--band-text); line-height: 1; letter-spacing: -0.02em; }
.ln-takt__facts dd { margin: var(--space-2) 0 0; font-size: var(--fs-small); color: var(--band-muted); }
.ln-takt__note { font-size: var(--fs-micro); color: var(--band-muted); margin: 0; }

/* ---------- Stations ---------- */
.ln-station { padding-block: var(--section-y); background: var(--bg-base); }
.ln-station:nth-of-type(odd) { background: var(--surface-1); }
.ln-station + .ln-station::before, .ln-gate::before, .ln-ramp::before, .ln-modules::before, .ln-price::before, .ln-faq::before {
  content: ""; position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: min(var(--container-xl), 100%); height: 7px; pointer-events: none;
  background:
    linear-gradient(var(--border-default), var(--border-default)) top / 100% 1px no-repeat,
    repeating-linear-gradient(90deg, var(--rail-tick) 0 1px, transparent 1px 80px) top / 100% 7px no-repeat;
}
.ln-station__grid { display: grid; grid-template-columns: minmax(240px, 0.75fr) minmax(0, 2fr); gap: clamp(28px, 5vw, 80px); align-items: start; }
.ln-station--flip .ln-station__grid { grid-template-columns: minmax(0, 2fr) minmax(240px, 0.75fr); }
.ln-station--flip .ln-plate { order: 2; }
.ln-plate { position: sticky; top: calc(var(--nav-h) + var(--space-8)); }
.ln-plate__no {
  display: block; font-family: var(--font-display); font-stretch: var(--wdth-display); font-weight: 800;
  font-size: clamp(3rem, 1.6rem + 5vw, 6rem); line-height: 0.9; letter-spacing: -0.04em; color: var(--accent);
  margin-bottom: var(--space-4);
}
.ln-plate h2 { margin-bottom: var(--space-3); }
.ln-plate__role { color: var(--text-secondary); margin-bottom: var(--space-5); }
.ln-plate__agents { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: var(--space-2); }
.ln-plate__agents li { margin: 0; font-size: var(--fs-micro); font-weight: 600; color: var(--accent);
  padding: 5px 12px; border-radius: var(--radius-pill); border: 1px solid var(--accent-line); background: var(--surface-1); }
.ln-station:nth-of-type(odd) .ln-plate__agents li { background: var(--accent-soft); border-color: transparent; }
.ln-station__body { min-width: 0; }

.ln-drift { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-8); margin-top: var(--space-10); }
.ln-drift > div { padding-top: var(--space-4); border-top: 2px solid var(--border-default); }
.ln-drift > div + div { border-top-color: var(--accent); }
.ln-drift h3 { font-size: var(--fs-h4); margin-bottom: var(--space-2); }
.ln-drift p { margin: 0; }

/* Figures (inline SVG illustrations) */
.ln-fig { margin: 0; background: var(--bg-base); border-radius: var(--radius-xl); padding: clamp(16px, 3vw, 36px); }
.ln-station:nth-of-type(even) .ln-fig { background: var(--surface-1); border: 1px solid var(--border-subtle); }
.ln-fig svg { display: block; width: 100%; height: auto; }
.ln-fig figcaption { margin-top: var(--space-4); font-size: var(--fs-small); color: var(--text-muted); max-width: 70ch; }
.fig-frame { fill: none; stroke: var(--c-ink); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.fig-frame-thin { fill: none; stroke: var(--border-strong); stroke-width: 1.5; stroke-dasharray: 4 5; }
.fig-spots circle { fill: var(--accent); }
.fig-datum { fill: var(--accent-soft); stroke: var(--accent); stroke-width: 2.5; }
.fig-leader { fill: none; stroke: var(--c-ink); stroke-width: 1.2; }
.fig-txt { font-family: var(--font-sans); font-size: 14px; fill: var(--text-muted); }
.fig-txt--strong { fill: var(--text-primary); font-weight: 650; }
.fig-txt--on { fill: #ffffff; font-weight: 650; }
.fig-txt--bad { fill: var(--st-failed); font-weight: 650; }
.fig-axis { fill: none; stroke: var(--border-strong); stroke-width: 1.5; }
.fig-dash { stroke: var(--accent); stroke-width: 1.5; stroke-dasharray: 4 4; }
.fig-window { fill: var(--accent-soft); }
.fig-line { fill: none; stroke: var(--accent); stroke-width: 3; stroke-linecap: round; }
.fig-line--muted { stroke: var(--c-ink); stroke-width: 2; }
.fig-line--ok { stroke: var(--accent); }
.fig-line--bad { stroke: var(--st-failed); stroke-dasharray: 7 5; }
.fig-risk { fill: var(--st-failed); }
.fig-risk--low { fill: var(--st-success-soft); stroke: var(--st-success); stroke-width: 1.5; }
.fig-pack { fill: var(--accent-soft); stroke: var(--accent); stroke-width: 2; }
.fig-bolts circle { fill: var(--c-ink); }
.fig-bolts .is-flag { fill: var(--st-failed); stroke: var(--surface-1); stroke-width: 2; }
.fig-wheel { fill: var(--c-graphite); }
.fig-arrow { stroke: var(--accent); stroke-width: 2.5; }
.fig-arrow-head { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linejoin: round; }
.fig-band { fill: var(--accent-soft); stroke: var(--accent-line); stroke-width: 1; }
.fig-tol { fill: var(--st-failed-soft); }
.fig-tol-in { fill: var(--st-success-soft); }
.fig-before { fill: var(--surface-1); stroke: var(--text-muted); stroke-width: 2; stroke-dasharray: 3 3; }
.fig-after { fill: var(--accent); }

/* Paint booth chart */
.ln-booth { background: var(--surface-1); border: 1px solid var(--border-subtle); border-radius: var(--radius-xl); padding: clamp(16px, 3vw, 36px); }
.ln-booth__head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: var(--space-6); margin-bottom: var(--space-6); }
.ln-booth__head h3 { margin: 0; }
.ln-booth__head p { margin: 0; }
.ln-booth__chart { display: block; width: 100%; height: auto; }

/* Trim readout: a station terminal printout */
.ln-readout { background: var(--bg-base); border-radius: var(--radius-xl); padding: clamp(16px, 3vw, 36px); }
.ln-readout__title { font-weight: 650; font-stretch: 108%; color: var(--text-primary); margin-bottom: var(--space-4); }
.ln-readout__rows { list-style: none; margin: 0; padding: 0; }
.ln-readout__rows li {
  display: grid; grid-template-columns: 9rem minmax(0, 1fr) auto; gap: var(--space-4); align-items: baseline;
  padding: var(--space-4) 0; border-top: 1px solid var(--border-default); margin: 0;
}
.ln-readout__k { font-weight: 650; color: var(--text-primary); }
.ln-readout__s { font-size: var(--fs-micro); font-weight: 600; color: var(--text-secondary); padding: 3px 10px; border-radius: var(--radius-pill); background: var(--surface-1); border: 1px solid var(--border-default); white-space: nowrap; }
.ln-readout__s--move { color: var(--accent); border-color: var(--accent-line); background: var(--accent-soft); }

/* EOL test stand */
.ln-stand { background: var(--surface-1); border-radius: var(--radius-xl); padding: clamp(16px, 3vw, 36px); }
.ln-station:nth-of-type(even) .ln-stand { border: 1px solid var(--border-subtle); }
.ln-stand__title { font-weight: 650; font-stretch: 108%; color: var(--text-primary); display: flex; align-items: center; gap: var(--space-3); }
.ln-stand__title::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); flex: none; }
.ln-stand__list { list-style: none; margin: 0; padding: 0; counter-reset: t; }
.ln-stand__list li { counter-increment: t; display: flex; justify-content: space-between; gap: var(--space-4); align-items: center;
  padding: var(--space-3) 0; border-top: 1px dashed var(--border-default); margin: 0; color: var(--text-primary); }
.ln-stand__list li > span:first-child::before { content: counter(t) "."; display: inline-block; width: 1.8em; color: var(--text-faint); font-variant-numeric: tabular-nums; }
.ln-pass, .ln-retest { font-size: var(--fs-micro); font-weight: 650; padding: 4px 10px; border-radius: var(--radius-pill); white-space: nowrap; }
.ln-pass { color: var(--st-success); background: var(--st-success-soft); }
.ln-pass::before { content: "✓ "; }
.ln-retest { color: var(--st-approve); background: var(--st-approve-soft); }
.ln-retest::before { content: "↻ "; }
.ln-stand__foot { font-size: var(--fs-small); color: var(--text-muted); margin: var(--space-4) 0 0; }

/* ---------- Quality gate story ---------- */
.ln-gate { background: var(--surface-1); padding-block: var(--section-y-lg); }
.ln-gate__intro { max-width: 60ch; margin-bottom: var(--space-12); }
.ln-gate__intro h2 { font-size: var(--fs-display); line-height: 1.02; letter-spacing: -0.03em; }
.ln-gate__pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--panel-gap); }
.ln-gate__case { background: var(--bg-base); border-radius: var(--radius-xl); padding: clamp(20px, 3vw, 40px); min-width: 0; }
.ln-gate__case svg { display: block; width: 100%; height: auto; margin: var(--space-4) 0 var(--space-6); }
.ln-log { list-style: none; margin: 0; padding: 0; }
.ln-log li { display: grid; grid-template-columns: 4.5rem minmax(0, 1fr); gap: var(--space-3); padding: var(--space-3) 0; border-top: 1px solid var(--border-default); margin: 0; }
.ln-log__t { font-weight: 650; color: var(--accent); font-size: var(--fs-small); padding-top: 1px; }
.ln-verdict {
  margin-top: var(--panel-gap); background: var(--c-graphite); color: var(--band-muted);
  border-radius: var(--radius-xl); padding: clamp(24px, 4vw, 56px);
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: var(--space-4) clamp(24px, 4vw, 64px);
}
.ln-verdict__q { font-size: var(--fs-lead); color: var(--band-muted); margin: 0; }
.ln-verdict__a { font-family: var(--font-display); font-stretch: 112%; font-size: var(--fs-h3); line-height: 1.35; color: var(--band-text); font-weight: 550; margin: 0; }
.ln-verdict__note { grid-column: 2; font-size: var(--fs-micro); margin: 0; color: var(--band-muted); }

/* ---------- Launch ramp ---------- */
.ln-ramp { background: var(--bg-base); padding-block: var(--section-y-lg); }
.ln-ramp__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: clamp(32px, 6vw, 96px); align-items: start; }
.ln-ramp__chart { background: var(--surface-1); border-radius: var(--radius-xl); padding: clamp(18px, 3vw, 36px); border: 1px solid var(--border-subtle); }
.ln-ramp__chart svg { display: block; width: 100%; height: auto; }
.ln-ramp__steps { fill: none; stroke: var(--accent); stroke-width: 4; stroke-linejoin: round; }
.ln-ramp__gate { fill: var(--surface-1); stroke: var(--accent); stroke-width: 2.5; }
.ln-ramp__legend { list-style: none; padding: 0; margin: var(--space-6) 0 0; }
.ln-ramp__legend li { padding: var(--space-3) 0; border-top: 1px solid var(--border-subtle); margin: 0; font-size: var(--fs-small); }
.ln-ramp__legend b { color: var(--accent); }

/* ---------- Modules: spec sheet ---------- */
.ln-modules { background: var(--surface-1); padding-block: var(--section-y-lg); }
.ln-modules__head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--space-8); align-items: end; margin-bottom: var(--space-12); }
.ln-modules__head h2 { margin: 0; }
.ln-modules__head p { margin: 0; }
.ln-spec { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: clamp(24px, 4vw, 64px); }
.ln-spec li { margin: 0; border-top: 1px solid var(--border-default); }
.ln-spec a { display: grid; grid-template-columns: minmax(0, 13rem) minmax(0, 1fr); gap: var(--space-4); padding: var(--space-5) 0; text-decoration: none; color: inherit; }
.ln-spec__n { font-weight: 650; font-stretch: 112%; color: var(--text-primary); }
.ln-spec__d { color: var(--text-muted); font-size: var(--fs-small); }
.ln-spec a:hover .ln-spec__n { color: var(--accent); }

/* ---------- Pricing: three trims in one body ---------- */
.ln-price { background: var(--bg-base); padding-block: var(--section-y-lg); }
.ln-price__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: var(--space-6); margin-bottom: var(--space-10); }
.ln-price__head h2 { margin: 0; max-width: 20ch; }
.ln-trims { display: grid; grid-template-columns: 1fr 1.15fr 1fr; background: var(--surface-1); border-radius: var(--radius-xl); border: 1px solid var(--border-subtle); overflow: hidden; }
.ln-trim { padding: clamp(24px, 3vw, 44px); display: flex; flex-direction: column; min-width: 0; }
.ln-trim + .ln-trim { border-left: 1px solid var(--border-subtle); }
.ln-trim h3 { font-size: var(--fs-h4); color: var(--accent); margin-bottom: var(--space-4); }
.ln-trim__price { margin: 0; }
.ln-trim__unit { font-size: var(--fs-small); color: var(--text-muted); min-height: 3em; margin: var(--space-3) 0 var(--space-5); }
.ln-trim .checklist { margin: var(--space-2) 0 var(--space-8); font-size: var(--fs-small); }
.ln-trim .btn { margin-top: auto; width: 100%; }
.ln-trim--plant { background: var(--c-graphite); color: var(--band-muted); border-left: 0 !important; }
.ln-trim--plant + .ln-trim { border-left: 0; }
.ln-trim--plant h3 { color: var(--c-violet-bright); }
.ln-trim--plant .price__amount { color: var(--band-text); }
.ln-trim--plant .ln-trim__unit { color: var(--band-muted); }
.ln-trim--plant .checklist li { color: var(--band-text); }
.ln-trim--plant .checklist li::before { border-color: var(--c-violet-bright); }
.ln-trim--plant .btn-primary { background: var(--c-violet-bright); color: var(--c-graphite); }
.ln-trim--plant .btn-primary:hover { background: #ffffff; color: var(--c-graphite); }
.ln-trim--plant :focus-visible { outline-color: #ffffff; }
.ln-price__foot { margin: var(--space-6) 0 0; font-size: var(--fs-small); color: var(--text-muted); max-width: none; }

/* ---------- FAQ ---------- */
.ln-faq { background: var(--surface-1); padding-block: var(--section-y); }
.ln-faq__grid { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.6fr); gap: clamp(28px, 5vw, 80px); align-items: start; }
.ln-faq .faq { max-width: none; }

/* ---------- CTA: violet launch panel ---------- */
.ln-cta { background: var(--accent); color: #f1eeff; padding-block: var(--section-y-lg); }
.ln-cta h2 { color: #ffffff; font-size: var(--fs-display); line-height: 1; letter-spacing: -0.035em; font-weight: 700; }
.ln-cta__grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: var(--space-10); align-items: end; }
.ln-cta p { color: #f1eeff; font-size: var(--fs-lead); }
.ln-cta .ln-cta__note { font-size: var(--fs-small); color: #e4defd; margin: 0; }
.ln-cta__actions { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-4); }
.ln-cta .btn-primary { background: #ffffff; color: var(--accent-press); }
.ln-cta .btn-primary:hover { background: var(--c-graphite); color: #ffffff; }
.ln-cta__mail { color: #ffffff; font-weight: 600; font-size: var(--fs-body-lg); }
.ln-cta__mail:hover { color: #ffffff; text-decoration-thickness: 2px; }
.ln-cta :focus-visible { outline-color: #ffffff; }

/* ---------- Homepage responsive ---------- */
@media (max-width: 1024px) {
  .ln-station__grid, .ln-station--flip .ln-station__grid { grid-template-columns: minmax(0, 1fr); }
  .ln-station--flip .ln-plate { order: 0; }
  .ln-plate { position: static; }
  .ln-takt__grid, .ln-ramp__grid, .ln-faq__grid, .ln-cta__grid { grid-template-columns: minmax(0, 1fr); }
  .ln-verdict { grid-template-columns: minmax(0, 1fr); }
  .ln-verdict__note { grid-column: auto; }
}
@media (max-width: 860px) {
  .ln-hero__sub { grid-template-columns: minmax(0, 1fr); gap: var(--space-6); }
  .ln-hero__sub .hero__cta { justify-content: flex-start; }
  .ln-gate__pair, .ln-spec, .ln-modules__head { grid-template-columns: minmax(0, 1fr); }
  .ln-trims { grid-template-columns: minmax(0, 1fr); }
  .ln-trim + .ln-trim { border-left: 0; border-top: 1px solid var(--border-subtle); }
  .ln-booth__head { grid-template-columns: minmax(0, 1fr); gap: var(--space-2); }
}
@media (max-width: 640px) {
  .ln-drift { grid-template-columns: minmax(0, 1fr); gap: var(--space-6); }
  .ln-takt__facts { grid-template-columns: minmax(0, 1fr); gap: var(--space-4); }
  .ln-readout__rows li { grid-template-columns: minmax(0, 1fr); gap: var(--space-1); }
  .ln-readout__s { justify-self: start; }
  .ln-spec a { grid-template-columns: minmax(0, 1fr); gap: var(--space-1); }
  .ln-stage__stations { font-size: 0.75rem; }
  .ln-stage__svg { margin-inline: -8px; width: calc(100% + 16px); max-width: none; }
  .ln-price__head { flex-direction: column; align-items: flex-start; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .js [data-reveal] { opacity: 1; transform: none; }
  .log.is-playing > li { animation: none; }
  .chip--running .dot { animation: none; }
  .ln-car { animation: none !important; transform: translateX(950px); }
}

@media print {
  .site-header, .cmdk, .mobile-menu { display: none !important; }
  body { background: #fff; color: #000; }
}

/* ---------- Late fixes ---------- */
.fig-risk-hi { fill: var(--st-failed-soft); stroke: var(--st-failed); stroke-width: 1.5; }
.fig-risk-lo { fill: var(--st-success-soft); stroke: var(--st-success); stroke-width: 1.5; }
.fig-txt--ok { fill: var(--st-success); font-weight: 650; }
.ln-takt__facts dt { font-size: clamp(1.5rem, 1rem + 1.3vw, 2.2rem); }
.ln-stand { background: var(--bg-base); }
.ln-station:nth-of-type(even) .ln-stand { background: var(--surface-1); }
.ln-gate__intro h2 { font-size: var(--fs-display); }
@media (max-width: 640px) {
  /* Keep diagram labels legible: let wide diagrams scroll inside their panel rather than shrink */
  .ln-fig, .ln-booth { overflow-x: auto; }
  .ln-fig svg, .ln-booth__chart { min-width: 500px; }
  .ln-fig figcaption { position: sticky; left: 0; max-width: calc(100vw - 2 * var(--gutter) - 32px); }
  .ln-booth__head { position: sticky; left: 0; max-width: calc(100vw - 2 * var(--gutter) - 32px); }
}
