:root {
  --paper: #faf9f5;
  --surface: #f3f1e9;
  --raised: #ffffff;
  --ink: #1f1e1a;
  --ink-soft: #5a574d;
  --ink-faint: #85816f;
  --line: #e3dfd2;
  --accent: #b1502b;
  --accent-soft: #f4e4da;
  --code-bg: #f1eee4;
  --code-ink: #2b2925;
  --token-keyword: #a23f1d;
  --token-string: #3f6b2f;
  --token-type: #7a4f9e;
  --token-number: #1f6f8b;
  --token-comment: #8b8778;
  --token-function: #1e5a96;
  --ok: #2f6b3c;
  --ok-soft: #e2efdf;
  --warn: #8f5a0a;
  --warn-soft: #f7ecd2;
  --danger: #a33131;
  --danger-soft: #f8e2df;
  --shadow: 0 1px 2px rgba(60, 50, 30, 0.05), 0 12px 32px rgba(60, 50, 30, 0.08);
  --font-serif: "Newsreader", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --font-ui: "Instrument Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Consolas, Menlo, monospace;
  --sidebar-width: 272px;
  --toc-width: 216px;
  --measure: 720px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #1e1d1a;
    --surface: #25241f;
    --raised: #2b2a25;
    --ink: #ece9df;
    --ink-soft: #b3afa1;
    --ink-faint: #8a8678;
    --line: #38362e;
    --accent: #e58f66;
    --accent-soft: #3d2a20;
    --code-bg: #171612;
    --code-ink: #e6e2d6;
    --token-keyword: #e8976f;
    --token-string: #a5c78f;
    --token-type: #c3a3e0;
    --token-number: #7fc4d8;
    --token-comment: #7d7a6c;
    --token-function: #8db8e8;
    --ok: #93c89f;
    --ok-soft: #22332a;
    --warn: #e0b868;
    --warn-soft: #3a2f18;
    --danger: #ec9c94;
    --danger-soft: #3e2422;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 16px 40px rgba(0, 0, 0, 0.42);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --paper: #1e1d1a;
  --surface: #25241f;
  --raised: #2b2a25;
  --ink: #ece9df;
  --ink-soft: #b3afa1;
  --ink-faint: #8a8678;
  --line: #38362e;
  --accent: #e58f66;
  --accent-soft: #3d2a20;
  --code-bg: #171612;
  --code-ink: #e6e2d6;
  --token-keyword: #e8976f;
  --token-string: #a5c78f;
  --token-type: #c3a3e0;
  --token-number: #7fc4d8;
  --token-comment: #7d7a6c;
  --token-function: #8db8e8;
  --ok: #93c89f;
  --ok-soft: #22332a;
  --warn: #e0b868;
  --warn-soft: #3a2f18;
  --danger: #ec9c94;
  --danger-soft: #3e2422;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 16px 40px rgba(0, 0, 0, 0.42);
  color-scheme: dark;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 24px;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: 18px;
  line-height: 1.62;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--accent) 35%, transparent);
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

a:hover {
  text-decoration-color: var(--accent);
}

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

img,
svg {
  max-width: 100%;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 60;
  padding: 8px 14px;
  background: var(--ink);
  color: var(--paper);
  border-radius: 8px;
  font-family: var(--font-ui);
  font-size: 14px;
}

.skip-link:focus {
  top: 12px;
}

.layout {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-right: 1px solid var(--line);
  font-family: var(--font-ui);
  z-index: 30;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 20px 12px;
  color: var(--ink);
  text-decoration: none;
}

.brand svg {
  flex: none;
  width: 26px;
  height: 26px;
  color: var(--accent);
}

.brand-name {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.brand-version {
  margin-left: auto;
  padding: 1px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-faint);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.search-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 14px 10px;
  padding: 8px 10px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--ink-faint);
  font: inherit;
  font-size: 13.5px;
  cursor: pointer;
  text-align: left;
}

