/* C3D Studio site. Paper ground to sit with the pencil artwork; the harness and loop sections
   switch to a dark instrument panel. One amber signal colour, cyan for simulation. */

:root {
  --bg: #f5f2ec;
  --bg-2: #ece8e0;
  --bg-3: #e3ded4;
  --line: rgba(22, 24, 26, 0.1);
  --line-2: rgba(22, 24, 26, 0.2);
  --ink: #16181a;
  --mute: #5f6366;
  --amber: #e89a00;
  --amber-ink: #b36f00;
  --amber-dim: rgba(232, 154, 0, 0.14);
  --cyan: #1f9e94;
  --green: #2f8a3c;

  --sans: "Geist", -apple-system, "Segoe UI", system-ui, sans-serif;
  --serif: "Instrument Serif", "Times New Roman", serif;
  --mono: "Geist Mono", ui-monospace, Consolas, monospace;

  --wrap: 1180px;
  --gutter: clamp(16px, 4vw, 40px);
  --ease: cubic-bezier(0.2, 0.7, 0.1, 1);
}

/* Dark instrument panel */
.dark {
  --bg: #0f1112;
  --bg-2: #161a1d;
  --bg-3: #1d2226;
  --line: rgba(233, 230, 223, 0.09);
  --line-2: rgba(233, 230, 223, 0.2);
  --ink: #ece9e2;
  --mute: #8f9391;
  --amber: #ffb000;
  --amber-ink: #ffb000;
  --amber-dim: rgba(255, 176, 0, 0.16);
  --cyan: #5ad1c7;
  background: var(--bg);
  color: var(--ink);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.035em; line-height: 1.05; }
h1 em, h2 em {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  color: var(--amber-ink);
  letter-spacing: -0.01em;
}
p { margin: 0; }
img { display: block; max-width: 100%; height: auto; }
::selection { background: var(--amber); color: #111; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--mute);
  margin-bottom: 22px;
}
.eyebrow .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 0 4px var(--amber-dim); }
.lede { color: var(--mute); font-size: clamp(17px, 1.6vw, 20px); max-width: 36em; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 20px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  font-weight: 500;
  font-size: 15px;
  text-decoration: none;
  border: 1px solid var(--ink);
  transition: transform 0.25s var(--ease), background 0.25s, color 0.25s, border-color 0.25s;
}
.btn:hover { transform: translateY(-2px); background: var(--amber); border-color: var(--amber); color: #16181a; }
.btn:focus-visible, .nav-links a:focus-visible, .brand:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-2); }
.btn-ghost:hover { background: var(--bg-2); border-color: var(--line-2); color: var(--ink); }
.btn-small { padding: 8px 16px; font-size: 14px; }

/* Nav */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px var(--gutter);
  background: rgba(245, 242, 236, 0.8);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav { transition: background 0.35s, border-color 0.35s, color 0.35s; }
.nav.on-dark {
  --ink: #ece9e2;
  --bg: #0f1112;
  --mute: #8f9391;
  --line: rgba(233, 230, 223, 0.09);
  background: rgba(15, 17, 18, 0.8);
  color: var(--ink);
}
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; text-decoration: none; letter-spacing: -0.02em; }
.brand-mark { width: 24px; height: 24px; color: var(--ink); }
.nav-links { display: flex; align-items: center; gap: 28px; font-size: 14px; }
.nav-links a:not(.btn) { text-decoration: none; color: var(--mute); transition: color 0.2s; }
.nav-links a:not(.btn):hover { color: var(--ink); }
.nav::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -1px;
  height: 2px;
  width: 100%;
  background: var(--amber);
  transform-origin: 0 50%;
  transform: scaleX(var(--page-p, 0));
}

/* Hero */
.hero { position: relative; padding: 57px 0 0; overflow: hidden; }
.hero-inner { text-align: center; display: flex; flex-direction: column; align-items: center; padding: clamp(40px, 6vw, 72px) var(--gutter) clamp(72px, 9vw, 112px); }
.hero h1 { font-size: clamp(42px, 7vw, 92px); margin-bottom: 26px; max-width: 12em; }
.hero .lede { margin: 0 auto; }
.hero-cta { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 34px; }

/* The banner runs edge to edge under the nav; the headline follows it. */
.hero-art { position: relative; margin: 0; overflow: hidden; }
.art-frame::after {
  content: "";
  position: absolute; inset: auto 0 0 0; height: 22%;
  background: linear-gradient(to bottom, rgba(245, 242, 236, 0), var(--bg));
  pointer-events: none;
}
.art-frame {
  position: relative;
  /* Scroll eases the artwork in a little; JS writes --hero-p (0..1). */
  transform: scale(calc(1 + var(--hero-p, 0) * 0.05)) translateY(calc(var(--hero-p, 0) * 18px));
  transform-origin: 50% 30%;
  opacity: 0;
  animation: art-in 1.1s var(--ease) 0.2s forwards;
}
.art-frame img {
  display: block;
  width: 100%;
  height: auto;
  max-height: calc(100vh - 57px);
  object-fit: cover;
  /* White paper of the drawing takes on the page's paper colour. */
  mix-blend-mode: multiply;
  /* The wand's sweep: the picture is revealed left to right on load. */
  clip-path: inset(0 100% 0 0);
  animation: wipe 1.6s var(--ease) 0.4s forwards;
}
@keyframes art-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes wipe { to { clip-path: inset(0 0 0 0); } }

.console {
  position: absolute;
  z-index: 1;
  right: var(--gutter);
  bottom: clamp(20px, 4vw, 48px);
  list-style: none;
  margin: 0;
  padding: 12px 16px;
  min-width: 300px;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.85;
  color: #8f9391;
  background: #121517;
  border-radius: 10px;
  box-shadow: 0 20px 40px -18px rgba(0, 0, 0, 0.5);
  text-align: left;
}
.console li { opacity: 0; transform: translateX(-6px); animation: line-in 0.45s var(--ease) forwards; white-space: nowrap; }
.console li:nth-child(1) { animation-delay: 2.0s; }
.console li:nth-child(2) { animation-delay: 2.5s; }
.console li:nth-child(3) { animation-delay: 3.0s; }
.console li:nth-child(4) { animation-delay: 3.5s; }
.console .t { color: rgba(143, 147, 145, 0.55); }
.console .c { color: #ece9e2; }
.tag { display: inline-block; padding: 0 6px; margin: 0 2px; border-radius: 3px; font-size: 11px; line-height: 1.6; }
.tag-risk { background: rgba(255, 176, 0, 0.16); color: #ffb000; }
.tag-sim { background: rgba(90, 209, 199, 0.14); color: #5ad1c7; }
.tag-ok { background: rgba(127, 216, 138, 0.14); color: #7fd88a; }
@keyframes line-in { to { opacity: 1; transform: none; } }

/* Load-in stagger */
.load { opacity: 0; transform: translateY(22px); animation: rise 0.9s var(--ease) forwards; animation-delay: calc(var(--d, 0) * 0.1s + 0.05s); }
@keyframes rise { to { opacity: 1; transform: none; } }

/* Ticker */
.ticker { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); overflow: hidden; }
.ticker-track { display: flex; width: max-content; animation: ticker 40s linear infinite; }
.ticker-track span {
  padding: 15px 26px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mute);
  white-space: nowrap;
}
.ticker-track span::before { content: "◆"; color: var(--amber); margin-right: 26px; font-size: 8px; vertical-align: 2px; }
@keyframes ticker { to { transform: translateX(-50%); } }

/* Scrubbed sections: a tall track with a sticky stage; JS writes --p (0..1) and the active step */
.scrub { position: relative; height: 420vh; }
.scrub + .scrub { border-top: 1px solid var(--line); }
.pin { position: sticky; top: 0; height: 100vh; height: 100svh; display: flex; align-items: center; overflow: hidden; padding-top: 60px; }
.pin-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(32px, 6vw, 96px); align-items: center; }
.pin-copy h2 { font-size: clamp(34px, 4.4vw, 58px); margin-bottom: 40px; }
.dark .eyebrow { color: var(--amber); }

/* Steps share one grid cell, so the block is as tall as its longest step on any screen. */
.steps-text { position: relative; display: grid; min-height: 180px; }
.step-text {
  grid-area: 1 / 1;
  align-self: start;
  max-width: 30em;
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease);
  pointer-events: none;
}
.step-text.is-active { opacity: 1; transform: none; pointer-events: auto; }
.step-text h3 { font-size: 22px; letter-spacing: -0.02em; margin-bottom: 12px; }
.step-text p { color: var(--mute); }

/* Harness pipeline */
.pipeline { position: relative; display: grid; gap: 16px; padding-left: 34px; }
.pipe-rail { position: absolute; left: 8px; top: 18px; bottom: 18px; width: 2px; background: var(--line-2); }
.pipe-fill { position: absolute; inset: 0; background: var(--amber); transform-origin: 50% 0; transform: scaleY(var(--p, 0)); box-shadow: 0 0 18px var(--amber); }
.pipe-node {
  position: relative;
  display: grid;
  grid-template-columns: 34px 52px 1fr;
  align-items: center;
  gap: 8px;
  padding: 18px 20px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--mute);
  transition: border-color 0.4s, background 0.4s, color 0.4s, transform 0.5s var(--ease);
}
.pipe-node::before {
  content: "";
  position: absolute;
  left: -32px;
  top: 50%;
  width: 12px;
  height: 12px;
  margin-top: -6px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--line-2);
  transition: background 0.4s, border-color 0.4s, box-shadow 0.4s;
}
.pipe-node .n { color: rgba(143, 147, 145, 0.55); }
.pipe-node .k { text-transform: uppercase; letter-spacing: 0.08em; font-size: 11px; }
.pipe-node .v { color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pipe-node.is-done::before { background: var(--amber); border-color: var(--amber); }
.pipe-node.is-active { border-color: var(--amber); background: var(--bg-3); color: var(--amber); transform: translateX(10px); }
.pipe-node.is-active::before { background: var(--amber); border-color: var(--amber); box-shadow: 0 0 0 6px var(--amber-dim); }
.pipe-node[data-step="2"].is-active { border-color: var(--cyan); color: var(--cyan); }
.pipe-node[data-step="2"].is-active::before, .pipe-node[data-step="2"].is-done::before { background: var(--cyan); border-color: var(--cyan); box-shadow: 0 0 0 6px rgba(90, 209, 199, 0.16); }

/* Lab-in-the-loop ring */
.pin-grid-flip { grid-template-columns: 1fr 1.05fr; }
.ring-wrap { display: flex; justify-content: center; }
.ring { width: min(100%, 460px); height: auto; overflow: visible; }
.ring-track { fill: none; stroke: var(--line-2); stroke-width: 2; stroke-dasharray: 2 8; }
.ring-fill {
  fill: none;
  stroke: var(--amber);
  stroke-width: 2;
  stroke-dasharray: 1;
  stroke-dashoffset: calc(1 - var(--p, 0));
  transform: rotate(-90deg);
  transform-origin: 200px 200px;
}
.ring-dot { transform: rotate(calc(var(--p, 0) * 360deg)); transform-origin: 200px 200px; }
.ring-dot circle { fill: var(--amber); filter: drop-shadow(0 0 10px var(--amber)); }
.ring-labels text {
  font-family: var(--sans);
  font-size: 16px;
  font-weight: 500;
  fill: var(--mute);
  text-anchor: middle;
  dominant-baseline: middle;
  transition: fill 0.4s;
}
.ring-labels text.is-active { fill: var(--amber); }
.ring-labels text.is-done { fill: var(--ink); }
.ring-center { font-family: var(--serif); font-style: italic; font-size: 46px; fill: var(--ink); text-anchor: middle; }
.ring-center-sub { font-family: var(--mono); font-style: normal; font-size: 12px; letter-spacing: 0.18em; fill: var(--mute); text-transform: uppercase; }
/* Lab in the loop: which parts act in each step, and why it matters */
#loop .pin-copy h2 { margin-bottom: 14px; }
.loop-lead { margin: 0 0 16px; max-width: 34em; font-size: 15px; line-height: 1.5; color: var(--mute); }
.loop-lead b, #loop .step-text p b { font-weight: 600; color: var(--ink); }
.loop-parts { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 22px; padding: 0; list-style: none; }
.loop-parts li { padding: 4px 11px; border-radius: 999px; border: 1px solid var(--line-2); font-family: var(--mono); font-size: 11.5px; color: var(--mute); opacity: 0.45; transition: opacity 0.4s, color 0.4s, border-color 0.4s, background 0.4s; }
#loop[data-active="0"] .lp-o, #loop[data-active="0"] .lp-a,
#loop[data-active="1"] .lp-h, #loop[data-active="1"] .lp-o,
#loop[data-active="2"] .lp-s, #loop[data-active="2"] .lp-h,
#loop[data-active="3"] .lp-h, #loop[data-active="3"] .lp-a,
#loop[data-active="4"] .lp-h, #loop[data-active="4"] .lp-o, #loop[data-active="4"] .lp-a { opacity: 1; color: var(--amber); border-color: var(--amber); background: var(--amber-dim); }
#loop .steps-text { min-height: 240px; }
.loop-why { margin-top: 10px; font-size: 14.5px; line-height: 1.45; color: var(--ink) !important; }
.loop-vs { margin-top: 4px; color: var(--mute) !important; }
.loop-why span { display: inline-block; min-width: 52px; margin-right: 8px; padding: 1px 8px; border-radius: 999px; text-align: center; font-family: var(--mono); font-size: 11px; color: var(--amber); border: 1px solid currentColor; vertical-align: 1px; }
.loop-vs span { color: var(--mute); }
@media (max-width: 860px) {
  .loop-lead { display: none; }
  .loop-parts { margin-bottom: 12px; }
  .loop-parts li { font-size: 10.5px; padding: 3px 9px; }
  #loop .steps-text { min-height: 0; }
  #loop .step-text p { font-size: 13.5px; }
  #loop .ring { width: min(60vw, 240px); }
}
@media (max-height: 820px) { .loop-lead { display: none; } }
@media (prefers-reduced-motion: reduce) { .loop-parts li { opacity: 1; } }

/* Regular sections */
.section { padding: clamp(96px, 13vw, 168px) 0; }
.section + .section { border-top: 1px solid var(--line); }
.section-tight { padding-top: clamp(72px, 10vw, 120px); }
.section h2 { font-size: clamp(34px, 4.8vw, 62px); margin-bottom: 56px; }

.axes { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.axis {
  padding: clamp(28px, 4vw, 44px);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease);
}
.axis:hover { transform: translateY(-4px); box-shadow: 0 24px 48px -28px rgba(22, 24, 26, 0.35); }
.axis-k { font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--amber-ink); }
.axis h3 { font-size: clamp(26px, 3vw, 34px); margin: 14px 0 14px; }
.axis p { color: var(--mute); }
.axis ul { list-style: none; margin: 26px 0 0; padding: 0; border-top: 1px solid var(--line); }
.axis li { padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.axis li:last-child { border-bottom: 0; }
.axis li::before { content: "→"; color: var(--amber-ink); margin-right: 12px; font-family: var(--mono); }

.rules { list-style: none; margin: 0; padding: 0; counter-reset: rule; }
.rules li {
  counter-increment: rule;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 12px;
  padding: 24px 0;
  border-top: 1px solid var(--line);
  font-size: clamp(20px, 2.6vw, 32px);
  letter-spacing: -0.025em;
  line-height: 1.25;
}
.rules li:last-child { border-bottom: 1px solid var(--line); }
.rules li::before { content: "0" counter(rule); font-family: var(--mono); font-size: 12px; color: var(--amber-ink); width: 40px; }
.rules span { color: var(--mute); }
.rules strong { font-weight: 600; }

/* CTA */
.cta { position: relative; overflow: hidden; text-align: center; }
.cta::before {
  content: "";
  position: absolute;
  inset: auto -20% -70% -20%;
  height: 130%;
  background: radial-gradient(ellipse at 50% 100%, var(--amber-dim), transparent 60%);
  pointer-events: none;
}
.cta-inner { position: relative; display: flex; flex-direction: column; align-items: center; }
.cta .lede { margin: 0 auto; }

.footer { border-top: 1px solid var(--line); padding: 28px 0; font-size: 13px; color: var(--mute); }
.footer-inner { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.footer-line { font-family: var(--serif); font-style: italic; font-size: 18px; color: var(--ink); }
.footer a { text-decoration: none; }
.footer a:hover { color: var(--ink); }

/* Reveal on enter */
.reveal { opacity: 0; transform: translateY(32px); transition: opacity 0.9s var(--ease), transform 0.9s var(--ease); transition-delay: calc(var(--d, 0) * 0.1s); }
.reveal.in { opacity: 1; transform: none; }

/* 404 */
.notfound { min-height: 100vh; display: flex; align-items: center; }
.notfound h1 { font-size: clamp(42px, 8vw, 96px); margin-bottom: 20px; }

/* Narrow screens: stack the pinned stages, keep the scrub */
@media (max-width: 860px) {
  .nav-links a:not(.btn) { display: none; }
  .art-frame img { min-height: 260px; object-position: 50% 50%; }
  .console { position: relative; right: auto; bottom: auto; margin: 12px var(--gutter) 0; min-width: 0; }
  .art-frame::after { display: none; }
  .pin-grid, .pin-grid-flip { grid-template-columns: 1fr; gap: 28px; }
  .pin-copy h2 { margin-bottom: 20px; }
  .steps-text { min-height: 0; }
  .pipeline { gap: 8px; }
  .pipe-node { padding: 10px 14px; grid-template-columns: 28px 46px 1fr; font-size: 12px; }
  .pipe-node.is-active { transform: none; }
  .ring { width: min(72vw, 300px); }
  .pin-grid-flip .ring-wrap { order: 2; }
  .axes { grid-template-columns: 1fr; }
}

/* Reduced motion: no scrub, no pinning, everything visible */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .load, .console li, .reveal, .art-frame, .art-frame img { animation: none; opacity: 1; transform: none; transition: none; clip-path: none; }
  .ticker-track { animation: none; }
  .scrub { height: auto; --p: 1; }
  .pin { position: relative; height: auto; padding: 96px 0; }
  .steps-text { min-height: 0; display: grid; gap: 24px; }
  .step-text { grid-area: auto; opacity: 1; transform: none; }
}

/* ---- Numbers ---- */
.stats { border-bottom: 1px solid var(--line); }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); }
.stat { padding: 44px 24px 40px 0; border-right: 1px solid var(--line); }
.stat + .stat { padding-left: 24px; }
.stat:last-child { border-right: 0; }
.stat-n, .stat-plus { font-size: clamp(38px, 4.6vw, 60px); font-weight: 600; letter-spacing: -0.04em; line-height: 1; font-variant-numeric: tabular-nums; }
.stat-plus { color: var(--amber-ink); }
.stat p { margin-top: 12px; color: var(--mute); font-size: 15px; }

