/* MAKIINA SDK documentation.
   Materials and palette of the Robot Console (Liquid Glass II): graphite
   ground, raised panes with a specular top edge, hairlines, enamel copper.
   Red appears only in the wordmark. Dark only. */

:root {
  --bg: #0E0F11;
  --bg-2: #141518;
  --bg-3: #1B1C20;
  --well: rgba(8, 9, 10, .42);
  --line: rgba(245, 243, 239, .075);
  --line-2: rgba(245, 243, 239, .13);
  --line-3: rgba(245, 243, 239, .22);

  --text: #F5F3EF;
  --text-2: rgba(245, 243, 239, .74);
  --text-3: rgba(245, 243, 239, .56);
  --text-4: rgba(245, 243, 239, .40);

  --cu: #E08A52;
  --cu-2: #F4B78E;
  --cu-3: #C46A35;
  --cu-tint: rgba(224, 138, 82, .12);
  --cu-line: rgba(224, 138, 82, .34);
  --good: #37C8A0;
  --warn: #F5B342;

  --f-ui: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --f-mono: 'IBM Plex Mono', ui-monospace, 'Cascadia Mono', Consolas, monospace;

  --ease: cubic-bezier(.2, .8, .2, 1);
  --pane: linear-gradient(180deg, rgba(255, 255, 255, .042), rgba(255, 255, 255, .014));
  --pane-edge: inset 0 1px 0 rgba(255, 255, 255, .055);
  --deep: 0 34px 70px -30px rgba(0, 0, 0, .85), 0 10px 24px -12px rgba(0, 0, 0, .55);

  --bar: 60px;
  --shell: 1520px;
  --nav-w: 272px;
  --pad-l: 56px;
  --pad-r: 40px;
  --measure: 720px;
  --region: 880px;
  --toc-w: 216px;
  --toc-gap: 48px;
  --bleed: 0px;
}

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

html {
  background-color: var(--bg);
  color: var(--text);
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--bar) + 24px);
}

body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--bg);
  background-image: radial-gradient(1100px 520px at 64% -160px, rgba(245, 235, 222, .05), transparent 72%);
  background-repeat: no-repeat;
  color: var(--text);
  font: 400 16px/1.72 var(--f-ui);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img, svg { display: block; }
a { color: inherit; }
button { font: inherit; color: inherit; }
::selection { background: rgba(224, 138, 82, .32); color: #fff; }

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

.skip {
  position: absolute; left: 12px; top: -60px; z-index: 200;
  padding: 10px 16px; border-radius: 10px;
  background: var(--bg-3); color: var(--text);
  font: 600 14px/1 var(--f-ui); text-decoration: none;
  border: 1px solid var(--line-2);
  transition: top .18s var(--ease);
}
.skip:focus { top: 10px; }

.ic { width: 16px; height: 16px; flex: none; }

/* ------------------------------------------------------------ top bar */

.bar {
  position: sticky; top: 0; z-index: 60;
  height: var(--bar);
  background: rgba(14, 15, 17, .72);
  -webkit-backdrop-filter: blur(22px) saturate(150%);
          backdrop-filter: blur(22px) saturate(150%);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 0 rgba(0, 0, 0, .35), 0 12px 30px -24px rgba(0, 0, 0, .8);
}
.bar-in {
  max-width: var(--shell); height: 100%; margin: 0 auto;
  display: grid;
  grid-template-columns: var(--nav-w) minmax(0, 1fr) auto;
  align-items: center;
}
.brand {
  display: flex; align-items: center; gap: 12px;
  padding-left: 28px; height: 100%;
  text-decoration: none; border-radius: 8px;
}
.wm { width: 132px; height: auto; }
.sdk {
  font: 600 10.5px/1 var(--f-mono); letter-spacing: .16em;
  color: var(--text-3);
  padding: 5px 7px 4px 8px;
  border: 1px solid var(--line-2); border-radius: 6px;
}

.search { position: relative; padding-left: var(--pad-l); }
.search-field {
  position: relative; display: flex; align-items: center;
  max-width: 440px;
}
.search-field .ic {
  position: absolute; left: 12px; color: var(--text-4); pointer-events: none;
}
.search-field input {
  width: 100%; height: 38px; margin: 0;
  padding: 0 44px 0 38px;
  font: 500 14px/1 var(--f-ui); color: var(--text);
  background: var(--well);
  border: 1px solid var(--line-2); border-radius: 11px;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, .45), 0 1px 0 rgba(255, 255, 255, .04);
  -webkit-appearance: none; appearance: none;
  transition: border-color .15s, box-shadow .15s, background-color .15s;
}
.search-field input::placeholder { color: var(--text-4); }
.search-field input::-webkit-search-cancel-button { -webkit-appearance: none; }
.search-field input:focus {
  outline: none;
  border-color: rgba(224, 138, 82, .55);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, .45), 0 0 0 3px var(--cu-tint);
}
.search-field .key {
  position: absolute; right: 9px;
  pointer-events: none; transition: opacity .15s;
}
.search-field input:focus ~ .key { opacity: 0; }

