/* The documentation's pages, in the home page's style: its colours, its
   fonts, the glow behind the page and its grid of dots, a column of prose. */

:root {
  --bg: #0b0911;
  --bg-raised: #13101d;
  --fg: #f4f1ff;
  --muted: #a7a1bd;
  --dim: #857f9d;
  --line: rgba(244, 241, 255, 0.08);
  --line-strong: rgba(244, 241, 255, 0.14);
  --violet: #a592ff;
  --pink: #f27ac4;
  --gradient: linear-gradient(120deg, var(--violet), var(--pink));
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", Roboto, sans-serif;
  --display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  /* The type scale, steps of about 1.2 from the body's 16 px, the home
     page's: notes, interface and code, body, small headings, the headings'
     own sizes above them. */
  --t-xs: 13px;
  --t-s: 14px;
  --t-m: 16px;
  --t-l: 19px;
  --t-xl: 23px;
}

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

html {
  background: var(--bg);
  /* An anchor's heading lands below the sticky top bar. */
  scroll-padding-top: 88px;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--fg);
  font: var(--t-m)/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  position: relative;
}

.backdrop {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}
.backdrop::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -420px;
  width: 1200px;
  height: 800px;
  transform: translateX(-50%);
  background:
    radial-gradient(closest-side, rgba(165, 146, 255, 0.16), transparent 70%),
    radial-gradient(closest-side at 70% 60%, rgba(242, 122, 196, 0.08), transparent 70%);
}
.backdrop::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(244, 241, 255, 0.06) 1px, transparent 1.2px);
  background-size: 22px 22px;
  -webkit-mask-image: radial-gradient(ellipse 80% 30% at 50% 0%, #000 30%, transparent 75%);
          mask-image: radial-gradient(ellipse 80% 30% at 50% 0%, #000 30%, transparent 75%);
}

.wrap {
  width: min(1080px, 100% - 48px);
  margin-inline: auto;
}

/* The top bar, which stays as the page scrolls: the page's ground, a little
   translucent and blurred, the page passing under it. Where the browser
   ties an animation to the scroll, the bar starts clear over the glow and
   takes its ground and its line within the first 80 px; elsewhere it has
   them from the start. Its height never changes, so nothing below moves. */
.bar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(11, 9, 17, 0.8);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
          backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--line);
}
@supports (animation-timeline: scroll()) {
  .bar {
    animation: bar-ground linear both;
    animation-timeline: scroll();
    animation-range: 0 80px;
  }
}
@keyframes bar-ground {
  from {
    background: rgba(11, 9, 17, 0);
    border-bottom-color: transparent;
    -webkit-backdrop-filter: none;
            backdrop-filter: none;
  }
}

/* The brand and the sections, on one line at every width: the sections
   scroll sideways where they do not fit. */
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  padding: 12px 0;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: inherit;
  text-decoration: none;
}
.brand { flex: none; }
.brand img { width: 28px; height: 28px; }
.top nav {
  display: flex;
  gap: 22px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 8px 6px;
  font-size: var(--t-s);
  white-space: nowrap;
}
.top nav::-webkit-scrollbar { display: none; }
.top nav a { color: var(--muted); text-decoration: none; }
.top nav a:hover { color: var(--fg); }
.top nav a[aria-current="page"] {
  color: var(--fg);
  text-decoration: underline 2px var(--violet);
  text-underline-offset: 7px;
}

/* The keyboard's place: a ring of the brand's violet round what has the
   focus, never taken away. In the top bar's scrolling row, which would clip
   it, the links take a little room of their own round their words for it,
   given back by their margins. The skip link waits above the page and comes
   down as it takes the focus. */
:focus-visible { outline: 2px solid var(--violet); outline-offset: 3px; }
.top nav a { padding-inline: 6px; margin-inline: -6px; }
.top nav a:focus-visible { outline-offset: 2px; border-radius: 6px; }
.skip {
  position: absolute;
  top: -100px;
  left: 16px;
  z-index: 20;
  padding: 10px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--bg-raised);
  color: var(--fg);
  font-size: var(--t-s);
  text-decoration: none;
}
.skip:focus { top: 12px; }

