/* Nexy docs, vanilla. A monochrome documentation site: near-white paper in the light, near-black
   in the dark, one ink accent, rounded cards and a floating dark bar copied from the starter. */

:root {
  color-scheme: light;
  --bg: #fafafa;
  --card: #fefefe;
  --paper: #ffffff;
  --soft: #f5f5f5;
  --ink: #0a0a0a;
  --muted: #737373;
  --line: rgba(153, 153, 153, 0.2);
  --line-strong: rgba(115, 115, 115, 0.35);
  --accent: #0a0a0a;
  --signal: #0f766e;
  --on-accent: #fafafa;
  --code-bg: #f5f5f5;
  /* A code block is a dark panel in both themes, with a bar that names the file. */
  --pre-bg: #0d1017;
  --pre-head: #151922;
  --pre-line: rgba(255, 255, 255, 0.09);
  --pre-ink: #e6e8ee;
  --pre-muted: #8b93a7;
  --mark: rgba(10, 10, 10, 0.07);
  /* The bar of the starter: ink in both themes, so the wordmark is always white. */
  /* The bar follows the theme, flat, with a rule under it. */
  --bg-page: #f1f1f0;
  --header: var(--bg);
  --header-ink: var(--ink);
  --header-muted: var(--muted);
  --header-line: var(--line);
  /* The dots of a callout are the only colour the pages keep. */
  --note: #0a9d8f;
  --tip: #15803d;
  --important: #7c3aed;
  --warning: #c2740b;
  --caution: #dc2626;
  --top: 52px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --grid: rgba(0, 0, 0, 0.05);
  --glow-a: rgba(15, 118, 110, 0.10);
  --glow-b: rgba(0, 0, 0, 0.04);
  --side: 268px;
  --toc: 224px;
  --page: 820px;
  --radius: 0.5rem;
  --sans: "Geist", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg-page: #050505;
  --grid: rgba(255, 255, 255, 0.05);
  --glow-a: rgba(63, 224, 200, 0.10);
  --glow-b: rgba(255, 255, 255, 0.04);
  --bg: #050505;
  --card: #0a0a0a;
  --paper: #0d0d0d;
  --soft: #141414;
  --ink: #fafafa;
  --muted: #999999;
  --line: rgba(128, 128, 128, 0.2);
  --line-strong: rgba(160, 160, 160, 0.35);
  --accent: #fafafa;
  --signal: #3fe0c8;
  --on-accent: #0a0a0a;
  --code-bg: #0f0f0f;
  --mark: rgba(250, 250, 250, 0.09);
  --note: #3fe0c8;
  --tip: #4ade80;
  --important: #c4b5fd;
  --warning: #fbbf24;
  --caution: #fca5a5;
}

* { box-sizing: border-box; scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-thumb { border-radius: 999px; background: var(--line-strong); }
::-webkit-scrollbar-track { background: transparent; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--top) + 16px); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15.5px/1.7 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-color: currentColor; }
button { font: inherit; color: inherit; }
img { max-width: 100%; }
::selection { background: var(--ink); color: var(--bg); }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
[hidden] { display: none !important; }

