/* BLSE site. Palette black-crimson, type Onest + JetBrains Mono, sharp corners. */
/* fonts: self-hosted latin subsets (SIL OFL, see fonts/OFL-*.txt), copied in by tools/build.mjs */
@font-face { font-family: "Onest"; font-style: normal; font-weight: 100 900; font-display: swap; src: url(fonts/onest-latin-wght.woff2) format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 100 800; font-display: swap; src: url(fonts/jetbrains-mono-latin-wght.woff2) format("woff2"); }
:root {
  --bg: #0a0a0a;
  --surface: #121212;
  --surface-2: #181818;
  --line: #222222;
  --line-2: #2e2e2e;
  --ink: #efefef;
  --ink-2: #c9c9c9;
  --muted: #8c8c8c;
  --accent: #b11226;
  --accent-hi: #d42a3e;   /* crimson that reads on black at text sizes */
  --accent-soft: #e6b8be; /* inline code */
  --font: "Onest", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --side: 288px;
  --top: 56px;
  --pad: clamp(20px, 4vw, 56px);
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--bg); color: var(--ink); -webkit-text-size-adjust: 100%; scroll-padding-top: 24px; }
body { margin: 0; font: 400 16px/1.65 var(--font); font-feature-settings: "ss01"; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
img, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; }
::selection { background: var(--accent); color: #fff; }
:focus-visible { outline: 2px solid var(--accent-hi); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.skip { position: fixed; left: 12px; top: 12px; z-index: 100; padding: 10px 16px; background: var(--accent); color: #fff; text-decoration: none; transform: translateY(-160%); }
.skip:focus { transform: none; }

/* ---------------------------------------------------------------- sidebar */
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--side); z-index: 30;
  display: flex; flex-direction: column; gap: 16px;
  padding: 22px 16px 24px; background: var(--bg); border-right: 1px solid var(--line);
  overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--line-2) transparent;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px; text-decoration: none; min-height: 44px; }
.mark-icon { width: auto; height: 32px; flex: none; }
.brand-name { font-weight: 600; letter-spacing: .02em; font-size: 17px; }
.brand-ver { margin-left: auto; font: 500 11px/1 var(--mono); color: var(--muted); border: 1px solid var(--line-2); padding: 5px 6px; }

/* collapsible sidebar (wide screens; the state is kept per browser) */
.side-head { display: flex; align-items: center; gap: 6px; }
.side-head .brand { flex: 1; min-width: 0; }
.side-toggle {
  display: grid; place-items: center; width: 32px; height: 32px; flex: none; padding: 0; cursor: pointer;
  color: var(--muted); background: transparent; border: 1px solid var(--line); border-radius: 0;
  transition: color .15s, border-color .15s, background-color .15s;
}
.side-toggle::before { content: ""; width: 7px; height: 7px; border-left: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: translateX(1.5px) rotate(45deg); }
.side-open::before { transform: translateX(-1.5px) rotate(-135deg); }
.side-toggle:hover { color: var(--ink); border-color: var(--line-2); background: var(--surface); }
.side-open { position: fixed; top: 16px; left: 16px; z-index: 31; background: var(--bg); visibility: hidden; opacity: 0; transition: opacity .2s, visibility 0s .2s, color .15s, border-color .15s; }
.sidebar { transition: transform .25s var(--ease), visibility 0s; }
.main { transition: margin-left .25s var(--ease); }
.side-closed .sidebar { transform: translateX(-100%); visibility: hidden; transition: transform .25s var(--ease), visibility 0s .25s; }
.side-closed .main { margin-left: 0; }
.side-closed .side-open { visibility: visible; opacity: 1; transition: opacity .2s .1s, color .15s, border-color .15s; }

.filter input {
  width: 100%; height: 40px; padding: 0 12px; font: 14px var(--font); color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); border-radius: 0; outline: none;
  transition: border-color .15s;
}
.filter input::placeholder { color: var(--muted); }
.filter input:hover { border-color: var(--line-2); }
.filter input:focus-visible { border-color: var(--accent-hi); outline: 2px solid var(--accent-hi); outline-offset: 2px; }

