:root {
  --bg: #fbfbf9;
  --surface: #ffffff;
  --ink: #0b0f0d;
  --ink-2: #3c4642;
  --ink-3: #6b7671;
  --line: #e3e6e2;
  --line-strong: #cfd4cf;
  --accent: #1fbf6a;
  --accent-ink: #0b7a42;
  --accent-soft: #e6f8ee;
  --night: #0a0d0c;
  --night-2: #121715;
  --night-line: #1f2724;
  --night-line-strong: #2c3632;
  --night-ink: #e8ece9;
  --night-ink-2: #98a39e;
  --shell: 78rem;
  --pad: clamp(1.25rem, 3vw, 2.5rem);
  --display: 'Bricolage Grotesque', ui-sans-serif, sans-serif;
  --sans: 'Instrument Sans', ui-sans-serif, sans-serif;
  --mono: 'Geist Mono', ui-monospace, 'SF Mono', monospace;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 1rem/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

img {
  display: block;
}

code,
pre,
kbd {
  font-family: var(--mono);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ─── Frame: full-width rows + bordered center column ───────────────────── */

.band {
  position: relative;
  overflow-x: clip;
  border-bottom: 1px solid var(--line);
}

.shell {
  position: relative;
  max-width: var(--shell);
  margin: 0 auto;
  border-inline: 1px solid var(--line);
}

.band > .shell::before,
.band > .shell::after {
  content: '';
  position: absolute;
  bottom: -5px;
  width: 9px;
  height: 9px;
  z-index: 2;
  background:
    linear-gradient(var(--ink-3), var(--ink-3)) center / 1px 100% no-repeat,
    linear-gradient(var(--ink-3), var(--ink-3)) center / 100% 1px no-repeat;
  pointer-events: none;
}

.band > .shell::before {
  left: -5px;
}

.band > .shell::after {
  right: -5px;
}

.pad {
  padding: var(--pad);
}

.spacer {
  height: 3rem;
}

.spacer > .shell {
  height: 100%;
  background: repeating-linear-gradient(
    -45deg,
    transparent 0 6px,
    var(--line) 6px 7px
  );
}

/* ─── Header ────────────────────────────────────────────────────────────── */

.band--header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(12px);
}

.header {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  height: 4rem;
  padding-inline: var(--pad);
}

.brand {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 0.625rem;
  min-width: 0;
  text-decoration: none;
  font: 600 0.95rem/1 var(--display);
  letter-spacing: -0.01em;
}

.brand span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand img {
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  border: 1px solid var(--line-strong);
}

.nav {
  display: flex;
  flex: 1;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-left: 0.5rem;
  min-width: 0;
}

.nav a {
  padding: 0.375rem 0.625rem;
  border-radius: 6px;
  font-size: 0.875rem;
  color: var(--ink-2);
  text-decoration: none;
}

.nav a:hover {
  color: var(--ink);
  background: rgb(0 0 0 / 0.04);
}

.nav a[aria-current='page'] {
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--line-strong);
  background: var(--surface);
}

.header__actions {
  display: flex;
  flex: none;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
}

.menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  height: 2rem;
  min-width: 2rem;
  padding: 0 0.55rem;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: var(--surface);
  color: var(--ink);
  font: 500 0.72rem/1 var(--mono);
  cursor: pointer;
}

.menu-btn[aria-expanded='true'] {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

.mobile-nav {
  display: none;
  border-top: 1px solid var(--line);
  background: var(--bg);
}

.mobile-nav[hidden] {
  display: none !important;
}

.mobile-nav nav {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.25rem;
  padding: 0.5rem;
}

.mobile-nav a {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 2.25rem;
  padding: 0.4rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--ink-2);
  font-size: 0.8rem;
  text-align: center;
  text-decoration: none;
}

.mobile-nav a:hover,
.mobile-nav a:active {
  border-color: var(--line-strong);
  color: var(--ink);
}

.mobile-nav a[aria-current='page'] {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-weight: 600;
}

