/* Kuiper docs
 *
 * Self-contained: nothing here depends on the landing page's stylesheet.
 * Brand tokens come from docs/brand-guidlines.md: Void ground, Space and Hull
 * for surfaces and hairlines, Regolith and Metal for secondary text, Frost for
 * primary text. Ice is the one accent and only ever marks an edge, an active
 * state, a focus ring or the single primary action.
 *
 * Glass: translucent panels with a hairline edge and a faint top highlight,
 * blurred over a quiet neutral glow. Words are Sora 200/300, anything a
 * machine produced or a developer types is JetBrains Mono.
 */

@font-face {
  font-family: 'Sora';
  src: url('/assets/sora.woff2') format('woff2');
  font-weight: 100 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'JetBrains Mono';
  src: url('/assets/jetbrains-mono.woff2') format('woff2');
  font-weight: 100 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --void: #04060a;
  --space: #0a0f15;
  --hull: #18212b;
  --hull-2: #253140;
  --regolith: #7d8a97;
  --metal: #9aa7b3;
  --frost: #e6f1f4;
  --ice: #7ce0ee;
  --text: #cdd9de;

  --glass: rgba(230, 241, 244, 0.035);
  --glass-2: rgba(230, 241, 244, 0.065);
  --edge: rgba(230, 241, 244, 0.1);
  --edge-2: rgba(230, 241, 244, 0.18);
  --ice-edge: rgba(124, 224, 238, 0.55);

  --r-sm: 6px;
  --r: 10px;
  --r-lg: 14px;

  --sans: 'Sora', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, Menlo, Consolas, monospace;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);

  --hdr: 60px;
  --side: 244px;
  --toc: 196px;
  --gap: 48px;
  --gut: clamp(16px, 4vw, 40px);
}

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

html {
  background: var(--void);
  color: var(--frost);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--hdr) + 28px);
}
html.nav-open { overflow: hidden; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(1100px 520px at 72% -180px, rgba(37, 49, 64, 0.5), transparent 70%),
    radial-gradient(700px 420px at -6% 18%, rgba(24, 33, 43, 0.55), transparent 70%),
    var(--void);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--sans);
  font-weight: 300;
  font-size: 16px;
  line-height: 1.72;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

::selection { background: rgba(124, 224, 238, 0.24); color: var(--frost); }

a { color: inherit; }
img { max-width: 100%; }
button { font: inherit; color: inherit; }

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

.skip {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--frost);
  color: var(--void);
  border-radius: var(--r-sm);
  font-weight: 500;
  text-decoration: none;
}
.skip:focus { top: 12px; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

kbd {
  font: 400 11px/1 var(--mono);
  color: var(--metal);
  border: 1px solid var(--edge-2);
  border-bottom-width: 2px;
  border-radius: 5px;
  padding: 3px 6px 2px;
  background: var(--glass);
}

/* ------------------------------------------------------------------ header */

.dh {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--hdr);
  background: rgba(4, 6, 10, 0.86);
  -webkit-backdrop-filter: blur(16px) saturate(1.5);
  backdrop-filter: blur(16px) saturate(1.5);
  border-bottom: 1px solid var(--edge);
}
.dh-inner {
  height: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 var(--gut);
  display: flex;
  align-items: center;
  gap: 14px;
}
.dh-menu {
  display: none;
  width: 40px;
  height: 40px;
  margin-left: -10px;
  align-items: center;
  justify-content: center;
  background: none;
  border: 0;
  border-radius: var(--r-sm);
  color: var(--frost);
  cursor: pointer;
}
.dh-menu svg, .dh-search svg { fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; }
.dh-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--frost);
}
.dh-brand .mark { fill: var(--frost); display: block; }
.dh-word {
  font-weight: 300;
  font-size: 19px;
  letter-spacing: 0.14em;
  line-height: 1;
  padding-bottom: 1px;
}
.dh-sep { width: 1px; height: 18px; background: var(--edge-2); margin: 0 2px; }
.dh-docs {
  font: 400 11.5px/1 var(--mono);
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--metal);
  text-decoration: none;
}
.dh-docs:hover { color: var(--frost); }

