:root {
  color-scheme: dark;
  --background: #071014;
  --surface: #0b171c;
  --surface-strong: #102129;
  --border: #1a3540;
  --text: #e7f8ff;
  --muted: #91aab4;
  --cyan: #3de7ff;
  --amber: #ffb84a;
  --max-width: 1120px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--background);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 10;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--text);
  color: var(--background);
  transform: translateY(-150%);
}

.skip-link:focus { transform: translateY(0); }

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

.shell { width: min(var(--max-width), calc(100% - 40px)); margin: 0 auto; }

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 76px;
  border-bottom: 1px solid var(--border);
}

.brand { display: inline-flex; align-items: center; gap: 11px; min-height: 44px; font-weight: 760; text-decoration: none; }
.brand img { width: 34px; height: 34px; }
.nav-links { display: flex; align-items: center; gap: 24px; color: var(--muted); font-size: 14px; }
.nav-links a { min-height: 44px; display: inline-flex; align-items: center; text-decoration: none; }
.nav-links a:hover, .nav-links a:focus-visible { color: var(--cyan); }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, .95fr);
  align-items: center;
  gap: 72px;
  min-height: calc(100vh - 76px);
  min-height: calc(100svh - 76px);
  padding: 80px 0;
}
.hero > div { min-width: 0; }

.eyebrow {
  margin: 0 0 18px;
  color: var(--cyan);
  font: 700 12px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: .18em;
  text-transform: uppercase;
}

h1, h2, h3 { margin-top: 0; letter-spacing: -.035em; }
h1 { max-width: 720px; margin-bottom: 24px; font-size: clamp(50px, 7vw, 88px); line-height: .98; }
h1 span { color: var(--amber); }
.lede { max-width: 660px; margin: 0 0 34px; color: var(--muted); font-size: clamp(18px, 2vw, 21px); line-height: 1.65; }

.install {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 620px;
  padding: 8px 8px 8px 18px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 18px 70px rgba(0, 0, 0, .28);
}

code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.install code { min-width: 0; overflow-x: auto; color: var(--amber); white-space: nowrap; }
.copy {
  min-width: 70px;
  min-height: 44px;
  padding: 10px 13px;
  border: 1px solid #2a4c58;
  border-radius: 8px;
  background: var(--surface-strong);
  color: var(--text);
  cursor: pointer;
}
.copy:hover, .copy:focus-visible { border-color: var(--cyan); }

.actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 26px; }
.button { min-height: 44px; display: inline-flex; align-items: center; padding: 11px 16px; border: 1px solid var(--border); border-radius: 9px; text-decoration: none; font-weight: 650; }
.button.primary { border-color: var(--cyan); background: var(--cyan); color: #031014; }
.button:hover, .button:focus-visible { transform: translateY(-1px); }

.terminal { min-width: 0; overflow: hidden; margin: 0; border: 1px solid #24505f; border-radius: 16px; background: #050c0f; box-shadow: 0 30px 90px rgba(0, 0, 0, .45); }
.terminal-head { display: flex; align-items: center; gap: 7px; padding: 13px 16px; border-bottom: 1px solid #18343e; background: #0b181d; }
.terminal-head i { width: 9px; height: 9px; border-radius: 50%; background: #29434c; }
.terminal-head span { margin-left: 7px; color: #6f8a94; font: 11px/1 ui-monospace, monospace; }
.terminal-body { min-width: 0; margin: 0; padding: 24px; overflow-x: auto; font: 13px/1.8 ui-monospace, SFMono-Regular, Menlo, monospace; }
.prompt { color: var(--cyan); }
.dim { color: #86a3ac; }
.pass { color: #77e8ab; }
.reject { color: #ff8d8d; }
.accept { color: var(--amber); }

.section { padding: 108px 0; border-top: 1px solid var(--border); }
.section-head { max-width: 690px; margin-bottom: 46px; }
.section h2 { margin-bottom: 14px; font-size: clamp(36px, 5vw, 58px); }
.section-head p { color: var(--muted); font-size: 18px; line-height: 1.65; }

.cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.card { padding: 28px; border: 1px solid var(--border); border-radius: 15px; background: var(--surface); }
.card .index { display: block; margin-bottom: 28px; color: var(--cyan); font: 700 12px/1 ui-monospace, monospace; }
.card h3 { margin-bottom: 10px; font-size: 22px; }
.card p { margin-bottom: 0; color: var(--muted); line-height: 1.6; }

.route-demo { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(280px, .6fr); gap: 34px; align-items: start; }
.route-visual { position: relative; min-height: 442px; overflow: hidden; padding: 26px 24px 24px; border: 1px solid #24505f; border-radius: 16px; background: #050c0f; box-shadow: 0 30px 90px rgba(0, 0, 0, .3); }
.route-track { position: absolute; top: 160px; left: 9%; right: 9%; height: 1px; background: #25444d; }
.route-track::before { content: ""; position: absolute; inset: -3px auto -3px 0; width: 100%; background: var(--cyan); opacity: .22; filter: blur(3px); }
.route-stages { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin: 0; padding: 0; list-style: none; }
.route-stage { min-width: 0; min-height: 86px; padding: 13px 10px; border-top: 1px solid #25444d; color: var(--muted); transition: border-color .35s ease, color .35s ease, opacity .35s ease, transform .35s ease; }
.route-stage strong { display: block; margin-bottom: 8px; color: var(--text); font-size: 15px; letter-spacing: -.02em; }
.route-stage--execution { border-top-color: #805f2b; }
.stage-mark { display: block; margin-bottom: 12px; color: var(--cyan); font: 700 11px/1 ui-monospace, monospace; letter-spacing: .08em; }
.stage-detail { display: block; font: 11px/1.45 ui-monospace, monospace; }
.route-packet { position: absolute; z-index: 2; top: 151px; left: 4%; display: inline-flex; align-items: center; gap: 7px; padding: 6px 9px; border: 1px solid var(--cyan); border-radius: 7px; background: #071b21; color: var(--cyan); font: 700 11px/1 ui-monospace, monospace; box-shadow: 0 0 0 4px rgba(61, 231, 255, .08); transition: left .7s cubic-bezier(.16, 1, .3, 1), top .7s cubic-bezier(.16, 1, .3, 1), border-color .35s ease, color .35s ease; }
.packet-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.filter-lanes, .admission-readout, .selection-readout, .execution-readout { position: absolute; left: 24px; right: 24px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border: 1px solid #1a3540; border-radius: 9px; background: #0b171c; color: var(--muted); font: 12px/1.3 ui-monospace, monospace; transition: opacity .45s ease, transform .45s ease, border-color .35s ease; }
.filter-lanes { top: 190px; }
.admission-readout { top: 254px; }
.selection-readout { top: 318px; justify-content: flex-start; color: var(--amber); }
.execution-readout { top: 382px; border-color: #805f2b; color: var(--amber); }
.lane { display: inline-flex; align-items: center; gap: 7px; }
.lane b, .admission-readout b { color: #77e8ab; font-size: 11px; font-weight: 700; }
.lane--drop b, .admission-readout > b { color: #ff8d8d; }
.readout-accept { color: var(--amber) !important; }
.selection-arrow { color: var(--cyan); font-size: 18px; }
.route-controls { display: none; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 22px; }
.js-ready .route-controls { display: flex; }
.route-control { min-height: 44px; padding: 10px 13px; border: 1px solid #2a4c58; border-radius: 8px; background: var(--surface-strong); color: var(--text); cursor: pointer; font: 650 13px/1.1 inherit; }
.route-control:hover, .route-control:focus-visible { border-color: var(--cyan); }
.route-control--quiet { color: var(--muted); }
.route-status { color: var(--muted); font: 11px/1.4 ui-monospace, monospace; }
.route-explanation { display: grid; gap: 18px; margin: 0; padding: 0 0 0 22px; color: var(--muted); }
.route-explanation li { padding-left: 5px; line-height: 1.55; }
.route-explanation li::marker { color: var(--cyan); font: 700 12px/1 ui-monospace, monospace; }
.route-explanation strong { color: var(--text); }
.route-explanation code { color: var(--amber); font-size: .9em; }

body.js-ready .route-stage { opacity: 1; transform: translateY(5px); border-top-color: #163039; }
body.js-ready .route-readout, body.js-ready .filter-lanes, body.js-ready .admission-readout, body.js-ready .selection-readout, body.js-ready .execution-readout { opacity: 0; transform: translateY(9px); }
body.js-ready .route-demo[data-route-stage="1"] .route-stage[data-stage="1"],
body.js-ready .route-demo[data-route-stage="2"] .route-stage[data-stage="2"],
body.js-ready .route-demo[data-route-stage="3"] .route-stage[data-stage="3"],
body.js-ready .route-demo[data-route-stage="4"] .route-stage[data-stage="4"],
body.js-ready .route-demo[data-route-stage="5"] .route-stage[data-stage="5"] { opacity: 1; transform: none; border-top-color: var(--cyan); }
body.js-ready .route-demo[data-route-stage="1"] .route-stage[data-stage="1"] strong,
body.js-ready .route-demo[data-route-stage="2"] .route-stage[data-stage="2"] strong,
body.js-ready .route-demo[data-route-stage="3"] .route-stage[data-stage="3"] strong,
body.js-ready .route-demo[data-route-stage="4"] .route-stage[data-stage="4"] strong,
body.js-ready .route-demo[data-route-stage="5"] .route-stage[data-stage="5"] strong { color: var(--cyan); }
body.js-ready .route-demo[data-route-stage="2"] .filter-lanes,
body.js-ready .route-demo[data-route-stage="3"] .filter-lanes,
body.js-ready .route-demo[data-route-stage="4"] .filter-lanes,
body.js-ready .route-demo[data-route-stage="5"] .filter-lanes,
body.js-ready .route-demo[data-route-stage="3"] .admission-readout,
body.js-ready .route-demo[data-route-stage="4"] .admission-readout,
body.js-ready .route-demo[data-route-stage="5"] .admission-readout,
body.js-ready .route-demo[data-route-stage="4"] .selection-readout,
body.js-ready .route-demo[data-route-stage="5"] .selection-readout,
body.js-ready .route-demo[data-route-stage="5"] .execution-readout { opacity: 1; transform: none; }
body.js-ready .route-demo[data-route-stage="2"] .route-packet { left: 24%; }
body.js-ready .route-demo[data-route-stage="3"] .route-packet { left: 44%; }
body.js-ready .route-demo[data-route-stage="4"] .route-packet { left: 64%; }
body.js-ready .route-demo[data-route-stage="5"] .route-packet { left: 84%; border-color: var(--amber); color: var(--amber); }
body.js-ready .route-demo[data-route-paused="true"] .route-packet { box-shadow: 0 0 0 4px rgba(255, 184, 74, .12); }
body.js-ready .route-demo[data-route-stage="5"] .route-stage--execution { border-top-color: var(--amber); }
body.js-ready .route-demo[data-route-stage="5"] .route-stage--execution strong { color: var(--amber); }

.provider-list { display: flex; flex-wrap: wrap; gap: 10px; }
.provider-list span { padding: 9px 12px; border: 1px solid var(--border); border-radius: 999px; color: var(--muted); font: 13px/1 ui-monospace, monospace; }

.notice { padding: 28px; border: 1px solid #2a4c58; border-radius: 12px; background: var(--surface); color: var(--muted); line-height: 1.7; }
.notice strong { color: var(--text); }
.notice-action { margin: 16px 0 0; }
.notice a { color: var(--cyan); }

footer { display: flex; justify-content: space-between; gap: 24px; padding: 34px 0 48px; border-top: 1px solid var(--border); color: var(--muted); font-size: 13px; }
footer > span > a { min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; }
footer nav { display: flex; flex-wrap: wrap; gap: 18px; }
footer nav a { min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; }
footer a:hover, footer a:focus-visible { color: var(--cyan); }

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; min-height: auto; gap: 52px; }
  .terminal { max-width: 620px; }
  .route-demo { grid-template-columns: 1fr; }
  .route-copy { max-width: 680px; }
}

@media (max-width: 620px) {
  .shell { width: min(var(--max-width), calc(100% - 28px)); }
  .nav { align-items: flex-start; flex-wrap: wrap; gap: 4px 16px; padding: 12px 0; }
  .nav-links { width: 100%; justify-content: space-between; gap: 0 8px; flex-wrap: wrap; font-size: 13px; }
  .hero { padding: 60px 0 72px; }
  .install { align-items: stretch; flex-direction: column; gap: 10px; padding: 14px; }
  .install code { width: 100%; }
  .terminal-body { white-space: pre-wrap; overflow-wrap: anywhere; }
  .copy { align-self: flex-start; }
  .cards { grid-template-columns: 1fr; }
  .section { padding: 76px 0; }
  footer { flex-direction: column; }
}

@media (max-width: 620px) {
  .route-visual { min-height: 0; padding: 18px 14px 22px 50px; }
  .route-track { top: 30px; bottom: 48px; left: 40px; right: auto; width: 1px; height: auto; }
  .route-track::before { inset: 0 -3px; width: auto; height: 100%; }
  .route-stages { display: grid; grid-template-columns: 1fr; gap: 0; }
  .route-stage { min-height: 70px; padding: 10px 0; border-top: 0; border-bottom: 1px solid #1a3540; }
  .route-stage:last-child { border-bottom: 0; }
  .route-stage strong { margin-bottom: 5px; }
  .stage-mark { position: absolute; left: -47px; margin-top: 3px; }
  .route-packet { top: 0; left: 33px; width: 14px; height: 14px; gap: 0; padding: 3px; justify-content: center; }
  .route-packet > span:last-child { display: none; }
  .filter-lanes, .admission-readout, .selection-readout, .execution-readout { position: relative; top: auto; left: auto; right: auto; margin-top: 12px; }
  .filter-lanes { flex-wrap: wrap; justify-content: flex-start; gap: 8px 14px; }
  .admission-readout { flex-wrap: wrap; justify-content: flex-start; gap: 8px 14px; }
  body.js-ready .route-demo[data-route-stage="2"] .route-packet { left: 33px; top: 70px; }
  body.js-ready .route-demo[data-route-stage="3"] .route-packet { left: 33px; top: 143px; }
  body.js-ready .route-demo[data-route-stage="4"] .route-packet { left: 33px; top: 213px; }
  body.js-ready .route-demo[data-route-stage="5"] .route-packet { left: 33px; top: 298px; }
}

/* Sub pages (commands, changelog) */

.page { padding: 72px 0 96px; }
.page-head { max-width: 720px; margin-bottom: 56px; }
.page-head h1 { margin: 12px 0 18px; font-size: clamp(40px, 6vw, 64px); }
.page-head .lede { margin-bottom: 0; }

.page-group { max-width: 860px; margin: 0 0 56px; }
.page-group > h2 { margin-bottom: 8px; font-size: 26px; }
.page-group > .group-note { margin: 0 0 22px; color: var(--muted); line-height: 1.6; }

.cmd-list { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.cmd { display: grid; grid-template-columns: minmax(210px, 280px) 1fr; gap: 8px 28px; padding: 18px 20px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.cmd:hover, .cmd:focus-within { border-color: #2a4c58; }
.cmd-name { color: var(--amber); font: 650 14px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; overflow-wrap: anywhere; }
.cmd-desc { color: var(--muted); line-height: 1.6; }
.cmd-desc code { color: var(--text); font-size: .92em; }
.cmd-example { grid-column: 1 / -1; margin: 4px 0 0; padding: 10px 14px; border-radius: 8px; background: #050c0f; color: var(--dim); font: 12.5px/1.7 ui-monospace, SFMono-Regular, Menlo, monospace; overflow-x: auto; white-space: pre; }
.cmd-example .prompt { color: var(--cyan); }

.kind-list { display: flex; flex-wrap: wrap; gap: 10px; margin: 0; padding: 0; list-style: none; }
.kind-list li { display: inline-flex; align-items: baseline; gap: 8px; padding: 9px 14px; border: 1px solid var(--border); border-radius: 999px; color: var(--muted); font: 12.5px/1 ui-monospace, monospace; }
.kind-list b { color: var(--amber); }

.changelog { max-width: 860px; }
.release { padding: 26px 0 30px; border-top: 1px solid var(--border); }
.release:first-child { border-top: 0; padding-top: 0; }
.release-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; margin-bottom: 18px; }
.release-version { color: var(--cyan); font: 700 22px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: -.02em; text-decoration: none; }
.release-version:hover, .release-version:focus-visible { color: var(--amber); }
.release-date { color: var(--muted); font: 12.5px/1.4 ui-monospace, monospace; }
.release-latest { padding: 3px 9px; border: 1px solid var(--amber); border-radius: 999px; color: var(--amber); font: 700 10.5px/1.2 ui-monospace, monospace; letter-spacing: .1em; text-transform: uppercase; }
.release h3 { margin: 20px 0 10px; color: var(--text); font: 700 12px/1.4 ui-monospace, monospace; letter-spacing: .16em; text-transform: uppercase; }
.release ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.release li { position: relative; padding-left: 22px; color: var(--muted); line-height: 1.6; }
.release li::before { content: "▸"; position: absolute; left: 0; color: var(--cyan); font: 700 12px/1.6 ui-monospace, monospace; }
.release li a { color: var(--cyan); text-decoration: none; }
.release li a:hover, .release li a:focus-visible { text-decoration: underline; }
.release li strong { color: var(--text); font-weight: 650; }
.changelog-note { max-width: 720px; margin: 40px 0 0; padding: 20px 24px; border: 1px solid #2a4c58; border-radius: 12px; background: var(--surface); color: var(--muted); line-height: 1.65; }
.changelog-note a { color: var(--cyan); }

@media (max-width: 620px) {
  .cmd { grid-template-columns: 1fr; }
  .cmd-example { white-space: pre-wrap; overflow-wrap: anywhere; }
  .release-head { flex-direction: column; gap: 6px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
  body.js-ready .route-stage, body.js-ready .route-readout, body.js-ready .filter-lanes, body.js-ready .admission-readout, body.js-ready .selection-readout, body.js-ready .execution-readout { transform: none; }
}