.search-trigger:hover {
  border-color: var(--ink-faint);
  color: var(--ink-soft);
}

.search-trigger svg {
  flex: none;
  width: 15px;
  height: 15px;
}

.search-trigger kbd,
.search-box kbd {
  margin-left: auto;
  padding: 0 5px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface);
  color: var(--ink-faint);
  font-family: var(--font-ui);
  font-size: 11px;
}

.nav {
  flex: 1;
  overflow-y: auto;
  padding: 2px 14px 20px;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}

.nav-group + .nav-group {
  margin-top: 18px;
}

.nav-title {
  margin: 0 0 4px;
  padding: 0 8px;
  color: var(--ink-faint);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.nav-list {
  display: grid;
  gap: 1px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav-list li {
  margin: 0;
}

.nav-link {
  display: block;
  padding: 5px 8px;
  border-radius: 7px;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.35;
  text-decoration: none;
}

.nav-link:hover {
  background: color-mix(in srgb, var(--ink) 5%, transparent);
  color: var(--ink);
}

.nav-link[aria-current="page"] {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}

.sidebar-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-top: 1px solid var(--line);
  font-size: 13px;
}

.sidebar-foot a {
  color: var(--ink-soft);
  text-decoration: none;
}

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

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink-soft);
  cursor: pointer;
}

.icon-button:hover {
  background: color-mix(in srgb, var(--ink) 5%, transparent);
  color: var(--ink);
}

.icon-button svg {
  width: 16px;
  height: 16px;
}

.theme-toggle {
  margin-left: auto;
}

.topbar {
  display: none;
}

.main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--toc-width);
  gap: 40px;
  justify-content: center;
  width: 100%;
  max-width: calc(var(--measure) + var(--toc-width) + 136px);
  margin: 0 auto;
  padding: 44px 48px 88px;
}

.main.is-wide {
  grid-template-columns: minmax(0, 1fr);
  max-width: calc(var(--measure) + 260px);
}

.main.is-wide .toc {
  display: none;
}

.content {
  min-width: 0;
}

.page {
  max-width: var(--measure);
}

.main.is-wide .page {
  max-width: none;
}

.js .page {
  display: none;
}

.js .page.is-active {
  display: block;
}

.page-head {
  margin-bottom: 30px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 600;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-serif);
  font-weight: 450;
  line-height: 1.18;
  text-wrap: balance;
  letter-spacing: -0.012em;
  color: var(--ink);
}

h1 {
  margin: 0;
  font-size: 44px;
  font-weight: 400;
  letter-spacing: -0.02em;
}

h2 {
  margin: 52px 0 12px;
  padding-top: 8px;
  font-size: 29px;
}

h3 {
  margin: 34px 0 8px;
  font-size: 22px;
}

h4 {
  margin: 24px 0 6px;
  font-size: 18.5px;
  font-weight: 550;
}

.lead {
  margin: 14px 0 0;
  color: var(--ink-soft);
  font-size: 21px;
  line-height: 1.5;
}

p {
  margin: 0 0 16px;
}

ul,
ol {
  margin: 0 0 18px;
  padding-left: 24px;
}

li {
  margin-bottom: 7px;
}

li::marker {
  color: var(--ink-faint);
}

strong {
  font-weight: 620;
}

.heading-anchor {
  margin-left: 8px;
  color: var(--ink-faint);
  font-family: var(--font-ui);
  font-size: 0.7em;
  text-decoration: none;
  opacity: 0;
}

h2:hover .heading-anchor,
h3:hover .heading-anchor,
.heading-anchor:focus-visible {
  opacity: 1;
}

:not(pre) > code {
  padding: 0.1em 0.34em;
  background: var(--code-bg);
  border: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
  border-radius: 5px;
  color: var(--code-ink);
  font-family: var(--font-mono);
  font-size: 0.78em;
  font-variant-ligatures: none;
  overflow-wrap: anywhere;
}

.code-block {
  position: relative;
  margin: 0 0 20px;
  background: var(--code-bg);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}