.dh-search {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 36px;
  min-width: 232px;
  padding: 0 8px 0 12px;
  background: var(--glass);
  border: 1px solid var(--edge);
  border-radius: var(--r-sm);
  color: var(--regolith);
  font-size: 13.5px;
  font-weight: 300;
  cursor: pointer;
  transition: border-color 0.2s var(--ease), color 0.2s var(--ease), background 0.2s var(--ease);
}
.dh-search:hover { border-color: var(--edge-2); color: var(--frost); background: var(--glass-2); }
.dh-search-i { display: inline-flex; }
.dh-search-t { flex: 1; text-align: left; }
.dh-search kbd { margin-left: auto; }

.dh-links { display: flex; align-items: center; gap: 22px; margin-left: 10px; }
.dh-links a:not(.btn) {
  font-size: 14px;
  color: var(--metal);
  text-decoration: none;
  transition: color 0.2s var(--ease);
}
.dh-links a:not(.btn):hover { color: var(--frost); }
.dh-links a.ext::after { content: ' \2197'; font-size: 0.9em; color: var(--regolith); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  padding: 0 16px;
  background: var(--ice);
  color: var(--void);
  border-radius: var(--r-sm);
  font-weight: 500;
  font-size: 13.5px;
  letter-spacing: 0.02em;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.2s var(--ease), transform 0.2s var(--ease);
}
.btn:hover { background: #a1ecf6; }
.btn:active { transform: translateY(1px); }

/* ------------------------------------------------------------------ layout */

.dl {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 var(--gut);
  display: grid;
  grid-template-columns: var(--side) minmax(0, 1fr) var(--toc);
  column-gap: var(--gap);
  align-items: start;
}

/* ----------------------------------------------------------------- sidebar */

.sidebar {
  position: sticky;
  top: var(--hdr);
  height: calc(100vh - var(--hdr));
  overflow-y: auto;
  padding: 36px 20px 56px 0;
  border-right: 1px solid var(--edge);
  scrollbar-width: thin;
  scrollbar-color: var(--hull-2) transparent;
}
.sb-group + .sb-group { margin-top: 28px; }
.sb-title {
  margin: 0 0 8px 12px;
  font: 400 11px/1.4 var(--mono);
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--regolith);
}
.sidebar ul { list-style: none; margin: 0; padding: 0; }
.sidebar a {
  position: relative;
  display: block;
  padding: 7px 12px;
  border-radius: var(--r-sm);
  font-size: 14px;
  line-height: 1.4;
  color: var(--metal);
  text-decoration: none;
  transition: color 0.18s var(--ease), background 0.18s var(--ease);
}
.sidebar a:hover { color: var(--frost); background: var(--glass); }
.sidebar a[aria-current='page'] {
  color: var(--frost);
  font-weight: 400;
  background: var(--glass-2);
}
.sidebar a[aria-current='page']::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 2px;
  border-radius: 2px;
  background: var(--ice);
}

/* -------------------------------------------------------------------- page */

.doc { min-width: 0; padding: 44px 0 80px; }
.doc article { animation: rise 0.5s var(--ease) both; }
@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .doc article { animation: none; }
}

.eyebrow {
  margin: 0 0 18px;
  font: 400 11.5px/1.4 var(--mono);
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--regolith);
}
.doc h1 {
  margin: 0 0 18px;
  font-weight: 200;
  font-size: clamp(34px, 4.6vw, 50px);
  line-height: 1.08;
  letter-spacing: -0.01em;
  color: var(--frost);
  text-wrap: balance;
}
.lede {
  margin: 0;
  max-width: 62ch;
  font-size: clamp(17px, 1.6vw, 19px);
  line-height: 1.6;
  color: var(--metal);
}
.doc-head { padding-bottom: 8px; }
.doc-home h1 { font-size: clamp(38px, 5.4vw, 60px); }

