@font-face {
  font-family: "Geologica Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url(../fonts/geologica-latin-wght-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Geologica Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url(../fonts/geologica-latin-ext-wght-normal.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "JetBrains Mono Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 100 800;
  src: url(../fonts/jetbrains-mono-latin-wght-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "JetBrains Mono Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 100 800;
  src: url(../fonts/jetbrains-mono-latin-ext-wght-normal.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  color-scheme: light dark;
  --bg: #f3f9fd;
  --surface: #ffffff;
  --stage: #dcebf6;
  --ink: #10202e;
  --muted: #4a6075;
  --accent: #1e78b4;
  --accent-text: #186a9f;
  --accent-ink: #f5fafe;
  --sans: "Geologica Variable", system-ui, -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --mono: "JetBrains Mono Variable", ui-monospace, "Cascadia Mono", Consolas, monospace;
  --header: 56px;
  --tabs: 44px;
  --radius: 12px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b120e;
    --surface: #121c16;
    --stage: #14201a;
    --ink: #e6eee6;
    --muted: #93a596;
    --accent: #8db89b;
    --accent-text: #8db89b;
    --accent-ink: #0b120e;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  scroll-padding-top: calc(var(--header) + var(--tabs) + 24px);
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.7 var(--sans);
  -webkit-font-smoothing: antialiased;
}
a {
  color: var(--accent-text);
  text-underline-offset: 3px;
}
a:hover {
  color: var(--ink);
}
:focus-visible {
  outline: 2px solid var(--accent-text);
  outline-offset: 2px;
  border-radius: 6px;
}
.skip {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: var(--radius);
  background: var(--accent);
  color: var(--accent-ink);
}
.skip:focus {
  top: 12px;
}
.ico {
  width: 18px;
  height: 18px;
  flex: none;
}

/* header */
.top {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--bg);
}
.top-row {
  display: flex;
  align-items: center;
  gap: 8px;
  height: var(--header);
  padding: 0 24px;
  max-width: 1480px;
  margin: 0 auto;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-right: auto;
  color: var(--ink);
  font-weight: 600;
  letter-spacing: -0.01em;
  text-decoration: none;
}
.brand:hover {
  color: var(--ink);
}
.mark-img {
  width: 30px;
  height: 27px;
  color: var(--ink);
}
.brand span {
  line-height: 1;
  padding-bottom: 3px;
}
.brand-docs {
  color: var(--muted);
  font-weight: 400;
}
.icon-btn,
.search-btn,
.lang > summary,
.main-link,
.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 12px;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 15px;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
}
.icon-btn:hover,
.search-btn:hover,
.lang > summary:hover,
.lang[open] > summary,
.main-link:hover {
  background: var(--surface);
  color: var(--ink);
}
.menu-btn {
  display: none;
  width: 40px;
  justify-content: center;
  padding: 0;
}
.search-btn {
  min-width: 260px;
  background: var(--surface);
  margin-right: 8px;
}
.search-btn kbd {
  margin-left: auto;
}
.nav-cta {
  background: var(--accent);
  color: var(--accent-ink);
  padding: 0 18px;
  font-weight: 500;
}
.nav-cta:hover {
  color: var(--accent-ink);
  filter: brightness(0.92);
}
.nav-cta.inline {
  display: inline-flex;
}
.lang {
  position: relative;
}
.lang > summary {
  list-style: none;
}
.lang > summary::-webkit-details-marker {
  display: none;
}
.lang > summary .ico {
  display: none;
}
.lang ul {
  position: absolute;
  right: 0;
  top: 46px;
  z-index: 40;
  min-width: 150px;
  margin: 0;
  padding: 6px;
  list-style: none;
  border-radius: var(--radius);
  background: var(--surface);
}
.lang ul a {
  display: block;
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--ink);
  text-decoration: none;
}
.lang ul a:hover,
.lang ul a[aria-current] {
  background: var(--stage);
}
.tabs {
  display: flex;
  gap: 4px;
  height: var(--tabs);
  padding: 0 24px 6px;
  max-width: 1480px;
  margin: 0 auto;
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs a {
  display: inline-flex;
  align-items: center;
  padding: 0 14px;
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 15px;
  text-decoration: none;
  white-space: nowrap;
}
.tabs a:hover {
  color: var(--ink);
  background: var(--surface);
}
.tabs a[aria-current] {
  color: var(--ink);
  background: var(--stage);
  font-weight: 500;
}

kbd {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 6px;
  background: var(--stage);
  color: var(--ink);
  font: 500 0.82em/1.4 var(--mono);
  white-space: nowrap;
}

/* layout */
.layout {
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr) 220px;
  gap: 40px;
  max-width: 1480px;
  margin: 0 auto;
  padding: 16px 24px 64px;
}
.layout.layout-bare {
  grid-template-columns: minmax(0, 1fr);
}
.layout-bare .doc {
  margin: 0 auto;
}
.side,
.toc {
  position: sticky;
  top: calc(var(--header) + var(--tabs) + 16px);
  align-self: start;
  max-height: calc(100vh - var(--header) - var(--tabs) - 32px);
  overflow-y: auto;
  scrollbar-width: thin;
}
.side-group + .side-group {
  margin-top: 24px;
}
.side h2,
.toc h2 {
  margin: 0 0 8px;
  padding: 0 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.02em;
}
.side ul,
.toc ul {
  margin: 0;
  padding: 0;
  list-style: none;
}
.side a {
  display: block;
  padding: 7px 12px;
  border-radius: 10px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.4;
  text-decoration: none;
}
.side a:hover {
  color: var(--ink);
  background: var(--surface);
}
.side a[aria-current] {
  color: var(--ink);
  background: var(--stage);
  font-weight: 500;
}
.toc a {
  display: block;
  padding: 5px 12px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.4;
  text-decoration: none;
}
.toc a:hover,
.toc a[aria-current] {
  color: var(--ink);
}
.toc a[aria-current] {
  font-weight: 500;
}
.toc .d3 a {
  padding-left: 24px;
}
.doc {
  width: 100%;
  max-width: 720px;
  min-width: 0;
}
.crumb {
  display: flex;
  gap: 8px;
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 14px;
}
.crumb a {
  color: var(--muted);
}