/* ─── Buttons & badges ──────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  height: 2.5rem;
  padding: 0 1rem;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font: 500 0.9rem/1 var(--sans);
  text-decoration: none;
  white-space: nowrap;
  transition:
    border-color 0.15s,
    background 0.15s,
    transform 0.15s;
}

.btn:hover {
  border-color: var(--ink-3);
}

.btn:active {
  transform: translateY(1px);
}

.btn--dark {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 0.15),
    0 1px 2px rgb(0 0 0 / 0.2);
}

.btn--dark:hover {
  border-color: var(--ink);
  background: #1d2420;
}

.btn--sm {
  height: 2rem;
  padding: 0 0.75rem;
  font-size: 0.825rem;
}

.btn .arrow {
  font-family: var(--mono);
  transition: transform 0.15s;
}

.btn:hover .arrow {
  transform: translateX(2px);
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0.75rem 0.25rem 0.375rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  font: 500 0.8rem/1.4 var(--sans);
  color: var(--ink-2);
  text-decoration: none;
}

.pill b {
  padding: 0.0625rem 0.5rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font: 500 0.72rem/1.5 var(--mono);
}

.label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font: 500 0.75rem/1 var(--mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.label::before {
  content: '';
  width: 6px;
  height: 6px;
  background: var(--accent);
}

/* ─── Hero ──────────────────────────────────────────────────────────────── */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  overflow: hidden;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 48px 48px;
  background-position: -1px -1px;
}