.nav { display: flex; flex-direction: column; gap: 6px; }
.nav ul { list-style: none; margin: 0 0 8px; padding: 0; }
.nav-group summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between;
  padding: 10px 8px 6px; font: 500 12px/1.2 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted);
  transition: color .15s;
}
.nav-group summary::-webkit-details-marker { display: none; }
.nav-group summary::after { content: ""; width: 7px; height: 7px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(-45deg); transition: transform .2s var(--ease); margin-right: 4px; }
.nav-group[open] summary::after { transform: rotate(45deg); }
.nav-group summary:hover { color: var(--ink); }
.nav a {
  position: relative; display: block; padding: 6px 10px 6px 12px; font-size: 14.5px; line-height: 1.4; color: var(--ink-2);
  text-decoration: none; border-left: 1px solid var(--line); transition: color .15s, border-color .15s, background-color .15s;
}
.nav a:hover { color: var(--ink); border-left-color: var(--muted); background: var(--surface); }
.nav a[aria-current="page"] { color: #fff; border-left: 2px solid var(--accent); padding-left: 11px; background: linear-gradient(90deg, rgba(177, 18, 38, .16), transparent 80%); }
.nav-empty { color: var(--muted); font-size: 14px; padding: 0 8px; margin: 0; }
.filter { position: relative; display: block; }
.filter input { padding-right: 36px; }
.filter input::-webkit-search-cancel-button { display: none; }
.filter-key { position: absolute; right: 9px; top: 50%; transform: translateY(-50%); display: grid; place-items: center; min-width: 20px; height: 20px; font: 500 11px/1 var(--mono); color: var(--muted); border: 1px solid var(--line-2); pointer-events: none; }
.filter input:focus ~ .filter-key, .filter input:not(:placeholder-shown) ~ .filter-key { display: none; }
.nav-sections-title { margin: 0; padding: 10px 8px 6px; font: 500 12px/1.2 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.nav-sections ul { list-style: none; margin: 0; padding: 0; }
.nav-sections a { display: flex; flex-direction: column; gap: 2px; padding: 7px 10px 7px 12px; text-decoration: none; border-left: 1px solid var(--line); transition: color .15s, border-color .15s, background-color .15s; }
.nav-sections a span { font-size: 14px; line-height: 1.35; color: var(--ink-2); }
.nav-sections a small { font: 400 11.5px/1.3 var(--mono); color: var(--muted); }
.nav-sections a:hover { border-left-color: var(--accent); background: var(--surface); }
.nav-sections a:hover span { color: var(--ink); }
.nav .hide { display: none; }

/* mobile top bar */
.topbar { display: none; }

/* ---------------------------------------------------------------- main */
.main { margin-left: var(--side); min-height: 100vh; display: flex; flex-direction: column; }

.masthead { position: relative; overflow: hidden; border-bottom: 1px solid var(--line); background: var(--bg); min-height: 232px; display: flex; align-items: flex-end; }
.masthead.hero { min-height: clamp(560px, 86vh, 820px); align-items: center; }
.dither { position: absolute; inset: 0; width: 100%; height: 100%; image-rendering: pixelated; image-rendering: crisp-edges; }
.dither.still { background:
  radial-gradient(ellipse 70% 60% at 85% 40%, rgba(177, 18, 38, .55), transparent 70%),
  linear-gradient(90deg, transparent 30%, rgba(90, 8, 20, .5)); }
.masthead::after { /* keeps text readable over the light where widths are narrow */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(90deg, rgba(10, 10, 10, .92) 0%, rgba(10, 10, 10, .55) 38%, transparent 62%);
}
.masthead-inner { position: relative; z-index: 1; width: 100%; max-width: 1180px; padding: 48px var(--pad) 36px; }
.hero .masthead-inner { padding-top: 96px; padding-bottom: 96px; }

.eyebrow { display: inline-flex; align-items: baseline; gap: 10px; margin: 0 0 14px; font: 500 12.5px/1.2 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); }
.eyebrow .dot { flex: none; align-self: flex-start; margin-top: 2px; width: 8px; height: 8px; background: var(--accent); box-shadow: 0 0 0 3px rgba(177, 18, 38, .25); }

.masthead h1 { margin: 0; font-weight: 400; letter-spacing: -.03em; line-height: 1.08; font-size: clamp(30px, 3.6vw, 46px); max-width: 22ch; text-wrap: balance; }
.masthead h1 code { font-size: .8em; }
.hero h1 { font-size: clamp(40px, 5.4vw, 76px); letter-spacing: -.04em; line-height: 1.02; max-width: 14ch; }
.hero h1 em { font-style: normal; color: var(--accent-hi); }
.lead { margin: 24px 0 0; max-width: 54ch; font-size: clamp(17px, 1.4vw, 19px); line-height: 1.6; color: var(--ink-2); }
.lead em { color: var(--ink); font-style: normal; }

.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 36px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 22px;
  font: 500 15px/1 var(--font); text-decoration: none; border: 1px solid transparent; border-radius: 0;
  transition: transform .18s var(--ease), background-color .18s, border-color .18s, color .18s;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0) scale(.98); transition-duration: .06s; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: #c8162c; }