.prose { margin-top: 18px; }
.prose > :first-child { margin-top: 0; }

.prose h2 {
  position: relative;
  margin: 64px 0 18px;
  padding-top: 40px;
  border-top: 1px solid var(--hull);
  font-weight: 200;
  font-size: clamp(25px, 2.8vw, 31px);
  line-height: 1.2;
  color: var(--frost);
  text-wrap: balance;
}
.prose > h2:first-child { margin-top: 24px; padding-top: 32px; }
.prose h3 {
  position: relative;
  margin: 40px 0 10px;
  font-weight: 400;
  font-size: 17.5px;
  line-height: 1.4;
  color: var(--frost);
}
.anchor {
  margin-left: 10px;
  font: 400 0.8em/1 var(--mono);
  color: var(--regolith);
  text-decoration: none;
  opacity: 0;
  transition: opacity 0.18s var(--ease), color 0.18s var(--ease);
}
h2:hover .anchor, h3:hover .anchor, .anchor:focus-visible { opacity: 1; }
.anchor:hover { color: var(--ice); }

.prose p { margin: 0 0 16px; max-width: 70ch; }
.prose strong { font-weight: 500; color: var(--frost); }
.prose em { font-style: italic; color: var(--frost); }

.prose a:not(.card):not(.anchor):not(.shot-frame) {
  color: var(--frost);
  text-decoration: underline;
  text-decoration-color: rgba(230, 241, 244, 0.32);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color 0.18s var(--ease), text-decoration-color 0.18s var(--ease);
}
.prose a:not(.card):not(.anchor):not(.shot-frame):hover {
  color: var(--ice);
  text-decoration-color: var(--ice);
}
.prose a.ext::after { content: '\2197'; margin-left: 3px; font-size: 0.82em; color: var(--regolith); text-decoration: none; display: inline-block; }

.prose :not(pre) > code {
  font: 400 0.86em/1.4 var(--mono);
  color: var(--frost);
  background: rgba(230, 241, 244, 0.06);
  border: 1px solid var(--edge);
  border-radius: 5px;
  padding: 0.12em 0.4em;
  overflow-wrap: anywhere;
}
.prose a code { border-color: transparent; }
.nb { white-space: nowrap; }

.prose ul { list-style: none; margin: 0 0 20px; padding: 0; max-width: 70ch; }
.prose ul > li {
  position: relative;
  margin: 0 0 8px;
  padding-left: 22px;
}
.prose ul > li::before {
  content: '';
  position: absolute;
  left: 2px;
  top: 0.82em;
  width: 8px;
  height: 1px;
  background: var(--regolith);
}
.prose li > ul, .prose li > ol { margin-top: 10px; margin-bottom: 4px; }
.prose li p { margin-bottom: 10px; }

.prose ol.steps {
  list-style: none;
  counter-reset: step;
  margin: 24px 0 28px;
  padding: 0;
  max-width: 78ch;
}
.prose ol.steps > li {
  position: relative;
  counter-increment: step;
  margin: 0;
  padding: 2px 0 26px 48px;
}
.prose ol.steps > li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  font: 400 12.5px/1 var(--mono);
  color: var(--frost);
  background: var(--glass-2);
  border: 1px solid var(--edge-2);
  border-radius: 8px;
}
.prose ol.steps > li::after {
  content: '';
  position: absolute;
  left: 15px;
  top: 40px;
  bottom: 8px;
  width: 1px;
  background: var(--hull-2);
}
.prose ol.steps > li:last-child { padding-bottom: 4px; }
.prose ol.steps > li:last-child::after { display: none; }
.prose ol.steps > li > :first-child { margin-top: 3px; }
.prose ol.steps li > p:last-child { margin-bottom: 8px; }
.prose ol.steps li .code:last-child, .prose ol.steps li .shot:last-child { margin-bottom: 0; }

/* ------------------------------------------------------------------- code */

