/* excapia.com — "The living mission"
   Palette = the Excapia application tokens (internal/server/static/excapia.css,
   brief V1003): midnight navy surfaces, blue = primary action and objective,
   cyan = execution and AI, amber = recovery/approval, green = verified,
   red = failure. Ice blue carries brand-coloured text (AA on navy). */

@font-face { font-family: "Sora"; src: url("/assets/fonts/sora-latin-wght.woff2") format("woff2"); font-weight: 100 800; font-display: swap; }
@font-face { font-family: "Inter"; src: url("/assets/fonts/inter-latin-wght.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("/assets/fonts/jetbrains-mono-latin-wght.woff2") format("woff2"); font-weight: 100 800; font-display: swap; }

:root {
  --bg: #07111F;
  --bg-2: #091527;
  --surface: #0B1626;
  --surface-2: #112238;
  --line: #1A2A40;
  --line-2: #22364F;
  --text: #E6EDF7;
  --muted: #8A9BB4;
  --dim: #7D8FA9;
  --brand: #2563EB;
  --brand-ink: #FFFFFF;
  --brand-soft: rgba(37, 99, 235, .16);
  --brand-strong: #1D4ED8;
  --ice: #60A5FA;
  --cyan-ink: #67E8F9;
  --focus: #06B6D4;
  --cyan: #06B6D4;
  --cyan-soft: rgba(6, 182, 212, .12);
  --mint: #4ADE80;
  --mint-soft: rgba(74, 222, 128, .13);
  --amber: #FBBF24;
  --amber-soft: rgba(251, 191, 36, .14);
  --red: #F87171;
  --red-soft: rgba(248, 113, 113, .13);
  --font-head: "Sora", "Inter", ui-sans-serif, system-ui, sans-serif;
  --font-body: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --radius: 14px;
  --radius-sm: 9px;
  --wrap: 1240px;
  --gutter: clamp(16px, 4vw, 40px);
  --t-ctrl: 160ms;
  --t-panel: 350ms;
  --t-graph: 650ms;
  --t-chapter: 850ms;
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 84px; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 17px/1.65 var(--font-body); font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
img, svg { max-width: 100%; display: block; }
a { color: var(--ice); text-underline-offset: 3px; }
a:hover { color: var(--text); }
h1, h2, h3, h4 { font-family: var(--font-head); font-weight: 600; line-height: 1.12; letter-spacing: -0.02em; margin: 0 0 .5em; text-wrap: balance; }
h1 { font-size: clamp(2.3rem, 5.2vw, 4.3rem); letter-spacing: -0.035em; }
h2 { font-size: clamp(1.8rem, 3.4vw, 2.85rem); }
h3 { font-size: 1.28rem; letter-spacing: -0.01em; }
p { margin: 0 0 1em; }
code, pre, kbd { font-family: var(--font-mono); font-size: .88em; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 4px; box-shadow: 0 0 0 3px rgba(37, 99, 235, .33); }
::selection { background: rgba(37, 99, 235, .35); }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 16px; top: -60px; z-index: 100; background: var(--brand); color: var(--brand-ink); padding: 10px 16px; border-radius: 8px; font-weight: 600; }
.skip:focus { top: 12px; }
main:focus { outline: none; }
hr { border: 0; border-top: 1px solid var(--line); margin: 14px 0; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.eyebrow { font: 600 .78rem/1.2 var(--font-body); letter-spacing: .16em; text-transform: uppercase; color: var(--ice); margin-bottom: 1rem; }
.eyebrow--cyan { color: var(--cyan); }
.eyebrow--mint { color: var(--mint); }
.eyebrow--amber { color: var(--amber); }
.lead { font-size: clamp(1.06rem, 1.5vw, 1.24rem); color: var(--muted); max-width: 60ch; }
.muted { color: var(--muted); }
.section { padding: clamp(72px, 10vw, 140px) 0; position: relative; }
.section--tight { padding: clamp(56px, 7vw, 96px) 0; }
.section--raised { background: linear-gradient(180deg, var(--bg-2), var(--bg)); border-top: 1px solid var(--line); }
.section-head { max-width: 760px; margin-bottom: clamp(32px, 5vw, 56px); }
.section-head--center { margin-left: auto; margin-right: auto; text-align: center; }
.section-head--center .lead { margin-left: auto; margin-right: auto; }

/* ---------------------------------------------------------------- buttons */
.btn {
  --b: var(--line-2);
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  min-height: 46px; padding: 0 22px; border-radius: 999px; border: 1px solid var(--b);
  font: 600 .98rem/1 var(--font-body); color: var(--text); background: transparent; text-decoration: none; cursor: pointer;
  transition: background var(--t-ctrl) var(--ease), border-color var(--t-ctrl) var(--ease), color var(--t-ctrl), transform var(--t-ctrl);
}
.btn:hover { border-color: var(--muted); color: var(--text); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .42; cursor: not-allowed; }
.btn--primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); box-shadow: 0 6px 28px -10px rgba(37, 99, 235, .65); }
.btn--primary:hover { background: var(--brand-strong); border-color: var(--brand-strong); color: var(--brand-ink); }
.btn--ghost { background: rgba(255, 255, 255, .02); }
.btn--sm { min-height: 38px; padding: 0 16px; font-size: .9rem; }
.btn .arrow { transition: transform var(--t-ctrl) var(--ease); }
.btn:hover .arrow { transform: translateX(3px); }

/* ---------------------------------------------------------------- nav */
.nav { position: sticky; top: 0; z-index: 50; background: rgba(7, 17, 31, .78); backdrop-filter: blur(14px) saturate(1.3); -webkit-backdrop-filter: blur(14px) saturate(1.3); border-bottom: 1px solid rgba(26, 42, 64, .6); }
.nav__inner { max-width: 1400px; margin: 0 auto; padding: 0 var(--gutter); height: 68px; display: flex; align-items: center; gap: 28px; }
.wordmark { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; }
.wordmark__mark { width: 30px; height: 30px; overflow: visible; }
.wm-beacon { fill: var(--brand); }
.wm-ring { fill: none; stroke: var(--brand); stroke-opacity: .35; stroke-width: 1.2; }
.wm-path { fill: none; stroke: var(--cyan); stroke-width: 2.2; stroke-linecap: round; }
.wm-alt { fill: none; stroke: var(--cyan); stroke-opacity: .45; stroke-width: 1.6; stroke-linecap: round; stroke-dasharray: 2 3; }
.wordmark__text { font: 600 1.32rem/1 var(--font-head); letter-spacing: -0.03em; }
/* Tracston family lockup: Tracston logo | product name (as on otopia.one) */
.tracston-wordmark { width: 150px; height: auto; display: block; }
.brand-divider { width: 1px; height: 24px; background: var(--line-2); flex: none; }
.product-wordmark { display: inline-flex; align-items: center; gap: 8px; font: 700 21px/1 var(--font-head); letter-spacing: .06em; text-transform: uppercase; color: #FFFFFF; }
.xmark { width: 26px; height: 26px; flex: none; overflow: visible; }
.wordmark { gap: 12px; }
.footer .tracston-wordmark { width: 170px; }
@media (max-width: 720px) { .tracston-wordmark { width: 108px; } .brand-divider { height: 19px; } .product-wordmark { font-size: 17px; gap: 6px; } .xmark { width: 20px; height: 20px; } .wordmark { gap: 9px; } }
@media (max-width: 380px) { .tracston-wordmark { width: 92px; } .product-wordmark { font-size: 15px; } .xmark { width: 18px; height: 18px; } .wordmark { gap: 7px; } }
.nav__links { flex: 1; }
.nav__links ul { list-style: none; display: flex; gap: 4px; margin: 0; padding: 0; }
.nav__links a { display: block; padding: 8px 12px; border-radius: 8px; color: var(--muted); text-decoration: none; font-weight: 500; font-size: .95rem; transition: color var(--t-ctrl), background var(--t-ctrl); }
.nav__links a:hover { color: var(--text); background: rgba(255, 255, 255, .04); }
.nav__links a[aria-current="page"] { color: var(--text); box-shadow: inset 0 -2px 0 var(--brand); border-radius: 8px 8px 0 0; }
.nav__actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.nav__menu { display: none; width: 44px; height: 44px; border-radius: 10px; border: 1px solid var(--line-2); background: transparent; color: var(--text); cursor: pointer; align-items: center; justify-content: center; }
.nav__menu-bars, .nav__menu-bars::before, .nav__menu-bars::after { display: block; width: 18px; height: 2px; background: currentColor; border-radius: 2px; position: relative; transition: transform var(--t-ctrl); }
.nav__menu-bars::before, .nav__menu-bars::after { content: ""; position: absolute; left: 0; }
.nav__menu-bars::before { top: -6px; } .nav__menu-bars::after { top: 6px; }
.nav__menu[aria-expanded="true"] .nav__menu-bars { background: transparent; }
.nav__menu[aria-expanded="true"] .nav__menu-bars::before { transform: translateY(6px) rotate(45deg); }
.nav__menu[aria-expanded="true"] .nav__menu-bars::after { transform: translateY(-6px) rotate(-45deg); }
.drawer { border-top: 1px solid var(--line); background: var(--bg); padding: 12px var(--gutter) 24px; }
.drawer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.drawer a:not(.btn) { display: block; padding: 14px 8px; color: var(--text); text-decoration: none; font: 500 1.1rem var(--font-head); border-bottom: 1px solid var(--line); }
.drawer a[aria-current="page"] { color: var(--ice); }
.drawer .btn { margin-top: 16px; width: 100%; }

.prefs { position: relative; }
.prefs__toggle { display: inline-flex; align-items: center; gap: 8px; min-height: 38px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line-2); background: transparent; color: var(--muted); font: 500 .9rem var(--font-body); cursor: pointer; }
.prefs__toggle:hover, .prefs__toggle[aria-expanded="true"] { color: var(--text); border-color: var(--muted); }
.prefs__toggle .ico { width: 18px; height: 18px; }
.ico-fill { fill: currentColor; }
.ico-wave, .ico-mute { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.ico-wave { display: none; }
.prefs__toggle.is-on { color: var(--text); }
.prefs__toggle.is-on .ico-wave { display: inline; }
.prefs__toggle.is-on .ico-mute { display: none; }
.prefs__state { font-size: .78rem; padding: 2px 7px; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.prefs__toggle.is-on .prefs__state { background: var(--cyan-soft); color: var(--cyan); }
.prefs__panel { position: absolute; right: 0; top: calc(100% + 10px); width: min(320px, calc(100vw - 32px)); background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius); padding: 16px; box-shadow: 0 24px 60px -20px rgba(0, 0, 0, .8); z-index: 60; }
.prefs__title { font: 600 .95rem var(--font-head); margin-bottom: 10px; }
.prefs__row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; font-size: .92rem; }
.prefs__row input[type=range] { width: 140px; accent-color: var(--brand); }
.prefs__preview { width: 100%; margin: 8px 0; }
.prefs__note { font-size: .8rem; color: var(--muted); margin: 6px 0 0; line-height: 1.5; }
.switch { position: relative; display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 10px 0 4px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--bg-2); color: var(--muted); font: 600 .78rem var(--font-body); cursor: pointer; }
.switch__knob { width: 22px; height: 22px; border-radius: 50%; background: var(--dim); transition: background var(--t-ctrl), transform var(--t-ctrl); }
.switch[aria-checked="true"] { border-color: var(--cyan); color: var(--cyan); }
.switch[aria-checked="true"] .switch__knob { background: var(--cyan); }
.switch[disabled] { opacity: .45; cursor: not-allowed; }