.bar-end { grid-column: -2 / -1; justify-self: end; display: flex; align-items: center; gap: 6px; padding-right: 24px; }
.bar-link {
  display: inline-flex; align-items: center; gap: 7px;
  height: 34px; padding: 0 12px; border-radius: 999px;
  font: 500 12.5px/1 var(--f-mono); color: var(--text-3);
  text-decoration: none;
  transition: color .15s, background-color .15s;
}
.bar-link .ic { width: 12px; height: 12px; }
.bar-link:hover { color: var(--text); background: rgba(255, 255, 255, .05); }

.bar-btn {
  display: none; place-items: center;
  width: 40px; height: 40px; border-radius: 12px;
  background: none; border: 1px solid transparent; cursor: pointer;
  color: var(--text-2);
}
.bar-btn:hover { color: var(--text); background: rgba(255, 255, 255, .05); }
.bar-btn .ic { width: 18px; height: 18px; }

/* search results */

.results {
  position: absolute; top: calc(100% + 12px); left: var(--pad-l);
  width: min(580px, calc(100vw - 32px));
  max-height: min(72vh, 600px); overflow-y: auto; overscroll-behavior: contain;
  padding: 8px;
  border-radius: 18px;
  /* opaque: a backdrop filter inside the bar only sees the bar */
  background: linear-gradient(180deg, #25262B 0%, #1A1B1F 40%, #17181B 100%);
  border: 1px solid var(--line-2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .07), var(--deep);
  scrollbar-width: thin; scrollbar-color: var(--line-3) transparent;
}
.results[hidden] { display: none; }
.res {
  display: block; padding: 10px 12px 11px; border-radius: 11px;
  text-decoration: none; color: var(--text-2);
}
.res.on { background: rgba(255, 255, 255, .06); box-shadow: inset 2px 0 0 var(--cu); }
.res-p {
  display: block; margin-bottom: 3px;
  font: 500 10.5px/1.3 var(--f-mono); letter-spacing: .12em; text-transform: uppercase;
  color: var(--text-4);
}
.res-h { display: block; font: 650 14.5px/1.4 var(--f-ui); color: var(--text); }
.res-x {
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;
  margin-top: 3px; font: 400 13px/1.5 var(--f-ui); color: var(--text-3);
}
.res mark { background: rgba(224, 138, 82, .16); color: var(--cu-2); border-radius: 3px; padding: 0 1px; }
.res-none { padding: 18px 14px; font: 500 13.5px/1.4 var(--f-ui); color: var(--text-3); }
.res-foot {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  margin: 6px 4px 0; padding: 10px 8px 4px;
  border-top: 1px solid var(--line);
  font: 500 11px/1 var(--f-mono); color: var(--text-4);
}
.res-foot span { display: inline-flex; align-items: center; gap: 6px; }
.res-foot kbd { font-size: 10.5px; }
.res-foot kbd .ic { width: 10px; height: 10px; }

/* ------------------------------------------------------------ shell */

.shell {
  max-width: var(--shell); margin: 0 auto;
  display: grid;
  grid-template-columns: var(--nav-w) minmax(0, 1fr);
}

.nav {
  position: sticky; top: var(--bar);
  height: calc(100vh - var(--bar));
  overflow-y: auto; overscroll-behavior: contain;
  padding: 30px 18px 72px 20px;
  border-right: 1px solid var(--line);
  scrollbar-width: thin; scrollbar-color: var(--line-2) transparent;
}
.nav-sec + .nav-sec { margin-top: 26px; }
.nav-h {
  margin: 0 0 8px; padding: 0 12px;
  font: 600 10.5px/1.4 var(--f-mono); letter-spacing: .16em; text-transform: uppercase;
  color: var(--text-4);
}
.nav ul { list-style: none; margin: 0; padding: 0; }
.nav li + li { margin-top: 1px; }
.nav a {
  display: block; padding: 6px 12px; border-radius: 9px;
  font: 500 14px/1.45 var(--f-ui); color: var(--text-3);
  text-decoration: none;
  transition: color .15s, background-color .15s;
}
.nav a:hover { color: var(--text); background: rgba(255, 255, 255, .035); }
.nav a[aria-current="page"] {
  color: var(--cu-2); font-weight: 600;
  background: var(--cu-tint);
  box-shadow: inset 0 0 0 1px rgba(224, 138, 82, .2);
}
.nav-foot { display: none; }

.veil { display: none; }

.main { min-width: 0; padding: 44px var(--pad-r) 88px var(--pad-l); }

.page {
  display: grid;
  grid-template-columns: minmax(0, var(--region)) var(--toc-w);
  column-gap: var(--toc-gap);
}

.doc { min-width: 0; }
.doc > * { max-width: var(--measure); }
.doc > .pair, .doc > .fig.wide { max-width: none; margin-right: calc(-1 * var(--bleed)); }

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

.doc-head {
  position: relative;
  margin-bottom: 40px; padding-bottom: 34px;
}
.doc-head::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px;
  background: linear-gradient(90deg, var(--line-2), var(--line-2) 60%, transparent);
}
.crumb {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0 10px;
  margin: 0 0 18px;
  font: 500 11px/1.5 var(--f-mono); letter-spacing: .14em; text-transform: uppercase;
  color: var(--text-4);
}
.crumb .sep { width: 1px; height: 11px; background: var(--line-3); transform: skewX(-18deg); }
.crumb .here { color: var(--text-3); }

