/* LAST-V2X project page. Restrained, paper-like styling; signal colours are reserved for data. */
:root {
  --ink: #161c27;
  --ink-2: #4a5260;
  --muted: #868d98;
  --line: #e6e3dc;
  --line-2: #d9d5cc;
  --bg: #fdfcf9;
  --bg-alt: #f6f4ef;
  --paper: #ffffff;
  --night: #0f1928;
  --navy: #1b2f4e;
  --accent: #2a6f78;
  --accent-soft: #e5efef;
  --m1: #3a6fb7;
  --m2: #8a5ba8;
  --m3: #1f8a8c;
  --m4: #4f8a3c;
  --sig-green: #3d9f57;
  --sig-amber: #d9a637;
  --sig-red: #d4533f;
  --orange: #d9732c;
  --serif: 'Newsreader', 'Iowan Old Style', 'Palatino Linotype', Georgia, serif;
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, Menlo, monospace;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(22, 28, 39, .04), 0 6px 20px rgba(22, 28, 39, .05);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 64px; }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3, h4 { margin: 0; font-weight: 500; line-height: 1.2; }
code, pre { font-family: var(--mono); font-size: .88em; }
em { font-family: var(--serif); font-style: italic; font-size: 1.06em; }

.wrap { width: 100%; max-width: 1040px; margin: 0 auto; padding: 0 24px; }
.center { text-align: center; }
.small { font-size: .84rem; }
.dim-text { color: var(--muted); }

/* Reveal on scroll */
.js .reveal { opacity: 0; transform: translateY(12px); transition: opacity .7s ease, transform .7s ease; }
.js .reveal.is-in { opacity: 1; transform: none; }