/* ------------------------------------------------------- capability badges */
.cap { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 999px; font: 600 .72rem/1.3 var(--font-body); letter-spacing: .02em; border: 1px solid; vertical-align: middle; white-space: nowrap; }
.cap__dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.cap--available { color: var(--mint); border-color: rgba(74, 222, 128, .35); background: var(--mint-soft); }
.cap--review { color: var(--cyan); border-color: rgba(6, 182, 212, .35); background: var(--cyan-soft); }
.cap--development { color: var(--amber); border-color: rgba(251, 191, 36, .35); background: var(--amber-soft); }
.cap--planned { color: var(--muted); border-color: var(--line-2); background: rgba(255, 255, 255, .03); }
.cap--planned .cap__dot { background: transparent; border: 1.5px solid currentColor; }
.cap--demo, .cap--concept { color: var(--ice); border-color: rgba(37, 99, 235, .35); background: var(--brand-soft); }
.demo-label { display: inline-flex; align-items: center; gap: 8px; font-size: .86rem; color: var(--muted); margin: 0; }
.demo-label__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); flex: none; }
.legend-caps { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; font-size: .85rem; color: var(--muted); }

/* ---------------------------------------------------------------- hero */
.hero { position: relative; overflow: hidden; padding: clamp(48px, 7vw, 96px) 0 clamp(56px, 7vw, 104px); isolation: isolate;
  background: radial-gradient(60% 70% at 78% 45%, rgba(37, 99, 235, .09), transparent 70%), radial-gradient(50% 60% at 20% 80%, rgba(6, 182, 212, .05), transparent 70%), var(--bg); }