.doc h1 {
  margin: 0 0 16px;
  font: 800 44px/1.08 var(--f-ui); letter-spacing: -.032em;
  color: var(--text);
}
.lede {
  margin: 0; max-width: 680px;
  font: 400 19px/1.6 var(--f-ui); color: var(--text-2);
  letter-spacing: -.005em;
}
.home .doc h1 { font-size: 52px; }
.home .lede { font-size: 20px; }

/* ------------------------------------------------------------ text */

.doc h2, .doc h3, .doc h4 { color: var(--text); scroll-margin-top: calc(var(--bar) + 24px); }
.doc h2 {
  margin: 64px 0 16px;
  font: 750 26px/1.25 var(--f-ui); letter-spacing: -.022em;
}
.doc h3 {
  margin: 44px 0 12px;
  font: 700 19px/1.35 var(--f-ui); letter-spacing: -.012em;
}
.doc h4 {
  margin: 32px 0 8px;
  font: 700 16px/1.45 var(--f-ui); letter-spacing: -.005em;
}
.doc-head + h2, .doc-head + h3 { margin-top: 0; }

.anchor {
  display: inline-grid; place-items: center; vertical-align: middle;
  width: 26px; height: 26px; margin-left: 6px; border-radius: 8px;
  color: var(--text-4); text-decoration: none;
  opacity: 0; transition: opacity .15s, color .15s, background-color .15s;
}
.anchor .ic { width: 14px; height: 14px; }
h2:hover .anchor, h3:hover .anchor, h4:hover .anchor, .anchor:focus-visible { opacity: 1; }
.anchor:hover { color: var(--cu-2); background: var(--cu-tint); }

/* signature headings (reference pages) */
.doc .sig {
  font-family: var(--f-mono); letter-spacing: 0;
  padding: 14px 16px 14px 18px;
  border-radius: 12px;
  background: var(--pane), var(--bg-2);
  border: 1px solid var(--line-2);
  box-shadow: var(--pane-edge);
  position: relative;
}
.doc .sig::before {
  content: ""; position: absolute; left: -1px; top: 12px; bottom: 12px; width: 2px;
  border-radius: 2px; background: var(--cu);
}
.doc h2.sig { font-size: 15.5px; line-height: 1.6; margin-top: 56px; }
.doc h3.sig { font-size: 14px; line-height: 1.6; margin-top: 40px; }
.doc h4.sig { font-size: 13.5px; line-height: 1.6; }
.sig .sig-n { color: var(--text); font-weight: 600; }
.sig .sig-a { color: var(--text-3); font-weight: 400; }
.sig .anchor { width: 22px; height: 22px; margin-left: 4px; }

.doc p { margin: 0 0 18px; color: var(--text-2); }
.doc strong { color: var(--text); font-weight: 650; }
.doc em { font-style: italic; }

.doc a {
  color: var(--cu);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  text-decoration-color: rgba(224, 138, 82, .38);
  transition: color .15s, text-decoration-color .15s;
}
.doc a:hover { color: var(--cu-2); text-decoration-color: var(--cu-2); }
.doc a:active { color: var(--cu-3); }
.pending {
  color: var(--text-2);
  text-decoration: underline dotted;
  text-decoration-color: var(--line-3);
  text-underline-offset: 3px;
}

.doc ul, .doc ol { list-style: none; margin: 0 0 22px; padding: 0; }
.doc li { position: relative; margin: 0 0 8px; padding-left: 26px; color: var(--text-2); }
.doc li > p { margin-bottom: 8px; }
.doc li > :last-child { margin-bottom: 0; }
.doc li > ul, .doc li > ol { margin: 8px 0 0; }
.doc ul > li::before {
  content: ""; position: absolute; left: 8px; top: .74em;
  width: 5px; height: 5px; border-radius: 1.5px;
  background: var(--text-4);
}
.doc ol { counter-reset: n; }
.doc ol > li { counter-increment: n; padding-left: 32px; }
.doc ol > li::before {
  content: counter(n);
  position: absolute; left: 0; top: .2em;
  display: grid; place-items: center;
  width: 21px; height: 21px; border-radius: 7px;
  font: 600 11px/1 var(--f-mono); color: var(--text-2);
  background: rgba(255, 255, 255, .05);
  border: 1px solid var(--line-2);
}

.doc hr {
  height: 1px; margin: 40px 0; border: 0;
  background: linear-gradient(90deg, transparent, var(--line-2) 12%, var(--line-2) 88%, transparent);
}

.doc :not(pre) > code {
  font: 500 .85em/1 var(--f-mono);
  font-feature-settings: "zero" 1;
  padding: .2em .42em .18em;
  border-radius: 6px;
  color: var(--text);
  background: rgba(255, 255, 255, .045);
  border: 1px solid var(--line);
  white-space: nowrap;
}
/* a token that can be wider than the column may break, nothing else does */
.doc code.brk { white-space: normal; overflow-wrap: anywhere; }
.doc a code { color: inherit; }
.doc .sig code { font: inherit; padding: 0; background: none; border: 0; white-space: normal; }

