:root {
  --bg: #fbfbfa;
  --ink: #171918;
  --muted: #6b706c; /* 4.88:1 on --bg */
  --line: #e3e4e0;
  --line-strong: #cfd1cc;
  --soft: #f1f2ef;
  --band-text: #575d58; /* 5.6:1 on --soft */
  --green: #93bf1f;
  --green-dark: #4f6900; /* 5.17:1 on --bg – text-safe green */
  --green-soft: #eef6d5;
  --term-bg: #161916;
  --term-line: #2b302c;
  --term-text: #dfe8df;
  --term-green: #c3e76b;
  --term-comment: #8b968d; /* 5.78:1 on --term-bg */
  --max: 1160px;
  --mono: "Geist Mono", ui-monospace, "SF Mono", monospace;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Geist, Inter, ui-sans-serif, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
::selection {
  background: var(--green-soft);
  color: var(--green-dark);
}
a {
  color: inherit;
  text-decoration: none;
}
button {
  font: inherit;
  color: inherit;
}
:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 3px;
  border-radius: 2px;
}
section[id] {
  scroll-margin-top: 80px;
}
.container {
  width: min(calc(100% - 48px), var(--max));
  margin: 0 auto;
}

/* ---- shared motion primitives ---- */
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes grow-x {
  from {
    transform: scaleX(0);
  }
  to {
    transform: scaleX(1);
  }
}
@keyframes fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@keyframes pop {
  0% {
    transform: scale(1);
  }
  45% {
    transform: scale(1.07);
  }
  100% {
    transform: scale(1);
  }
}

/* ---- structural rails: hairlines 24px outside the content column ---- */
.page-rails {
  position: fixed;
  inset: 0;
  width: min(calc(100% - 8px), calc(var(--max) + 48px));
  margin: 0 auto;
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
  pointer-events: none;
  z-index: 0;
}
.site-shell {
  position: relative;
}
.site-shell > *:not(.page-rails) {
  position: relative;
  z-index: 1;
}
.site-shell > .nav-wrap {
  z-index: 20;
}

/* crosshair ticks at the ends of section rules */
.crossed {
  position: relative;
}
.crossed::before,
.crossed::after {
  content: "";
  position: absolute;
  top: -5px;
  width: 9px;
  height: 9px;
  background:
    linear-gradient(var(--line-strong), var(--line-strong)) center / 9px 1px
      no-repeat,
    linear-gradient(var(--line-strong), var(--line-strong)) center / 1px 9px
      no-repeat;
  pointer-events: none;
}
.crossed::before {
  left: -4.5px;
}
.crossed::after {
  right: -4.5px;
}

/* ---- nav ---- */
.nav-wrap {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  -webkit-backdrop-filter: blur(14px) saturate(1.5);
  backdrop-filter: blur(14px) saturate(1.5);
  border-bottom: 1px solid var(--line);
  transition:
    border-color 0.3s var(--ease),
    box-shadow 0.3s var(--ease);
}
.nav-wrap.scrolled {
  border-bottom-color: var(--line-strong);
  box-shadow: 0 1px 2px rgba(23, 25, 24, 0.04);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.04em;
}
.wordmark-name {
  font-family: "Dela Gothic One", Geist, sans-serif;
  font-size: 14px;
  font-weight: 400;
  letter-spacing: -0.07em;
}
.wordmark-mark {
  display: inline-grid;
  width: 24px;
  height: 24px;
  place-items: center;
  margin-right: 5px;
  border: 1px solid var(--green-dark);
  border-radius: 8px 8px 3px 8px;
  background: var(--green-soft);
  color: var(--green-dark);
  font-size: 12px;
  box-shadow: 2px 2px 0 var(--green);
}
.wordmark-tld {
  color: var(--muted);
  font-weight: 400;
}
.version-badge {
  margin-left: 9px;
  padding: 2.5px 7px;
  border: 1px solid var(--line);
  border-radius: 100px;
  background: #fff;
  color: var(--muted);
  font: 400 10.5px/1 var(--mono);
  letter-spacing: 0;
  align-self: center;
}
.nav-links,
.footer-links {
  display: flex;
  gap: 26px;
  align-items: center;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
}
.nav-links a,
.footer-links a,
.text-link {
  transition: color 0.18s var(--ease);
}
.nav-links a:hover,
.footer-links a:hover,
.text-link:hover {
  color: var(--green-dark);
}