.hero__mesh {
  position: absolute;
  inset: -30% -20% auto auto;
  width: 70%;
  aspect-ratio: 1;
  background:
    radial-gradient(circle at 30% 40%, #3ddc84 0, transparent 45%),
    radial-gradient(circle at 70% 30%, #00b3a4 0, transparent 40%),
    radial-gradient(circle at 55% 70%, #c6f432 0, transparent 38%);
  filter: blur(60px);
  opacity: 0.45;
  pointer-events: none;
}

.hero__copy {
  position: relative;
  padding: clamp(3rem, 7vw, 6rem) var(--pad);
  background: linear-gradient(90deg, var(--bg) 55%, transparent);
}

.hero h1 {
  margin: 1.5rem 0 1.25rem;
  font: 700 clamp(2.6rem, 5.6vw, 4.6rem) / 0.98 var(--display);
  letter-spacing: -0.045em;
}

.hero h1 em {
  font-style: normal;
  background: linear-gradient(100deg, var(--accent-ink), #00a397 60%, #6fb800);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero__lead {
  max-width: 34rem;
  margin: 0 0 2rem;
  font-size: 1.125rem;
  color: var(--ink-2);
}

.hero__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.hero__panel {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1rem;
  min-width: 0;
  padding: var(--pad);
  border-left: 1px solid var(--line);
}

.hero__panel .code {
  background: color-mix(in srgb, var(--night) 94%, transparent);
  backdrop-filter: blur(6px);
}

/* ─── Stats strip ───────────────────────────────────────────────────────── */

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}

.stat {
  padding: 1.5rem var(--pad);
  border-right: 1px solid var(--line);
}

.stat:last-child {
  border-right: 0;
}

.stat strong {
  display: block;
  font: 600 1.75rem/1.1 var(--display);
  letter-spacing: -0.03em;
}

.stat span {
  font: 400 0.8rem/1.4 var(--mono);
  color: var(--ink-3);
}

/* ─── Section heads ─────────────────────────────────────────────────────── */

.section-head {
  display: grid;
  grid-template-columns: minmax(12rem, 0.4fr) minmax(0, 1fr);
  border-bottom: 1px solid var(--line);
}

.section-head > div {
  padding: 2.5rem var(--pad);
}

.section-head > div:first-child {
  border-right: 1px solid var(--line);
}

.section-head h2 {
  margin: 0 0 0.75rem;
  font: 650 clamp(1.75rem, 3.2vw, 2.5rem) / 1.05 var(--display);
  letter-spacing: -0.035em;
}

.section-head p {
  max-width: 40rem;
  margin: 0;
  color: var(--ink-2);
}

/* ─── Feature grid (shared borders) ─────────────────────────────────────── */

.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid--2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.cell {
  position: relative;
  padding: 2rem var(--pad);
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  transition: background 0.2s;
}

.grid > .cell:nth-child(3n) {
  border-right: 0;
}

.grid--2 > .cell:nth-child(3n) {
  border-right: 1px solid var(--line);
}

.grid--2 > .cell:nth-child(2n) {
  border-right: 0;
}

.grid > .cell:nth-last-child(-n + 3):nth-child(3n + 1),
.grid > .cell:nth-last-child(-n + 3):nth-child(3n + 1) ~ .cell {
  border-bottom: 0;
}

.grid--2 > .cell:nth-last-child(-n + 2):nth-child(2n + 1),
.grid--2 > .cell:nth-last-child(-n + 2):nth-child(2n + 1) ~ .cell {
  border-bottom: 0;
}

.cell:hover {
  background: var(--surface);
}

.cell__num {
  display: block;
  margin-bottom: 2.5rem;
  font: 500 0.75rem/1 var(--mono);
  color: var(--ink-3);
}

.cell h3 {
  margin: 0 0 0.5rem;
  font: 600 1.15rem/1.25 var(--display);
  letter-spacing: -0.02em;
}

.cell p {
  margin: 0;
  font-size: 0.925rem;
  color: var(--ink-2);
}

.cell :not(pre) > code {
  overflow-wrap: anywhere;
  font-size: 0.82em;
  padding: 0.05em 0.35em;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface);
}

.cell .tag {
  position: absolute;
  top: 1.75rem;
  right: var(--pad);
  padding: 0.125rem 0.5rem;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  font: 500 0.7rem/1.5 var(--mono);
  color: var(--ink-3);
  background: var(--surface);
}

.cell .tag--accent {
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  background: var(--accent-soft);
  color: var(--accent-ink);
}

.cell .code {
  margin-top: 1.25rem;
}

.cell__link {
  display: inline-flex;
  gap: 0.375rem;
  margin-top: 1.25rem;
  font: 500 0.8rem/1 var(--mono);
  color: var(--accent-ink);
  text-decoration: none;
}

.cell__link span {
  transition: transform 0.15s;
}

.cell__link:hover span {
  transform: translateX(3px);
}

/* ─── Split ─────────────────────────────────────────────────────────────── */

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
}

.split > * {
  padding: 2.5rem var(--pad);
}

.split > :first-child {
  border-right: 1px solid var(--line);
}

.split h2 {
  margin: 1rem 0 0.75rem;
  font: 650 clamp(1.75rem, 3.2vw, 2.4rem) / 1.05 var(--display);
  letter-spacing: -0.035em;
}

.split p {
  color: var(--ink-2);
}

.checks {
  margin: 1.5rem 0 0;
  padding: 0;
  list-style: none;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}

.checks li {
  position: relative;
  padding: 0.75rem 1rem 0.75rem 2.5rem;
  font-size: 0.925rem;
  border-bottom: 1px solid var(--line);
}

.checks li:last-child {
  border-bottom: 0;
}

.checks li::before {
  content: '→';
  position: absolute;
  left: 1rem;
  font-family: var(--mono);
  color: var(--accent-ink);
}

.checks code {
  overflow-wrap: anywhere;
}

/* ─── Code blocks ───────────────────────────────────────────────────────── */

.code {
  overflow: hidden;
  border: 1px solid var(--night-line-strong);
  border-radius: 12px;
  background: var(--night);
  box-shadow:
    0 0 0 4px rgb(0 0 0 / 0.03),
    0 20px 40px -24px rgb(0 0 0 / 0.45);
}

.code__bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  height: 2.5rem;
  padding: 0 0.5rem 0 1rem;
  border-bottom: 1px solid var(--night-line);
  background: var(--night-2);
  font: 400 0.75rem/1 var(--mono);
  color: var(--night-ink-2);
}