kbd {
  display: inline-block; min-width: 1.75em;
  padding: .16em .5em .18em;
  font: 500 .8em/1.25 var(--f-mono); text-align: center;
  color: var(--text);
  background: linear-gradient(180deg, #26272C, #1B1C20);
  border: 1px solid var(--line-2); border-bottom-color: rgba(0, 0, 0, .6);
  border-radius: 6px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .09), 0 1px 0 rgba(0, 0, 0, .55), 0 3px 6px -3px rgba(0, 0, 0, .7);
  vertical-align: .06em;
  white-space: nowrap;
}
kbd .ic { display: inline-block; vertical-align: -.1em; }

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

.code {
  position: relative;
  margin: 8px 0 26px;
  border-radius: 12px;
  background: var(--pane), var(--bg-2);
  border: 1px solid var(--line-2);
  box-shadow: var(--pane-edge), 0 18px 36px -26px rgba(0, 0, 0, .9);
  overflow: hidden;
}
.code-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  height: 38px; padding: 0 7px 0 16px;
  border-bottom: 1px solid var(--line);
}
.code-lang {
  font: 600 10.5px/1 var(--f-mono); letter-spacing: .16em; text-transform: uppercase;
  color: var(--text-4);
}
.copy {
  display: inline-flex; align-items: center; gap: 6px;
  height: 26px; padding: 0 10px 0 9px; border-radius: 999px;
  font: 500 11.5px/1 var(--f-mono); color: var(--text-3);
  background: none; border: 1px solid transparent; cursor: pointer;
  transition: color .15s, background-color .15s, border-color .15s;
}
.copy .ic { width: 13px; height: 13px; }
.copy .ok { display: none; }
.copy:hover { color: var(--text); background: rgba(255, 255, 255, .05); border-color: var(--line); }
.copy.done { color: var(--good); }
.copy.done .ok { display: block; }
.copy.done .cp { display: none; }

.code pre {
  margin: 0; padding: 16px 20px 18px;
  overflow-x: auto;
  font: 400 13px/1.72 var(--f-mono);
  font-feature-settings: "zero" 1;
  color: var(--text);
  tab-size: 4;
  scrollbar-width: thin; scrollbar-color: var(--line-3) transparent;
}
.code pre code { font: inherit; }

/* monochrome highlighting: weight and the text opacity steps */
.t-k { font-weight: 600; color: var(--text); }
.t-s { color: var(--text-2); }
.t-n { color: var(--text-2); }
.t-c { color: var(--text-4); }
.t-p { color: var(--text-3); }
.t-d { color: var(--text-2); }
.t-cmd { font-weight: 600; }
.t-f { color: var(--text-2); }

/* command lines: a copper prompt drawn in CSS, never part of the copied text */
.ln.pr::before {
  content: "";
  display: inline-block;
  width: 6px; height: 6px; margin: 0 15px 0 1px;
  border-right: 1.6px solid var(--cu); border-bottom: 1.6px solid var(--cu);
  transform: translateY(-.14em) rotate(-45deg);
}
.ln.np { padding-left: 22px; }

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

.fig { margin: 14px 0 34px; }
.fig .zoom {
  position: relative; display: block;
  width: max-content; max-width: 100%;
  border-radius: 12px; overflow: hidden;
  background: var(--bg-2);
  box-shadow: var(--deep);
  cursor: zoom-in;
  text-decoration: none;
}
.fig .zoom::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, .30) 0%, rgba(255, 255, 255, .11) 14%, rgba(255, 255, 255, .06) 45%, rgba(255, 255, 255, .05) 85%, rgba(255, 255, 255, .09) 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
}
/* the width and height attributes carry the CSS size (pixels / 2.4 for the
   console, / 2 for renders); nothing here may scale an image above them */
.fig img { display: block; max-width: 100%; height: auto; }
/* product renders are shot on black: no frame, the black melts into the ground */
.fig.render .zoom { background: none; box-shadow: none; border-radius: 0; overflow: visible; }
.fig.render .zoom::after { display: none; }
.fig.render img {
  mix-blend-mode: lighten;
  -webkit-mask-image: linear-gradient(180deg, #000 80%, transparent), linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
  -webkit-mask-composite: source-in;
          mask-image: linear-gradient(180deg, #000 80%, transparent), linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
          mask-composite: intersect;
}
.zoom-badge {
  position: absolute; right: 12px; top: 12px; z-index: 1;
  display: grid; place-items: center;
  width: 34px; height: 34px; border-radius: 11px;
  color: var(--text);
  background: rgba(20, 21, 24, .66);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border: 1px solid var(--line-2);
  box-shadow: 0 6px 16px -6px rgba(0, 0, 0, .7);
  opacity: 0; transform: translateY(-3px);
  transition: opacity .18s, transform .22s var(--ease);
}
.zoom:hover .zoom-badge, .zoom:focus-visible .zoom-badge { opacity: 1; transform: none; }
.fig figcaption {
  margin-top: 14px; padding-left: 2px;
  font: 400 13.5px/1.55 var(--f-ui); color: var(--text-3);
}
.fig.wide figcaption { max-width: var(--measure); }

/* ------------------------------------------------------------ console and python */

.pair {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 5fr);
  margin: 14px 0 30px;
  border-radius: 16px;
  background: var(--pane), var(--bg-2);
  border: 1px solid var(--line-2);
  box-shadow: var(--pane-edge), 0 24px 48px -32px rgba(0, 0, 0, .9);
}
.pair-side { min-width: 0; padding: 18px 18px 20px; }
.pair-side + .pair-side { border-left: 1px solid var(--line-2); }
.pair-side > :last-child { margin-bottom: 0; }
.pair-chip {
  display: inline-flex; align-items: center; gap: 7px;
  height: 24px; margin: 0 0 14px; padding: 0 10px 0 8px;
  border-radius: 999px;
  font: 600 10.5px/1 var(--f-mono); letter-spacing: .14em; text-transform: uppercase;
  color: var(--cu-2);
  background: var(--cu-tint);
  border: 1px solid var(--cu-line);
}
.pair-chip .ic { width: 13px; height: 13px; }
.pair p { font-size: 15px; line-height: 1.66; margin-bottom: 14px; }
.pair .fig { margin: 16px 0 0; }
.pair .fig .zoom { box-shadow: 0 16px 32px -18px rgba(0, 0, 0, .85); border-radius: 10px; }
.pair .code {
  margin: 4px 0 0;
  background: var(--well);
  border-color: rgba(0, 0, 0, .28);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, .45), 0 1px 0 rgba(255, 255, 255, .045);
}
.pair .code + p, .pair p + .code { margin-top: 12px; }
.pair .code pre { font-size: 12px; line-height: 1.7; padding: 13px 14px 15px; }
.pair .code-bar { height: 34px; }

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