.arrow {
  display: inline-block;
  transition: transform 0.22s var(--ease);
}
a:hover > .arrow,
.button:hover .arrow {
  transform: translateX(3px);
}

/* ---- hero ---- */
.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 420px);
  align-items: center;
  gap: 64px;
  padding: 108px 0 100px;
}
.hero-main > * {
  animation: rise 0.65s var(--ease) both;
}
.hero-main > *:nth-child(1) {
  animation-delay: 0.02s;
}
.hero-main > *:nth-child(2) {
  animation-delay: 0.08s;
}
.hero-main > *:nth-child(3) {
  animation-delay: 0.16s;
}
.hero-main > *:nth-child(4) {
  animation-delay: 0.24s;
}
.hero-main > *:nth-child(5) {
  animation-delay: 0.3s;
}
.eyebrow,
.section-label,
.hero-note,
.signal-grid,
.card-index,
.window-bar,
.footer,
.copy-label,
.map-panel,
.lane-caption,
.gate-label,
.chip {
  font-family: var(--mono);
}
.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.02em;
}
.eyebrow-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px var(--green-soft);
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1 {
  margin-top: 28px;
  font-size: clamp(46px, 5.6vw, 76px);
  line-height: 1;
  letter-spacing: -0.055em;
  font-weight: 600;
  text-wrap: balance;
}
h1 span {
  color: var(--muted);
}
.hero-copy {
  max-width: 540px;
  margin-top: 28px;
  color: #494f4b;
  font-size: 18px;
  line-height: 1.55;
  letter-spacing: -0.015em;
}
.hero-actions {
  display: flex;
  align-items: center;
  gap: 26px;
  margin-top: 36px;
}
.command {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  padding: 13px 15px 13px 17px;
  border: 1px solid var(--term-line);
  border-radius: 8px;
  background: var(--term-bg);
  color: #f6f8f5;
  cursor: pointer;
  box-shadow:
    0 1px 0 #ffffff17 inset,
    0 1px 2px rgba(23, 25, 24, 0.06);
  transition:
    background 0.18s var(--ease),
    transform 0.12s var(--ease);
}
.command:hover {
  background: #1e231f;
}
.command:active {
  transform: scale(0.985);
}
.command code {
  font: 13px var(--mono);
}
.prompt {
  color: var(--term-green);
  font: 13px var(--mono);
}
.copy-label {
  border-left: 1px solid #3c433e;
  padding-left: 13px;
  color: #a9b0ab;
  font-size: 11px;
  min-width: 72px; /* sized to the wider "copied ✓" state */
  text-align: left;
  transition: color 0.18s var(--ease);
}
.command.is-copied .copy-label {
  color: var(--term-green);
  animation: pop 0.35s var(--ease);
}
.text-link {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  color: var(--ink);
  font: 12px var(--mono);
  border-bottom: 1px solid currentColor;
  padding-bottom: 4px;
}
.hero-note {
  margin-top: 18px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.01em;
}

/* ---- hero: the inheritance panel ---- */
.map-panel {
  position: relative;
  border: 1px solid var(--line-strong);
  background: #fff;
  animation: rise 0.65s 0.28s var(--ease) both;
}
.map-title {
  position: absolute;
  top: -8px;
  left: 14px;
  padding: 0 8px;
  background: #fff;
  color: var(--green-dark);
  font-size: 10px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}