.code__bar::before {
  content: '';
  flex: none;
  width: 42px;
  height: 10px;
  background: radial-gradient(circle, #3a4440 4px, transparent 4.5px) 0 0 / 14px 10px
    repeat-x;
}

.code__bar span {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.code pre {
  margin: 0;
  padding: 1.125rem 1.25rem;
  overflow-x: auto;
  font-size: 0.825rem;
  line-height: 1.7;
  color: var(--night-ink);
}

.code pre code {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  color: inherit;
  font: inherit;
}

.code pre::-webkit-scrollbar {
  height: 8px;
}

.code pre::-webkit-scrollbar-thumb {
  border-radius: 8px;
  background: var(--night-line-strong);
}

.code pre::-webkit-scrollbar-track {
  background: transparent;
}

.code pre {
  scrollbar-color: var(--night-line-strong) transparent;
  scrollbar-width: thin;
}

.code .c {
  color: #66726d;
}

.code .k {
  color: #7ee2a8;
}

.code .s {
  color: #f2d68a;
}

.code .f {
  color: #8cc8ff;
}

.code .n {
  color: #ffb38a;
}

.filter {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1rem 0;
  padding: 0 0.875rem;
  height: 2.75rem;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--surface);
}

.filter:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.filter input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font: 400 0.95rem/1 var(--sans);
  color: var(--ink);
}

.filter span {
  font: 500 0.75rem/1 var(--mono);
  color: var(--ink-3);
  white-space: nowrap;
}

.table tr[hidden] {
  display: none;
}

.toc {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0 0 2.5rem;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface);
}

.toc a {
  display: flex;
  gap: 0.625rem;
  padding: 0.875rem 1rem;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  font-size: 0.9rem;
  color: var(--ink) !important;
  text-decoration: none;
}

.toc a:nth-child(3n) {
  border-right: 0;
}

.toc a:hover {
  background: var(--bg);
}

.toc a span {
  font: 500 0.75rem/1.6 var(--mono);
  color: var(--ink-3);
}

.toc a:nth-last-child(-n + 3):nth-child(3n + 1),
.toc a:nth-last-child(-n + 3):nth-child(3n + 1) ~ a {
  border-bottom: 0;
}

.prose h2 a.anchor {
  margin-left: auto;
  font: 400 0.9rem/1 var(--mono);
  color: var(--line-strong);
  text-decoration: none;
}

.prose h2:hover a.anchor {
  color: var(--ink-3);
}