.code-block pre {
  margin: 0;
  padding: 14px 16px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.code-block code {
  display: block;
  width: max-content;
  min-width: 100%;
  padding: 0;
  background: none;
  border: 0;
  color: var(--code-ink);
  font-family: var(--font-mono);
  font-size: 13.5px;
  line-height: 1.6;
  font-variant-ligatures: none;
}

.code-label {
  display: flex;
  align-items: center;
  min-height: 36px;
  padding: 0 44px 0 16px;
  border-bottom: 1px solid var(--line);
  color: var(--ink-faint);
  font-family: var(--font-ui);
  font-size: 12.5px;
  font-weight: 500;
}

.copy-button {
  position: absolute;
  top: 5px;
  right: 6px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 26px;
  min-width: 26px;
  padding: 0 6px;
  background: var(--code-bg);
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--ink-faint);
  font-family: var(--font-ui);
  font-size: 12px;
  cursor: pointer;
}

.copy-button:hover,
.copy-button:focus-visible {
  border-color: var(--line);
  color: var(--ink);
}

.copy-button svg {
  width: 14px;
  height: 14px;
}

.tabs {
  margin: 0 0 20px;
  background: var(--code-bg);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}

.tab-list {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  padding: 6px 8px 0;
  border-bottom: 1px solid var(--line);
}

.tab-button {
  position: relative;
  padding: 6px 10px 9px;
  background: none;
  border: 0;
  color: var(--ink-faint);
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}

.tab-button:hover {
  color: var(--ink);
}

.tab-button[aria-selected="true"] {
  color: var(--ink);
}

.tab-button[aria-selected="true"]::after {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: -1px;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
}

.tab-panel[hidden] {
  display: none;
}

.tabs .code-block {
  margin: 0;
  background: none;
  border: 0;
  border-radius: 0;
}

.hljs-keyword,
.hljs-meta,
.hljs-selector-tag,
.hljs-literal,
.hljs-built_in {
  color: var(--token-keyword);
}

.hljs-string,
.hljs-regexp,
.hljs-symbol {
  color: var(--token-string);
}

.hljs-type,
.hljs-class .hljs-title,
.hljs-title.class_ {
  color: var(--token-type);
}

.hljs-number,
.hljs-attr {
  color: var(--token-number);
}

.hljs-comment {
  color: var(--token-comment);
  font-style: italic;
}

.hljs-title,
.hljs-title.function_,
.hljs-function .hljs-title {
  color: var(--token-function);
}

.table-wrap {
  margin: 0 0 22px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  scrollbar-width: thin;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.45;
  font-variant-numeric: tabular-nums;
}

th,
td {
  padding: 9px 13px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  background: var(--surface);
  color: var(--ink-soft);
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
}

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

td code {
  font-size: 0.86em;
}

td:first-child code {
  overflow-wrap: normal;
  word-break: normal;
}

.callout {
  display: grid;
  gap: 4px;
  margin: 0 0 20px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-left-width: 3px;
  border-radius: 10px;
  background: var(--surface);
  font-size: 16.5px;
}

.callout p:last-child {
  margin-bottom: 0;
}

.callout-title {
  margin: 0;
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 650;
}

.callout-note {
  border-left-color: var(--accent);
}

.callout-note .callout-title {
  color: var(--accent);
}

.callout-tip {
  border-left-color: var(--ok);
  background: var(--ok-soft);
}

.callout-tip .callout-title {
  color: var(--ok);
}

.callout-warn {
  border-left-color: var(--warn);
  background: var(--warn-soft);
}

.callout-warn .callout-title {
  color: var(--warn);
}

.callout-danger {
  border-left-color: var(--danger);
  background: var(--danger-soft);
}

.callout-danger .callout-title {
  color: var(--danger);
}

.pill {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  font-family: var(--font-ui);
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.6;
  vertical-align: 0.12em;
  white-space: nowrap;
}