.btn-ghost { border-color: #3a3a3a; color: var(--ink); background: rgba(10, 10, 10, .5); backdrop-filter: blur(4px); }
.btn-ghost:hover { border-color: var(--ink); }

/* entrance, once on load */
.js [data-enter] .masthead-inner > * { opacity: 0; transform: translateY(14px); animation: enter .8s var(--ease) forwards; }
.js [data-enter] .masthead-inner > :nth-child(2) { animation-delay: .08s; }
.js [data-enter] .masthead-inner > :nth-child(3) { animation-delay: .16s; }
.js [data-enter] .masthead-inner > :nth-child(4) { animation-delay: .24s; }
@keyframes enter { to { opacity: 1; transform: none; } }

/* ---------------------------------------------------------------- page body */
.page { flex: 1; display: grid; grid-template-columns: minmax(0, 880px) 200px; justify-content: space-between; gap: 56px; padding: 56px var(--pad) 72px; max-width: 1360px; }
.toc { position: sticky; top: 32px; align-self: start; max-height: calc(100vh - 64px); overflow-y: auto; font-size: 13.5px; scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
.toc-title { margin: 0 0 10px; font: 500 12px/1.2 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.toc ul { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line); }
.toc a { display: block; padding: 4px 0 4px 14px; margin-left: -1px; border-left: 1px solid transparent; color: var(--muted); text-decoration: none; line-height: 1.4; transition: color .15s, border-color .15s; }
.toc .d3 a { padding-left: 26px; font-size: 13px; }
.toc a:hover { color: var(--ink); }
.toc a.on { color: var(--ink); border-left-color: var(--accent); }
.toc code { font-size: .92em; background: none; border: 0; padding: 0; color: inherit; }

/* ---------------------------------------------------------------- prose */
.prose { min-width: 0; outline: none; }
.prose > :first-child { margin-top: 0; }
.prose p, .prose ul, .prose ol { margin: 0 0 18px; color: var(--ink-2); }
.prose li { margin: 6px 0; }
.prose li:has(> input[type="checkbox"]) { list-style: none; margin-left: -1.3em; }
.prose li > input[type="checkbox"] { margin: 0 .55em 0 0; vertical-align: -.1em; accent-color: var(--accent); }
.prose li::marker { color: var(--accent-hi); }
.prose ul ul, .prose ol ul, .prose ul ol { margin: 6px 0 6px; }
.prose strong { color: var(--ink); font-weight: 600; }
.prose a { color: var(--ink); text-decoration: underline; text-decoration-color: rgba(212, 42, 62, .6); text-decoration-thickness: 1px; text-underline-offset: 3px; transition: text-decoration-color .15s, color .15s; }
.prose a:hover { color: #fff; text-decoration-color: var(--accent-hi); text-decoration-thickness: 2px; }

.prose h2, .prose h3, .prose h4 { position: relative; color: var(--ink); font-weight: 500; letter-spacing: -.02em; }
.prose h2 { margin: 64px 0 18px; padding-top: 28px; border-top: 1px solid var(--line); font-size: 28px; line-height: 1.2; }
.prose h3 { margin: 40px 0 12px; font-size: 20px; line-height: 1.3; }
.prose h4 { margin: 28px 0 10px; font-size: 16.5px; }
.prose > h2:first-child { border-top: 0; padding-top: 0; }

.prose code { font: 400 .86em/1.5 var(--mono); color: var(--accent-soft); background: var(--surface); border: 1px solid var(--line); padding: .1em .35em; overflow-wrap: anywhere; }
.prose a code { color: inherit; }
.prose h1 code, .prose h2 code, .prose h3 code { font-size: .82em; }

.code { margin: 22px 0 26px; border: 1px solid var(--line); background: #0d0d0d; }
.code-bar { display: flex; align-items: center; justify-content: space-between; padding: 0 6px 0 14px; height: 38px; border-bottom: 1px solid var(--line); font: 500 11.5px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.copy { font: 500 12px/1 var(--mono); color: var(--muted); background: none; border: 1px solid transparent; padding: 7px 10px; min-height: 30px; cursor: pointer; transition: color .15s, border-color .15s, transform .1s; }
.copy:hover { color: var(--ink); border-color: var(--line-2); }
.copy:active { transform: scale(.96); }
.copy.done { color: var(--accent-hi); }
.code pre { margin: 0; padding: 16px 18px; overflow-x: auto; scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
.code pre code { font: 400 13.5px/1.65 var(--mono); color: #e4e4e4; background: none; border: 0; padding: 0; white-space: pre; overflow-wrap: normal; tab-size: 4; }
.tok-c { color: #6f6f6f; font-style: italic; }
.tok-s { color: #e6a3ab; }
.tok-k { color: #ff6b7a; }

/* folder trees (```tree blocks) */
.ftree { margin: 22px 0 26px; border: 1px solid var(--line); background: #0d0d0d; }
.ftree-bar { display: flex; align-items: center; justify-content: space-between; padding: 0 6px 0 14px; height: 38px; border-bottom: 1px solid var(--line); font: 500 11.5px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.ftree-toggle { font: 500 12px/1 var(--mono); color: var(--muted); background: none; border: 1px solid transparent; padding: 7px 10px; min-height: 30px; cursor: pointer; transition: color .15s, border-color .15s; }
.ftree-toggle:hover { color: var(--ink); border-color: var(--line-2); }
.ftree-mark { display: inline-block; margin-right: 8px; font-weight: 700; }
.ftree-right .ftree-mark { color: #6fbf8a; }
.ftree-wrong { border-color: rgba(212, 42, 62, .45); }
.ftree-wrong .ftree-bar { border-bottom-color: rgba(212, 42, 62, .3); }
.ftree-wrong .ftree-mark { color: var(--accent-hi); }
.ftree-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 22px 0 26px; }
.ftree-pair .ftree { margin: 0; }
.ft, .ft ul { list-style: none; margin: 0; padding: 0; }
.ft { padding: 10px 8px 12px; overflow-x: auto; scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
.ft ul { margin-left: 15px; padding-left: 6px; border-left: 1px solid var(--line); }
.prose .ft li { margin: 0; }
.ft details > summary { list-style: none; }
.ft details > summary::-webkit-details-marker { display: none; }
.ft-row { display: flex; align-items: baseline; gap: 0 8px; flex-wrap: wrap; padding: 3px 8px 3px 4px; font: 400 13.5px/1.55 var(--mono); color: var(--ink-2); transition: background-color .15s; }
.ft-row:hover { background: var(--surface); }
summary.ft-row { cursor: pointer; }
summary.ft-row:focus-visible { outline: 1px solid var(--accent-hi); outline-offset: -1px; }
.ft-chev, .ft-gap { flex: none; width: 14px; height: 14px; align-self: center; }
.ft-chev { fill: none; stroke: var(--muted); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; transform: rotate(90deg); transition: transform .18s var(--ease); }
.ft details:not([open]) > summary .ft-chev { transform: none; }
.ft-icon { flex: none; width: 16px; height: 16px; align-self: center; }
.ft-icon svg { width: 16px; height: 16px; }
.ft-dir svg { fill: var(--accent); }
.ft-icon:not(.ft-dir) svg path { fill: none; stroke: #7a7a7a; stroke-width: 1.2; stroke-linejoin: round; }
.ft-code svg path { stroke: var(--accent-soft) !important; }
.ft-text svg path { stroke: #a8a8a8 !important; }
.ft-pack svg path { stroke: var(--ink) !important; }
.ft-name { flex: none; color: var(--ink); white-space: nowrap; }
.ft-desc { flex: 1 1 220px; min-width: 0; padding-left: 10px; font: 400 13.5px/1.55 var(--font); color: var(--muted); }
.ft-warn .ft-desc { color: var(--accent-hi); }
.ft-warn-mark { display: inline-grid; place-items: center; width: 15px; height: 15px; margin-right: 7px; font: 700 10.5px/1 var(--mono); color: #fff; background: var(--accent); vertical-align: 1px; }
.ft-more .ft-name { color: var(--muted); }
.ftree-tools { display: flex; gap: 2px; }
.ftree-view { font: 500 12px/1 var(--mono); color: var(--muted); background: none; border: 1px solid transparent; padding: 7px 10px; min-height: 30px; cursor: pointer; transition: color .15s, border-color .15s; }
.ftree-view:hover { color: var(--ink); border-color: var(--line-2); }

/* folder browser (site.js): one folder at a time; the tree list is the "Show as tree" view */
.ftree.is-explorer > .ft { display: none; }
.ftree.is-explorer.show-tree > .ft { display: block; }
.ftree.is-explorer.show-tree > .fx { display: none; }
.fx-bar { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-bottom: 1px solid var(--line); background: #0b0b0b; }
.fx-up {
  display: grid; place-items: center; flex: none; width: 32px; height: 32px; padding: 0; cursor: pointer;
  color: var(--ink-2); background: transparent; border: 1px solid var(--line-2); border-radius: 0;
  transition: color .15s, border-color .15s, background-color .15s;
}
.fx-up svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.fx-up:hover:not(:disabled) { color: var(--ink); border-color: var(--muted); background: var(--surface); }
.fx-up:disabled { opacity: .35; cursor: default; }
.prose .fx-path {
  display: flex; align-items: center; flex: 1; min-width: 0; margin: 0; padding: 0 4px; list-style: none;
  height: 32px; border: 1px solid var(--line); background: var(--bg); overflow-x: auto; scrollbar-width: none;
  font: 400 13px/1 var(--mono);
}
.fx-path::-webkit-scrollbar { display: none; }
.prose .fx-path li { display: flex; align-items: center; flex: none; margin: 0; }
.fx-sep { width: 12px; height: 12px; margin: 0 1px; fill: none; stroke: var(--muted); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.fx-crumb { font: inherit; color: var(--ink-2); background: none; border: 0; padding: 6px 6px; white-space: nowrap; }
button.fx-crumb { cursor: pointer; transition: color .15s, background-color .15s; }
button.fx-crumb:hover { color: var(--ink); background: var(--surface-2); }
span.fx-crumb { color: var(--ink); }
.prose .fx-about { margin: 0; padding: 10px 16px; border-bottom: 1px solid var(--line); font-size: 14px; color: var(--muted); }
.prose .fx-about.fx-warn { color: var(--accent-hi); }
.fx-list { list-style: none; margin: 0 !important; padding: 0 0 6px; display: flex; flex-direction: column; }
.prose .fx-list li { margin: 0; }
/* one item a row, like a file manager's details view: name, what it is, how many items */
.fx-item, .fx-head {
  display: grid; grid-template-columns: 20px minmax(9em, 30%) minmax(0, 1fr) 5.5em; grid-template-areas: "icon name desc meta";
  align-items: center; gap: 2px 12px; width: 100%; padding: 7px 14px; text-align: left;
  font: 400 13.5px/1.45 var(--mono); color: var(--ink); background: transparent; border: 1px solid transparent; border-radius: 0;
}
.prose .fx-head { padding-top: 8px; padding-bottom: 8px; margin-bottom: 4px; border: 0; border-bottom: 1px solid var(--line); font: 500 11px/1.2 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.fx-head span:nth-child(1) { grid-area: name; }
.fx-head span:nth-child(2) { grid-area: desc; }
.fx-head span:nth-child(3) { grid-area: meta; text-align: right; }
.fx-item .fx-meta { text-align: right; }
.fx-item > svg { grid-area: icon; width: 18px; height: 18px; }
.fx-item.fx-dir > svg { fill: var(--accent); }
.fx-item:not(.fx-dir) > svg path { fill: none; stroke: #7a7a7a; stroke-width: 1.2; stroke-linejoin: round; }
.fx-name { grid-area: name; overflow-wrap: anywhere; }
.fx-meta { grid-area: meta; font: 400 11.5px/1 var(--mono); color: var(--muted); white-space: nowrap; }
.fx-desc { grid-area: desc; font: 400 13px/1.45 var(--font); color: var(--muted); }
.fx-warn .fx-desc { color: var(--accent-hi); }
button.fx-item { cursor: pointer; transition: background-color .15s, border-color .15s; }
button.fx-item:hover { background: var(--surface); border-color: var(--line-2); }
button.fx-item:hover .fx-name { color: #fff; }
button.fx-item:focus-visible { outline: 1px solid var(--accent-hi); outline-offset: -1px; }
.fx-more .fx-name { color: var(--muted); }
.prose .fx-empty { padding: 18px 14px 12px; color: var(--muted); font-size: 14px; }
.fx-list.fx-in { animation: fx-in .22s var(--ease); }
.fx-list.fx-out { animation: fx-out .22s var(--ease); }
@keyframes fx-in { from { opacity: 0; transform: translateX(10px); } }
@keyframes fx-out { from { opacity: 0; transform: translateX(-10px); } }

/* section links beside headings */
.prose .anchor { margin-left: .4em; color: var(--muted); text-decoration: none; font-weight: 400; opacity: 0; transition: opacity .15s, color .15s; }
.prose h2:hover .anchor, .prose h3:hover .anchor, .prose h4:hover .anchor, .prose .anchor:focus-visible { opacity: 1; }
.prose .anchor:hover { color: var(--accent-hi); }
.prose .anchor.copied::after { content: " link copied"; font: 500 11.5px/1 var(--mono); letter-spacing: .04em; color: var(--accent-hi); vertical-align: middle; }

/* "on this page", folded above the text where the side list does not fit */
.toc-inline { display: none; margin: 0 0 36px; border: 1px solid var(--line); background: var(--surface); }
.toc-inline summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; min-height: 44px; font: 500 12px/1.2 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); }
.toc-inline summary::-webkit-details-marker { display: none; }
.toc-inline summary span { margin-left: auto; color: var(--muted); letter-spacing: 0; text-transform: none; }
.toc-inline summary::after { content: ""; flex: none; width: 7px; height: 7px; border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted); transform: rotate(45deg); transition: transform .2s var(--ease); }
.toc-inline[open] summary::after { transform: rotate(-135deg); }
.prose .toc-inline ul { list-style: none; margin: 0; padding: 4px 0 10px; border-top: 1px solid var(--line); }
.prose .toc-inline li { margin: 0; }
.toc-inline a { display: block; padding: 7px 16px; color: var(--ink-2); text-decoration: none; font-size: 14.5px; }
.toc-inline .d3 a { padding-left: 32px; font-size: 14px; color: var(--muted); }
.toc-inline a:hover { color: var(--ink); background: var(--surface-2); }
.toc-inline code { background: none; border: 0; padding: 0; color: inherit; }

.table-wrap { margin: 22px 0 26px; overflow-x: auto; border: 1px solid var(--line); scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
.prose table { width: 100%; border-collapse: collapse; font-size: 14.5px; line-height: 1.5; }
.prose th, .prose td { text-align: left; vertical-align: top; padding: 11px 16px; border-bottom: 1px solid var(--line); }
.prose th { font: 500 12px/1.3 var(--mono); letter-spacing: .05em; text-transform: uppercase; color: var(--muted); background: var(--surface); }
.prose tr:last-child td { border-bottom: 0; }
.prose td { color: var(--ink-2); }
.prose tbody tr { transition: background-color .15s; }
.prose tbody tr:hover { background: #101010; }
.prose td:first-child { color: var(--ink); white-space: normal; min-width: 9em; }
/* a cell may list several names: it wraps between them, each name stays whole */
.prose td:first-child code { white-space: nowrap; }

.prose blockquote { margin: 22px 0; padding: 14px 20px; border-left: 2px solid var(--accent); background: var(--surface); }
.prose blockquote p:last-child { margin-bottom: 0; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 48px 0; }

/* home: the README's highlights read as a list of features */
.is-home .prose > h2 { margin-top: 72px; }

.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 72px; }
.pager a { display: flex; flex-direction: column; gap: 6px; padding: 18px 20px; border: 1px solid var(--line); text-decoration: none; color: var(--ink); font-weight: 500; transition: border-color .18s, transform .18s var(--ease), background-color .18s; }
.pager a span { font: 500 11.5px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.pager a:hover { border-color: var(--accent); transform: translateY(-2px); background: var(--surface); }
.pager .pager-next { text-align: right; grid-column: 2; }

.foot { border-top: 1px solid var(--line); padding: 28px var(--pad); font-size: 13.5px; color: var(--muted); }
.foot p { margin: 0; max-width: 760px; }
.foot a { color: var(--ink-2); text-underline-offset: 3px; }
.foot a:hover { color: var(--ink); }

/* ---------------------------------------------------------------- widths */
@media (max-width: 1279px) {
  .page { grid-template-columns: minmax(0, 760px); }
  .toc { display: none; }
  .toc-inline { display: block; }
  /* no room for the emblem beside the text: it gets this slot above it (drawn by dither.js) */
  .js .hero-emblem { height: clamp(150px, 22vw, 210px); margin: 0 0 28px; }
}

@media (max-width: 959px) {
  .side-toggle { display: none; }
  .side-closed .sidebar { transform: none; }
  .side-closed .main { margin-left: 0; }
  .topbar {
    position: sticky; top: 0; z-index: 40; display: flex; align-items: center; justify-content: space-between;
    height: var(--top); padding: 0 12px 0 10px; background: rgba(10, 10, 10, .92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line);
  }
  .topbar .brand-ver { margin-left: 4px; }
  .menu-btn { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 12px; font: 500 14px var(--font); color: var(--ink); background: rgba(10, 10, 10, .5); border: 1px solid #3a3a3a; cursor: pointer; transition: border-color .18s; }
  .menu-btn:hover { border-color: var(--ink); }
  .menu-lines { position: relative; width: 16px; height: 10px; border-top: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transition: border-color .2s; }
  .menu-lines::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; border-top: 1.5px solid currentColor; transform: translateY(-50%); transition: transform .2s var(--ease); }
  .menu-btn[aria-expanded="true"] .menu-lines { border-color: transparent; }
  .menu-btn[aria-expanded="true"] .menu-lines::before { transform: translateY(-50%) rotate(45deg); }
  .menu-btn[aria-expanded="true"] .menu-lines::after { content: ""; position: absolute; left: 0; right: 0; top: 50%; border-top: 1.5px solid currentColor; transform: translateY(-50%) rotate(-45deg); }

  .sidebar { top: var(--top); width: 100%; border-right: 0; padding-top: 16px; visibility: hidden; opacity: 0; transform: translateY(-8px); transition: opacity .2s, transform .2s var(--ease), visibility 0s .2s; }
  .sidebar > .side-head { display: none; }
  .nav-open .sidebar { visibility: visible; opacity: 1; transform: none; transition: opacity .2s, transform .2s var(--ease); }
  .nav-open { overflow: hidden; }
  .nav a { padding-top: 11px; padding-bottom: 11px; font-size: 16px; }
  .nav-group summary { min-height: 44px; }
  .main { margin-left: 0; }
  html { scroll-padding-top: calc(var(--top) + 16px); }
  .masthead.hero { min-height: calc(100svh - var(--top)); }
}

@media (max-width: 640px) {
  .ftree-pair { grid-template-columns: 1fr; }
  .fx-item { grid-template-columns: 20px minmax(0, 1fr) auto; grid-template-areas: "icon name meta" ". desc desc"; }
  .prose .fx-head { display: none; }
  .ft-desc { flex-basis: 100%; padding-left: 44px; }
  .masthead::after { background: linear-gradient(180deg, rgba(10, 10, 10, .2), rgba(10, 10, 10, .85) 70%); }
  .masthead { min-height: 200px; }
  .hero .masthead-inner { padding-top: 64px; padding-bottom: 56px; }
  /* content from the top, so the emblem's slot (64px + 150px) sits above the shade that keeps the text readable */
  .js .masthead.hero { align-items: flex-start; }
  .js .masthead.hero::after { background: linear-gradient(180deg, rgba(10, 10, 10, .12) 0, rgba(10, 10, 10, .12) 214px, rgba(10, 10, 10, .78) 272px, rgba(10, 10, 10, .88) 70%); }
  .actions .btn { width: 100%; }
  .page { padding-top: 40px; }
  .prose h2 { font-size: 24px; margin-top: 52px; }
  .pager { grid-template-columns: 1fr; }
  .pager .pager-next { grid-column: 1; }
  .prose td:first-child { white-space: normal; }
  .anchor { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; transition-duration: .01ms !important; }
  .js [data-enter] .masthead-inner > * { opacity: 1; transform: none; }
}

@media print {
  .sidebar, .topbar, .toc, .toc-inline, .pager, .dither, .copy, .anchor, .skip, .fx, .ftree-tools { display: none !important; }
  .ftree.is-explorer > .ft { display: block !important; }
  html, body, .masthead, .code { background: #fff !important; color: #000 !important; }
  .main { margin: 0; }
  .masthead { min-height: 0 !important; border: 0; }
  .masthead::after { display: none; }
  .masthead-inner, .page { padding: 0 0 16px; max-width: none; display: block; }
  .js [data-enter] .masthead-inner > * { opacity: 1; transform: none; animation: none; }
  .prose p, .prose li, .prose td, .prose a, .prose strong, .prose h2, .prose h3, .prose h4, .code pre code, .eyebrow, .lead { color: #000 !important; }
  .prose code, .tok-c, .tok-s, .tok-k { color: #000 !important; background: none; }
  .code pre { white-space: pre-wrap; overflow: visible; }
  .code pre code { white-space: pre-wrap; }
  .prose h2, .prose h3 { break-after: avoid; }
  .code, .table-wrap, blockquote { break-inside: avoid; }
}