.copy {
  flex: none;
  height: 1.75rem;
  padding: 0 0.625rem;
  border: 1px solid var(--night-line-strong);
  border-radius: 6px;
  background: transparent;
  color: var(--night-ink-2);
  font: 500 0.72rem/1 var(--mono);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.copy:hover {
  color: var(--night-ink);
  border-color: #46524d;
}

.copy[data-copied] {
  color: #7ee2a8;
  border-color: #2f6b48;
}

/* ─── Tabs ──────────────────────────────────────────────────────────────── */

.tabs__list {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin-bottom: 0.75rem;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: var(--surface);
  width: fit-content;
  overflow: hidden;
}

.tabs__list button {
  height: 2.125rem;
  padding: 0 0.875rem;
  border: 0;
  border-right: 1px solid var(--line);
  background: transparent;
  font: 500 0.8rem/1 var(--mono);
  color: var(--ink-3);
  cursor: pointer;
}

.tabs__list button:last-child {
  border-right: 0;
}

.tabs__list button[aria-selected='true'] {
  background: var(--ink);
  color: #fff;
}

.tabs__panel[hidden] {
  display: none;
}

/* ─── Dark band (agents) ────────────────────────────────────────────────── */

.band--night {
  background: var(--night);
  color: var(--night-ink);
  border-bottom-color: var(--night-line);
}

.band--night > .shell {
  border-color: var(--night-line);
}

.band--night > .shell::before,
.band--night > .shell::after {
  background:
    linear-gradient(#56625d, #56625d) center / 1px 100% no-repeat,
    linear-gradient(#56625d, #56625d) center / 100% 1px no-repeat;
}

.band--night .section-head,
.band--night .section-head > div:first-child,
.band--night .cell,
.band--night .grid--2 > .cell:nth-child(3n) {
  border-color: var(--night-line);
}

.band--night .section-head {
  background:
    radial-gradient(60% 120% at 100% 0%, rgb(31 191 106 / 0.18), transparent 60%),
    var(--night);
}

.band--night .section-head p,
.band--night .cell p {
  color: var(--night-ink-2);
}

.band--night .label {
  color: var(--night-ink-2);
}

.band--night .cell {
  background: var(--night);
}

.band--night .cell:hover {
  background: var(--night-2);
}

.band--night .cell__num {
  color: #56625d;
}

.band--night .cell :not(pre) > code {
  border-color: var(--night-line-strong);
  background: var(--night-2);
  color: var(--night-ink);
}

.band--night .cell .tag {
  border-color: var(--night-line-strong);
  background: var(--night-2);
  color: var(--night-ink-2);
}

.band--night .cell .tag--accent {
  border-color: #2f6b48;
  background: rgb(31 191 106 / 0.12);
  color: #7ee2a8;
}

.band--night .tabs__list {
  border-color: var(--night-line-strong);
  background: var(--night-2);
}

.band--night .tabs__list button {
  border-color: var(--night-line-strong);
  color: var(--night-ink-2);
}

.band--night .tabs__list button[aria-selected='true'] {
  background: var(--night-ink);
  color: var(--night);
}

.band--night .code {
  border-color: var(--night-line-strong);
  background: #060807;
  box-shadow: none;
}

.band--night a {
  color: #7ee2a8;
}

.prompt {
  position: relative;
  margin: 0;
  padding: 1.25rem 1.25rem 1.25rem 1.5rem;
  border: 1px dashed #2f6b48;
  border-radius: 12px;
  background: rgb(31 191 106 / 0.06);
  font: 400 0.9rem/1.65 var(--sans);
  color: var(--night-ink);
  overflow-wrap: anywhere;
}

.prompt code {
  font-size: 0.85em;
}

.prompt-wrap {
  display: grid;
  gap: 0.75rem;
}

.prompt-wrap .copy {
  justify-self: start;
}

.paths {
  width: 100%;
  margin-top: 1.25rem;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.paths td {
  padding: 0.625rem 0;
  border-top: 1px solid var(--night-line);
  vertical-align: top;
}

.paths td:first-child {
  width: 8.5rem;
  color: var(--night-ink-2);
}

.paths code {
  overflow-wrap: anywhere;
  border: 0 !important;
  background: none !important;
  padding: 0 !important;
}

/* ─── CTA ───────────────────────────────────────────────────────────────── */

.cta {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 2rem;
  padding: 3.5rem var(--pad);
  background:
    radial-gradient(50% 140% at 0% 100%, rgb(31 191 106 / 0.12), transparent 70%),
    var(--bg);
}

.cta h2 {
  margin: 0;
  font: 650 clamp(1.75rem, 3.6vw, 2.75rem) / 1.05 var(--display);
  letter-spacing: -0.04em;
}

.cta p {
  margin: 0.5rem 0 0;
  color: var(--ink-2);
}

/* ─── Footer ────────────────────────────────────────────────────────────── */

.footer {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, 1fr);
}

.footer > div {
  padding: 2rem var(--pad);
  border-right: 1px solid var(--line);
}

.footer > div:last-child {
  border-right: 0;
}

.footer h4 {
  margin: 0 0 0.75rem;
  font: 500 0.72rem/1 var(--mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.footer ul {
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.875rem;
}

.footer li + li {
  margin-top: 0.375rem;
}

.footer a {
  color: var(--ink-2);
  text-decoration: none;
}

.footer a:hover {
  color: var(--ink);
}

.footer p {
  margin: 0.75rem 0 0;
  font-size: 0.85rem;
  color: var(--ink-3);
}

/* ─── Docs pages ────────────────────────────────────────────────────────── */

.page-head {
  padding: 3.5rem var(--pad) 2.5rem;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 48px 48px;
  background-position: -1px -1px;
}

.page-head h1 {
  margin: 1rem 0 0.75rem;
  font: 700 clamp(2.25rem, 4.6vw, 3.5rem) / 1 var(--display);
  letter-spacing: -0.045em;
}

.page-head p {
  max-width: 42rem;
  margin: 0;
  padding: 0.25rem 0;
  font-size: 1.075rem;
  color: var(--ink-2);
  background: var(--bg);
  width: fit-content;
}

.docs {
  display: grid;
  grid-template-columns: 15rem minmax(0, 1fr);
}

.docs__nav {
  border-right: 1px solid var(--line);
}

.docs__nav nav {
  position: sticky;
  top: 4rem;
  max-height: calc(100vh - 4rem);
  overflow-y: auto;
  padding: 1.75rem 0;
  scrollbar-width: thin;
}

.docs__nav h4 {
  margin: 0 0 0.5rem;
  padding: 0 1.5rem;
  font: 500 0.72rem/1 var(--mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.docs__nav h4:not(:first-child) {
  margin-top: 1.75rem;
}

.docs__nav a {
  display: block;
  padding: 0.3rem 1.5rem;
  border-left: 2px solid transparent;
  margin-left: -1px;
  font-size: 0.875rem;
  color: var(--ink-2);
  text-decoration: none;
}

.docs__nav a:hover {
  color: var(--ink);
  border-left-color: var(--line-strong);
}

.docs__nav a[aria-current='page'] {
  color: var(--ink);
  font-weight: 600;
  border-left-color: var(--accent);
}

.prose {
  max-width: 62rem;
  padding: 2.5rem var(--pad) 4rem;
}

.prose > section {
  padding-bottom: 2.5rem;
  margin-bottom: 2.5rem;
  border-bottom: 1px dashed var(--line-strong);
}

.prose > section:last-child {
  border-bottom: 0;
  margin-bottom: 0;
}

.prose h2 {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  margin: 0 0 1rem;
  font: 650 1.6rem/1.15 var(--display);
  letter-spacing: -0.03em;
}

.prose h2 .step {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 1.75rem;
  height: 1.75rem;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface);
  font: 500 0.75rem/1 var(--mono);
  color: var(--ink-2);
  transform: translateY(-0.2em);
}

.prose h3 {
  margin: 1.75rem 0 0.5rem;
  font: 600 1.1rem/1.3 var(--display);
  letter-spacing: -0.015em;
}

.prose p,
.prose li {
  color: var(--ink-2);
}

.prose ol,
.prose ul {
  padding-left: 1.25rem;
}

.prose :not(pre) > code {
  overflow-wrap: anywhere;
  font-size: 0.85em;
  padding: 0.1em 0.35em;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface);
  color: var(--ink);
}

.prose .code {
  margin: 1rem 0;
}

.prose a {
  color: var(--accent-ink);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.callout {
  display: flex;
  gap: 0.875rem;
  margin: 1.25rem 0;
  padding: 1rem 1.125rem;
  border: 1px solid var(--line-strong);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  background: var(--surface);
  font-size: 0.925rem;
}

.callout strong {
  color: var(--ink);
}

.callout p {
  margin: 0;
}

.table {
  overflow-x: auto;
  margin: 1rem 0;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--surface);
}

.table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.table th,
.table td {
  padding: 0.7rem 1rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}

.table th + th,
.table td + td {
  border-left: 1px solid var(--line);
}

.table th {
  background: var(--bg);
  font: 500 0.72rem/1.4 var(--mono);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.table tr:last-child td {
  border-bottom: 0;
}

.table td code {
  overflow-wrap: anywhere;
}

.table td:last-child {
  min-width: 13rem;
}

.table td:first-child code,
.table--ids td:nth-child(2) code {
  white-space: nowrap;
  overflow-wrap: normal;
}

.cards {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  margin: 1.25rem 0;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface);
}

.cards > div {
  padding: 1.25rem;
}

.cards > div + div {
  border-top: 1px solid var(--line-strong);
}

.cards h3 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 0 0.5rem;
}

.cards p {
  margin: 0 0 0.75rem;
  font-size: 0.9rem;
}

.cards .code {
  margin: 0;
}

/* ─── Motion ────────────────────────────────────────────────────────────── */

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.rise {
  animation: rise 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) both;
  animation-delay: calc(var(--i, 0) * 90ms);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .rise {
    animation: none;
  }
}

/* ─── Responsive ────────────────────────────────────────────────────────── */

@media (max-width: 960px) {
  .hero,
  .split,
  .section-head {
    grid-template-columns: minmax(0, 1fr);
  }

  .hero__copy {
    background: linear-gradient(180deg, var(--bg) 70%, transparent);
  }

  .hero__panel {
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .split > :first-child,
  .section-head > div:first-child {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .band--night .section-head > div:first-child {
    border-color: var(--night-line);
  }

  .stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .stat:nth-child(2) {
    border-right: 0;
  }

  .stat:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .grid > .cell,
  .grid > .cell:nth-child(3n) {
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
  }

  .grid > .cell:nth-child(2n) {
    border-right: 0;
  }

  .band--night .grid > .cell {
    border-color: var(--night-line);
  }

  .docs {
    grid-template-columns: minmax(0, 1fr);
  }

  .docs__nav {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .docs__nav nav {
    position: static;
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    padding: 0.75rem var(--pad);
  }

  .docs__nav h4 {
    display: none;
  }

  .docs__nav a {
    padding: 0.25rem 0.625rem;
    border: 1px solid var(--line);
    border-radius: 6px;
    margin: 0;
  }

  .docs__nav a[aria-current='page'] {
    border-color: var(--accent);
  }

  .footer {
    grid-template-columns: 1fr 1fr;
  }

  .footer > div:nth-child(2n) {
    border-right: 0;
  }

  .footer > div:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }
}

/* iPad Mini and phones: collapse the primary nav into a menu */
@media (max-width: 900px) {
  .header {
    height: 3.25rem;
    gap: 0.625rem;
    padding-inline: 1rem;
  }

  .header__actions .btn--sm {
    height: 2rem;
    padding: 0 0.65rem;
    font-size: 0.8rem;
  }

  .nav {
    display: none;
  }

  .menu-btn {
    display: inline-flex;
  }

  .mobile-nav:not([hidden]) {
    display: block;
  }

  .header__actions .btn:not(.btn--dark) {
    display: none;
  }
}

@media (max-width: 640px) {
  .header {
    height: 3rem;
    padding-inline: 0.875rem;
  }

  .brand span {
    max-width: 11rem;
  }

  .mobile-nav nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .grid,
  .grid--2 {
    grid-template-columns: minmax(0, 1fr);
  }

  .toc {
    grid-template-columns: minmax(0, 1fr);
  }

  .toc a {
    border-right: 0 !important;
    border-bottom: 1px solid var(--line) !important;
  }

  .toc a:last-child {
    border-bottom: 0 !important;
  }

  .grid > .cell,
  .grid--2 > .cell {
    border-right: 0 !important;
    border-bottom: 1px solid var(--line) !important;
  }

  .band--night .grid > .cell {
    border-color: var(--night-line) !important;
  }

  .cta {
    grid-template-columns: minmax(0, 1fr);
  }

  .paths td:first-child {
    width: 6.5rem;
  }

  .hero__cta,
  .cta .hero__cta {
    width: 100%;
  }

  .hero__cta .btn,
  .cta .btn {
    flex: 1 1 auto;
    justify-content: center;
  }

  .tabs__list {
    width: 100%;
  }

  .tabs__list button {
    flex: 1;
  }
}

@media (max-width: 390px) {
  .brand span {
    max-width: 8.5rem;
  }
}