.code {
  position: relative;
  margin: 20px 0 26px;
  max-width: 100%;
  background:
    linear-gradient(180deg, rgba(230, 241, 244, 0.045), rgba(230, 241, 244, 0.012)),
    rgba(10, 15, 21, 0.72);
  border: 1px solid var(--edge);
  border-radius: var(--r);
  box-shadow: inset 0 1px 0 rgba(230, 241, 244, 0.05);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  overflow: hidden;
}
.code-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 38px;
  padding: 0 8px 0 18px;
  border-bottom: 1px solid var(--edge);
}
.code-lang {
  font: 400 11px/1 var(--mono);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--regolith);
}
.code pre {
  margin: 0;
  padding: 16px 20px 17px;
  overflow-x: auto;
  font: 400 13.5px/1.82 var(--mono);
  color: #d4e1e6;
  tab-size: 2;
  scrollbar-width: thin;
  scrollbar-color: var(--hull-2) transparent;
}
.code pre code { font: inherit; white-space: pre; }
.code pre, .prose :not(pre) > code, th, td code { font-variant-ligatures: none; font-feature-settings: 'calt' 0, 'liga' 0; }
.code.one pre { padding-right: 104px; }
.code.out pre { color: var(--metal); }

.ln.cmd::before {
  content: '$ ';
  color: var(--ice);
  -webkit-user-select: none;
  user-select: none;
}
.ln.c { color: var(--regolith); }
.t-k { color: var(--frost); font-weight: 500; }
.t-f { color: var(--metal); }
.t-s { color: #f2fafc; }
.t-c { color: var(--regolith); }
.t-key { color: var(--frost); }
.t-n { color: var(--metal); }
.t-p { color: var(--regolith); }
.lang-json .t-s, .lang-ts .t-s { color: var(--metal); }
.lang-ts .t-key { font-weight: 500; }

.copy {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 28px;
  padding: 0 9px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  color: var(--regolith);
  font: 400 11px/1 var(--mono);
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: color 0.18s var(--ease), border-color 0.18s var(--ease), background 0.18s var(--ease);
}
.copy svg { fill: none; stroke: currentColor; stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; }
.copy:hover { color: var(--frost); border-color: var(--edge-2); background: var(--glass); }
.copy.done { color: var(--ice); border-color: var(--ice-edge); }
.code.one .copy {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
}

/* --------------------------------------------------------------- callouts */

.callout {
  position: relative;
  margin: 26px 0;
  padding: 16px 20px 6px 22px;
  max-width: 78ch;
  background: var(--glass);
  border: 1px solid var(--edge);
  border-left: 2px solid var(--ice);
  border-radius: var(--r);
  box-shadow: inset 0 1px 0 rgba(230, 241, 244, 0.05);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}
.callout-tip { border-left-color: var(--regolith); }
.callout-warn { border-left-color: var(--frost); }
.prose .callout p.callout-title {
  margin: 0 0 8px;
  font: 400 11px/1.4 var(--mono);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--frost);
}
.callout > :last-child { margin-bottom: 10px; }
.callout .code { margin-top: 12px; }

/* ----------------------------------------------------------------- tables */

.table-wrap {
  margin: 22px 0 30px;
  overflow-x: auto;
  background: var(--glass);
  border: 1px solid var(--edge);
  border-radius: var(--r);
  scrollbar-width: thin;
  scrollbar-color: var(--hull-2) transparent;
}
table { width: 100%; border-collapse: collapse; font-size: 14.5px; line-height: 1.55; }
th {
  padding: 12px 18px;
  text-align: left;
  font: 400 11px/1.3 var(--mono);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--regolith);
  border-bottom: 1px solid var(--edge);
  white-space: nowrap;
}
td { padding: 12px 18px 13px; vertical-align: top; border-top: 1px solid var(--hull); }
tbody tr:first-child td { border-top: 0; }
td:first-child { color: var(--frost); }
td:first-child code { white-space: nowrap; }
tbody tr { transition: background 0.15s var(--ease); }
tbody tr:hover { background: rgba(230, 241, 244, 0.025); }

/* ---------------------------------------------------------------- figures */