.doc .cards {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px;
  margin: 12px 0 34px; padding: 0; list-style: none;
}
.doc .cards > li { margin: 0; padding: 0; }
.doc .cards > li::before { display: none; }
.doc .card {
  position: relative; display: flex; flex-direction: column; gap: 6px;
  height: 100%; padding: 16px 46px 18px 18px;
  border-radius: 14px;
  background: var(--pane), var(--bg-2);
  border: 1px solid var(--line);
  box-shadow: var(--pane-edge);
  color: inherit; text-decoration: none;
  transition: border-color .2s, background-color .2s, box-shadow .2s;
}
.card-t { font: 650 15.5px/1.35 var(--f-ui); color: var(--text); letter-spacing: -.005em; transition: color .2s; }
.card-s { font: 400 13.5px/1.55 var(--f-ui); color: var(--text-3); }
.card .chev {
  position: absolute; right: 16px; top: 18px;
  width: 16px; height: 16px; color: var(--text-4);
  transition: transform .22s var(--ease), color .2s;
}
.doc a.card:hover {
  border-color: var(--line-3);
  background: var(--pane), var(--bg-3);
  box-shadow: var(--pane-edge), 0 18px 36px -24px rgba(0, 0, 0, .9);
}
.doc a.card:hover .card-t { color: var(--cu-2); }
.doc a.card:hover .chev { color: var(--cu); transform: translateX(3px); }
.doc a.card:focus-visible { outline-offset: 3px; border-radius: 14px; }
.card.pending { opacity: .5; }

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

.callout {
  position: relative;
  display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 12px;
  margin: 8px 0 26px; padding: 14px 18px 14px 16px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .028);
  border: 1px solid var(--line);
}
.callout::before {
  content: ""; position: absolute; left: -1px; top: 10px; bottom: 10px; width: 2px;
  border-radius: 2px; background: var(--line-3);
}
.callout > .ic { width: 18px; height: 18px; margin-top: 3px; color: var(--text-3); }
.callout-b > :last-child { margin-bottom: 0; }
.callout p { font-size: 15px; line-height: 1.66; margin-bottom: 10px; }
.callout-t { font-weight: 700; }
.callout.tip { background: rgba(224, 138, 82, .055); border-color: rgba(224, 138, 82, .16); }
.callout.tip::before { background: var(--cu); }
.callout.tip > .ic, .callout.tip .callout-t { color: var(--cu-2); }
.callout.careful { background: rgba(245, 179, 66, .055); border-color: rgba(245, 179, 66, .17); }
.callout.careful::before { background: var(--warn); }
.callout.careful > .ic, .callout.careful .callout-t { color: var(--warn); }
.quote {
  margin: 8px 0 24px; padding: 2px 0 2px 18px;
  border-left: 2px solid var(--line-2);
}

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

.table-wrap {
  margin: 10px 0 30px;
  overflow-x: auto;
  scrollbar-width: thin; scrollbar-color: var(--line-3) transparent;
}
.doc table { width: 100%; border-collapse: collapse; font-size: 14.5px; line-height: 1.55; }
.doc th {
  padding: 0 18px 10px 0; text-align: left; vertical-align: bottom;
  font: 600 10.5px/1.35 var(--f-mono); letter-spacing: .14em; text-transform: uppercase;
  color: var(--text-4);
  border-bottom: 1px solid var(--line-3);
  white-space: nowrap;
}
.doc td {
  padding: 11px 18px 11px 0; vertical-align: top;
  color: var(--text-2);
  border-bottom: 1px solid var(--line);
}
.doc th:last-child, .doc td:last-child { padding-right: 0; }
.doc tr:last-child td { border-bottom-color: var(--line-2); }
.doc td[data-a="r"], .doc th[data-a="r"] { text-align: right; }
.doc td[data-a="c"], .doc th[data-a="c"] { text-align: center; }
.doc table.c1 td:first-child {
  font-family: var(--f-mono); font-size: 13px; line-height: 1.7; color: var(--text);
  min-width: 9em;
}
.doc table.c1 td:first-child code {
  font-size: 13px; padding: 0; background: none; border: 0;
}
.doc table.c1 td:first-child kbd { font-size: 11.5px; }