.hero__canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; }
.hero__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr); gap: clamp(28px, 4vw, 64px); align-items: center; }
.hero__copy h1 { margin-bottom: .45em; }
.hero__copy h1 em { font-style: normal; color: var(--ice); background: linear-gradient(90deg, #60A5FA 0%, #3B82F6 45%, #06B6D4 100%); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.hero__sub { font-size: clamp(1.08rem, 1.45vw, 1.26rem); color: var(--muted); max-width: 54ch; }
.hero__line { font-size: .98rem; color: var(--text); opacity: .86; margin-bottom: 1.6em; }
.hero__ctas { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 18px; }
.hero__visual { position: relative; }

.hs { width: 100%; height: auto; overflow: visible; }
.hs-grid line { stroke: rgba(138, 155, 180, .07); stroke-width: 1; }
.hs-e { fill: none; stroke-width: 2.2; stroke-linecap: round; }
.hs-e--base { stroke: var(--line-2); }
.hs-e--flow { stroke: var(--cyan); stroke-dasharray: 10 190; stroke-dashoffset: 0; opacity: 0; }
.hs-e--orig { stroke: var(--line-2); stroke-dasharray: 5 6; }
.hs-e--alt { stroke: var(--amber); stroke-opacity: .75; }
.hs-e--obj { stroke: var(--mint); stroke-opacity: .8; }
.hs-n circle.core { fill: var(--surface); stroke: var(--line-2); stroke-width: 2; transition: stroke var(--t-graph), fill var(--t-graph); }
.hs-n text { font: 600 14px var(--font-head); fill: var(--text); }
.hs-n text.sub { font: 500 11px var(--font-body); fill: var(--muted); }
.hs-n .glyph { font: 700 14px var(--font-body); }
.hs-n--done circle.core { stroke: var(--mint); fill: #0F2E22; }
.hs-n--done .glyph { fill: var(--mint); }
.hs-n--alt circle.core { stroke: var(--amber); fill: #3A2A0D; }
.hs-n--exec circle.core { stroke: var(--red); fill: #3A1418; }
.hs-n--exec .glyph { fill: var(--red); }
.hs-n:hover circle.core { stroke-width: 3; }
.hs-obj .halo { fill: url(#hs-halo); }
.hs-obj .ring { fill: none; stroke: var(--brand); stroke-opacity: .4; stroke-width: 1.5; }
.hs-obj .ring2 { fill: none; stroke: var(--brand); stroke-opacity: .18; stroke-width: 1; }
.hs-obj .core { fill: var(--brand); }
.hs-obj .check { fill: none; stroke: var(--brand-ink); stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round; }
.hs-obj text { font: 600 15px var(--font-head); fill: var(--ice); }
.hs-obj text.sub { fill: var(--muted); font: 500 11px var(--font-body); }
.hs-chip rect { fill: var(--surface); stroke: var(--line-2); }
.hs-chip text { font: 500 10.5px var(--font-mono); fill: var(--mint); }
.hero__status { margin: 6px 0 0; font-size: .88rem; color: var(--muted); display: flex; align-items: center; gap: 8px; min-height: 1.6em; }
.hero__status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--cyan); flex: none; }

/* settled defaults are the "done" composition; phases override */
.js .hs.ph-run .hs-n--exec circle.core, .js .hs.ph-fail .hs-n--exec circle.core { stroke: var(--cyan); fill: #0B2A36; }
.js .hs.ph-run .hs-n--exec .glyph { fill: transparent; }
.js .hs.ph-run .hs-alt, .js .hs.ph-fail .hs-alt { opacity: 0; }
.js .hs.ph-run .hs-e--orig { stroke: var(--cyan); stroke-dasharray: none; stroke-opacity: .5; }
.js .hs.ph-run .hs-n--verify circle.core, .js .hs.ph-fail .hs-n--verify circle.core, .js .hs.ph-alt .hs-n--verify circle.core { stroke: var(--line-2); fill: var(--surface); }
.js .hs.ph-run .hs-n--verify .glyph, .js .hs.ph-fail .hs-n--verify .glyph, .js .hs.ph-alt .hs-n--verify .glyph,
.js .hs.ph-verify .hs-n--verify .glyph { fill: transparent; }
.js .hs.ph-fail .hs-n--exec circle.core { stroke: var(--red); fill: #3A1418; }
.js .hs.ph-run .hs-obj .check, .js .hs.ph-fail .hs-obj .check, .js .hs.ph-alt .hs-obj .check, .js .hs.ph-verify .hs-obj .check { opacity: 0; }
.js .hs.ph-run .hs-e--obj, .js .hs.ph-fail .hs-e--obj, .js .hs.ph-alt .hs-e--obj { stroke: var(--line-2); }
.js .hs.ph-run .hs-chips, .js .hs.ph-fail .hs-chips, .js .hs.ph-alt .hs-chips { opacity: 0; }
.js .hs.ph-verify .hs-n--verify circle.core { stroke: var(--cyan); fill: #0B2A36; }
.hs-alt, .hs-chips, .hs-obj .check { transition: opacity var(--t-graph) var(--ease); }
.js .hs.ph-run .hs-flow-1 { opacity: 1; animation: flow 1.8s linear infinite; }
.js .hs.ph-alt .hs-flow-alt { opacity: 1; stroke: var(--amber); animation: flow 1.6s linear infinite; }
.js .hs.ph-verify .hs-flow-obj { opacity: 1; animation: flow 1.4s linear infinite; }
.js .hs.ph-done .hs-obj .ring { animation: breathe 3.6s ease-in-out infinite; transform-origin: center; transform-box: fill-box; }
@keyframes flow { from { stroke-dashoffset: 200; } to { stroke-dashoffset: 0; } }
@keyframes breathe { 0%, 100% { transform: scale(1); opacity: .9; } 50% { transform: scale(1.12); opacity: .4; } }

/* opening choreography (≈2.6 s): grid + beacon → nodes resolve → pulse */
.hs.is-opening .hs-grid { animation: fadein .6s var(--ease) both; }
.hs.is-opening .hs-obj { animation: beacon 1s var(--ease) .15s both; }
.hs.is-opening .hs-n { animation: resolve .5s var(--ease) both; }
.hs.is-opening .hs-n:nth-of-type(1) { animation-delay: .55s; }
.hs.is-opening .hs-n:nth-of-type(2) { animation-delay: .75s; }
.hs.is-opening .hs-n:nth-of-type(3) { animation-delay: .95s; }
.hs.is-opening .hs-n:nth-of-type(4) { animation-delay: 1.15s; }
.hs.is-opening .hs-edges { animation: fadein .6s var(--ease) .9s both; }
.hs.is-opening .hs-flow-open { opacity: 1; animation: flow 1.2s var(--ease) 1.4s both; }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
@keyframes beacon { from { opacity: 0; transform: scale(.6); } to { opacity: 1; transform: scale(1); } }
@keyframes resolve { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.hs-obj, .hs-n { transform-box: fill-box; transform-origin: center; }

.mission-card { position: relative; margin: 14px 0 0 auto; width: min(360px, 92%); background: rgba(11, 22, 38, .92); border: 1px solid var(--line-2); border-radius: var(--radius); padding: 16px 18px; box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .9); backdrop-filter: blur(6px); }
.mission-card dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: .9rem; }
.mission-card dt { color: var(--muted); }
.mission-card dd { margin: 0; color: var(--text); }
.mission-card ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 4px; }
.mission-card li { display: flex; gap: 8px; align-items: baseline; }
.mission-card li::before { content: "✓"; color: var(--mint); font-weight: 700; font-size: .8rem; }
.mission-card__k { font: 600 .72rem var(--font-body); letter-spacing: .14em; text-transform: uppercase; color: var(--ice); margin-bottom: 10px; display: flex; justify-content: space-between; }
.mission-card__k span:last-child { color: var(--muted); letter-spacing: .04em; text-transform: none; font-weight: 500; }

/* ---------------------------------------------------------------- story */
.chapters-rail { position: fixed; left: max(12px, calc((100vw - 1400px) / 2)); top: 50%; transform: translateY(-50%); z-index: 20; list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; opacity: 0; pointer-events: none; transition: opacity var(--t-panel); }
.chapters-rail.is-visible { opacity: 1; pointer-events: auto; }
.chapters-rail a { display: flex; align-items: center; gap: 10px; color: var(--dim); text-decoration: none; font: 600 .72rem var(--font-mono); letter-spacing: .08em; }
.chapters-rail a::before { content: ""; width: 18px; height: 1px; background: currentColor; transition: width var(--t-panel); }
.chapters-rail a span { opacity: 0; transition: opacity var(--t-panel); }
.chapters-rail a:hover span, .chapters-rail a[aria-current] span { opacity: 1; }
.chapters-rail a[aria-current] { color: var(--ice); }
.chapters-rail a[aria-current]::before { width: 32px; }

.chapter { display: grid; grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr); gap: clamp(32px, 5vw, 80px); align-items: center; padding: clamp(64px, 9vw, 120px) 0; border-top: 1px solid rgba(26, 42, 64, .5); }
.chapter:nth-child(even) .chapter__visual { order: -1; }
.chapter__num { font: 600 .8rem var(--font-mono); color: var(--dim); letter-spacing: .1em; margin-bottom: 14px; display: block; }
.chapter__quote { font: 600 clamp(1.25rem, 2vw, 1.6rem)/1.3 var(--font-head); color: var(--text); border-left: 2px solid var(--brand); padding-left: 18px; margin: 1.4em 0; letter-spacing: -0.01em; }
.chapter__visual { background: linear-gradient(180deg, var(--surface), var(--bg-2)); border: 1px solid var(--line); border-radius: 20px; padding: clamp(18px, 3vw, 32px); position: relative; overflow: hidden; }
.chapter__visual figcaption { font-size: .82rem; color: var(--muted); margin-top: 14px; }

[data-reveal] { transition: opacity var(--t-chapter) var(--ease), transform var(--t-chapter) var(--ease); }
.js [data-reveal]:not(.is-in) { opacity: 0; transform: translateY(24px); }

/* chapter 1: objective → conditions */
.v-mission { display: grid; gap: 14px; }
.v-objective { display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: 12px; background: var(--brand-soft); border: 1px solid rgba(37, 99, 235, .3); }
.v-objective b { font: 600 1.05rem var(--font-head); }
.v-dot { width: 14px; height: 14px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 6px rgba(37, 99, 235, .15); flex: none; }
.v-conds { display: grid; gap: 8px; margin: 0; padding: 0 0 0 26px; list-style: none; border-left: 1px dashed var(--line-2); margin-left: 6px; }
.v-conds li { display: flex; justify-content: space-between; gap: 10px; padding: 10px 14px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; font-size: .93rem; }
.v-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 6px; }
.v-compare div { padding: 12px 14px; border-radius: 10px; border: 1px solid var(--line); font-size: .9rem; }
.v-compare p { margin: 0; }
.v-compare .k { font: 600 .72rem var(--font-body); letter-spacing: .12em; text-transform: uppercase; margin-bottom: 4px; }
.v-compare .bad .k { color: var(--amber); } .v-compare .good .k { color: var(--mint); }

/* status tags */
.tag { display: inline-flex; align-items: center; gap: 5px; font: 600 .74rem/1.3 var(--font-body); padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.tag--ok { color: var(--mint); background: var(--mint-soft); }
.tag--ok::before { content: "✓"; }
.tag--run { color: var(--cyan); background: var(--cyan-soft); }
.tag--warn { color: var(--amber); background: var(--amber-soft); }
.tag--warn::before { content: "!"; font-weight: 800; }
.tag--fail { color: var(--red); background: var(--red-soft); }
.tag--fail::before { content: "✕"; }
.tag--wait { color: var(--muted); background: rgba(255, 255, 255, .05); }

/* chapter 2: path */
.v-path svg { width: 100%; height: auto; }
.v-path .e { fill: none; stroke: var(--line-2); stroke-width: 2; }
.v-path .e--det { stroke: var(--cyan); stroke-opacity: .65; }
.v-path .e--alt { stroke: var(--cyan); stroke-dasharray: 6 6; }
.v-path .e--brk { stroke: var(--red); stroke-dasharray: 3 5; stroke-opacity: .7; }
.v-path circle { fill: var(--surface-2); stroke: var(--cyan); stroke-width: 2; }
.v-path circle.fail { stroke: var(--red); }
.v-path circle.agent { stroke: var(--brand); }
.v-path circle.obj { fill: var(--brand); stroke: none; }
.v-path text { font: 500 11px var(--font-body); fill: var(--muted); }
.v-path text.h { font: 600 12px var(--font-head); fill: var(--text); }
.v-path .flow { fill: none; stroke: var(--cyan); stroke-width: 2.5; stroke-dasharray: 8 160; }
.js .is-in .v-path .flow { animation: flow 2.4s linear infinite; }
.v-legend { display: flex; flex-wrap: wrap; gap: 16px; font-size: .85rem; color: var(--muted); margin-top: 10px; }
.v-legend i { display: inline-block; width: 22px; height: 2px; vertical-align: middle; margin-right: 6px; background: var(--cyan); }
.v-legend i.alt { background: repeating-linear-gradient(90deg, var(--cyan) 0 5px, transparent 5px 9px); }
.v-legend i.brk { background: repeating-linear-gradient(90deg, var(--red) 0 3px, transparent 3px 7px); }

/* chapter 3: boundary */
.v-approval { display: grid; gap: 12px; }
.v-blocked { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border-radius: 12px; border: 1px solid rgba(248, 113, 113, .3); background: var(--red-soft); font-size: .93rem; }
.v-blocked p { margin: 0; }
.v-card { border: 1px solid rgba(251, 191, 36, .4); background: linear-gradient(180deg, rgba(251, 191, 36, .08), transparent); border-radius: 14px; padding: 16px; }
.v-card__k { font: 600 .72rem var(--font-body); letter-spacing: .14em; text-transform: uppercase; color: var(--amber); margin-bottom: 6px; }
.v-card__q { font: 600 1.05rem var(--font-head); margin-bottom: 10px; }
.v-card dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; font-size: .88rem; margin: 0 0 12px; }
.v-card dt { color: var(--muted); }
.v-card dd { margin: 0; }
.v-card__btns { display: flex; gap: 8px; flex-wrap: wrap; }
.v-card__btns span { padding: 7px 14px; border-radius: 999px; font-size: .85rem; font-weight: 600; border: 1px solid var(--line-2); }
.v-card__btns span:first-child { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.v-rules { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.v-rules div { padding: 10px 12px; border-radius: 10px; background: var(--bg-2); border: 1px solid var(--line); font-size: .86rem; }
.v-rules b { display: block; font-family: var(--font-head); font-weight: 600; font-size: .9rem; }
.v-rules span { color: var(--muted); }

/* chapter 4: proof */
.v-pack { font-size: .9rem; }
.v-pack__head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; }
.v-pack__head b { font: 600 1.05rem var(--font-head); }
.v-pack table { width: 100%; border-collapse: collapse; }
.v-pack td { padding: 9px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.v-pack td:last-child { text-align: right; }
.v-pack td code { color: var(--muted); font-size: .82rem; }
.v-pack__files { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.v-pack__files span { font: 500 .78rem var(--font-mono); padding: 5px 9px; border-radius: 6px; background: var(--bg-2); border: 1px solid var(--line); color: var(--muted); }

/* ---------------------------------------------------------- feature rows */
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 72px); align-items: center; }
.split--wide { grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); }
.list-check { list-style: none; padding: 0; margin: 0 0 1.4em; display: grid; gap: 10px; }
.list-check li { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: start; }
.list-check li::before { content: ""; width: 8px; height: 8px; margin-top: .6em; border-radius: 2px; background: var(--cyan); transform: rotate(45deg); }
.list-check li > div > b { font-family: var(--font-head); font-weight: 600; }
.list-check .cap { margin-left: 6px; }
.feature-list { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.feature-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; padding: 16px 18px; background: var(--surface); align-items: center; }
.feature-list li p { margin: 2px 0 0; font-size: .9rem; color: var(--muted); }
.feature-list b { font-family: var(--font-head); font-weight: 600; }

.flow-steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; list-style: none; margin: 0; padding: 0; counter-reset: fs; }
.flow-steps li { position: relative; padding: 22px 20px 22px 0; counter-increment: fs; }
.flow-steps li::before { content: counter(fs, decimal-leading-zero); display: block; font: 600 .78rem var(--font-mono); color: var(--ice); margin-bottom: 14px; }
.flow-steps li::after { content: ""; position: absolute; top: 30px; left: 34px; right: 14px; height: 1px; background: linear-gradient(90deg, var(--line-2), transparent); }
.flow-steps b { display: block; font: 600 1.08rem var(--font-head); margin-bottom: 6px; }
.flow-steps p { font-size: .93rem; color: var(--muted); margin: 0 0 8px; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(18px, 2.4vw, 28px); }
.panel h3 { margin-bottom: .4em; }
.panel p:last-child { margin-bottom: 0; }
.panels { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.panels--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.panel__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 8px; }
.panel__head h3 { margin: 0; }
.panel--accent { border-color: rgba(37, 99, 235, .35); background: linear-gradient(180deg, rgba(37, 99, 235, .06), var(--surface) 60%); }
.example { margin-top: 14px; padding: 12px 14px; border-radius: 10px; background: var(--bg-2); border: 1px solid var(--line); font-size: .9rem; }
.example__k { font: 600 .7rem var(--font-body); letter-spacing: .14em; text-transform: uppercase; color: var(--dim); display: block; margin-bottom: 4px; }
.mono { font-family: var(--font-mono); font-size: .86rem; }

.usecases { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.usecase { padding: 22px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); }
.usecase__obj { font: 600 1.1rem/1.35 var(--font-head); margin-bottom: 12px; }
.usecase__obj::before { content: "Mission  "; font: 600 .7rem var(--font-body); letter-spacing: .14em; text-transform: uppercase; color: var(--ice); display: block; margin-bottom: 6px; }
.usecase dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0; font-size: .9rem; }
.usecase dt { color: var(--muted); }
.usecase dd { margin: 0; }

/* product screens */
.screens { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 16px; }
.screen { margin: 0; grid-column: span 2; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.screen--wide { grid-column: span 3; }
.screen__img { display: block; background: #060F1C; border-bottom: 1px solid var(--line); position: relative; }
.screen__img img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; object-position: top left; transition: transform var(--t-panel) var(--ease); }
.screen__img:hover img { transform: scale(1.015); }
.screen__img::after { content: "View"; position: absolute; right: 10px; bottom: 10px; font: 600 .75rem var(--font-body); padding: 4px 10px; border-radius: 999px; background: rgba(7, 17, 31, .8); color: var(--text); border: 1px solid var(--line-2); }
.screen figcaption { padding: 14px 16px 16px; }
.screen__top { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 6px; }
.screen__top b { font: 600 1rem var(--font-head); }
.screen__kind { font: 600 .7rem var(--font-body); letter-spacing: .04em; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.screen__kind--real { color: var(--mint); background: var(--mint-soft); }
.screen__kind--concept { color: var(--ice); background: var(--brand-soft); }
.screen figcaption p { font-size: .88rem; color: var(--muted); margin: 0; }
.screen-dialog { width: min(1200px, calc(100vw - 32px)); max-height: calc(100vh - 32px); padding: 0; border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--surface); color: var(--text); }
.screen-dialog::backdrop { background: rgba(3, 8, 16, .82); backdrop-filter: blur(4px); }
.screen-dialog__bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--surface); }
.screen-dialog__bar h2 { font-size: 1.05rem; margin: 0; }
.screen-dialog img { width: 100%; height: auto; }
.screen-dialog p { padding: 12px 16px 16px; margin: 0; color: var(--muted); font-size: .92rem; }

/* agent */
.provider-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.provider { padding: 14px 16px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); display: flex; flex-direction: column; gap: 8px; }
.provider b { font: 600 1rem var(--font-head); }
.provider p { margin: 0; font-size: .86rem; color: var(--muted); }
.distinction { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.distinction > div { padding: 22px; background: var(--surface); }
.distinction > div + div { border-left: 1px solid var(--line); }
.distinction h3 { font-size: 1.1rem; }
.loop { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; list-style: none; padding: 0; margin: 0; }
.loop li { padding: 16px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); position: relative; }
.loop li b { display: block; font: 600 .98rem var(--font-head); margin-bottom: 4px; }
.loop li span { font-size: .85rem; color: var(--muted); }
.loop li:not(:last-child)::after { content: "→"; position: absolute; right: -10px; top: 50%; transform: translateY(-50%); color: var(--dim); z-index: 1; }

