/* Nullean.Entities landing page, on the Nullean Design System. Needs tokens.css first. No framework. */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; background: var(--bg); }
body {
  margin: 0; position: relative; background: var(--bg); color: var(--text);
  font: 400 15px/1.6 var(--font-mono);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
/* landing background: the one gradient on the page. Six radial pools in the two hues, fixed behind content. */
body::before {
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-color: var(--bg);
  background-image:
    radial-gradient(at 8% 18%,  rgb(224 216 193 / .19), transparent 55%),
    radial-gradient(at 92% 6%,  rgb(219 133 83 / .26), transparent 50%),
    radial-gradient(at 60% 78%, rgb(219 133 83 / .18), transparent 55%),
    radial-gradient(at 22% 88%, rgb(224 216 193 / .075), transparent 50%),
    radial-gradient(at 80% 48%, rgb(233 179 148 / .14), transparent 50%),
    radial-gradient(at 45% 42%, rgb(224 216 193 / .045), transparent 45%);
}
body > * { position: relative; z-index: 1; }
img, svg { max-width: 100%; }
a { color: var(--accent); text-underline-offset: .2em; }
a:hover { color: var(--accent-hi); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
::selection { background: var(--accent); color: var(--on-accent); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 1rem; top: -4rem; background: var(--accent); color: var(--on-accent); padding: .6rem 1rem; border-radius: var(--radius-xs); z-index: 20; font-weight: 700; }
.skip:focus { top: 1rem; }
.wrap { max-width: var(--layout-wide); margin-inline: auto; padding-inline: var(--space-6); }
.mono { font-family: var(--font-mono); }

/* JS gating: with no JS everything below is simply visible. */
html:not(.js) .js-only { display: none; }
.js-only.flex { display: flex; }
pre code { font: inherit; background: none; border: 0; padding: 0; }
.icon { width: 16px; height: 16px; display: block; flex: none; }

/* ---------- nav: no fill, 1px soft line ---------- */
.nav { position: relative; z-index: 10; border-bottom: 1px solid var(--line-tint-soft); }
.nav .wrap { display: flex; align-items: center; gap: var(--space-5); min-height: 4rem; }
.lockup { display: inline-flex; align-items: center; text-decoration: none; }
.lockup svg { height: 48px; width: auto; display: block; }
.logo .sheen { animation: sweep 4s ease-in-out infinite; }
@keyframes sweep { 0%, 62% { transform: translateX(0); } 90%, 100% { transform: translateX(var(--W, 396px)); } }
.logo .tk { animation: ltk 3.6s steps(1) infinite; }
@keyframes ltk { 0%, 45% { opacity: 0; transform: translate(0,0); } 46%, 58% { opacity: 1; transform: translate(0,0); } 59%, 71% { opacity: 1; transform: translate(40px,0); } 72%, 84% { opacity: 1; transform: translate(20px,38px); } 85%, 100% { opacity: 0; transform: translate(20px,38px); } }
.logo .den { animation: lden 3.6s ease-in-out infinite; }
@keyframes lden { 0%, 84% { opacity: 1; } 90% { opacity: .25; } 96%, 100% { opacity: 1; } }
.badge { display: inline-flex; align-items: center; gap: 8px; font: 400 .65rem var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--accent); background: var(--accent-dim); border: 1px solid var(--accent-dim); padding: .28rem .75rem; border-radius: var(--radius-2xs); margin: 0 0 1.1rem; }
.badge i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); animation: bpulse 2s ease-in-out infinite; }
@keyframes bpulse { 50% { opacity: .3; } }
.nav-links { display: flex; gap: var(--space-5); margin-left: auto; align-items: center; }
.nav-links a { color: var(--muted); text-decoration: none; font-size: .8rem; padding: .6rem 0; }
.nav-links a:hover { color: var(--text); }
.nav-links .hide-sm { display: none; }
@media (min-width: 900px) { .nav-links .hide-sm { display: inline; } }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: .78rem 1.6rem; border-radius: var(--radius-xs); font: 700 .82rem/1 var(--font-mono); text-decoration: none; border: 1px solid transparent; cursor: pointer; transition: transform .15s, opacity .18s, border-color .18s, background-color .18s, color .18s; }
.btn.primary { background: var(--accent); color: var(--on-accent); }
.btn.primary:hover { opacity: .88; transform: translateY(-1px); color: var(--on-accent); }
.btn.ghost { border-color: var(--hairline-strong); color: var(--text); font-weight: 500; }
.btn.ghost:hover { border-color: var(--hairline-hover); transform: translateY(-1px); color: var(--text); }
.btn.nav-btn { min-height: 36px; font-size: .78rem; padding: .45rem 1rem; background: transparent; color: var(--accent); border-color: var(--accent-dim); }
.btn.nav-btn:hover { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.nav-btn .icon, .btn.ghost .icon { filter: none; }
.cta-row { display: flex; flex-wrap: wrap; gap: var(--space-3); }
@media (max-width: 420px) { .cta-row .btn { width: 100%; } }

/* ---------- type ---------- */
.eyebrow { font: 400 .68rem var(--font-mono); text-transform: uppercase; letter-spacing: .16em; color: var(--accent); margin: 0 0 1.1rem; }
.eyebrow::before { content: "// "; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 700; }
h1 { font-size: clamp(2.4rem, 4.2vw, 4rem); line-height: 1.04; letter-spacing: -.035em; margin: 0 0 var(--space-5); text-wrap: balance; }
h1 .a { display: block; color: var(--muted); }
h1 .b { display: block; }
h1 em, h2 em, h3 em { font-style: normal; color: var(--accent); }
h2 { font-size: clamp(1.85rem, 3.2vw, 2.7rem); line-height: 1.12; letter-spacing: -.028em; margin: 0 0 var(--space-3); text-wrap: balance; }
h3 { font-size: 1.1rem; line-height: 1.25; letter-spacing: -.02em; margin: 0 0 var(--space-2); }
.lede { font-size: 1rem; line-height: 1.6; color: var(--muted); max-width: 34rem; margin: 0 0 var(--space-5); text-wrap: pretty; }
.lede strong { color: var(--text); font-weight: 500; }
.sec-head p:not(.eyebrow) { color: var(--muted); max-width: 38rem; margin: 0; text-wrap: pretty; }
section { padding-block: var(--space-8); border-top: 1px solid var(--line-tint-soft); }
.hero { padding-block: var(--space-7) var(--space-8); border-top: 0; }
@media (max-width: 900px) { .wrap { padding-inline: 1.5rem; } section { padding-block: 3.75rem; } .hero { padding-block: 2.5rem 3.75rem; } }
code, .code-inline { font: 400 .9em var(--font-mono); color: var(--accent-hi); background: var(--bg2); border: 1px solid var(--line-tint-soft); border-radius: var(--radius-2xs); padding: .08em .35em; }

/* ---------- code: flat bg2 panel, hairline, small radius ---------- */
.win { border: 1px solid var(--line-tint); border-radius: var(--radius-md); background: var(--bg2); overflow: hidden; }
.win + .win { margin-top: var(--space-4); }
.win-bar { display: flex; align-items: center; gap: var(--space-3); padding: .55rem 1.1rem; border-bottom: 1px solid var(--line-tint-soft); font: 400 .7rem var(--font-mono); color: var(--muted); min-height: 42px; background: color-mix(in srgb, var(--text) 2%, transparent); }
.win-bar .file { color: var(--muted); }
.win-bar .right { margin-left: auto; display: flex; align-items: center; gap: var(--space-3); }
pre.code, pre.report { margin: 0; padding: 1.1rem 1.25rem; overflow: auto; font: 400 var(--mono-size)/1.85 var(--font-mono); color: var(--text); tab-size: 4; -webkit-overflow-scrolling: touch; }
pre.code .k { color: var(--muted); }
pre.code .t { color: var(--accent-hi); }
pre.code .s { color: var(--code-string); }
pre.code .c { color: var(--muted); font-style: normal; }
pre.code .n { color: var(--accent); font-weight: 700; }
pre.code .add { display: block; margin-inline: -1.25rem; padding-inline: 1.25rem; background: var(--pass-wash); }
.status-dot { width: .6rem; height: .6rem; border-radius: 50%; background: var(--dim); display: inline-block; }
.status-dot.fail { background: var(--fail); }

.toggle { font: 700 .75rem var(--font-mono); color: var(--text); background: transparent; border: 1px solid var(--hairline-strong); border-radius: var(--radius-xs); padding: .5rem .9rem; min-height: 44px; cursor: pointer; display: inline-flex; gap: .5rem; align-items: center; transition: background-color .15s, border-color .15s, color .15s; }
.toggle:hover { border-color: var(--hairline-hover); }
.toggle[aria-pressed="true"] { border-color: var(--fail); color: var(--accent-2-hi); background: var(--fail-wash); }
.toggle .pip { width: .55rem; height: .55rem; border-radius: 50%; background: var(--dim); }
.toggle[aria-pressed="true"] .pip { background: var(--fail); }

/* hero demo gating */
.js .demo:not(.is-planted) .planted-only { display: none; }
.js .demo:not(.is-planted) .report-wrap { display: none; }
.idle-only { display: none; }
.js .demo:not(.is-planted) .idle-only { display: block; }
.idle-only { padding: 1rem 1.25rem; font: 400 var(--mono-size)/1.7 var(--font-mono); color: var(--muted); }
.report-top { display: flex; flex-wrap: wrap; gap: .5rem; padding: .9rem 1.25rem 0; }
.chip { display: inline-flex; gap: .5ch; align-items: center; font: 500 .75rem var(--font-mono); padding: .2rem .6rem; border-radius: 2px; border: 1px solid var(--line); color: var(--muted); }
.chip b { color: var(--text); font-weight: 600; }
.chip.fail { color: var(--fail); border-color: currentColor; background: var(--fail-wash); }
.chip.accent { color: var(--accent); border-color: currentColor; background: var(--accent-wash); }
pre.report .hd { color: var(--fail); font-weight: 700; }
pre.report .rk { color: var(--muted); }
pre.report .law { color: var(--text); }
pre.report .lk { color: var(--accent); }
pre.report .seed { color: var(--c-str); }
pre.report .l { display: block; }
.js pre.report.typed .l { opacity: 0; transition: opacity .14s linear, transform .14s ease-out; transform: translateY(3px); }
.js pre.report.typed .l.on { opacity: 1; transform: none; }
.js pre.report.typed .l.typing::after { content: ""; display: inline-block; width: .6ch; height: 1.1em; vertical-align: text-bottom; background: var(--accent); margin-left: 2px; animation: caret 1.1s steps(1) infinite; }
@keyframes caret { 50% { opacity: 0; } }

/* ---------- nine questions ---------- */
.qwrap { margin-top: var(--space-6); overflow-x: auto; }
table.qtable { width: 100%; border-collapse: collapse; min-width: 640px; }
.qtable caption { text-align: left; font: 500 .8125rem var(--font-mono); color: var(--muted); padding-bottom: var(--space-3); }
.qtable th, .qtable td { text-align: left; vertical-align: middle; padding: .35rem .75rem; border-top: 1px solid var(--line); }
.qtable thead th { font: 500 .75rem var(--font-mono); color: var(--muted); border-top: 0; padding-bottom: .6rem; }
.qtable tbody tr { transition: background-color .15s; }
.qtable tbody tr:hover, .qtable tbody tr:focus-within, .qtable tbody tr.is-on { background: var(--accent-wash); }
.qnum { font: 700 .8125rem var(--font-mono); color: var(--accent); width: 3rem; }
.qbtn { font: 700 1.0625rem/1.3 var(--font-display); letter-spacing: -.01em; color: var(--text); background: none; border: 0; text-align: left; cursor: pointer; padding: .5rem 0; min-height: 44px; }
.qbug { color: var(--muted); }
.qstage { width: 176px; }
.stage { width: 160px; height: 56px; display: block; overflow: visible; }
.stage text { font: 500 9px var(--font-mono); fill: var(--muted); }
.stage .ln { stroke: var(--muted); stroke-width: 1.5; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.stage .box { fill: none; stroke: var(--muted); stroke-width: 1.5; }
.stage .bad-t { fill: var(--fail); }

/* each scene's resting frame is its "bug" end state; hover/focus/tap replays it from the start */
/* 1 every state */
.s1 circle { fill: var(--pass-wash); stroke: var(--pass); stroke-width: 1.5; transform-box: fill-box; transform-origin: center; }
.s1 .bad { fill: var(--fail-wash); stroke: var(--fail); }
.s1 .x { stroke: var(--fail); stroke-width: 1.75; stroke-linecap: round; fill: none; }
/* 2 twice */
.s2 .v1 { opacity: 0; font-size: 13px; }
.s2 .v2 { fill: var(--fail); font-size: 13px; font-weight: 700; }
/* 3 backwards */
.s3 rect { fill: var(--muted); opacity: .65; transform-box: fill-box; transform-origin: bottom; }
.s3 .bad { fill: var(--fail); opacity: 1; transform: scaleY(.25); }
.s3 .base { stroke: var(--line); stroke-width: 1.5; }
/* 4 appear / vanish */
.s4 rect { fill: var(--accent-wash); stroke: var(--accent); stroke-width: 1.5; transform-box: fill-box; transform-origin: center; }
.s4 .gone { fill: none; stroke: var(--muted); stroke-dasharray: 3 3; opacity: .6; }
.s4 .mis { fill: var(--fail); font-weight: 700; }
/* 5 bad sequence */
.s5 rect { fill: none; stroke: var(--muted); stroke-width: 1.5; }
.s5 .bad { stroke: var(--fail); fill: var(--fail-wash); }
.s5 .bad-t { fill: var(--fail); }
/* 6 deadline */
.s6 .tick { stroke: var(--warn); stroke-width: 2; stroke-linecap: round; }
.s6 .w { fill: var(--warn); }
.s6 .dot { fill: var(--fail); transform: translateX(0); }
.s6 .ring { fill: none; stroke: var(--fail); stroke-width: 1.5; transform-box: fill-box; transform-origin: center; opacity: .55; }
/* 7 never finishes */
.s7 .track { fill: none; stroke: var(--line); stroke-width: 3; }
.s7 .arc { fill: none; stroke: var(--accent); stroke-width: 3; stroke-linecap: round; transform-origin: 80px 28px; }
/* 8 order */
.s8 text { font-size: 11px; }
.s8 .out-bad { fill: var(--fail); font-weight: 700; }
.s8 .mis { fill: var(--fail); font-weight: 700; font-size: 13px; }
/* 9 reach */
.s9 .target { fill: none; stroke: var(--muted); stroke-width: 1.5; stroke-dasharray: 4 3; }
.s9 .arrow { stroke: var(--accent); stroke-width: 2; fill: none; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 80; }
.s9 .ok { fill: var(--pass); font-weight: 700; }
.s9 .never { fill: var(--warn); font-size: 8px; }

:is(.q:hover, .q:focus-within, .q.is-on) .s1 circle { animation: q-pop .3s both; }
:is(.q:hover, .q:focus-within, .q.is-on) .s1 circle:nth-of-type(2) { animation-delay: .14s; }
:is(.q:hover, .q:focus-within, .q.is-on) .s1 circle:nth-of-type(3) { animation-delay: .28s; }
:is(.q:hover, .q:focus-within, .q.is-on) .s1 circle:nth-of-type(5) { animation-delay: .56s; }
:is(.q:hover, .q:focus-within, .q.is-on) .s1 .bad { animation: q-pop .3s .42s both, q-turn .25s .8s both; }
:is(.q:hover, .q:focus-within, .q.is-on) .s1 .x { animation: q-fade .2s .95s both; }

:is(.q:hover, .q:focus-within, .q.is-on) .s2 .a1 { animation: q-fade .25s both; }
:is(.q:hover, .q:focus-within, .q.is-on) .s2 .a2 { animation: q-fade .25s .6s both; }
:is(.q:hover, .q:focus-within, .q.is-on) .s2 .v1 { animation: q-inout 1.1s .2s both; }
:is(.q:hover, .q:focus-within, .q.is-on) .s2 .v2 { animation: q-fade .25s 1.2s both; }

:is(.q:hover, .q:focus-within, .q.is-on) .s3 rect { animation: q-grow .35s both; }
:is(.q:hover, .q:focus-within, .q.is-on) .s3 rect:nth-of-type(2) { animation-delay: .2s; }
:is(.q:hover, .q:focus-within, .q.is-on) .s3 rect:nth-of-type(3) { animation-delay: .4s; }
:is(.q:hover, .q:focus-within, .q.is-on) .s3 .bad { animation: q-drop 1s .6s both; }

:is(.q:hover, .q:focus-within, .q.is-on) .s4 rect { animation: q-pop .3s both; }
:is(.q:hover, .q:focus-within, .q.is-on) .s4 rect:nth-of-type(2) { animation-delay: .15s; }
:is(.q:hover, .q:focus-within, .q.is-on) .s4 .gone { animation: q-pop .3s .3s both, q-vanish .5s 1s both; }
:is(.q:hover, .q:focus-within, .q.is-on) .s4 .mis, :is(.q:hover, .q:focus-within, .q.is-on) .s4 .lbl { animation: q-fade .3s 1.4s both; }

:is(.q:hover, .q:focus-within, .q.is-on) .s5 .c1 { animation: q-fade .3s both; }
:is(.q:hover, .q:focus-within, .q.is-on) .s5 .arr { animation: q-draw .4s .35s both; }
:is(.q:hover, .q:focus-within, .q.is-on) .s5 .c2 { animation: q-fade .3s .8s both; }

:is(.q:hover, .q:focus-within, .q.is-on) .s6 .dot { animation: q-run 1.3s ease-out both; }
:is(.q:hover, .q:focus-within, .q.is-on) .s6 .ring { animation: q-fade .4s 1.3s both; }

:is(.q:hover, .q:focus-within, .q.is-on) .s7 .arc { animation: q-spin 1s linear infinite; }

:is(.q:hover, .q:focus-within, .q.is-on) .s8 .r1 { animation: q-fade .3s both; }
:is(.q:hover, .q:focus-within, .q.is-on) .s8 .r2 { animation: q-fade .3s .55s both; }
:is(.q:hover, .q:focus-within, .q.is-on) .s8 .mis { animation: q-fade .3s 1.3s both; }

:is(.q:hover, .q:focus-within, .q.is-on) .s9 .ok { animation: q-fade .3s both; }
:is(.q:hover, .q:focus-within, .q.is-on) .s9 .arrow { animation: q-draw .8s .3s both; }
:is(.q:hover, .q:focus-within, .q.is-on) .s9 .never { animation: q-fade .3s 1.3s both; }

@keyframes q-pop { from { opacity: 0; transform: scale(.55); } }
@keyframes q-turn { from { fill: var(--pass-wash); stroke: var(--pass); } }
@keyframes q-fade { from { opacity: 0; } }
@keyframes q-inout { 0% { opacity: 0; } 25%, 75% { opacity: 1; } 100% { opacity: 0; } }
@keyframes q-grow { from { transform: scaleY(0); } }
@keyframes q-drop { 0% { transform: scaleY(0); fill: var(--muted); } 50% { transform: scaleY(1); fill: var(--muted); } 100% { transform: scaleY(.25); fill: var(--fail); } }
@keyframes q-vanish { to { opacity: .6; } from { opacity: 1; fill: var(--accent-wash); stroke: var(--accent); } }
@keyframes q-draw { from { stroke-dashoffset: 80; } }
@keyframes q-run { from { transform: translateX(-100px); } }
@keyframes q-spin { to { transform: rotate(360deg); } }
@keyframes q-breathe { 0%, 100% { opacity: .5; } 50% { opacity: 1; } }

/* ---------- incident reports ---------- */
.reports { display: grid; gap: var(--space-5); margin-top: var(--space-6); grid-template-columns: minmax(0, 1fr); align-items: start; }
.rcard .win-bar { gap: .5rem; flex-wrap: wrap; }
.rcard pre.report { white-space: pre; }
.shrink { border-bottom: 1px solid var(--line); padding: 1rem 1.25rem; display: grid; gap: .75rem; background: var(--bg); }
.shrink-top { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; justify-content: space-between; font: 500 .75rem var(--font-mono); color: var(--muted); }
.shrink-line { margin: 0; font: 400 var(--mono-size)/1.6 var(--font-mono); color: var(--text); overflow: auto; white-space: pre; padding-bottom: .25rem; }
.shrink-line .fz { color: var(--muted); }
.meter { height: 6px; border-radius: 2px; background: var(--line); overflow: hidden; }
.meter i { display: block; height: 100%; width: 100%; background: var(--accent); border-radius: 2px; transition: width .45s ease; }
.shrink-seed { font: 500 var(--mono-size)/1.5 var(--font-mono); color: var(--c-str); min-height: 1.5em; overflow: auto; white-space: pre; }
.mini { font: 700 .75rem var(--font-mono); color: var(--text); background: none; border: 1px solid var(--line); border-radius: 2px; padding: .45rem .9rem; min-height: 44px; cursor: pointer; }
.mini:hover { border-color: var(--muted); }
.mini[disabled] { opacity: .5; cursor: default; }

/* ---------- three jobs ---------- */
.rule-chip { display: flex; justify-content: center; margin-top: var(--space-6); }
.rule-chip span { font: 700 var(--mono-size) var(--font-mono); color: var(--accent); border: 1px solid var(--accent); background: var(--accent-wash); border-radius: 2px; padding: .5rem 1rem; }
.fan { display: none; width: 100%; height: 56px; }
@media (min-width: 900px) { .fan { display: block; } }
.fan path { fill: none; stroke: var(--accent); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.fan path.dash { stroke-dasharray: 5 5; stroke: var(--muted); }
.jobs { display: grid; gap: var(--space-4); grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); margin-top: var(--space-4); }
@media (min-width: 900px) { .jobs { margin-top: 0; grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.job { border: 1px solid var(--line); border-radius: var(--radius-lg); padding: var(--space-5); background: var(--bg-raise); }
.job.optin { background: transparent; border-style: dashed; }
.job .num { font: 700 .8125rem var(--font-mono); color: var(--accent); }
.job p { margin: 0; color: var(--muted); }
.job .tag { display: inline-block; margin-top: var(--space-3); }
.job pre { margin: var(--space-3) 0 0; font: 400 .75rem/1.6 var(--font-mono); overflow: auto; }
.note { margin-top: var(--space-5); color: var(--muted); max-width: var(--measure); }

/* ---------- adoption ---------- */
.adopt { display: grid; gap: var(--space-5); grid-template-columns: repeat(auto-fit, minmax(min(480px, 100%), 1fr)); margin-top: var(--space-6); align-items: start; }
.dial { border: 1px solid var(--line); border-radius: var(--radius-lg); padding: var(--space-5); background: var(--bg-raise); display: grid; gap: var(--space-4); }
.dial label { font: 500 .8125rem var(--font-mono); color: var(--muted); }
.dial-date { font: 700 1.75rem/1 var(--font-mono); letter-spacing: -.02em; }
.sev { display: inline-flex; align-items: center; gap: .6rem; font: 700 .875rem var(--font-mono); letter-spacing: .04em; padding: .5rem .9rem; border-radius: var(--radius); border: 1px solid currentColor; width: fit-content; transition: color .2s, background-color .2s; }
.sev.warn { color: var(--warn); background: var(--warn-wash); }
.sev.err { color: var(--fail); background: var(--fail-wash); }
.dial-effect { margin: 0; color: var(--muted); min-height: 3.2em; }
input[type="range"] { width: 100%; height: 44px; background: none; accent-color: var(--accent); margin: 0; }
.rail { position: relative; height: 8px; border-radius: 2px; background: linear-gradient(90deg, var(--warn) 0 49.2%, var(--fail) 49.2% 100%); opacity: .85; }
.rail-labels { display: flex; justify-content: space-between; font: 500 .75rem var(--font-mono); color: var(--muted); }
table.sevtab { width: 100%; border-collapse: collapse; font-size: .9375rem; }
.sevtab th, .sevtab td { text-align: left; padding: .6rem .5rem; border-top: 1px solid var(--line); }
.sevtab thead th { font: 500 .75rem var(--font-mono); color: var(--muted); border-top: 0; }
.js .sevtab-wrap { display: none; }

/* ---------- footer ---------- */
footer .wrap { display: flex; flex-wrap: wrap; gap: var(--space-4) var(--space-6); align-items: center; }
footer a { color: var(--muted); }
footer .fam { margin-left: auto; display: flex; gap: var(--space-4); flex-wrap: wrap; font-family: var(--font-mono); font-size: .8125rem; }
footer .nl { color: var(--text); text-decoration: none; }
footer .nl:hover { color: var(--accent); }

/* ---------- reduced motion: keep small fades and colour changes, drop travel, scale and loops ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .logo .sheen, .logo .tk, .logo .den, .badge i { animation: none; }
  .stage * { animation-name: q-fade !important; animation-duration: .25s !important; animation-iteration-count: 1 !important; animation-timing-function: linear !important; }
  :is(.q:hover, .q:focus-within, .q.is-on) .s7 .arc { animation-name: q-breathe !important; animation-duration: 2.6s !important; animation-iteration-count: infinite !important; animation-timing-function: ease-in-out !important; }
  .js pre.report.typed .l { transform: none !important; transition: opacity .1s linear; }
  .js pre.report.typed .l.typing::after { animation: none; }
  .meter i { transition: none; }
}
@media (max-width: 720px) {
  :root { --space-8: 4.5rem; --space-7: 3rem; }
  .qwrap { overflow: visible; }
  table.qtable, .qtable tbody, .qtable tr, .qtable td, .qtable th { display: block; min-width: 0; }
  .qtable thead { display: none; }
  .qtable tr.q { display: grid; grid-template-columns: 2.4rem 1fr; padding: .5rem 0; border-top: 1px solid var(--line); }
  .qtable th, .qtable td { border: 0; padding: .1rem .25rem; }
  .qtable .qbug, .qtable .qstage { grid-column: 2; }
  .qstage { width: auto; }
}


/* ---------- build (hero): one Order, seven stages ---------- */
.build { margin-top: var(--space-7); display: grid; gap: var(--space-4); --h: 34rem; }
.js .build:not(.is-ready) { min-height: 62rem; }
.sbtn { display: inline-flex; align-items: center; gap: .6rem; min-height: 44px; padding: .4rem 1rem .4rem .5rem; border-radius: 2px; border: 1px solid var(--line); background: none; color: var(--muted); font: 500 .9375rem var(--font-display); cursor: pointer; transition: border-color .15s, color .15s, background-color .15s; }
.sbtn .n { display: inline-grid; place-items: center; width: 1.65rem; height: 1.65rem; border-radius: 50%; background: var(--bg-raise); font: 700 .75rem var(--font-mono); color: var(--muted); }
.sbtn:hover { border-color: var(--muted); color: var(--text); }
.sbtn[aria-current="step"] { border-color: var(--accent); color: var(--text); background: var(--accent-wash); }
.sbtn[aria-current="step"] .n { background: var(--accent); color: var(--on-accent); }
.sbtn.is-done .n { color: var(--accent); }
.b-ctl { display: grid; gap: var(--space-3); }
.b-steps { display: flex; flex-wrap: wrap; gap: .5rem; }
.b-bar { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.b-scrub { flex: 1 1 12rem; min-width: 9rem; display: flex; align-items: center; min-height: 44px; }
.b-scrub input { width: 100%; height: 44px; margin: 0; accent-color: var(--accent); background: transparent; cursor: grab; }
.b-scrub input:active { cursor: grabbing; }
.toggle[disabled] { opacity: .45; cursor: default; }
.b-meter { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .75rem; font: 500 .75rem var(--font-mono); color: var(--muted); }
.b-meter .meter { flex: 1 1 10rem; height: 8px; }
.b-meter .meter i { width: 4%; transition: width .7s ease; }
.b-state { color: var(--accent); font-weight: 700; min-width: 7ch; }
.b-caps { display: grid; }
.b-caps .stg-h { grid-area: 1 / 1; visibility: hidden; opacity: 0; transition: opacity .35s; }
.b-caps .stg-h.is-on { visibility: visible; opacity: 1; }
.stg-h h3 { font: 700 clamp(1.5rem, 2.6vw, 2.1rem)/1.12 var(--font-display); letter-spacing: -.035em; margin: 0 0 var(--space-3); text-wrap: balance; }
.stg-h p { color: var(--muted); margin: 0 0 var(--space-3); max-width: 62ch; text-wrap: pretty; }
.step-k { font: 500 .8125rem var(--font-mono); color: var(--accent); margin: 0 0 .8rem; }

/* the stacked, no-JS reading: every stage, with the code it adds and the view it draws */
.b-stack .stg { padding-block: var(--space-6); border-top: 1px solid var(--line-tint-soft); }
.b-stack .stg:first-child { border-top: 0; padding-top: 0; }
.stg-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--space-4); align-items: start; margin-top: var(--space-4); }
.js .b-stack { display: none; }

/* the live build */
.b-live { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--space-4); align-items: stretch; }
.b-live:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.b-code, .b-view { height: var(--h); min-width: 0; }
.b-code { display: flex; flex-direction: column; }
.b-code pre.code { flex: 1; min-height: 0; overflow: auto; scroll-behavior: smooth; position: relative; }
.b-view { position: relative; }
.b-view .vw { height: 100%; margin: 0; display: flex; flex-direction: column; }
.b-view .vw .vw-body { flex: 1; min-height: 0; overflow: auto; }
.js .vw:not(.is-on) { display: none; }
.vw-body { padding: 1rem 1.25rem; display: grid; gap: .9rem; align-content: start; min-width: 0; }
.vw-note { margin: 0; font: 400 .75rem/1.5 var(--font-mono); color: var(--muted); }
.vw .win-bar .status-dot.ok { background: var(--pass); }
.vw pre.code, .vw pre.report { padding: 0; background: none; border: 0; overflow: auto; }

.ly { display: block; margin-inline: -1.25rem; padding-inline: 1.25rem; }
.ly + .ly { margin-top: .9rem; }
.js .ly:not(.is-on) { display: none; }
.js .ly.is-on { opacity: .62; transition: opacity .4s; }
.js .ly.is-new { opacity: 1; background: var(--pass-wash); box-shadow: inset 2px 0 var(--pass); animation: ly-in .5s both; }
@keyframes ly-in { from { opacity: 0; transform: translateY(6px); } }

.okline { display: inline; }
.bugdiff { display: none; }
.is-planted .bugdiff { display: inline; }
.is-planted .okline { display: none; }
.del, .add2 { display: inline-block; box-sizing: border-box; width: calc(100% + 2.5rem); margin-inline: -1.25rem; padding-inline: 1.25rem; }
.del { color: var(--fail); background: var(--fail-wash); }
.add2 { color: var(--pass); background: var(--pass-wash); }

/* the questions a record cannot answer */
.asks { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .5rem; }
.asks li { font: 500 .8125rem var(--font-mono); color: var(--warn); border: 1px dashed currentColor; border-radius: 2px; padding: .3rem .75rem; background: var(--warn-wash); }
.asks .by { color: var(--muted); font-weight: 400; margin-left: .5ch; }
.b-asks { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .5rem; }
.b-asks li { font: 500 .8125rem var(--font-mono); color: var(--warn); border: 1px dashed currentColor; border-radius: 2px; padding: .3rem .75rem; background: var(--warn-wash); transition: color .4s, background-color .4s, border-color .4s; }
.b-asks li .by { display: none; }
.b-asks li.is-ok { color: var(--pass); border-style: solid; background: var(--pass-wash); }
.b-asks li::before { content: "✓ "; visibility: hidden; }
.b-asks li.is-ok::before { visibility: visible; }
#b-play { min-width: 5.6rem; }
.b-hint { margin: 0; font: 400 .75rem/1.5 var(--font-mono); color: var(--muted); }

/* stage 0 */
pre.val { font: 400 var(--mono-size)/1.8 var(--font-mono); color: var(--text); }
/* stage 1 */
.erd-mini { width: 100%; height: auto; display: block; overflow: visible; }
.erd-mini text { font: 500 12.5px var(--font-mono); fill: var(--muted); }
.erd-mini .th { font-weight: 700; fill: var(--text); }
.erd-mini .fk { fill: var(--accent); font-weight: 700; }
.erd-mini .dim { fill: var(--muted); font-size: 12px; }
.erd-mini .fr { fill: var(--bg-code); stroke: var(--line); stroke-width: 1.5; }
.erd-mini .hd { fill: var(--bg-raise); stroke: var(--line); stroke-width: 1.5; }
.erd-mini .fkline path { fill: none; stroke: var(--accent); stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.rows { list-style: none; margin: 0; padding: 0; display: grid; gap: .4rem; }
.r { display: grid; grid-template-columns: 2rem minmax(0, 1fr) auto; gap: .75rem; align-items: center; padding: .4rem .7rem; border: 1px solid var(--line); border-radius: 4px; font: 500 .78rem var(--font-mono); background: var(--bg-code); min-height: 2.4rem; }
.r code { color: var(--text); background: none; border: 0; padding: 0; font: inherit; }
.r .res { color: var(--pass); text-align: right; }
.r.dangling { border-color: var(--fail); background: var(--fail-wash); }
.r.dangling .res { color: var(--fail); }
.cons { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .4rem; }
.cons li { font: 500 .75rem var(--font-mono); border: 1px solid var(--accent); border-radius: 2px; padding: .2rem .65rem; color: var(--accent); background: var(--accent-wash); }
.cons li.more { border: 0; background: none; padding-inline: .3rem; }
.cons li.more a { color: var(--muted); }
/* stage 2 */
.tryit { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; font: 500 .8125rem var(--font-mono); color: var(--muted); }
.tryit input[type="number"] { min-height: 44px; width: 7.5rem; background: var(--bg-code); border: 1px solid var(--hairline-strong); border-radius: 4px; color: var(--text); font: 700 .9rem var(--font-mono); padding: .4rem .7rem; }
.rulelist { list-style: none; margin: 0; padding: 0; display: grid; gap: .4rem; }
.rl { display: flex; justify-content: space-between; gap: 1rem; align-items: center; padding: .55rem .8rem; border: 1px solid var(--pass); border-radius: 4px; background: var(--pass-wash); font: 600 .78rem var(--font-mono); min-height: 44px; }
.rl .rn { color: var(--text); }
.rl .st { color: var(--pass); }
.rl.is-bad { border-color: var(--fail); background: var(--fail-wash); }
.rl.is-bad .st { color: var(--fail); }
.viol { display: grid; gap: 0; }
/* stage 3 */
.mm pre.code { font-size: .72rem; line-height: 1.6; }
.try-out { font: 500 .78rem var(--font-mono); color: var(--accent-2-hi); }
/* stage 4 */
.tests { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.test { display: grid; grid-template-columns: 6.6rem minmax(0, 1fr) auto 1.2rem; gap: .75rem; align-items: center; padding: .5rem .8rem; border: 1px solid var(--pass); border-radius: 4px; background: var(--pass-wash); font: 500 .78rem var(--font-mono); min-height: 44px; }
.test .tn { font-weight: 700; color: var(--text); }
.test .td, .test .tc { color: var(--muted); }
.test .tc { white-space: nowrap; }
.test .tc b { color: var(--text); font-variant-numeric: tabular-nums; }
.test .tk { color: var(--pass); font-weight: 700; }
.test.is-fail { border-color: var(--fail); background: var(--fail-wash); }
.test.is-fail .tk { color: var(--fail); }
.conform-out { display: block; visibility: hidden; margin: 0; color: var(--muted); }
html:not(.js) .conform-out { display: none; }
.conform-out .hd { color: var(--fail); font-weight: 700; }
.build.is-planted .conform-out { visibility: visible; }
/* stage 5 and services */
.wal-top { display: flex; justify-content: space-between; align-items: center; gap: .75rem; font: 500 .75rem var(--font-mono); color: var(--muted); }
.wal-seq { margin: 0; font: 400 .78rem/1.7 var(--font-mono); color: var(--text); white-space: pre-wrap; overflow-wrap: anywhere; min-height: 3.4em; }
.wal-seq .gone { color: var(--muted); text-decoration: line-through; }
.wal .meter i { width: 100%; }
.wal-report, .wal-top, .wal-seq, .wal .meter { display: none; }
.wal.is-fail .wal-top, .wal.is-fail .wal-seq, .wal.is-fail .meter { display: block; }
.wal.is-fail .wal-top { display: flex; }
.wal.is-fail .wal-report.is-done { display: block; }
.wal.is-fail .wal-ok { display: none; }
.wal-ok { margin: 0; color: var(--muted); }
.l.ok { color: var(--pass); font-weight: 700; }
/* stage 6 */
.tiles { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; }
.tile { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: .5rem; padding: .55rem .7rem; border: 1px solid var(--pass); border-radius: var(--radius); background: var(--pass-wash); min-height: 44px; }
.tile .tn { font: 700 .75rem var(--font-mono); color: var(--muted); }
.tile .tl { font: 700 .78rem var(--font-mono); color: var(--text); overflow-wrap: anywhere; }
.tile .tk { font: 700 1rem var(--font-mono); color: var(--pass); }
.reached { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .4rem; }
.reached li { font: 500 .75rem var(--font-mono); color: var(--pass); border: 1px solid var(--pass); border-radius: 2px; padding: .2rem .65rem; background: var(--pass-wash); }
.vacancy { margin: 0; font: 500 .85rem var(--font-mono); color: var(--pass); }
.vacancy b { color: var(--text); margin-right: 1ch; }

/* state machine drawing (hero stage 3 and the state machines section) */
.mch { width: 100%; height: auto; display: block; overflow: visible; }
.mch text { font: 500 12px var(--font-mono); fill: var(--muted); }
.mch .n rect { fill: var(--bg-code); stroke: var(--accent); stroke-width: 1.75; transition: fill .25s, stroke .25s; }
.mch .n text { fill: var(--text); font-weight: 700; font-size: 13px; }
.mch .n .fin { fill: none; stroke-width: 1.25; }
.mch .e path { stroke: var(--accent); stroke-width: 1.75; fill: none; stroke-linecap: round; stroke-linejoin: round; transition: stroke .25s, stroke-width .25s; }
.mch .e.start circle { fill: var(--accent); }
.mk { fill: var(--accent); } .mk-d { fill: var(--accent-2); } .mk-r { fill: var(--fail); }
.mch .den path { fill: none; stroke: var(--accent-2); stroke-width: 3; stroke-linecap: round; stroke-dasharray: .1 7; transition: opacity .3s; }
.mch .den .bar { stroke-dasharray: none; stroke-width: 3.5; }
.mch .den text { fill: var(--accent-2-hi); font-weight: 700; }
.mch .guard { fill: var(--accent-2-hi); font-size: 11px; }
.mch .ext { opacity: 0; transition: opacity .3s; }
.mch .ext path { fill: none; stroke: var(--fail); stroke-width: 2.5; stroke-linecap: round; }
.mch .ext text { fill: var(--fail); font-weight: 700; }
.mch.is-bad .ext { opacity: 1; }
.mch.is-bad .den { opacity: .45; }
.mch .n.active rect { fill: var(--accent-wash); stroke: var(--accent-hi); }
.mch .e.active path { stroke: var(--accent-hi); stroke-width: 3.25; }
.mch .n.flash rect { stroke: var(--fail); fill: var(--fail-wash); }

/* hero stage animations: nodes spawn, edges draw, tests stream in. They restart each time the stage shows. */
.vw.is-on .ln { animation: s-in .35s var(--d, 0s) both; }
.vw.is-on .asks li { animation: s-in .4s var(--d, 0s) both; }
.vw.is-on .erd-mini .tb { animation: s-pop .4s var(--d, 0s) both; transform-box: fill-box; transform-origin: center; }
.vw.is-on .erd-mini .fkline { animation: s-in .4s var(--d, 0s) both; }
.vw.is-on .erd-mini .fkline path[pathLength] { stroke-dasharray: 1; animation: s-draw1 .6s var(--d, 0s) both; }
.vw.is-on .r, .vw.is-on .compiles li { animation: s-slide .4s var(--d, 0s) both; }
.vw.is-on .r.dangling { animation: s-slide .4s var(--d, 0s) both, r-bad .5s 1.9s both; }
.vw.is-on .r.dangling .res { animation: r-bad-t .5s 1.9s both; }
.vw.is-on .rl { animation: s-in .4s var(--d, 0s) both; }
.vw.is-on .mch .n { animation: s-pop .4s var(--d, 0s) both; transform-box: fill-box; transform-origin: center; }
.vw.is-on .mch .e path[pathLength] { stroke-dasharray: 1; animation: s-draw1 .5s var(--d, 0s) both; }
.vw.is-on .mch .e text, .vw.is-on .mch .e.start circle { animation: s-in .4s var(--d, 0s) both; }
.vw.is-on .mch .den { animation: s-in .7s var(--d, 0s) both; }
.vw.is-on .test { animation: s-slide .4s var(--d, 0s) both; }
.vw.is-on .tile { animation: s-in .3s var(--d, 0s) both; }
.vw.is-on .tile .tk { animation: s-pop .3s calc(var(--d, 0s) + .2s) both; }
.vw.is-on .reached li, .vw.is-on .vacancy { animation: s-in .4s var(--d, 0s) both; }
@keyframes s-in { from { opacity: 0; } }
@keyframes s-pop { from { opacity: 0; transform: scale(.7); } }
@keyframes s-slide { from { opacity: 0; transform: translateX(-14px); } }
@keyframes s-draw1 { from { stroke-dashoffset: 1; } }
@keyframes r-bad { from { border-color: var(--line); background: var(--bg-code); } }
@keyframes r-bad-t { from { color: var(--muted); } }

/* ---------- relations ---------- */
.rel { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: var(--space-4); margin-top: var(--space-6); align-items: start; }
.rel-side { display: grid; gap: var(--space-4); }
.rel-side .win + .win { margin-top: 0; }
.rel-erd svg.erd { width: 100%; height: auto; display: block; padding: .5rem 1rem 0; }
.erd text { font: 500 12px var(--font-mono); fill: var(--muted); }
.erd .th { font-weight: 700; fill: var(--text); font-size: 13px; }
.erd .fr { fill: var(--bg-code); stroke: var(--line); stroke-width: 1.5; }
.erd .hd { fill: var(--bg-raise); stroke: var(--line); stroke-width: 1.5; }
.erd .hl { fill: none; stroke: none; }
.erd .row.bad .hl { fill: var(--fail-wash); stroke: var(--fail); stroke-width: 1; }
.erd .row.bad text { fill: var(--fail); font-weight: 700; }
.erd .dim, .erd .cap { fill: var(--muted); }
.erd .cap { font-size: 12px; }
.erd path.fk { fill: none; stroke: var(--accent); stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.erd.sc-ref .fk-line { stroke: var(--fail); stroke-dasharray: 5 4; }
.erd .nd rect { fill: var(--bg-code); stroke: var(--accent); stroke-width: 1.5; }
.erd .nd text { fill: var(--text); font-weight: 700; }
.erd .cyc, .erd .chn { fill: none; stroke: var(--fail); stroke-width: 2; stroke-linecap: round; opacity: 0; transition: opacity .3s; }
.erd.sc-cyc .cyc, .erd.sc-chain .chn { opacity: 1; }
.erd .ann { fill: var(--fail); font-weight: 700; opacity: 0; transition: opacity .3s; }
.erd.sc-dup .a-dup, .erd.sc-ref .a-ref, .erd.sc-cyc .a-cyc, .erd.sc-chain .a-chain { opacity: 1; }
.seg { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; padding: .75rem 1.1rem; border-top: 1px solid var(--line-tint-soft); }
.seg-l { font: 500 .75rem var(--font-mono); color: var(--muted); margin-right: .25rem; }
.seg .mini[aria-pressed="true"] { border-color: var(--fail); color: var(--accent-2-hi); background: var(--fail-wash); }
.cl { display: block; opacity: 1; }
.js .cl { opacity: .6; transition: opacity .2s; }
.js .cl.is-on { opacity: 1; background: var(--fail-wash); margin-inline: -1.25rem; padding-inline: 1.25rem; box-shadow: inset 2px 0 var(--fail); }
.viols .idle-only { display: none; }
.js .viols:not([data-sc]) .idle-only { display: block; }
.js .viols .viol { display: none; padding: 1rem 1.25rem; }
.js .viols[data-sc="dup"] .v-dup, .js .viols[data-sc="ref"] .v-ref, .js .viols[data-sc="cyc"] .v-cyc, .js .viols[data-sc="chain"] .v-chain { display: block; }
.viols .viol { padding: 1rem 1.25rem .25rem; border-top: 1px solid var(--line-tint-soft); }
.viols .viol:first-of-type { border-top: 0; }

/* ---------- state machines ---------- */
.mc-kind { margin-top: var(--space-6); }
.mc-kind .gen-k { font-size: 1rem; text-transform: none; }
.mc-sub { margin: .2rem 0 0; color: var(--muted); }
.mc { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: var(--space-4); margin-top: var(--space-4); align-items: start; }
.mc2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.mc-side { display: grid; gap: var(--space-3); }
.walk { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.trail { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; font: 500 .75rem var(--font-mono); }
.trail li { border: 1px solid var(--line); border-radius: 2px; padding: .15rem .55rem; color: var(--muted); }
.trail li.arrow { border: 0; padding: 0; color: var(--accent); }
.trail li.cur { border-color: var(--accent); color: var(--text); background: var(--accent-wash); }
.conf { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-3); align-content: start; }
.conf .win + .win { margin-top: 0; }
.conf-bad { display: none; }
.conf.is-planted .conf-ok { display: none; }
.conf.is-planted .conf-bad { display: inline; color: var(--fail); }
.conf-pass { margin: 0; padding: 1rem 1.25rem; color: var(--muted); }
.conf-fail { display: none; padding: 1rem 1.25rem .5rem; }
.conf.is-planted .conf-pass { display: none; }
.conf.is-planted .conf-fail { display: block; }
.conf-dot-fail { background: var(--fail); }

/* ---------- services ---------- */
.sv { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--space-4); margin-top: var(--space-6); align-items: start; }
.sv .win + .win { margin-top: 0; }

/* ---------- responsive ---------- */
@media (max-width: 1000px) {
  .rel, .mc, .mc2, .conf, .sv, .stg-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 860px) {
  .build { --h: auto; }
  .b-live { grid-template-columns: minmax(0, 1fr); }
  .b-code, .b-view { height: auto; }
  .b-code pre.code { max-height: 19rem; flex: none; }
  .b-view .vw .vw-body { overflow: visible; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .test { grid-template-columns: 1fr auto 1.2rem; }
  .test .td { grid-column: 1 / -1; grid-row: 2; }
}
@media (max-width: 720px) { .qtable .qaxis { grid-column: 2; } }

/* ---------- reduced motion: fades only, no travel, no drawing, no scale ---------- */
@media (prefers-reduced-motion: reduce) {
  .vw.is-on :is(.ln, .asks li, .compiles li, .erd-mini .tb, .erd-mini .fkline, .erd-mini .fkline path[pathLength], .r, .rl, .mch .n, .mch .e path[pathLength], .mch .e text, .mch .e.start circle, .mch .den, .test, .tile, .tile .tk, .reached li, .vacancy) { animation: s-in .3s var(--d, 0s) both !important; stroke-dasharray: none; }
  .vw.is-on .mch .e path[pathLength] { stroke-dasharray: none; }
  .vw.is-on .r.dangling, .vw.is-on .r.dangling .res { animation: s-in .3s var(--d, 0s) both !important; }
  .js .ly.is-new { animation: s-in .3s both; }
  .b-meter .meter i, .b-caps .stg-h { transition: none; }
  .b-code pre.code { scroll-behavior: auto; }
  .mch .n rect, .mch .e path, .mch .ext, .mch .den path, .erd .ann, .erd .cyc, .erd .chn { transition: none; }
}

pre.code, pre.report, .shrink-line { font-variant-ligatures: none; }

.compiles { list-style: none; margin: 0; padding: 0; display: grid; gap: .35rem; }
.compiles li { display: flex; justify-content: space-between; gap: 1rem; align-items: center; padding: .4rem .7rem; border: 1px solid var(--line); border-radius: 4px; background: var(--bg-code); font: 500 .78rem var(--font-mono); }
.compiles code { color: var(--text); background: none; border: 0; padding: 0; font: inherit; }
.compiles span { color: var(--muted); }

.viols .viol, .wal-report, .conf-fail { white-space: pre-wrap; overflow-wrap: anywhere; }

.mm-d { margin-top: var(--space-4); }
.mm-d summary { cursor: pointer; font: 500 .8125rem var(--font-mono); color: var(--muted); min-height: 44px; display: flex; align-items: center; }
.mm-d[open] summary { color: var(--text); }
.mm-d .win { margin-top: var(--space-3); }

/* ---------- hero visual: the Order, layer by layer ---------- */
.morph { margin: var(--space-7) 0 0; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--bg2); padding: 1.25rem 1.5rem 1rem; }
.morph svg { width: 100%; height: auto; display: block; overflow: visible; }
.morph text { font: 500 13px var(--font-mono); fill: var(--muted); }
.morph .th { font-weight: 700; fill: var(--text); font-size: 14px; }
.morph .ty { fill: var(--muted); font-size: 12px; }
.morph .fk, .morph .ac { fill: var(--accent); font-weight: 700; }
.morph .fr { fill: var(--bg); stroke: var(--line); stroke-width: 1.5; }
.morph .hd { fill: var(--bg-raise); stroke: var(--line); stroke-width: 1.5; }
.morph .qc { fill: var(--warn-wash); stroke: var(--accent-2-hi); stroke-width: 1.5; stroke-dasharray: 5 4; }
.morph .qt { fill: var(--accent-2-hi); font-weight: 600; }
.morph .ed { fill: none; stroke: var(--accent); stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.morph .sd { fill: var(--accent); }
.morph .nd { fill: var(--bg); stroke: var(--accent); stroke-width: 1.75; }
.morph .fin { fill: none; stroke: var(--accent); stroke-width: 1.25; }
.morph .nt { fill: var(--text); font-weight: 700; }
.morph .dn { fill: none; stroke: var(--accent-2); stroke-width: 3; stroke-linecap: round; stroke-dasharray: .1 7; }
.morph .dbar { stroke: var(--accent-2); stroke-width: 3.5; stroke-linecap: round; }
.morph .dt { fill: var(--accent-2-hi); font-weight: 700; }
.morph .bd { fill: var(--fail-wash); stroke: var(--fail); stroke-width: 1.5; }
.morph .bt { fill: var(--fail); font-weight: 600; }
.morph .gd, .morph .tc { fill: var(--pass-wash); stroke: var(--pass); stroke-width: 1.5; }
.morph .gt, .morph .tk { fill: var(--pass); font-weight: 700; }
.morph .tn { fill: var(--text); font-weight: 700; }
.morph .rl { fill: var(--accent-wash); stroke: var(--accent); stroke-width: 1.5; }
.morph .rn { fill: var(--accent); font-weight: 700; }
.morph .vac { fill: var(--pass); font-weight: 700; font-size: 18px; }
.morph .ax { fill: var(--pass-wash); stroke: var(--pass); stroke-width: 1.5; }
.morph .axt { fill: var(--pass); font-weight: 700; }
.morph .mk { fill: var(--accent); } .morph .mk-d { fill: var(--accent-2); }
.morph .st { transition: opacity .7s var(--d, 0s) ease, transform .7s var(--d, 0s) ease; }
.morph .dr { stroke-dasharray: 1; stroke-dashoffset: 0; transition: stroke-dashoffset .8s ease; }
.js .morph .mg:not(.is-on) .st { opacity: 0; transform: translateY(10px); }
.js .morph .mg:not(.is-on) .dr { stroke-dashoffset: 1; }
.morph:not([data-stage="0"]) .q0 { opacity: 0; transition: opacity .5s; }
.morph .pre6, .morph .at6 { transition: opacity .6s; }
.morph[data-stage="7"] .pre6, .morph:not([data-stage="7"]) .at6 { opacity: 0; }
.m-foot { display: grid; gap: .75rem; margin-top: var(--space-3); }
.m-cap { margin: 0; min-height: 3.2em; font: 500 .95rem/1.5 var(--font-mono); color: var(--text); }
.m-meter { display: flex; align-items: center; gap: .75rem; font: 500 .75rem var(--font-mono); color: var(--muted); }
.m-meter .meter { flex: 1; height: 8px; }
.m-meter .meter i { transition: width .8s ease; }
.m-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .5rem; }
.m-steps li, .m-steps button { display: inline-flex; align-items: center; gap: .5rem; font: 500 .8125rem var(--font-mono); color: var(--muted); border: 1px solid var(--line); border-radius: 2px; padding: .35rem .8rem .35rem .4rem; background: none; }
.m-steps button { min-height: 44px; cursor: pointer; }
.m-steps button:hover { border-color: var(--muted); color: var(--text); }
.m-steps .n { display: inline-grid; place-items: center; width: 1.5rem; height: 1.5rem; border-radius: 50%; background: var(--bg-raise); font: 700 .7rem var(--font-mono); }
.m-steps [aria-current="step"] { border-color: var(--accent); color: var(--text); background: var(--accent-wash); }
.m-steps [aria-current="step"] .n { background: var(--accent); color: var(--on-accent); }
.m-steps .is-done .n { color: var(--accent); }
#m-play { justify-self: start; }
@media (max-width: 720px) { .morph { padding: 1rem; } .morph text { font-size: 15px; } .m-steps li, .m-steps button { font-size: .75rem; } }
@media (prefers-reduced-motion: reduce) {
  .js .morph .mg:not(.is-on) .st { transform: none; }
  .morph .st, .morph .dr, .m-meter .meter i { transition: opacity .3s; transition-delay: 0s; }
  .morph .dr { stroke-dasharray: none; }
}
.js .build:not(.is-ready) { min-height: 40rem; }
#walkthrough .build { margin-top: var(--space-6); }
.m-steps li:has(button) { border: 0; padding: 0; }

/* hero v3: code first */
.m-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: var(--space-4); align-items: stretch; --mh: 34rem; }
.m-code { height: var(--mh); display: flex; flex-direction: column; }
.m-codebox { flex: 1; min-height: 0; overflow: auto; scroll-behavior: smooth; position: relative; }
.m-codebox pre.code { padding: 1rem 1.25rem; }
.m-view { height: var(--mh); display: flex; flex-direction: column; }
.m-view svg { flex: 1; min-height: 0; width: 100%; padding: .5rem .75rem; }
.m-view .win-bar b { color: var(--accent); font-weight: 700; }
.morph .tn.sm { font-size: 10.5px; }
.cg { display: block; margin-inline: -1.25rem; padding-inline: 1.25rem; transition: opacity .6s, transform .6s, background-color .6s; }
.cg + .cg { margin-top: .9rem; }
.js .morph .cg:not(.is-on) { opacity: 0; transform: translateY(8px); }
.js .morph .cg.is-on { opacity: .6; }
.js .morph .cg.is-new { opacity: 1; background: var(--pass-wash); box-shadow: inset 2px 0 var(--pass); }
.morph .rl2 { fill: var(--bg); stroke: var(--line); stroke-width: 1.5; }
@media (max-width: 1000px) { .m-grid { grid-template-columns: minmax(0, 1fr); } .m-code, .m-view { height: auto; } .m-codebox { max-height: 18rem; flex: none; } .m-view svg { flex: none; height: auto; } }
@media (prefers-reduced-motion: reduce) { .js .morph .cg:not(.is-on) { transform: none; } .m-codebox { scroll-behavior: auto; } .cg { transition: opacity .3s; } }

.morph .vac { font-size: 14px; }

.morph .vac2 { font: 700 11.5px var(--font-mono); fill: var(--text); }

/* hero v4: solo layers; only the last layer shows everything */
.morph .m-view .mg { transition: none; }
.morph .m-view .mg.is-on { transition: opacity .35s ease; }
.morph[data-stage="7"] .only-s { display: none; }
.morph:not([data-stage="7"]) .m-view .mg[data-s="0"] { transform: translate(0px, 122px); }
.morph:not([data-stage="7"]) .m-view .mg[data-s="1"] { transform: translate(0px, 116px); }
.morph:not([data-stage="7"]) .m-view .mg[data-s="2"] { transform: translate(0px, 88px); }
.morph:not([data-stage="7"]) .m-view .mg[data-s="3"] { transform: translate(7px, -9px) scale(1.05); }
.morph:not([data-stage="7"]) .m-view .mg[data-s="4"] { transform: translate(0px, -114px); }
.morph:not([data-stage="7"]) .m-view .mg[data-s="5"] { transform: translate(14px, -489px) scale(1.7); }
.morph:not([data-stage="7"]) .m-view .mg[data-s="6"] { transform: translate(0px, -190px); }
.morph:not([data-stage="7"]) .mg .rows { transform: translateY(170px); }
.morph[data-stage="7"] .er { display: none; }
.morph .fkt { font: 700 11px var(--font-mono); fill: var(--copper, #db8553); }
.m-foot { margin: 0 0 var(--space-4); }
@media (prefers-reduced-motion: reduce) { .morph .m-view .mg.is-on { transition: opacity .3s; } }

/* progress inside the active layer button while it autoplays */
.m-steps button { position: relative; overflow: hidden; }
.m-steps button::after { content: ""; position: absolute; left: 0; bottom: 0; height: 3px; width: 0; background: var(--accent); }
.morph.is-playing .m-steps button[aria-current]::after { width: 100%; transition: width var(--dwell, 5600ms) linear; }
@media (prefers-reduced-motion: reduce) { .m-steps button::after { display: none; } }

/* let any block scroll to the top, so the pane always starts on its comment line */
.m-codebox pre.code { padding-bottom: calc(var(--mh) - 6rem); }
@media (max-width: 1000px) { .m-codebox pre.code { padding-bottom: 1rem; } }

/* ---------- axis column, fix loop ---------- */
.qaxis { font: 700 .8125rem var(--font-mono); color: var(--text); white-space: nowrap; }
.loop { list-style: none; margin: var(--space-5) 0 0; padding: 0; display: grid; gap: var(--space-3); grid-template-columns: repeat(auto-fit, minmax(min(230px, 100%), 1fr)); counter-reset: none; }
.loop li { border: 1px solid var(--line); border-radius: var(--radius-lg); padding: var(--space-4); color: var(--muted); background: var(--bg-raise); }
.loop b { display: inline-grid; place-items: center; width: 1.5rem; height: 1.5rem; border-radius: 50%; background: var(--accent-wash); color: var(--accent); font: 700 .75rem var(--font-mono); margin-right: .4rem; }

/* ---------- adversarial vs real-world data ---------- */
.gens { display: grid; gap: var(--space-4); grid-template-columns: repeat(auto-fit, minmax(min(440px, 100%), 1fr)); margin-top: var(--space-6); }
.gen { border: 1px solid var(--line); border-radius: var(--radius-lg); padding: var(--space-5); background: var(--bg-raise); display: grid; gap: var(--space-3); align-content: start; }
.gen.adv { border-color: var(--accent); }
.gen-k { font: 500 .8125rem var(--font-mono); color: var(--accent); margin: 0; }
.gen.real .gen-k { color: var(--muted); }
.gen h3 { margin: 0; }
.gen ul { margin: 0; padding-left: 1.1rem; color: var(--muted); display: grid; gap: .35rem; }
.tokens { display: flex; flex-wrap: wrap; gap: .4rem; }
.tokens span { font: 500 .75rem var(--font-mono); border: 1px solid var(--line); border-radius: 2px; padding: .2rem .65rem; color: var(--muted); background: var(--bg-code); }
.gen:is(:hover, :focus-within) .tokens span { animation: g-flow .7s var(--i, 0s) both; }
.tokens span:nth-child(2) { --i: .08s; } .tokens span:nth-child(3) { --i: .16s; } .tokens span:nth-child(4) { --i: .24s; }
.tokens span:nth-child(5) { --i: .32s; } .tokens span:nth-child(6) { --i: .4s; } .tokens span:nth-child(7) { --i: .48s; }
@keyframes g-flow { from { opacity: 0; transform: translateY(-10px); } }
.judge { margin-top: var(--space-4); border: 1px dashed var(--accent); border-radius: var(--radius-lg); padding: var(--space-4) var(--space-5); display: flex; flex-wrap: wrap; gap: .5rem .6rem; align-items: center; color: var(--muted); }
.judge b { color: var(--text); margin-right: .4rem; }
@media (prefers-reduced-motion: reduce) { .gen:is(:hover, :focus-within) .tokens span { animation-name: s-in; animation-duration: .3s; } }

/* ---------- closing cta and footer ---------- */
.closing { position: relative; padding-block: var(--space-8); overflow: hidden; text-align: center; }
.closing::before { content: ""; position: absolute; left: 50%; top: 50%; width: 680px; height: 420px; transform: translate(-50%, -50%); background: radial-gradient(ellipse at center, rgb(224 216 193 / .09), transparent 68%); pointer-events: none; }
.closing .wrap { position: relative; }
.closing h2 { font-size: clamp(2rem, 3.6vw, 3rem); letter-spacing: -.03em; margin-inline: auto; }
.closing .cta-row { justify-content: center; margin-top: var(--space-5); }
@media (max-width: 900px) { .closing::before { display: none; } }
footer { border-top: 1px solid var(--line-tint-soft); padding-block: var(--space-5); color: var(--muted); font-size: .75rem; }

/* ---------- install commands ---------- */
.pkg-commands { display: flex; flex-direction: column; gap: .55rem; margin: 0 0 var(--space-5); max-width: 34rem; }
.pkg-row { display: flex; align-items: stretch; gap: .55rem; }
.pkg-cmd { flex: 1; min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 1rem; background: var(--bg2); border: 1px solid var(--line-tint-soft); border-radius: var(--radius-xs); padding: .55rem .55rem .55rem 1rem; min-height: 44px; font: 400 .82rem var(--font-mono); color: var(--text); }
.pkg-cmd-text { overflow-x: auto; white-space: nowrap; user-select: all; }
.pkg-cmd-dim { color: var(--muted); }
.pkg-copy { flex: none; min-height: 32px; padding: 0 .8rem; background: transparent; color: var(--accent); border: 1px solid var(--line-tint-soft); border-radius: var(--radius-2xs); font: 700 .7rem var(--font-mono); cursor: pointer; transition: border-color .18s, color .18s; }
.pkg-copy:hover { border-color: var(--accent); }
.pkg-copy.done { color: var(--text); }
.pkg-nuget { display: flex; align-items: center; padding: 0 .9rem; min-height: 44px; background: var(--bg2); border: 1px solid var(--line-tint-soft); border-radius: var(--radius-xs); font: 700 .75rem var(--font-mono); color: var(--accent); text-decoration: none; white-space: nowrap; transition: border-color .18s; }
.pkg-nuget:hover { border-color: var(--accent); }
.pkg-note { margin: .15rem 0 0; font: 400 .75rem var(--font-mono); color: var(--muted); }
.closing .pkg-commands { margin-left: auto; margin-right: auto; text-align: left; }