.shot { margin: 30px 0 36px; }
.shot-frame {
  display: block;
  position: relative;
  overflow: hidden;
  background: var(--space);
  border: 1px solid var(--edge-2);
  border-radius: var(--r-lg);
  box-shadow:
    0 30px 70px -30px rgba(0, 0, 0, 0.85),
    inset 0 1px 0 rgba(230, 241, 244, 0.06);
  cursor: zoom-in;
  transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.shot-frame:hover { border-color: var(--ice-edge); }
.shot img { display: block; width: 100%; height: auto; }
.shot figcaption {
  margin-top: 12px;
  font: 400 12px/1.6 var(--mono);
  color: var(--regolith);
  letter-spacing: 0.02em;
}

/* ------------------------------------------------------------------ cards */

.cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 24px 0 32px;
}
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 20px 22px 22px;
  min-height: 132px;
  background: var(--glass);
  border: 1px solid var(--edge);
  border-radius: var(--r-lg);
  box-shadow: inset 0 1px 0 rgba(230, 241, 244, 0.05);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  text-decoration: none;
  transition: border-color 0.22s var(--ease), background 0.22s var(--ease), transform 0.22s var(--ease);
}
.card:hover { border-color: var(--ice-edge); background: var(--glass-2); transform: translateY(-2px); }
.card-eyebrow {
  font: 400 11px/1.3 var(--mono);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--regolith);
}
.card-title { font-weight: 400; font-size: 17.5px; line-height: 1.35; color: var(--frost); padding-right: 28px; }
.card-desc { font-size: 14.5px; line-height: 1.6; color: var(--metal); }
.card-go {
  position: absolute;
  right: 20px;
  top: 18px;
  color: var(--regolith);
  transition: color 0.2s var(--ease), transform 0.2s var(--ease);
}
.card:hover .card-go { color: var(--ice); transform: translateX(3px); }

/* ----------------------------------------------------------------- pager */

.pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 72px;
}
.pager a {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px 22px 20px;
  background: var(--glass);
  border: 1px solid var(--edge);
  border-radius: var(--r-lg);
  text-decoration: none;
  transition: border-color 0.22s var(--ease), background 0.22s var(--ease);
}
.pager a:hover { border-color: var(--ice-edge); background: var(--glass-2); }
.pager-next { text-align: right; align-items: flex-end; grid-column: 2; }
.pager-prev { grid-column: 1; }
.pager-k { font: 400 11px/1.3 var(--mono); letter-spacing: 0.22em; text-transform: uppercase; color: var(--regolith); }
.pager-t { font-weight: 400; font-size: 17px; color: var(--frost); line-height: 1.35; }
.pager-prev .pager-k::before { content: '\2190  '; }
.pager-next .pager-k::after { content: '  \2192'; }

.doc-foot {
  margin-top: 48px;
  padding-top: 22px;
  border-top: 1px solid var(--hull);
  font-size: 13px;
  color: var(--regolith);
}
.doc-foot p { margin: 0; }
.doc-foot a { color: var(--metal); text-underline-offset: 3px; }
.doc-foot a:hover { color: var(--frost); }

/* -------------------------------------------------------------------- toc */

.toc {
  position: sticky;
  top: var(--hdr);
  max-height: calc(100vh - var(--hdr));
  overflow-y: auto;
  padding: 48px 0 40px;
  scrollbar-width: none;
}
.toc-title {
  margin: 0 0 14px;
  font: 400 11px/1.4 var(--mono);
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--regolith);
}
.toc ul, .toc-inline ul { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--hull-2); }
.toc a, .toc-inline a {
  position: relative;
  display: block;
  padding: 5px 0 5px 14px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--regolith);
  text-decoration: none;
  transition: color 0.18s var(--ease);
}
.toc li.l3 a, .toc-inline li.l3 a { padding-left: 26px; font-size: 12.5px; }
.toc a:hover, .toc-inline a:hover { color: var(--frost); }
.toc a.on { color: var(--frost); }
.toc a.on::before {
  content: '';
  position: absolute;
  left: -1px;
  top: 4px;
  bottom: 4px;
  width: 1px;
  background: var(--ice);
}