.map-head {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  padding: 16px 16px 10px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 9.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.map-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  animation: fade 0.5s var(--ease) both;
  animation-delay: calc(0.5s + var(--i) * 0.14s);
}
.map-row + .map-row {
  border-top: 1px solid var(--line);
}
.map-from {
  font-size: 12px;
  color: var(--ink);
  font-weight: 500;
  white-space: nowrap;
}
.map-line {
  position: relative;
  height: 1px;
  min-width: 24px;
  background: var(--line-strong);
  transform-origin: left;
  animation: grow-x 0.5s var(--ease) both;
  animation-delay: calc(0.62s + var(--i) * 0.14s);
}
.map-line::after {
  content: "";
  position: absolute;
  right: -1px;
  top: -2.5px;
  border-left: 5px solid var(--line-strong);
  border-top: 3px solid transparent;
  border-bottom: 3px solid transparent;
  animation: fade 0.3s var(--ease) both;
  animation-delay: calc(0.95s + var(--i) * 0.14s);
}
.map-to {
  font-family: Geist, Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 13px;
  color: var(--green-dark);
  white-space: nowrap;
}

/* ---- signal band ---- */
.signal-band {
  background: var(--soft);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.signal-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  padding: 16px 0;
  color: var(--band-text);
  font-size: 11.5px;
  letter-spacing: 0.02em;
}
.signal-grid em {
  font-style: normal;
  color: var(--green-dark);
  margin-right: 8px;
}
.signal-grid span:not(:first-child) {
  border-left: 1px solid var(--line-strong);
  padding-left: 22px;
}