/* prose */
.prose h1 {
  margin: 0 0 12px;
  font-size: clamp(30px, 4vw, 40px);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
.lede {
  margin: 0 0 32px;
  color: var(--muted);
  font-size: 19px;
  line-height: 1.55;
}
.prose h2 {
  margin: 48px 0 12px;
  font-size: 26px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.015em;
}
.prose h3 {
  margin: 32px 0 8px;
  font-size: 19px;
  font-weight: 600;
  line-height: 1.35;
}
.prose h2 code,
.prose h3 code {
  font-size: 0.85em;
}
.anchor {
  margin-left: 8px;
  color: var(--muted);
  font-weight: 400;
  text-decoration: none;
  opacity: 0;
}
h2:hover .anchor,
h3:hover .anchor,
.anchor:focus-visible {
  opacity: 1;
}
.prose p,
.prose ul,
.prose ol {
  margin: 0 0 16px;
}
.prose ul,
.prose ol {
  padding-left: 24px;
}
.prose li {
  margin: 6px 0;
}
.prose li::marker {
  color: var(--muted);
}
.prose strong {
  font-weight: 600;
}
.prose code {
  padding: 2px 6px;
  border-radius: 6px;
  background: var(--stage);
  font: 400 0.88em/1.5 var(--mono);
  overflow-wrap: anywhere;
}
.code {
  position: relative;
  margin: 0 0 20px;
  border-radius: var(--radius);
  background: var(--surface);
}
.code pre {
  margin: 0;
  padding: 16px 70px 16px 18px;
  overflow-x: auto;
  font: 400 14px/1.6 var(--mono);
}
.code code {
  padding: 0;
  background: none;
  font: inherit;
  overflow-wrap: normal;
}
.copy {
  position: absolute;
  right: 8px;
  top: 8px;
  min-height: 32px;
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  background: var(--stage);
  color: var(--ink);
  font: 500 13px/1 var(--sans);
  cursor: pointer;
}
.copy:hover {
  filter: brightness(0.95);
}
.table-wrap {
  margin: 0 0 20px;
  overflow-x: auto;
  border-radius: var(--radius);
  background: var(--surface);
}
.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  line-height: 1.5;
}
.prose th,
.prose td {
  padding: 10px 16px;
  text-align: left;
  vertical-align: top;
}
.prose th {
  background: var(--stage);
  font-weight: 600;
  white-space: nowrap;
}
.prose tbody tr:nth-child(even) td {
  background: color-mix(in srgb, var(--stage) 40%, transparent);
}
.shot {
  margin: 24px 0;
}
.shot img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius);
}
.callout {
  margin: 0 0 20px;
  padding: 14px 18px;
  border-radius: var(--radius);
  background: var(--stage);
}
.callout > :last-child {
  margin-bottom: 0;
}
.callout-title {
  margin: 0 0 4px;
  color: var(--accent-text);
  font-size: 14px;
  font-weight: 600;
}
.prose blockquote {
  margin: 0 0 16px;
  padding: 0 0 0 18px;
  color: var(--muted);
}
.cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.cards li {
  margin: 0;
}
.card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  height: 100%;
  padding: 18px 20px;
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
}
.card:hover {
  background: var(--stage);
  color: var(--ink);
}
.card strong {
  font-weight: 600;
}
.card span {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.5;
}
/* home */
.doc:has(.home) {
  max-width: 1120px;
}
.home {
  padding-top: 40px;
}
.home-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 0 56px;
  text-align: center;
}
.home .home-hero h1 {
  margin: 0 0 16px;
  font-size: clamp(36px, 6vw, 60px);
  letter-spacing: -0.03em;
}
.home .home-hero .lede {
  max-width: 640px;
  margin: 0 0 32px;
  font-size: clamp(17px, 2vw, 21px);
}
.home-search {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  max-width: 720px;
  min-height: 64px;
  padding: 0 22px;
  border: 0;
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--muted);
  font: inherit;
  font-size: 18px;
  text-align: left;
  cursor: pointer;
}
.home-search:hover {
  background: var(--stage);
  color: var(--ink);
}
.home-search .ico {
  width: 22px;
  height: 22px;
  flex: none;
}
.home-search span {
  flex: 1;
  min-width: 0;
}
.home-search kbd {
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--stage);
  font-family: var(--mono);
  font-size: 13px;
}
.home-intro {
  max-width: 640px;
  margin: 24px 0 0;
}
.home-intro p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.6;
}
.home h2 {
  margin: 0 0 20px;
  font-size: 22px;
}
.dir {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}
.dir-group {
  padding: 28px 28px 20px;
  border-radius: var(--radius);
  background: var(--surface);
}
.dir-group h3 {
  margin: 0 0 14px;
  font-size: 20px;
  font-weight: 600;
}
.dir-group ul {
  margin: 0;
  padding: 0;
  list-style: none;
}
.dir-group li {
  margin: 0;
}
.dir-group a {
  display: block;
  padding: 7px 0;
  font-size: 16px;
  font-weight: 500;
  text-decoration: none;
}
.dir-group a:hover {
  text-decoration: underline;
}
.suggest {
  margin: 40px 0 0;
  font-size: 14px;
}
.pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 24px;
}
.pn {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 14px 18px;
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
}
.pn:hover {
  background: var(--stage);
  color: var(--ink);
}
.pn span {
  color: var(--muted);
  font-size: 13px;
}
.pn.next {
  grid-column: 2;
  text-align: right;
}
.pn.prev {
  grid-column: 1;
}
.foot {
  max-width: 1480px;
  margin: 0 auto;
  padding: 24px 24px 48px;
  color: var(--muted);
  font-size: 14px;
}
.foot p {
  margin: 0 0 6px;
}
.foot a {
  margin-right: 16px;
  color: var(--muted);
}