.toc-inline {
  display: none;
  margin: 24px 0 8px;
  background: var(--glass);
  border: 1px solid var(--edge);
  border-radius: var(--r);
}
.toc-inline summary {
  list-style: none;
  cursor: pointer;
  padding: 12px 16px;
  font: 400 11px/1.4 var(--mono);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--metal);
}
.toc-inline summary::-webkit-details-marker { display: none; }
.toc-inline summary::after { content: '+'; float: right; color: var(--regolith); }
.toc-inline[open] summary::after { content: '\2212'; }
.toc-inline ul { margin: 0 16px 14px; }

/* ---------------------------------------------------------- search, zoom */

dialog { color: inherit; padding: 0; border: 0; background: none; max-width: none; max-height: none; }
dialog::backdrop { background: rgba(4, 6, 10, 0.72); -webkit-backdrop-filter: blur(5px); backdrop-filter: blur(5px); }

.search {
  position: fixed;
  top: 11vh;
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  width: min(660px, calc(100vw - 32px));
  background: rgba(10, 15, 21, 0.9);
  border: 1px solid var(--edge-2);
  border-radius: var(--r-lg);
  box-shadow: 0 40px 90px -30px rgba(0, 0, 0, 0.9), inset 0 1px 0 rgba(230, 241, 244, 0.06);
  -webkit-backdrop-filter: blur(24px) saturate(1.4);
  backdrop-filter: blur(24px) saturate(1.4);
  overflow: hidden;
}
.search[open] { animation: pop 0.2s var(--ease) both; }
@keyframes pop {
  from { opacity: 0; transform: translateX(-50%) translateY(-6px); }
  to { opacity: 1; transform: translateX(-50%); }
}
.search-field { display: flex; align-items: center; gap: 12px; padding: 0 18px; height: 56px; border-bottom: 1px solid var(--edge); color: var(--regolith); }
.search-field svg { fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; flex: none; }
.search input {
  flex: 1;
  min-width: 0;
  height: 100%;
  background: none;
  border: 0;
  outline: 0;
  color: var(--frost);
  font: 300 17px/1 var(--sans);
}
.search input::placeholder { color: var(--regolith); }
.search input::-webkit-search-cancel-button, .search input::-webkit-search-decoration { -webkit-appearance: none; appearance: none; }
.search-list { list-style: none; margin: 0; padding: 8px; max-height: min(52vh, 440px); overflow-y: auto; }
.search-list li { margin: 0; }
.search-list a {
  position: relative;
  display: block;
  padding: 10px 14px 11px;
  border-radius: var(--r-sm);
  text-decoration: none;
}
.search-list a[aria-selected='true'] { background: var(--glass-2); }
.search-list a[aria-selected='true']::before {
  content: '';
  position: absolute;
  left: 0;
  top: 9px;
  bottom: 9px;
  width: 2px;
  border-radius: 2px;
  background: var(--ice);
}
.sr-t { display: block; font-weight: 400; font-size: 15px; line-height: 1.4; color: var(--frost); }
.sr-p { display: block; font: 400 11px/1.5 var(--mono); letter-spacing: 0.08em; color: var(--regolith); margin-top: 2px; }
.sr-x { display: block; font-size: 13px; line-height: 1.5; color: var(--metal); margin-top: 3px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sr-t mark, .sr-x mark { background: none; color: var(--frost); font-weight: 500; text-decoration: underline; text-decoration-color: var(--ice); text-underline-offset: 3px; }
.search-empty { padding: 28px 18px; text-align: center; color: var(--regolith); font-size: 14px; }
.search-foot { display: flex; gap: 18px; padding: 10px 18px; border-top: 1px solid var(--edge); font: 400 11px/1 var(--mono); color: var(--regolith); letter-spacing: 0.04em; }

.lightbox {
  position: fixed;
  inset: 0;
  margin: 0;
  width: 100vw;
  height: 100vh;
  display: none;
  place-items: center;
  overflow: auto;
  padding: 24px;
}
.lightbox[open] { display: grid; animation: fade 0.2s var(--ease) both; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.lightbox::backdrop { background: rgba(4, 6, 10, 0.9); }
.lightbox img {
  display: block;
  max-width: calc(100vw - 48px);
  height: auto;
  border: 1px solid var(--edge-2);
  border-radius: var(--r-lg);
  box-shadow: 0 40px 100px -30px #000;
  cursor: zoom-out;
}
.lightbox-x {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 2;
  height: 36px;
  padding: 0 14px;
  background: rgba(10, 15, 21, 0.8);
  border: 1px solid var(--edge-2);
  border-radius: var(--r-sm);
  color: var(--frost);
  font: 400 11px/1 var(--mono);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  cursor: pointer;
}
.lightbox-x:hover { border-color: var(--ice-edge); }

.scrim { display: none; }

/* ------------------------------------------------------------ breakpoints */

@media (max-width: 1239px) {
  .dl { grid-template-columns: var(--side) minmax(0, 1fr); }
  .toc { display: none; }
  .toc-inline { display: block; }
  .dh-search { min-width: 0; }
}

@media (max-width: 1060px) {
  .dh-links a:not(.btn) { display: none; }
}

@media (max-width: 899px) {
  :root { --hdr: 56px; }
  .dh-menu { display: inline-flex; }
  .dh-docs { display: none; }
  .dh-sep { display: none; }
  .dh-search { margin-left: auto; min-width: 0; width: 40px; padding: 0; justify-content: center; gap: 0; }
  .dh-search-t, .dh-search kbd { display: none; }
  .dh-links { margin-left: 0; }
  .dh-links .btn { display: none; }

  .dl { display: block; }

  /* Without scripts the navigation stays in the page; with them it is a drawer. */
  .sidebar {
    position: static;
    height: auto;
    padding: 20px 0 8px;
    border-right: 0;
    border-bottom: 1px solid var(--edge);
    overflow: visible;
  }
  html.js .sidebar {
    position: fixed;
    z-index: 60;
    top: 0;
    bottom: 0;
    left: 0;
    width: min(86vw, 330px);
    height: auto;
    padding: calc(var(--hdr) + 12px) 18px 40px 16px;
    background: rgba(8, 12, 18, 0.94);
    -webkit-backdrop-filter: blur(22px) saturate(1.4);
    backdrop-filter: blur(22px) saturate(1.4);
    border-right: 1px solid var(--edge-2);
    border-bottom: 0;
    overflow-y: auto;
    transform: translateX(-102%);
    visibility: hidden;
    transition: transform 0.3s var(--ease), visibility 0s linear 0.3s;
  }
  html.nav-open .sidebar { transform: none; visibility: visible; transition: transform 0.3s var(--ease); }
  html.js .scrim {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 50;
    background: rgba(4, 6, 10, 0.6);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s var(--ease), visibility 0s linear 0.3s;
  }
  html.nav-open .scrim { opacity: 1; visibility: visible; transition: opacity 0.3s var(--ease); }

  .doc { padding-top: 32px; }
}

@media (max-width: 480px) {
  .nb { white-space: normal; }
}

@media (max-width: 640px) {
  body { font-size: 16px; }
  .cards { grid-template-columns: 1fr; }
  .pager { grid-template-columns: 1fr; }
  .pager-next, .pager-prev { grid-column: 1; text-align: left; align-items: flex-start; }
  .prose h2 { margin-top: 52px; padding-top: 32px; }
  .code pre { font-size: 12.5px; padding: 14px 16px 15px; }
  .code.one pre { padding-right: 92px; }
  .code-bar { padding-left: 16px; }
  th, td { padding-left: 14px; padding-right: 14px; }
  .shot { margin: 24px 0 30px; }
  .search { top: 8vh; }
  .dh-word { font-size: 18px; }
}