/* ---- sections ---- */
.section {
  padding: 118px 0;
}
.section-bordered,
.code-section,
.closing,
.footer {
  border-top: 1px solid var(--line);
}
.section-intro {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: end;
}
.section-intro.compact {
  align-items: end;
}
.section-label {
  color: var(--green-dark);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
h2 {
  margin-top: 18px;
  font-size: clamp(36px, 4.4vw, 56px);
  line-height: 1.02;
  letter-spacing: -0.045em;
  font-weight: 600;
  text-wrap: balance;
}
.section-intro > p:last-child,
.code-copy > p:not(.section-label) {
  max-width: 440px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.6;
  align-self: end;
}

/* ---- thesis: three clients, one gate ---- */
.lanes {
  display: grid;
  grid-template-columns:
    minmax(170px, 230px) 1fr minmax(150px, 180px)
    1fr minmax(170px, 220px);
  grid-template-rows: repeat(3, minmax(72px, auto));
  gap: 12px 0;
  align-items: center;
  margin-top: 68px;
}
.client {
  grid-column: 1;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 14px 16px;
  border: 1px solid var(--line-strong);
  background: #fff;
  transition: border-color 0.2s var(--ease);
}
.client:hover {
  border-color: var(--ink);
}
.client strong {
  font-size: 15px;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 8px;
}
.client > span,
.app-node > span {
  color: var(--muted);
  font: 10.5px var(--mono);
}
.client-agent {
  border-color: #7ec69d;
  background: linear-gradient(180deg, #fff 0%, var(--green-soft) 140%);
}
.client-agent:hover {
  border-color: var(--green);
}
.chip {
  padding: 2px 6px;
  border-radius: 100px;
  background: var(--green-soft);
  color: var(--green-dark);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.conn {
  position: relative;
  grid-column: 2;
  height: 1px;
}
.conn::before {
  content: "";
  position: absolute;
  inset: 0;
  border-top: 1px dashed var(--line-strong);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.6s var(--ease);
  transition-delay: calc(0.15s + var(--i, 0) * 0.15s);
}
.conn::after {
  content: "";
  position: absolute;
  right: 0;
  top: -2.5px;
  border-left: 5px solid var(--line-strong);
  border-top: 3px solid transparent;
  border-bottom: 3px solid transparent;
  opacity: 0;
  transition: opacity 0.3s var(--ease);
  transition-delay: calc(0.6s + var(--i, 0) * 0.15s);
}
.lanes.is-in .conn::before {
  transform: scaleX(1);
}
.lanes.is-in .conn::after {
  opacity: 1;
}
.conn-agent::before {
  border-top: 1px solid var(--green);
}
.conn-agent::after {
  border-left-color: var(--green);
}
.gate {
  grid-column: 3;
  grid-row: 1 / -1;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 18px 12px;
  border: 1px solid var(--ink);
  background: #fff;
  text-align: center;
}
.gate-label {
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.gate strong {
  font-size: 13.5px;
  letter-spacing: -0.02em;
}
.conn-out {
  grid-column: 4;
  grid-row: 2;
  --i: 3;
}
.conn-out::before {
  border-top-style: solid;
  border-top-color: var(--ink);
}
.conn-out::after {
  border-left-color: var(--ink);
}
.app-node {
  grid-column: 5;
  grid-row: 1 / -1;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 18px 16px;
  border: 1px solid var(--line-strong);
  background: var(--soft);
  text-align: center;
}
.app-node strong {
  font-size: 16px;
  letter-spacing: -0.02em;
}
.lane-caption {
  margin-top: 26px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.01em;
}

/* ---- code section ---- */
.code-section {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 80px;
  align-items: center;
  padding: 116px 0;
}
.code-copy h2 {
  margin: 18px 0 22px;
}
.code-copy .text-link {
  margin-top: 28px;
}
.code-window {
  overflow: hidden;
  border: 1px solid #2f352f;
  border-radius: 10px;
  background: var(--term-bg);
  box-shadow:
    0 1px 0 #ffffff12 inset,
    0 1px 2px rgba(23, 25, 24, 0.06);
}
.window-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 15px;
  border-bottom: 1px solid var(--term-line);
  color: #7d867f;
  font-size: 10px;
}
.window-bar .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1px solid #4a524c;
}
.window-bar .tab {
  margin-left: 8px;
  padding: 12px 4px 10px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: none;
  color: #7d867f;
  font: 10.5px var(--mono);
  letter-spacing: 0.04em;
  cursor: pointer;
  transition:
    color 0.18s var(--ease),
    border-color 0.18s var(--ease);
}
.window-bar .tab:hover {
  color: var(--term-text);
}
.window-bar .tab.is-active {
  color: var(--term-text);
  border-bottom-color: var(--term-green);
}
.pane {
  margin: 0;
  padding: 24px 26px 28px;
  color: var(--term-text);
  font: 12.5px/1.7 var(--mono);
  white-space: pre-wrap;
  overflow-x: auto;
}
.nb {
  white-space: nowrap;
}
.code-line {
  display: block;
}
/* line cascade – replays each time a pane is shown */
html.js .pane .code-line {
  animation: fade 0.3s var(--ease) both;
}
html.js .pane .code-line:nth-child(1) {
  animation-delay: 0.03s;
}
html.js .pane .code-line:nth-child(2) {
  animation-delay: 0.06s;
}
html.js .pane .code-line:nth-child(3) {
  animation-delay: 0.09s;
}
html.js .pane .code-line:nth-child(4) {
  animation-delay: 0.12s;
}
html.js .pane .code-line:nth-child(5) {
  animation-delay: 0.15s;
}
html.js .pane .code-line:nth-child(6) {
  animation-delay: 0.18s;
}
html.js .pane .code-line:nth-child(7) {
  animation-delay: 0.21s;
}
html.js .pane .code-line:nth-child(8) {
  animation-delay: 0.24s;
}
html.js .pane .code-line:nth-child(9) {
  animation-delay: 0.27s;
}
html.js .pane .code-line:nth-child(10) {
  animation-delay: 0.3s;
}
html.js .pane .code-line:nth-child(11) {
  animation-delay: 0.33s;
}
html.js .pane .code-line:nth-child(12) {
  animation-delay: 0.36s;
}
html.js .pane .code-line:nth-child(13) {
  animation-delay: 0.39s;
}
html.js .pane .code-line:nth-child(14) {
  animation-delay: 0.42s;
}
html.js .pane .code-line:nth-child(15) {
  animation-delay: 0.45s;
}
html.js .pane .code-line:nth-child(16) {
  animation-delay: 0.48s;
}
html.js .pane .code-line:nth-child(17) {
  animation-delay: 0.51s;
}
html.js .pane .code-line:nth-child(18) {
  animation-delay: 0.54s;
}
.tok-c {
  color: var(--term-comment);
}
.tok-k {
  color: #a3c4b0;
}
.tok-s,
.tok-p,
.tok-ok {
  color: var(--term-green);
}

/* ---- production grid ---- */
.prod-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin-top: 76px;
  background: var(--line);
  border: 1px solid var(--line);
}
.prod-card {
  position: relative;
  min-height: 185px;
  display: flex;
  flex-direction: column;
  padding: 22px;
  background: var(--bg);
  transition: background 0.25s var(--ease);
}
.prod-card::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 2px;
  background: var(--green);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.32s var(--ease);
}
.prod-card:hover {
  background: #fff;
}
.prod-card:hover::after {
  transform: scaleX(1);
}
.prod-card:hover .card-index {
  color: var(--green-dark);
}
.card-index {
  color: var(--muted);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  transition: color 0.2s var(--ease);
}
.prod-card h3 {
  margin-top: auto;
  padding-top: 22px;
  font-size: 18px;
  line-height: 1.15;
  letter-spacing: -0.025em;
}
.prod-card p {
  margin-top: 10px;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.55;
}
.prod-card code {
  font: 12px var(--mono);
  color: var(--green-dark);
}
/* staggered card entrance under the grid's reveal */
html.js .prod-grid.reveal .prod-card {
  opacity: 0;
  transform: translateY(10px);
  transition:
    opacity 0.55s var(--ease),
    transform 0.55s var(--ease),
    background 0.25s var(--ease);
  transition-delay: calc(var(--i) * 0.07s);
}
html.js .prod-grid.reveal.is-in .prod-card {
  opacity: 1;
  transform: none;
}

