/* darrshangovender.github.io: one stylesheet, system fonts, no third-party requests.
   Dark is the house style (#0d1015 + amber #d9a441); light follows the OS. */

:root {
  color-scheme: dark light;
  --bg: #0d1015;
  --surface: #121720;
  --surface-2: #181f2a;
  --line: rgba(255, 255, 255, 0.09);
  --line-2: rgba(255, 255, 255, 0.17);
  --text: #eceff3;
  --text-2: #c3cad3;
  --muted: #9aa3b0;
  --amber: #d9a441;
  --amber-ink: #e0b255; /* amber used as text */
  --amber-soft: rgba(217, 164, 65, 0.13);
  --on-amber: #1a1204;
  --ok: #5fd08a;
  --bad: #ff7b72;
  --bad-soft: rgba(255, 123, 114, 0.12);
  --ok-soft: rgba(95, 208, 138, 0.12);
  --focus: #f0c46a;
  --serif: Georgia, "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Code", "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --maxw: 1120px;
  --gutter: clamp(20px, 4.4vw, 44px);
  --radius: 12px;
  --header-h: 64px;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f7f5f0;
    --surface: #ffffff;
    --surface-2: #f1eee7;
    --line: rgba(18, 22, 29, 0.12);
    --line-2: rgba(18, 22, 29, 0.24);
    --text: #12161d;
    --text-2: #38414e;
    --muted: #566070;
    --amber: #bd8412;
    --amber-ink: #7d5208;
    --amber-soft: rgba(176, 122, 18, 0.12);
    --on-amber: #1a1204;
    --ok: #1b6b3a;
    --bad: #b42318;
    --bad-soft: rgba(180, 35, 24, 0.09);
    --ok-soft: rgba(27, 107, 58, 0.1);
    --focus: #7d5208;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text-2);
  font: 1.0625rem/1.62 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

h1, h2, h3, h4 { color: var(--text); margin: 0; font-weight: 600; line-height: 1.15; text-wrap: balance; }
p { margin: 0 0 1em; text-wrap: pretty; }
a { color: var(--amber-ink); text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
a:hover { color: var(--text); }
ul, ol { margin: 0; padding: 0; }
code, kbd, .mono { font-family: var(--mono); font-size: 0.88em; }
code { background: var(--surface-2); border: 1px solid var(--line); padding: 0.08em 0.4em; border-radius: 5px; color: var(--text); overflow-wrap: anywhere; }
svg { display: block; }
[hidden] { display: none !important; }
button, input { font: inherit; color: inherit; }

:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 4px; }

.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.skip {
  position: absolute; left: 12px; top: -80px; z-index: 100; background: var(--amber); color: var(--on-amber);
  padding: 12px 16px; border-radius: 8px; font-weight: 600; text-decoration: none;
}
.skip:focus { top: 12px; }

.container { width: min(var(--maxw), 100% - 2 * var(--gutter)); margin-inline: auto; }

.eyebrow {
  font: 600 0.78rem/1.3 var(--sans); letter-spacing: 0.2em; text-transform: uppercase; color: var(--amber-ink); margin: 0 0 18px;
}
.eyebrow .sep { opacity: 0.55; padding: 0 0.35em; }

/* ---------- buttons, chips ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 20px;
  border: 1px solid var(--line-2); border-radius: 10px; background: transparent; color: var(--text); font-weight: 600; font-size: 0.95rem;
  text-decoration: none; cursor: pointer; transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}
.btn:hover { background: var(--surface-2); color: var(--text); border-color: var(--muted); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.45; cursor: not-allowed; }
.btn-primary { background: var(--amber); border-color: var(--amber); color: var(--on-amber); }
.btn-primary:hover { background: #e6b34f; border-color: #e6b34f; color: var(--on-amber); }
.btn-sm { padding: 0 16px; font-size: 0.9rem; }
.btn svg { width: 16px; height: 16px; flex: none; }
.btn-approve { background: var(--ok); border-color: var(--ok); color: #04170c; }
.btn-approve:hover { background: var(--ok); filter: brightness(1.1); color: #04170c; border-color: var(--ok); }
.btn-ghost-danger { border-color: var(--bad); color: var(--bad); }
.btn-ghost-danger:hover { background: var(--bad-soft); color: var(--bad); border-color: var(--bad); }

.chip {
  display: inline-flex; align-items: center; gap: 6px; font: 600 0.68rem/1 var(--mono); letter-spacing: 0.1em; text-transform: uppercase;
  padding: 6px 9px; border: 1px solid currentColor; border-radius: 6px; color: var(--muted); white-space: nowrap;
}
.chip-synth { color: var(--amber-ink); background: var(--amber-soft); }
.chip-ok { color: var(--ok); background: var(--ok-soft); }
.chip-bad { color: var(--bad); background: var(--bad-soft); }
.chip-plain { border-color: var(--line-2); }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50; height: var(--header-h); background: var(--bg);
  border-bottom: 1px solid var(--line);
}
@supports (backdrop-filter: blur(8px)) {
  .site-header { background: color-mix(in srgb, var(--bg) 84%, transparent); backdrop-filter: blur(14px) saturate(1.2); }
}
.site-header .bar { height: 100%; display: flex; align-items: center; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 600; letter-spacing: 0.01em; min-height: 44px; }
.brand:hover { color: var(--text); }
.brand-mark { width: 30px; height: 30px; flex: none; }
.brand-mark path { stroke: var(--amber); }
.brand span { font-family: var(--serif); font-size: 1.12rem; font-weight: 400; }
.nav { display: flex; gap: 4px; margin-left: auto; }
.nav a { color: var(--text-2); text-decoration: none; padding: 0 12px; min-height: 44px; display: inline-flex; align-items: center; font-size: 0.93rem; border-radius: 8px; }
.nav a:hover { color: var(--text); background: var(--surface-2); }
.site-header .btn { margin-left: 4px; }
.nav-toggle { display: none; }

@media (max-width: 880px) {
  .site-header .bar { gap: 10px; }
  .nav { margin-left: auto; gap: 0; }
  .nav a { padding: 0 8px; font-size: 0.86rem; }
  .site-header .btn { display: none; }
}
@media (max-width: 760px) {
  .js .nav-toggle {
    display: inline-flex; align-items: center; justify-content: center; margin-left: auto; min-height: 44px; min-width: 44px; padding: 0 14px;
    background: transparent; border: 1px solid var(--line-2); border-radius: 10px; cursor: pointer; font-weight: 600; font-size: 0.9rem;
  }
  .js .nav {
    display: none; position: absolute; top: var(--header-h); left: 0; right: 0; flex-direction: column; margin: 0; padding: 10px var(--gutter) 16px;
    background: var(--bg); border-bottom: 1px solid var(--line);
  }
  .js .nav.is-open { display: flex; }
  .js .nav a { padding: 0 4px; min-height: 48px; font-size: 1rem; border-bottom: 1px solid var(--line); border-radius: 0; }
  .site-header .btn { display: none; }
  .nav { overflow-x: auto; }
}

/* ---------- hero ---------- */
.hero { position: relative; padding: clamp(56px, 9vw, 120px) 0 clamp(40px, 6vw, 72px); overflow: hidden; border-bottom: 1px solid var(--line); isolation: isolate; }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    repeating-linear-gradient(to bottom, transparent 0 63px, var(--line) 63px 64px),
    radial-gradient(900px 420px at 12% -10%, var(--amber-soft), transparent 70%);
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 55%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 0%, #000 55%, transparent 100%);
  opacity: 0.9;
}
.hero h1 { font-weight: 400; font-family: var(--serif); letter-spacing: -0.02em; }
.hero-name { display: block; font-size: clamp(1.15rem, 2.4vw, 1.5rem); letter-spacing: 0.01em; color: var(--text-2); margin-bottom: 14px; font-style: normal; }
.hero-line { display: block; font-size: clamp(2.1rem, 5.5vw, 4.3rem); line-height: 1.06; color: var(--text); }
.hero-line .ln { display: block; }
.hero-line em { color: var(--amber-ink); font-style: italic; }
.hero-sub { max-width: 60ch; font-size: clamp(1.04rem, 1.5vw, 1.2rem); color: var(--text-2); margin: 28px 0 30px; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.trace { margin: clamp(30px, 5vw, 52px) 0 8px; position: relative; }
.trace svg { width: 100%; height: clamp(88px, 15vw, 170px); overflow: visible; }
.trace .tr-line { fill: none; stroke: var(--amber); stroke-width: 1.3; stroke-linejoin: round; vector-effect: non-scaling-stroke; opacity: 0.85; }
.trace .tr-base { stroke: var(--text); stroke-opacity: 0.22; stroke-dasharray: 2 6; vector-effect: non-scaling-stroke; }
.trace .tr-limit { stroke: var(--amber); stroke-opacity: 0.35; stroke-dasharray: 5 5; vector-effect: non-scaling-stroke; }
.trace figcaption { font: 0.74rem/1.4 var(--mono); color: var(--muted); display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; letter-spacing: 0.02em; }
.trace-mask { -webkit-mask-image: linear-gradient(to right, transparent 0%, #000 22%, #000 100%); mask-image: linear-gradient(to right, transparent 0%, #000 22%, #000 100%); }

.focus { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 32px; margin-top: 30px; border-top: 1px solid var(--line-2); }
.focus li { padding: 0; position: relative; }
.focus li::before { content: ""; display: block; width: 44px; height: 3px; background: var(--amber); margin-top: -2px; }
.focus strong { display: block; color: var(--text); font-size: 1.2rem; font-weight: 600; margin: 18px 0 4px; letter-spacing: -0.005em; }
.focus span { color: var(--muted); font-size: 0.98rem; }
.avail { margin: 34px 0 0; display: flex; gap: 10px; align-items: baseline; font-size: 0.97rem; color: var(--text-2); max-width: 70ch; }
.avail .dot { flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 4px var(--ok-soft); transform: translateY(-1px); }

@media (max-width: 760px) {
  .focus { grid-template-columns: 1fr; gap: 6px; }
  .focus strong { margin-top: 16px; }
}

/* ---------- proof strip ---------- */
.proof { padding: clamp(36px, 5vw, 56px) 0; border-bottom: 1px solid var(--line); }
.proof-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.proof-head p { margin: 0; color: var(--muted); font-size: 0.9rem; }
.kpis { list-style: none; display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.kpis li { padding: 22px 22px 24px; border-left: 1px solid var(--line); }
.kpis li:first-child { border-left: 0; }
.kpi-num { display: block; font: 400 clamp(1.9rem, 3.4vw, 2.5rem)/1 var(--serif); color: var(--text); letter-spacing: -0.02em; margin-bottom: 10px; font-variant-numeric: lining-nums tabular-nums; }
.kpi-num small { font: 400 0.55em/1 var(--serif); color: var(--muted); }
.kpi-txt { display: block; font-size: 0.92rem; line-height: 1.45; color: var(--text-2); }
.kpi-src { display: block; margin-top: 10px; font: 0.72rem/1.3 var(--mono); color: var(--muted); letter-spacing: 0.02em; }
@media (max-width: 900px) {
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .kpis li:nth-child(3) { border-left: 0; }
  .kpis li:nth-child(n + 3) { border-top: 1px solid var(--line); }
}
@media (max-width: 520px) {
  .kpis { grid-template-columns: 1fr; }
  .kpis li { border-left: 0; border-top: 1px solid var(--line); }
  .kpis li:first-child { border-top: 0; }
}

/* ---------- sections ---------- */
.section { padding: clamp(64px, 9vw, 120px) 0; border-bottom: 1px solid var(--line); }
.section-head { max-width: 760px; margin-bottom: clamp(32px, 4.4vw, 56px); }
.section-head h2 { font: 400 clamp(1.9rem, 4.2vw, 3rem)/1.1 var(--serif); letter-spacing: -0.018em; }
.section-head .lede { margin: 20px 0 0; font-size: 1.1rem; color: var(--text-2); max-width: 64ch; }
.section-head h2 em { font-style: italic; color: var(--amber-ink); }

/* flow strip */
.flow { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr; align-items: stretch; gap: 10px; margin-bottom: 18px; }
.flow-node { border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 14px 16px; font-size: 0.93rem; }
.flow-node b { display: block; color: var(--text); font: 600 0.88rem var(--mono); margin-bottom: 4px; }
.flow-arrow { align-self: center; color: var(--amber-ink); font-size: 1.3rem; }
.flow-note { color: var(--muted); font-size: 0.9rem; margin: 0 0 30px; max-width: 80ch; }
@media (max-width: 800px) {
  .flow { grid-template-columns: 1fr; }
  .flow-arrow { transform: rotate(90deg); justify-self: center; line-height: 1; }
}

.cards3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; display: flex; flex-direction: column; gap: 16px; position: relative; }
.card h3 { font: 400 1.45rem/1.2 var(--serif); letter-spacing: -0.01em; }
.card .repo { font: 600 0.78rem var(--mono); color: var(--amber-ink); letter-spacing: 0.03em; display: flex; justify-content: space-between; gap: 10px; align-items: center; flex-wrap: wrap; }
.card p { margin: 0; font-size: 0.97rem; }
.card dl { margin: 0; display: grid; gap: 14px; }
.card dt { font: 600 0.7rem/1.2 var(--sans); letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.card dd { margin: 0; font-size: 0.95rem; color: var(--text-2); }
.card dd.result { color: var(--text); }
.card .more { margin-top: auto; padding-top: 4px; font-size: 0.93rem; font-weight: 600; }
.card .more a { display: inline-flex; align-items: center; min-height: 44px; }
.card-top { border-top: 3px solid var(--amber); }
@media (max-width: 1000px) { .cards3 { grid-template-columns: 1fr; } }

/* ---------- panels (replays) ---------- */
.replays { display: grid; gap: clamp(40px, 6vw, 72px); grid-template-columns: minmax(0, 1fr); }
.replays > * { min-width: 0; }
.panel-bar .chip { white-space: normal; }
.replay-title { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 18px; }
.replay-title h3 { font: 400 clamp(1.4rem, 2.6vw, 1.85rem)/1.2 var(--serif); letter-spacing: -0.012em; max-width: 36ch; }
.replay-intro { max-width: 70ch; margin: 0 0 20px; font-size: 1rem; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.panel-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.panel-bar .grow { flex: 1 1 auto; }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: 10px; overflow: hidden; }
.seg button { background: transparent; border: 0; min-height: 44px; padding: 0 16px; cursor: pointer; font-weight: 600; font-size: 0.9rem; color: var(--text-2); }
.seg button + button { border-left: 1px solid var(--line-2); }
.seg button[aria-pressed="true"] { background: var(--amber); color: var(--on-amber); }
.seg button:not([aria-pressed="true"]):hover { background: var(--surface); color: var(--text); }
.panel-body { padding: 18px; }

.ctl { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.ctl .btn { min-width: 112px; }
.range-wrap { flex: 1 1 260px; display: flex; align-items: center; gap: 12px; min-width: 220px; }
.range-wrap label { font: 0.72rem/1 var(--mono); color: var(--muted); letter-spacing: 0.08em; text-transform: uppercase; white-space: nowrap; }
input[type="range"] { -webkit-appearance: none; appearance: none; flex: 1; height: 44px; background: transparent; cursor: pointer; margin: 0; min-width: 0; }
input[type="range"]::-webkit-slider-runnable-track { height: 4px; background: var(--line-2); border-radius: 4px; }
input[type="range"]::-moz-range-track { height: 4px; background: var(--line-2); border-radius: 4px; }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; margin-top: -9px; border-radius: 50%; background: var(--amber); border: 3px solid var(--surface); box-shadow: 0 0 0 1px var(--amber); }
input[type="range"]::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: var(--amber); border: 3px solid var(--surface); box-shadow: 0 0 0 1px var(--amber); }

.chart-wrap { position: relative; width: 100%; min-height: 280px; }
.chart-wrap svg { width: 100%; height: auto; overflow: visible; }
.ch-grid { stroke: var(--line); stroke-width: 1; }
.ch-axis { fill: var(--muted); font: 11px var(--mono); }
.ch-axis-title { fill: var(--muted); font: 11px var(--sans); }
.ch-line { fill: none; stroke: var(--amber); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.ch-area-stop-a { stop-color: var(--amber); stop-opacity: 0.28; }
.ch-area-stop-b { stop-color: var(--amber); stop-opacity: 0; }
.ch-thr { stroke: var(--amber-ink); stroke-width: 1.3; stroke-dasharray: 6 5; }
.ch-thr-label { fill: var(--amber-ink); font: 11px var(--mono); }
.ch-future { fill: var(--text); fill-opacity: 0.045; }
.ch-future-label { fill: var(--muted); font: 11px var(--sans); }
.ch-head { fill: var(--amber); stroke: var(--surface); stroke-width: 2; }
.ch-alert-line { stroke: var(--text-2); stroke-width: 1; stroke-dasharray: 2 4; }
.ch-alert-label { fill: var(--text); font: 600 11px var(--sans); }
.ch-fail { stroke: var(--bad); stroke-width: 1.6; }
.ch-fail-label { fill: var(--bad); font: 600 11px var(--sans); }
.ch-onset { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 2 4; }
.ch-lane-label { fill: var(--muted); font: 11px var(--sans); }
.ch-lane-bg { fill: var(--text); fill-opacity: 0.04; }
.ch-rul { fill: var(--amber); fill-opacity: 0.2; stroke: var(--amber); stroke-width: 1; }
.ch-rul-old { fill: var(--amber); fill-opacity: 0.1; stroke: var(--amber); stroke-opacity: 0.4; stroke-width: 1; }
.ch-rul-none { fill: none; stroke: var(--muted); stroke-width: 1; stroke-dasharray: 2 3; }
.ch-rul-med { stroke: var(--text); stroke-width: 2; }
.ch-rul-cur { fill: var(--amber); fill-opacity: 0.38; stroke: var(--amber-ink); stroke-width: 1.4; }
.ch-hit { fill: var(--ok); }
.ch-miss { fill: var(--bad); }

.readouts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; margin: 14px 0 0; }
.readouts > div { background: var(--surface); padding: 12px 14px; min-height: 76px; }
.readouts dt { font: 600 0.68rem/1.2 var(--sans); letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.readouts dd { margin: 0; font: 500 0.98rem/1.35 var(--mono); color: var(--text); font-variant-numeric: tabular-nums; }
.readouts dd small { display: block; font: 0.78rem/1.4 var(--sans); color: var(--muted); margin-top: 2px; }
.state-below { color: var(--text-2); }
.state-above { color: var(--amber-ink); }
.state-open { color: var(--bad); }
@media (max-width: 800px) { .readouts { grid-template-columns: repeat(2, 1fr); } }

.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 10px 0 0; padding: 0; list-style: none; font-size: 0.82rem; color: var(--muted); }
.legend li { display: inline-flex; align-items: center; gap: 7px; }
.legend i { display: inline-block; width: 18px; height: 0; border-top: 2px solid var(--amber); }
.legend i.dash { border-top-style: dashed; border-color: var(--amber-ink); }
.legend i.red { border-color: var(--bad); }
.legend i.box { width: 16px; height: 10px; border: 1px solid var(--amber); background: var(--amber-soft); }

.wo { margin-top: 18px; border: 1px solid var(--line-2); border-left: 4px solid var(--amber); border-radius: 10px; background: var(--surface-2); padding: 18px 20px; }
.wo[hidden] { display: none; }
.wo-ghost { margin-top: 18px; border: 1px dashed var(--line-2); border-radius: 10px; padding: 14px 18px; color: var(--muted); font-size: 0.93rem; }
.wo-head { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin-bottom: 10px; }
.wo-head b { font: 600 0.95rem var(--mono); color: var(--text); overflow-wrap: anywhere; }
.wo p { font-size: 0.96rem; margin: 0 0 0.7em; }
.wo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px 24px; margin: 12px 0; }
.wo-grid dt { font: 600 0.68rem/1.2 var(--sans); letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.wo-grid dd { margin: 0; color: var(--text); font-size: 0.95rem; }
.wo-grid dd.mono { font-family: var(--mono); font-size: 0.9rem; }
.wo table { width: 100%; border-collapse: collapse; font-size: 0.86rem; margin: 8px 0 12px; }
.wo th, .wo td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.wo th { color: var(--muted); font-weight: 600; font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; }
.wo td.n, .wo th.n { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; }
.table-scroll { overflow-x: auto; }
.outcome { margin-top: 12px; padding: 12px 14px; border-radius: 8px; font-size: 0.95rem; color: var(--text); border: 1px solid var(--line-2); }
.outcome.hit { background: var(--ok-soft); border-color: var(--ok); }
.outcome.miss { background: var(--bad-soft); border-color: var(--bad); }
.outcome b { color: var(--text); }
.note { font-size: 0.85rem; color: var(--muted); margin: 14px 0 0; }
.note code { font-size: 0.95em; }
@media (max-width: 700px) { .wo-grid { grid-template-columns: 1fr; } .panel-body { padding: 14px; } }

/* ---------- agent walkthrough ---------- */
.stepper { list-style: none; display: grid; grid-template-columns: repeat(6, 1fr); gap: 0; margin: 0 0 16px; counter-reset: st; position: relative; }
.stepper li { position: relative; padding: 14px 10px 0 0; font: 600 0.8rem/1.25 var(--mono); color: var(--muted); letter-spacing: 0.02em; border-top: 2px solid var(--line-2); min-height: 56px; transition: color 0.25s, border-color 0.25s; }
.stepper li::before { counter-increment: st; content: counter(st, decimal-leading-zero); display: block; font-size: 0.68rem; opacity: 0.7; margin-bottom: 3px; }
.stepper li small { display: block; font: 400 0.74rem/1.3 var(--sans); letter-spacing: 0; color: var(--muted); margin-top: 3px; }
.stepper li[data-st="done"] { color: var(--text-2); border-color: var(--amber); }
.stepper li[data-st="current"] { color: var(--text); border-color: var(--amber); }
.stepper li[data-st="current"]::after { content: ""; position: absolute; top: -6px; left: 0; width: 10px; height: 10px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 0 4px var(--amber-soft); }
.stepper li[data-st="blocked"] { color: var(--bad); border-color: var(--bad); }
.stepper li[data-st="blocked"]::after { content: ""; position: absolute; top: -6px; left: 0; width: 10px; height: 10px; border-radius: 50%; background: var(--bad); box-shadow: 0 0 0 4px var(--bad-soft); }
.stepper li[data-st="released"] { color: var(--ok); border-color: var(--ok); }
.stepper li[data-st="released"]::after { content: ""; position: absolute; top: -6px; left: 0; width: 10px; height: 10px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 4px var(--ok-soft); }
.loop-note { font: 0.76rem/1.3 var(--mono); color: var(--bad); margin: -6px 0 12px; min-height: 1em; }
@media (max-width: 720px) {
  .stepper { grid-template-columns: repeat(3, 1fr); row-gap: 10px; }
}

.walk { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 960px) { .walk { grid-template-columns: minmax(0, 1fr); } }
.walk > *, .gate-row > *, .panel-body > * { min-width: 0; }
.stage { border: 1px solid var(--line); border-radius: 10px; background: var(--bg); padding: 16px 18px; min-height: 330px; }
.stage h4 { font: 600 0.72rem/1.2 var(--sans); letter-spacing: 0.16em; text-transform: uppercase; color: var(--amber-ink); margin-bottom: 12px; }
.stage p { font-size: 0.95rem; margin: 0 0 0.8em; }
.stage ul.tight, .stage ol.tight { padding-left: 1.2em; font-size: 0.92rem; margin: 0 0 12px; }
.stage ol.tight li, .stage ul.tight li { margin-bottom: 4px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 0.9rem; margin: 0 0 12px; }
.kv dt { color: var(--muted); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; padding-top: 2px; }
.kv dd { margin: 0; color: var(--text); overflow-wrap: anywhere; }
.quote { font: 0.82rem/1.45 var(--mono); border-left: 2px solid var(--line-2); padding: 3px 0 3px 10px; margin: 0 0 8px; color: var(--text-2); }
.quote b { color: var(--amber-ink); font-weight: 600; display: block; font-size: 0.76rem; }
.quote.removed { border-left-color: var(--bad); color: var(--muted); text-decoration: line-through; text-decoration-color: var(--bad); background: var(--bad-soft); }
.quote.removed b { text-decoration: none; color: var(--bad); }
.scroll-box { max-height: 270px; overflow: auto; padding-right: 6px; }
.rules { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 0 0 12px; list-style: none; }
.rules li { border: 1px solid var(--line); border-radius: 8px; padding: 8px 9px; font: 0.7rem/1.25 var(--mono); color: var(--muted); background: var(--surface); position: relative; min-height: 54px; }
.rules li b { display: block; color: var(--text-2); font-size: 0.74rem; }
.rules li .mk { position: absolute; top: 6px; right: 8px; font-size: 0.85rem; font-weight: 700; }
.rules li[data-r="pass"] { border-color: color-mix(in srgb, var(--ok) 45%, var(--line)); }
.rules li[data-r="pass"] .mk { color: var(--ok); }
.rules li[data-r="fail"] { border-color: var(--bad); background: var(--bad-soft); }
.rules li[data-r="fail"] b { color: var(--bad); }
.rules li[data-r="fail"] .mk { color: var(--bad); }
.rules li[data-r="idle"] .mk { color: var(--muted); opacity: 0.5; }
@media (max-width: 560px) { .rules { grid-template-columns: repeat(2, 1fr); } }
.verdict { padding: 10px 12px; border-radius: 8px; border: 1px solid; font-size: 0.92rem; }
.verdict.pass { color: var(--text); border-color: var(--ok); background: var(--ok-soft); }
.verdict.fail { color: var(--text); border-color: var(--bad); background: var(--bad-soft); }
.verdict code { word-break: break-word; }
.stage-empty { color: var(--muted); font-size: 0.95rem; }

.log { border: 1px solid var(--line); border-radius: 10px; background: var(--bg); overflow: hidden; display: flex; flex-direction: column; min-height: 330px; }
.log h4 { font: 600 0.72rem/1.2 var(--sans); letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); padding: 12px 14px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 10px; }
.log h4 span { font: 0.72rem var(--mono); letter-spacing: 0; text-transform: none; }
.log ol { list-style: none; max-height: 330px; overflow: auto; padding: 6px 0; margin: 0; font: 0.74rem/1.4 var(--mono); flex: 1; }
.log li { display: grid; grid-template-columns: 2.4ch minmax(0, 1fr) auto; gap: 8px; padding: 5px 14px; border-bottom: 1px dashed var(--line); color: var(--text-2); }
.log li .sq { color: var(--muted); text-align: right; }
.log li .ty { color: var(--text); overflow-wrap: anywhere; }
.log li .ty i { font-style: normal; color: var(--muted); }
.log li .hs { color: var(--muted); text-align: right; white-space: nowrap; }
.log li.k-ok .ty b { color: var(--ok); font-weight: 600; }
.log li.k-bad .ty b { color: var(--bad); font-weight: 600; }
.log li.k-key .ty b { color: var(--amber-ink); font-weight: 600; }
.log .empty { padding: 16px 14px; color: var(--muted); font: 0.85rem var(--sans); }
.log-foot { border-top: 1px solid var(--line); padding: 9px 14px; font: 0.7rem/1.4 var(--mono); color: var(--muted); }

.gate-row { margin-top: 16px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px 24px; align-items: center; border: 1px solid var(--line); border-radius: 10px; padding: 16px 18px; background: var(--bg); }
@media (max-width: 760px) { .gate-row { grid-template-columns: minmax(0, 1fr); } }
.gate { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 0; min-width: 0; }
.gate-node { font: 600 0.74rem/1.3 var(--mono); letter-spacing: 0.04em; padding: 9px 11px; border: 1px solid var(--line-2); border-radius: 8px; color: var(--text-2); background: var(--surface); text-align: center; }
.gate-node small { display: block; font: 400 0.7rem var(--sans); color: var(--muted); letter-spacing: 0; }
.gate-node.is-wait { border-color: var(--amber); color: var(--text); }
.gate-node.is-bad { border-color: var(--bad); color: var(--bad); }
.gate-node.is-ok { border-color: var(--ok); color: var(--ok); }
.gate-path { position: relative; height: 70px; min-width: 70px; }
.gate-path::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 2px; background: var(--line-2); transform: translateY(-50%); }
.gate-path::after { content: ""; position: absolute; left: 0; width: 0; top: 50%; height: 2px; background: var(--ok); transform: translateY(-50%); }
.gate[data-state="open"] .gate-path::after { width: 100%; }
.gate-door { position: absolute; left: 50%; top: 6px; bottom: 6px; width: 10px; margin-left: -5px; background: var(--amber); border-radius: 3px; transform-origin: top center; }
.gate-door::before, .gate-door::after { content: ""; position: absolute; left: -9px; width: 28px; height: 3px; background: var(--line-2); }
.gate-door::before { top: -4px; }
.gate-door::after { bottom: -4px; }
.gate[data-state="open"] .gate-door { transform: translateY(-62%) scaleY(0.32); background: var(--ok); }
.gate[data-state="refused"] .gate-door { background: var(--bad); }
.gate-msg { font-size: 0.92rem; color: var(--text-2); margin: 10px 0 0; grid-column: 1 / -1; min-height: 3.2em; }
.gate-msg b { color: var(--text); }
.gate-msg code { word-break: break-word; }
.gate-actions { display: flex; flex-direction: column; gap: 8px; align-items: stretch; min-width: 230px; }
@media (max-width: 760px) { .gate-actions { min-width: 0; } }
.gate-actions .hint { font-size: 0.78rem; color: var(--muted); text-align: left; line-height: 1.4; }

/* ---------- infrastructure grid ---------- */
.grid-infra { display: grid; grid-template-columns: repeat(12, 1fr); gap: 16px; }
.tile { grid-column: span 4; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 22px 18px; display: flex; flex-direction: column; gap: 10px; transition: border-color 0.2s, transform 0.2s; }
.tile:hover { border-color: var(--line-2); }
.tile h3 { font: 600 1rem var(--mono); color: var(--text); letter-spacing: 0; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.tile h3 a { color: inherit; text-decoration: none; display: inline-flex; align-items: center; min-height: 44px; margin-block: -10px; }
.tile h3 a:hover { color: var(--amber-ink); text-decoration: underline; }
.tile p { margin: 0; font-size: 0.94rem; }
.tile .res { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); font-size: 0.9rem; color: var(--text); }
.tile .res span { display: block; font: 600 0.66rem/1.2 var(--sans); letter-spacing: 0.15em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.tile.wide { grid-column: span 8; border-top: 3px solid var(--amber); }
.tile.wide .res { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.tile .big { font: 400 2.2rem/1 var(--serif); color: var(--text); letter-spacing: -0.02em; display: block; margin-bottom: 4px; }
.tile .res-cols > div + div { padding-left: 20px; border-left: 1px solid var(--line); }
@media (max-width: 1000px) { .tile { grid-column: span 6; } .tile.wide { grid-column: span 12; } }
@media (max-width: 640px) { .tile, .tile.wide { grid-column: span 12; } .tile.wide .res { grid-template-columns: 1fr; } .tile .res-cols > div + div { padding-left: 0; border-left: 0; } }
.more-row { margin-top: 28px; font-size: 0.95rem; color: var(--muted); max-width: 80ch; }

/* ---------- how I work ---------- */
.principles { list-style: none; display: grid; grid-template-columns: repeat(2, 1fr); gap: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; counter-reset: pr; background: var(--surface); }
.principles li { padding: 30px 30px 32px; counter-increment: pr; position: relative; }
.principles li:nth-child(even) { border-left: 1px solid var(--line); }
.principles li:nth-child(n + 3) { border-top: 1px solid var(--line); }
.principles li::before { content: counter(pr, decimal-leading-zero); font: 0.78rem var(--mono); color: var(--amber-ink); letter-spacing: 0.1em; display: block; margin-bottom: 14px; }
.principles h3 { font: 400 1.5rem/1.2 var(--serif); margin-bottom: 10px; letter-spacing: -0.01em; }
.principles p { margin: 0 0 10px; font-size: 0.98rem; }
.principles .ev { font: 0.78rem/1.5 var(--mono); color: var(--muted); }
@media (max-width: 760px) { .principles { grid-template-columns: 1fr; } .principles li { border-left: 0 !important; } .principles li + li { border-top: 1px solid var(--line); } }
.pull { margin: 30px 0 0; padding: 22px 26px; border-left: 3px solid var(--amber); background: var(--surface); border-radius: 0 var(--radius) var(--radius) 0; max-width: 860px; }
.pull blockquote { margin: 0; font: italic 1.12rem/1.55 var(--serif); color: var(--text); }
.pull figcaption { margin-top: 10px; font: 0.8rem/1.4 var(--mono); color: var(--muted); }

/* ---------- contact + footer ---------- */
.contact { padding: clamp(72px, 10vw, 132px) 0; }
.contact-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: clamp(32px, 6vw, 80px); align-items: start; }
.contact h2 { font: 400 clamp(2rem, 4.6vw, 3.3rem)/1.08 var(--serif); letter-spacing: -0.02em; margin-bottom: 20px; }
.contact h2 em { color: var(--amber-ink); }
.contact p { max-width: 54ch; }
.contact-list { list-style: none; display: grid; gap: 0; border-top: 1px solid var(--line-2); }
.contact-list li { border-bottom: 1px solid var(--line); }
.contact-list a { display: flex; justify-content: space-between; gap: 16px; align-items: center; min-height: 58px; color: var(--text); text-decoration: none; font-weight: 500; }
.contact-list a:hover { color: var(--amber-ink); }
.contact-list small { color: var(--muted); font: 0.78rem var(--mono); text-align: right; }
.contact-list .static-row { display: flex; justify-content: space-between; gap: 16px; align-items: center; min-height: 58px; color: var(--text); font-weight: 500; }
.proof-h { margin: 0; }
.reveal[data-d="1"] { --d: 0.07s; }
.reveal[data-d="2"] { --d: 0.14s; }
.contact .cta-row { margin-top: 26px; }
@media (max-width: 860px) { .contact-grid { grid-template-columns: 1fr; } }

.footer { border-top: 1px solid var(--line); padding: 30px 0 48px; color: var(--muted); font-size: 0.86rem; }
.footer .container { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 28px; }
.footer a { color: var(--muted); }
.footer a:hover { color: var(--text); }

/* ---------- motion (only when the user has not asked for less) ---------- */
@media (prefers-reduced-motion: no-preference) {
  .js .reveal { opacity: 0; transform: translateY(16px); transition: opacity 0.7s cubic-bezier(0.2, 0.7, 0.2, 1), transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1); transition-delay: var(--d, 0s); }
  .js .reveal.is-in { opacity: 1; transform: none; }

  .trace .tr-line { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 3.6s cubic-bezier(0.45, 0.05, 0.25, 1) 0.35s forwards; }
  .trace .tr-base, .trace .tr-limit { opacity: 0; animation: fade-in 1s ease 0.2s forwards; }
  @keyframes draw { to { stroke-dashoffset: 0; } }
  @keyframes fade-in { to { opacity: 1; } }

  /* hero text is deliberately not animated: it is the LCP and should paint at once */
  @keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

  .gate-door { transition: transform 0.7s cubic-bezier(0.5, 0, 0.2, 1), background-color 0.4s; }
  .gate-path::after { transition: width 0.9s ease 0.35s; }
  .gate[data-state="refused"] .gate-door { animation: shake 0.45s ease; }
  @keyframes shake { 20% { transform: translateX(-4px); } 40% { transform: translateX(4px); } 60% { transform: translateX(-3px); } 80% { transform: translateX(2px); } }
  .log li.is-new { animation: flash 1.4s ease-out; }
  @keyframes flash { from { background: var(--amber-soft); } to { background: transparent; } }
  .rules li { transition: border-color 0.3s, background-color 0.3s; }
  .ch-head-pulse { animation: pulse 1.8s ease-out infinite; transform-origin: center; transform-box: fill-box; }
  @keyframes pulse { 0% { opacity: 0.55; transform: scale(1); } 100% { opacity: 0; transform: scale(3.2); } }
  .wo.is-fresh { animation: rise 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
  .tile { transition: border-color 0.2s, transform 0.2s; }
  .tile:hover { transform: translateY(-2px); }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .ch-head-pulse { display: none; }
}

noscript .nojs { margin: 12px 0; padding: 14px 16px; border: 1px dashed var(--line-2); border-radius: 10px; color: var(--muted); }

@media print {
  .site-header, .panel-bar, .ctl, .gate-row { display: none; }
  body { background: #fff; color: #000; }
}