/* ---- Manifesto: words light with scroll ---- */
.manifesto { height: 260vh; }
.manifesto-text {
  font-size: clamp(30px, 4.6vw, 64px);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.12;
  max-width: 18em;
}
.manifesto-text .w { color: var(--line-2); transition: color 0.25s; }
.manifesto-text .w.lit { color: var(--ink); }

/* ---- Stack ---- */
.stack-section { height: 340vh; }
.stack { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.layer {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  grid-template-rows: auto auto;
  column-gap: 14px;
  align-items: center;
  padding: 16px 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  opacity: 0;
  transform: translateY(40px) scale(0.97);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease), background 0.5s, border-color 0.5s, color 0.5s, filter 0.5s;
}
.layer.in { opacity: 1; transform: none; }
.layer-k { grid-row: span 2; font-family: var(--mono); font-size: 13px; color: var(--mute); width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--line-2); display: grid; place-items: center; }
.layer-t { font-weight: 600; letter-spacing: -0.01em; }
.layer-s { grid-column: 2; font-size: 13.5px; color: var(--mute); }
.layer-b { grid-row: 1 / span 2; grid-column: 3; font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--mute); padding: 4px 8px; border-radius: 999px; border: 1px solid var(--line); }
.stack.focus .layer:not(.own) { opacity: 0.38; filter: grayscale(1); }
.stack.focus .layer.own { background: var(--ink); color: var(--bg); border-color: var(--ink); transform: translateX(-12px); }
.stack.focus .layer.own .layer-s { color: rgba(245, 242, 236, 0.65); }
.stack.focus .layer.own .layer-k { border-color: var(--amber); color: var(--amber); }
.stack.focus .layer.own .layer-b { background: var(--amber); border-color: var(--amber); color: #16181a; }
.stack-caption { margin-bottom: 28px; }
.stack-quote {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(22px, 2.4vw, 30px);
  line-height: 1.25;
  color: var(--amber-ink);
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}
.stack-section.focus .stack-quote { opacity: 1; transform: none; }

/* ---- Campaign ---- */
.campaign-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 6vw, 80px); align-items: center; }
.campaign h2 { margin-bottom: 28px; }
.checks { list-style: none; margin: 28px 0 0; padding: 0; }
.checks li { position: relative; padding: 8px 0 8px 30px; font-size: 15.5px; }
.checks li::before { content: ""; position: absolute; left: 0; top: 13px; width: 16px; height: 16px; border-radius: 50%; background: var(--amber-dim); box-shadow: inset 0 0 0 1px var(--amber); }
.checks li::after { content: ""; position: absolute; left: 5px; top: 17px; width: 6px; height: 4px; border-left: 1.6px solid var(--amber-ink); border-bottom: 1.6px solid var(--amber-ink); transform: rotate(-45deg); }
.code-card { margin: 0; background: #121517; color: #c9ccc9; border-radius: 14px; overflow: hidden; box-shadow: 0 30px 60px -30px rgba(22, 24, 26, 0.5); }
.code-card figcaption { display: flex; align-items: center; gap: 6px; padding: 12px 16px; border-bottom: 1px solid rgba(233, 230, 223, 0.08); }
.code-dot { width: 10px; height: 10px; border-radius: 50%; background: rgba(233, 230, 223, 0.15); }
.code-name { margin-left: 10px; font-family: var(--mono); font-size: 12px; color: #8f9391; }
.code-card pre { margin: 0; padding: 22px 24px; overflow-x: auto; font-family: var(--mono); font-size: 13.5px; line-height: 1.75; }
.code-card .s { color: #5ad1c7; }
.code-card .v { color: #ffcf70; }
.code-card .n { color: #ffb000; }
.code-card .k { color: #8f9391; }

/* ---- Horizontal scroll ---- */
.hscroll { position: relative; }
.hscroll .pin { flex-direction: column; align-items: stretch; justify-content: center; gap: 32px; }
.hscroll-head h2 { font-size: clamp(32px, 4.2vw, 56px); }
.hscroll-track {
  display: flex;
  gap: 20px;
  padding: 0 max(var(--gutter), calc((100vw - var(--wrap)) / 2 + var(--gutter)));
  width: max-content;
  transform: translateX(calc(var(--hx, 0) * -1px));
  will-change: transform;
}
.cap {
  position: relative;
  flex: 0 0 auto;
  width: clamp(280px, 30vw, 380px);
  min-height: 360px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--bg-2);
  transition: border-color 0.3s, transform 0.4s var(--ease);
}
.cap:hover { border-color: var(--amber); transform: translateY(-6px); }
.cap-art { width: 120px; height: 80px; margin-bottom: 28px; fill: none; stroke: var(--mute); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.cap-art .hot { fill: var(--amber); stroke: none; }
.cap-art .hot-ring, .cap-art .hot-line { stroke: var(--amber); }
.cap-art .pts circle { fill: var(--ink); stroke: none; }
.cap-n { position: absolute; top: 28px; right: 28px; font-family: var(--mono); font-size: 12px; color: var(--mute); }
.cap h3 { font-size: 22px; letter-spacing: -0.02em; margin-bottom: 12px; }
.cap p { color: var(--mute); font-size: 15.5px; }
.hscroll-bar span { display: block; height: 2px; background: var(--line-2); position: relative; overflow: hidden; }
.hscroll-bar span::after { content: ""; position: absolute; inset: 0; background: var(--amber); transform-origin: 0 50%; transform: scaleX(var(--p, 0)); }

/* ---- Use cases ---- */
.cases { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.case { padding: 28px 24px 32px; border-radius: 16px; background: #fff; border: 1px solid var(--line); position: relative; overflow: hidden; transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease), opacity 0.9s var(--ease); }
.case::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--amber); transform: scaleX(0); transform-origin: 0 50%; transition: transform 0.5s var(--ease); }
.case:hover { transform: translateY(-4px); box-shadow: 0 24px 48px -28px rgba(22, 24, 26, 0.35); }
.case:hover::before, .case.in::before { transform: scaleX(1); }
.case.in::before { transition-delay: calc(var(--d, 0) * 0.1s + 0.4s); }
.case-tag { font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--amber-ink); }
.case h3 { font-size: 22px; letter-spacing: -0.02em; margin: 14px 0 12px; }
.case p { color: var(--mute); font-size: 15px; }

.works-note { margin-top: 18px; text-align: center; font-size: 12px; color: var(--mute); }

/* ---- Comparison ---- */
.table { border-top: 1px solid var(--line-2); }
.tr { display: grid; grid-template-columns: 1fr 1.2fr 1.4fr; gap: 24px; padding: 20px 0; border-bottom: 1px solid var(--line); align-items: baseline; }
.tr > span:first-child { font-weight: 600; }
.tr > span:nth-child(2) { color: var(--mute); }
.tr > span:nth-child(3) { position: relative; padding-left: 26px; }
.tr:not(.th) > span:nth-child(3)::before { content: "→"; position: absolute; left: 0; color: var(--amber-ink); font-family: var(--mono); }
.th { font-family: var(--mono); font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--mute); padding: 14px 0; }
.th > span:nth-child(3) { color: var(--amber-ink); }
.table .tr.reveal { transform: translateX(-24px); }
.table .tr.reveal.in { transform: none; }

/* ---- Oversight ---- */
.oversight-grid { display: grid; grid-template-columns: 1fr 1.1fr; gap: clamp(32px, 6vw, 96px); }
.oversight h2 { margin-bottom: 0; }
.oversight .checks li::after { border-color: var(--amber); }
.fine { margin-top: 28px; font-size: 13.5px; color: var(--mute); padding-left: 14px; border-left: 2px solid var(--line-2); }

/* ---- FAQ ---- */
.faq-grid { display: grid; grid-template-columns: 0.8fr 1.2fr; gap: clamp(32px, 6vw, 96px); align-items: start; }
.faq details { border-bottom: 1px solid var(--line); }
.faq details:first-child { border-top: 1px solid var(--line); }
.faq summary { list-style: none; cursor: pointer; padding: 22px 40px 22px 0; position: relative; font-size: 19px; font-weight: 500; letter-spacing: -0.015em; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 4px; top: 18px; font-size: 24px; font-weight: 300; color: var(--amber-ink); transition: transform 0.3s var(--ease); }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { color: var(--mute); padding: 0 40px 24px 0; animation: rise 0.4s var(--ease); }
.faq summary:focus-visible { outline: 2px solid var(--cyan); outline-offset: 4px; }

@media (max-width: 1000px) {
  .cases { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .stat { padding: 28px 12px 26px 0; border-bottom: 1px solid var(--line); }
  .stat + .stat { padding-left: 12px; }
  .stat:nth-child(2n) { border-right: 0; }
  .stat:nth-child(2n+1) { padding-left: 0; }
  .manifesto { height: 200vh; }
  .stack-section { height: 300vh; }
  .stack-section .pin-copy h2 { margin-bottom: 14px; }
  .stack-caption { display: none; }
  .layer { padding: 10px 14px; }
  .layer-s { font-size: 12.5px; }
  .stack.focus .layer.own { transform: none; }
  .stack-quote { font-size: 20px; }
  .campaign-grid, .oversight-grid, .faq-grid { grid-template-columns: 1fr; }
  .cases { grid-template-columns: 1fr; }
  .tr { grid-template-columns: 1fr; gap: 6px; }
  .th { display: none; }
  .tr > span:nth-child(2)::before { content: "Copilot: "; font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; }
  /* The horizontal scroller becomes a plain stacked list. */
  .hscroll { height: auto !important; }
  .hscroll .pin { position: relative; height: auto; padding: 96px 0; }
  .hscroll-track { flex-direction: column; width: auto; transform: none; padding: 0 var(--gutter); }
  .cap { width: auto; min-height: 0; }
  .hscroll-bar { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .manifesto { height: auto; }
  .manifesto-text .w { color: var(--ink); }
  .stack-section { height: auto; }
  .layer { opacity: 1; transform: none; transition: none; }
  .stack-quote { opacity: 1; transform: none; }
  .hscroll { height: auto !important; }
  .hscroll .pin { position: relative; height: auto; padding: 96px 0; }
  .hscroll-track { flex-wrap: wrap; width: auto; transform: none; }
  .hscroll-bar { display: none; }
}

/* Items keyed to a scrub step: shown once their step is reached. */
.mini-log li, .term-lines li, .hub-tile, .hub-core, .hot-spot, .algo-steps li { transition: opacity 0.5s var(--ease), transform 0.5s var(--ease), color 0.4s, background 0.4s, border-color 0.4s; }

/* ---- XZT case study ---- */
.case-study { height: 460vh; border-top: 1px solid var(--line); }
.xzt-grid { grid-template-columns: 0.9fr 1.1fr; }
.case-study .steps-text { min-height: 170px; }
.mini-log {
  list-style: none;
  margin: 28px 0 0;
  padding: 14px 16px;
  border-radius: 10px;
  background: #121517;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.9;
  color: #8f9391;
  min-height: 132px;
}
.mini-log .c { color: #ece9e2; }
.mini-log li { opacity: 0; transform: translateX(-8px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-log li.is-active, .mini-log li.is-done { opacity: 1; transform: none; }
.mini-log li.is-done { opacity: 0.55; }

.xzt-media { margin: 0; }
.xzt-zoom {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  background: #1a1410;
  box-shadow: 0 40px 80px -40px rgba(22, 24, 26, 0.55);
}
/* The picture and its hotspots zoom as one layer; labels counter-scale to stay readable. */
.xzt-stage { position: relative; transform-origin: 50% 50%; transition: transform 0.9s var(--ease), transform-origin 0.9s var(--ease); }
.xzt-stage img { width: 100%; }
.hot-spot > * { transition: transform 0.9s var(--ease); transform-origin: 7px 50%; }
.case-study[data-active="1"] .xzt-stage { transform-origin: 44% 36%; transform: scale(1.55); }
.case-study[data-active="1"] .hot-spot > * { transform: scale(0.645); }
.case-study[data-active="2"] .xzt-stage { transform-origin: 40% 56%; transform: scale(1.45); }
.case-study[data-active="2"] .hot-spot > * { transform: scale(0.69); }
.case-study[data-active="3"] .xzt-stage { transform-origin: 50% 50%; transform: scale(1.15); }
.case-study[data-active="3"] .hot-spot > * { transform: scale(0.87); }
.xzt-media figcaption { margin-top: 12px; font-family: var(--mono); font-size: 11.5px; color: var(--mute); }
.hot-spot {
  position: absolute;
  left: var(--x);
  top: var(--y);
  display: flex;
  align-items: center;
  gap: 8px;
  opacity: 0;
  transform: translate(-7px, -7px) scale(0.8);
  pointer-events: none;
}
.hot-spot i { width: 14px; height: 14px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 0 0 rgba(255, 176, 0, 0.6); animation: ping 1.8s ease-out infinite; flex: none; }
.hot-spot b { font: 500 12px/1 var(--mono); color: #16181a; background: rgba(245, 242, 236, 0.92); padding: 6px 8px; border-radius: 6px; white-space: nowrap; }
.hot-spot.is-active, .hot-spot.is-done { opacity: 1; transform: translate(-7px, -7px); }
.hot-spot.left { flex-direction: row-reverse; transform: translate(calc(-100% + 7px), -7px) scale(0.8); }
.hot-spot.left.is-active, .hot-spot.left.is-done { transform: translate(calc(-100% + 7px), -7px); }
.hot-spot.left > * { transform-origin: calc(100% - 7px) 50%; }
.hot-spot.is-done i { animation: none; background: rgba(255, 176, 0, 0.7); }
.hot-spot.is-done b { opacity: 0.7; }
@keyframes ping { 0% { box-shadow: 0 0 0 0 rgba(255, 176, 0, 0.6); } 100% { box-shadow: 0 0 0 16px rgba(255, 176, 0, 0); } }

/* ---- Robot examples ---- */
.examples-lede { margin: -28px 0 48px; }
.ex-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
.ex-art .stream { stroke: #1f9e94; stroke-width: 2.4; stroke-dasharray: 4 3; animation: flow 0.8s linear infinite; }
.ex-art .drop { fill: #1f9e94; stroke: none; }
.ex-art .water { stroke: none; fill: rgba(31, 158, 148, 0.35); }
.ex-art .fold { stroke: var(--amber-ink); stroke-width: 1; opacity: 0.6; }
@keyframes flow { to { stroke-dashoffset: -14; } }
.ex { padding: 24px; border-radius: 16px; background: #fff; border: 1px solid var(--line); transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease), opacity 0.9s var(--ease); }
.ex:hover { transform: translateY(-4px); box-shadow: 0 24px 48px -28px rgba(22, 24, 26, 0.35); }
/* Line art by default; the simulator render fades in over it on hover or focus. */
.ex { outline: none; }
.ex:focus-visible { box-shadow: 0 0 0 2px var(--amber-ink); }
.ex-media { position: relative; aspect-ratio: 16 / 10; margin-bottom: 18px; border-radius: 10px; overflow: hidden; background: var(--bg); }
.ex-media::after {
  content: "render";
  position: absolute; right: 8px; bottom: 8px;
  padding: 2px 7px; border-radius: 999px;
  font-family: var(--mono); font-size: 11px; color: var(--mute);
  background: rgba(255, 255, 255, 0.8); border: 1px solid var(--line);
  transition: opacity 0.3s var(--ease);
}
.ex-media .ex-img {
  position: absolute; inset: 0; width: 100%; height: 100%; margin: 0;
  object-fit: cover; opacity: 0; transform: scale(1.04);
  transition: opacity 0.45s var(--ease), transform 0.8s var(--ease);
}
.ex:hover .ex-img, .ex:focus-within .ex-img { opacity: 1; transform: none; }
.ex:hover .ex-media::after, .ex:focus-within .ex-media::after { opacity: 0; }
.ex-art .belt, .ex-art .pallet, .ex-art .vessel { stroke: var(--ink); }
.ex-art .pallet { stroke: var(--line-2); }
.ex-art .cloth { stroke-width: 1.4; }
.ex-art {
  width: 100%;
  height: 100%;
  padding: 10px;
  border-radius: 10px;
  background: var(--bg);
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.ex-art .desk, .ex-art .axis { stroke: var(--line-2); }
.ex-art .joint { fill: var(--bg); }
.ex-art .wells circle { stroke-width: 1.2; }
.ex-art .beam { stroke: none; fill: rgba(31, 158, 148, 0.16); }
.ex-art .hot { stroke: var(--amber-ink); fill: var(--amber-dim); }
.ex-art .arc { stroke: var(--line-2); }
/* Arms swing in when the card is revealed. */
.ex .ex-art .arm { stroke-dasharray: 240; stroke-dashoffset: 240; transition: stroke-dashoffset 1.4s var(--ease) 0.3s; }
.ex.in .ex-art .arm { stroke-dashoffset: 0; }
.ex .ex-art .curve { stroke-dasharray: 120; stroke-dashoffset: 120; transition: stroke-dashoffset 1.6s var(--ease) 0.6s; }
.ex.in .ex-art .curve { stroke-dashoffset: 0; }
.ex-tag { font-family: var(--mono); font-size: 11px; color: var(--amber-ink); letter-spacing: 0.06em; }
.ex h3 { font-size: 20px; letter-spacing: -0.02em; margin: 8px 0 10px; }
.ex p { color: var(--mute); font-size: 15px; }

/* ---- Extensibility hub ---- */
.extend { height: 440vh; }
.hub { position: relative; aspect-ratio: 1; width: min(100%, 480px); margin: 0 auto; }
.hub-wires { position: absolute; inset: 0; width: 100%; height: 100%; }
.hub-wires path { fill: none; stroke: var(--amber); stroke-width: 1.5; stroke-dasharray: 200; stroke-dashoffset: 200; transition: stroke-dashoffset 0.8s var(--ease); }
.hub-wires path.is-active, .hub-wires path.is-done { stroke-dashoffset: 0; }
.hub-core, .hub-tile {
  position: absolute;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px;
  border-radius: 14px;
  border: 1px solid var(--line-2);
  background: var(--bg-2);
}
.hub-core {
  left: 50%; top: 50%;
  width: 46%;
  transform: translate(-50%, -50%) scale(0.9);
  text-align: center;
  align-items: center;
  opacity: 0.35;
  border-color: var(--amber);
  box-shadow: 0 0 0 8px var(--amber-dim);
}
.hub-core.is-active, .hub-core.is-done { opacity: 1; transform: translate(-50%, -50%); }
.hub-core b { font-size: 13px; font-weight: 500; }
.hub-k { font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--amber); }
.hub-tile { width: 40%; opacity: 0; }
.hub-tile b { font-size: 18px; letter-spacing: -0.02em; }
.hub-tile small { font-size: 12px; color: var(--mute); line-height: 1.4; }
.hub-tile.t1 { left: 0; top: 0; transform: translate(-40px, -40px); }
.hub-tile.t2 { right: 0; top: 0; transform: translate(40px, -40px); }
.hub-tile.t3 { left: 0; bottom: 0; transform: translate(-40px, 40px); }
.hub-tile.t4 { right: 0; bottom: 0; transform: translate(40px, 40px); }
.hub-tile.is-active, .hub-tile.is-done { opacity: 1; transform: none; }
.hub-tile.is-active { border-color: var(--amber); }
.hub-tile.yours { border-style: dashed; }
.hub-tile.yours.is-active { background: var(--amber); color: #16181a; border-style: solid; }
.hub-tile.yours.is-active .hub-k, .hub-tile.yours.is-active small { color: #16181a; }

/* ---- Algorithm lifecycle ---- */
.algo { height: 460vh; border-top: 1px solid var(--line); }
.algo-steps { list-style: none; display: flex; gap: 6px; margin: -16px 0 28px; padding: 0; flex-wrap: wrap; }
.algo-steps li { font-size: 13px; padding: 6px 12px 6px 8px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--mute); }
.algo-steps li span { font-family: var(--mono); font-size: 11px; margin-right: 6px; opacity: 0.6; }
.algo-steps li.is-done { color: var(--ink); border-color: var(--ink); }
.algo-steps li.is-active { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.algo .steps-text { min-height: 190px; }
.term { margin: 0; background: #121517; border-radius: 14px; overflow: hidden; box-shadow: 0 40px 80px -40px rgba(22, 24, 26, 0.55); }
.term figcaption { display: flex; align-items: center; gap: 6px; padding: 12px 16px; border-bottom: 1px solid rgba(233, 230, 223, 0.08); }
.term-lines { list-style: none; margin: 0; padding: 18px 20px 22px; font-family: var(--mono); font-size: 12.5px; line-height: 2; color: #c9ccc9; min-height: 340px; }
.term-lines li { opacity: 0; transform: translateY(6px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.term-lines li.is-active, .term-lines li.is-done { opacity: 1; transform: none; }
.term-lines li.is-done { opacity: 0.5; }
.term-lines .p { color: #ffb000; margin-right: 6px; }
.term-lines .v { color: #ffcf70; }
.term-lines .m { color: #5ad1c7; }

@media (max-width: 1000px) {
  .ex-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) {
  .case-study, .extend, .algo { height: 420vh; }
  .xzt-grid { grid-template-columns: 1fr; gap: 16px; }
  .case-study .pin-copy h2, .algo .pin-copy h2, .extend .pin-copy h2 { font-size: 28px; margin-bottom: 14px; }
  .case-study .steps-text, .algo .steps-text, .extend .steps-text { min-height: 0; }
  .case-study .step-text p, .algo .step-text p, .extend .step-text p { font-size: 14.5px; }
  .mini-log { display: none; }
  .xzt-media figcaption { display: none; }
  /* On a phone only the current hotspot keeps its label, and each label opens toward the middle. */
  .hot-spot b { font-size: 11px; padding: 5px 7px; }
  .hot-spot.is-done b { display: none; }
  .hot-spot[data-step="0"] { flex-direction: row-reverse; }
  .hot-spot[data-step="0"].is-active, .hot-spot[data-step="0"].is-done { transform: translate(calc(-100% + 7px), -7px); }
  .hot-spot[data-step="0"] > * { transform-origin: calc(100% - 7px) 50%; }
  .hot-spot.left[data-step="3"] { flex-direction: row; }
  .hot-spot.left[data-step="3"].is-active, .hot-spot.left[data-step="3"].is-done { transform: translate(-7px, -7px); }
  .hot-spot.left[data-step="3"] > * { transform-origin: 7px 50%; }
  .ex-grid { grid-template-columns: 1fr; }
  .hub { width: min(100%, 340px); }
  .hub-tile { padding: 10px; }
  .hub-tile b { font-size: 14px; }
  .hub-tile small { display: none; }
  .hub-core { padding: 10px; }
  .hub-core b { font-size: 11px; }
  .algo-steps { margin: 0 0 14px; }
  .term-lines { min-height: 0; font-size: 11px; padding: 12px 14px; }
  .term-lines li:not(.is-active):not(.is-done) { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .case-study, .extend, .algo { height: auto; }
  .mini-log li, .term-lines li, .hub-tile, .hot-spot, .hub-core { opacity: 1; transform: none; }
  .hub-core { transform: translate(-50%, -50%); }
  .hub-wires path { stroke-dashoffset: 0; }
  .ex .ex-art .arm, .ex .ex-art .curve { stroke-dashoffset: 0; transition: none; }
  .hot-spot i { animation: none; }
  .ex-art .stream { animation: none; }
}

/* ---- Development loop: ontology ---- */
.onto { height: 460vh; }
.onto-grid { grid-template-columns: 0.85fr 1.15fr; }
.onto .steps-text { min-height: 200px; }
.onto-visual { display: grid; gap: 14px; }
.onto-graph { width: 100%; height: auto; overflow: visible; }
.onto-graph text { font-family: var(--mono); font-size: 11px; fill: var(--mute); }
.onto-graph .nt { font-family: var(--sans); font-size: 14px; font-weight: 600; fill: var(--ink); }
.onto-graph .node rect { fill: var(--bg-2); stroke: var(--line-2); stroke-width: 1.2; }
.onto-graph .cap rect { stroke: var(--cyan); }
.onto-graph .act rect { stroke: var(--amber); fill: var(--bg-3); }
.onto-graph .rule rect { stroke: #ff6b5e; stroke-dasharray: 4 3; }
.onto-graph .rule .nt { fill: #ff8a7f; }
.onto-graph .edge path { fill: none; stroke: var(--amber); stroke-width: 1.3; stroke-dasharray: 260; stroke-dashoffset: 260; transition: stroke-dashoffset 0.9s var(--ease); }
.onto-graph .edge text { font-size: 10px; text-anchor: middle; opacity: 0; transition: opacity 0.5s 0.4s; }
.onto-graph .node { opacity: 0; transform: translateY(10px); transform-box: fill-box; transition: opacity 0.5s var(--ease), transform 0.5s var(--ease); }
.onto-graph .node.is-active, .onto-graph .node.is-done { opacity: 1; transform: none; }
.onto-graph .edge.is-active path, .onto-graph .edge.is-done path { stroke-dashoffset: 0; }
.onto-graph .edge.is-active text, .onto-graph .edge.is-done text { opacity: 1; }
.plan {
  list-style: none;
  margin: 0;
  padding: 14px 16px;
  min-height: 196px;
  border-radius: 12px;
  background: #0a0c0d;
  border: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.95;
  color: #c9ccc9;
}
.plan li { opacity: 0; transform: translateX(-8px); transition: opacity 0.4s var(--ease), transform 0.4s var(--ease); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.plan li:nth-child(2) { transition-delay: 0.08s; } .plan li:nth-child(3) { transition-delay: 0.16s; }
.plan li:nth-child(4) { transition-delay: 0.24s; } .plan li:nth-child(5) { transition-delay: 0.4s; }
.plan li.is-active, .plan li.is-done { opacity: 1; transform: none; }
.plan em { font-style: normal; color: #8f9391; margin-left: 8px; }
.plan .plan-h { color: #8f9391; }
.plan .ok { color: #7fd88a; margin-right: 6px; }
.plan .no { color: #ff6b5e; margin-right: 6px; }
.plan .fx { color: #ffb000; margin-right: 6px; }
.plan .refused { color: #ff8a7f; }
.plan .refused.is-active { background: rgba(255, 107, 94, 0.1); margin: 0 -8px; padding: 0 8px; border-radius: 4px; }
.plan .refused.is-done { text-decoration: line-through; text-decoration-color: rgba(255, 107, 94, 0.6); opacity: 0.6; }
.plan .replan { color: #ece9e2; }
.plan .fact { color: #ffcf70; }

/* ---- Two loops ---- */
.loops-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.loop-card { padding: 30px; border-radius: 16px; background: #fff; border: 1px solid var(--line); transition: opacity 0.9s var(--ease), transform 0.9s var(--ease); }
.loop-k { font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--amber-ink); }
.loop-flow { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 4px; margin: 18px 0 18px; padding: 0; }
.loop-flow li { font-size: 13.5px; padding: 6px 12px; border-radius: 999px; background: var(--bg); border: 1px solid var(--line); opacity: 0; transform: scale(0.9); transition: opacity 0.4s var(--ease), transform 0.4s var(--ease), background 0.4s; }
.loop-flow li:not(:last-child)::after { content: "→"; margin-left: 10px; color: var(--amber-ink); font-family: var(--mono); }
.loop-card.in .loop-flow li { opacity: 1; transform: none; }
.loop-card.in .loop-flow li:last-child { background: var(--amber-dim); border-color: var(--amber); }
.loop-flow li:nth-child(1) { transition-delay: 0.3s; } .loop-flow li:nth-child(2) { transition-delay: 0.38s; }
.loop-flow li:nth-child(3) { transition-delay: 0.46s; } .loop-flow li:nth-child(4) { transition-delay: 0.54s; }
.loop-flow li:nth-child(5) { transition-delay: 0.62s; } .loop-flow li:nth-child(6) { transition-delay: 0.7s; }
.loop-flow li:nth-child(7) { transition-delay: 0.78s; } .loop-flow li:nth-child(8) { transition-delay: 0.86s; }
.loop-card p { color: var(--mute); font-size: 15.5px; }
.proof { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 40px; border-top: 1px solid var(--line-2); }
.proof-item { padding: 28px 24px 8px 0; }
.proof-item + .proof-item { padding-left: 24px; border-left: 1px solid var(--line); }
.proof-item b { display: block; font-size: clamp(34px, 4vw, 52px); font-weight: 600; letter-spacing: -0.04em; line-height: 1; margin-bottom: 12px; }
.proof-item b small { font-size: 0.45em; color: var(--mute); font-weight: 500; letter-spacing: -0.01em; }
.proof-item span { color: var(--mute); font-size: 14.5px; }
.proof-note { text-align: left; margin-top: 24px; }

@media (max-width: 860px) {
  .onto { height: 440vh; }
  .onto-grid { grid-template-columns: 1fr; gap: 14px; }
  .onto .pin-copy h2 { font-size: 28px; margin-bottom: 14px; }
  .onto .steps-text { min-height: 0; }
  .onto .step-text p { font-size: 14px; }
  .plan { display: none; }
  .loops-grid, .proof { grid-template-columns: 1fr; }
  .proof-item + .proof-item { padding-left: 0; border-left: 0; border-top: 1px solid var(--line); }
}
@media (prefers-reduced-motion: reduce) {
  .onto { height: auto; }
  .onto-graph .node, .onto-graph .edge text, .plan li, .loop-flow li { opacity: 1; transform: none; transition: none; }
  .onto-graph .edge path { stroke-dashoffset: 0; transition: none; }
}

/* ---- Use-case icons ---- */
.case-ico { display: block; width: 56px; height: 56px; margin-bottom: 18px; fill: none; stroke: var(--ink); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.case-ico .hot { stroke: var(--amber-ink); fill: var(--amber-dim); }
.case-ico .beam { stroke: none; fill: rgba(31, 158, 148, 0.18); }
.case { transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease), opacity 0.9s var(--ease); }
.case.in .case-ico { animation: pop 0.6s var(--ease) both; animation-delay: calc(var(--d, 0) * 0.1s + 0.2s); }
@keyframes pop { from { transform: scale(0.6) rotate(-8deg); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---- Approval card ---- */
.oversight-lede { margin: 24px 0 0; }
.approve {
  margin: 0;
  padding: 22px;
  border-radius: 16px;
  background: var(--bg-2);
  border: 1px solid var(--line-2);
  box-shadow: 0 40px 80px -40px rgba(0, 0, 0, 0.6);
}
.approve-h { display: flex; justify-content: space-between; align-items: center; font-family: var(--mono); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--amber); }
.approve-t { margin: 14px 0 16px; font-size: 20px; font-weight: 600; letter-spacing: -0.02em; }
.approve-l { list-style: none; margin: 0 0 20px; padding: 0; font-family: var(--mono); font-size: 12.5px; color: var(--mute); }
.approve-l li { padding: 8px 0; border-top: 1px solid var(--line); }
.tag-plain { background: rgba(233, 230, 223, 0.08); color: var(--ink); }
.approve-b { display: flex; gap: 10px; }
.ab { flex: 1; text-align: center; padding: 12px; border-radius: 10px; font-weight: 500; font-size: 15px; border: 1px solid var(--line-2); }
.ab-yes { background: var(--amber); border-color: var(--amber); color: #16181a; position: relative; overflow: hidden; }
/* The hold-to-approve fill runs once when the card is revealed. */
.ab-yes::before { content: ""; position: absolute; inset: 0; background: rgba(255, 255, 255, 0.35); transform: scaleX(0); transform-origin: 0 50%; }
.approve.in .ab-yes::before { animation: hold 1.6s var(--ease) 0.8s forwards; }
@keyframes hold { 60% { transform: scaleX(1); opacity: 1; } 100% { transform: scaleX(1); opacity: 0; } }
.approve-f { margin-top: 14px; font-family: var(--mono); font-size: 12px; color: var(--green); opacity: 0; transition: opacity 0.5s 2.3s; }
.dark .approve-f { color: #7fd88a; }
.approve.in .approve-f { opacity: 1; }

/* ---- Principles as inequalities ---- */
.neq { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.neq li {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 24px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid var(--line);
  font-size: clamp(22px, 2.2vw, 30px);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.1;
}
.neq li span:first-child { color: var(--mute); }
.neq b { font-family: var(--serif); font-weight: 400; font-size: 1.5em; line-height: 0.9; color: var(--amber-ink); }

@media (max-width: 860px) {
  .neq { grid-template-columns: 1fr 1fr; }
  .approve-t { font-size: 17px; }
}
@media (prefers-reduced-motion: reduce) {
  .case.in .case-ico { animation: none; }
  .approve-f { opacity: 1; transition: none; }
  .approve.in .ab-yes::before { animation: none; }
}

/* ---- How development runs ---- */
.bf { display: grid; grid-template-columns: 1.05fr 56px 1fr 56px 1.15fr 56px 1fr; align-items: center; }
.bf-src { display: grid; gap: 10px; }
.bf-box { padding: 18px 20px; border-radius: 14px; background: #fff; border: 1px solid var(--line); }
.bf-box b { display: block; font-size: clamp(22px, 2.2vw, 30px); letter-spacing: -0.03em; line-height: 1.1; margin: 4px 0 6px; }
.bf-box small { display: block; color: var(--mute); font-size: 13px; }
.bf-k { font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--amber-ink); }
.bf-src .bf-box b { font-size: clamp(26px, 2.6vw, 36px); }
.bf-agent { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.bf-agent .bf-k { color: var(--amber); }
.bf-agent small { color: rgba(245, 242, 236, 0.6); }
.bf-harness ol { list-style: none; margin: 10px 0 0; padding: 0; counter-reset: h; }
.bf-harness li { counter-increment: h; position: relative; padding: 7px 0 7px 30px; font-size: 14.5px; border-top: 1px solid var(--line); }
.bf-harness li::before {
  content: counter(h); position: absolute; left: 0; top: 7px;
  width: 20px; height: 20px; border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--mono); font-size: 11px; color: var(--cyan); border: 1px solid var(--cyan);
}
.bf-harness.in li { animation: bf-tick 4.8s var(--ease) infinite; }
.bf-harness li:nth-child(2) { animation-delay: 1.2s; }
.bf-harness li:nth-child(3) { animation-delay: 2.4s; }
.bf-harness li:nth-child(4) { animation-delay: 3.6s; }
@keyframes bf-tick { 0%, 22% { background: var(--amber-dim); } 30%, 100% { background: transparent; } }
.bf-proof { border-color: var(--amber); background: var(--amber-dim); }
/* A wire is a dashed line with a packet running along it. */
.bf-wire { position: relative; height: 2px; margin: 0 6px; background: repeating-linear-gradient(90deg, var(--line-2) 0 6px, transparent 6px 11px); }
.bf-wire::after { content: ""; position: absolute; right: -2px; top: -4px; border: 5px solid transparent; border-left: 7px solid var(--line-2); border-right: 0; }
.bf-wire i { position: absolute; top: -3px; left: 0; width: 8px; height: 8px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 0 4px var(--amber-dim); opacity: 0; }
.bf-wire.in i { animation: bf-run 1.8s linear infinite; }
@keyframes bf-run { 0% { left: 0; opacity: 0; } 15% { opacity: 1; } 85% { opacity: 1; } 100% { left: calc(100% - 8px); opacity: 0; } }
@keyframes bf-run-v { 0% { top: 0; opacity: 0; } 15% { opacity: 1; } 85% { opacity: 1; } 100% { top: calc(100% - 8px); opacity: 0; } }
.bf-back { margin: 28px 0 0; text-align: right; font-family: var(--serif); font-style: italic; font-size: clamp(20px, 2vw, 26px); color: var(--amber-ink); }
.bf-points { list-style: none; margin: 56px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.bf-points li { padding-top: 16px; border-top: 2px solid var(--ink); color: var(--mute); font-size: 15.5px; }
.bf-points b { color: var(--ink); }

/* ---- Cluster mode ---- */
@media (max-width: 1000px) {
  .bf { grid-template-columns: 1fr; gap: 0; }
  .bf-src { grid-template-columns: repeat(3, 1fr); }
  .bf-wire { width: 2px; height: 40px; margin: 6px auto; background: repeating-linear-gradient(180deg, var(--line-2) 0 6px, transparent 6px 11px); }
  .bf-wire::after { right: -4px; top: auto; bottom: -2px; border: 5px solid transparent; border-top: 7px solid var(--line-2); border-bottom: 0; }
  .bf-wire i { left: -3px; }
  .bf-wire.in i { animation-name: bf-run-v; }
  .bf-back { text-align: center; }
}
@media (max-width: 860px) {
  .bf-src { grid-template-columns: 1fr; }
  .bf-points { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .bf-harness.in li, .bf-wire.in i { animation: none; }
}

/* ---- Concepts: harness and ontology up front ---- */
.cc-lede { margin: -28px 0 48px; }
.cc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.cc-card { padding: clamp(24px, 3vw, 36px); border-radius: 18px; border: 1px solid var(--line); background: #fff; }
.cc-harness { background: #16181a; color: #ece9e2; border-color: #16181a; }
.cc-card.cc-harness p { color: #b4b7b5; }
.cc-k { font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--amber-ink); }
.cc-harness .cc-k { color: #ffb000; }
.cc-onto .cc-k { color: var(--cyan); }
.cc-card h3 { font-size: clamp(24px, 2.4vw, 32px); letter-spacing: -0.03em; margin: 12px 0 14px; }
.cc-card p { color: var(--mute); font-size: 15.5px; margin: 0 0 16px; }
.cc-parts { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 20px; padding: 0; }
.cc-parts li { font-family: var(--mono); font-size: 12px; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line-2); }
.cc-harness .cc-parts li { border-color: rgba(255, 176, 0, 0.4); color: #ffcf66; }
.cc-onto .cc-parts li { border-color: rgba(31, 158, 148, 0.45); color: var(--cyan); }
.cc-card.in .cc-parts li { animation: cc-pop 0.5s var(--ease) both; }
.cc-parts li:nth-child(2) { animation-delay: 0.1s !important; } .cc-parts li:nth-child(3) { animation-delay: 0.2s !important; }
.cc-parts li:nth-child(4) { animation-delay: 0.3s !important; } .cc-parts li:nth-child(5) { animation-delay: 0.4s !important; }
@keyframes cc-pop { from { opacity: 0; transform: scale(0.85); } to { opacity: 1; transform: none; } }
.cc-card .cc-q { margin: 0; padding-top: 16px; border-top: 1px solid var(--line); font-size: 15px; }
.cc-harness .cc-q { border-color: rgba(233, 230, 223, 0.12); }
.cc-q b { color: var(--ink); font-family: var(--serif); font-style: italic; font-weight: 400; font-size: 1.35em; }
.cc-harness .cc-q b { color: #ece9e2; }
.cc-card .cc-v { margin: 10px 0 0; font-size: 15px; font-weight: 500; color: var(--ink); }
.cc-harness .cc-v { color: #ffcf66; }
.cc-onto .cc-v { color: #177a72; }

.cc-flow { position: relative; display: flex; flex-wrap: wrap; align-items: stretch; gap: 8px; margin: 40px 0 0; padding: 22px 22px 46px; border-radius: 18px; background: var(--bg-2); }
.cc-step { position: relative; display: flex; flex-direction: column; justify-content: center; padding: 10px 16px; border-radius: 10px; background: #fff; border: 1px solid var(--line); font-weight: 600; font-size: 15px; }
.cc-step small { font-family: var(--mono); font-size: 11px; font-weight: 400; color: var(--mute); }
.cc-step:not(:nth-last-child(2))::after { content: "→"; position: absolute; right: -14px; top: 50%; transform: translateY(-50%); color: var(--mute); font-family: var(--mono); font-size: 13px; z-index: 1; }
.cc-step { flex: 1 1 auto; margin-right: 12px; }
.cc-o { border-color: var(--cyan); box-shadow: inset 4px 0 0 var(--cyan); }
.cc-h { border-color: var(--amber); box-shadow: inset 4px 0 0 var(--amber); }
.cc-back { position: absolute; left: 22px; right: 22px; bottom: 14px; font-family: var(--serif); font-style: italic; font-size: 17px; color: #177a72; }
.cc-back::before { content: "↺ "; font-style: normal; }

.cc-case { margin-top: 16px; padding: clamp(22px, 3vw, 32px); border-radius: 18px; border: 1px solid var(--line-2); }
.cc-case-h { margin: 0 0 18px; font-size: clamp(18px, 1.8vw, 22px); font-weight: 600; letter-spacing: -0.02em; }
.cc-case-h .cc-k { display: block; margin-bottom: 6px; font-weight: 400; letter-spacing: 0.1em; }
.cc-case-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.cc-row { display: grid; grid-template-columns: 32px 1fr; gap: 12px; padding: 16px; border-radius: 12px; }
.cc-row b { display: block; margin-bottom: 4px; }
.cc-row span { color: var(--mute); font-size: 14.5px; }
.cc-row code { font-family: var(--mono); font-size: 12.5px; color: var(--ink); }
.cc-mark { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 14px; font-weight: 700; color: #fff; }
.cc-bad { background: rgba(214, 69, 55, 0.07); }
.cc-bad .cc-mark { background: #d64537; }
.cc-good { background: rgba(31, 158, 148, 0.09); }
.cc-good .cc-mark { background: var(--cyan); }

.cc-next { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; margin-top: 32px; font-size: 15px; }
.cc-next span { color: var(--mute); }
.cc-next a { text-decoration: none; font-weight: 600; border-bottom: 1px solid var(--amber); }
.cc-next a:hover { color: var(--amber-ink); }

/* Ontology detail: what it saves, beside the plan */
.onto-vs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; font-family: var(--mono); font-size: 12px; }
.onto-vs span { padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line-2); color: var(--mute); }
.onto-vs b { display: block; font-weight: 500; text-transform: uppercase; letter-spacing: 0.1em; font-size: 10.5px; margin-bottom: 2px; }
.onto-vs span:first-child b { color: #ff8a7f; }
.onto-vs span:last-child { border-color: var(--cyan); }
.onto-vs span:last-child b { color: var(--cyan); }

@media (max-width: 860px) {
  .cc-grid, .cc-case-grid { grid-template-columns: 1fr; }
  .onto-vs { font-size: 11px; gap: 8px; }
  .onto-vs span { padding: 8px 10px; }
  .cc-flow { flex-direction: column; }
  .cc-step { margin-right: 0; margin-bottom: 10px; }
  .cc-step:not(:nth-last-child(2))::after { content: "↓"; right: auto; left: 50%; top: auto; bottom: -17px; transform: translateX(-50%); }
}
@media (prefers-reduced-motion: reduce) {
  .cc-card.in .cc-parts li { animation: none; }
}

/* ---- A session, end to end: one Studio window walks through six steps ---- */
.dev { height: 560vh; }
.dev .pin { padding-top: 72px; }
.dev-wrap { width: 100%; }
.dev-head { display: grid; grid-template-columns: 1fr 1.15fr; gap: clamp(24px, 4vw, 64px); align-items: end; margin-bottom: 22px; }
.dev-head h2 { font-size: clamp(32px, 3.6vw, 50px); margin: 0; }
.dev-side .steps-text { min-height: 112px; }
.dev-side .step-text h3 { font-size: 19px; margin-bottom: 6px; }
.dev-side .step-text p { font-size: 15px; }

.dev-phases { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 16px; padding: 0; }
.dev-phases li { display: flex; align-items: center; gap: 8px; padding: 6px 14px 6px 6px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--mute); font-size: 13px; transition: color 0.4s, background 0.4s, border-color 0.4s; }
.dev-phases li span { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-family: var(--mono); font-size: 11px; background: rgba(233, 230, 223, 0.08); }
.dev-phases small { font-family: var(--mono); font-size: 11px; color: #5ad1c7; margin-left: 4px; }
.dev[data-active="0"] .ph1, .dev[data-active="1"] .ph2,
.dev[data-active="2"] .ph3, .dev[data-active="3"] .ph3, .dev[data-active="4"] .ph3,
.dev[data-active="5"] .ph4 { background: var(--amber); border-color: var(--amber); color: #16181a; }
.dev[data-active="0"] .ph1 span, .dev[data-active="1"] .ph2 span, .dev[data-active="5"] .ph4 span,
.dev[data-active="2"] .ph3 span, .dev[data-active="3"] .ph3 span, .dev[data-active="4"] .ph3 span { background: rgba(22, 24, 26, 0.15); }
.dev[data-active="2"] .ph3 small, .dev[data-active="3"] .ph3 small, .dev[data-active="4"] .ph3 small { color: #16181a; }
.dev:not([data-active="0"]) .ph1, .dev[data-active="2"] .ph2, .dev[data-active="3"] .ph2,
.dev[data-active="4"] .ph2, .dev[data-active="5"] .ph2, .dev[data-active="5"] .ph3 { color: var(--ink); border-color: var(--ink); }

/* The window */
.dev-win { margin: 0; background: #121517; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; box-shadow: 0 40px 80px -40px rgba(0, 0, 0, 0.7); }
.dev-win figcaption { display: flex; align-items: center; gap: 6px; padding: 11px 16px; border-bottom: 1px solid var(--line); }
.dev-target { margin-left: auto; font-family: var(--mono); font-size: 11px; }
.dev-target em { font-style: normal; padding: 2px 8px; border-radius: 4px; }
.dev-target .t-sim { background: rgba(90, 209, 199, 0.14); color: #5ad1c7; }
.dev-target .t-real { display: none; background: rgba(255, 176, 0, 0.18); color: #ffb000; }
.dev[data-active="5"] .t-sim { display: none; }
.dev[data-active="5"] .t-real { display: inline; animation: dev-in 0.5s var(--ease) both; }
.dev-body { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); height: min(48vh, 430px); min-height: 330px; }

/* Chat column: newest at the bottom, older lines scroll out of the top */
.dev-chat { list-style: none; margin: 0; padding: 14px 16px; display: flex; flex-direction: column; justify-content: flex-end; gap: 8px; overflow: hidden; border-right: 1px solid var(--line); font-size: 13px; line-height: 1.45; color: #c9ccc9; }
.dev-chat li { display: none; padding: 7px 10px; border-radius: 8px; background: rgba(233, 230, 223, 0.04); flex-shrink: 0; }
.dev-chat li.is-active, .dev-chat li.is-done { display: block; }
.dev-chat li.is-active { animation: dev-in 0.45s var(--ease) both; }
.dev-chat li.is-done { opacity: 0.5; }
.dev-chat b { display: block; font-family: var(--mono); font-size: 10.5px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 2px; color: #8f9391; }
.dev-chat .c-you { background: rgba(233, 230, 223, 0.09); color: var(--ink); }
.dev-chat .c-ai b { color: #ffcf70; }
.dev-chat .c-onto { box-shadow: inset 3px 0 0 #5ad1c7; font-family: var(--mono); font-size: 12px; }
.dev-chat .c-onto b { color: #5ad1c7; }
.dev-chat .c-gate { box-shadow: inset 3px 0 0 #ffb000; font-family: var(--mono); font-size: 12px; }
.dev-chat .c-gate b { color: #ffb000; }
.dev-chat .c-sys { font-family: var(--mono); font-size: 12px; }
@keyframes dev-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* View column: one view per phase */
.dev-view { position: relative; overflow: hidden; }
.dv { position: absolute; inset: 0; padding: 18px; opacity: 0; visibility: hidden; transform: translateY(10px); transition: opacity 0.45s var(--ease), transform 0.45s var(--ease), visibility 0s 0.45s; }
.dev[data-active="0"] .dv-attach, .dev[data-active="1"] .dv-goal,
.dev[data-active="2"] .dv-dev, .dev[data-active="3"] .dv-dev, .dev[data-active="4"] .dv-dev,
.dev[data-active="5"] .dv-deploy { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
.dv .bf-k, .dd-k { font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: #8f9391; }
.dv-h { margin: 0 0 10px; font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: #8f9391; }

.dv-attach { display: grid; grid-template-columns: 1fr 70px 1.4fr; align-items: center; }
.dv-agent, .dv-studio { padding: 16px; border-radius: 12px; border: 1px solid var(--line-2); background: rgba(233, 230, 223, 0.03); }
.dv-agent b { display: block; margin: 6px 0 2px; font-size: 17px; }
.dv-agent small { color: #8f9391; font-size: 12px; }
.dv-studio { border-color: rgba(255, 176, 0, 0.5); }
.dv-studio ul { list-style: none; margin: 8px 0 12px; padding: 0; font-size: 13.5px; color: #c9ccc9; }
.dv-studio li { padding: 3px 0; }
.dv-studio li b { color: var(--ink); font-size: 15px; margin-right: 4px; }
.dv-role { margin: 6px 0 0; font-family: var(--mono); font-size: 11.5px; color: #c9ccc9; }
.dv-role span { display: inline-block; min-width: 72px; margin-right: 6px; padding: 1px 6px; border-radius: 4px; }
.dv-role .h { background: rgba(255, 176, 0, 0.16); color: #ffb000; }
.dv-role .o { background: rgba(90, 209, 199, 0.14); color: #5ad1c7; }
.dv-link { position: relative; height: 40px; display: grid; place-items: center; }
.dv-link i { position: absolute; left: 6px; right: 6px; top: 50%; height: 2px; background: repeating-linear-gradient(90deg, #ffb000 0 6px, transparent 6px 12px); background-size: 12px 2px; animation: dv-flow 0.8s linear infinite; }
.dv-link span { position: relative; padding: 2px 6px; border-radius: 4px; background: #121517; font-family: var(--mono); font-size: 11px; color: #ffb000; }
@keyframes dv-flow { to { background-position: 12px 0; } }

.dv-targets { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 0 0 22px; padding: 0; }
.dv-targets li { padding: 14px; border-radius: 12px; border: 1px solid var(--line-2); }
.dv-targets span { display: block; font-size: 12.5px; color: #8f9391; }
.dv-targets b { display: block; margin: 4px 0 2px; font-size: clamp(20px, 2vw, 28px); letter-spacing: -0.02em; color: #ffcf70; }
.dv-targets small { font-family: var(--mono); font-size: 11px; color: #8f9391; }
.dv-facts { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; }
.dv-facts li { padding: 4px 10px; border-radius: 999px; border: 1px solid rgba(90, 209, 199, 0.45); color: #5ad1c7; font-family: var(--mono); font-size: 12px; }
.dev[data-active="1"] .dv-targets li, .dev[data-active="1"] .dv-facts li { animation: dev-in 0.5s var(--ease) both; }
.dv-targets li:nth-child(2), .dv-facts li:nth-child(2) { animation-delay: 0.08s !important; }
.dv-targets li:nth-child(3), .dv-facts li:nth-child(3) { animation-delay: 0.16s !important; }
.dv-facts li:nth-child(4) { animation-delay: 0.24s !important; }
.dv-facts li:nth-child(5) { animation-delay: 0.32s !important; }

/* Develop and test: twin, sequence and results fill in turn */
.dv-dev { display: grid; grid-template-columns: 1.45fr 1fr; grid-template-rows: 1.35fr 1fr; gap: 10px; }
.dp { position: relative; border-radius: 10px; border: 1px solid var(--line-2); overflow: hidden; opacity: 0.22; transition: opacity 0.45s, border-color 0.45s; }
.dp.is-active, .dp.is-done { opacity: 1; }
.dp.is-active { border-color: #ffb000; }
.dp-sim { grid-column: 1; grid-row: 1; background: #e9e6df; }
.dp-sim img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dp-sim svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.dp-path { fill: none; stroke: #ffb000; stroke-width: 5; stroke-linecap: round; stroke-dasharray: 10 9; stroke-dashoffset: 400; }
.dp-sim.is-active .dp-path { animation: dp-path 2.4s linear infinite; }
@keyframes dp-path { to { stroke-dashoffset: 0; } }
.dp-badge { position: absolute; left: 10px; top: 10px; padding: 2px 8px; border-radius: 4px; background: #1f9e94; color: #fff; font-family: var(--mono); font-size: 11px; }
.dp-ev { position: absolute; right: 10px; padding: 3px 8px; border-radius: 4px; font-family: var(--mono); font-size: 11px; background: rgba(18, 21, 23, 0.85); opacity: 0; }
.dp-ev1 { bottom: 38px; color: #5ad1c7; }
.dp-ev2 { bottom: 10px; color: #7fd88a; }
.dp-sim.is-active .dp-ev, .dp-sim.is-done .dp-ev { animation: dev-in 0.5s var(--ease) both; }
.dp-sim.is-active .dp-ev1 { animation-delay: 0.5s; }
.dp-sim.is-active .dp-ev2 { animation-delay: 1.1s; }
.dp-seq { grid-column: 2; grid-row: 1 / 3; padding: 14px; }
.dp-seq ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; counter-reset: seq; }
.dp-seq li { position: relative; padding: 7px 10px 7px 30px; border-radius: 7px; border: 1px solid var(--line-2); font-family: var(--mono); font-size: 12px; color: var(--ink); counter-increment: seq; }
.dp-seq li::before { content: counter(seq); position: absolute; left: 10px; color: #8f9391; }
.dp-seq li:not(:last-child)::after { content: ""; position: absolute; left: 14px; bottom: -8px; width: 1px; height: 8px; background: var(--line-2); }
.dp-seq li.new { border-style: dashed; border-color: #ffb000; color: #ffcf70; }
.dp-seq li em { display: block; font-style: normal; font-size: 10.5px; color: #ffb000; }
.dp-seq.is-active li { animation: dev-in 0.4s var(--ease) both; }
.dp-seq li:nth-child(2) { animation-delay: 0.08s !important; } .dp-seq li:nth-child(3) { animation-delay: 0.16s !important; }
.dp-seq li:nth-child(4) { animation-delay: 0.24s !important; } .dp-seq li:nth-child(5) { animation-delay: 0.32s !important; }
.dp-seq li:nth-child(6) { animation-delay: 0.5s !important; }
.dp-res { grid-column: 1; grid-row: 2; padding: 12px 14px; display: grid; align-content: center; gap: 8px; }
.dp-res .dv-h { margin-bottom: 2px; }
.bar { display: grid; grid-template-columns: 58px 1fr 92px; align-items: center; gap: 10px; font-size: 12px; color: #8f9391; }
.bar b { font-family: var(--mono); font-size: 11.5px; font-weight: 400; color: var(--ink); text-align: right; white-space: nowrap; }
.bar i { position: relative; height: 8px; border-radius: 4px; background: rgba(233, 230, 223, 0.06); }
.bar s, .bar u { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 4px; transform-origin: 0 50%; }
.bar s { width: calc(var(--a) * 100%); background: rgba(233, 230, 223, 0.16); }
.bar u { width: calc(var(--b) * 100%); background: #ffb000; transform: scaleX(0); transition: transform 1s var(--ease) 0.2s; }
.bar.ok u { background: #7fd88a; }
.bar q { position: absolute; top: -4px; bottom: -4px; left: calc(var(--t) * 100%); width: 2px; background: #5ad1c7; }
.dp-res.is-active u, .dp-res.is-done u { transform: none; }

/* Deploy */
.dv-deploy { display: grid; grid-template-columns: repeat(3, 1fr); align-content: center; gap: 28px; }
.dd { position: relative; padding: 18px 16px; border-radius: 12px; border: 1px solid var(--line-2); }
.dd b { display: block; margin: 6px 0 4px; font-size: 20px; }
.dd small { color: #8f9391; font-family: var(--mono); font-size: 11.5px; }
.dd:not(:nth-child(3))::after { content: "→"; position: absolute; right: -21px; top: 50%; transform: translateY(-50%); color: #8f9391; font-family: var(--mono); }
.dd:first-child .dd-k { color: #5ad1c7; }
.dd-person .dd-k { color: #ffcf70; }
.dd-real { border-color: #ffb000; background: rgba(255, 176, 0, 0.08); }
.dd-real .dd-k { color: #ffb000; }
.dd-note { grid-column: 1 / -1; margin: 0; color: #8f9391; font-size: 14px; }
.dev[data-active="5"] .dd { animation: dev-in 0.5s var(--ease) both; }
.dev[data-active="5"] .dd:nth-child(2) { animation-delay: 0.25s; }
.dev[data-active="5"] .dd:nth-child(3) { animation-delay: 0.5s; }
.dev[data-active="5"] .dd-real { animation: dev-in 0.5s var(--ease) 0.5s both, dd-glow 2.4s ease-in-out 1s infinite; }
@keyframes dd-glow { 50% { box-shadow: 0 0 0 6px rgba(255, 176, 0, 0.12); } }

@media (max-width: 860px) {
  .dev { height: 520vh; }
  .dev .pin { padding-top: 64px; }
  .dev-head { grid-template-columns: 1fr; gap: 10px; margin-bottom: 12px; }
  .dev-head h2 { font-size: 26px; }
  .dev-head .eyebrow { margin-bottom: 8px; }
  .dev-phases { margin-bottom: 10px; gap: 4px; }
  .dev-phases li { font-size: 11.5px; padding: 4px 10px 4px 4px; gap: 6px; }
  .dev-phases li span { width: 18px; height: 18px; }
  .dev-phases small { display: none; }
  .dev-side .steps-text { min-height: 0; }
  .dev-side .step-text h3 { font-size: 16px; margin-bottom: 4px; }
  .dev-side .step-text p { font-size: 13.5px; line-height: 1.45; }
  .dev-win figcaption { padding: 9px 12px; }
  .dev-win .code-name { font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
  .dev-body { grid-template-columns: 1fr; grid-template-rows: auto 1fr; height: auto; min-height: 0; }
  .dev-chat { border-right: 0; border-bottom: 1px solid var(--line); padding: 10px 12px; font-size: 12px; }
  .dev-chat { max-height: 112px; }
  .dev-win .code-name { display: none; }
  .dev-view { height: 250px; }
  .dd-note { display: none; }
  .dv { padding: 12px; }
  .dv-attach { grid-template-columns: 1fr; grid-template-rows: auto 28px auto; }
  .dv-agent, .dv-studio { padding: 10px 12px; }
  .dv-agent b { font-size: 15px; margin: 2px 0 0; }
  .dv-agent small { display: none; }
  .dv-studio ul { margin: 4px 0 6px; font-size: 12px; }
  .dv-studio li:nth-child(n+2) { display: none; }
  .dv-studio li { padding: 1px 0; }
  .dv-studio li b { font-size: 13px; }
  .dv-role { font-size: 10.5px; margin-top: 3px; }
  .dv-link { height: 28px; }
  .dv-link i { left: 50%; right: auto; top: 0; bottom: 0; width: 2px; height: auto; background: repeating-linear-gradient(180deg, #ffb000 0 6px, transparent 6px 12px); }
  .dv-targets { gap: 6px; margin-bottom: 14px; }
  .dv-targets li { padding: 10px 8px; }
  .dv-targets span { font-size: 11px; }
  .dv-targets b { font-size: 18px; }
  .dv-facts li { font-size: 11px; padding: 3px 8px; }
  .dv-dev { display: block; }
  .dp, .dp.is-done { position: absolute; inset: 12px; opacity: 0; visibility: hidden; }
  .dp.is-active { opacity: 1; visibility: visible; }
  .dp-seq ol { gap: 6px; grid-template-columns: 1fr 1fr; }
  .dv-targets small { display: none; }
  .dv-targets b { margin-bottom: 0; }
  .dp-seq li { padding: 5px 10px 5px 30px; font-size: 11.5px; }
  .dp-seq li:not(:last-child)::after { display: none; }
  .dp-res { align-content: center; gap: 14px; }
  .bar { grid-template-columns: 52px 1fr 84px; font-size: 11px; }
  .dv-deploy { grid-template-columns: 1fr; gap: 14px; align-content: start; }
  .dd { padding: 8px 12px; display: grid; grid-template-columns: 64px 1fr; column-gap: 8px; }
  .dd b { margin: 0; font-size: 15px; }
  .dd small { grid-column: 2; }
  .dd-k { grid-row: 1 / 3; align-self: center; }
  .dd:not(:nth-child(3))::after { content: "↓"; right: auto; left: 50%; top: auto; bottom: -15px; transform: translateX(-50%); }
  .dd-note { font-size: 12.5px; }
}

@media (prefers-reduced-motion: reduce) {
  .dev { height: auto; }
  .dev-chat { justify-content: flex-start; overflow: visible; }
  .dev-chat li { display: block; opacity: 1; animation: none; }
  .dev-body { height: auto; grid-template-columns: 1fr; }
  .dev-view { display: grid; gap: 12px; padding: 12px; }
  .dv, .dp { position: relative; inset: auto; opacity: 1; visibility: visible; transform: none; transition: none; }
  .dv-dev { min-height: 420px; }
  .dp-sim .dp-path { animation: none; stroke-dashoffset: 0; }
  .dp-ev { opacity: 1; }
  .bar u { transform: none; }
  .dev-target .t-real { display: inline; margin-left: 4px; }
  .dv-link i { animation: none; }
}

/* ---- Algorithm case: the fit view changes with each step ---- */
.algo { height: 640vh; }
.algo .pin { flex-direction: column; justify-content: center; }
.algo .pin-copy h2 { margin-bottom: 14px; }
.algo-case { margin: 0 0 26px; font-family: var(--serif); font-style: italic; font-size: clamp(18px, 1.7vw, 22px); color: var(--amber-ink); }
.algo-steps { margin: 0 0 22px; }
.algo .steps-text { min-height: 200px; }
.algo-lead { margin: -14px 0 20px; max-width: 46ch; font-size: 15px; line-height: 1.5; color: var(--mute); }
.algo-lead b, .algo .step-text p b { font-weight: 600; color: var(--ink); }
.algo .step-text p.step-gain { margin-top: 10px; font-size: 14.5px; color: var(--ink); }
@media (max-height: 820px) { .algo-lead { display: none; } }
.step-gain span { display: inline-block; margin-right: 8px; padding: 1px 8px; border-radius: 999px; font-family: var(--mono); font-size: 11px; color: var(--amber-ink); border: 1px solid currentColor; vertical-align: 1px; }
.algo-note { width: 100%; max-width: var(--wrap); margin: 14px auto 0; padding: 0 var(--gutter); font-size: 12px; color: var(--mute); }
.algo-fig { margin: 0; background: #121517; border-radius: 14px; overflow: hidden; box-shadow: 0 40px 80px -40px rgba(22, 24, 26, 0.55); color: #c9ccc9; }
.algo-fig figcaption { display: flex; align-items: center; gap: 6px; padding: 11px 16px; border-bottom: 1px solid rgba(233, 230, 223, 0.08); }
.algo-ver { margin-left: auto; font-family: var(--mono); font-size: 11px; }
.algo-ver em { display: none; font-style: normal; padding: 2px 8px; border-radius: 4px; }
.algo-ver .v0 { background: rgba(233, 230, 223, 0.08); color: #c9ccc9; }
.algo-ver .v1 { background: rgba(90, 209, 199, 0.14); color: #5ad1c7; }
.algo-ver .v2 { background: rgba(255, 176, 0, 0.18); color: #ffb000; }
.algo[data-active="0"] .v0, .algo[data-active="1"] .v0 { display: inline; }
.algo[data-active="2"] .v1, .algo[data-active="3"] .v1, .algo[data-active="4"] .v1 { display: inline; }
.algo[data-active="5"] .v2 { display: inline; }
.algo-ver .v3 { background: rgba(127, 216, 138, 0.14); color: #7fd88a; }
.algo[data-active="6"] .v3 { display: inline; }

.fit-wrap { position: relative; padding: 6px 12px 0; }
.fit-svg { display: block; width: 100%; height: auto; max-height: 34vh; }
.fit-grid path { stroke: rgba(233, 230, 223, 0.07); stroke-width: 1; fill: none; }
.fit-pts .pt { fill: #c9ccc9; transition: fill 0.5s, opacity 0.5s; }
.fit-pts .out { fill: #ff8a7f; }
.fit-sector { fill: rgba(255, 176, 0, 0.1); stroke: #ffb000; stroke-dasharray: 4 4; opacity: 0; transition: opacity 0.5s; }
.fit-old { fill: none; stroke: #ff6b5e; stroke-width: 2; stroke-dasharray: 6 5; transition: opacity 0.6s; }
.fit-old-c path { stroke: #ff6b5e; stroke-width: 2; transition: opacity 0.6s; }
.fit-new { fill: none; stroke: #ffb000; stroke-width: 2.5; stroke-dasharray: 600; stroke-dashoffset: 600; transition: stroke-dashoffset 1.2s var(--ease); }
.fit-new-c path { stroke: #ffb000; stroke-width: 2.5; opacity: 0; transition: opacity 0.4s 0.8s; }
.fit-rounds circle { fill: none; stroke: #5ad1c7; stroke-width: 1.5; opacity: 0; transition: transform 0.8s var(--ease), opacity 0.6s; transform-origin: 200px 128px; }
.algo[data-active="1"] .fit-sector, .algo[data-active="2"] .fit-sector { opacity: 1; }
.algo[data-active="3"] .fit-new, .algo[data-active="4"] .fit-new, .algo[data-active="5"] .fit-new, .algo[data-active="6"] .fit-new { stroke-dashoffset: 0; }
.algo[data-active="3"] .fit-new-c path, .algo[data-active="4"] .fit-new-c path, .algo[data-active="5"] .fit-new-c path, .algo[data-active="6"] .fit-new-c path { opacity: 1; }
.algo[data-active="3"] .fit-old, .algo[data-active="3"] .fit-old-c path,
.algo[data-active="4"] .fit-old, .algo[data-active="4"] .fit-old-c path,
.algo[data-active="5"] .fit-old, .algo[data-active="5"] .fit-old-c path,
.algo[data-active="6"] .fit-old, .algo[data-active="6"] .fit-old-c path { opacity: 0.18; }
.algo[data-active="3"] .out, .algo[data-active="4"] .out, .algo[data-active="5"] .out, .algo[data-active="6"] .out { opacity: 0.25; }
/* Rounds 1-4 start apart and settle on the same circle. */
.algo[data-active="4"] .fit-rounds circle { animation: fit-conv 1.6s var(--ease) both; }
.algo[data-active="4"] .fit-rounds circle:nth-child(2) { --s: 1.14; animation-delay: 0.15s; }
.algo[data-active="4"] .fit-rounds circle:nth-child(3) { --s: 1.22; animation-delay: 0.3s; }
@keyframes fit-conv { from { opacity: 0.9; transform: scale(var(--s, 1.07)); } to { opacity: 0.55; transform: scale(1); } }

.fit-tag { position: absolute; padding: 3px 8px; border-radius: 4px; background: rgba(18, 21, 23, 0.9); font-family: var(--mono); font-size: 11px; opacity: 0; transform: translateY(6px); transition: opacity 0.4s, transform 0.4s var(--ease); pointer-events: none; }
.fit-tag-old { left: 14px; top: 12px; color: #ff8a7f; border: 1px solid rgba(255, 107, 94, 0.4); }
.fit-tag-sector { right: 14px; bottom: 10px; color: #ffcf70; border: 1px solid rgba(255, 176, 0, 0.4); }
.fit-tag-new { left: 14px; top: 12px; color: #ffb000; border: 1px solid rgba(255, 176, 0, 0.5); }
.fit-tag-rounds { right: 14px; top: 12px; color: #5ad1c7; border: 1px solid rgba(90, 209, 199, 0.4); }
.algo[data-active="0"] .fit-tag-old, .algo[data-active="1"] .fit-tag-old, .algo[data-active="2"] .fit-tag-old,
.algo[data-active="1"] .fit-tag-sector, .algo[data-active="2"] .fit-tag-sector,
.algo[data-active="3"] .fit-tag-new, .algo[data-active="4"] .fit-tag-new, .algo[data-active="5"] .fit-tag-new, .algo[data-active="6"] .fit-tag-new,
.algo[data-active="4"] .fit-tag-rounds { opacity: 1; transform: none; }

.fit-metrics { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid rgba(233, 230, 223, 0.08); border-bottom: 1px solid rgba(233, 230, 223, 0.08); }
.fit-metrics div { padding: 10px 14px; }
.fit-metrics div + div { border-left: 1px solid rgba(233, 230, 223, 0.08); }
.fit-metrics span { display: block; font-size: 11.5px; color: #8f9391; }
.fit-metrics b { display: block; font-family: var(--mono); font-size: 15px; font-weight: 500; color: #ece9e2; }
.fit-metrics i { font-style: normal; }
.fit-metrics .a { display: none; color: #ffcf70; }
.fit-metrics .a.r { color: #7fd88a; }
.algo[data-active="3"] .fit-metrics div:not(:last-child) .b, .algo[data-active="4"] .fit-metrics .b, .algo[data-active="5"] .fit-metrics .b, .algo[data-active="6"] .fit-metrics .b { display: none; }
.algo[data-active="3"] .fit-metrics div:not(:last-child) .a, .algo[data-active="4"] .fit-metrics .a, .algo[data-active="5"] .fit-metrics .a, .algo[data-active="6"] .fit-metrics .a { display: inline; animation: dev-in 0.5s var(--ease) both; }

.algo-log { min-height: 0; height: 128px; display: flex; flex-direction: column; justify-content: flex-end; overflow: hidden; padding: 10px 16px 12px; line-height: 1.85; font-size: 12px; }
.algo-log li { display: none; flex-shrink: 0; }
.algo-log li.is-active, .algo-log li.is-done { display: block; }
.algo-log li.ol .p { color: #5ad1c7; }
.algo-log li.ol { color: #b9dcd8; }
.tag-no { background: rgba(255, 107, 94, 0.14); color: #ff8a7f; }

/* The harness ontology's trace, one node per step: lit as the step is reached. */
.onto-trace { padding: 10px 16px 12px; border-bottom: 1px solid rgba(233, 230, 223, 0.08); }
.ot-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 8px; font-family: var(--mono); font-size: 11px; }
.ot-k { color: #5ad1c7; text-transform: none; }
.ot-sub { color: #8f9391; }
.ot-track { position: relative; }
.ot-rail { position: absolute; left: calc(100% / 14); right: calc(100% / 14); top: 5px; height: 2px; background: rgba(233, 230, 223, 0.1); }
.ot-fill { height: 100%; width: 0; background: #5ad1c7; transition: width 0.6s var(--ease); }
.algo[data-active="1"] .ot-fill { width: 16.667%; }
.algo[data-active="2"] .ot-fill { width: 33.333%; }
.algo[data-active="3"] .ot-fill { width: 50%; }
.algo[data-active="4"] .ot-fill { width: 66.667%; }
.algo[data-active="5"] .ot-fill { width: 83.333%; }
.algo[data-active="6"] .ot-fill { width: 100%; }
.ot-nodes { position: relative; list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(7, 1fr); }
.ot-nodes li { display: flex; flex-direction: column; align-items: center; gap: 6px; font-family: var(--mono); font-size: 10.5px; letter-spacing: -0.03em; white-space: nowrap; color: #8f9391; transition: color 0.4s; }
.ot-nodes i { width: 12px; height: 12px; border-radius: 50%; background: #121517; border: 2px solid rgba(233, 230, 223, 0.25); transition: background 0.4s, border-color 0.4s, box-shadow 0.4s; }
.ot-nodes b { font-weight: 500; }
.ot-nodes li.is-done { color: #c9ccc9; }
.ot-nodes li.is-done i { background: #5ad1c7; border-color: #5ad1c7; }
.ot-nodes li.is-active { color: #ece9e2; }
.ot-nodes li.is-active i { background: #ffb000; border-color: #ffb000; box-shadow: 0 0 0 4px rgba(255, 176, 0, 0.18); }
.ot-says { position: relative; min-height: 58px; margin-top: 10px; }
.ot-says p { display: none; margin: 0; font-size: 12.5px; line-height: 1.5; color: #c9ccc9; }
.ot-says p b { display: none; }
.ot-says p.is-active { display: block; animation: dev-in 0.5s var(--ease) both; }

@media (max-width: 860px) {
  .algo { height: 600vh; }
  .algo .pin-copy h2 { font-size: 24px; margin-bottom: 6px; }
  .algo-case { margin-bottom: 10px; font-size: 14px; }
  .algo-lead, .algo-case { display: none; }
  /* A phone shows one screen per step: the paragraph already names what the harness and the
     ontology do, so the gain line and the trace caption give way. */
  .algo .step-text p.step-gain, .ot-says { display: none; }
  .algo-steps li span { display: none; }
  .algo-steps li { padding: 4px 10px !important; }
  .algo-steps { margin-bottom: 10px; }
  .fit-tag { font-size: 10px; padding: 2px 6px; }
  .fit-tag-rounds { top: 36px; }
  .algo .steps-text { min-height: 0; }
  .algo-steps li { font-size: 11.5px; padding: 4px 10px 4px 6px; }
  .algo .step-text p { font-size: 13px; line-height: 1.4; }
  .algo .step-text h3 { font-size: 16px; margin-bottom: 4px; }
  .fit-svg { max-height: 104px; }
  .algo .pin-grid { gap: 14px; }
  .fit-metrics b { font-size: 12.5px; }
  .fit-metrics span { font-size: 10.5px; }
  .fit-metrics div { padding: 8px 10px; }
  .algo-log { display: none; }
  .ot-sub { display: none; }
  .ot-nodes b { display: none; }
  .ot-says { min-height: 0; margin-top: 8px; }
  .ot-says p { font-size: 11.5px; }
  .ot-says p b { display: inline; margin-right: 6px; color: #ffb000; font-weight: 500; }
  .algo-note { font-size: 11px; margin-top: 8px; }
  .algo-fig figcaption .code-name { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .algo { height: auto; }
  .fit-new { stroke-dashoffset: 0; }
  .fit-new-c path { opacity: 1; }
  .fit-metrics .b { display: none; }
  .fit-metrics .a { display: inline; }
  .algo-log { height: auto; }
  .algo-log li { display: block; }
  .algo-ver .v3 { display: inline; }
  .ot-fill { width: 100%; transition: none; }
  .ot-nodes li i { background: #5ad1c7; border-color: #5ad1c7; }
  .ot-says p { display: block; margin-bottom: 6px; animation: none; }
  .ot-says p b { display: inline; margin-right: 6px; color: #5ad1c7; font-weight: 500; }
}

/* ---- Cluster mode: N devices x M PCs, a failed PC swapped while the line runs ---- */
.clu { height: 500vh; }
.clu .pin { flex-direction: column; justify-content: center; }
.clu-grid { grid-template-columns: 0.9fr 1.1fr; }
.clu .pin-copy h2 { margin-bottom: 22px; }
.clu-steps li.is-done { color: var(--ink); border-color: var(--ink); }
.clu-steps li.is-active { background: var(--amber); color: #16181a; border-color: var(--amber); }
.clu .steps-text { min-height: 170px; }

.clu-vis { padding: 18px; border-radius: 16px; background: var(--bg-2); border: 1px solid var(--line); }
.clu-lab { margin: 0 0 8px; font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--amber); }
.clu-lab span { text-transform: none; letter-spacing: 0; color: var(--mute); }
.clu-lab-b { margin: 8px 0 0; color: var(--cyan); }
.clu-stations { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.clu-st { position: relative; padding: 10px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--bg-3); font-size: 12px; transition: border-color 0.4s, background 0.4s; }
.clu-st b { display: block; font-size: 13px; margin-bottom: 4px; }
.clu-st span { font-family: var(--mono); font-size: 11px; }
.st-run { color: #7fd88a; }
.st-stop { display: none; color: #ff8a7f; }
.clu-st.sN { border-style: dashed; }
.clu-st .ws { display: block; position: relative; height: 0; margin-top: 0; border-radius: 6px; border: 1px solid transparent; overflow: hidden; transition: height 0.5s var(--ease), margin 0.5s var(--ease), border-color 0.4s, background 0.4s; }
.clu-st .ws small { position: absolute; left: 6px; bottom: 4px; font-family: var(--mono); font-size: 10.5px; color: var(--mute); }
.clu[data-active="0"] .clu-st .ws { height: 46px; margin-top: 8px; border-color: var(--line-2); background: rgba(233, 230, 223, 0.05); }
.clu[data-active="0"] .clu-st.s2 { border-color: #ff6b5e; background: rgba(255, 107, 94, 0.08); }
.clu[data-active="0"] .clu-st.s2 .ws { border-color: #ff6b5e; animation: clu-blink 1.2s steps(1) infinite; }
.clu[data-active="0"] .clu-st.s2 .st-run { display: none; }
.clu[data-active="0"] .clu-st.s2 .st-stop { display: inline; }
@keyframes clu-blink { 50% { background: rgba(255, 107, 94, 0.25); } }

.clu-mesh { position: relative; height: clamp(90px, 15vh, 140px); margin: 6px 0; }
.clu-mesh svg { width: 100%; height: 100%; overflow: visible; }
.clu-mesh path { fill: none; vector-effect: non-scaling-stroke; }
.clu-mesh .w { stroke: var(--line-2); stroke-width: 1; opacity: 0; transition: opacity 0.6s, stroke 0.4s; }
.clu-mesh .pk { stroke: var(--amber); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 8 300; stroke-dashoffset: 8; opacity: 0; }
.clu:not([data-active="0"]) .clu-mesh .w { opacity: 1; }
.clu:not([data-active="0"]) .clu-mesh .pk { opacity: 1; animation: clu-pk 2.2s linear infinite; }
.clu-mesh .k2 { animation-delay: 0.3s !important; } .clu-mesh .k3 { animation-delay: 0.7s !important; }
.clu-mesh .k4 { animation-delay: 1s !important; } .clu-mesh .k5 { animation-delay: 1.4s !important; }
.clu-mesh .k6 { animation-delay: 0.5s !important; } .clu-mesh .k7 { animation-delay: 1.6s !important; }
@keyframes clu-pk { from { stroke-dashoffset: 8; } to { stroke-dashoffset: -300; } }
.clu .clu-mesh .to5 { opacity: 0 !important; animation: none !important; }
.clu[data-active="4"] .clu-mesh .to5 { opacity: 1 !important; }
.clu[data-active="4"] .clu-mesh .pk.to5 { animation: clu-pk 2.2s linear infinite !important; }
.clu[data-active="2"] .clu-mesh .w.to4 { stroke: #ff6b5e; stroke-dasharray: 3 4; opacity: 0.5; }
.clu[data-active="2"] .clu-mesh .pk.to4 { opacity: 0; animation: none; }
.clu[data-active="3"] .clu-mesh .w.to4 { stroke: #7fd88a; }
.clu-q { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); padding: 3px 10px; border-radius: 999px; background: var(--bg-2); border: 1px solid var(--line-2); font-family: var(--mono); font-size: 11px; color: var(--ink); white-space: nowrap; opacity: 0; transition: opacity 0.5s; }
.clu:not([data-active="0"]) .clu-q { opacity: 1; }

.clu-nodes { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; opacity: 0.25; transition: opacity 0.5s; }
.clu:not([data-active="0"]) .clu-nodes { opacity: 1; }
.cn { position: relative; padding: 9px 10px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--bg-3); transition: border-color 0.4s, background 0.4s, opacity 0.5s, transform 0.5s var(--ease); }
.cn b { display: block; font-family: var(--mono); font-size: 12px; font-weight: 500; }
.cs { position: relative; display: block; min-height: 16px; font-family: var(--mono); font-size: 10.5px; color: var(--cyan); }
.cs em { display: none; font-style: normal; }
.cs .x-busy { display: inline; }
.cb { display: block; height: 3px; margin-top: 6px; border-radius: 2px; background: var(--line); overflow: hidden; }
.cb i { display: block; height: 100%; width: 0; background: var(--cyan); }
.clu:not([data-active="0"]) .cb i { animation: clu-bar 2.2s var(--ease) infinite; }
.n2 .cb i { animation-delay: 0.5s !important; } .n3 .cb i { animation-delay: 1s !important; } .n4 .cb i { animation-delay: 1.5s !important; }
@keyframes clu-bar { 0% { width: 0; } 70% { width: 100%; } 100% { width: 100%; opacity: 0; } }
.cn.n5 { border-style: dashed; opacity: 0.35; }
.cn.n5 .cs { color: var(--mute); }
.cn.n5 .cb i { animation: none !important; }
/* A PC fails: offline, its task re-queued */
.clu[data-active="2"] .n4 { border-color: #ff6b5e; background: rgba(255, 107, 94, 0.1); animation: clu-shake 0.5s 2; }
.clu[data-active="2"] .n4 .x-busy { display: none; }
.clu[data-active="2"] .n4 .x-off { display: inline; color: #ff8a7f; }
.clu[data-active="2"] .n4 .cb i { animation: none; }
@keyframes clu-shake { 25% { transform: translateX(-3px); } 75% { transform: translateX(3px); } }
/* Hot swap: a new PC slides in, syncs, then takes tasks */
.clu[data-active="3"] .n4 { border-color: #7fd88a; background: rgba(127, 216, 138, 0.1); animation: clu-in 0.7s var(--ease) both; }
.clu[data-active="3"] .n4 .x-busy { position: absolute; left: 0; top: 0; animation: clu-late 2.6s both; }
.clu[data-active="3"] .n4 .x-new { display: inline; color: #7fd88a; animation: clu-early 2.6s both; }
@keyframes clu-in { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
@keyframes clu-early { 0%, 70% { opacity: 1; } 80%, 100% { opacity: 0; } }
@keyframes clu-late { 0%, 75% { opacity: 0; } 85%, 100% { opacity: 1; } }
/* Scale: PC-M joins */
.clu[data-active="4"] .n5 { opacity: 1; border-style: solid; border-color: var(--cyan); animation: clu-in 0.7s var(--ease) both; }
.clu[data-active="4"] .n5 .x-add { display: inline; color: var(--cyan); }
.clu[data-active="4"] .n5 .cb i { animation: clu-bar 2.2s var(--ease) 0.3s infinite !important; }

.clu-cap { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; margin-top: 16px; font-size: 12.5px; color: var(--mute); }
.cap-bar { height: 8px; border-radius: 4px; background: var(--line); overflow: hidden; }
.cap-bar i { display: block; height: 100%; width: 0; background: var(--cyan); transition: width 0.8s var(--ease), background 0.4s; }
.clu[data-active="1"] .cap-bar i, .clu[data-active="3"] .cap-bar i { width: 80%; }
.clu[data-active="2"] .cap-bar i { width: 60%; background: var(--amber); }
.clu[data-active="4"] .cap-bar i { width: 100%; }
.clu-cap b { font-family: var(--mono); font-size: 12px; font-weight: 500; color: var(--ink); min-width: 15em; text-align: right; }
.clu-cap em { display: none; font-style: normal; }
.clu[data-active="0"] .c0, .clu[data-active="1"] .c1, .clu[data-active="2"] .c2, .clu[data-active="3"] .c3, .clu[data-active="4"] .c4 { display: inline; }
.clu[data-active="2"] .c2 { color: #ffcf70; }
.clu[data-active="3"] .c3 { color: #7fd88a; }

.clu-proof { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; max-height: 0; margin-top: 0; overflow: hidden; opacity: 0; transition: max-height 0.6s var(--ease), opacity 0.5s, margin 0.6s; }
.clu[data-active="4"] .clu-proof { max-height: 120px; margin-top: 14px; opacity: 1; }
.clu-proof div { padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); }
.clu-proof b { display: block; font-size: 24px; letter-spacing: -0.03em; line-height: 1.1; }
.clu-proof small { font-size: 0.55em; color: var(--mute); }
.clu-proof span { font-size: 11.5px; color: var(--mute); }

@media (max-width: 860px) {
  .clu { height: 460vh; }
  .clu-grid { grid-template-columns: 1fr; }
  .clu .pin-copy h2 { font-size: 24px; margin-bottom: 10px; }
  .clu-steps li span { display: none; }
  .clu-steps li { padding: 4px 10px; }
  .clu .eyebrow { margin-bottom: 8px; }
  .clu-steps { margin: 0 0 10px; }
  .clu-steps li { font-size: 11.5px; padding: 4px 10px 4px 6px; }
  .clu .steps-text { min-height: 0; }
  .clu .step-text h3 { font-size: 16px; margin-bottom: 4px; }
  .clu .step-text p { font-size: 13.5px; line-height: 1.45; }
  .clu-grid { gap: 14px; }
  .clu-vis { padding: 10px; }
  .clu-lab span { display: none; }
  .clu-stations, .clu-nodes { gap: 4px; }
  .clu-st { padding: 6px; }
  .clu-st b { font-size: 11px; }
  .clu-st span, .cs { font-size: 9.5px; }
  .clu[data-active="0"] .clu-st .ws { height: 26px; }
  .clu-st .ws small { display: none; }
  .cn { padding: 6px; }
  .cn b { font-size: 11px; }
  .clu-mesh { height: 56px; }
  .clu[data-active="4"] .clu-cap, .clu-lab-b { display: none; }
  .clu .pin { padding-top: 64px; }
  .clu-cap { grid-template-columns: 1fr; gap: 4px; margin-top: 10px; }
  .clu-cap > span:first-child { display: none; }
  .clu-cap b { text-align: left; min-width: 0; }
  .clu-proof b { font-size: 18px; }
  .clu-proof span { font-size: 10px; }
  .clu-proof div { padding: 6px 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .clu { height: auto; }
  .clu-mesh .w { opacity: 1; }
  .clu-nodes { opacity: 1; }
  .clu-q { opacity: 1; }
  .clu-proof { max-height: none; opacity: 1; margin-top: 14px; }
  .clu-cap { display: none; }
}

/* ---- Narrative: chapter 1 lists the problems, each chapter band names the ones it answers,
   chapter 7 closes each problem with what Studio gives and the evidence ---- */
.problem h2 { margin-bottom: 28px; }
.pr-lede { margin-bottom: 48px; }
.pr-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line-2); }
.pr { display: grid; grid-template-columns: 64px 1fr auto; gap: 8px 24px; align-items: start; padding: 28px 0; border-bottom: 1px solid var(--line); scroll-margin-top: 96px; }
.pr-n { font-family: var(--serif); font-style: italic; font-size: 48px; line-height: 0.9; color: var(--amber-ink); }
.pr h3 { font-size: clamp(21px, 2.3vw, 28px); letter-spacing: -0.025em; margin: 2px 0 10px; }
.pr p { color: var(--mute); font-size: 16px; max-width: 46em; }
.pr-go { align-self: center; font-family: var(--mono); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; text-decoration: none; color: var(--mute); padding: 6px 12px; border: 1px solid var(--line-2); border-radius: 999px; white-space: nowrap; transition: color 0.25s, border-color 0.25s; }
.pr-go::after { content: " ↓"; }
.pr-go:hover { color: var(--amber-ink); border-color: var(--amber); }
.pr:target { background: linear-gradient(90deg, var(--amber-dim), transparent 70%); }
.pr-close { margin-top: 44px; max-width: 30em; font-family: var(--serif); font-style: italic; font-size: clamp(24px, 2.8vw, 34px); line-height: 1.25; letter-spacing: -0.01em; }

.chapter { padding: clamp(64px, 9vw, 112px) 0; background: var(--bg-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.ch-inner { display: grid; grid-template-columns: auto 1fr; gap: clamp(20px, 4vw, 56px); align-items: start; }
.ch-n { font-family: var(--serif); font-style: italic; font-size: clamp(72px, 11vw, 150px); line-height: 0.78; color: var(--amber-ink); letter-spacing: -0.03em; }
.ch-k { font-family: var(--mono); font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--mute); }
.ch-t { font-size: clamp(30px, 3.8vw, 50px); margin: 12px 0 22px; max-width: 19em; }
.ch-q { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ch-tag { font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--amber-ink); margin-right: 4px; }
.ch-q a, .ch-q > span:not(.ch-tag) { font-size: 14.5px; text-decoration: none; padding: 5px 12px; border-radius: 999px; background: #fff; border: 1px solid var(--line); transition: border-color 0.25s; }
.ch-q a:hover { border-color: var(--amber); }
.ch-map { margin-top: 18px; font-family: var(--mono); font-size: 12.5px; color: var(--mute); }
.ch-map i { font-style: normal; color: var(--amber-ink); }

.why h2 { margin-bottom: 44px; }
.why-head, .why-row { display: grid; grid-template-columns: 1fr 1.7fr 1fr; gap: 28px; }
.why-head { padding: 0 0 14px; border-bottom: 1px solid var(--line-2); font-family: var(--mono); font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--mute); }
.why-head span:nth-child(2) { color: var(--amber-ink); }
.why-list { list-style: none; margin: 0; padding: 0; }
.why-row { padding: 26px 0; border-bottom: 1px solid var(--line); align-items: start; }
.why-p a { display: flex; gap: 12px; color: var(--mute); text-decoration: none; font-size: 15px; line-height: 1.45; }
.why-p a:hover { color: var(--ink); }
.why-p span { font-family: var(--serif); font-style: italic; font-size: 30px; line-height: 0.9; color: var(--amber-ink); }
.why-g h3 { font-size: clamp(20px, 2vw, 25px); letter-spacing: -0.02em; margin-bottom: 8px; }
.why-g p { color: var(--mute); font-size: 15.5px; }
.why-proof { font-family: var(--mono); font-size: 12.5px; line-height: 1.6; color: var(--amber-ink); padding-left: 14px; border-left: 2px solid var(--amber-dim); }
.why-close { margin-top: 44px; max-width: 34em; font-family: var(--serif); font-style: italic; font-size: clamp(22px, 2.5vw, 30px); line-height: 1.3; }

.nav-links { flex-wrap: nowrap; }
@media (max-width: 1100px) { .nav-links a[href="#chapter-fit"], .nav-links a[href="#chapter-learn"] { display: none; } }
@media (max-width: 860px) {
  .pr { grid-template-columns: 36px 1fr; padding: 22px 0; }
  .pr-n { font-size: 34px; }
  .pr p { font-size: 15px; }
  .pr-go { grid-column: 2; justify-self: start; }
  .ch-inner { grid-template-columns: 1fr; gap: 6px; }
  .ch-n { font-size: 64px; }
  .ch-map { display: none; }
  .why-head { display: none; }
  .why-row { grid-template-columns: 1fr; gap: 10px; padding: 22px 0; }
}