.pill-ok {
  background: var(--ok-soft);
  color: var(--ok);
}

.pill-exp {
  background: var(--warn-soft);
  color: var(--warn);
}

.pill-no {
  background: var(--danger-soft);
  color: var(--danger);
}

.pill-async {
  background: var(--accent-soft);
  color: var(--accent);
}

.api-list {
  display: grid;
  gap: 0;
  margin: 0 0 24px;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}

.api {
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  scroll-margin-top: 24px;
}

.api:last-child {
  border-bottom: 0;
}

.api:target,
.api.is-target {
  background: var(--accent-soft);
}

.api-sig {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 4px;
}

.api-sig code {
  padding: 0;
  background: none;
  border: 0;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.api-sig .api-name {
  color: var(--token-function);
  font-weight: 600;
}

.api p {
  margin: 0;
  color: var(--ink-soft);
  font-family: var(--font-ui);
  font-size: 14.5px;
  line-height: 1.5;
}

.home-hero {
  padding: 22px 0 8px;
}

.home-hero h1 {
  max-width: 15em;
  font-size: 58px;
  line-height: 1.06;
}

.home-hero .lead {
  max-width: 34em;
}

.home-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 24px 0 30px;
  font-family: var(--font-ui);
}

.button {
  display: inline-flex;
  align-items: center;
  padding: 9px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--raised);
  color: var(--ink);
  font-size: 14.5px;
  font-weight: 550;
  text-decoration: none;
}

.button:hover {
  border-color: var(--ink-faint);
}

.button-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--paper);
}

.button-primary:hover {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 88%, var(--ink));
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
  margin: 0 0 24px;
}

.card {
  display: grid;
  align-content: start;
  gap: 4px;
  padding: 15px 17px;
  background: var(--raised);
  border: 1px solid var(--line);
  border-radius: 12px;
  color: inherit;
  text-decoration: none;
}

a.card:hover {
  border-color: var(--accent);
}

.card-title {
  font-size: 19px;
  font-weight: 500;
  line-height: 1.25;
}

.card-text {
  color: var(--ink-soft);
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.45;
}

.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0;
  margin: 0 0 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: var(--raised);
}

.stat {
  padding: 14px 16px;
  border-right: 1px solid var(--line);
}

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

.stat-value {
  display: block;
  font-size: 30px;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.stat-label {
  display: block;
  margin-top: 4px;
  color: var(--ink-soft);
  font-family: var(--font-ui);
  font-size: 12.5px;
  line-height: 1.35;
}

.stat-note {
  color: var(--ink-faint);
  font-family: var(--font-ui);
  font-size: 13px;
}

.steps {
  counter-reset: step;
  margin: 0 0 24px;
  padding: 0;
  list-style: none;
}

.steps > li {
  position: relative;
  margin: 0;
  padding: 0 0 14px 40px;
  counter-increment: step;
}

.steps > li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 1px;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--raised);
  color: var(--accent);
  font-family: var(--font-ui);
  font-size: 12.5px;
  font-weight: 650;
}

.steps > li::after {
  content: "";
  position: absolute;
  left: 13px;
  top: 30px;
  bottom: 2px;
  width: 1px;
  background: var(--line);
}

.steps > li:last-child::after {
  display: none;
}

.pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 56px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.pager a {
  display: grid;
  gap: 2px;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  font-size: 17.5px;
  text-decoration: none;
}

.pager a:hover {
  border-color: var(--accent);
}

.pager small {
  color: var(--ink-faint);
  font-family: var(--font-ui);
  font-size: 12px;
}

.pager .pager-next {
  grid-column: 2;
  text-align: right;
}

.site-foot {
  margin-top: 28px;
  color: var(--ink-faint);
  font-family: var(--font-ui);
  font-size: 12.5px;
}

.toc {
  position: sticky;
  top: 44px;
  align-self: start;
  max-height: calc(100vh - 88px);
  overflow-y: auto;
  font-family: var(--font-ui);
  scrollbar-width: thin;
}