/* ---- closing ---- */
.closing {
  padding: 116px 0 124px;
  text-align: center;
}
.closing h2 {
  margin-top: 18px;
}
.closing-actions {
  display: flex;
  justify-content: center;
  margin-top: 38px;
}
.closing-links {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 16px;
}
.button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 18px;
  border: 1px solid var(--ink);
  border-radius: 7px;
  font: 12px var(--mono);
  transition:
    background 0.18s var(--ease),
    border-color 0.18s var(--ease),
    transform 0.12s var(--ease);
}
.button:active {
  transform: scale(0.98);
}
.button-dark {
  background: var(--ink);
  color: #fff;
  box-shadow: 0 1px 0 #ffffff21 inset;
}
.button-dark:hover {
  background: #2b302c;
}
.button-light {
  border-color: var(--line-strong);
  background: #fff;
}
.button-light:hover {
  border-color: var(--ink);
}

/* ---- footer ---- */
.footer {
  padding: 26px 0 34px;
  color: var(--muted);
  font-size: 12px;
}
.footer-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.footer-bottom {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-top: 30px;
  color: var(--muted);
  line-height: 1.5;
}

/* ---- scroll reveal: JS-gated accent; content visible by default ---- */
html.js .reveal {
  opacity: 0;
  transform: translateY(14px);
  transition:
    opacity 0.7s var(--ease),
    transform 0.7s var(--ease);
}
html.js .reveal.is-in {
  opacity: 1;
  transform: none;
}
/* the lanes and prod grid handle their own inner motion */
html.js .lanes.reveal,
html.js .prod-grid.reveal {
  transform: none;
}

/* ---- docs ---- */
.nav-links .is-current {
  color: var(--ink);
}
.docs-layout {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 72px;
  align-items: start;
  padding: 56px 0 90px;
}
.docs-side {
  position: sticky;
  top: 96px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}