/* The page: a grid of lines and two glows from the starter, behind a rounded panel. */
body { background: var(--bg-page); }
.shell {
  position: relative;
  display: grid;
  grid-template-columns: var(--side) minmax(0, 1fr);
  max-width: 108rem;
  margin: 0 auto;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(50% 60% at 0% 0%, var(--glow-a), transparent 70%),
    radial-gradient(40% 50% at 100% 0%, var(--glow-b), transparent 70%),
    linear-gradient(var(--grid) 1px, transparent 1px) calc(var(--mx, 0) * -8px) calc(var(--my, 0) * -8px) / 56px 56px,
    linear-gradient(90deg, var(--grid) 1px, transparent 1px) calc(var(--mx, 0) * -8px) calc(var(--my, 0) * -8px) / 56px 56px;
  -webkit-mask-image: radial-gradient(80% 90% at 20% 20%, #000, transparent);
  mask-image: radial-gradient(80% 90% at 20% 20%, #000, transparent);
}

.brand { display: inline-flex; align-items: center; color: var(--ink); text-decoration: none; }
.brand-logo { display: block; height: 1.25rem; width: auto; filter: brightness(0); }
:root[data-theme="dark"] .brand-logo { filter: brightness(0) invert(1); }
.lost-brand { margin: 1.5rem 0 0 1.5rem; }

.search-open {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  height: 2.25rem;
  padding: 0 0.5rem 0 0.65rem;
  border: 1px solid var(--line);
  border-radius: 0.6rem;
  background: var(--card);
  color: var(--muted);
  font: 400 13.5px/1 var(--sans);
  cursor: pointer;
  transition: color 0.12s ease, border-color 0.12s ease, transform 0.12s var(--ease);
}
.search-open svg { width: 15px; height: 15px; flex: none; }
.search-open span { flex: 1; text-align: left; }
.search-open kbd {
  padding: 0.15rem 0.35rem;
  border: 1px solid var(--line);
  border-radius: 0.3rem;
  color: var(--muted);
  font: 500 10.5px/1 var(--mono);
}
.search-open:hover { border-color: var(--line-strong); color: var(--ink); }
.search-open:active { transform: scale(0.98); }

/* The bar over the panel: reading progress, the source and the theme. */
.panel-bar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.6rem;
  height: var(--top);
  padding: 0 1.1rem;
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  view-transition-name: nx-bar;
}
.bar-link {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 0.5rem;
  color: var(--muted);
  transition: color 0.12s ease, background 0.12s ease, transform 0.12s var(--ease);
}
.bar-link svg { width: 18px; height: 18px; }
.bar-link:hover { color: var(--ink); background: var(--soft); }
.bar-link:active { transform: scale(0.92); }
.progress {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 2px;
  background: var(--signal);
  transform: scaleX(0);
  transform-origin: 0 50%;
}

/* The theme switch of the starter: a pill, the knob carrying the sun or the moon. */
.theme-switch {
  position: relative;
  width: 3rem;
  height: 1.75rem;
  flex: none;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
  transition: border-color 0.2s ease;
}
.theme-switch:hover { border-color: var(--header-ink); }
.theme-knob {
  position: absolute;
  top: 2px;
  left: 2px;
  display: grid;
  place-items: center;
  width: 1.375rem;
  height: 1.375rem;
  border-radius: 999px;
  background: var(--header-ink);
  color: var(--header);
  transition: transform 0.3s ease;
}
.theme-knob svg { width: 13px; height: 13px; }
:root[data-theme="dark"] .theme-knob { transform: translateX(1.25rem); }
.theme-knob .sun { display: block; }
.theme-knob .moon, :root[data-theme="dark"] .theme-knob .sun { display: none; }
:root[data-theme="dark"] .theme-knob .moon { display: block; }

.menu {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 0;
  border-radius: 0.5rem;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}
.mobilebar { display: none; }

/* Frame: the menu on the page, the content in a rounded panel, the outline inside it. */
.side {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100dvh;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 0 0.9rem 1.5rem;
  view-transition-name: nx-side;
}
.side-top {
  position: sticky;
  top: 0;
  z-index: 2;
  margin: 0 -0.9rem 0.4rem;
  padding: 0.9rem 0.9rem 0.8rem;
  background: color-mix(in srgb, var(--bg-page) 94%, transparent);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.panel {
  position: relative;
  min-width: 0;
  min-height: calc(100dvh - 1rem);
  margin: 0.5rem 0.5rem 0.5rem 0;
  overflow: clip;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: var(--paper);
}
.panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 22rem;
  pointer-events: none;
  background:
    radial-gradient(60% 70% at 82% 0%, var(--glow-a), transparent 70%),
    radial-gradient(46% 56% at 6% 0%, var(--glow-b), transparent 70%);
}
.panel-body {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--toc);
}
.toc {
  position: sticky;
  top: var(--top);
  align-self: start;
  height: calc(100dvh - var(--top) - 1rem);
  overflow: auto;
  overscroll-behavior: contain;
}
/* The area selector above the menu, drawn like the framework picker of Fumadocs. */
.side-brand { display: flex; align-items: center; justify-content: space-between; margin: 0.2rem 0.2rem 0.9rem 0.4rem; }
.side-toggle {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 0;
  border-radius: 0.5rem;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.12s ease, background 0.12s ease, transform 0.12s var(--ease);
}
.side-toggle svg { width: 18px; height: 18px; }
.side-toggle:hover { color: var(--ink); background: var(--soft); }
.side-toggle:active { transform: scale(0.92); }
.area-select { position: relative; margin: 0 0 0.6rem; }
.area-select summary {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.45rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 0.7rem;
  background: var(--card);
  cursor: pointer;
  list-style: none;
  transition: border-color 0.12s ease, background 0.12s ease;
}
.area-select summary::-webkit-details-marker { display: none; }
.area-select summary:hover { border-color: var(--line-strong); background: var(--soft); }
.area-select > summary > svg { width: 14px; height: 14px; margin-left: auto; flex: none; color: var(--muted); }
.area-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 1.9rem;
  height: 1.9rem;
  border: 1px solid color-mix(in srgb, var(--signal) 35%, var(--line));
  border-radius: 0.5rem;
  background: color-mix(in srgb, var(--signal) 12%, transparent);
  color: var(--signal);
}
.area-icon svg { width: 15px; height: 15px; }
.area-text { display: grid; min-width: 0; line-height: 1.25; }
.area-text b { font-size: 13.5px; font-weight: 600; }
.area-text small { overflow: hidden; color: var(--muted); font-size: 11.5px; text-overflow: ellipsis; white-space: nowrap; }
.area-select ul {
  position: absolute;
  inset: calc(100% + 0.35rem) 0 auto;
  z-index: 5;
  margin: 0;
  padding: 0.3rem;
  list-style: none;
  border: 1px solid var(--line-strong);
  border-radius: 0.8rem;
  background: var(--paper);
  box-shadow: 0 18px 40px -18px rgb(0 0 0 / 0.35);
  transform-origin: top;
}
.area-select[open] ul { animation: nx-pop 0.18s var(--ease) both; }
.area-select li a {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.45rem 0.5rem;
  border-radius: 0.55rem;
  color: var(--ink);
  text-decoration: none;
  transition: background 0.12s ease;
}
.area-select li a:hover { background: var(--soft); }
.area-select li a > svg { width: 14px; height: 14px; margin-left: auto; flex: none; color: var(--signal); opacity: 0; }
.area-select li a[aria-current] > svg { opacity: 1; }
.area-select li a[aria-current] { background: color-mix(in srgb, var(--signal) 8%, transparent); }

