:root {
  --graphite-50: #f8f7f4;
  --graphite-100: #ecebe8;
  --graphite-200: #d9d7d4;
  --graphite-300: #bfbdbb;
  --graphite-400: #a3a19f;
  --graphite-500: #878683;
  --graphite-600: #6d6c69;
  --graphite-700: #535250;
  --graphite-800: #3b3a38;
  --graphite-900: #1f1e1c;
  --bg: var(--graphite-900);
  --bg-2: color-mix(in srgb, var(--graphite-900) 60%, var(--graphite-800));
  --fg: var(--graphite-50);
  --fg-muted: var(--graphite-300);
  --fg-dim: var(--graphite-500);
  --ink: var(--graphite-900);
  --brand: #c2410c;
  --accent: #fb923c;
  --accent-fg: #ffffff;
  --cta: #fdba74;
  --cta-hover: #fb923c;
  --key: #fff7ed;
  --night: var(--graphite-900);
  --ok: #86b386;
  --border: color-mix(in srgb, var(--graphite-50) 16%, transparent);
  --line: color-mix(in srgb, var(--graphite-50) 7%, transparent);
  --wash: color-mix(in srgb, var(--graphite-50) 5%, transparent);
  --font: "Azeret Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --max: 1180px;
  --gutter: 24px;
  --nav-h: 62px;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --dur: 150ms;
}

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

html {
  color-scheme: dark;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  scroll-padding-top: calc(var(--nav-h) + 24px);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 500 13px/1.65 var(--font);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body.paper {
  background-image: radial-gradient(circle at 1px 1px, var(--line) 1px, transparent 0);
  background-size: 22px 22px;
}

body.paper::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  width: min(100%, var(--max));
  margin: 0 auto;
  border-inline: 1px solid var(--line);
  background: repeating-linear-gradient(to right, transparent 0 calc(100% / 6 - 1px), var(--line) calc(100% / 6 - 1px) calc(100% / 6));
  pointer-events: none;
}

a { color: var(--accent); text-underline-offset: 3px; text-decoration-thickness: 1px; }
img, svg { display: block; }
button { font: inherit; color: inherit; }
button, a, [role="tab"] { touch-action: manipulation; }
button, [role="tab"] { -webkit-user-select: none; user-select: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
::selection { background: var(--cta); color: var(--ink); }

.nowrap { white-space: nowrap; }
.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}
.skip {
  position: absolute; left: 12px; top: -48px; z-index: 20;
  padding: 8px 12px; background: var(--fg); color: var(--bg); text-decoration: none;
}
.skip:focus { top: 12px; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }

/* nav */
.nav { position: sticky; top: 0; z-index: 10; background: var(--bg-2); }
.nav::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -3px; height: 3px;
  background: radial-gradient(circle, var(--border) 1px, transparent 1.1px) 0 50% / 7px 3px repeat-x;
}
.nav .wrap { height: var(--nav-h); display: flex; align-items: center; gap: 28px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--fg); text-decoration: none; font-size: 17px; font-weight: 600; letter-spacing: -0.5px; }
.brand img { width: 26px; height: 26px; }
.nav-cc { display: flex; align-items: center; gap: 6px; margin-left: -12px; color: var(--fg-muted); font-size: 12px; white-space: nowrap; }
.cc-badge { display: inline-flex; flex: none; align-items: center; padding: 4px 7px; border-radius: 4px; background: var(--graphite-50); }
.cc-badge img { display: block; width: auto; }
.eyebrow-cc { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.nav-links { display: flex; align-items: center; gap: 22px; margin-right: auto; }
.nav-links a, .foot a { color: var(--fg); text-decoration: none; font-size: 12px; }
.nav-links a[aria-current="page"] { color: var(--accent); }
.nav-end { display: flex; gap: 8px; }
.stars { display: inline-block; min-width: 7ch; padding-left: 0.6ch; color: var(--fg-muted); font-variant-numeric: tabular-nums; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 36px; padding: 0 14px; border: 1px solid transparent;
  font: 600 12px/1 var(--font); text-decoration: none; cursor: pointer;
  color: var(--fg); background: var(--bg);
  transition: background-color var(--dur) ease, border-color var(--dur) ease, color var(--dur) ease, transform 160ms var(--ease-out);
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--fg); color: var(--bg); }
.btn-ghost { border-color: var(--border); }
.btn-cta { background: var(--cta); color: var(--ink); }
.btn-white { background: var(--bg); color: var(--accent); }