/* search */
.search {
  width: min(640px, calc(100vw - 32px));
  margin-top: 12vh;
  padding: 12px;
  border: 0;
  border-radius: 16px;
  background: var(--surface);
  color: var(--ink);
}
.search::backdrop {
  background: color-mix(in srgb, var(--bg) 70%, transparent);
}
.search-form {
  display: flex;
  gap: 8px;
}
.search-input {
  flex: 1;
  min-width: 0;
  min-height: 44px;
  padding: 0 14px;
  border: 0;
  border-radius: var(--radius);
  background: var(--stage);
  color: var(--ink);
  font: inherit;
}
.search-close {
  padding: 0 14px;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
  font: inherit;
  cursor: pointer;
}
.search-status {
  margin: 10px 4px 4px;
  color: var(--muted);
  font-size: 14px;
}
.search-status:empty { display: none; }
.search-results {
  max-height: 50vh;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  list-style: none;
}
.search-results a {
  display: block;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--ink);
  text-decoration: none;
}
.search-results a:hover,
.search-results a:focus-visible,
.search-results a[aria-selected="true"] {
  background: var(--stage);
}
.search-results strong {
  display: block;
  font-weight: 500;
}
.search-results span {
  display: block;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}
.search-results mark {
  background: none;
  color: var(--accent-text);
  font-weight: 600;
}