.side-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.side-label {
  margin-bottom: 8px;
  color: var(--green-dark);
  font: 500 10px var(--mono);
  letter-spacing: 0.09em;
  text-transform: uppercase;
}
.side-link {
  position: relative;
  padding: 6px 0 6px 14px;
  border-left: 1px solid var(--line);
  color: var(--muted);
  font: 12px/1.4 var(--mono);
  transition:
    color 0.18s var(--ease),
    border-color 0.18s var(--ease);
}
.side-link:hover {
  color: var(--ink);
  border-left-color: var(--line-strong);
}
.side-link.is-active {
  color: var(--green-dark);
  border-left-color: var(--green);
}
.docs-eyebrow {
  margin: 0 0 8px;
  color: var(--muted);
  font: 11px var(--mono);
  letter-spacing: 0.02em;
}
.docs-eyebrow code {
  font: inherit;
  color: var(--green-dark);
}
.doc {
  padding: 56px 0 64px;
}
.doc + .doc,
.doc:first-of-type {
  border-top: 1px solid var(--line);
}
.doc:first-of-type {
  margin-top: 18px;
}
.doc-kind {
  display: inline-block;
  padding: 3px 9px;
  border: 1px solid var(--line-strong);
  border-radius: 100px;
  background: #fff;
  color: var(--muted);
  font: 500 9.5px var(--mono);
  letter-spacing: 0.09em;
  text-transform: uppercase;
}
.doc h1 {
  margin-top: 16px;
  font-size: clamp(28px, 3vw, 36px);
  line-height: 1.08;
  letter-spacing: -0.035em;
  font-weight: 600;
  text-wrap: balance;
}
.doc-summary {
  max-width: 62ch;
  margin-top: 12px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.55;
}
.doc-body {
  margin-top: 26px;
  max-width: 68ch;
}
.doc-body p {
  margin: 0 0 14px;
  color: #3c423e;
  font-size: 15px;
  line-height: 1.7;
}
.doc-body ul {
  margin: 0 0 14px;
  padding-left: 0;
  list-style: none;
}
.doc-body li {
  position: relative;
  padding-left: 18px;
  margin-bottom: 6px;
  color: #3c423e;
  font-size: 15px;
  line-height: 1.7;
}
.doc-body li::before {
  content: "–";
  position: absolute;
  left: 0;
  color: var(--green-dark);
}
.doc-body code {
  padding: 1.5px 6px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--soft);
  font: 12.5px var(--mono);
  color: var(--ink);
  white-space: nowrap;
}
.doc-body a {
  color: var(--green-dark);
  border-bottom: 1px solid
    color-mix(in srgb, var(--green-dark) 40%, transparent);
  transition: border-color 0.18s var(--ease);
}
.doc-body a:hover {
  border-bottom-color: var(--green-dark);
}
.doc-body h2,
.doc-body h3 {
  margin: 28px 0 10px;
  font-size: 17px;
  letter-spacing: -0.01em;
}
.doc-body .doc-code {
  margin: 14px 0;
  padding: 14px 16px;
  border: 1px solid var(--term-line);
  border-radius: 10px;
  background: var(--term-bg);
  overflow-x: auto;
}
.doc-body .doc-code code {
  padding: 0;
  border: 0;
  background: none;
  font: 12.5px/1.7 var(--mono);
  color: var(--term-text);
  white-space: pre;
}
.doc-table-wrap {
  margin: 14px 0;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.doc-table-wrap table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  line-height: 1.55;
}
.doc-table-wrap th,
.doc-table-wrap td {
  padding: 10px 14px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}
.doc-table-wrap th {
  font: 600 11px var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--band-text);
  background: var(--soft);
}
.doc-table-wrap tr:last-child td {
  border-bottom: 0;
}
.doc-table-wrap td code {
  white-space: nowrap;
}
.doc[id] {
  scroll-margin-top: 88px;
}