/* deployment */
.deploy-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.eco { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.eco .panel h3 a { color: var(--text); text-decoration: none; }
.eco .panel h3 a:hover { color: var(--ice); }
.notice { padding: 16px 18px; border-radius: 12px; border: 1px solid rgba(251, 191, 36, .35); background: var(--amber-soft); font-size: .95rem; }
.notice p:last-child { margin: 0; }
.diagram { width: 100%; height: auto; }
.diagram rect.box { fill: var(--surface); stroke: var(--line-2); }
.diagram rect.box--core { stroke: var(--brand); fill: #0F2547; }
.diagram rect.box--opt { stroke-dasharray: 5 5; }
.diagram text { font: 500 12px var(--font-body); fill: var(--muted); }
.diagram text.h { font: 600 13px var(--font-head); fill: var(--text); }
.diagram path { fill: none; stroke: var(--line-2); stroke-width: 1.6; }
.diagram path.opt { stroke-dasharray: 4 5; }
.diagram path.run { stroke: var(--cyan); stroke-opacity: .7; }

/* CTA */
.cta-final { text-align: center; padding: clamp(80px, 11vw, 150px) 0; position: relative; overflow: hidden;
  background: radial-gradient(50% 70% at 50% 100%, rgba(37, 99, 235, .14), transparent 70%), var(--bg); border-top: 1px solid var(--line); }
.cta-final h2 { font-size: clamp(2rem, 4.2vw, 3.4rem); }
.cta-final .lead { margin: 0 auto 2em; }
.cta-final__btns { display: flex; justify-content: center; flex-wrap: wrap; gap: 12px; }
.page-hero { padding: clamp(56px, 8vw, 104px) 0 clamp(36px, 5vw, 64px); background: radial-gradient(50% 80% at 85% 0%, rgba(37, 99, 235, .08), transparent 70%), var(--bg); border-bottom: 1px solid var(--line); }
.page-hero h1 { font-size: clamp(2.1rem, 4.4vw, 3.6rem); max-width: 18ch; }
.page-hero .lead { margin-bottom: 1.6em; }
.toc { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 0; }
.toc a { display: inline-block; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--muted); text-decoration: none; font-size: .88rem; }
.toc a:hover { color: var(--text); border-color: var(--muted); }

/* ----------------------------------------------------------------- theater */
.theater { padding: clamp(72px, 9vw, 128px) 0; background: linear-gradient(180deg, var(--bg), var(--bg-2) 30%, var(--bg)); border-top: 1px solid var(--line); scroll-margin-top: 68px; }
.theater__head { max-width: 820px; }
.theater > .wrap { max-width: 1640px; }
.theater__frame { margin-top: 32px; }
.th-fallback { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.th-fallback ol { margin: 0; padding-left: 1.3em; display: grid; gap: 6px; color: var(--muted); }
.th-grid { display: grid; grid-template-columns: 300px minmax(0, 1fr); grid-template-areas: "mission stage" "side side" "summary summary"; gap: 14px; }
.th-panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; min-width: 0; }
.th-mission { grid-area: mission; display: flex; flex-direction: column; gap: 14px; }
.th-stage { grid-area: stage; position: relative; background: radial-gradient(70% 70% at 90% 55%, rgba(37, 99, 235, .07), transparent 70%), #081322; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 14px 10px; min-width: 0; display: flex; flex-direction: column; }
.th-side { grid-area: side; display: flex; flex-direction: row; gap: 14px; }
.th-side > * { flex: 1 1 50%; min-width: 0; }
.th-side .th-evidence { border-top: 0; padding-top: 0; border-left: 1px solid var(--line); padding-left: 14px; }
.th-summary { grid-area: summary; display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 14px; }
.th-summary > div { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.th-k { font: 600 .7rem/1.3 var(--font-body); letter-spacing: .14em; text-transform: uppercase; color: var(--dim); margin: 0 0 8px; }
.th-k__sub { letter-spacing: .02em; text-transform: none; color: var(--muted); }
.th-muted { color: var(--dim); font-size: .88rem; margin: 0; }
.th-scenarios { display: grid; gap: 6px; }
.th-scenarios button { display: flex; align-items: center; gap: 10px; text-align: left; padding: 9px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg-2); color: var(--muted); font: 500 .9rem var(--font-body); cursor: pointer; transition: border-color var(--t-ctrl), color var(--t-ctrl), background var(--t-ctrl); }
.th-scenarios button:hover { color: var(--text); }
.th-scenarios button[aria-selected="true"] { border-color: var(--brand); color: var(--text); background: var(--brand-soft); }
.th-tab__k { width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; background: var(--surface-2); font: 700 .75rem var(--font-mono); color: var(--ice); flex: none; }
.th-scn-short { font-size: .86rem; color: var(--muted); margin: 0; }
.th-card { background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.th-objective__text { font: 600 1.02rem/1.35 var(--font-head); color: var(--text); margin: 0 0 8px; padding-left: 12px; border-left: 2px solid var(--brand); }
.th-tag { font-size: .78rem; color: var(--ice); margin: 0 0 8px; }
.th-dl { display: grid; gap: 4px; margin: 0 0 10px; font-size: .86rem; }
.th-dl div { display: grid; grid-template-columns: 52px 1fr; gap: 8px; }
.th-dl dt { color: var(--dim); }
.th-dl dd { margin: 0; }
.th-conditions, .th-assert ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.cond { display: grid; grid-template-columns: 18px 1fr auto; gap: 8px; align-items: start; font-size: .88rem; }
.cond__ico { width: 16px; height: 16px; margin-top: 2px; border-radius: 50%; border: 1.5px solid var(--line-2); display: grid; place-items: center; font: 700 10px/1 var(--font-body); }
.cond.is-passed .cond__ico { border-color: var(--mint); background: var(--mint-soft); color: var(--mint); }
.cond.is-passed .cond__ico::after { content: "✓"; }
.cond.is-failed .cond__ico { border-color: var(--red); background: var(--red-soft); color: var(--red); }
.cond.is-failed .cond__ico::after { content: "✕"; }
.cond.is-skipped .cond__ico::after { content: "–"; color: var(--dim); }
.cond__st { font-size: .78rem; color: var(--dim); }
.cond.is-passed .cond__st { color: var(--mint); }
.cond.is-failed .cond__st { color: var(--red); }
.th-status { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px; background: var(--bg-2); border: 1px solid var(--line); font-size: .82rem; }
.chip__k { color: var(--dim); }
.chip__v { font-weight: 600; }
.chip__v::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 6px; background: var(--dim); vertical-align: 1px; }
.chip--m-running .chip__v::before, .chip--activity .chip__v::before { background: var(--cyan); }
.chip--m-running, .chip--activity { border-color: rgba(6, 182, 212, .35); }
.chip--m-verified { border-color: rgba(74, 222, 128, .5); background: var(--mint-soft); }
.chip--m-verified .chip__v { color: var(--mint); }
.chip--m-verified .chip__v::before { background: var(--mint); }
.chip--m-failed, .chip--m-blocked { border-color: rgba(248, 113, 113, .45); background: var(--red-soft); }
.chip--m-failed .chip__v, .chip--m-blocked .chip__v { color: var(--red); }
.chip--m-failed .chip__v::before, .chip--m-blocked .chip__v::before { background: var(--red); border-radius: 1px; }
.chip--m-waiting { border-color: rgba(251, 191, 36, .5); background: var(--amber-soft); }
.chip--m-waiting .chip__v { color: var(--amber); }
.chip--m-waiting .chip__v::before { background: var(--amber); }
.chip--l-connected .chip__v::before { background: var(--mint); }
.chip--l-disconnected { border-color: rgba(248, 113, 113, .45); }
.chip--l-disconnected .chip__v { color: var(--red); }
.chip--l-disconnected .chip__v::before { background: transparent; border: 1.5px solid var(--red); }
.chip--l-reconnecting .chip__v { color: var(--amber); }
.chip--l-reconnecting .chip__v::before { background: var(--amber); }
.th-controls { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.th-controls .btn { width: 100%; padding: 0 10px; }
.th-settings { border-top: 1px solid var(--line); padding-top: 12px; }
.th-settings summary { cursor: pointer; font-weight: 600; font-size: .9rem; color: var(--muted); list-style-position: inside; }
.th-settings summary:hover { color: var(--text); }
.th-settings form { display: grid; gap: 10px; margin-top: 12px; }
.th-settings label { display: grid; gap: 4px; font-size: .8rem; color: var(--muted); }
.th-settings select, .th-settings input, .field input, .field textarea {
  width: 100%; min-height: 38px; padding: 8px 10px; border-radius: 9px; border: 1px solid var(--line-2); background: var(--bg-2); color: var(--text); font: 400 .9rem var(--font-body);
}
.th-settings select:disabled { opacity: .7; }
.th-hint { font-size: .76rem; color: var(--dim); margin: 0; line-height: 1.5; }

.th-stage__top { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 4px; }
.th-clock { margin: 0; font: 500 .9rem var(--font-mono); color: var(--text); display: flex; gap: 8px; align-items: baseline; }
.th-clock .th-k { margin: 0; }
.th-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; list-style: none; margin: 0; padding: 0; font-size: .74rem; color: var(--muted); }
.th-legend li { display: flex; align-items: center; gap: 5px; }
.lg { width: 9px; height: 9px; border-radius: 50%; border: 2px solid; }
.lg--obj { border-color: var(--brand); background: var(--brand); }
.lg--run { border-color: var(--cyan); }
.lg--ok { border-color: var(--mint); background: var(--mint-soft); }
.lg--fail { border-color: var(--red); border-radius: 2px; }
.lg--gate { border-color: var(--amber); transform: rotate(45deg); border-radius: 2px; }
.th-graph { flex: 1; display: flex; align-items: center; min-height: 0; }

.graph { width: 100%; height: auto; overflow: visible; }
.graph__grid line { stroke: rgba(138, 155, 180, .045); }
.edge { transition: opacity var(--t-graph) var(--ease); }
.edge.is-hidden { opacity: 0; }
.edge__base { fill: none; stroke: var(--line-2); stroke-width: 2; transition: stroke var(--t-graph); }
.edge__flow { fill: none; stroke: var(--cyan); stroke-width: 2.6; stroke-linecap: round; stroke-dasharray: 8 92; opacity: 0; }
.edge.is-active .edge__base { stroke: rgba(6, 182, 212, .55); }
.edge.is-active .edge__flow { opacity: 1; animation: eflow 1.6s linear infinite; }
.edge.is-paused .edge__base { stroke: rgba(248, 113, 113, .45); stroke-dasharray: 4 6; }
.edge.is-failed .edge__base { stroke: var(--red); stroke-dasharray: 2 5; }
@keyframes eflow { from { stroke-dashoffset: 100; } to { stroke-dashoffset: 0; } }
.node { cursor: pointer; transition: opacity var(--t-graph) var(--ease); outline: none; }
.node.is-hidden { opacity: 0; pointer-events: none; }
.node__core { fill: var(--surface); stroke: var(--line-2); stroke-width: 2; transition: fill var(--t-graph), stroke var(--t-graph); }
.node__glyph { font: 700 17px var(--font-body); fill: var(--text); pointer-events: none; }
.node__label { font: 600 15px var(--font-head); fill: var(--text); pointer-events: none; }
.node__sub { font: 500 12px var(--font-body); fill: var(--dim); pointer-events: none; }
.node--step .node__sub, .node--verify .node__sub { font-family: var(--font-body); }
.node:hover .node__core, .node:focus-visible .node__core { stroke-width: 3.2; }
.node:focus-visible .node__core { stroke: var(--brand); }
.node.is-selected .node__label { fill: var(--ice); }
.node.is-running .node__core { stroke: var(--cyan); fill: #0B2A36; }
.node.is-running .node__glyph { fill: var(--cyan); }
.node.is-passed .node__core { stroke: var(--mint); fill: #0F2E22; }
.node.is-passed .node__glyph { fill: var(--mint); }
.node.is-failed .node__core { stroke: var(--red); fill: #3A1418; }
.node.is-failed .node__glyph { fill: var(--red); }
.node.is-skipped .node__core { stroke-dasharray: 3 4; opacity: .7; }
.node.is-skipped .node__label { fill: var(--dim); }
.node--gate .node__core { stroke: var(--amber); }
.node--gate.is-running .node__core { stroke: var(--amber); fill: #3A2A0D; }
.node--gate.is-running .node__glyph { fill: var(--amber); }
.node--agent .node__core { stroke: rgba(251, 191, 36, .7); }
.edge--branch .edge__flow { stroke: var(--amber); }
.edge--branch.is-active .edge__base { stroke: rgba(251, 191, 36, .5); }
.node--central .node__core { stroke: var(--line-2); fill: var(--surface-2); }
.graph.is-disconnected .node--central .node__core { stroke: var(--red); stroke-dasharray: 4 4; }
.node--objective .node__core { fill: var(--brand); stroke: none; }
.node--objective .node__ring { fill: none; stroke: var(--cyan); stroke-opacity: .5; stroke-width: 1.5; }
.node--objective .node__ring2 { fill: none; stroke: var(--ice); stroke-opacity: .22; }
.node--objective .node__label { fill: var(--ice); font-size: 16px; }
.node--objective .node__glyph { fill: var(--brand-ink); font-size: 17px; }
.node--objective.is-running .node__core { fill: var(--brand); }
.node--objective.is-running .node__ring { animation: breathe 3s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.node--objective.is-passed .node__core { fill: var(--mint); stroke: none; }
.node--objective.is-passed .node__ring, .node--objective.is-passed .node__ring2 { stroke: var(--mint); }
.node--objective.is-passed .node__label { fill: var(--mint); }
.node--objective.is-failed .node__core { fill: var(--red); stroke: none; }
.node--objective.is-failed .node__ring { stroke: var(--red); }
.node--objective.is-failed .node__glyph { fill: #3A1418; }
.graph[data-mission="blocked"] .node--objective .node__core { fill: var(--surface-2); stroke: var(--red); stroke-width: 2; stroke-dasharray: 4 3; }
.graph[data-mission="blocked"] .node--objective .node__label { fill: var(--red); }

.th-decision { position: absolute; left: 50%; top: 54px; transform: translateX(-50%); width: min(420px, calc(100% - 24px)); background: rgba(11, 22, 38, .97); border: 1px solid var(--amber); border-radius: 14px; padding: 16px; box-shadow: 0 20px 60px -20px rgba(0, 0, 0, .9), 0 0 0 6px rgba(251, 191, 36, .08); z-index: 3; animation: panelin var(--t-panel) var(--ease); }
@keyframes panelin { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }
.th-decision__k { font: 600 .7rem var(--font-body); letter-spacing: .14em; text-transform: uppercase; color: var(--amber); margin: 0 0 4px; }
.th-decision__q { font: 600 1rem/1.35 var(--font-head); margin: 0 0 12px; }
.th-decision__opts { display: flex; gap: 8px; flex-wrap: wrap; }
.th-decision__note { font-size: .76rem; color: var(--dim); margin: 10px 0 0; }
.th-caption { position: absolute; top: 46px; right: 16px; margin: 0; font: 500 .78rem var(--font-body); color: var(--cyan); padding: 4px 10px; border-radius: 999px; background: rgba(6, 182, 212, .08); opacity: 0; pointer-events: none; }
.sound-on .th-caption.is-on { animation: caption 2.4s var(--ease) both; }
@keyframes caption { 0% { opacity: 0; } 12% { opacity: 1; } 75% { opacity: 1; } 100% { opacity: 0; } }
.th-steps { display: none; list-style: none; margin: 10px 0 0; padding: 0; gap: 6px; }
.step { width: 100%; display: grid; grid-template-columns: 18px 1fr auto; gap: 10px; align-items: center; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font: 500 .9rem var(--font-body); text-align: left; cursor: pointer; }
.step.is-selected { border-color: var(--brand); }
.step__ico { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line-2); }
.step.is-running .step__ico { border-color: var(--cyan); }
.step.is-passed .step__ico { border-color: var(--mint); background: var(--mint); }
.step.is-failed .step__ico { border-color: var(--red); background: var(--red); border-radius: 3px; }
.step.is-skipped .step__ico { border-style: dashed; }
.step__s { font-size: .8rem; color: var(--muted); }

.th-events { display: flex; flex-direction: column; min-height: 0; flex: 1 1 55%; }
.th-events__list { list-style: none; margin: 0; padding: 0 4px 0 0; overflow-y: auto; display: grid; gap: 8px; align-content: start; max-height: 380px; scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
.evt { display: grid; gap: 2px; font-size: .86rem; line-height: 1.45; padding: 8px 10px; border-radius: 9px; background: var(--bg-2); border: 1px solid var(--line); }
.evt time { font: 500 .72rem var(--font-mono); color: var(--dim); }
.evt.is-new { border-color: rgba(6, 182, 212, .45); animation: evtin var(--t-panel) var(--ease); }
@keyframes evtin { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.evt--step { }
.evt--mission, .evt--plan { border-left: 3px solid var(--brand); }
.evt--approval { border-left: 3px solid var(--amber); }
.evt--change, .evt--link { border-left: 3px solid var(--red); }
.evt--visitor { border-left-style: double; }
.evt--branch, .evt--agent { border-left: 3px solid var(--cyan); }
.evt--idle { color: var(--dim); }
.evt__cue { font-size: .72rem; color: var(--cyan); }
.th-evidence { border-top: 1px solid var(--line); padding-top: 12px; overflow-y: auto; flex: 1 1 45%; min-height: 180px; }
.ev { margin: 0 0 12px; }
.ev__meta { display: flex; justify-content: space-between; gap: 8px; font-size: .82rem; margin: 0 0 6px; }
.ev__meta span:last-child { font-family: var(--font-mono); color: var(--dim); font-size: .74rem; }
.ev pre { margin: 0; padding: 10px; border-radius: 8px; background: #050C17; border: 1px solid var(--line); font-size: .76rem; line-height: 1.55; color: #C9D7EE; overflow-x: auto; white-space: pre; }
.ev figcaption { font-size: .72rem; color: var(--dim); margin-top: 4px; }
.shot { width: 100%; height: auto; border-radius: 8px; border: 1px solid var(--line); }
.th-result { margin: 12px 0 0; font-size: .9rem; font-weight: 600; padding: 8px 12px; border-radius: 9px; background: var(--bg-2); }
.th-result.is-verified { color: var(--mint); background: var(--mint-soft); }
.th-result.is-failed, .th-result.is-blocked { color: var(--red); background: var(--red-soft); }
.th-result.is-waiting { color: var(--amber); background: var(--amber-soft); }
.bl__row { display: flex; justify-content: space-between; gap: 10px; font-size: .9rem; margin: 0 0 8px; }
.bl__row span:last-child { font-family: var(--font-mono); }
.bl__bar { position: relative; height: 10px; border-radius: 999px; background: var(--bg-2); border: 1px solid var(--line); overflow: visible; }
.bl__fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 999px; background: linear-gradient(90deg, rgba(6, 182, 212, .5), var(--cyan)); transition: width var(--t-graph) var(--ease); }
.bl__fill.is-live { opacity: .55; }
.bl__p50 { position: absolute; top: -5px; bottom: -5px; width: 2px; background: var(--brand); }
.bl__p50::after { content: "P50"; position: absolute; top: 22px; left: -8px; font: 600 .62rem var(--font-mono); color: var(--ice); }
.bl__note { font-size: .78rem; color: var(--dim); margin: 26px 0 0; }
.view { padding: 10px 12px; border-radius: 10px; background: var(--bg-2); border: 1px solid var(--line); margin-bottom: 8px; font-size: .84rem; }
.view p { margin: 0; }
.view__h { display: flex; justify-content: space-between; gap: 8px; font-weight: 600; margin-bottom: 4px !important; }
.view.is-stale { border-style: dashed; border-color: rgba(251, 191, 36, .5); }
.view.is-stale p:not(.view__h) { color: var(--muted); }

/* --------------------------------------------------------------- forms */
.form { display: grid; gap: 16px; }
.field { display: grid; gap: 6px; }
.field label { font-weight: 600; font-size: .95rem; }
.field label .opt { font-weight: 400; color: var(--dim); }
.field input, .field textarea { min-height: 48px; font-size: 1rem; padding: 12px 14px; }
.field textarea { min-height: 120px; resize: vertical; }
.field input:focus, .field textarea:focus { border-color: var(--brand); outline: none; box-shadow: 0 0 0 3px var(--brand-soft); }
.field [aria-invalid="true"] { border-color: var(--red); }
.field__err { color: var(--red); font-size: .85rem; min-height: 0; }
.field__hint { color: var(--dim); font-size: .82rem; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form__status { padding: 14px 16px; border-radius: 10px; font-weight: 500; }
.form__status.is-ok { background: var(--mint-soft); color: var(--mint); border: 1px solid rgba(74, 222, 128, .4); }
.form__status.is-err { background: var(--red-soft); color: var(--red); border: 1px solid rgba(248, 113, 113, .4); }
.contact-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: clamp(28px, 5vw, 72px); align-items: start; }

/* --------------------------------------------------------------- prose */
.prose { max-width: 760px; }
.prose h2 { font-size: 1.5rem; margin-top: 2em; }
.prose h3 { margin-top: 1.6em; }
.prose p, .prose li { color: #D3DEEE; }
.prose ul { padding-left: 1.2em; }

/* --------------------------------------------------------------- footer */
.footer { border-top: 1px solid var(--line); background: #050D18; padding: 56px 0 28px; }
.footer__inner { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 32px; }
.footer__brand p { color: var(--muted); font-size: .92rem; margin: 14px 0 0; }
.footer__by { font-size: .82rem !important; color: var(--dim) !important; margin-top: 6px !important; }
.footer__head { font: 600 .72rem var(--font-body); letter-spacing: .14em; text-transform: uppercase; color: var(--dim); margin-bottom: 12px; }
.footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.footer ul a { color: var(--muted); text-decoration: none; font-size: .93rem; }
.footer ul a:hover { color: var(--text); }
.footer__legal { max-width: var(--wrap); margin: 40px auto 0; padding: 20px var(--gutter) 0; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; font-size: .8rem; color: var(--dim); }
.footer__legal p { margin: 0; max-width: 70ch; }

/* --------------------------------------------------------------- responsive */
@media (min-width: 1600px) {
  .th-grid { grid-template-columns: 300px minmax(0, 1fr) 330px; grid-template-areas: "mission stage side" "summary summary summary"; }
  .th-side { flex-direction: column; max-height: 780px; }
  .th-side .th-evidence { border-left: 0; padding-left: 0; border-top: 1px solid var(--line); padding-top: 12px; }
}
@media (max-width: 999px) {
  .nav__links, .nav__cta { display: none; }
  .nav__menu { display: inline-flex; }
  .hero__grid, .split, .split--wide, .chapter, .contact-grid { grid-template-columns: minmax(0, 1fr); }
  .chapter:nth-child(even) .chapter__visual { order: 0; }
  .chapters-rail { display: none; }
  .panels { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .screens { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .screen, .screen--wide { grid-column: span 1; }
  .flow-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .loop { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .loop li::after { display: none; }
  .footer__inner { grid-template-columns: 1fr 1fr; }
  .footer__brand { grid-column: 1 / -1; }
  .th-grid { grid-template-columns: minmax(0, 1fr); grid-template-areas: "mission" "stage" "side" "summary"; }
  .th-summary { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .th-scenarios { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .th-controls { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  body { font-size: 16px; }
  .prefs__toggle span:not(.prefs__state) { display: none; }
  .prefs__toggle .ico { display: block; }
  .panels, .panels--2, .usecases, .distinction, .v-rules, .v-compare, .th-summary, .flow-steps { grid-template-columns: minmax(0, 1fr); }
  .distinction > div + div { border-left: 0; border-top: 1px solid var(--line); }
  .screens { grid-template-columns: minmax(0, 1fr); }
  .loop { grid-template-columns: minmax(0, 1fr); }
  .mission-card { margin: 12px 0 0; width: 100%; }
  .th-scenarios { grid-template-columns: minmax(0, 1fr); }
  .th-controls { grid-template-columns: 1fr 1fr; }
  .th-side { flex-direction: column; }
  .th-side .th-evidence { border-left: 0; padding-left: 0; border-top: 1px solid var(--line); padding-top: 12px; }
  .th-steps { display: grid; }
  .th-legend { display: none; }
  .node__sub { display: none; }
  .node__label { font-size: 17px; }
  .th-decision { position: static; transform: none; width: auto; margin-top: 10px; animation: none; }
  .th-caption { top: 10px; }
  .footer__inner { grid-template-columns: 1fr; }
  .feature-list li { grid-template-columns: minmax(0, 1fr); }
}

/* --------------------------------------------------------- reduced motion */
@media (prefers-reduced-motion: reduce) {
  html:not([data-motion="full"]) *, html:not([data-motion="full"]) *::before, html:not([data-motion="full"]) *::after {
    animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; scroll-behavior: auto !important;
  }
  html:not([data-motion="full"]) [data-reveal] { opacity: 1 !important; transform: none !important; }
  html:not([data-motion="full"]) .hero__canvas { display: none; }
}
html[data-motion="reduce"] *, html[data-motion="reduce"] *::before, html[data-motion="reduce"] *::after {
  animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; scroll-behavior: auto !important;
}
html[data-motion="reduce"] [data-reveal] { opacity: 1 !important; transform: none !important; }
html[data-motion="reduce"] .hero__canvas { display: none; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
@media print { .nav, .theater, .hero__canvas, .chapters-rail { display: none; } body { background: #fff; color: #000; } }
.section-sub { margin-top: 48px; }
.h3 { font-size: 1.15rem; }

/* Verified objective: one short blue/cyan halo (brief V1003 §5) */
.node--objective.is-passed .node__halo { animation: halo-once 1.4s var(--ease) 1; transform-box: fill-box; transform-origin: center; }
@keyframes halo-once { 0% { opacity: .3; transform: scale(.85); } 45% { opacity: 1; transform: scale(1.12); } 100% { opacity: .75; transform: scale(1); } }
@media (max-width: 440px) {
  .tracston-wordmark { width: 92px; }
  .product-wordmark { font-size: 15px; letter-spacing: .04em; gap: 5px; }
  .xmark { width: 17px; height: 17px; }
  .brand-divider { height: 16px; }
  .wordmark { gap: 7px; }
  .nav__inner { gap: 10px; }
  .nav__actions { gap: 6px; }
  .prefs__toggle { padding: 0 9px; }
  .prefs__state { display: none; }
}