.toc-title {
  margin: 0 0 8px;
  color: var(--ink-faint);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.toc ul {
  margin: 0;
  padding: 0;
  list-style: none;
  border-left: 1px solid var(--line);
}

.toc li {
  margin: 0;
}

.toc a {
  display: block;
  margin-left: -1px;
  padding: 4px 0 4px 12px;
  border-left: 1px solid transparent;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.35;
  text-decoration: none;
}

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

.toc a.is-sub {
  padding-left: 22px;
  color: var(--ink-faint);
  font-size: 12.5px;
}

.toc a.is-current {
  border-left-color: var(--accent);
  color: var(--accent);
  font-weight: 600;
}

.search-layer {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: none;
  padding: 10vh 16px 16px;
  background: color-mix(in srgb, var(--ink) 32%, transparent);
  backdrop-filter: blur(3px);
}

.search-layer.is-open {
  display: block;
}

.search-panel {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 640px;
  max-height: 72vh;
  margin: 0 auto;
  background: var(--raised);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  overflow: hidden;
  font-family: var(--font-ui);
}

.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.search-box svg {
  flex: none;
  width: 18px;
  height: 18px;
  color: var(--ink-faint);
}

.search-box input::-webkit-search-cancel-button {
  display: none;
}

.search-box input {
  flex: 1;
  appearance: none;
  min-width: 0;
  background: none;
  border: 0;
  outline: 0;
  color: var(--ink);
  font: inherit;
  font-size: 16px;
}

.search-results {
  margin: 0;
  padding: 6px;
  overflow-y: auto;
  list-style: none;
}

.search-results li {
  margin: 0;
}

.search-result {
  display: grid;
  gap: 1px;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--ink);
  text-decoration: none;
}

.search-result.is-selected,
.search-result:hover {
  background: var(--accent-soft);
}

.search-result-title {
  font-size: 14.5px;
  font-weight: 550;
  overflow-wrap: anywhere;
}

.search-result-title mark {
  background: none;
  color: var(--accent);
}

.search-result-where {
  color: var(--ink-faint);
  font-size: 12.5px;
}

.search-empty {
  padding: 22px 12px;
  color: var(--ink-soft);
  font-size: 14px;
  text-align: center;
}

.sidebar-scrim {
  display: none;
}

@media (max-width: 1180px) {
  .main {
    grid-template-columns: minmax(0, 1fr);
    max-width: calc(var(--measure) + 96px);
  }

  .main.is-wide {
    max-width: calc(var(--measure) + 96px);
  }

  .toc {
    display: none;
  }
}

@media (max-width: 860px) {
  body {
    font-size: 17px;
  }

  .layout {
    display: block;
  }

  .topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 14px;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    font-family: var(--font-ui);
  }

  .topbar .brand {
    padding: 0;
  }

  .topbar .brand-name {
    font-size: 19px;
  }

  .topbar-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
  }

  .topbar .search-trigger {
    margin: 0;
    padding: 0;
    background: transparent;
    color: var(--ink-soft);
  }

  .topbar .theme-toggle {
    margin-left: 0;
  }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(300px, 86vw);
    transform: translateX(-102%);
    transition: transform 0.2s ease;
    box-shadow: var(--shadow);
  }

  .sidebar.is-open {
    transform: none;
  }

  .sidebar-scrim.is-open {
    position: fixed;
    inset: 0;
    z-index: 25;
    display: block;
    background: color-mix(in srgb, var(--ink) 30%, transparent);
  }

  .main {
    padding: 26px 18px 64px;
  }

  h1 {
    font-size: 36px;
  }

  .home-hero h1 {
    font-size: 42px;
  }

  h2 {
    margin-top: 42px;
    font-size: 25px;
  }

  .lead {
    font-size: 19px;
  }

  html {
    scroll-padding-top: 70px;
  }

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

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

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

  .pager .pager-next {
    grid-column: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