/* hero */
.hero { padding: 88px 0 40px; }
.eyebrow { margin: 0 0 18px; color: var(--accent); font-size: 12px; letter-spacing: 0.04em; }
.eyebrow-on { color: var(--key); }
h1, h2, h3 { font-weight: 500; margin: 0; text-wrap: balance; }
.display { font-size: 56px; line-height: 1.05; letter-spacing: -2px; max-width: 15.5em; }
.lede { max-width: 44em; margin: 22px 0 0; color: var(--fg-muted); font-size: 14px; line-height: 1.7; text-wrap: pretty; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 32px; }
.note { margin: 12px 0 0; color: var(--fg-muted); font-size: 12px; }

/* install choices */
.hero-key { max-width: 44em; margin: 22px 0 0; padding: 12px 14px; border: 1px solid var(--border); background: var(--bg-2); color: var(--fg); font-size: 14px; line-height: 1.6; }
.hero-key span { color: var(--accent); font-weight: 600; }
.hero-after { margin: 16px 0 0; }
.hero-after + .hero-actions { margin-top: 20px; }
.hero-install { max-width: 760px; margin-top: 32px; }
.hero-install .hero-actions { margin-top: 20px; }

@media (min-width: 1100px) {
  .hero-grid { --display: clamp(40px, 3.6vw, 44px); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: stretch; }
  .hero-text { padding-right: 56px; }
  .hero-grid .display { font-size: var(--display); letter-spacing: -1.5px; }
  .hero-grid .lede { max-width: none; }
  .hero-install { display: flex; flex-direction: column; max-width: none; margin-top: 0; padding-top: calc(12px * 1.65 + 18px + 0.182 * var(--display)); }
  .hero-install .install-panel pre { height: calc(5 * 1.7 * 12.5px + 32px); overflow-y: auto; white-space: pre-wrap; overflow-wrap: anywhere; }
}
.install { min-width: 0; }
.install-tabs { display: flex; flex-wrap: wrap; }
.install-tab { height: 44px; padding: 0 14px; border: 1px solid var(--border); border-bottom: 0; background: var(--bg); color: var(--fg-muted); font: 600 12px/1 var(--font); cursor: pointer; }
.install-tab + .install-tab { border-left: 0; }
.install-tab[aria-selected="true"] { background: var(--bg-2); color: var(--accent); }
.install .install-panel { margin: 0; }
.install .install-panel:not([hidden]) + .install-panel { margin-top: 12px; }
.install .code pre { font-size: 12.5px; }
.install .wrap-pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.band .install { color: var(--fg); }
.band .install-tab { border-color: color-mix(in srgb, #ffffff 45%, transparent); background: var(--brand); color: var(--accent-fg); }
.band .install-tab[aria-selected="true"] { background: var(--bg-2); color: var(--accent); }

/* copy button */
.copy {
  display: inline-grid; place-items: center; height: 28px; padding: 0 12px;
  border: 1px solid var(--border); background: var(--bg); cursor: pointer;
  font: 600 12px/1 var(--font); color: var(--fg);
  transition: border-color var(--dur) ease, color var(--dur) ease, transform 160ms var(--ease-out);
}
.copy:active { transform: scale(0.97); }
.copy > span { grid-area: 1 / 1; transition: opacity 200ms var(--ease-out), filter 200ms var(--ease-out), transform 200ms var(--ease-out); }
.copy-b { opacity: 0; filter: blur(2px); transform: scale(0.9); color: var(--ok); }
.copy[data-copied] .copy-a { opacity: 0; filter: blur(2px); transform: scale(0.9); }
.copy[data-copied] .copy-b { opacity: 1; filter: blur(0); transform: none; }
.copy[data-failed] .copy-b { color: var(--fg); }

/* figures */
.fig { margin: 0; border: 1px solid var(--border); background: var(--bg-2); min-width: 0; }
.fig-bar { display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 9px; border-bottom: 1px solid var(--border); background: var(--bg); color: var(--fg-muted); font-size: 12px; letter-spacing: 0.04em; white-space: nowrap; }
.fig-ico { display: grid; place-items: center; width: 24px; height: 24px; border: 1px solid var(--border); color: var(--fg); font-size: 12px; letter-spacing: 0; }
.fig-rule { flex: 1; min-width: 12px; height: 1px; background: var(--border); }
.fig-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.fig-body { padding: 28px; background-image: radial-gradient(circle at 1px 1px, var(--line) 1.2px, transparent 0); background-size: 26px 26px; }
.fig-cap { margin: 14px 0 0; max-width: 60em; color: var(--fg-muted); font-size: 12px; }
.hero-cap { margin-top: 40px; }
@media (min-width: 900px) { .hero-cap, .hero-after { max-width: calc(66.667% + 8px); } }
.hero-fig { margin-top: 14px; }

/* fig 1: what claude sees */
.demo { display: grid; gap: 18px; }
.demo-prompt { display: flex; gap: 14px; align-items: baseline; padding: 14px 16px; border: 1px solid var(--border); background: var(--bg); font-size: 14px; }
.demo-who { flex: none; color: var(--accent); }
.demo-line { display: grid; min-width: 0; }
.demo-line > * { grid-area: 1 / 1; }
.demo-ghost { visibility: hidden; }
.demo-sep { display: flex; align-items: center; gap: 12px; color: var(--fg-muted); font-size: 12px; }
.demo-sep::before, .demo-sep::after { content: ""; flex: 1; min-width: 16px; height: 1px; background: var(--border); }
.demo pre { margin: 0; padding: 18px 20px; border: 1px solid var(--border); background: var(--bg); font: 500 12.5px/1.7 var(--font); white-space: pre-wrap; overflow-wrap: anywhere; }
.demo-record { border-left: 2px solid var(--accent) !important; clip-path: inset(0 0 0 0); }
.demo .m { color: var(--fg-muted); }
.demo .h { color: var(--accent); }
.demo .t { color: var(--accent); }
.demo[data-play="typing"] .demo-type::after { content: ""; display: inline-block; width: 0.6em; height: 1.15em; margin-left: 2px; vertical-align: -0.2em; background: var(--accent); }
.demo[data-play="typing"] .demo-sep { opacity: 0; }
.demo[data-play="typing"] .demo-record { clip-path: inset(0 0 100% 0); }
.demo[data-play="typing"] .demo-recall { opacity: 0; transform: translateY(6px); }
.demo[data-play="reveal"] .demo-sep { transition: opacity 300ms var(--ease-out); }
.demo[data-play="reveal"] .demo-record { transition: clip-path 700ms var(--ease-out) 80ms; }
.demo[data-play="reveal"] .demo-recall { transition: opacity 400ms var(--ease-out) 560ms, transform 400ms var(--ease-out) 560ms; }

/* fig 7: memory layers */
.mem { display: grid; background-image: radial-gradient(circle at 1px 1px, var(--line) 1.2px, transparent 0); background-size: 26px 26px; }
.mem-tree, .mem-session { min-width: 0; padding: 24px 28px 28px; }
.mem-session { border-top: 1px solid var(--border); background: var(--bg); }
.mem-head { margin: 0 0 16px; color: var(--fg-muted); font-size: 12px; }
.mem-note { margin: 0 0 18px; color: var(--fg-muted); font-size: 12.5px; }
.tree, .tree ul { list-style: none; margin: 0; padding: 0; }
.tree ul { margin-left: 7px; }
.tree li { position: relative; padding: 0 0 10px 22px; }
.tree ul > li::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; border-left: 1px solid var(--border); }
.tree ul > li:last-child::before { bottom: auto; height: 11px; }
.tree ul > li::after { content: ""; position: absolute; left: 0; top: 11px; width: 14px; border-top: 1px solid var(--border); }
.tree > li { padding-left: 0; }
.tree .node { display: inline-block; margin-right: 10px; color: var(--fg); font-size: 12.5px; font-weight: 600; line-height: 22px; overflow-wrap: anywhere; }
.tree .what { color: var(--fg-muted); font-size: 12px; }
.tree .via { display: block; color: var(--accent); font-size: 12px; }
.tree .via::before { content: "→ "; }
.tree li.own > .node { padding: 0 6px; border-left: 2px solid var(--accent); background: var(--bg); }
.tree li.none > .node { color: var(--fg-muted); font-weight: 500; text-decoration: line-through; text-decoration-color: var(--fg-dim); }
.tree li.ext { margin-top: 6px; padding-top: 12px; border-top: 1px dashed var(--border); }
.edges { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.edges li { display: grid; gap: 4px; font-size: 12.5px; color: var(--fg-muted); }
.edges .edge { display: flex; align-items: center; color: var(--accent); font-size: 12px; font-weight: 600; }
.edges .edge::before { content: ""; order: -2; flex: 0 0 28px; height: 1px; background: var(--accent); }
.edges .edge::after { content: ""; order: -1; width: 0; height: 0; margin-right: 8px; border-left: 6px solid var(--accent); border-block: 4px solid transparent; }
.edges li.out .edge::after { order: -3; margin-right: 0; border-left: 0; border-right: 6px solid var(--accent); }
.edges li.out .edge::before { margin-right: 8px; }
.layers-cap { padding: 14px 28px; border-top: 1px solid var(--border); background: var(--bg); color: var(--fg-muted); font-size: 12px; }
@media (min-width: 1100px) {
  .mem { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
  .mem-session { border-top: 0; border-left: 1px solid var(--border); }
}

/* sections */
.section { padding: 72px 0; border-top: 1px solid var(--border); }
.h2 { font-size: 34px; line-height: 1.25; letter-spacing: -1.5px; max-width: 22em; }
.section .lede { margin-bottom: 36px; }

.compare { display: grid; grid-template-columns: 1fr 1fr; }
.compare > div { padding: 24px 26px 28px; }
.compare > div + div { border-left: 1px solid var(--border); }
.compare h3 { margin-bottom: 16px; font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--fg-muted); }
.compare .on h3 { color: var(--accent); }
.chat { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.chat li { padding: 10px 12px; border: 1px solid var(--line); background: var(--bg); font-size: 12.5px; }
.chat li::before { content: "you  "; color: var(--accent); white-space: pre; }
.compare p { margin: 16px 0 0; color: var(--fg-muted); font-size: 12.5px; }

/* feature rail */
.rail { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); border: 1px solid var(--border); background: var(--bg); }
.rail-list { display: flex; flex-direction: column; border-right: 1px solid var(--border); }
.rail-tab {
  display: grid; grid-template-columns: 34px 1fr; gap: 4px 6px; padding: 20px 22px; text-align: left;
  border: 0; border-bottom: 1px solid var(--line); background: var(--bg); cursor: pointer;
}
.rail-tab:last-child { border-bottom: 0; }
.rail-tab[aria-selected="true"] { background: linear-gradient(var(--line), var(--line)), var(--bg); }
.rail-num { grid-row: span 2; color: var(--accent); font-size: 12px; padding-top: 3px; }
.rail-title { font-size: 17px; font-weight: 600; letter-spacing: -0.4px; }
.rail-text { color: var(--fg-muted); font-size: 12.5px; font-weight: 500; }
.rail-panels { min-width: 0; }
.rail-panel { height: 100%; border: 0; }
.rail-panel .fig-body { height: calc(100% - 40px); }
.rail-panel pre { margin: 0; font: 500 12.5px/1.75 var(--font); white-space: pre-wrap; overflow-wrap: anywhere; }
.rail-panel .k { color: var(--accent); }
.rail-panel .c { color: var(--fg-muted); }
.rail-panel .say { margin: 18px 0 0; padding-top: 14px; border-top: 1px solid var(--border); color: var(--fg-muted); font-size: 12px; }

/* what monot leaves out */
.rules { list-style: none; margin: 0; padding: 0; counter-reset: rule; border: 1px solid var(--border); background: var(--bg); }
.rules li { display: grid; gap: 6px; padding: 16px 22px 18px; counter-increment: rule; }
.rules li + li { border-top: 1px solid var(--line); }
.rules b { display: flex; gap: 14px; font-size: 15px; font-weight: 600; }
.rules b::before { content: counter(rule, decimal-leading-zero); color: var(--accent); font-size: 12px; font-weight: 500; padding-top: 2px; }
.rules span { color: var(--fg-muted); font-size: 12.5px; }

/* stat cells */
.cells { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--border); background: var(--bg); }
.cell { padding: 22px 22px 26px; min-width: 0; }
.cell:not(:nth-child(3n + 1)) { border-left: 1px solid var(--border); }
.cell:nth-child(n + 4) { border-top: 1px solid var(--border); }
.cell b { display: block; margin-bottom: 10px; color: var(--accent); font-size: 22px; font-weight: 500; letter-spacing: -1px; overflow-wrap: anywhere; }
.cell span { color: var(--fg-muted); font-size: 12.5px; }

/* orange band */
.band {
  padding: 72px 0; color: var(--accent-fg);
  background: radial-gradient(circle at 1px 1px, color-mix(in srgb, #ffffff 22%, transparent) 1px, transparent 0) 0 0 / 22px 22px, var(--brand);
}
.band .wrap { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 48px; align-items: start; }
.band .h2 { color: var(--accent-fg); }
.band p { margin: 18px 0 0; max-width: 32em; color: var(--accent-fg); font-size: 13.5px; }
.band .hero-actions { margin-top: 28px; }
.band .fig { color: var(--fg); }

/* code blocks (docs and band) */
.code { margin: 20px 0; border: 1px solid var(--border); background: var(--bg-2); color: var(--fg); min-width: 0; }
.code-bar { display: flex; align-items: center; justify-content: space-between; height: 38px; padding: 0 5px 0 12px; border-bottom: 1px solid var(--border); background: var(--bg); color: var(--fg-muted); font-size: 12px; letter-spacing: 0.04em; }
.code pre { margin: 0; padding: 16px 18px; overflow-x: auto; font: 500 12.5px/1.7 var(--font); tab-size: 2; }
.code .c { color: var(--fg-muted); }
.code .k { color: var(--accent); }
.code .s { color: var(--ok); }

/* footer */
.foot { border-top: 1px solid var(--border); background: var(--bg); }
.foot .wrap { display: flex; flex-wrap: wrap; gap: 20px 40px; align-items: center; padding-top: 36px; padding-bottom: 40px; }
.foot-name { display: flex; align-items: center; gap: 12px; margin-right: auto; color: var(--fg-muted); font-size: 12px; }
.foot-name img { width: 22px; height: 22px; }
.foot-tm { flex-basis: 100%; margin: 0; color: var(--fg-muted); font-size: 12px; }
.foot nav { display: flex; flex-wrap: wrap; gap: 10px 22px; }

/* docs */
.docs-grid { display: grid; grid-template-columns: 220px minmax(0, 1fr) 200px; gap: 56px; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.side { position: sticky; top: calc(var(--nav-h) + 3px); align-self: start; max-height: calc(100dvh - var(--nav-h) - 3px); overflow-y: auto; padding: 40px 0 32px; }
.side-group + .side-group { margin-top: 26px; }
.side-group p { margin: 0 0 8px; color: var(--fg-muted); font-size: 12px; }
.side a { display: block; padding: 5px 0 5px 12px; border-left: 1px solid var(--border); color: var(--fg); text-decoration: none; font-size: 12.5px; }
.side a[aria-current="page"] { border-left: 2px solid var(--accent); padding-left: 11px; color: var(--accent); }
.side-mobile { display: none; margin: 24px 0 0; border: 1px solid var(--border); }
.side-mobile summary { padding: 12px 14px; cursor: pointer; font-weight: 600; font-size: 12px; }
.side-mobile .side { position: static; max-height: none; padding: 0 14px 16px; overflow: visible; }

.doc { min-width: 0; padding: 40px 0 72px; }
.doc article { max-width: 46rem; font-size: 14px; font-weight: 400; line-height: 1.75; }
.doc h1 { font-size: 34px; line-height: 1.2; letter-spacing: -1.5px; }
.doc .doc-lede { margin: 14px 0 34px; color: var(--fg-muted); font-size: 14px; }
.doc h2 { margin: 52px 0 6px; padding-top: 22px; border-top: 1px solid var(--border); font-size: 20px; line-height: 1.35; letter-spacing: -0.6px; }
.doc h3 { margin: 36px 0 4px; font-size: 15px; font-weight: 600; }
.doc p { margin: 14px 0; text-wrap: pretty; }
.doc ul, .doc ol { margin: 14px 0; padding-left: 1.6em; }
.doc li { margin: 8px 0; padding-left: 4px; }
.doc li::marker { color: var(--accent); }
.doc li > p { margin: 8px 0; }
:not(pre) > code { padding: 1px 6px; border: 1px solid var(--line); background: var(--bg-2); color: var(--fg); font-size: inherit; white-space: nowrap; }
:not(pre) > code.long { white-space: normal; overflow-wrap: anywhere; }
.doc a { color: var(--accent); }
.table { margin: 20px 0; overflow-x: auto; border: 1px solid var(--border); }
.table table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.table th, .table td { padding: 10px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.table th { background: var(--bg-2); font-weight: 600; }
.table tr:last-child td { border-bottom: 0; }
.toc { position: sticky; top: calc(var(--nav-h) + 3px); align-self: start; padding: 44px 0 32px; font-size: 12px; }
.toc p { margin: 0 0 10px; color: var(--fg-muted); }
.toc a { display: block; padding: 4px 0; color: var(--fg); text-decoration: none; line-height: 1.5; }
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; max-width: 46rem; margin-top: 64px; }
.pager a { display: block; padding: 14px 16px; border: 1px solid var(--border); color: var(--fg); text-decoration: none; transition: border-color var(--dur) ease, color var(--dur) ease; }
.pager a span { display: block; margin-bottom: 4px; color: var(--fg-muted); font-size: 12px; }
.pager .next { grid-column: 2; text-align: right; }

@media (hover: hover) and (pointer: fine) {
  .nav-links a:hover, .foot a:hover, .side a:hover, .toc a:hover { color: var(--accent); }
  .btn-primary:hover { background: var(--accent); color: var(--ink); }
  .btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
  .btn-cta:hover { background: var(--cta-hover); }
  .btn-white:hover { background: var(--cta); color: var(--ink); }
  .copy:hover { border-color: var(--accent); color: var(--accent); }
  .install-tab:hover { color: var(--accent); }
  .band .install-tab:hover { color: var(--accent-fg); background: color-mix(in srgb, var(--brand) 85%, var(--night)); }
  .band .install-tab[aria-selected="true"]:hover { color: var(--accent); background: var(--bg-2); }
  .rail-tab:hover { background: linear-gradient(var(--wash), var(--wash)), var(--bg); }
  .rail-tab[aria-selected="true"]:hover { background: linear-gradient(var(--line), var(--line)), var(--bg); }
  .pager a:hover { border-color: var(--accent); color: var(--accent); }
  .doc a:hover { color: var(--fg); }
}

@media (prefers-reduced-motion: reduce) {
  .btn:active, .copy:active { transform: none; }
  .copy > span { transition: opacity 150ms ease; filter: none !important; transform: none !important; }
}

@media (max-width: 1100px) {
  .docs-grid { grid-template-columns: 200px minmax(0, 1fr); gap: 44px; }
  .toc { display: none; }
}

@media (max-width: 900px) {
  .display { font-size: 40px; letter-spacing: -1.5px; }
  .h2 { font-size: 28px; }
  .rail, .band .wrap, .compare { grid-template-columns: minmax(0, 1fr); }
  .rail-list { border-right: 0; border-bottom: 1px solid var(--border); }
  .compare > div + div { border-left: 0; border-top: 1px solid var(--border); }
  .cells { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cell:nth-child(n) { border-left: 0; }
  .cell:nth-child(even) { border-left: 1px solid var(--border); }
  .cell:nth-child(n + 3) { border-top: 1px solid var(--border); }
  .nav-links a.nav-sponsor { display: none; }
}

@media (max-width: 760px) {
  :root { --gutter: 16px; }
  .nav-links { gap: 16px; }
  .nav-links a:not(:first-child) { display: none; }
  .nav .wrap { gap: 16px; }
  .nav-cc { margin-left: -8px; }
  .nav-cc .cc-badge img { height: 9px; }
  .nav .wrap { justify-content: space-between; }
  .docs-grid { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .docs-grid > .side { display: none; }
  .side-mobile { display: block; }
  .hero { padding-top: 56px; }
  .display { font-size: 32px; letter-spacing: -1px; }
  .h2 { font-size: 24px; letter-spacing: -1px; }
  .fig-body { padding: 16px; }
    .layers-cap, .mem-tree, .mem-session { padding-inline: 16px; }
  .fig-rule { display: none; }
  .fig-title { flex: 1; text-align: center; }
  .demo-prompt { font-size: 13px; padding: 12px; gap: 10px; }
  .demo pre { padding: 14px; font-size: 12px; }
  .cells { grid-template-columns: minmax(0, 1fr); }
  .cell:nth-child(n) { border-left: 0; }
  .cell + .cell { border-top: 1px solid var(--border); }
  .section, .band { padding: 56px 0; }
  .doc h1 { font-size: 28px; }
}

@media (max-width: 400px) {
  .nav-cc { display: none; }
}

/* page grid: at 1100px and wider, sections split at the middle column rule and boxes reach the outer rules */
@media (min-width: 1100px) {
  .section .wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .section .wrap > * { grid-column: 1 / -1; }
  .section .wrap > .eyebrow { grid-column: 1; grid-row: 1; }
  .section .wrap > .h2 { grid-column: 1; grid-row: 2; padding-right: 48px; margin-bottom: 36px; }
  .section .wrap > .lede { grid-column: 2; grid-row: 2; align-self: start; max-width: none; padding-left: 24px; margin: calc((0.04 + 0.242) * 34px - (0.265 + 0.242) * 14px) 0 36px; }
  .hero-fig, .section .wrap > .fig, .rail, .cells, .rules { margin-inline: calc(-1 * var(--gutter)); }
  .rules li { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0; padding-inline: 0 24px; }
  .rules b { padding-left: 46px; }
  .rules span { padding-left: 24px; }
  .hero-install .install { margin-right: calc(-1 * var(--gutter)); }
  .rail { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .band .wrap { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0; }
  .band .wrap > div:first-child { padding-right: 48px; }
}
@media (min-width: 1180px) {
  .hero-install .install-panel pre { height: calc(4 * 1.7 * 12.5px + 32px); }
}