/* ------------------------------------------------------------ diagrams */

.diagram {
  margin: 14px 0 32px; padding: 22px 20px 20px;
  border-radius: 16px;
  background: radial-gradient(120% 70% at 10% -10%, rgba(255, 255, 255, .03), transparent 60%), var(--pane), #111215;
  border: 1px solid var(--line);
  box-shadow: var(--pane-edge);
  overflow-x: auto;
  scrollbar-width: thin; scrollbar-color: var(--line-3) transparent;
}
.diagram svg { width: 100%; min-width: 620px; height: auto; }
.dg-l { font-family: var(--f-mono); font-size: 10px; font-weight: 600; letter-spacing: .16em; fill: var(--text-4); }
.dg-t { font-family: var(--f-ui); font-size: 13.5px; font-weight: 700; fill: var(--text); }
.dg-s { font-family: var(--f-ui); font-size: 12px; font-weight: 500; fill: var(--text-3); }
.dg-s2 { font-family: var(--f-ui); font-size: 12.5px; font-weight: 500; fill: var(--text-2); }
.dg-m { font-family: var(--f-mono); font-size: 12px; font-weight: 500; fill: var(--text-2); }
.dg-mt { font-family: var(--f-mono); font-size: 13px; font-weight: 600; fill: var(--text); }
.dg-mc { font-family: var(--f-mono); font-size: 11.5px; font-weight: 500; fill: var(--cu-2); }
.dg-ct { font-family: var(--f-mono); font-size: 11px; font-weight: 500; fill: var(--text-2); }
.dg-box { fill: #18191D; stroke: var(--line-2); stroke-width: 1; }
.dg-box2 { fill: rgba(255, 255, 255, .025); stroke: var(--line); stroke-width: 1; }
.dg-hi { fill: rgba(224, 138, 82, .075); stroke: rgba(224, 138, 82, .5); stroke-width: 1; }
.dg-lane { fill: rgba(255, 255, 255, .018); stroke: var(--line-2); stroke-width: 1; stroke-dasharray: 3 4; }
.dg-chip { fill: #202126; stroke: var(--line-2); stroke-width: 1; }
.dg-w { fill: none; stroke: var(--line-3); stroke-width: 1.3; }
.dg-wd { fill: none; stroke: var(--line-2); stroke-width: 1.2; stroke-dasharray: 3 4; }
.dg-wc { fill: none; stroke: var(--cu); stroke-width: 1.5; }
.dg-h { fill: var(--line-3); stroke: none; }
.dg-hc { fill: var(--cu); stroke: none; }
.dg-hr { fill: none; stroke: var(--line); stroke-width: 1; }
.dg-ic { fill: none; stroke: var(--text-3); stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; }
.dg-node { fill: var(--bg-3); stroke: var(--line-3); stroke-width: 1; }
.dg-led0 { fill: none; stroke: var(--text-3); stroke-width: 1.6; }
.dg-led-cu { fill: var(--cu); }
.dg-led-good { fill: var(--good); }
.dg-led-warn { fill: var(--warn); }
.dg-glow-cu { fill: rgba(224, 138, 82, .22); }
.dg-glow-good { fill: rgba(55, 200, 160, .18); }
.dg-glow-warn { fill: rgba(245, 179, 66, .18); }

/* ------------------------------------------------------------ on this page */

.toc {
  position: sticky; top: calc(var(--bar) + 44px);
  align-self: start;
  max-height: calc(100vh - var(--bar) - 88px);
  overflow-y: auto; overscroll-behavior: contain;
  scrollbar-width: none;
  transition: opacity .22s var(--ease), visibility 0s linear 0s;
}
.toc::-webkit-scrollbar { display: none; }
/* the column yields to figures and pairs that span into it:
   it ends above them, moves below them, or fades while they pass */
.toc.clipped {
  -webkit-mask-image: linear-gradient(180deg, #000 calc(100% - 36px), transparent);
          mask-image: linear-gradient(180deg, #000 calc(100% - 36px), transparent);
}
.toc.tucked {
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity .16s var(--ease), visibility 0s linear .16s;
}
.toc-h {
  margin: 0 0 12px;
  font: 600 10.5px/1.4 var(--f-mono); letter-spacing: .16em; text-transform: uppercase;
  color: var(--text-4);
}
.toc ol { position: relative; list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line-2); }
.toc li { margin: 0; }
.toc a {
  display: block; padding: 5px 0 5px 15px;
  font: 500 13px/1.45 var(--f-ui); color: var(--text-4);
  text-decoration: none;
  transition: color .18s;
}
.toc .l3 a { padding-left: 27px; font-size: 12.5px; }
.toc a:hover { color: var(--text-2); }
.toc a.on { color: var(--text); }
.toc a.sig-l { font-family: var(--f-mono); font-size: 12px; }
.toc-ind {
  position: absolute; left: -1px; top: 0; width: 2px; height: 0;
  border-radius: 2px; background: var(--cu);
  box-shadow: 0 0 10px rgba(224, 138, 82, .55);
  transition: transform .28s var(--ease), height .28s var(--ease), opacity .2s;
  opacity: 0;
}
.toc-ind.on { opacity: 1; }

/* ------------------------------------------------------------ pager and foot */

.pager {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px;
  margin: 72px 0 0; padding-top: 28px;
  border-top: 1px solid var(--line);
}
.doc .pager a {
  display: flex; flex-direction: column; gap: 5px;
  padding: 14px 18px 16px; border-radius: 14px;
  background: var(--pane), var(--bg-2);
  border: 1px solid var(--line);
  box-shadow: var(--pane-edge);
  color: inherit; text-decoration: none;
  transition: border-color .2s, background-color .2s;
}
.pager .next { grid-column: 2; align-items: flex-end; text-align: right; }
.pg-l {
  display: inline-flex; align-items: center; gap: 6px;
  font: 600 10.5px/1.4 var(--f-mono); letter-spacing: .14em; text-transform: uppercase;
  color: var(--text-4);
}
.pg-l .ic { width: 12px; height: 12px; transition: transform .22s var(--ease); }
.pg-t { font: 650 15.5px/1.35 var(--f-ui); color: var(--text); transition: color .2s; }
.doc .pager a:hover { border-color: var(--line-3); background: var(--pane), var(--bg-3); }
.doc .pager a:hover .pg-t { color: var(--cu-2); }
.pager .prev:hover .ic { transform: translateX(-3px); }
.pager .next:hover .ic { transform: translateX(3px); }

.foot {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 24px;
  margin-top: 40px; padding-top: 20px;
  border-top: 1px solid var(--line);
  font: 500 11px/1.5 var(--f-mono); letter-spacing: .12em; text-transform: uppercase;
  color: var(--text-4);
}
.doc .foot a { color: var(--text-3); text-decoration: none; }
.doc .foot a:hover { color: var(--text); }

/* ------------------------------------------------------------ lightbox */

.lb {
  position: fixed; inset: 0; z-index: 100;
  overflow: hidden; touch-action: none;
  -webkit-user-select: none; user-select: none;
}
.lb[hidden] { display: none; }
.lb-veil {
  position: absolute; inset: 0;
  background: rgba(8, 9, 10, .9);
  -webkit-backdrop-filter: blur(14px) saturate(120%);
          backdrop-filter: blur(14px) saturate(120%);
  opacity: 0; transition: opacity .34s var(--ease);
}
.lb.show .lb-veil { opacity: 1; }
.lb-img {
  position: absolute; left: 0; top: 0;
  max-width: none; transform-origin: 0 0;
  border-radius: 10px;
  box-shadow: 0 50px 120px -40px rgba(0, 0, 0, .95), 0 0 0 1px var(--line-2);
  cursor: zoom-in;
  -webkit-user-drag: none;
}
.lb.bare .lb-img { box-shadow: none; border-radius: 0; }
.lb.zoomed .lb-img { cursor: grab; border-radius: 0; }
.lb.dragging .lb-img { cursor: grabbing; }
.lb.fixed .lb-img { cursor: zoom-out; }
.lb-bar {
  position: absolute; top: 14px; right: 14px; z-index: 2;
  display: flex; align-items: center; gap: 2px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(28, 29, 32, .72);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
          backdrop-filter: blur(20px) saturate(150%);
  border: 1px solid var(--line-2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .07), 0 16px 32px -16px rgba(0, 0, 0, .8);
  opacity: 0; transform: translateY(-6px);
  transition: opacity .3s var(--ease), transform .3s var(--ease);
}
.lb.show .lb-bar { opacity: 1; transform: none; }
.lb-scale {
  min-width: 44px; padding: 0 8px 0 12px; text-align: center;
  font: 600 11px/1 var(--f-mono); letter-spacing: .08em; color: var(--text-3);
}
.lb-btn {
  display: grid; place-items: center;
  width: 36px; height: 36px; border-radius: 50%;
  background: none; border: 0; cursor: pointer;
  color: var(--text-2);
  transition: color .15s, background-color .15s;
}
.lb-btn:hover { color: var(--text); background: rgba(255, 255, 255, .08); }
.lb-btn .ic { width: 18px; height: 18px; }
.lb-btn[hidden] { display: none; }
.lb .z-out { display: none; }
.lb.zoomed .z-in { display: none; }
.lb.zoomed .z-out { display: block; }
.lb-cap {
  position: absolute; left: 50%; bottom: 18px; z-index: 2;
  max-width: min(720px, calc(100vw - 32px));
  padding: 9px 14px; border-radius: 12px;
  transform: translateX(-50%);
  font: 500 13px/1.45 var(--f-ui); color: var(--text-2);
  background: rgba(28, 29, 32, .72);
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  border: 1px solid var(--line-2);
  opacity: 0; transition: opacity .3s var(--ease);
}
.lb.show .lb-cap { opacity: 1; }
.lb.zoomed .lb-cap { opacity: 0; }
.lb-cap[hidden] { display: none; }
.lb-spin {
  position: absolute; left: 50%; top: 50%; width: 22px; height: 22px; margin: -11px 0 0 -11px;
  border-radius: 50%; border: 2px solid rgba(244, 183, 142, .25); border-top-color: var(--cu-2);
  animation: spin .9s linear infinite;
}
.lb-spin[hidden] { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }
html.lb-lock { overflow: hidden; }

/* ------------------------------------------------------------ responsive */

@media (min-width: 1280px) {
  :root { --bleed: calc(var(--toc-w) + var(--toc-gap)); }
}

@media (max-width: 1439px) {
  :root { --nav-w: 232px; --pad-l: 44px; --pad-r: 28px; --toc-w: 200px; --toc-gap: 36px; }
}

@media (max-width: 1279px) {
  .page { grid-template-columns: minmax(0, 1fr); }
  .toc { display: none; }
}

@media (max-width: 1023px) {
  :root { --pad-l: 32px; --pad-r: 32px; }
  .shell { grid-template-columns: minmax(0, 1fr); }
  .bar-in { grid-template-columns: auto auto minmax(0, 1fr) auto; }
  .bar-btn { display: inline-grid; }
  .menu-btn { margin-left: 10px; }
  .brand { padding-left: 6px; }
  .search { padding-left: 24px; }
  .results { left: 24px; }
  .page { margin: 0 auto; max-width: var(--measure); grid-template-columns: minmax(0, 1fr); }
  .doc > * { max-width: none; }
  .search-btn { display: none; }

  .nav {
    position: fixed; top: var(--bar); left: 0; bottom: 0; z-index: 55;
    width: min(320px, 86vw); height: auto;
    padding: 24px 16px 40px;
    background: linear-gradient(180deg, rgba(30, 31, 35, .96), rgba(18, 19, 22, .97));
    -webkit-backdrop-filter: blur(24px) saturate(150%);
            backdrop-filter: blur(24px) saturate(150%);
    border-right: 1px solid var(--line-2);
    box-shadow: 30px 0 60px -30px rgba(0, 0, 0, .9);
    transform: translateX(-102%); visibility: hidden;
    transition: transform .3s var(--ease), visibility 0s linear .3s;
  }
  .nav-open .nav { transform: none; visibility: visible; transition: transform .3s var(--ease), visibility 0s; }
  .nav-foot { display: block; margin-top: 30px; padding: 18px 12px 0; border-top: 1px solid var(--line); }
  .nav .nav-foot a { display: inline-flex; align-items: center; gap: 7px; padding: 0; font: 500 12.5px/1 var(--f-mono); color: var(--text-3); background: none; }
  .nav-foot .ic { width: 12px; height: 12px; }
  .veil {
    display: block; position: fixed; inset: var(--bar) 0 0 0; z-index: 54;
    background: rgba(8, 9, 10, .55);
    opacity: 0; pointer-events: none; transition: opacity .3s var(--ease);
  }
  .nav-open .veil { opacity: 1; pointer-events: auto; }
  .pair { grid-template-columns: minmax(0, 1fr); }
  .pair-side + .pair-side { border-left: 0; border-top: 1px solid var(--line-2); }
  .pair .code pre { font-size: 12.5px; }
}

@media (max-width: 719px) {
  .doc .cards { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 639px) {
  :root { --pad-l: 20px; --pad-r: 20px; --bar: 56px; }
  .doc code.lng { white-space: normal; overflow-wrap: anywhere; }
  .bar-link { display: none; }
  .search-btn { display: inline-grid; }
  .bar-end { padding-right: 10px; }
  .menu-btn { margin-left: 6px; }
  .wm { width: 112px; }
  .search {
    position: fixed; left: 0; right: 0; top: var(--bar);
    padding: 12px 16px;
    background: linear-gradient(180deg, #1D1E22, #16171A);
    border-bottom: 1px solid var(--line-2);
    box-shadow: 0 24px 40px -24px rgba(0, 0, 0, .9);
    transform: translateY(-8px); opacity: 0; visibility: hidden;
    transition: transform .22s var(--ease), opacity .22s var(--ease), visibility 0s linear .22s;
  }
  .search-open .search { transform: none; opacity: 1; visibility: visible; transition: transform .22s var(--ease), opacity .22s var(--ease), visibility 0s; }
  .search-field { max-width: none; }
  .search-field .key { display: none; }
  .search-field input { font-size: 16px; padding-right: 14px; }
  .results {
    position: static; width: auto; margin-top: 10px;
    max-height: calc(100vh - var(--bar) - 90px);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .07);
  }
  .res-foot { display: none; }

  .main { padding-top: 30px; padding-bottom: 64px; }
  .crumb { margin-bottom: 14px; font-size: 10.5px; }
  .doc h1, .home .doc h1 { font-size: 34px; }
  .lede, .home .lede { font-size: 17.5px; }
  .doc-head { margin-bottom: 30px; padding-bottom: 26px; }
  .doc h2 { font-size: 23px; margin-top: 52px; }
  .doc h3 { font-size: 18px; }
  .doc p, .doc li { font-size: 15.5px; }
  .code { border-radius: 10px; }
  .code pre { font-size: 12.5px; padding: 14px 16px 16px; }
  .pair-side { padding: 16px 16px 18px; }
  .fig .zoom { border-radius: 10px; }
  .diagram { padding: 16px 14px 14px; border-radius: 14px; }
  .pager { grid-template-columns: minmax(0, 1fr); }
  .pager .next { grid-column: 1; }
  .doc table { font-size: 14px; }
}

@media (max-width: 380px) {
  :root { --pad-l: 16px; --pad-r: 16px; }
  .sdk { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0s !important; transition-delay: 0s !important; animation-duration: 0s !important; }
}