/* Top navigation */
.topnav {
  position: sticky; top: 0; z-index: 30;
  background: rgba(15, 25, 40, .86);
  backdrop-filter: saturate(140%) blur(12px);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, .06);
}
.topnav-inner { display: flex; align-items: center; justify-content: space-between; height: 54px; }
.brand { color: #fff; font-family: var(--serif); font-size: 1.15rem; font-weight: 500; letter-spacing: .01em; }
.brand:hover { text-decoration: none; }
.topnav-links { display: flex; gap: 26px; }
.topnav-links a { color: rgba(255, 255, 255, .7); font-size: .86rem; letter-spacing: .02em; }
.topnav-links a:hover { color: #fff; text-decoration: none; }

/* Hero */
.hero {
  position: relative; overflow: hidden; color: #fff; text-align: center;
  background:
    radial-gradient(1000px 520px at 50% 0%, rgba(42, 111, 120, .22), transparent 70%),
    var(--night);
  padding: 44px 0 128px;
}
.hero-bg { position: absolute; inset: 0; width: 100%; height: 100%; }
.roads path { stroke: rgba(255, 255, 255, .035); stroke-width: 22; fill: none; }
.rsu circle { fill: rgba(140, 200, 205, .7); }
.rsu .ring { fill: none; stroke: rgba(140, 200, 205, .6); stroke-width: 1; transform-box: fill-box; transform-origin: center; animation: ring 4.8s ease-out infinite; }
.rsu .r2 { animation-delay: 1.6s; }
.rsu .r3 { animation-delay: 3.2s; }
@keyframes ring { from { transform: scale(1); opacity: .55; } to { transform: scale(13); opacity: 0; } }
.pk { fill: rgba(140, 200, 205, .55); }
.pk.bad { fill: rgba(212, 83, 63, .7); }
.pk.stale { fill: rgba(217, 166, 55, .7); }

.hero-inner { position: relative; z-index: 1; }
.eyebrow {
  margin: 0 0 14px; font-size: .72rem; font-weight: 500; letter-spacing: .22em; text-transform: uppercase;
  color: rgba(255, 255, 255, .55);
}
.hero-title {
  font-family: var(--serif); font-weight: 500; letter-spacing: -.015em;
  font-size: clamp(3rem, 8vw, 4.8rem); line-height: 1; color: #fff;
}
.hero-title .dash { color: var(--sig-amber); }
.hero-subtitle {
  max-width: 720px; margin: 12px auto 0;
  font-family: var(--serif); font-size: clamp(1.1rem, 2.3vw, 1.38rem); line-height: 1.4;
  color: rgba(255, 255, 255, .82);
}
.hero-subtitle b { color: #fff; font-weight: 600; }
.hero-rule { display: block; width: 56px; height: 1px; margin: 18px auto 16px; background: rgba(255, 255, 255, .25); }
.authors { margin: 0 0 4px; font-size: 1.02rem; display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 20px; }
.authors a { color: #fff; border-bottom: 1px solid rgba(255, 255, 255, .25); }
.authors a:hover { text-decoration: none; border-bottom-color: rgba(255, 255, 255, .8); }
.authors sup { color: rgba(255, 255, 255, .6); margin-left: 1px; }
.affils { margin: 0; font-size: .88rem; color: rgba(255, 255, 255, .62); display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 20px; }

.buttons { margin-top: 18px; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 6px 16px; border-radius: 999px; font-size: .88rem; font-weight: 500; }
.btn-ghost { color: rgba(255, 255, 255, .58); border: 1px solid rgba(255, 255, 255, .18); cursor: default; }
.btn small { font-size: .64rem; text-transform: uppercase; letter-spacing: .1em; color: rgba(255, 255, 255, .45); }

/* Prompt editor */
.editor {
  max-width: 720px; margin: 28px auto 0; text-align: left; overflow: hidden;
  background: #0a121e; border: 1px solid rgba(255, 255, 255, .1); border-radius: 12px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .35), inset 0 1px 0 rgba(255, 255, 255, .04);
  font-family: var(--mono);
}
.editor-bar {
  display: flex; align-items: stretch; gap: 2px; height: 34px; padding: 0 12px 0 14px;
  background: #0e1826; border-bottom: 1px solid rgba(255, 255, 255, .07);
}
.dots { display: inline-flex; align-items: center; gap: 7px; margin-right: 14px; }
.dots i { width: 10px; height: 10px; border-radius: 50%; background: #3a4352; }
.dots i:nth-child(1) { background: #c9594e; }
.dots i:nth-child(2) { background: #c9a14a; }
.dots i:nth-child(3) { background: #5a9e62; }
.etab {
  display: inline-flex; align-items: center; padding: 0 14px; font-size: .74rem;
  color: rgba(255, 255, 255, .4); border-bottom: 1.5px solid transparent; transition: color .25s ease, border-color .25s ease;
}
.etab.is-on { color: rgba(255, 255, 255, .88); border-bottom-color: rgba(140, 200, 205, .9); background: rgba(255, 255, 255, .025); }
.editor-hint { margin-left: auto; align-self: center; font-family: var(--sans); font-size: .7rem; letter-spacing: .04em; color: rgba(255, 255, 255, .32); }

.code { list-style: none; margin: 0; padding: 8px 0; counter-reset: ln; font-size: .82rem; line-height: 1.75; color: #dfe5ee; }
.code li { position: relative; counter-increment: ln; padding: 0 18px 0 52px; white-space: pre-wrap; word-break: break-word; }
.code li::before {
  content: counter(ln); position: absolute; left: 0; width: 36px; text-align: right;
  color: rgba(255, 255, 255, .22); font-size: .76rem;
}
.code-in { min-height: calc(2 * 1.75em + 20px); padding-top: 12px; }
.code-in li { color: #eef2f7; }
.code-out { min-height: calc(6 * 1.75em + 16px); background: rgba(255, 255, 255, .012); }
.code-out li { opacity: 0; transform: translateX(-4px); animation: lineIn .35s ease forwards; }
@keyframes lineIn { to { opacity: 1; transform: none; } }
.pane-sep {
  display: flex; align-items: center; gap: 10px; padding: 0 18px 0 52px;
  font-family: var(--sans); font-size: .64rem; letter-spacing: .16em; text-transform: uppercase; color: rgba(255, 255, 255, .3);
}
.pane-sep::after { content: ""; flex: 1; height: 1px; background: rgba(255, 255, 255, .07); }
.caret { display: inline-block; width: 7px; height: 1.1em; margin-left: 1px; vertical-align: -3px; background: rgba(140, 200, 205, .9); animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.j-k { color: #8fc9d1; }
.j-s { color: #e2c08d; }
.j-n { color: #d39a6a; }
.j-p { color: rgba(255, 255, 255, .45); }
.j-c { color: rgba(255, 255, 255, .34); font-style: italic; }
.j-ok { color: #93d1a1; font-style: italic; }

/* Cards and figures */
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.figure-card { margin: 0 0 28px; padding: 18px 18px 14px; }
.figure-card img { display: block; width: 100%; height: auto; }
.figure-card figcaption {
  margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line);
  font-family: var(--serif); font-size: 1rem; line-height: 1.5; color: var(--ink-2);
}
.fig-label { font-family: var(--sans); font-size: .82rem; font-weight: 600; letter-spacing: .02em; color: var(--ink); margin-right: 4px; }
.figure-card figcaption code { font-size: .82em; }
.zoomable { cursor: zoom-in; }

/* Teaser */
.teaser { margin-top: -84px; position: relative; z-index: 2; }
.teaser-card { padding: 24px 24px 16px; }
.tldr {
  max-width: 720px; margin: 36px auto 0; text-align: center;
  font-family: var(--serif); font-size: 1.4rem; line-height: 1.5; color: var(--ink);
}
.tldr em { color: var(--accent); font-size: 1em; }

/* Stats */
.stats { padding: 44px 0 4px; }
.stats-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2);
}
.stat { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 26px 12px 22px; }
.stat + .stat { border-left: 1px solid var(--line); }
.stat-value { font-family: var(--serif); font-weight: 500; font-size: 2.6rem; line-height: 1; color: var(--navy); display: inline-flex; align-items: baseline; gap: 6px; }
.stat-value .arrow { font-size: 1.4rem; color: var(--muted); }
.stat-label { margin-top: 10px; font-size: .82rem; color: var(--ink-2); line-height: 1.45; }

/* Sections */
.section { padding: 96px 0; }
.section-alt { background: var(--bg-alt); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.kicker {
  display: flex; align-items: center; justify-content: center; gap: 10px; margin: 0 0 12px;
  font-size: .72rem; font-weight: 500; letter-spacing: .2em; text-transform: uppercase; color: var(--muted);
}
.kicker span {
  display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px;
  border: 1px solid var(--line-2); border-radius: 50%;
  font-family: var(--serif); font-size: .82rem; letter-spacing: 0; color: var(--ink-2);
}
.section-title { font-family: var(--serif); font-weight: 500; font-size: clamp(1.8rem, 3.8vw, 2.5rem); text-align: center; color: var(--ink); letter-spacing: -.01em; }
.section-lead { max-width: 640px; margin: 14px auto 48px; text-align: center; color: var(--ink-2); font-size: 1.04rem; }
.rule { font-family: var(--mono); font-size: .86em; padding: 1px 8px; border-radius: 4px; background: var(--accent-soft); color: var(--accent); white-space: nowrap; }

/* Information chain */
.chain { position: relative; padding: 14px 0 6px; }
.chain-track { position: absolute; left: 8.33%; right: 8.33%; top: 42px; height: 2px; background: var(--line-2); }
.pkt { position: absolute; top: -5px; left: 0; width: 12px; height: 12px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px rgba(42, 111, 120, .12); animation: flow 7s linear infinite; }
.pkt.d2 { animation-delay: -2.3s; }
.pkt.d3 { animation-delay: -4.6s; }
.pkt.stale { animation: flowStale 10s linear infinite; animation-delay: -1s; }
.pkt.wrong { animation: flowWrong 7s linear infinite; animation-delay: -3.5s; }
.pkt.lost { animation: flowLost 7s linear infinite; animation-delay: -5.8s; }
@keyframes flow { from { left: 0; } to { left: calc(100% - 12px); } }
@keyframes flowStale {
  0% { left: 0; background: var(--accent); }
  50% { left: 50%; background: var(--sig-amber); box-shadow: 0 0 0 4px rgba(217, 166, 55, .16); }
  100% { left: calc(100% - 12px); background: var(--sig-amber); box-shadow: 0 0 0 4px rgba(217, 166, 55, .16); }
}
@keyframes flowWrong {
  0%, 52% { background: var(--accent); }
  0% { left: 0; }
  58% { background: var(--sig-red); box-shadow: 0 0 0 4px rgba(212, 83, 63, .16); }
  100% { left: calc(100% - 12px); background: var(--sig-red); box-shadow: 0 0 0 4px rgba(212, 83, 63, .16); }
}
@keyframes flowLost {
  0% { left: 0; opacity: 1; }
  54% { left: 54%; opacity: 1; transform: scale(1); }
  64% { left: 60%; opacity: 0; transform: scale(2); background: var(--muted); }
  100% { left: 60%; opacity: 0; }
}
.chain-nodes { position: relative; display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; }
.cnode { display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center; }
.cic {
  display: flex; align-items: center; justify-content: center; width: 56px; height: 56px;
  border-radius: 50%; background: var(--paper); border: 1px solid var(--line-2); color: var(--navy); font-size: 1.15rem;
}
.cnode b { margin-top: 10px; font-size: .88rem; font-weight: 600; }
.cnode code { font-family: var(--serif); font-style: italic; font-size: .95rem; color: var(--muted); }
.cnode-fault .cic { color: var(--sig-red); border-color: #ecc3ba; }

.mechanisms { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; margin-top: 56px; border-top: 1px solid var(--line-2); }
.mech { padding: 22px 24px 4px; }
.mech + .mech { border-left: 1px solid var(--line); }
.mech-tag { display: inline-flex; align-items: center; gap: 8px; font-family: var(--serif); font-size: 1.15rem; font-weight: 500; color: var(--ink); }
.mech-tag::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.mech-stale { --c: var(--sig-amber); }
.mech-wrong { --c: var(--sig-red); }
.mech-silent { --c: #9aa1ab; }
.mech p { margin: 8px 0 0; font-size: .93rem; color: var(--ink-2); }

/* Method steps */
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.step { position: relative; padding: 24px 22px 22px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); }
.step::before { content: ""; position: absolute; left: 22px; top: 0; width: 28px; height: 2px; background: var(--c); }
.step.s1 { --c: var(--m1); }
.step.s2 { --c: var(--m2); }
.step.s3 { --c: var(--m3); }
.step.s4 { --c: var(--m4); }
.step-num { font-family: var(--serif); font-style: italic; font-size: 1.05rem; color: var(--c); }
.step h3 { margin: 6px 0 8px; font-family: var(--serif); font-size: 1.22rem; font-weight: 500; }
.step p { margin: 0; font-size: .9rem; color: var(--ink-2); line-height: 1.55; }
.link-btn {
  margin-top: 32px; cursor: pointer; font: inherit; font-size: .9rem; font-weight: 500;
  padding: 8px 4px; border: 0; background: none; color: var(--accent);
  border-bottom: 1px solid rgba(42, 111, 120, .35);
}
.link-btn:hover { border-bottom-color: var(--accent); }

/* Replay */
.replay { padding: 24px 24px 20px; }
.replay-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.seg { display: inline-flex; padding: 3px; border-radius: 8px; background: var(--bg-alt); border: 1px solid var(--line); }
.seg-btn { cursor: pointer; font: inherit; font-size: .85rem; font-weight: 500; padding: 6px 14px; border-radius: 6px; border: 0; background: transparent; color: var(--ink-2); }
.seg-btn.is-active { background: var(--paper); color: var(--ink); box-shadow: 0 1px 2px rgba(22, 28, 39, .12); }
.verdict-chip { font-size: .82rem; font-weight: 500; padding: 5px 12px; border-radius: 6px; background: var(--bg-alt); color: var(--muted); transition: background .3s ease, color .3s ease; }
.verdict-chip.is-admitted { background: #e6f2e8; color: #2e7340; }
.verdict-chip.is-clean { background: #eeeeec; color: #5d6470; }
.replay-prompt {
  margin: 18px 0 8px; padding: 2px 0 2px 16px; border-left: 2px solid var(--accent);
  font-family: var(--serif); font-size: 1.08rem; font-style: italic; color: var(--ink-2);
}
.replay-prompt mark { background: none; color: var(--ink); font-style: italic; }
.replay-prompt small { display: block; margin-top: 4px; font-family: var(--sans); font-size: .78rem; font-style: normal; color: var(--muted); }

.road-svg { display: block; width: 100%; height: auto; margin-top: 10px; }
.asphalt { fill: #333a46; }
.lane-mark { stroke: rgba(255, 255, 255, .45); stroke-width: 2; stroke-dasharray: 14 12; }
.stopbar { fill: #f1f2f4; }
.crosswalk rect { fill: rgba(255, 255, 255, .3); }
.lane-label { font: 500 10.5px var(--sans); letter-spacing: .1em; fill: var(--muted); }
.bar-label, .sig-label { font: 400 11px var(--sans); fill: var(--muted); }
.sig-housing { fill: #222833; }
.lamp { fill: #444b58; transition: fill .2s ease; }
.lamp.on-r { fill: var(--sig-red); }
.lamp.on-y { fill: var(--sig-amber); }
.lamp.on-g { fill: var(--sig-green); }
.car-ego { fill: var(--orange); }
.windshield { fill: rgba(255, 255, 255, .55); }
.car-twin { fill: rgba(160, 175, 200, .12); stroke: #aebbcf; stroke-width: 1.75; stroke-dasharray: 6 4; }
.bubble rect { fill: var(--paper); stroke: var(--line-2); }
.bubble text { font: 500 11px var(--sans); fill: var(--ink-2); }
.bubble circle { transition: fill .2s ease; }
.flash rect { fill: var(--sig-red); }
.flash text { font: 600 12.5px var(--sans); fill: #fff; letter-spacing: .02em; }
.flash { transition: opacity .3s ease; }

.timelines { position: relative; margin: 16px 0 0; }
.tl-row { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.tl-name { width: 70px; flex: none; font-size: .74rem; font-weight: 500; color: var(--muted); text-align: right; }
.tl-bar { position: relative; flex: 1; height: 12px; border-radius: 3px; overflow: hidden; display: flex; }
.tl-seg { height: 100%; }
.tl-seg.g { background: var(--sig-green); }
.tl-seg.y { background: var(--sig-amber); }
.tl-seg.r { background: var(--sig-red); }
.tl-seg.frozen { background-image: repeating-linear-gradient(135deg, rgba(255, 255, 255, .55) 0 3px, transparent 3px 8px); }
.tl-head { position: absolute; top: -4px; bottom: 2px; width: 1.5px; background: var(--ink); left: 80px; pointer-events: none; }
.tl-head::before { content: ""; position: absolute; top: -3px; left: -3.25px; width: 8px; height: 8px; border-radius: 50%; background: var(--ink); }

.replay-controls { display: flex; align-items: center; gap: 14px; margin-top: 16px; flex-wrap: wrap; }
.play-btn { width: 36px; height: 36px; border-radius: 50%; cursor: pointer; color: var(--ink); background: var(--paper); border: 1px solid var(--line-2); font-size: .8rem; flex: none; }
.play-btn:hover { border-color: var(--ink-2); }
#scrub { flex: 1; min-width: 160px; accent-color: var(--navy); }
.readout { display: flex; gap: 16px; font-family: var(--mono); font-size: .78rem; color: var(--muted); }
.readout b { font-weight: 500; color: var(--ink); display: inline-block; min-width: 3.4ch; text-align: right; }
.r-ego b { color: var(--orange); }
.replay-note { margin: 14px 0 0; padding-top: 12px; border-top: 1px solid var(--line); font-size: .78rem; color: var(--muted); }

/* Vocabulary */
.elements { display: grid; grid-template-columns: repeat(7, 1fr); gap: 12px; }
.el {
  position: relative; display: flex; flex-direction: column; aspect-ratio: 1 / 1.1;
  padding: 12px 12px 10px; border-radius: 8px; background: var(--paper); border: 1px solid var(--line);
  transition: transform .25s ease, box-shadow .25s ease;
}
.el::before { content: ""; position: absolute; left: 12px; top: 0; width: 22px; height: 2px; background: var(--c); }
.el:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.el-sym { font-family: var(--serif); font-weight: 500; font-size: 2.1rem; line-height: 1; color: var(--c); margin-top: 8px; }
.el b { margin-top: auto; font-family: var(--mono); font-weight: 400; font-size: .74rem; color: var(--ink); word-break: break-all; }
.el small { font-size: .72rem; color: var(--muted); line-height: 1.35; }
.fam-delivery { --c: var(--m1); }
.fam-time { --c: #b8862a; }
.fam-content { --c: var(--sig-red); }
.legend { display: flex; justify-content: center; flex-wrap: wrap; gap: 22px; margin-top: 18px; font-size: .8rem; color: var(--ink-2); }
.legend .sw { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 7px; vertical-align: -1px; background: var(--c); }
.apps { display: grid; grid-template-columns: 1fr 2fr; gap: 18px; margin-top: 44px; }
.app-group { padding: 18px 22px 20px; background: var(--paper); border-radius: var(--radius); border: 1px solid var(--line); }
.app-group-name { display: block; font-size: .7rem; font-weight: 500; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); margin-bottom: 14px; }
.app-list { display: flex; flex-wrap: wrap; gap: 8px; }
.app { font-size: .86rem; padding: 5px 12px; border-radius: 6px; border: 1px solid var(--line); color: var(--ink-2); }
.app b { font-weight: 600; color: var(--ink); margin-right: 4px; }

/* Results tabs */
.tabs { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 28px; margin: 36px 0 34px; border-bottom: 1px solid var(--line-2); }
.tab {
  font: inherit; font-size: .95rem; font-weight: 500; cursor: pointer; padding: 10px 2px 12px; margin-bottom: -1px;
  color: var(--muted); background: none; border: 0; border-bottom: 2px solid transparent;
  transition: color .15s ease, border-color .15s ease;
}
.tab:hover { color: var(--ink); }
.tab.is-active { color: var(--ink); border-bottom-color: var(--ink); }
.js .panel { display: none; }
.js .panel.is-active { display: block; animation: fade .35s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.panel-head { text-align: center; margin-bottom: 26px; }
.panel-head p { margin: 0 auto 14px; max-width: 680px; font-family: var(--serif); font-size: 1.25rem; line-height: 1.45; color: var(--ink); }
.pills { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.pill { padding: 3px 11px; border-radius: 999px; font-size: .8rem; font-weight: 500; color: var(--ink-2); border: 1px solid var(--line-2); background: var(--paper); }

/* Citation */
.bibtex { position: relative; margin: 28px 0 14px; }
.bibtex pre {
  margin: 0; padding: 22px 24px; overflow-x: auto;
  font-size: .82rem; line-height: 1.7; color: var(--ink);
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
}
.copy-btn {
  position: absolute; top: 12px; right: 12px; cursor: pointer; font: inherit; font-size: .76rem; font-weight: 500;
  padding: 4px 10px; border-radius: 6px; color: var(--ink-2); background: var(--bg-alt); border: 1px solid var(--line);
}
.copy-btn:hover { color: var(--ink); border-color: var(--line-2); }

/* Footer */
.footer { padding: 30px 0 40px; font-size: .8rem; color: var(--muted); }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; }
.footer a { color: var(--ink-2); }

/* Lightbox */
.lightbox { width: 100vw; height: 100vh; max-width: none; max-height: none; margin: 0; padding: 28px; border: 0; background: rgba(12, 18, 28, .92); cursor: zoom-out; }
.lightbox[open] { display: flex; align-items: center; justify-content: center; }
.lightbox::backdrop { background: transparent; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 4px; background: #fff; }
.lightbox-close { position: absolute; top: 16px; right: 20px; cursor: pointer; font-size: 1.3rem; color: #fff; background: none; border: 0; }

/* Responsive */
@media (max-width: 900px) {
  .steps { grid-template-columns: repeat(2, 1fr); }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(3) { border-left: 0; }
  .stat:nth-child(n + 3) { border-top: 1px solid var(--line); }
  .elements { grid-template-columns: repeat(4, 1fr); }
  .apps { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .wrap { padding: 0 16px; }
  .topnav-links { gap: 14px; }
  .topnav-links a { font-size: .8rem; }
  .topnav-links a[href="#chain"], .topnav-links a[href="#bibtex"] { display: none; }
  .hero { padding: 32px 0 108px; }
  .editor-hint { display: none; }
  .code { font-size: .74rem; }
  .code li { padding-left: 40px; padding-right: 12px; }
  .code li::before { width: 26px; }
  .pane-sep { padding-left: 40px; }
  .code-in { min-height: calc(4 * 1.75em + 26px); }
  .code-out { min-height: calc(7 * 1.75em + 24px); }
  .teaser { margin-top: -80px; }
  .teaser-card, .figure-card { padding: 10px 10px 8px; }
  .tldr { font-size: 1.18rem; }
  .section { padding: 68px 0; }
  .steps { grid-template-columns: 1fr; }
  .mechanisms { grid-template-columns: 1fr; }
  .mech + .mech { border-left: 0; border-top: 1px solid var(--line); }
  .mech { padding: 18px 4px 14px; }
  .elements { grid-template-columns: repeat(3, 1fr); }
  .stat-value { font-size: 2.1rem; }
  .chain-track { top: 34px; }
  .cic { width: 40px; height: 40px; font-size: .9rem; }
  .cnode b { font-size: .7rem; }
  .cnode code { font-size: .8rem; }
  .chain-nodes { gap: 2px; }
  .replay { padding: 14px; }
  .readout { width: 100%; justify-content: space-between; }
  .tl-name { width: 58px; font-size: .68rem; }
  .tabs { gap: 2px 18px; }
  .tab { font-size: .86rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .reveal { opacity: 1; transform: none; }
  .code-out li { opacity: 1; transform: none; }
}