/* The document. */
/* One column of about 80 characters a line, which prose, code and tables
   share, so that their edges meet. */
.doc {
  max-width: 700px;
  margin-inline: auto;
  padding: 34px 0 0;
}

/* The documentation's pages: the sidebar of every page, in its groups, at
   the left on a wide screen, sticky under the top bar, the page shown
   marked and the pages that hold it open; on a narrower one, the same as a
   menu that opens above the page. A page of several sections: its table of
   contents at the right on the widest screens, sticky too, each section a
   group that opens on its parts at its chevron, its link going to it; the
   part in view marked, as the script follows the reading. Narrower, a short
   one of the sections alone, which opens, under the title. */
.pages, .toc { display: none; }
@media (min-width: 1100px) {
  .page.has-nav {
    display: grid;
    grid-template-columns: 220px minmax(0, 700px);
    column-gap: 56px;
    justify-content: center;
  }
  .page.has-nav .doc { margin: 0; grid-column: 2; grid-row: 1; }
  .pages, .toc {
    position: sticky;
    top: 64px;
    align-self: start;
    max-height: calc(100vh - 64px);
    overflow-y: auto;
    padding: 44px 4px 32px 0;
    scrollbar-width: thin;
    scrollbar-color: var(--line-strong) transparent;
  }
  .pages { display: block; grid-column: 1; grid-row: 1; }
  .pages-inline { display: none; }
}
@media (min-width: 1360px) {
  .wrap.page.has-nav.has-toc {
    width: min(1320px, 100% - 48px);
    grid-template-columns: 220px minmax(0, 700px) 200px;
  }
  .toc { display: block; grid-column: 3; grid-row: 1; padding: 44px 0 32px 4px; }
  .doc .toc-inline { display: none; }
  /* The top bar as wide as the page's three columns. */
  body:has(.page.has-nav.has-toc) .top { width: min(1320px, 100% - 48px); }
}
.pages-group {
  margin: 24px 0 6px;
  color: var(--fg);
  font-size: var(--t-xs);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.pages-group:first-child { margin-top: 0; }
.pages-inline {
  max-width: 700px;
  margin: 28px auto 0;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: rgba(19, 16, 29, 0.6);
}
.pages-inline > summary {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 16px;
  color: var(--fg);
  font-size: var(--t-s);
  font-weight: 600;
  list-style: none;
  cursor: pointer;
}
.pages-inline > summary::-webkit-details-marker { display: none; }
.pages-inline > summary::before {
  content: "";
  width: 12px;
  height: 12px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M3.5 2l3 3-3 3' fill='none' stroke='%23857f9d' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 10px no-repeat;
  transition: transform 0.15s ease;
}
.pages-inline[open] > summary::before { transform: rotate(90deg); }
.pages-inline nav { padding: 0 16px 16px; }
.toc-title {
  margin: 0 0 10px;
  color: var(--fg);
  font-size: var(--t-s);
  font-weight: 600;
}
:is(.toc, .pages, .pages-inline nav) ul { margin: 0; padding: 0; list-style: none; }
:is(.toc, .pages, .pages-inline nav) a {
  display: block;
  padding: 4px 8px 4px 12px;
  border-left: 1px solid var(--line);
  color: var(--muted);
  font-size: var(--t-s);
  line-height: 1.4;
  text-decoration: none;
}
:is(.toc, .pages, .pages-inline nav) a:hover { color: var(--fg); }
:is(.toc, .pages, .pages-inline nav) a[aria-current] { color: var(--fg); border-left-color: var(--violet); }
:is(.toc, .pages, .pages-inline nav) a:focus-visible { outline-offset: -2px; border-radius: 4px; }
:is(.toc, .pages, .pages-inline nav) details ul a { padding-left: 24px; font-size: var(--t-xs); }
:is(.pages, .pages-inline nav) details details ul a { padding-left: 36px; }
:is(.toc, .pages, .pages-inline nav) code { font: 0.95em var(--mono); color: inherit; }
:is(.toc, .pages, .pages-inline nav) summary {
  display: flex;
  align-items: center;
  list-style: none;
  cursor: pointer;
}
:is(.toc, .pages, .pages-inline nav) summary::-webkit-details-marker { display: none; }
:is(.toc, .pages, .pages-inline nav) summary a { flex: 1; min-width: 0; }
:is(.toc, .pages, .pages-inline nav) summary::after {
  content: "";
  flex: none;
  width: 24px;
  height: 24px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M3.5 2l3 3-3 3' fill='none' stroke='%23857f9d' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 10px no-repeat;
  transition: transform 0.15s ease;
}
:is(.toc, .pages, .pages-inline nav) details[open] > summary::after { transform: rotate(90deg); }
.doc .toc-inline {
  margin: 0 0 32px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: rgba(19, 16, 29, 0.6);
}
.doc .toc-inline summary {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 16px;
  color: var(--fg);
  font-size: var(--t-s);
  font-weight: 600;
  list-style: none;
  cursor: pointer;
}
.doc .toc-inline summary::-webkit-details-marker { display: none; }
.doc .toc-inline summary::before {
  content: "";
  width: 12px;
  height: 12px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M3.5 2l3 3-3 3' fill='none' stroke='%23857f9d' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 10px no-repeat;
  transition: transform 0.15s ease;
}
.doc .toc-inline[open] summary::before { transform: rotate(90deg); }
.doc .toc-inline ul {
  margin: 0;
  padding: 0 16px 14px;
  list-style: none;
  columns: 2 200px;
  column-gap: 24px;
}
.doc .toc-inline li { max-width: none; margin: 0; break-inside: avoid; }
.doc .toc-inline a {
  display: block;
  padding: 5px 0;
  color: var(--muted);
  font-size: var(--t-s);
  text-decoration: none;
}
.doc .toc-inline a:hover { color: var(--fg); }
.doc .toc-inline code { padding: 0; background: none; color: inherit; }
.doc h1, .doc h2, .doc h3, .doc h4 {
  font-family: var(--display);
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.doc h1 {
  margin: 0 0 28px;
  font-size: clamp(34px, 5vw, 48px);
  font-weight: 700;
  letter-spacing: -0.035em;
  background: linear-gradient(180deg, #fff 40%, #c9bfff);
  -webkit-background-clip: text;
          background-clip: text;
  color: transparent;
}
/* A blog post's date and author, under its title. */
.doc h1:has(+ .byline) { margin-bottom: 10px; }
.doc .byline {
  margin: 0 0 28px;
  color: var(--muted);
  font-size: 15px;
}
.doc h2 {
  margin: 56px 0 16px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  font-size: 28px;
  font-weight: 600;
}
.doc h3 { margin: 36px 0 12px; font-size: var(--t-l); font-weight: 600; }
.doc h4 { margin: 28px 0 10px; font-size: var(--t-m); font-weight: 600; }
.doc p, .doc li { color: #ddd8ee; }
/* A link of the prose: underlined, so that it does not rest on its colour
   alone, the line faint until the pointer comes; its code of its colour. */
.doc a {
  color: var(--violet);
  text-decoration: underline 1px rgba(165, 146, 255, 0.4);
  text-underline-offset: 3px;
}
.doc a:hover { text-decoration-color: var(--violet); }
.doc a code { color: inherit; }
/* A section's or a part's link to itself, shown as the pointer comes to it. */
.doc .anchor {
  margin-left: 0.35em;
  color: var(--dim);
  font-weight: 400;
  text-decoration: none;
  opacity: 0;
  transition: opacity 0.15s ease;
}
.doc h2:hover .anchor, .doc h3:hover .anchor { opacity: 1; }
.doc .anchor:hover { color: var(--violet); }
.doc strong { color: var(--fg); font-weight: 600; }
.doc ul, .doc ol { padding-left: 1.4em; }
.doc li + li { margin-top: 4px; }
.doc img { max-width: 100%; height: auto; border-radius: 10px; }
.doc hr { border: 0; border-top: 1px solid var(--line); margin: 40px 0; }
.doc blockquote {
  margin: 20px 0;
  padding: 2px 20px;
  border-left: 2px solid var(--violet);
  color: var(--muted);
}
/* GitHub's alerts, as callouts of their kind's title and colour. */
.doc .callout {
  --callout: var(--violet);
  margin: 24px 0;
  padding: 12px 18px;
  border-left: 3px solid var(--callout);
  border-radius: 0 10px 10px 0;
  background: color-mix(in srgb, var(--callout) 8%, transparent);
}
.doc .callout > :last-child { margin-bottom: 0; }
.doc .callout-title + * { margin-top: 0; }
.doc .callout-title {
  margin: 0 0 4px;
  color: var(--callout);
  font-size: var(--t-s);
  font-weight: 600;
}
.doc .callout-tip { --callout: #6fdc8c; }
.doc .callout-important { --callout: var(--pink); }
.doc .callout-warning { --callout: #f2c46d; }
.doc .callout-caution { --callout: #ff7a7a; }

/* Code, as the home page's terminal. */
.doc code {
  font: 0.88em/1.5 var(--mono);
  padding: 0.12em 0.36em;
  border-radius: 5px;
  background: rgba(165, 146, 255, 0.10);
  color: #e6e1f7;
}
.doc pre {
  margin: 20px 0;
  padding: 18px 20px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: rgba(19, 16, 29, 0.85);
  overflow-x: auto;
}
.doc pre code {
  padding: 0;
  background: none;
  font-size: var(--t-s);
  line-height: 1.6;
}
/* A code block's copy button, which the script adds, at its top right:
   shown as the pointer comes over the block, or always where there is no
   pointer, and as it has the keyboard. */
.doc .code { position: relative; }
.doc .copy {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 4px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--bg-raised);
  color: var(--muted);
  font: 500 var(--t-xs)/1.4 var(--sans);
  cursor: pointer;
}
.doc .copy:hover { color: var(--fg); }
@media (hover: hover) {
  .doc .copy { opacity: 0; transition: opacity 0.15s ease; }
  .doc .code:hover .copy, .doc .copy:focus-visible, .doc .copy[data-copied] { opacity: 1; }
}

/* Tables, of lines between their rows. */
.doc table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  margin: 20px 0;
  border-collapse: collapse;
  font-size: var(--t-s);
}
.doc th, .doc td {
  padding: 9px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
.doc th {
  color: var(--fg);
  font-weight: 600;
  border-bottom-color: var(--line-strong);
  white-space: nowrap;
}
.doc td { color: #ddd8ee; }
/* A name in a cell keeps whole, the cell's column widening for it. */
.doc td code { white-space: nowrap; }

/* A chart of the benches, its SVG in the page: of the page's width, its
   marks letting the pointer through to its releases' columns, which the
   script marks and tells of in a card. */
.doc .chart-figure { position: relative; margin: 24px 0; }
.doc .chart-figure svg.chart { display: block; width: 100%; height: auto; border-radius: 10px; }
/* Its surface the site's raised one, and the dots' rings of it. */
.doc svg.chart.dark .surface { fill: var(--bg-raised); }
.doc svg.chart.dark .ring { stroke: var(--bg-raised); }
.doc svg.chart :is(circle, line, text) { pointer-events: none; }
.doc svg.chart .legend-item :is(circle, text) { pointer-events: auto; }
.doc svg.chart .legend-item, .doc svg.chart .column[data-report] { cursor: pointer; }
.doc svg.chart:focus-visible, .doc svg.chart .legend-item:focus-visible { outline: 2px solid var(--violet); outline-offset: 2px; }
.chart-card {
  position: absolute;
  z-index: 2;
  min-width: 150px;
  max-width: 260px;
  padding: 9px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: rgba(19, 16, 29, 0.96);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  color: var(--muted);
  font-size: var(--t-xs);
  line-height: 1.45;
  pointer-events: none;
}
.chart-card[hidden] { display: none; }
.chart-card .chart-card-title { color: var(--fg); font-weight: 600; }
.chart-card .chart-card-value { color: var(--fg); font-variant-numeric: tabular-nums; }
.chart-card .chart-card-report { margin-top: 4px; color: var(--dim); }

/* A wide page's tables: their figures of one width, alternate rows, a
   group's row of its title, the row and the column under the pointer
   marked, as the script marks the column; the first column held as the
   table scrolls sideways, and the header under the top bar as the page
   scrolls where the table fits its column. A cell's sign of a verdict is
   of its color, a measure not taken dimmed. */
.page.wide .doc table :is(td, th) { padding: 8px 10px; }
.page.wide .doc table td { font-variant-numeric: tabular-nums; background: var(--bg); }
.page.wide .doc table th { background: var(--bg); }
.page.wide .doc table tbody tr:nth-child(even) td { background: #110e19; }
.page.wide .doc table tbody tr.group td:first-child { white-space: nowrap; }
.page.wide .doc table tbody tr.group td {
  background: var(--bg);
  padding-top: 18px;
  color: var(--fg);
  border-bottom-color: var(--line-strong);
}
.page.wide .doc table tbody tr:not(.group):hover td,
.page.wide .doc table :is(td, th).column-on { background: #1b1727; }
.page.wide .doc table :is(td, th):first-child { position: sticky; left: 0; z-index: 1; }
.page.wide .doc table td.none { color: var(--dim); }
.page.wide .doc table .mark-better { color: #74d39c; }
.page.wide .doc table .mark-worse { color: #f2b35e; }
.page.wide .doc table .mark-over { color: #ff7a8f; }

/* A page of charts or of a wide table: its column wider than the text's on
   a wide screen, its prose kept to the text's measure, its charts and its
   tables taking the rest. */
@media (min-width: 1100px) {
  .page.has-nav.wide { grid-template-columns: 220px minmax(0, 960px); }
  .page.has-nav.wide .doc { max-width: 960px; }
  .page.has-nav.wide .doc > :not(.chart-figure, table) { max-width: 700px; }
  .page.has-nav.wide .doc table { display: table; width: 100%; overflow: visible; }
  .page.has-nav.wide .doc table thead th { position: sticky; top: 53px; z-index: 2; }
}
@media (min-width: 1360px) {
  .wrap.page.has-nav.has-toc.wide {
    width: min(1560px, 100% - 48px);
    grid-template-columns: 220px minmax(0, 960px) 200px;
  }
  body:has(.page.has-nav.has-toc.wide) .top { width: min(1560px, 100% - 48px); }
}

footer {
  margin-top: 120px;
  padding: 32px 0 48px;
  border-top: 1px solid var(--line);
  font-size: var(--t-xs);
  color: var(--dim);
}
footer .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px 32px;
}
footer p { margin: 0; }
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  width: 100%;
  margin-bottom: 8px;
}
footer a { color: var(--muted); text-decoration: none; }
footer a:hover { color: var(--fg); }

@media (max-width: 600px) {
  .doc h2 { font-size: var(--t-xl); }
  .doc pre code { font-size: var(--t-xs); }
  /* The sections beside the brand, scrolling under a fade at the right,
     each a target of 44 px. */
  .top { gap: 20px; padding: 6px 0; }
  .top nav {
    -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent);
            mask-image: linear-gradient(90deg, #000 85%, transparent);
    padding-right: 24px;
  }
  .top nav { padding-block: 0; }
  .top nav a { padding-block: 12px; }
  /* The documentation's menu's pages, each a target of 40 px or so. */
  .pages-inline nav a { padding-block: 9px; }
  .top nav a:focus-visible { outline-offset: -4px; }
}

/* Pagefind's interface, in the site's colours. */
#search {
  --pagefind-ui-scale: 0.9;
  --pagefind-ui-primary: var(--violet);
  --pagefind-ui-text: var(--fg);
  --pagefind-ui-background: var(--bg-raised);
  --pagefind-ui-border: var(--line-strong);
  --pagefind-ui-tag: var(--bg-raised);
  --pagefind-ui-border-width: 1px;
  --pagefind-ui-border-radius: 10px;
  --pagefind-ui-font: var(--sans);
}
