/* Arboris · v9 showcase
   Character: precise, quiet, editorial. One accent (Arboris blue) on ink and paper.
   Colour carries meaning only: blue = model/estimate, green = verified, amber = waiting, red = refused.
   Motion: transform/opacity, short distances, springs for anything the pointer touches. */

:root {
  --paper: #f5f5f2;
  --surface: #ffffff;
  --ink: #101318;
  --ink-2: #474d56;
  --ink-3: #7c828b;
  --ink-4: #a7acb3;
  --line: rgba(16, 19, 24, .08);
  --line-2: rgba(16, 19, 24, .14);

  --accent: #0a66d8;
  --accent-2: #0852ad;
  --accent-soft: rgba(10, 102, 216, .08);
  --ok: #1d7a52;
  --ok-soft: rgba(29, 122, 82, .1);
  --warn: #9a5f0a;
  --warn-soft: rgba(154, 95, 10, .1);
  --bad: #b13a32;
  --bad-soft: rgba(177, 58, 50, .1);

  --night: #0b0e12;

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", system-ui, sans-serif;
  --display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --serif: "New York", Georgia, "Songti SC", "Noto Serif SC", serif;

  --wrap: min(1120px, calc(100% - 64px));
  --r-lg: 22px;
  --r-md: 16px;
  --r-sm: 12px;

  --ease-out: cubic-bezier(.2, .8, .2, 1);
  --ease-spring: cubic-bezier(.3, 1.3, .6, 1);

  --glass-fill: rgba(255, 255, 255, .64);
  --glass-blur: blur(18px) saturate(140%);
  --glass-shadow:
    0 0 0 1px rgba(16, 19, 24, .06),
    0 1px 0 rgba(255, 255, 255, .9) inset,
    0 16px 40px -24px rgba(16, 19, 24, .22);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
html.reduce-motion { scroll-behavior: auto; }
body {
  margin: 0;
  font: 16px/1.65 var(--font);
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
button { font: inherit; color: inherit; }
code { font-family: var(--mono); font-size: .86em; padding: .1em .4em; border-radius: 5px; background: var(--accent-soft); color: var(--accent-2); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: fixed; left: 16px; top: -60px; z-index: 100; padding: 10px 16px; border-radius: 10px; background: var(--ink); color: #fff; text-decoration: none; }
.skip:focus { top: 16px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 8px; }
.defs { position: absolute; }

/* ───────── Ground: dot field (canvas, see js/bg.js) ───────── */
.paper { position: fixed; inset: 0; width: 100%; height: 100%; z-index: -2; pointer-events: none; }
.grain {
  position: fixed; inset: -50%; z-index: -1; pointer-events: none; opacity: .028;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ───────── Glass ───────── */
.glass {
  position: relative;
  background: var(--glass-fill);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  box-shadow: var(--glass-shadow);
  isolation: isolate;
}
.glass::before { /* a thin rim that catches light; a highlight runs along it once on arrival */
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none;
  background:
    linear-gradient(105deg, transparent 42%, rgba(255, 255, 255, 1) 50%, transparent 58%) var(--sheen, 160%) 0 / 260% 100% no-repeat,
    linear-gradient(180deg, rgba(255, 255, 255, .95), rgba(255, 255, 255, .25) 30%, rgba(255, 255, 255, 0) 60%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  z-index: 1;
}
.reveal.in.glass::before, .nav__bar.glass::before { animation: sheen 1.8s var(--ease-out) .25s both; }
@keyframes sheen { from { background-position: 160% 0, 0 0; } to { background-position: -60% 0, 0 0; } }
.glass:hover::before { animation: sheen 1.4s var(--ease-out) both; }
[data-spec]::after { /* a soft light that follows the pointer */
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: 1;
  background: radial-gradient(260px circle at var(--mx, 50%) var(--my, -20%), rgba(255, 255, 255, .5), rgba(255, 255, 255, 0) 65%);
  opacity: calc(var(--hl, 0) * .7);
  transition: opacity .5s ease;
}
.glass--dark {
  background: rgba(255, 255, 255, .035);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .08), 0 1px 0 rgba(255, 255, 255, .08) inset;
}
.glass--dark::before { background: linear-gradient(180deg, rgba(255, 255, 255, .18), rgba(255, 255, 255, 0) 40%); }
html.refract .lg {
  -webkit-backdrop-filter: url(#lg-refract) blur(10px) saturate(150%);
  backdrop-filter: url(#lg-refract) blur(10px) saturate(150%);
}
@media (prefers-reduced-transparency: reduce) {
  .glass, html.refract .lg { background: #fbfbfa; -webkit-backdrop-filter: none; backdrop-filter: none; }
  .glass--dark { background: #151a20; }
}
@media (prefers-contrast: more) {
  .glass { background: #fff; box-shadow: 0 0 0 1.5px var(--ink-2); }
}

/* ───────── Buttons & press feedback ───────── */
.btn {
  --h: 40px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--h); padding: 0 18px; border-radius: 999px; border: 0;
  font-weight: 560; font-size: 14.5px; letter-spacing: .005em; text-decoration: none; cursor: pointer; white-space: nowrap;
}
.btn--lg { --h: 46px; padding: 0 22px; font-size: 15px; }
.btn--mini { --h: 34px; padding: 0 14px; font-size: 13.5px; }
.btn--solid {
  color: #fff; background: var(--ink);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .16) inset, 0 8px 20px -10px rgba(16, 19, 24, .6);
}
.btn--solid:hover { background: #22262d; }
.btn--glass { color: var(--ink); }
.btn--glass > * { position: relative; z-index: 2; }
.btn--ghost { color: var(--ink); background: rgba(16, 19, 24, .05); box-shadow: 0 0 0 1px var(--line) inset; }
.btn:disabled { opacity: .4; cursor: default; }
.icon-btn { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 999px; border: 0; background: transparent; cursor: pointer; color: var(--ink-2); }
.icon-btn[aria-pressed="true"] { color: var(--accent); background: var(--accent-soft); }

.press { position: relative; overflow: hidden; transition: transform .5s var(--ease-spring), box-shadow .3s ease, background-color .25s ease; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.press.is-pressed { transform: scale(.965); transition: transform .08s ease-out; }
.ripple {
  position: absolute; left: var(--rx); top: var(--ry); width: 8px; height: 8px; margin: -4px 0 0 -4px;
  border-radius: 50%; pointer-events: none; z-index: 2;
  background: radial-gradient(circle, rgba(255, 255, 255, .55), rgba(255, 255, 255, 0) 70%);
  animation: ripple .65s var(--ease-out) forwards;
}
.btn--glass .ripple, .btn--ghost .ripple, .icon-btn .ripple, .seg .ripple, .charts__tabs .ripple { background: radial-gradient(circle, rgba(16, 19, 24, .12), rgba(16, 19, 24, 0) 70%); }
@keyframes ripple { from { transform: scale(1); opacity: 1; } to { transform: scale(var(--rs, 40)); opacity: 0; } }
/* Confirmation wave: rings spreading from the control that was approved. */
.wave { position: fixed; left: var(--wx); top: var(--wy); width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; pointer-events: none; z-index: 30; border: 1px solid var(--accent); opacity: 0; animation: wave 1s var(--ease-out) forwards; animation-delay: var(--wd, 0s); }
@keyframes wave { 0% { transform: scale(1); opacity: .5; } 100% { transform: scale(16); opacity: 0; } }

/* ───────── Nav ───────── */
.nav { position: fixed; top: max(14px, env(safe-area-inset-top)); left: 0; right: 0; z-index: 50; display: flex; justify-content: center; pointer-events: none; }
.nav__bar {
  pointer-events: auto; display: flex; align-items: center; gap: 10px;
  height: 50px; padding: 0 7px 0 16px; border-radius: 999px;
  width: min(960px, calc(100% - 24px));
  transition: width .6s var(--ease-out), background-color .4s ease, color .4s ease;
  overflow: hidden;
}
.nav.is-compact .nav__bar { width: min(820px, calc(100% - 24px)); }
/* English labels are longer: a wider bar, tighter links, and the menu a little earlier. */
html[lang="en"] .nav__bar { width: min(1060px, calc(100% - 24px)); }
html[lang="en"] .nav.is-compact .nav__bar { width: min(980px, calc(100% - 24px)); }
html[lang="en"] .nav__links a { padding: 6px 9px; font-size: 13px; }
@media (max-width: 1180px) {
  html[lang="en"] .nav__links { display: none; }
  html[lang="en"] .nav__menu { display: inline-grid; }
  html[lang="en"] .nav__tools { margin-left: auto; }
}
.console__mode, .console__count, .console__tag { white-space: nowrap; }
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; font-weight: 650; letter-spacing: -.01em; font-size: 15.5px; }
.nav__links { display: flex; gap: 2px; margin: 0 auto; }
.nav__links a { padding: 6px 11px; border-radius: 999px; font-size: 13.5px; color: var(--ink-2); text-decoration: none; transition: color .25s ease, background-color .25s ease; }
.nav__links a:hover { color: var(--ink); background: rgba(16, 19, 24, .04); }
.nav__links a.is-active { color: var(--ink); background: rgba(16, 19, 24, .06); }
.lang { white-space: nowrap; padding: 6px 9px; border-radius: 999px; font: 500 12.5px/1 var(--font); color: var(--ink-2); text-decoration: none; transition: background-color .25s ease, color .25s ease; }
.lang:hover { color: var(--ink); background: rgba(16, 19, 24, .05); }
.nav__tools { display: flex; align-items: center; gap: 4px; }
.nav__menu { display: none; }
.nav__progress { position: absolute; left: 20px; right: 20px; bottom: 0; height: 1px; background: var(--ink); transform-origin: left; transform: scaleX(var(--progress, 0)); opacity: .35; }
.sheet { pointer-events: auto; position: absolute; top: 62px; width: min(420px, calc(100% - 24px)); border-radius: 20px; padding: 8px; display: grid; transform-origin: top right; animation: sheetIn .4s var(--ease-out); }
.sheet a { position: relative; z-index: 2; padding: 13px 16px; border-radius: 12px; text-decoration: none; font-size: 16px; }
.sheet a:active { background: rgba(16, 19, 24, .05); }
@media (min-width: 1081px) { .sheet { display: none !important; } }
.sheet[hidden] { display: none; }
@keyframes sheetIn { from { opacity: 0; transform: scale(.96) translateY(-6px); } }

/* ───────── Typography ───────── */
.display { margin: 0; font: 640 clamp(28px, 3.3vw, 44px)/1.18 var(--display); letter-spacing: -.025em; text-wrap: balance; }
.mute { color: var(--ink-4); }
.lede { margin: 20px 0 0; max-width: 580px; font-size: 16.5px; line-height: 1.75; color: var(--ink-2); text-wrap: pretty; }

/* Chain-generated text: graphemes arrive in short tokens, softening into focus. */
.w { white-space: nowrap; }
.ch { display: inline-block; white-space: pre; opacity: 0; filter: blur(6px); transform: translateY(.18em); }
.is-streaming .ch { animation: chIn .6s var(--ease-out) forwards; animation-delay: calc(var(--base, 0ms) + var(--i) * var(--step, 42ms)); }
.ch.on { opacity: 1; filter: none; transform: none; transition: opacity .25s ease, filter .25s ease, transform .35s var(--ease-out); }
@keyframes chIn { 0% { opacity: 0; color: var(--accent); } 45% { color: var(--accent); } 100% { opacity: 1; filter: blur(0); transform: none; } }
.ch.on { animation: chTint .7s ease-out; }
@keyframes chTint { from { color: var(--accent); } }
.caret { display: inline-block; width: 1.5px; height: 1em; margin-left: 2px; vertical-align: -.12em; background: var(--accent); animation: caret 1.1s steps(1) infinite; }
@keyframes caret { 50% { opacity: 0; } }

/* Reveal on scroll: short travel, quick focus. */
.js .reveal { opacity: 0; transform: translateY(16px); filter: blur(4px); }
.js .reveal.in { opacity: 1; transform: none; filter: none; transition: opacity .9s var(--ease-out) var(--d, 0ms), transform 1s var(--ease-out) var(--d, 0ms), filter .8s var(--ease-out) var(--d, 0ms); }
.js .curtain { opacity: 0; clip-path: inset(0 0 100% 0); transform: translateY(.3em); }
.js .curtain.in { opacity: 1; clip-path: inset(-.2em -.2em -.3em -.2em); transform: none; transition: clip-path 1s var(--ease-out), transform 1s var(--ease-out), opacity .5s ease; }

/* ───────── Hero ───────── */
.hero { position: relative; min-height: 100svh; display: grid; align-items: center; padding: 112px 0 72px; overflow: clip; }
.field { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; }
.hero__grid {
  position: relative; z-index: 1; width: var(--wrap); margin: 0 auto;
  display: grid; grid-template-columns: minmax(0, .92fr) minmax(0, 1fr); gap: clamp(32px, 5vw, 72px); align-items: center;
  pointer-events: none;
}
.hero__grid a, .hero__grid button, .ask { pointer-events: auto; }
.hero__copy {
  transform: translateY(calc(var(--hp, 0) * -50px));
  opacity: calc(1 - var(--hp, 0) * 1.4);
  filter: var(--hfilter, none);
}
.hero__title { margin: 0; font: 660 clamp(34px, 4.1vw, 56px)/1.16 var(--display); letter-spacing: -.03em; }
.stream-line { display: block; min-height: 1.16em; }
.hero__lede { margin: 22px 0 0; max-width: 470px; font-size: 16.5px; line-height: 1.75; color: var(--ink-2); }
.ask { margin-top: 28px; max-width: 520px; padding: 12px 12px 10px 14px; border-radius: 18px; display: grid; gap: 8px; }
.ask > * { position: relative; z-index: 2; }
.ask__top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ask__ctx { display: inline-flex; align-items: center; gap: 6px; font: 500 11.5px/1 var(--mono); color: var(--accent-2); padding: 6px 9px; border-radius: 7px; background: var(--accent-soft); }
.ask__ctx i { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
.ask__text { margin: 2px 2px 4px; font-size: 16px; line-height: 1.65; color: var(--ink); min-height: 3.3em; }
.ask__bar { display: flex; align-items: center; gap: 14px; font-size: 13px; color: var(--ink-3); }
.ask__plus { font-size: 16px; color: var(--ink-4); }
.ask__mode { font: 500 11.5px/1 var(--mono); color: var(--ink-2); padding: 5px 8px; border-radius: 7px; box-shadow: 0 0 0 1px var(--line-2) inset; transition: opacity .3s ease; }
.ask__send { margin-left: auto; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: var(--ink); transition: transform .3s var(--ease-spring), background .3s ease; }
.ask.is-sending .ask__send { transform: scale(.86); background: var(--accent); }
.hero__cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.hero__figure { margin: 0; display: grid; gap: 14px; opacity: calc(1 - var(--hp, 0) * 1.2); }
.hero__plot { aspect-ratio: 1.18; width: 100%; }
.hero__cap { display: grid; gap: 8px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--ink-3); }
.hero__capline { display: flex; gap: 10px; min-height: 1.6em; }
.hero__cap b { color: var(--ink); font-weight: 600; flex: none; }
.hero__read { font-family: var(--mono); font-size: 12px; color: var(--ink-2); font-variant-numeric: tabular-nums; min-height: 1.6em; }
.figs { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 2px; }
.fig-chip { position: relative; height: 28px; padding: 0 11px; border: 0; border-radius: 999px; background: transparent; box-shadow: 0 0 0 1px var(--line) inset; font: 500 12px var(--font); color: var(--ink-3); cursor: pointer; pointer-events: auto; }
.fig-chip.on { color: var(--ink); box-shadow: 0 0 0 1px var(--line-2) inset; background: rgba(255, 255, 255, .7); }
.fig-chip.on::after { content: ""; position: absolute; left: 11px; right: 11px; bottom: 4px; height: 1px; background: var(--accent); transform-origin: left; transform: scaleX(0); }
.figs.run .fig-chip.on::after { animation: dwell var(--dwell, 7s) linear forwards; }
.figs.paused .fig-chip.on::after { animation-play-state: paused; }
@keyframes dwell { to { transform: scaleX(1); } }

/* ───────── Story (pinned, scroll-scrubbed) ───────── */
.story { position: relative; height: 540vh; }
.story__pin {
  position: sticky; top: 0; height: 100vh; height: 100svh;
  width: min(1280px, calc(100% - 64px)); margin: 0 auto;
  display: grid; grid-template-columns: minmax(280px, .62fr) 1.7fr; gap: clamp(28px, 4vw, 56px); align-items: center;
  padding-top: 60px;
}
.story__title { margin: 0 0 26px; font: 640 clamp(24px, 2.3vw, 32px)/1.26 var(--display); letter-spacing: -.02em; }
.story__caption { display: none; margin: 10px 0 0; font-size: 14px; line-height: 1.6; color: var(--ink-2); min-height: 3.2em; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; border-left: 1px solid var(--line); }
.steps button {
  position: relative; width: 100%; display: grid; grid-template-columns: 30px 1fr; gap: 4px 8px; text-align: left;
  padding: 10px 12px 10px 16px; border: 0; background: transparent; cursor: pointer;
}
.steps b { font: 500 11.5px/1.9 var(--mono); color: var(--ink-4); transition: color .4s ease; }
.steps strong { display: block; font-size: 15px; font-weight: 600; color: var(--ink-3); transition: color .4s ease; }
.steps em { display: block; font-style: normal; font-size: 14px; line-height: 1.65; color: var(--ink-2); max-height: 0; opacity: 0; overflow: hidden; transition: max-height .6s var(--ease-out), opacity .4s ease, margin .4s ease; }
.steps i { position: absolute; left: -1px; top: 10px; bottom: 10px; width: 1.5px; background: var(--ink); transform-origin: top; transform: scaleY(var(--sp, 0)); opacity: 0; transition: opacity .3s ease; }
.steps li.is-active b { color: var(--accent); }
.steps li.is-active strong { color: var(--ink); }
.steps li.is-active em { max-height: 8em; opacity: 1; margin-top: 4px; }
.steps li.is-active i { opacity: 1; }
.steps li.is-done strong { color: var(--ink-2); }

.stage {
  border-radius: 18px; height: min(74vh, 660px); display: grid; grid-template-rows: auto 1fr; overflow: hidden;
  background: rgba(255, 255, 255, .7);
  transform: translateY(calc((1 - var(--enter, 1)) * 48px)) scale(calc(.97 + var(--enter, 1) * .03));
  opacity: calc(.4 + var(--enter, 1) * .6);
}
.stage__top { display: flex; align-items: center; gap: 14px; padding: 10px 14px; border-bottom: 1px solid var(--line); position: relative; z-index: 2; }
.lights { display: inline-flex; gap: 6px; }
.lights i { width: 9px; height: 9px; border-radius: 50%; background: rgba(16, 19, 24, .14); }
.stage__tabs { position: relative; display: inline-grid; grid-template-columns: repeat(3, 70px); padding: 2px; margin: 0 auto; border-radius: 8px; background: rgba(16, 19, 24, .05); font-size: 12px; color: var(--ink-3); }
.stage__tabs span { position: relative; z-index: 1; text-align: center; padding: 3px 0; transition: color .4s ease; }
.stage__tabs span.on { color: var(--ink); }
.stage__thumb { position: absolute; top: 2px; bottom: 2px; left: 2px; width: 70px; border-radius: 6px; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .08); transform: translateX(calc(var(--tab, 0) * 70px)); transition: transform .55s var(--ease-spring); }
.stage__badge { font: 500 11px var(--mono); color: var(--ink-3); }
.stage__body { display: grid; grid-template-columns: 1.6fr 1fr; min-height: 0; position: relative; z-index: 2; }

.canvas {
  position: relative; overflow: hidden; min-height: 0; container-type: inline-size;
  background-image: radial-gradient(rgba(16, 19, 24, .12) .8px, transparent 1px);
  background-size: 16px 16px;
  background-color: #f7f7f5;
}
.preview {
  position: absolute; left: 5%; right: 5%; top: 9%; padding: 14px 14px 10px; border-radius: 10px; background: #fff; overflow: hidden;
  box-shadow: 0 0 0 1px rgba(16, 19, 24, .07), 0 20px 40px -26px rgba(16, 19, 24, .4);
  opacity: calc(var(--v, 0) * (1 - var(--out, 0)));
  transform: translateY(calc((1 - var(--v, 0)) * 14px)) scale(calc(1 - var(--out, 0) * .5));
  transform-origin: 8% 50%;
  pointer-events: none; z-index: 1;
}
.preview__head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; margin-bottom: 8px; font-size: 12px; color: var(--ink-3); }
.preview__head b { font: 600 13px var(--serif); color: var(--ink); }
.preview__roles { margin-left: auto; font: 500 11px var(--mono); color: var(--accent-2); opacity: 0; transition: opacity .4s ease; }
.preview__roles em { font-style: normal; color: #fff; background: var(--accent); border-radius: 3px; padding: 0 4px; margin-right: 2px; }
.preview table { width: 100%; border-collapse: collapse; font: 11.5px/1.5 var(--mono); font-variant-numeric: tabular-nums; }
.preview th { font-weight: 500; color: var(--ink-3); text-align: right; padding: 5px 7px; border-bottom: 1px solid var(--line-2); white-space: nowrap; }
.preview td { text-align: right; padding: 4px 7px; color: var(--ink-2); border-bottom: 1px solid var(--line); }
.preview tr[data-prow] { opacity: var(--v, 0); }
.preview th, .preview td { transition: background-color .4s ease, color .4s ease; }
.preview.is-roles .is-y, .preview.is-roles .is-x { background: var(--accent-soft); color: var(--accent-2); }
.preview.is-roles .preview__roles { opacity: 1; }
.preview .more { display: none; color: var(--ink-4); text-align: center; }
/* Narrow canvas: keep the two named columns and one more, mark the rest as hidden. */
@container (max-width: 540px) {
  .preview .opt { display: none; }
  .preview .more { display: table-cell; }
}
.edges { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.edges path { fill: none; stroke: #a3a9b1; stroke-width: 1.2; stroke-linecap: round; }
.edges path.hot { stroke: var(--accent); stroke-dasharray: 4 4; }
.node {
  position: absolute; left: var(--nx); top: var(--ny); width: 17.5%;
  padding: 7px 8px 8px; border-radius: 8px; background: #fff;
  border-left: 2.5px solid #6b727c;
  box-shadow: 0 0 0 1px rgba(16, 19, 24, .06), 0 6px 16px -10px rgba(16, 19, 24, .35);
  transform: translate(0, -50%) scale(calc(.7 + var(--v, 0) * .3)); opacity: var(--v, 0);
  transform-origin: left center; font-size: 11.5px; line-height: 1.35;
}
.node small { display: block; font: 500 8.5px/1.5 var(--mono); letter-spacing: .08em; color: var(--ink-3); }
.node small em { font-style: normal; color: #fff; background: var(--accent); border-radius: 3px; padding: 0 4px; }
.node span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink-3); }
.node b { display: block; font: 600 12.5px/1.35 var(--serif); margin: 1px 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.node--var { border-left-color: var(--accent); }
.node--model { border-left-color: var(--ink); }
.node--model.is-hot { box-shadow: 0 0 0 1.5px var(--accent), 0 8px 20px -10px rgba(10, 102, 216, .45); }
.node--report { border-left-color: #8a7350; }

.result-card {
  position: absolute; left: 6%; right: 6%; bottom: 5%;
  padding: 12px 16px; border-radius: 12px; background: #fff;
  box-shadow: 0 0 0 1px rgba(16, 19, 24, .06), 0 16px 32px -20px rgba(16, 19, 24, .4);
  display: grid; grid-template-columns: auto 1fr; gap: 2px 20px; align-items: center;
  opacity: var(--v, 0); transform: translateY(calc((1 - var(--v, 0)) * 20px));
}
.result-card small { grid-column: 1 / -1; font-size: 11.5px; color: var(--ink-3); }
.result-card__big { font: 620 28px/1.1 var(--display); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.result-card__meta { grid-column: 1 / -1; font: 400 11.5px/1.6 var(--mono); color: var(--ink-2); }
.ci { position: relative; height: 36px; }
.ci__axis { position: absolute; left: 0; right: 0; top: 16px; height: 1px; background: var(--line-2); }
.ci__bar { position: absolute; left: 30%; right: 30%; top: 14.5px; height: 4px; border-radius: 2px; background: var(--accent); transform: scaleX(var(--ci, 0)); }
.ci__pt { position: absolute; left: 50%; top: 11px; width: 11px; height: 11px; margin-left: -5.5px; border-radius: 50%; background: #fff; border: 2px solid var(--accent); transform: scale(var(--ci, 0)); }
.ci__lab { position: absolute; top: 23px; font: 400 10.5px var(--mono); color: var(--ink-3); opacity: var(--ci, 0); }
.ci__lab--lo { left: 30%; transform: translateX(-50%); }
.ci__lab--hi { right: 30%; transform: translateX(50%); }

.report {
  position: absolute; left: 6%; right: 6%; top: 7%; border-radius: 10px; background: #fffefc; padding: 18px 22px 14px;
  box-shadow: 0 0 0 1px rgba(16, 19, 24, .07), 0 30px 60px -28px rgba(16, 19, 24, .45);
  display: grid; gap: 10px;
  transform: translateY(calc((1 - var(--v, 0)) * 110%)); opacity: calc(var(--v, 0) * 1.4);
}
.report header b { font: 600 17px/1.35 var(--serif); }
.report p { margin: 0; font: 13.5px/1.85 var(--serif); color: #2b3037; }
.rtable { width: 100%; border-collapse: collapse; font: 12px/1.5 var(--mono); font-variant-numeric: tabular-nums; }
.rtable caption { text-align: left; font: 500 11.5px/1.6 var(--serif); color: var(--ink-2); padding-bottom: 4px; }
.rtable th { font-weight: 500; color: var(--ink-3); text-align: right; padding: 4px 8px; border-top: 1.2px solid var(--ink); border-bottom: 1px solid var(--line-2); }
.rtable td { text-align: right; padding: 4px 8px; color: var(--ink); }
.rtable th:first-child, .rtable td:first-child { text-align: left; padding-left: 0; }
.rtable tfoot td { text-align: left; border-top: 1.2px solid var(--ink); color: var(--ink-2); padding-left: 0; }
.rtable tr[data-rrow] { opacity: var(--v, 0); transition: opacity .3s ease; }
.report footer { display: flex; gap: 6px; flex-wrap: wrap; font: 500 11px var(--mono); }
.report footer span { padding: 4px 9px; border-radius: 6px; box-shadow: 0 0 0 1px var(--line-2) inset; color: var(--ink-2); }

/* Number chips: blue while unverified, green and briefly ringed once checked. */
.num { opacity: 0; }
.num.vis { opacity: 1; transition: opacity .3s ease; }
.is-streaming .num { animation: fadeOnly .35s ease forwards; animation-delay: calc(var(--base, 0ms) + var(--i) * var(--step, 42ms)); }
.num { font: 500 .93em var(--mono); padding: 0 4px; border-radius: 4px; background: var(--accent-soft); color: var(--accent-2); transition: background .3s ease, color .3s ease; white-space: nowrap; font-variant-numeric: tabular-nums; }
.num.ok { opacity: 1; background: var(--ok-soft); color: var(--ok); animation: okRing .9s var(--ease-out); }
.num.ok::after { content: " ✓"; font-size: .82em; }
.num.calc::before { content: "ƒ "; opacity: .7; }
.num.bad { background: var(--bad-soft); color: var(--bad); text-decoration: line-through; }
@keyframes okRing { from { box-shadow: 0 0 0 0 rgba(29, 122, 82, .35); } to { box-shadow: 0 0 0 7px rgba(29, 122, 82, 0); } }

.chat { border-left: 1px solid var(--line); display: grid; grid-template-rows: auto 1fr; min-height: 0; background: #fff; }
.chat__head { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; font-size: 13px; border-bottom: 1px solid var(--line); }
.seg-mini { display: inline-flex; padding: 2px; border-radius: 7px; background: rgba(16, 19, 24, .05); font-size: 11px; }
.seg-mini span { padding: 1px 8px; border-radius: 5px; color: var(--ink-3); }
.seg-mini span.on { background: #fff; color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(0, 0, 0, .08); }
.chat__scroll { position: relative; overflow: hidden; padding: 14px; display: flex; flex-direction: column; gap: 11px; font-size: 13.5px; line-height: 1.7; }
.chat__scroll > * { flex-shrink: 0; }
.bubble { padding: 9px 13px; border-radius: 14px; }
.bubble--user { align-self: flex-end; max-width: 92%; background: #f0f0ed; border-bottom-right-radius: 5px; opacity: var(--v, 0); }
.bubble--agent { color: var(--ink); padding: 2px; opacity: var(--v, 0); }
.plan { border-radius: 12px; background: #fff; padding: 11px 13px; box-shadow: 0 0 0 1px var(--line); opacity: var(--v, 0); transform: translateY(calc((1 - var(--v, 0)) * 12px)); }
.plan header { display: flex; justify-content: space-between; align-items: center; font-size: 13px; margin-bottom: 6px; }
.plan header span { font: 500 11px var(--mono); padding: 2px 7px; border-radius: 5px; background: var(--warn-soft); color: var(--warn); transition: all .3s ease; }
.plan header span.ok { background: var(--ok-soft); color: var(--ok); }
.plan ol { margin: 0; padding: 0; list-style: none; display: grid; gap: 4px; font-size: 12.5px; color: var(--ink-2); }
.plan li { display: flex; gap: 8px; align-items: center; opacity: var(--v, 0); transform: translateX(calc((1 - var(--v, 0)) * 8px)); }
.plan li i { width: 13px; height: 13px; border-radius: 3.5px; border: 1.3px solid var(--ink-4); flex: none; display: grid; place-items: center; transition: all .3s ease; }
.plan li.done i { background: var(--ok); border-color: var(--ok); }
.plan li.done i::after { content: ""; width: 6px; height: 3px; border: 1.6px solid #fff; border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px, -1px); }
.plan__approve { margin-top: 9px; width: 100%; height: 30px; border: 0; border-radius: 999px; font-weight: 560; font-size: 12.5px; color: #fff; background: var(--ink); pointer-events: none; transition: transform .4s var(--ease-spring), background .3s ease, box-shadow .3s ease, color .3s ease; }
.plan__approve.pulse { box-shadow: 0 0 0 5px rgba(16, 19, 24, .07); }
.plan__approve.pressed { transform: scale(.96); }
.plan__approve.ok { background: var(--ok-soft); color: var(--ok); }
.worked { opacity: 1 !important; display: grid; gap: 3px; font-size: 12.5px; color: var(--ink-2); }
.worked p { margin: 0; display: flex; gap: 8px; align-items: center; opacity: var(--v, 0); transform: translateY(calc((1 - var(--v, 0)) * 6px)); }
.worked i { width: 13px; height: 13px; border-radius: 50%; background: var(--ok); flex: none; position: relative; }
.worked i::after { content: ""; position: absolute; left: 3.5px; top: 3.8px; width: 5px; height: 2.5px; border: 1.5px solid #fff; border-top: 0; border-right: 0; transform: rotate(-45deg); }

/* ───────── Sections ───────── */
.section { position: relative; padding: clamp(120px, 17vh, 200px) 0 clamp(40px, 7vh, 80px); }
.section__head { width: var(--wrap); margin: 0 auto clamp(36px, 6vh, 60px); }

/* Bento */
.bento { width: var(--wrap); margin: 0 auto; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.card { border-radius: var(--r-lg); padding: clamp(22px, 2.6vw, 32px); }
.card--wide { grid-column: span 2; display: grid; grid-template-columns: 1fr 1.1fr; gap: 28px; align-items: center; }
.bento > .card:nth-child(4) { grid-column: 2 / span 2; }
.card--stack { grid-template-columns: 1fr; gap: 20px; }
.card--stack .card__copy p { max-width: 560px; }
.card > *, .card__copy, .verify, .flow { position: relative; z-index: 2; }
.card h3 { margin: 0 0 10px; font: 620 19px/1.4 var(--display); letter-spacing: -.01em; text-wrap: balance; }
.card p { margin: 0; color: var(--ink-2); font-size: 14.5px; line-height: 1.75; }
.card .btn { margin-top: 18px; }
.pills { list-style: none; padding: 0; margin: 16px 0 0; display: flex; flex-wrap: wrap; gap: 6px; }
.pills li { padding: 5px 11px; border-radius: 999px; font-size: 13px; color: var(--ink); box-shadow: 0 0 0 1px var(--line-2) inset; background: rgba(255, 255, 255, .6); }

.verify { display: grid; gap: 10px; }
.verify__line { padding: 12px 14px; border-radius: 12px; background: #fff; box-shadow: 0 0 0 1px var(--line); transition: opacity .5s ease, transform .5s var(--ease-out); }
.verify__line p { margin: 4px 0 0; font-size: 14.5px; line-height: 1.8; min-height: 1.8em; color: var(--ink); }
.verify__tag { font: 500 10.5px var(--mono); letter-spacing: .1em; color: var(--ink-3); }
.verify__tag--ok { color: var(--ok); }
.verify__line--draft.is-withdrawn { opacity: .45; }
.verify__line--final { opacity: 0; transform: translateY(8px); }
.verify__line--final.on { opacity: 1; transform: none; }
.verify__flag { justify-self: start; padding: 5px 10px; border-radius: 8px; font-size: 12.5px; color: var(--bad); background: var(--bad-soft); opacity: 0; transform: translateY(-4px); transition: opacity .35s ease, transform .5s var(--ease-out); }
.verify__flag.on { opacity: 1; transform: none; }

.ledger { list-style: none; padding: 0; margin: 16px 0 0; display: grid; border-top: 1px solid var(--line); }
.ledger li { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; opacity: 0; transform: translateX(-10px); transition: opacity .5s ease, transform .7s var(--ease-out); transition-delay: calc(var(--i, 0) * 200ms + 300ms); }
.ledger.in li, .in .ledger li { opacity: 1; transform: none; }
.ledger em { font: 500 11.5px var(--mono); font-style: normal; color: var(--ok); }
.ledger--no span { text-decoration: line-through; text-decoration-color: rgba(177, 58, 50, .6); color: var(--ink-3); }
.ledger--no em { color: var(--bad); }

.egress { display: grid; grid-template-columns: 1fr 46px 1.25fr; grid-template-rows: auto auto; gap: 10px 0; align-items: stretch; }
.egress__side { position: relative; border-radius: 12px; background: #fff; box-shadow: 0 0 0 1px var(--line); padding: 11px 12px; min-width: 0; }
.egress__h { white-space: nowrap; display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin: 0 0 8px !important; font-size: 12.5px !important; color: var(--ink) !important; font-weight: 600; }
.egress__h em { font: 400 10.5px var(--mono); font-style: normal; color: var(--ink-3); }
.egress__rows { display: grid; gap: 4px; }
.egress__rows i { display: block; font: 400 10.5px/1.6 var(--mono); font-style: normal; color: var(--ink-2); padding: 0 6px; border-radius: 4px; background: rgba(16, 19, 24, .035); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: transform .5s var(--ease-out), opacity .4s ease; }
.egress__rows i.try { transform: translateX(22px); opacity: .55; }
.egress__gate { position: relative; display: grid; place-items: center; }
.egress__wall { position: absolute; top: 6px; bottom: 6px; left: 50%; width: 1px; background: repeating-linear-gradient(to bottom, var(--ink-3) 0 3px, transparent 3px 6px); }
.egress__label { position: relative; writing-mode: vertical-rl; font: 500 10.5px var(--mono); letter-spacing: .16em; color: var(--ink-3); background: var(--paper); padding: 6px 0; }
.egress__bounce { position: absolute; left: 50%; top: 40%; width: 8px; height: 8px; margin: -4px 0 0 -4px; border-radius: 50%; border: 1px solid var(--bad); opacity: 0; }
.egress__bounce.on { animation: bounceRing .8s var(--ease-out); }
@keyframes bounceRing { from { opacity: .8; transform: scale(1); } to { opacity: 0; transform: scale(6); } }
.egress__payload { list-style: none; margin: 0; padding: 0; display: grid; gap: 5px; }
.egress__payload li { display: grid; grid-template-columns: 62px 1fr; gap: 8px; font: 400 11px/1.55 var(--mono); color: var(--ink-2); opacity: .15; transform: translateX(-14px); transition: opacity .5s ease, transform .6s var(--ease-out); }
.egress__payload li.in { opacity: 1; transform: none; }
.egress__payload b { font-weight: 500; color: var(--accent-2); }
.egress__payload span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.egress__audit { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; margin: 0 !important; font-size: 12px !important; }
.egress__audit span { flex: none; white-space: nowrap; font: 500 10.5px var(--mono); letter-spacing: .1em; color: var(--ink-3); }
.egress__audit code { background: none; padding: 0; color: var(--ink-2); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ───────── Agent ───────── */
.agent { width: var(--wrap); margin: 0 auto; display: grid; grid-template-columns: 1fr 1.08fr; gap: clamp(32px, 5vw, 72px); align-items: center; }
.agent__copy { position: sticky; top: 110px; }
.seg { position: relative; display: inline-grid; grid-template-columns: 1fr 1fr; margin-top: 28px; padding: 4px; border-radius: 999px; }
.seg button { position: relative; z-index: 2; height: 38px; padding: 0 18px; border: 0; border-radius: 999px; background: transparent; cursor: pointer; font-weight: 560; font-size: 13.5px; color: var(--ink-2); transition: color .35s ease; white-space: nowrap; }
.seg button[aria-checked="true"] { color: #fff; }
.seg__thumb { position: absolute; z-index: 1; top: 4px; bottom: 4px; left: 0; border-radius: 999px; background: var(--ink); box-shadow: 0 6px 16px -8px rgba(16, 19, 24, .7); transform: translateX(var(--tx, 4px)); width: var(--tw, 50%); }
.mode-note { margin: 14px 0 0; min-height: 3.6em; font-size: 14.5px; color: var(--ink-2); transition: opacity .25s ease; }
.rail { margin-top: 18px; padding: 14px 16px 12px; border-radius: 14px; background: rgba(255, 255, 255, .6); box-shadow: 0 0 0 1px var(--line); }
.rail__row { display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 10px; padding: 6px 0; opacity: .45; transition: opacity .35s ease; }
.rail__row.on { opacity: 1; }
.rail__row b { font: 600 12px var(--mono); }
.rail__row em { font: 500 11.5px var(--mono); font-style: normal; color: var(--ink-2); white-space: nowrap; }
.rail__dots { display: flex; align-items: center; gap: 6px; }
.rail__dots i { position: relative; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font: 500 9.5px var(--mono); font-style: normal; color: var(--ink-3); box-shadow: 0 0 0 1px var(--line-2) inset; transition: transform .4s var(--ease-spring); }
.rail__dots i.ro { color: var(--ink-4); box-shadow: 0 0 0 1px var(--line) inset; }
.rail__dots i.stop { color: #fff; background: var(--warn); box-shadow: none; }
.rail__dots i.go { color: var(--ok); box-shadow: 0 0 0 1px rgba(29, 122, 82, .35) inset; }
.rail__dots i.plan { width: auto; padding: 0 7px; border-radius: 999px; }
.rail__row.on .rail__dots i.stop { animation: railPulse 2.4s ease-in-out infinite; }
@keyframes railPulse { 50% { box-shadow: 0 0 0 4px rgba(154, 95, 10, .14); } }
.rail__key { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin: 8px 0 0; font-size: 11.5px; color: var(--ink-3); }
.rail__key i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: -6px; }
.rail__key .k-stop { background: var(--warn); }
.rail__key .k-go { box-shadow: 0 0 0 1px rgba(29, 122, 82, .5) inset; }
.rail__key .k-ro { box-shadow: 0 0 0 1px var(--line-2) inset; }

.console { border-radius: 20px; overflow: hidden; display: grid; grid-template-rows: auto auto 1fr auto; height: min(680px, 82vh); background: rgba(255, 255, 255, .72); }
.console__head { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); font-size: 13.5px; position: relative; z-index: 2; }
.console__mode { font: 500 11px var(--mono); color: var(--ink-2); padding: 3px 8px; border-radius: 6px; box-shadow: 0 0 0 1px var(--line-2) inset; }
.console__count { font: 500 11px var(--mono); color: var(--warn); padding: 3px 8px; border-radius: 6px; background: var(--warn-soft); }
.console__count.zero { color: var(--ink-3); background: rgba(16, 19, 24, .04); }
.console__tag { margin-left: auto; font: 500 11px var(--mono); color: var(--ok); }
.console__tag.demo { color: var(--ink-3); }
.console__scen { position: relative; z-index: 2; display: flex; gap: 4px; padding: 8px 12px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.console__scen button { flex: none; border: 0; padding: 5px 11px; border-radius: 999px; font-size: 12.5px; color: var(--ink-3); background: transparent; cursor: pointer; transition: background-color .25s ease, color .25s ease; }
.console__scen button:hover { color: var(--ink); background: rgba(16, 19, 24, .04); }
.console__scen button.on { color: var(--ink); background: rgba(16, 19, 24, .07); font-weight: 560; }
/* Recall card: earlier sessions of this project. */
.mem { padding: 11px 14px 12px; border-radius: 14px; background: linear-gradient(180deg, rgba(10, 102, 216, .045), rgba(10, 102, 216, .02)); box-shadow: 0 0 0 1px rgba(10, 102, 216, .14) inset; animation: msgIn .45s var(--ease-out); }
.mem header { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 600; color: var(--accent-2); }
.mem header em { margin-left: auto; font: 500 10.5px var(--mono); font-style: normal; color: var(--ink-3); }
.mem__ico { width: 14px; height: 14px; border-radius: 50%; box-shadow: 0 0 0 1.5px var(--accent) inset; position: relative; }
.mem__ico::after { content: ""; position: absolute; left: 6px; top: 3px; width: 1.5px; height: 5px; background: var(--accent); box-shadow: 1.5px 3.5px 0 -0px var(--accent); transform-origin: bottom; }
.mem ul { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.mem li { display: grid; grid-template-columns: 42px 1fr; gap: 8px; font-size: 13px; line-height: 1.6; color: var(--ink-2); opacity: 0; translate: 0 4px; transition: opacity .45s var(--ease-out), translate .5s var(--ease-out); }
.mem li.in { opacity: 1; translate: 0 0; }
.mem time { font: 500 11px/1.9 var(--mono); color: var(--ink-3); }
.plan-card.is-designing header span { background: rgba(10, 102, 216, .08); color: var(--accent-2); }
.plan-card li { animation: liIn .35s var(--ease-out) both; }
@keyframes liIn { from { opacity: 0; translate: -6px 0; } }
.plan-card .from-mem { margin-left: 8px; font: 500 10px var(--mono); font-style: normal; color: var(--accent-2); background: var(--accent-soft); padding: 1px 6px; border-radius: 4px; vertical-align: 1px; }
.plan-card .crit { margin: 10px 0 0; padding-top: 9px; border-top: 1px dashed var(--line-2); font-size: 12.5px; line-height: 1.6; color: var(--ink-2); opacity: 0; transition: opacity .4s ease; }
.plan-card.has-crit .crit { opacity: 1; }
.plan-card .crit b { margin-right: 8px; font: 600 10.5px var(--mono); color: var(--ink-3); letter-spacing: .04em; }
.console__log { position: relative; z-index: 2; overflow-y: auto; padding: 18px 18px 8px; display: flex; flex-direction: column; gap: 12px; background: #fbfbfa; scroll-behavior: smooth; overscroll-behavior: contain; }
html[lang="en"] .console__log:empty::before { content: "Pick a mode, then press “Run example”."; }
.console__log:empty::before { content: "选好执行模式，然后点“运行示例”。"; margin: auto; color: var(--ink-3); font-size: 14px; }
.console__foot { position: relative; z-index: 2; display: flex; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--line); background: rgba(255, 255, 255, .8); }
.msg { font-size: 15px; line-height: 1.75; animation: msgIn .5s var(--ease-out); }
.msg--user { align-self: flex-end; max-width: 86%; padding: 10px 14px; border-radius: 16px 16px 5px 16px; background: #efefec; }
.msg--sys { align-self: center; font: 400 11.5px var(--mono); color: var(--ink-3); }
@keyframes msgIn { from { opacity: 0; transform: translateY(10px); } }
.step { display: grid; grid-template-columns: 22px 1fr auto; gap: 4px 12px; align-items: center; padding: 11px 13px; border-radius: 12px; background: #fff; box-shadow: 0 0 0 1px var(--line); animation: msgIn .45s var(--ease-out); position: relative; }
.step__ico { width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--ink-4); display: grid; place-items: center; transition: all .35s ease; }
.step.is-run .step__ico { border-color: var(--ink); border-right-color: transparent; animation: spin .8s linear infinite; }
.step.is-ok .step__ico { border-color: var(--ok); background: var(--ok); }
.step.is-ok .step__ico::after { content: ""; width: 7px; height: 3.5px; border: 1.6px solid #fff; border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px, -1px); }
.step.is-wait .step__ico { border-color: var(--warn); }
.step__t { font-size: 14px; font-weight: 600; }
.step__d { grid-column: 2 / 4; font-size: 13px; color: var(--ink-3); }
.step__d .num { font-size: 12px; }
.step__kind { font: 500 10.5px var(--mono); padding: 2px 7px; border-radius: 5px; box-shadow: 0 0 0 1px var(--line-2) inset; color: var(--ink-3); }
.step__kind--guard { box-shadow: none; background: var(--warn-soft); color: var(--warn); }
.step .btn { grid-column: 2 / 4; justify-self: start; margin-top: 6px; }
@keyframes spin { to { transform: rotate(360deg); } }
.plan-card { padding: 13px 15px; border-radius: 14px; background: #fff; box-shadow: 0 0 0 1px var(--line); animation: msgIn .45s var(--ease-out); position: relative; }
.plan-card header { display: flex; justify-content: space-between; align-items: center; font-weight: 600; font-size: 14px; }
.plan-card header span { font: 500 11px var(--mono); padding: 2px 7px; border-radius: 5px; background: var(--warn-soft); color: var(--warn); }
.plan-card header span.ok { background: var(--ok-soft); color: var(--ok); }
.plan-card ol { margin: 8px 0 0; padding-left: 20px; display: grid; gap: 3px; font-size: 13.5px; color: var(--ink-2); }
.plan-card .btn { margin-top: 12px; }
.plan-card li { transition: color .3s ease; }
.plan-card li::marker { font: 500 12px var(--mono); }
.plan-card li.cur { color: var(--ink); font-weight: 560; }
.plan-card li.done { color: var(--ink-3); }
.plan-card li.done::after { content: " ✓"; color: var(--ok); font-weight: 600; }

/* ───────── Charts ───────── */
.charts { position: relative; width: var(--wrap); margin: 0 auto; border-radius: 22px; padding: 8px; }
.charts__tabs { position: relative; display: flex; gap: 2px; padding: 3px; margin: 4px 4px 6px; border-radius: 999px; background: rgba(16, 19, 24, .045); overflow-x: auto; scrollbar-width: none; z-index: 2; }
.charts__tabs::-webkit-scrollbar { display: none; }
.charts__tabs button { position: relative; z-index: 2; flex: 1 0 auto; height: 34px; padding: 0 14px; border: 0; border-radius: 999px; background: transparent; cursor: pointer; font-size: 13px; color: var(--ink-3); white-space: nowrap; transition: color .3s ease; }
.charts__tabs button[aria-selected="true"] { color: var(--ink); font-weight: 560; }
.charts__thumb { position: absolute; z-index: 1; top: 3px; bottom: 3px; left: 0; border-radius: 999px; background: #fff; box-shadow: 0 0 0 1px rgba(16, 19, 24, .05), 0 4px 12px -6px rgba(16, 19, 24, .3); transform: translateX(var(--tx, 0)); width: var(--tw, 0); }
.charts__body { position: relative; z-index: 2; display: grid; grid-template-columns: 1fr 280px; gap: 8px; }
.charts__plot { position: relative; height: 440px; border-radius: 16px; background: #fff; box-shadow: 0 0 0 1px var(--line); overflow: hidden; touch-action: pan-y; }
.charts__plot svg { display: block; width: 100%; height: 100%; }
.charts__aside { padding: 20px 16px 16px 14px; display: flex; flex-direction: column; }
.charts__kind { margin: 0 0 8px; font: 500 11px var(--mono); letter-spacing: .1em; color: var(--accent-2); }
.charts__kind.demo { color: var(--warn); }
.charts__aside h3 { margin: 0 0 10px; font: 620 18px/1.4 var(--display); letter-spacing: -.01em; }
.charts__aside > p { margin: 0; font-size: 14px; line-height: 1.75; color: var(--ink-2); }
.charts__stats { margin: 16px 0 0; display: grid; grid-template-columns: auto 1fr; border-top: 1px solid var(--line); font-size: 13px; }
.charts__stats dt, .charts__stats dd { padding: 6px 0; border-bottom: 1px solid var(--line); }
.charts__stats dt { color: var(--ink-3); }
.charts__stats dd { margin: 0; text-align: right; font: 500 12.5px var(--mono); font-variant-numeric: tabular-nums; }
.tip { position: absolute; z-index: 5; left: 0; top: 0; padding: 7px 10px; border-radius: 8px; background: var(--ink); color: #fff; font: 400 12px/1.55 var(--mono); pointer-events: none; white-space: nowrap; box-shadow: 0 8px 20px -8px rgba(16, 19, 24, .5); }
.tip b { font-family: var(--font); font-weight: 560; }

.ax line, .ax path { stroke: rgba(16, 19, 24, .07); }
.ax .tick { stroke: rgba(16, 19, 24, .3); }
.ax text, .lbl { font: 400 11.5px var(--mono); fill: var(--ink-3); }
.lbl--strong { font-family: var(--font); font-size: 12.5px; fill: var(--ink); font-weight: 500; }
.charts__plot text { paint-order: stroke; stroke: rgba(255, 255, 255, .95); stroke-width: 4px; stroke-linejoin: round; }
.zero { stroke: rgba(16, 19, 24, .35); stroke-dasharray: 2 4; }
.mk { transition: transform .9s var(--ease-out), opacity .5s ease, stroke-dashoffset 1.3s var(--ease-out); transition-delay: var(--dl, 0ms); }
.mk-x { transform: scaleX(0); transform-box: fill-box; transform-origin: var(--o, center); }
.mk-y { transform: scaleY(0); transform-box: fill-box; transform-origin: bottom; }
.mk-s { transform: scale(0); transform-box: fill-box; transform-origin: center; opacity: 0; }
.mk-f { opacity: 0; }
.mk-d { stroke-dasharray: var(--len); stroke-dashoffset: var(--len); }
.mk-band { clip-path: inset(0 100% 0 0); transition: clip-path 1.5s var(--ease-out); transition-delay: var(--dl, 0ms); }
.is-drawn .mk-x, .is-drawn .mk-y, .is-drawn .mk-s { transform: none; opacity: 1; }
.is-drawn .mk-f { opacity: 1; }
.is-drawn .mk-d { stroke-dashoffset: 0; }
.is-drawn .mk-band { clip-path: inset(0 0 0 0); }
.hover-line { stroke: var(--ink); stroke-width: .8; stroke-dasharray: 2 3; opacity: 0; transition: opacity .2s ease; }
.hover-dot { fill: #fff; stroke: var(--accent); stroke-width: 2; opacity: 0; transition: opacity .2s ease; }
.is-hover .hover-line, .is-hover .hover-dot { opacity: 1; }

/* Large panels rise into place with the scroll itself (set by JS as --rise 0→1). */
[data-rise] { translate: 0 calc((1 - var(--rise, 1)) * 56px); scale: calc(.965 + var(--rise, 1) * .035); }
html.reduce-motion [data-rise] { translate: none; scale: none; }
.charts__plot svg { transition: opacity .2s ease, filter .2s ease; }
.charts__plot.is-out svg { opacity: 0; filter: blur(3px); }

/* ───────── Capabilities ───────── */
.stats { width: var(--wrap); margin: 0 auto; display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line-2); border-bottom: 1px solid var(--line); }
.stat { padding: 26px 22px 24px 0; display: grid; gap: 8px; align-content: start; }
.stat + .stat { padding-left: 22px; border-left: 1px solid var(--line); }
.stat b { font: 600 clamp(30px, 3vw, 40px)/1 var(--display); letter-spacing: -.03em; font-variant-numeric: tabular-nums; color: var(--ink); }
.stat b small { font-size: .5em; letter-spacing: 0; color: var(--ink-3); font-weight: 500; }
.stat > span { font-size: 13.5px; color: var(--ink-2); line-height: 1.6; }
.stats--two { grid-template-columns: repeat(2, 1fr); margin-bottom: clamp(28px, 5vh, 48px); }


/* Capability cards: a one-line summary, then a spec sheet of grouped tags. */
.caps { width: var(--wrap); margin: 0 auto; display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.cap { border-radius: 20px; padding: 26px 28px 24px; display: grid; gap: 18px; align-content: start; }
.cap > * { position: relative; z-index: 2; }
.cap h3 { margin: 0; font: 620 16.5px/1.4 var(--display); letter-spacing: -.005em; }
.cap__spec { margin: 0; display: grid; gap: 11px; padding-top: 14px; border-top: 1px solid var(--line); }
.cap__spec > div { display: grid; grid-template-columns: 92px 1fr; gap: 12px; align-items: start; }
.cap__spec dt { padding-top: 4px; font: 500 11px/1.5 var(--mono); letter-spacing: .02em; color: var(--ink-3); }
.cap__spec dd { margin: 0; }
.chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.chips li { padding: 2px 9px; border-radius: 6px; font-size: 12.5px; line-height: 1.6; color: var(--ink-2); background: rgba(16, 19, 24, .045); white-space: nowrap; transition: background-color .25s ease, color .25s ease; }
.chips--mono li { font: 12px/1.65 var(--mono); }
.cap:hover .chips li { background: rgba(16, 19, 24, .06); }
.chips li:hover { background: var(--accent-soft) !important; color: var(--accent-2); }
/* Tags arrive one after another once the card is in view. */
.js .cap.reveal .chips li { opacity: 0; translate: 0 5px; }
.js .cap.reveal.in .chips li { opacity: 1; translate: 0 0; transition: opacity .5s var(--ease-out), translate .6s var(--ease-out), background-color .25s ease, color .25s ease; transition-delay: calc(var(--d, 0ms) + 260ms + var(--i) * 32ms), calc(var(--d, 0ms) + 260ms + var(--i) * 32ms), 0s, 0s; }

/* ───────── Precision (same paper, a cooler band) ───────── */
.section--precision { isolation: isolate; }
.section--precision::before {
  content: ""; position: absolute; inset: 0; z-index: -2; pointer-events: none;
  background: linear-gradient(to bottom, transparent, rgba(10, 102, 216, .035) 30%, rgba(10, 102, 216, .035) 70%, transparent);
}
.converge { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; }
.digits { width: var(--wrap); margin: 0 auto 40px; }
.digits__label { display: block; font: 400 11.5px var(--mono); letter-spacing: .08em; color: var(--ink-3); margin-bottom: 12px; }
.digits__num { font: 400 clamp(28px, 4.6vw, 64px)/1 var(--mono); letter-spacing: -.02em; display: flex; flex-wrap: wrap; font-variant-numeric: tabular-nums; }
.digit { display: inline-block; height: 1em; overflow: hidden; position: relative; -webkit-mask: linear-gradient(transparent, #000 18%, #000 82%, transparent); mask: linear-gradient(transparent, #000 18%, #000 82%, transparent); }
.digit:not(:has(.digit__col)) { -webkit-mask: none; mask: none; }
.digit__col { display: flex; flex-direction: column; transform: translateY(0); transition: transform 1.6s var(--ease-out); transition-delay: var(--dl, 0ms); }
.digit__col span { height: 1em; line-height: 1; }
.digits__num .digit:nth-child(n+8) { color: var(--ink-4); }

.ladder { width: var(--wrap); margin: 0 auto; border-radius: 18px; padding: clamp(20px, 2.6vw, 30px); }
.ladder > * { position: relative; z-index: 2; }
.ladder__head { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; font-size: 14px; }
.ladder__head b { font-weight: 560; }
.ladder__head span { font: 400 11.5px var(--mono); color: var(--ink-3); }
.ladder__scale { display: flex; justify-content: space-between; margin: 0 92px 8px calc(min(300px, 34%) + 16px); font: 400 10.5px var(--mono); color: var(--ink-4); }
.ladder__rows { display: grid; gap: 14px; }
.rung { display: grid; grid-template-columns: min(300px, 34%) 1fr 76px; gap: 16px; align-items: center; font-size: 13.5px; }
.rung__name { color: var(--ink-2); }
.rung__bar { position: relative; height: 6px; border-radius: 3px; background: rgba(16, 19, 24, .05); overflow: hidden; }
.rung__bar i { position: absolute; inset: 0; width: calc(var(--e) / 16 * 100%); border-radius: 3px; background: linear-gradient(90deg, rgba(10, 102, 216, .25), var(--accent)); transform: scaleX(0); transform-origin: left; transition: transform 1.6s var(--ease-out); }
.ladder.in .rung__bar i { transform: scaleX(1); }
.ladder.in .rung:nth-child(2) i { transition-delay: .15s; }
.ladder.in .rung:nth-child(3) i { transition-delay: .3s; }
.ladder.in .rung:nth-child(4) i { transition-delay: .45s; }
.rung__val { font: 500 13px var(--mono); text-align: right; color: var(--ink); }
.gate { width: var(--wrap); margin: 28px auto 0; display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line-2); }
.gate__item { padding: 22px 20px 0 0; display: grid; gap: 6px; }
.gate__item + .gate__item { padding-left: 20px; border-left: 1px solid var(--line); }
.gate__item b { font: 600 clamp(24px, 2.4vw, 32px)/1 var(--display); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.gate__item b small { font-size: .55em; color: var(--ink-3); }
.gate__item span { font-size: 13px; color: var(--ink-2); }

/* ───────── Gallery ───────── */
.gallery { display: flex; gap: 20px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; padding: 10px max(32px, calc((100% - 1120px) / 2)) 30px; scroll-padding: 0 max(32px, calc((100% - 1120px) / 2)); overscroll-behavior-x: contain; }
.gallery::-webkit-scrollbar { display: none; }
.shot { flex: 0 0 min(80vw, 860px); margin: 0; scroll-snap-align: center; transform: scale(calc(.94 + var(--f, 1) * .06)); opacity: calc(.4 + var(--f, 1) * .6); transition: transform .2s linear, opacity .2s linear; }
.shot img { width: 100%; height: auto; border-radius: 12px; box-shadow: 0 0 0 1px var(--line-2), 0 24px 50px -30px rgba(16, 19, 24, .4); }
.shot figcaption { padding: 14px 2px 0; font-size: 13.5px; color: var(--ink-3); }
.shot figcaption b { color: var(--ink); font-weight: 560; margin-right: 10px; }
.gallery__nav { display: flex; align-items: center; justify-content: center; gap: 14px; }
.gallery__nav .icon-btn { width: 40px; height: 40px; color: var(--ink); }
.gallery__dots { display: flex; gap: 6px; }
.gallery__dots button { width: 6px; height: 6px; padding: 0; border: 0; border-radius: 3px; background: rgba(16, 19, 24, .18); cursor: pointer; transition: width .45s var(--ease-out), background .3s ease; }
.gallery__dots button.on { width: 22px; background: var(--ink); }

/* ───────── Closing & footer ───────── */
.closing { padding-bottom: 110px; overflow: clip; }
/* Slow, faint rings spreading from behind the closing card. */
.rings { position: absolute; left: 50%; top: 50%; width: 0; height: 0; z-index: -1; pointer-events: none; }
.rings i { position: absolute; left: -360px; top: -360px; width: 720px; height: 720px; border-radius: 50%; border: 1px solid rgba(16, 19, 24, .09); opacity: 0; animation: ring 9s linear infinite; animation-play-state: var(--play, paused); }
.rings i:nth-child(2) { animation-delay: 3s; }
.rings i:nth-child(3) { animation-delay: 6s; }
@keyframes ring { 0% { transform: scale(.35); opacity: 0; } 15% { opacity: 1; } 100% { transform: scale(1.6); opacity: 0; } }
.closing__card { width: min(780px, calc(100% - 48px)); margin: 0 auto; border-radius: 28px; padding: clamp(40px, 6vw, 72px) 24px; text-align: center; display: grid; justify-items: center; }
.closing__card > * { position: relative; z-index: 2; }
.closing__card img { margin-bottom: 18px; }
.closing__card .lede { margin-left: auto; margin-right: auto; }
.closing__card .hero__cta { justify-content: center; margin-top: 30px; }
.caps, .closing { perspective: 1100px; }
.foot { padding: 36px 0 56px; border-top: 1px solid var(--line); }
.foot__inner { width: var(--wrap); margin: 0 auto; font-size: 12.5px; color: var(--ink-3); line-height: 1.85; }
.foot__inner b { color: var(--ink-2); font-weight: 560; }
.foot__meta { display: flex; flex-wrap: wrap; gap: 8px 24px; margin-top: 16px; font-family: var(--mono); font-size: 11.5px; }
.toast { position: fixed; left: 50%; bottom: max(24px, env(safe-area-inset-bottom)); z-index: 60; padding: 10px 18px; border-radius: 999px; font-size: 14px; transform: translateX(-50%); animation: toastIn .45s var(--ease-out); }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 12px); } }

/* ───────── Responsive ───────── */
@media (max-width: 1080px) {
  .nav__links { display: none; }
  .nav__menu { display: inline-grid; }
  .nav__tools { margin-left: auto; }
  .stats, .gate { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(3), .gate__item:nth-child(3) { padding-left: 0; border-left: 0; }
  .charts__body { grid-template-columns: 1fr; }
  .charts__aside { padding: 8px 12px 12px; }
}
@media (max-width: 900px) {
  .caps { grid-template-columns: 1fr; }
  :root { --wrap: calc(100% - 40px); }
  .hero { padding: 96px 0 48px; align-items: start; }
  .hero__grid { grid-template-columns: 1fr; gap: 28px; }
  .hero__plot { aspect-ratio: 1.45; }
  .story { height: 620vh; }
  .story__pin { width: calc(100% - 32px); grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); align-items: stretch; gap: 12px; padding-top: 80px; padding-bottom: 14px; }
  .story__title { display: none; }
  .story__copy { min-width: 0; }
  .steps { grid-auto-flow: column; grid-auto-columns: 1fr; border-left: 0; border-bottom: 1px solid var(--line); }
  .steps button { grid-template-columns: 1fr; padding: 6px 4px 9px; text-align: center; }
  .steps em { display: none; }
  .steps strong { font-size: 13.5px; }
  .steps b { font-size: 10.5px; line-height: 1.5; }
  .steps i { left: 20%; right: 20%; top: auto; bottom: -1px; width: auto; height: 1.5px; transform-origin: left; transform: scaleX(var(--sp, 0)); }
  .story__caption { display: block; }
  .stage { height: auto; min-height: 0; }
  .stage__body { grid-template-columns: 1fr; grid-template-rows: 50% 50%; }
  .chat { border-left: 0; border-top: 1px solid var(--line); }
  .chat__head, .stage__tabs { display: none; }
  .node[data-node="0"] { --nx: 1% !important; --ny: 24% !important; }
  .node[data-node="1"] { --nx: 20.5% !important; --ny: 24% !important; }
  .node[data-node="2"] { --nx: 40% !important; --ny: 11% !important; }
  .node[data-node="3"] { --nx: 40% !important; --ny: 37% !important; }
  .node[data-node="4"] { --nx: 59.5% !important; --ny: 24% !important; }
  .node[data-node="5"] { --nx: 79% !important; --ny: 24% !important; }
  .node { width: 18.5%; padding: 5px 6px; font-size: 10px; }
  .node small { font-size: 7px; }
  .node b { font-size: 10.5px; }
  .node span { display: none; }
  .result-card { grid-template-columns: 1fr; padding: 8px 12px; gap: 0; bottom: 4%; }
  .result-card .ci { display: none; }
  .result-card__big { font-size: 22px; }
  .result-card__meta { font-size: 10.5px; }
  .report { padding: 12px 14px; left: 3%; right: 3%; top: 3%; gap: 6px; }
  .report header b { font-size: 14px; }
  .report p { font-size: 11.5px; line-height: 1.7; }
  .rtable { font-size: 10px; }
  .rtable caption { font-size: 10px; }
  .rtable th, .rtable td { padding: 2px 4px; }
  .report footer { display: none; }
  .preview { left: 3%; right: 3%; top: 4%; padding: 10px 10px 6px; }
  .preview table { font-size: 10.5px; }
  .preview th, .preview td { padding: 3px 5px; }
  .preview__roles { margin-left: 0; width: 100%; }
  .egress { grid-template-columns: 1fr; grid-template-rows: auto; }
  .egress__gate { height: 34px; }
  .egress__wall { top: 50%; bottom: auto; left: 8px; right: 8px; width: auto; height: 1px; background: repeating-linear-gradient(to right, var(--ink-3) 0 3px, transparent 3px 6px); }
  .egress__label { writing-mode: horizontal-tb; padding: 0 8px; }
  .egress__rows i.try { transform: translateY(8px); }
  .stage__tabs { display: none; }
  .bento { grid-template-columns: 1fr; }
  .card--wide, .bento > .card:nth-child(4) { grid-column: auto; grid-template-columns: 1fr; }
  .agent { grid-template-columns: minmax(0, 1fr); }
  .agent__copy { position: static; }
  .console { height: 600px; }
  .ladder__scale { display: none; }
}
@media (max-width: 560px) {
  .cap { padding: 20px 18px 18px; gap: 14px; }
  .cap__spec > div { grid-template-columns: 1fr; gap: 6px; }
  .cap__spec dt { padding-top: 0; }
  .nav__bar { padding-left: 14px; }
  .nav [data-share] { display: none; }
  .hero__title { font-size: clamp(28px, 8.6vw, 40px); }
  .ask__text { min-height: 4.95em; }
  .egress__audit { align-items: flex-start; }
  .egress__audit code { white-space: normal; }
  .stats, .gate, .caps { grid-template-columns: 1fr; }
  .stat, .stat + .stat, .gate__item, .gate__item + .gate__item { padding: 16px 0; border-left: 0; grid-template-columns: 96px 1fr; align-items: baseline; gap: 14px; }
  .stat + .stat { border-top: 1px solid var(--line); }
  .gate__item + .gate__item { border-top: 1px solid var(--line); }
  .stat b { font-size: 26px; }
  .gate__item b { font-size: 22px; }
  .rung { grid-template-columns: 1fr auto; gap: 6px 10px; }
  .rung__bar { grid-column: 1 / -1; grid-row: 2; }
  .charts { padding: 5px; border-radius: 18px; }
  .charts__plot { height: 330px; border-radius: 13px; }
  .chat__scroll { padding: 10px; font-size: 12.5px; gap: 7px; }
  .plan { padding: 8px 10px; }
  .plan ol { font-size: 11.5px; gap: 2px; }
  .plan__approve { height: 26px; margin-top: 6px; }
  .msg { font-size: 14.5px; }
  .shot { flex-basis: 86vw; }
  .seg { display: grid; width: 100%; }
  .seg button { padding: 0 8px; font-size: 13px; }
  .console__head { flex-wrap: wrap; row-gap: 4px; padding: 10px 14px; }
  .console__head .lights { display: none; }
  .console__mode, .console__tag { white-space: nowrap; }
  .console__tag { margin-left: 0; width: 100%; }
  .ask__text { font-size: 15px; }
  .closing__card .hero__cta { flex-direction: column; align-items: stretch; width: 100%; padding: 0 8px; }
}

/* ───────── Reduced motion: cross-fades only ───────── */
html.reduce-motion .reveal, html.reduce-motion .curtain { filter: none !important; transform: none !important; clip-path: none !important; }
html.reduce-motion .reveal.in, html.reduce-motion .curtain.in { transition: opacity .4s ease !important; }
html.reduce-motion .ch { filter: none; transform: none; }
html.reduce-motion .is-streaming .ch { animation: fadeOnly .3s ease forwards; animation-delay: calc(var(--i) * 6ms); }
@keyframes fadeOnly { to { opacity: 1; } }
html.reduce-motion .cap .chips li { translate: none; transition-delay: 0s !important; }
html.reduce-motion .caret, html.reduce-motion .num.ok { animation: none; }
.ask.is-typing .caret { animation: none; opacity: 1; }
html.reduce-motion .hero__copy { filter: none; transform: none; }
html.reduce-motion .press, html.reduce-motion .press.is-pressed { transform: none; }
html.reduce-motion .ripple, html.reduce-motion .wave { display: none; }
html.reduce-motion .msg, html.reduce-motion .step, html.reduce-motion .plan-card, html.reduce-motion .sheet, html.reduce-motion .toast { animation-name: fadeOnly; }
html.reduce-motion .mk, html.reduce-motion .mk-band, html.reduce-motion .digit__col, html.reduce-motion .rung__bar i { transition-duration: .01s !important; transition-delay: 0s !important; }
html.reduce-motion .cap, html.reduce-motion .closing__card { rotate: none !important; }
html.reduce-motion .paper__spot, html.reduce-motion .rings { display: none; }

/* ═════════ V11: lineage branches, figure wall, report, models ═════════ */

/* Lineage: fork, parallel, compare, rewind, merge */
.lin { width: var(--wrap); margin: 0 auto; border-radius: 22px; padding: 14px; }
.lin > * { position: relative; z-index: 2; }
.lin__bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 2px 2px 12px; }
.lin__phases { display: flex; flex-wrap: wrap; gap: 4px; }
.lin__phases button { display: inline-flex; align-items: center; gap: 7px; border: 0; padding: 6px 12px 6px 7px; border-radius: 999px; font-size: 13px; color: var(--ink-3); background: transparent; cursor: pointer; transition: background-color .25s ease, color .25s ease; }
.lin__phases button i { width: 19px; height: 19px; border-radius: 50%; display: grid; place-items: center; font: 500 10.5px var(--mono); font-style: normal; box-shadow: 0 0 0 1px var(--line-2) inset; transition: background-color .3s ease, color .3s ease, box-shadow .3s ease; }
.lin__phases button:hover { color: var(--ink); background: rgba(16, 19, 24, .04); }
.lin__phases button.on { color: var(--ink); background: rgba(16, 19, 24, .06); font-weight: 560; }
.lin__phases button.on i { background: var(--accent); color: #fff; box-shadow: none; }
.lin__phases button.done i { background: var(--ok-soft); color: var(--ok); box-shadow: none; }
.lin__body { display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 14px; }
.lin__graph { position: relative; height: 400px; border-radius: 14px; overflow: hidden; background-color: #fbfbfa; background-image: radial-gradient(rgba(16, 19, 24, .1) .8px, transparent 1px); background-size: 16px 16px; box-shadow: 0 0 0 1px var(--line) inset; }
.lin__edges { position: absolute; inset: 0; width: 100%; height: 100%; }
.lin__edges path { fill: none; stroke: rgba(16, 19, 24, .3); stroke-width: 1.3; transition: opacity .3s ease; }
.lin__edges path.fork { stroke: var(--accent); stroke-width: 1.5; }
.lin__edges path.rewound { stroke: var(--ink-4); }
.fork-mark { transition: opacity .3s ease; }
.fork-mark circle { fill: #fff; stroke: var(--accent); stroke-width: 1.3; }
.fork-mark path { fill: none; stroke: var(--accent); stroke-width: 1.4; stroke-linecap: round; }
.lgn { position: absolute; min-height: 52px; white-space: nowrap; padding: 7px 10px 6px; border-radius: 10px; background: #fff; font-size: 12px; line-height: 1.35;
  box-shadow: 0 0 0 1px var(--line-2), 0 10px 22px -16px rgba(16, 19, 24, .4);
  opacity: var(--v, 0); transform: translateY(calc((1 - var(--v, 0)) * 8px)) scale(calc(.94 + var(--v, 0) * .06)); }
.lgn small { display: block; font: 500 8.5px var(--mono); letter-spacing: .1em; color: var(--ink-3); }
.lgn b { display: block; font-size: 13px; font-weight: 620; }
.lgn span { display: block; font: 400 10px/1.35 var(--mono); color: var(--ink-3); white-space: normal; overflow-wrap: anywhere; }
.lgn strong { display: block; margin-top: 1px; font: 500 11px var(--mono); color: var(--ink); white-space: nowrap; transition: color .25s ease; }
.lgn--model strong { color: var(--accent-2); }
.btn[hidden] { display: none; }
.lgn--model { box-shadow: 0 0 0 1px rgba(10, 102, 216, .3), 0 10px 22px -16px rgba(10, 102, 216, .5); }
.lgn--report { background: #f3f7fd; box-shadow: 0 0 0 1px rgba(10, 102, 216, .45), 0 10px 22px -16px rgba(10, 102, 216, .5); }
.lgn--bad strong { color: var(--bad); }
.lgn.is-run strong { color: transparent; }
.lgn.is-run::after { content: ""; position: absolute; right: 9px; top: 9px; width: 11px; height: 11px; border-radius: 50%; border: 1.5px solid var(--accent); border-right-color: transparent; animation: spin .8s linear infinite; }
.lgn--rw { opacity: calc(var(--v, 0) * (1 - var(--rw, 0) * .62)); filter: grayscale(var(--rw, 0)); }
.lgn__rw { position: absolute; right: 8px; top: 7px; font: 500 9px var(--mono); font-style: normal; color: var(--bad); opacity: 0; transition: opacity .3s ease; }
.lgn.is-rewound .lgn__rw { opacity: 1; }
.lgn.is-rewound b { text-decoration: line-through; text-decoration-color: rgba(177, 58, 50, .6); }
.lgn__par { position: absolute; right: 8px; top: 7px; font: 500 9px var(--mono); font-style: normal; color: var(--accent); opacity: 0; transition: opacity .3s ease; }
.lin__graph.is-parallel .lgn__par { opacity: 1; }
.lin__graph.is-parallel .lgn--test { box-shadow: 0 0 0 1.5px var(--accent), 0 0 0 6px rgba(10, 102, 216, .08); }
.lin__side { display: grid; align-content: start; gap: 12px; padding: 4px 2px; }
.lin__cap { margin: 0; min-height: 5.2em; font-size: 14.5px; line-height: 1.75; color: var(--ink); }
.lin__cap.swap, .mp__note.swap { animation: capIn .45s var(--ease-out); }
@keyframes capIn { from { opacity: 0; translate: 0 5px; } }
.lin__cmp { padding: 12px 12px 8px; border-radius: 12px; background: #fff; box-shadow: 0 0 0 1px var(--line); opacity: var(--v, 0); translate: 0 calc((1 - var(--v, 0)) * 8px); }
.lin__cmp header { margin-bottom: 4px; font: 500 10.5px var(--mono); color: var(--ink-3); }
.lin__cmp svg { display: block; width: 100%; overflow: visible; }
.lin__cmp .g { stroke: rgba(16, 19, 24, .07); }
.lin__cmp .tk { font: 400 9px var(--mono); fill: var(--ink-3); }
.cr { opacity: var(--v, 0); transition: opacity .3s ease; }
.cr .nm { font: 500 10px var(--mono); fill: var(--ink-2); }
.cr .ci { stroke: var(--ink); stroke-width: 1.6; }
.cr .pt { fill: var(--ink); }
.cr.iv .ci { stroke: var(--accent); }
.cr.iv .pt { fill: var(--accent); }
.cr .strike { stroke: var(--bad); stroke-width: 1; opacity: 0; transition: opacity .3s ease; }
.cr.is-rewound { opacity: .42; }
.cr.is-rewound .strike { opacity: .8; }
.lin__src { margin: 0; font: 400 11px var(--mono); color: var(--ink-3); }

/* Figure wall */
.figwall { width: var(--wrap); margin: 28px auto 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.fig { margin: 0; padding: 12px 12px 10px; border-radius: 14px; background: rgba(255, 255, 255, .74); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); box-shadow: 0 0 0 1px var(--line); transition: transform .45s var(--ease-out), box-shadow .3s ease; }
.fig:hover { transform: translateY(-2px); box-shadow: 0 0 0 1px var(--line-2), 0 16px 32px -22px rgba(16, 19, 24, .4); }
.fig svg { display: block; width: 100%; height: auto; overflow: visible; }
.fig figcaption { display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px 8px; margin-top: 6px; font-size: 12.5px; }
.fig figcaption b { font-weight: 600; }
.fig figcaption code { padding: 0; background: none; font-size: 10.5px; color: var(--ink-3); }
.fig figcaption em { margin-left: auto; font: 500 10px var(--mono); font-style: normal; color: var(--ok); }
.fig--demo figcaption em { color: var(--ink-3); }
.fig .gl { stroke: rgba(16, 19, 24, .07); }
.fig .ax { stroke: rgba(16, 19, 24, .25); }
.fig .tk { font: 400 8px var(--mono); fill: var(--ink-3); }
.fig .tk--k { fill: var(--ink-2); }
.fig .leg { font: 500 8px var(--mono); }
.fig .pt { fill: var(--ink); }
.fig .ln { fill: none; stroke: var(--accent); stroke-width: 1.7; }
.fig .ln2 { fill: none; stroke: #9aa0a8; stroke-width: 1.4; }
.fig .bar, .fig .hbar { fill: rgba(16, 19, 24, .72); }
.fig .bar--b { fill: var(--accent); }
.fig .bx { fill: rgba(16, 19, 24, .07); stroke: var(--ink); stroke-width: 1; }
.fig .bx--b { fill: var(--accent-soft); stroke: var(--accent); }
.fig .md { stroke: var(--ink); stroke-width: 1.8; }
.fig .wh { stroke: var(--ink); stroke-width: 1; }
.fig .ci { stroke-width: 1.5; }
.fig .zero { stroke: rgba(16, 19, 24, .3); }
.fig .ind { fill: none; stroke: rgba(16, 19, 24, .25); }
.fig .ind--on { fill: var(--ink); stroke: none; }
.fig .cv { font: 500 7.5px var(--mono); fill: var(--ink); }
.fig .cv--on { fill: #fff; }
/* Marks grow from their origin once the tile is in view. */
.js .fig { opacity: 0; translate: 0 12px; }
.fig.in { opacity: 1; translate: 0 0; transition: opacity .7s var(--ease-out) calc(var(--i) * 70ms), translate .8s var(--ease-out) calc(var(--i) * 70ms), transform .45s var(--ease-out), box-shadow .3s ease; }
.js .fig .pt, .js .fig .cell, .js .fig .box { opacity: 0; }
.fig.in .pt { opacity: .5; transition: opacity .5s ease calc(var(--i) * 70ms + 300ms + var(--d, 0ms)); }
.fig.in .pt--k { opacity: 1; }
.fig.in .cell, .fig.in .box { opacity: 1; transition: opacity .5s ease calc(var(--i) * 70ms + 300ms + var(--d, 0ms)); }
.js .fig .dr { stroke-dasharray: 900; stroke-dashoffset: 900; }
.fig.in .dr { stroke-dashoffset: 0; transition: stroke-dashoffset 1.4s var(--ease-out) calc(var(--i) * 70ms + 400ms + var(--d, 0ms)); }
.js .fig .bar, .js .fig .hbar, .js .fig .ci { transform-box: fill-box; transform: scale(0); }
.js .fig .bar { transform-origin: 50% 100%; transform: scaleY(0); }
.js .fig .hbar { transform-origin: 0 50%; transform: scaleX(0); }
.js .fig .ci { transform-origin: 50% 50%; }
.fig.in .bar, .fig.in .hbar, .fig.in .ci { transform: none; transition: transform .8s var(--ease-out) calc(var(--i) * 70ms + 300ms + var(--d, 0ms)); }

/* Report */
.rp { width: var(--wrap); margin: 0 auto; display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 28px; align-items: start; position: relative; }
.rp__side { position: sticky; top: 96px; display: grid; gap: 16px; justify-items: start; }
.rp__outline { list-style: none; margin: 0; padding: 0; display: grid; border-left: 1px solid var(--line-2); }
.rp__outline button { margin-left: -1px; padding: 6px 12px; border: 0; border-left: 2px solid transparent; background: none; text-align: left; font-size: 13px; color: var(--ink-3); cursor: pointer; transition: color .25s ease, border-color .25s ease; }
.rp__outline button:hover { color: var(--ink); }
.rp__outline button.on { color: var(--ink); border-left-color: var(--accent); font-weight: 560; }
.rp__hint { margin: 0; font-size: 12px; color: var(--ink-3); }
.rp__formats { display: flex; flex-wrap: wrap; gap: 5px; }
.rp__formats span { padding: 3px 8px; border-radius: 6px; font: 500 11px var(--mono); color: var(--ink-2); box-shadow: 0 0 0 1px var(--line-2) inset; }
.doc { height: min(78vh, 760px); overflow-y: auto; border-radius: 20px; padding: clamp(26px, 4vw, 52px) clamp(22px, 5vw, 68px); background: rgba(255, 255, 255, .88); overscroll-behavior: contain; outline: none; }
.doc > * { position: relative; z-index: 2; }
.doc__kicker { margin: 0 0 10px; font: 500 10.5px var(--mono); letter-spacing: .12em; color: var(--ink-3); }
.doc__title { margin: 0; min-height: 1.3em; font: 650 clamp(21px, 2.2vw, 27px)/1.3 var(--serif); letter-spacing: -.01em; }
.doc__meta { margin: 10px 0 0; padding-bottom: 18px; border-bottom: 1px solid var(--line); font: 400 11.5px var(--mono); color: var(--ink-3); }
.doc__sec { margin-top: 26px; opacity: .2; transition: opacity .5s ease; }
.doc__sec.on { opacity: 1; }
.doc__sec h4 { margin: 0 0 8px; font: 640 15px var(--display); }
.doc__sec > p { margin: 0; font-size: 15px; line-height: 1.9; color: var(--ink-2); }
.doc .cite { cursor: help; }
.doc__tip { position: absolute; z-index: 20; pointer-events: none; padding: 4px 8px; border-radius: 6px; font: 500 10.5px var(--mono); color: #fff; background: var(--ink); white-space: nowrap; opacity: 0; translate: -50% -4px; transition: opacity .15s ease, translate .2s var(--ease-out); }
.doc__tip.on { opacity: 1; translate: -50% -8px; }
.doc__table { width: 100%; margin: 18px 0 4px; border-collapse: collapse; font: 12.5px/1.45 var(--mono); font-variant-numeric: tabular-nums; border-top: 1.5px solid var(--ink); border-bottom: 1.5px solid var(--ink); }
.doc__table caption { caption-side: top; margin-bottom: 8px; text-align: left; font: 600 13px var(--font); }
.doc__table th, .doc__table td { padding: 5px 10px; text-align: right; vertical-align: top; }
.doc__table th:first-child, .doc__table td:first-child { text-align: left; }
.doc__table thead th { border-bottom: 1px solid var(--ink); font-weight: 500; line-height: 1.35; }
.doc__table small { display: block; font-size: 11px; color: var(--ink-3); }
.doc__table tr.sep td { border-top: 1px solid var(--line-2); }
.doc__table tfoot td { padding-top: 8px; border-top: 1px solid var(--ink); text-align: left !important; font: 400 11.5px/1.5 var(--font); color: var(--ink-3); }
.doc__table tbody tr { opacity: 0; transition: opacity .4s ease; }
.doc.is-table .doc__table tbody tr { opacity: 1; }
.doc.is-table .doc__table tbody tr:nth-child(2) { transition-delay: 90ms; }
.doc.is-table .doc__table tbody tr:nth-child(3) { transition-delay: 180ms; }
.doc.is-table .doc__table tbody tr:nth-child(n+4) { transition-delay: 270ms; }
.doc__fig { margin: 18px 0 0; }
.doc__fig svg { display: block; width: 100%; max-width: 520px; overflow: visible; }
.doc__fig .gl { stroke: rgba(16, 19, 24, .08); }
.doc__fig .tk { font: 400 9.5px var(--mono); fill: var(--ink-3); }
.doc__fig .tk--k { fill: var(--ink-2); }
.doc__fig .row { opacity: 0; transition: opacity .5s ease var(--d, 0ms); }
.doc.is-fig .doc__fig .row { opacity: 1; }
.doc__fig .ci { stroke: var(--ink); stroke-width: 1.8; }
.doc__fig circle { fill: var(--ink); }
.doc__fig .row:last-child .ci { stroke: var(--accent); }
.doc__fig .row:last-child circle { fill: var(--accent); }
.doc__fig figcaption { margin-top: 6px; font-size: 12.5px; color: var(--ink-3); }
.doc__path ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.doc__path li { display: grid; grid-template-columns: 92px 1fr auto; gap: 10px; align-items: baseline; font-size: 13px; color: var(--ink-2); opacity: 0; translate: 0 4px; transition: opacity .4s ease, translate .5s var(--ease-out); }
.doc.is-path .doc__path li { opacity: 1; translate: 0 0; }
.doc__path code { padding: 0; background: none; color: var(--ink); }
.doc__path em { font: 500 10.5px var(--mono); font-style: normal; color: var(--ok); }
.doc__path em.x { color: var(--warn); }
.doc__disc { margin: 12px 0 0; font-size: 12.5px; line-height: 1.6; color: var(--ink-3); }

/* Models: bring your own */
.mdl { width: var(--wrap); margin: 0 auto; display: grid; grid-template-columns: minmax(0, .78fr) minmax(0, 1.22fr); gap: clamp(32px, 5vw, 72px); align-items: center; }
.mp { border-radius: 20px; display: grid; grid-template-columns: 186px minmax(0, 1fr); overflow: hidden; background: rgba(255, 255, 255, .74); }
.mp > * { position: relative; z-index: 2; }
.mp__list { padding: 16px 10px; display: grid; align-content: start; gap: 4px; border-right: 1px solid var(--line); background: rgba(16, 19, 24, .02); }
.mp__h { margin: 0 8px 6px; font: 500 10.5px var(--mono); letter-spacing: .06em; color: var(--ink-3); }
.mp__item { display: grid; grid-template-columns: 1fr auto; gap: 0 6px; padding: 8px 10px; border: 0; border-radius: 10px; background: transparent; text-align: left; cursor: pointer; transition: background-color .25s ease, box-shadow .25s ease; }
.mp__item:hover { background: rgba(16, 19, 24, .035); }
.mp__item.on { background: #fff; box-shadow: 0 0 0 1px var(--line-2); }
.mp__item b { font-size: 13.5px; font-weight: 600; }
.mp__item span { grid-column: 1; font: 400 10.5px var(--mono); color: var(--ink-3); }
.mp__item em { grid-row: 1; grid-column: 2; font: 500 10px var(--mono); font-style: normal; color: var(--ok); }
.mp__item em.loc { color: var(--accent-2); }
.mp__add { padding: 8px 10px; font-size: 12.5px; color: var(--ink-3); }
.mp__form { padding: 18px 22px 20px; display: grid; gap: 12px; }
.mp__row { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 12px; align-items: center; }
.mp__row[hidden] { display: none; }
.mp__lab { font-size: 12.5px; color: var(--ink-3); }
.mp__field { min-height: 34px; display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-radius: 9px; background: #fff; box-shadow: 0 0 0 1px var(--line-2) inset; font-size: 13.5px; overflow: hidden; white-space: nowrap; }
.mp__field.mono { font: 400 12.5px var(--mono); }
.mp__field em { margin-left: auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; font: 400 11px var(--font); font-style: normal; color: var(--ok); }
.mp__field.is-typing::after { content: ""; width: 1.5px; height: 1em; background: var(--accent); }
.mp__models { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; font-size: 12.5px; color: var(--ink-3); }
.mp__models.ok { color: var(--ink-2); }
.mp__presets { display: flex; flex-wrap: wrap; gap: 5px; }
.mp__presets button { padding: 5px 10px; border: 0; border-radius: 999px; font-size: 12.5px; color: var(--ink-2); background: rgba(16, 19, 24, .045); cursor: pointer; transition: background-color .25s ease, color .25s ease; }
.mp__presets button:hover { background: rgba(16, 19, 24, .08); }
.mp__presets button.on { color: #fff; background: var(--ink); }
.mp__seg { justify-self: start; display: inline-flex; gap: 2px; padding: 3px; border-radius: 9px; background: rgba(16, 19, 24, .05); }
.mp__seg button { padding: 4px 12px; border: 0; border-radius: 7px; font-size: 12.5px; color: var(--ink-3); background: transparent; cursor: pointer; }
.mp__seg button[aria-checked="true"] { color: var(--ink); background: #fff; box-shadow: 0 1px 2px rgba(16, 19, 24, .12); }
.mp__loc { position: relative; justify-self: start; display: inline-grid; grid-template-columns: 1fr 1fr; padding: 3px; border-radius: 9px; background: rgba(16, 19, 24, .05); }
.mp__loc button { position: relative; z-index: 1; padding: 4px 18px; border: 0; background: transparent; font-size: 12.5px; color: var(--ink-3); cursor: pointer; transition: color .25s ease; }
.mp__loc button[aria-checked="true"] { color: var(--ink); }
.mp__thumb { position: absolute; top: 3px; bottom: 3px; left: 3px; border-radius: 7px; background: #fff; box-shadow: 0 1px 2px rgba(16, 19, 24, .12); transform: translateX(var(--x, 0)); }
.mp__loc[data-v="local"] .mp__thumb { background: #f1f8f4; }
.mp__note { margin: -2px 0 0 84px; min-height: 3.2em; font-size: 12.5px; line-height: 1.6; color: var(--ink-2); }

.foot__gh { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); text-decoration: none; }
.foot__gh:hover { color: var(--ink); }

@media (max-width: 1080px) {
  .lin__body { grid-template-columns: 1fr; }
  .lin__side { grid-template-columns: 1fr 1fr; align-items: start; }
  .lin__src { grid-column: 1 / -1; }
  .figwall { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .rp { grid-template-columns: 1fr; }
  .rp__side { position: static; grid-template-columns: 1fr; }
  .rp__outline { display: none; }
  .mdl { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .figwall { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mp { grid-template-columns: 1fr; }
  .mp__list { grid-auto-flow: column; grid-auto-columns: max-content; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .mp__h, .mp__add { display: none; }
}
@media (max-width: 620px) {
  .lin { padding: 10px; }
  .lin__graph { height: 560px; }
  .lin__side { grid-template-columns: 1fr; }
  .lgn { padding: 6px 8px 5px; }
  .lgn span { font-size: 9.5px; }
  .figwall { grid-template-columns: 1fr; }
  .doc { height: 72vh; }
  .doc__sec > p { font-size: 14.5px; }
  .doc__table { font-size: 11px; }
  .doc__table th, .doc__table td { padding: 4px 5px; }
  .doc__path li { grid-template-columns: 76px 1fr; }
  .doc__path em { grid-column: 2; }
  .mp__form { padding: 16px 14px; }
  .mp__row { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .rail__row { grid-template-columns: 40px minmax(0, 1fr); row-gap: 2px; }
  .rail__row em { grid-column: 2; }
  .rail__dots i { width: 19px; height: 19px; font-size: 9px; }
  .mp__field { white-space: normal; flex-wrap: wrap; row-gap: 2px; }
  .mp__field em { margin-left: 0; }
  .mp__note { margin-left: 0; }
}
html.reduce-motion .fig, html.reduce-motion .fig * { transition: none !important; }
html.reduce-motion .fig { opacity: 1; translate: none; }
html.reduce-motion .fig .pt { opacity: .5; }
html.reduce-motion .fig .pt--k, html.reduce-motion .fig .cell, html.reduce-motion .fig .box { opacity: 1; }
html.reduce-motion .fig .dr { stroke-dashoffset: 0; }
html.reduce-motion .fig .bar, html.reduce-motion .fig .hbar, html.reduce-motion .fig .ci { transform: none; }