/* The menu reads like Fumadocs: a folder label, then its pages on a guide line. */
.side details.group { border-top: 1px solid var(--line); padding: 0.3rem 0 0.4rem; }
.side details.group:first-of-type { border-top: 0; padding-top: 0.45rem; }
.side summary {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  list-style: none;
  padding: 0.4rem 0.5rem;
  border-radius: 0.5rem;
  color: var(--ink);
  cursor: pointer;
  font: 600 13px/1.4 var(--sans);
  letter-spacing: 0;
  transition: background 0.12s ease;
}
.side summary::-webkit-details-marker { display: none; }
.side summary:hover { background: var(--soft); }
.side summary:focus-visible { outline: 2px solid var(--ink); outline-offset: -2px; }
.side .group-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* The dotted rule of the label is gone: the count and the chevron close the line. */
.side .group-rule { display: none; }
.side .group-count {
  flex: none;
  padding: 0.02rem 0.4rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: var(--muted);
  font: 500 10.5px/1.6 var(--mono);
  letter-spacing: 0;
}
.side .chev { flex: none; width: 13px; height: 13px; color: var(--muted); transition: transform 0.18s ease; }
.side details[open] .chev { transform: rotate(90deg); }
.side details.group ul, .toc ul { list-style: none; margin: 0; padding: 0; }
/* The pages of a folder hang from a guide line under its label. */
.side details.group > ul {
  margin: 0.15rem 0 0.2rem 0.85rem;
  padding: 0.15rem 0 0.15rem 0.65rem;
  border-left: 1px solid var(--line);
}
.side li[hidden] { display: none; }
.side a {
  display: flex;
  align-items: center;
  min-height: 1.9rem;
  padding: 0.3rem 0.55rem;
  border-radius: 0.45rem;
  color: var(--muted);
  text-decoration: none;
  font-size: 13.5px;
  line-height: 1.45;
  transition: background 0.12s ease, color 0.12s ease;
}
.side a:hover { background: var(--soft); color: var(--ink); }
.side a[aria-current="page"] {
  /* 10% keeps the text at 4.58:1 on the light theme: 13% measured 4.39:1, below AA. */
  background: color-mix(in srgb, var(--signal) 10%, transparent);
  color: var(--signal);
  font-weight: 600;
  view-transition-name: nx-current;
}
/* The folder holding the page is named in the accent, even while another folder is open. */
.side details.group:has(a[aria-current="page"]) .group-name { color: var(--signal); }
/* The head of the Nexy site's menu: what this menu is, and its version. */
.side-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  margin: 0.2rem 0.4rem 0.75rem;
}
.side-kicker {
  color: var(--muted);
  font: 500 10.5px/1.4 var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.side-version {
  padding: 0.02rem 0.4rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: var(--muted);
  font: 500 10.5px/1.6 var(--mono);
}
/* The filter of that menu, drawn like the search button: a word keeps the pages that match. */
.side-filter {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  height: 2.25rem;
  margin: 0 0 0.6rem;
  padding: 0 0.6rem;
  border: 1px solid var(--line);
  border-radius: 0.6rem;
  background: var(--card);
  color: var(--muted);
  cursor: text;
  transition: border-color 0.12s ease, color 0.12s ease;
}
.side-filter:hover { border-color: var(--line-strong); }
.side-filter:focus-within { border-color: var(--line-strong); color: var(--ink); }
.side-filter svg { width: 15px; height: 15px; flex: none; }
.side-filter input {
  flex: 1;
  min-width: 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink);
  font: 400 13.5px/1 var(--sans);
  outline: 0;
}
.side-filter input::placeholder { color: var(--muted); }
.side-filter input::-webkit-search-cancel-button { -webkit-appearance: none; }
.side-foot { margin: 1.25rem 0.2rem 0; padding-top: 1rem; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.side-foot a { display: block; min-height: 0; padding: 0.2rem 0.35rem; color: var(--muted); text-decoration: none; border-radius: 0.25rem; }
.side-foot a:hover { color: var(--ink); background: var(--soft); }
.side-empty { margin: 0.75rem 0.55rem; color: var(--muted); font-size: 12.5px; }

/* The outline: a rail down the page, the heading being read marked on it. */
.toc { padding: 1.5rem 1.4rem 3rem 0.75rem; }
.toc h2 {
  margin: 0 0 0.6rem;
  padding: 0 0 0 0.75rem;
  color: var(--muted);
  font: 550 13px/1.4 var(--sans);
  text-transform: none;
  letter-spacing: 0;
}
.toc ul { display: flex; flex-direction: column; }
.toc a {
  position: relative;
  display: block;
  padding: 0.28rem 0.5rem 0.28rem 0.8rem;
  border-left: 1px solid var(--line);
  color: var(--muted);
  text-decoration: none;
  font-size: 12.75px;
  line-height: 1.5;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.toc .l3 a { padding-left: 1.55rem; font-size: 12.25px; }
.toc a:hover { color: var(--ink); border-left-color: var(--line-strong); }
.toc a.on { color: var(--signal); border-left-color: var(--signal); font-weight: 600; }
/* The mark on the rail sits over the line, so the text never moves. */
.toc a.on::before {
  content: "";
  position: absolute;
  left: -1px;
  top: 0;
  bottom: 0;
  width: 2px;
  border-radius: 2px;
  background: var(--signal);
}
.toc .top-link { margin-top: 1rem; padding-top: 0.85rem; border-top: 1px solid var(--line); }
.toc .top-link a { border-left: 0; padding-left: 0; font: 500 10.5px/1 var(--mono); text-transform: uppercase; letter-spacing: 0.06em; }
.toc .top-link a::before { display: none; }

/* The page. */
.page { min-width: 0; padding: 1.5rem clamp(1.25rem, 3.5vw, 3rem) 6rem; }
.doc { max-width: var(--page); margin: 0 auto; }
.crumb {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0 0 1rem;
  color: var(--muted);
  font: 500 10.5px/1.4 var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.crumb a { color: var(--muted); text-decoration: none; }
.crumb a:hover { color: var(--ink); }
.doc h1 {
  margin: 0 0 0.85rem;
  font-size: clamp(2rem, 3.4vw, 2.6rem);
  font-weight: 650;
  line-height: 1.08;
  letter-spacing: -0.03em;
  text-wrap: balance;
}
.doc > h1 + p { margin-top: 0; color: var(--muted); font-size: 1.075rem; line-height: 1.65; }
/* The anchor offset comes from `scroll-padding-top` alone: adding `scroll-margin-top` here
   would land the heading 136px down, past the line where the outline marks it. */
.doc h2 {
  margin: 3.25rem 0 0.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.02em;
}
.doc h3 {
  margin: 2.1rem 0 0.5rem;
  font-size: 1.2rem;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.01em;
}
.doc h4 { margin: 1.6rem 0 0.4rem; font-size: 0.95rem; font-weight: 600; letter-spacing: 0; }
.doc h2:first-of-type { margin-top: 2.75rem; }
.doc :is(h2, h3, h4)[id]:target { text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 6px; }
.doc p, .doc li, .doc td { overflow-wrap: anywhere; }
.doc p { margin: 0.9rem 0; }
.doc ul, .doc ol { margin: 0.9rem 0; padding-left: 1.35rem; }
.doc li { margin: 0.3rem 0; }
.doc li::marker { color: var(--line-strong); }
.doc strong { font-weight: 600; }
.doc em { font-style: italic; }
.doc hr { margin: 2.5rem 0; border: 0; border-top: 1px solid var(--line); }
.doc blockquote { margin: 1.5rem 0; padding: 0.25rem 0 0.25rem 1.1rem; border-left: 2px solid var(--line-strong); color: var(--muted); }
.doc blockquote p { margin: 0.5rem 0; }
.doc code {
  padding: 0.12em 0.35em;
  border: 1px solid var(--line);
  border-radius: 0.25rem;
  background: var(--code-bg);
  color: var(--ink);
  font: 0.86em var(--mono);
  white-space: break-spaces;
}
.doc pre {
  position: relative;
  margin: 1.25rem 0 1.5rem;
  padding: 1rem 1.1rem;
  overflow: auto;
  border: 1px solid var(--pre-line);
  border-radius: 0.6rem;
  background: var(--pre-bg);
  color: var(--pre-ink);
  font: 13px/1.7 var(--mono);
  tab-size: 2;
  --t-key: #ff7b72; --t-str: #a5d6ff; --t-com: #8b949e; --t-fn: #d2a8ff; --t-num: #79c0ff;
  --t-cls: #ffa657; --t-tag: #7ee787; --t-attr: #79c0ff;
}
.doc pre code { padding: 0; border: 0; border-radius: 0; background: none; color: inherit; font: inherit; white-space: pre; }
.doc pre + p, .doc p + pre { margin-top: 1rem; }
.doc figure {
  margin: 1.5rem 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
}
.doc figcaption {
  padding: 0.5rem 1rem;
  border-bottom: 1px solid var(--line);
  background: var(--soft);
  color: var(--muted);
  font: 500 10.5px/1.5 var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
/* A named block: the bar carries the file name and the copy chip; the panel follows. */
.doc figure:not(.figure):not(.diagram) { border-color: var(--pre-line); border-radius: 0.6rem; background: var(--pre-bg); }
.doc figure:not(.figure):not(.diagram) figcaption {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.9rem;
  border-bottom: 1px solid var(--pre-line);
  background: var(--pre-head);
  color: var(--pre-muted);
  font: 500 12.5px/1.4 var(--mono);
  text-transform: none;
  letter-spacing: 0;
}
.doc figure:not(.figure):not(.diagram) figcaption::before {
  content: "";
  flex: none;
  width: 0.95rem;
  height: 0.95rem;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linejoin='round'%3E%3Cpath d='M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z'/%3E%3Cpath d='M14 3v5h5'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linejoin='round'%3E%3Cpath d='M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z'/%3E%3Cpath d='M14 3v5h5'/%3E%3C/svg%3E") center / contain no-repeat;
}
.doc figure.terminal figcaption::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 8 5 4-5 4'/%3E%3Cpath d='M13 17h6'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 8 5 4-5 4'/%3E%3Cpath d='M13 17h6'/%3E%3C/svg%3E");
}
.doc figure pre { margin: 0; border: 0; border-radius: 0; background: transparent; }
.doc figure.figure { background: var(--card); }
.doc figure.figure svg { display: block; width: 100%; height: auto; padding: 1.25rem; }
.doc figure.figure figcaption { border-bottom: 0; border-top: 1px solid var(--line); background: transparent; }
.doc figure.diagram { background: var(--soft); }
.doc .diagram figcaption { border-bottom: 1px solid var(--line); background: transparent; }
.doc .diagram pre {
  margin: 0;
  padding: 1.15rem 1.25rem;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font-size: 12.5px;
  line-height: 1.65;
}
.doc .diagram code { border: 0; background: none; font: inherit; }
.doc .diagram pre::after { display: none; }

/* Tables: a light grid, the header read as a label. */
.doc table { display: block; width: 100%; max-width: 100%; margin: 1.4rem 0; overflow-x: auto; border-collapse: collapse; font-size: 0.9rem; }
.doc th, .doc td { padding: 0.55rem 0.85rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.doc th {
  border-bottom-color: var(--line-strong);
  color: var(--muted);
  font: 600 10.5px/1.5 var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
}
.doc tr:last-child td { border-bottom: 0; }
.doc tbody tr { transition: background 0.12s ease; }
.doc tbody tr:hover td { background: var(--soft); }

/* The home page: air, a dot field, and each table row as a card. */
body[data-home] .page { position: relative; }
body[data-home] .page::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: min(54%, 34rem);
  height: 22rem;
  pointer-events: none;
  background-image: radial-gradient(var(--line-strong) 1px, transparent 1px);
  background-size: 18px 18px;
  opacity: 0.65;
  -webkit-mask-image: radial-gradient(60% 72% at 82% 0%, #000 8%, transparent 76%);
  mask-image: radial-gradient(60% 72% at 82% 0%, #000 8%, transparent 76%);
}
.doc.home h1 { max-width: 22ch; font-size: clamp(2.5rem, 5.2vw, 3.6rem); line-height: 1.02; letter-spacing: -0.035em; }
.doc.home > h1 + p { max-width: 60ch; font-size: 1.15rem; }
.doc.home h2 { border-top: 0; padding-top: 0; margin-top: 3.25rem; }
.doc.home table { border-collapse: separate; }
.doc.home thead {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  white-space: nowrap;
  border: 0;
  clip-path: inset(50%);
}
.doc.home tbody { display: grid; gap: 0.45rem; }
.doc.home tr {
  display: grid;
  grid-template-columns: minmax(9rem, 15rem) minmax(0, 1fr);
  gap: 0.1rem 1.25rem;
  align-items: baseline;
  padding: 0.7rem 0.95rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  transition: border-color 0.15s ease, background 0.15s ease;
}
.doc.home tr:hover { border-color: var(--line-strong); background: var(--soft); }
.doc.home td { display: block; padding: 0; border: 0; font-size: 0.9rem; }
.doc.home tbody tr:hover td { background: transparent; }
.doc.home td:first-child { font-weight: 550; }
.doc.home td:first-child a { color: var(--ink); text-decoration: none; }
.doc.home td:first-child a:hover { text-decoration: underline; text-decoration-color: var(--line-strong); }
.doc.home > p > code { font-size: 0.84em; }

/* The copy chip: quiet until the block is reached. */
.copy {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  padding: 0.2rem 0.45rem;
  border: 1px solid var(--pre-line);
  border-radius: 0.3rem;
  background: var(--pre-head);
  color: var(--pre-muted);
  font: 500 11px/1.4 var(--sans);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
pre:hover .copy, .copy:focus-visible { opacity: 1; }
.copy:hover { border-color: rgba(255, 255, 255, 0.28); color: var(--pre-ink); }
/* In a bar the chip sits at the right edge, always visible. */
figcaption > .copy { position: static; margin-left: auto; opacity: 1; }

/* The edit link, under a dashed rule like the end of a section. */
.source {
  margin: 3.25rem 0 0;
  padding-top: 1rem;
  border-top: 1px dashed var(--line-strong);
  color: var(--muted);
  font: 500 10.5px/1.5 var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.source { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.75rem; }
.copy-page {
  padding: 0.35rem 0.6rem;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: none;
  color: var(--muted);
  font: inherit;
  text-transform: inherit;
  letter-spacing: inherit;
  cursor: pointer;
}
.copy-page:hover { color: var(--ink); border-color: var(--ink); }
.copy-page:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.source a { color: var(--muted); text-decoration: none; }
.source a:hover { color: var(--ink); text-decoration: underline; text-decoration-color: var(--line-strong); }

/* Previous and next: two cards whose arrow moves. */
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; margin-top: 1rem; }
.pager a {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--ink);
  text-decoration: none;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.pager a[rel="next"] { flex-direction: row-reverse; text-align: right; }
.pager a:hover { border-color: var(--line-strong); background: var(--soft); }
.pager .pager-text { display: grid; gap: 0.15rem; min-width: 0; }
.pager small { color: var(--muted); font: 500 10px/1.4 var(--mono); text-transform: uppercase; letter-spacing: 0.08em; }
.pager .pager-text > span { font-weight: 500; color: var(--ink); }
.pager .pager-arrow { flex: none; display: grid; place-items: center; color: var(--muted); transition: transform 0.2s ease, color 0.2s ease; }
.pager a:hover .pager-arrow { color: var(--ink); }
.pager a[rel="prev"]:hover .pager-arrow { transform: translateX(-3px); }
.pager a[rel="next"]:hover .pager-arrow { transform: translateX(3px); }
/* The Nexy site draws the pager without the extra text wrapper. */
.pager a > small, .pager a > span:not(.pager-text):not(.pager-arrow) { display: block; }
.pager a:not(:has(.pager-text)) { display: grid; gap: 0.15rem; }

/* A callout: GitHub alerts (`> [!NOTE]`) and other asides. */
.callout {
  --callout: var(--note);
  margin: 1.5rem 0;
  padding: 0.85rem 1rem 0.9rem;
  border: 1px solid color-mix(in srgb, var(--callout) 35%, var(--line));
  border-radius: 0.75rem;
  background: color-mix(in srgb, var(--callout) 6%, var(--bg));
}
.callout p { margin: 0.35rem 0; }
.callout > :last-child { margin-bottom: 0; }
.callout-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 0.2rem !important;
  color: var(--ink);
  font: 600 14px/1.5 var(--sans);
}
.callout-title::before { content: ""; width: 0.4rem; height: 0.4rem; border-radius: 999px; background: currentColor; color: var(--callout); }
.callout-tip { --callout: var(--tip); }
.callout-important { --callout: var(--important); }
.callout-warning { --callout: var(--warning); }
.callout-caution { --callout: var(--caution); }

/* Search. */
dialog.search {
  width: min(620px, calc(100vw - 2rem));
  margin: 12vh auto 0;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 0.75rem;
  background: var(--card);
  color: var(--ink);
  box-shadow: 0 30px 80px -20px rgb(0 0 0 / 0.5);
}
dialog.search::backdrop { background: rgb(0 0 0 / 0.5); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
dialog.search form { margin: 0; }
dialog.search input { width: 100%; padding: 1rem 1.1rem; border: 0; border-bottom: 1px solid var(--line); border-radius: 0.75rem 0.75rem 0 0; background: transparent; color: inherit; font: 15.5px var(--sans); }
dialog.search input:focus { outline: 0; }
.results { list-style: none; margin: 0; padding: 0.4rem; max-height: 52vh; overflow: auto; }
.results a { display: block; padding: 0.65rem 0.75rem; border-radius: 0.4rem; color: var(--ink); text-decoration: none; }
.results a small { display: block; margin-top: 0.1rem; color: var(--muted); font: 500 10px/1.4 var(--mono); text-transform: uppercase; letter-spacing: 0.06em; }
.results a[aria-selected="true"] { background: var(--soft); box-shadow: inset 2px 0 0 var(--ink); }
.results .none { padding: 0.9rem 0.75rem; color: var(--muted); }
.hint { margin: 0; padding: 0.55rem 0.9rem; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.results .snippet { display: block; margin-top: 0.2rem; color: var(--muted); font-size: 12.5px; line-height: 1.45; }
.results mark { border-radius: 0.2rem; background: var(--mark); color: inherit; }

/* The page shown for a wrong address. */
.lost { max-width: 40rem; margin: 22vh auto 0; padding: 0 1.5rem; }
.lost h1 { margin: 0 0 1rem; font-size: clamp(2rem, 4vw, 2.6rem); font-weight: 650; line-height: 1.1; letter-spacing: -0.03em; }
.lost p { color: var(--muted); }
.button {
  display: inline-flex;
  align-items: center;
  padding: 0.6rem 1rem;
  border-radius: 0.375rem;
  background: var(--ink);
  color: var(--bg) !important;
  font: 600 10.5px/1 var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  text-decoration: none;
}
.button:hover { opacity: 0.85; }

/* A link to a heading, shown when the heading is hovered or focused. */
.doc .anchor { margin-left: 0.35em; color: var(--muted); text-decoration: none; opacity: 0; font-family: var(--mono); }
.doc .anchor::before { content: "#"; }
.doc :is(h2, h3, h4):hover .anchor, .doc .anchor:focus-visible { opacity: 1; }
@media (hover: none) { .doc .anchor { opacity: 0.5; } }

/* For keyboard users: jump over the menu. */
.skip {
  position: absolute;
  left: -9999px;
  top: 0.5rem;
  z-index: 50;
  padding: 0.5rem 0.9rem;
  border-radius: 0.375rem;
  background: var(--ink);
  color: var(--bg);
  font-weight: 600;
  text-decoration: none;
}
.skip:focus { left: 0.75rem; }
.page:focus { outline: 0; }

/* Wide screens: the window never scrolls. The menu and the panel each scroll inside themselves. */
@media (min-width: 901px) {
  html, body { height: 100%; overflow: hidden; }
  .shell { height: 100dvh; transition: grid-template-columns 0.32s var(--ease); }
  .panel {
    height: calc(100dvh - 1rem);
    min-height: 0;
    overflow: auto;
    overscroll-behavior: contain;
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--top) + 16px);
  }
  .toc { height: calc(100dvh - var(--top) - 1.5rem); }
  .side { transition: opacity 0.2s ease, transform 0.32s var(--ease); }
  html[data-side="closed"] .shell { grid-template-columns: 0 minmax(0, 1fr); }
  html[data-side="closed"] .side { opacity: 0; transform: translateX(-1rem); pointer-events: none; overflow: hidden; }
  html[data-side="closed"] .panel { margin-left: 0.5rem; }
  .bar-open { display: none; margin-right: auto; }
  html[data-side="closed"] .bar-open { display: grid; }
}
@media (max-width: 900px) {
  .side-brand .side-toggle, .bar-open { display: none; }
}

/* Narrow screens: the menu becomes a drawer, opened from a thin bar. */
.scrim {
  position: fixed;
  inset: 0;
  z-index: 25;
  background: rgb(0 0 0 / 0.5);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
body.open .scrim { opacity: 1; pointer-events: auto; }
@media (max-width: 1180px) {
  .panel-body { grid-template-columns: minmax(0, 1fr); }
  .toc { display: none; }
}
@media (max-width: 900px) {
  .shell { display: block; }
  /* Touch: every control of the menu and of the bar clears 44px. */
  .side a { min-height: 2.75rem; }
  .side summary { padding: 0.65rem 0.5rem; }
  .side-filter, .search-open { height: 2.75rem; }
  .menu, .bar-link { width: 2.75rem; height: 2.75rem; }
  .theme-switch { width: 3.25rem; height: 2rem; }
  .mobilebar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--top);
    padding: 0 0.75rem;
    background: color-mix(in srgb, var(--bg-page) 85%, transparent);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
  }
  .mobilebar .search-open { width: 2rem; padding: 0; justify-content: center; border: 0; background: transparent; }
  .side {
    position: fixed;
    z-index: 30;
    inset: 0 auto 0 0;
    width: min(310px, 86vw);
    height: auto;
    background: var(--card);
    border-right: 1px solid var(--line);
    transform: translateX(-100%);
    transition: transform 0.3s var(--ease);
  }
  body.open .side { transform: none; box-shadow: 0 20px 50px -20px rgb(0 0 0 / 0.4); }
  .panel { margin: 0 0.5rem 0.5rem; min-height: calc(100dvh - var(--top) - 0.5rem); }
  .panel-bar { top: var(--top); }
  .page { padding: 1.25rem 1.1rem 4.5rem; }
  .doc h1 { font-size: 2rem; }
  body[data-home] .page::before { display: none; }
  .doc.home tr { grid-template-columns: 1fr; }
  .pager { grid-template-columns: 1fr; }
  .pager a[rel="next"] { flex-direction: row; text-align: left; }
}
@media (max-width: 560px) {
  .doc.home h1 { font-size: 2.15rem; }
  .doc table { font-size: 0.85rem; }
}

/* Motion. Moving between pages is a tab switch: the menu and the bar stay, the content slides. */
@view-transition { navigation: auto; }
:root { interpolate-size: allow-keywords; }
::view-transition-old(root) { animation: nx-leave 0.16s ease-in both; }
::view-transition-new(root) { animation: nx-enter 0.32s var(--ease) both; }
::view-transition-group(nx-side),
::view-transition-group(nx-bar) { animation-duration: 0s; }
::view-transition-old(nx-side), ::view-transition-new(nx-side),
::view-transition-old(nx-bar), ::view-transition-new(nx-bar) { animation: none; mix-blend-mode: normal; }
::view-transition-group(nx-current) { animation-duration: 0.3s; animation-timing-function: var(--ease); }
@keyframes nx-leave { to { opacity: 0; transform: translateY(-4px); } }
@keyframes nx-enter { from { opacity: 0; transform: translateY(14px); } }

/* The theme changes with a circle that grows from the switch. */
html.theme-fade::view-transition-old(root) { animation: none; }
html.theme-fade::view-transition-new(root) { animation: nx-reveal 0.4s var(--ease) both; }
/* The menu and the bar carry their own view-transition names, which page navigation freezes.
   During a theme change they would flip before the circle reaches them, so they join it. */
html.theme-fade .side,
html.theme-fade .panel-bar,
html.theme-fade .side a[aria-current="page"] { view-transition-name: none; }
@keyframes nx-reveal {
  from { clip-path: circle(0 at var(--tx, 100%) var(--ty, 0)); }
  to { clip-path: circle(150vmax at var(--tx, 100%) var(--ty, 0)); }
}
/* Page changes already move the whole root: the article does not move a second time. */
html:active-view-transition .doc > * { animation: none; }

/* A section of the menu opens in height instead of jumping. */
.side details::details-content {
  block-size: 0;
  overflow: clip;
  transition: block-size 0.24s var(--ease), content-visibility 0.24s allow-discrete;
}
.side details[open]::details-content { block-size: auto; }

/* The search box rises in, and its first results follow one after the other. */
dialog.search[open] { animation: nx-pop 0.2s var(--ease) both; }
dialog.search[open]::backdrop { animation: nx-fade 0.2s ease both; }
dialog.search[data-fresh] .results li { animation: nx-rise 0.26s var(--ease) both; animation-delay: calc(var(--i, 0) * 22ms); }
@keyframes nx-pop { from { opacity: 0; transform: translateY(-8px) scale(0.98); } }
@keyframes nx-fade { from { opacity: 0; } }
@keyframes nx-rise { from { opacity: 0; transform: translateY(6px); } }

/* Copy: the chip confirms with a check that draws itself. */
.copy.done svg, .copy-page.done svg { width: 12px; height: 12px; margin-right: 0.25rem; vertical-align: -1px; }
.copy.done path, .copy-page.done path { stroke-dasharray: 16; stroke-dashoffset: 16; animation: nx-draw 0.28s 0.04s var(--ease) forwards; }
@keyframes nx-draw { to { stroke-dashoffset: 0; } }

/* Cards and blocks answer the pointer within 100 ms. */
.pager a, .callout, .doc figure { transition: border-color 0.15s ease, background 0.15s ease, transform 0.2s var(--ease), box-shadow 0.2s ease; }
.pager a:hover { transform: translateY(-2px); }
.pager a:active, .copy:active, .copy-page:active { transform: scale(0.97); }
.doc h2:target, .doc h3:target { animation: nx-flash 1.4s ease-out; }
@keyframes nx-flash { from { background: color-mix(in srgb, var(--signal) 18%, transparent); } }
.doc > * { animation: nx-rise 0.4s var(--ease) both; }
.doc > :nth-child(2) { animation-delay: 40ms; }
.doc > :nth-child(3) { animation-delay: 80ms; }
.doc > :nth-child(n+4) { animation-delay: 120ms; }

@media (prefers-reduced-motion: reduce) {
  html, .panel { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-delay: 0s !important; transition-duration: 0.01ms !important; }
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}

/* Code colours: Pygments classes written at build time (tok-*), so code is coloured without a script. */
:root {
  --t-key: #cf222e; --t-str: #0a3069; --t-com: #6e7781; --t-fn: #8250df; --t-num: #0550ae;
  --t-cls: #953800; --t-tag: #116329; --t-attr: #0550ae;
}
:root[data-theme="dark"] {
  --t-key: #ff7b72; --t-str: #a5d6ff; --t-com: #8b949e; --t-fn: #d2a8ff; --t-num: #79c0ff;
  --t-cls: #ffa657; --t-tag: #7ee787; --t-attr: #79c0ff;
}
[class^="tok-k"] { color: var(--t-key); }
[class^="tok-s"] { color: var(--t-str); }
[class^="tok-c"] { color: var(--t-com); font-style: italic; }
[class^="tok-m"] { color: var(--t-num); }
.tok-nf, .tok-fm, .tok-nd { color: var(--t-fn); }
.tok-nc, .tok-nn, .tok-ne, .tok-nb, .tok-bp { color: var(--t-cls); }
.tok-nt { color: var(--t-tag); }
.tok-na { color: var(--t-attr); }
.tok-err { color: inherit; background: none; border: 0; }

/* The drawer takes the page with it: nothing scrolls or takes a tab stop behind it. */
body.open { overflow: hidden; }

@media print {
  .mobilebar, .panel-bar, .side, .toc, .pager, .copy, .copy-page, .source { display: none !important; }
  .frame { display: block; padding-top: 0; }
  .page { padding: 0; }
  body[data-home] .page::before { display: none; }
}