/* ---- responsive ---- */
@media (max-width: 1080px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 56px;
  }
  .map-panel {
    max-width: 520px;
  }
}
@media (max-width: 900px) {
  .lanes {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }
  .client,
  .gate,
  .app-node {
    align-self: stretch;
  }
  .client + .client {
    margin-top: 10px;
  }
  .conn {
    grid-column: auto;
    width: 1px;
    height: 28px;
    margin: 0 auto;
  }
  .conn::before {
    border-top: 0;
    border-left: 1px dashed var(--line-strong);
    transform: scaleY(0);
    transform-origin: top;
  }
  .lanes.is-in .conn::before {
    transform: scaleY(1);
  }
  .conn::after {
    right: -2.5px;
    top: auto;
    bottom: 0;
    border-left: 3px solid transparent;
    border-right: 3px solid transparent;
    border-top: 5px solid var(--line-strong);
    border-bottom: 0;
  }
  .conn-agent::before {
    border-left-style: solid;
    border-left-color: var(--green);
  }
  .conn-agent::after {
    border-top-color: var(--green);
  }
  .conn-out::before {
    border-left-style: solid;
    border-left-color: var(--ink);
  }
  .conn-out::after {
    border-top-color: var(--ink);
  }
  /* on mobile: show one connector into the gate and one out */
  .conn[style*="--i: 0"],
  .conn[style*="--i: 1"] {
    display: none;
  }
}
@media (max-width: 760px) {
  .container {
    width: min(calc(100% - 32px), var(--max));
  }
  .page-rails {
    display: none;
  }
  .crossed::before,
  .crossed::after {
    display: none;
  }
  .nav {
    height: 58px;
  }
  .version-badge {
    display: none;
  }
  .nav-links a:nth-child(-n + 2) {
    display: none;
  }
  .nav-links {
    gap: 16px;
    font-size: 11px;
  }
  .hero {
    padding: 80px 0 76px;
    gap: 48px;
  }
  h1 {
    font-size: clamp(42px, 12vw, 64px);
  }
  .hero-copy {
    font-size: 16.5px;
  }
  .hero-actions {
    align-items: flex-start;
    flex-direction: column;
    gap: 19px;
  }
  .map-panel {
    max-width: none;
  }
  .map-to {
    font-size: 12px;
  }
  .docs-layout {
    grid-template-columns: 1fr;
    gap: 34px;
    padding-top: 34px;
  }
  .docs-side {
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 20px 34px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--line);
  }
  .doc-body code {
    white-space: normal;
    overflow-wrap: anywhere;
  }
  .signal-grid {
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    line-height: 1.4;
  }
  .signal-grid span:nth-child(3) {
    border-left: 0;
    padding-left: 0;
  }
  .signal-grid span:nth-child(4) {
    padding-left: 14px;
  }
  .section {
    padding: 80px 0;
  }
  .section-intro,
  .code-section {
    grid-template-columns: 1fr;
    gap: 25px;
  }
  .lanes {
    margin-top: 42px;
  }
  .prod-grid {
    grid-template-columns: 1fr;
    margin-top: 46px;
  }
  .prod-card {
    min-height: 150px;
  }
  .code-section {
    gap: 45px;
    padding: 80px 0;
  }
  .pane {
    padding: 20px 18px 24px;
    font-size: 11.5px;
  }
  .closing {
    padding: 82px 0 90px;
  }
  .closing-links {
    flex-direction: column;
    align-items: stretch;
    margin: 16px auto 0;
    max-width: 280px;
  }
  .footer-bottom,
  .footer-top {
    align-items: flex-start;
    flex-direction: column;
    gap: 22px;
  }
  .footer-bottom {
    gap: 8px;
    margin-top: 28px;
  }
}

/* ---- reduced motion: everything lands instantly ---- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .hero-main > *,
  .map-panel,
  .map-row,
  .map-line,
  .map-line::after,
  html.js .pane .code-line {
    animation: none;
  }
  html.js .reveal,
  html.js .prod-grid.reveal .prod-card {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .conn::before,
  .conn::after {
    transform: none !important;
    opacity: 1 !important;
    transition: none;
  }
  .arrow,
  .command,
  .button,
  .prod-card::after,
  .nav-wrap {
    transition: none;
  }
  .command.is-copied .copy-label {
    animation: none;
  }
}