.scrim {
  display: none;
}

/* narrower */
@media (max-width: 1180px) {
  .layout {
    grid-template-columns: 240px minmax(0, 1fr);
  }
  .toc {
    display: none;
  }
}
@media (max-width: 820px) {
  .top-row {
    padding: 0 12px;
  }
  .tabs {
    padding: 0 12px 6px;
  }
  .menu-btn {
    display: inline-flex;
  }
  .brand {
    margin-right: auto;
  }
  .search-btn {
    min-width: 0;
    margin-right: 0;
    padding: 0 12px;
  }
  .search-text,
  .search-btn kbd,
  .main-link,
  .nav-cta {
    display: none;
  }
  .layout {
    grid-template-columns: minmax(0, 1fr);
    padding: 8px 16px 48px;
  }
  .side {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 50;
    width: min(300px, 86vw);
    max-height: none;
    padding: 20px 12px;
    background: var(--bg);
    transform: translateX(-100%);
    visibility: hidden;
  }
  .menu-open .side {
    transform: none;
    visibility: visible;
  }
  .menu-open .scrim {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 45;
    background: color-mix(in srgb, var(--bg) 70%, transparent);
  }
  .cards {
    grid-template-columns: minmax(0, 1fr);
  }
  .prose h2 {
    font-size: 23px;
  }
}
@media (prefers-reduced-motion: no-preference) {
  .side {
    transition: transform 0.2s ease, visibility 0.2s;
  }
}
@media (max-width: 820px) {
  .lang-name {
    display: none;
  }
  .lang > summary .ico {
    display: block;
  }
  .lang > summary,
  .search-btn {
    width: 40px;
    justify-content: center;
    padding: 0;
  }
  .lang ul {
    position: fixed;
    right: 12px;
    top: 52px;
  }
}
@media (max-width: 420px) {
  .brand-docs {
    display: none;
  }
}

/* 404: a big number that glitches and is scanned by a line. Static with reduced motion. */
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }

.nf { display: grid; justify-items: center; gap: 24px; padding-block: 64px; text-align: center; }

.code-404 { position: relative; overflow: hidden; font-size: clamp(96px, 22vw, 220px); line-height: 1; letter-spacing: -0.04em; }

.code-404::after { content: ""; position: absolute; inset-inline: 0; top: 0; height: 4px; background: var(--accent); opacity: 0.7; }

.glitch { position: relative; display: inline-block; overflow: hidden; padding-inline: 0.04em; }

.glitch::before { content: attr(data-text); position: absolute; inset: 0 0 0 0.04em; color: var(--accent); clip-path: inset(0 0 100% 0); opacity: 0.9; }

@media (prefers-reduced-motion: no-preference) {
  .code-404::after { animation: nf-scan 2.4s linear infinite; }
  .glitch { animation: nf-jolt 3s steps(1, end) infinite; }
  .glitch::before { animation: nf-slice 3s steps(1, end) infinite; }
}

@keyframes nf-scan { from { transform: translateY(-10px); } to { transform: translateY(1.1em); } }

@keyframes nf-jolt {
  0%, 62%, 100% { transform: none; }
  64% { transform: translateX(-0.03em) skewX(-6deg); }
  68% { transform: translateX(0.04em) skewX(5deg); }
  72% { transform: none; }
  90% { transform: translateX(0.02em); }
  92% { transform: none; }
}

@keyframes nf-slice {
  0%, 60%, 100% { clip-path: inset(0 0 100% 0); transform: none; }
  62% { clip-path: inset(10% 0 60% 0); transform: translateX(-0.06em); }
  66% { clip-path: inset(45% 0 30% 0); transform: translateX(0.07em); }
  70% { clip-path: inset(70% 0 5% 0); transform: translateX(-0.04em); }
  74% { clip-path: inset(0 0 100% 0); }
  88% { clip-path: inset(30% 0 50% 0); transform: translateX(0.05em); }
  91% { clip-path: inset(0 0 100% 0); }
}
