/* Documentation pages, the docs library and the search page. */

.docs {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr) 210px;
  gap: 48px;
  padding-top: calc(var(--head) + 40px);
  padding-bottom: 60px;
}
.docs-side,
.docs-toc {
  position: sticky;
  top: calc(var(--head) + 24px);
  align-self: start;
  max-height: calc(100vh - var(--head) - 48px);
  overflow-y: auto;
  scrollbar-width: thin;
  padding-bottom: 20px;
}
.docnav .micro,
.toc .micro {
  margin: 22px 0 8px;
}
.docnav .micro:first-child,
.toc .micro:first-child {
  margin-top: 0;
}
.docnav ul,
.toc ul {
  display: grid;
  gap: 1px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.docnav a,
.toc a {
  display: block;
  padding: 6px 10px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.4;
  text-decoration: none;
}
.docnav a:hover,
.toc a:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.04);
}
.docnav a[aria-current] {
  color: var(--ink);
  background: rgba(122, 162, 247, 0.12);
  font-weight: 600;
}
.toc a {
  font-size: 13.5px;
  padding: 5px 10px;
  border-left: 2px solid var(--line);
  border-radius: 0 8px 8px 0;
}
.toc a.on {
  color: var(--ink);
  border-left-color: var(--blue);
}
.doc {
  min-width: 0;
}
.doc-head .kick span {
  color: var(--faint);
}
.doc-head h1 {
  margin-bottom: 28px;
  font-size: clamp(36px, 4.4vw, 60px);
}
.doc-head .kick {
  color: var(--chapter);
}
.docnav .micro {
  display: flex;
  align-items: center;
  gap: 8px;
}
.docnav .dot {
  width: 6px;
  height: 6px;
}
.toc-mobile {
  display: none;
  margin-bottom: 24px;
  border: 1px solid var(--line2);
  border-radius: var(--r3);
}
.toc-mobile summary {
  padding: 12px 16px;
  color: var(--ink);
  font-weight: 600;
  cursor: pointer;
}
.toc-mobile .toc {
  padding: 0 10px 12px;
}
.toc-mobile .toc .micro {
  display: none;
}

/* Prose rendered from the README. */
.prose {
  color: var(--text);
  font-size: 16.5px;
  line-height: 1.7;
}
.prose > * + * {
  margin-top: 1em;
}
.prose h2 {
  margin-top: 2.2em;
  font-size: 27px;
  line-height: 1.2;
  letter-spacing: -0.02em;
}
.prose h3 {
  margin-top: 1.9em;
  font-size: 21px;
  letter-spacing: -0.015em;
}
.prose h4,
.prose h5 {
  margin-top: 1.6em;
  font-size: 17px;
}
.prose h2,
.prose h3,
.prose h4,
.prose h5 {
  position: relative;
  scroll-margin-top: calc(var(--head) + 20px);
}
.anchor {
  margin-left: 8px;
  color: var(--faint);
  text-decoration: none;
  opacity: 0;
  font-weight: 400;
}
.prose :is(h2, h3, h4, h5):hover .anchor,
.anchor:focus-visible {
  opacity: 1;
}
.prose a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: rgba(122, 162, 247, 0.6);
  text-underline-offset: 3px;
}
.prose a:hover {
  text-decoration-color: var(--blue);
}
.prose ul,
.prose ol {
  padding-left: 1.4em;
}
.prose li + li {
  margin-top: 0.35em;
}
.prose li > ul,
.prose li > ol {
  margin-top: 0.35em;
}
.prose strong {
  color: var(--ink);
}
.prose blockquote {
  margin-left: 0;
  padding: 12px 18px;
  border-left: 3px solid var(--blue);
  border-radius: 0 10px 10px 0;
  background: rgba(122, 162, 247, 0.06);
  color: var(--text);
}
.prose hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 2em 0;
}
.prose img {
  border: 1px solid var(--line2);
  border-radius: 12px;
  background: #0b0c12;
}
.prose div[align="center"] {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  /* The attribute centers everything, code included; only the headings, captions and images below should be. */
  text-align: start;
}
.prose div[align="center"] > :is(h3, p, img, em) {
  justify-self: center;
  text-align: center;
}
.prose div[align="center"] h3 {
  margin-top: 1.2em;
}
.code {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #07080d;
}
.code .lang {
  position: absolute;
  top: 8px;
  right: 56px;
  color: var(--faint);
  font: 600 11px/1 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  pointer-events: none;
}
.code pre {
  margin: 0;
  padding: 16px 18px;
  overflow-x: auto;
  color: var(--text);
  font-size: 13px;
  line-height: 1.6;
  scrollbar-width: thin;
}
.code .copy {
  position: absolute;
  top: 2px;
  right: 2px;
  min-height: 30px;
  padding: 0 8px;
  opacity: 0.6;
}
.code .copy span {
  display: none;
}
.code:hover .copy,
.code .copy:focus-visible {
  opacity: 1;
}
.mermaid-src pre {
  color: var(--muted);
}
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  scrollbar-width: thin;
}
.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14.5px;
  line-height: 1.5;
}
.prose th,
.prose td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
.prose th {
  background: var(--panel2);
  color: var(--ink);
  font-weight: 620;
  white-space: nowrap;
}
.prose tr:last-child td {
  border-bottom: 0;
}
/* Code in a cell wraps only at its spaces, so one long command cannot push the other columns off screen. */
.prose td code {
  white-space: pre-wrap;
  overflow-wrap: normal;
}
.doc-foot {
  margin-top: 56px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}
.doc-foot .more {
  --chapter: var(--blue);
}
.pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 18px;
}
.pager a {
  display: grid;
  gap: 4px;
  padding: 16px 18px;
  border: 1px solid var(--line2);
  border-radius: var(--r3);
  text-decoration: none;
}
.pager a:hover {
  border-color: var(--line3);
  background: rgba(255, 255, 255, 0.03);
}
.pager small {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--faint);
  font: 600 12px/1 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.pager small svg {
  width: 14px;
  height: 14px;
}
.pager span {
  color: var(--ink);
  font-weight: 620;
}
.pager .next {
  text-align: right;
  justify-items: end;
}
@media (max-width: 1199px) {
  .docs {
    grid-template-columns: 220px minmax(0, 1fr);
  }
  .docs-toc {
    display: none;
  }
  .toc-mobile {
    display: block;
  }
}
@media (max-width: 859px) {
  .docs {
    grid-template-columns: minmax(0, 1fr);
    padding-top: calc(var(--head) + 28px);
  }
  .docs-side {
    display: none;
  }
  .pager {
    grid-template-columns: 1fr;
  }
}

/* Library. */
.libhead {
  padding: calc(var(--head) + 64px) 0 36px;
  background: radial-gradient(800px 400px at 15% 0%, rgba(122, 162, 247, 0.1), transparent 70%);
}
.libhead .lede {
  margin-top: 18px;
}
.libgrid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  padding-bottom: 60px;
}
.libgroup {
  position: relative;
  padding: 24px;
  border: 1px solid var(--line2);
  border-radius: var(--r4);
  background:
    radial-gradient(420px 160px at 0% 0%, color-mix(in srgb, var(--chapter) 12%, transparent), transparent 70%),
    rgba(16, 18, 28, 0.7);
  overflow: hidden;
}
.libgroup::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, var(--chapter), transparent 80%);
}
.libgroup > .micro {
  color: var(--chapter);
  margin-bottom: 8px;
}
.libgroup h2 {
  font-size: 24px;
  letter-spacing: -0.025em;
}
.libgroup > p {
  margin: 6px 0 14px;
  color: var(--muted);
  font-size: 14.5px;
}
.libgroup ul {
  display: grid;
  gap: 1px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.libgroup a {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  margin: 0 -10px;
  border-radius: 9px;
  text-decoration: none;
}
.libgroup a:hover {
  background: rgba(122, 162, 247, 0.08);
}
.libgroup strong {
  color: var(--ink);
  font-weight: 580;
  font-size: 15px;
}
.libgroup a span {
  color: var(--faint);
  font: 12px/1.8 var(--mono);
  white-space: nowrap;
}
@media (max-width: 999px) {
  .libgrid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 649px) {
  .libgrid {
    grid-template-columns: 1fr;
  }
}

/* Search page. */
.searchpage h1 {
  margin-bottom: 24px;
}
.searchbox {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 760px;
  padding: 0 16px;
  border: 1px solid var(--line2);
  border-radius: 14px;
  background: var(--panel);
}
.searchbox:focus-within {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(122, 162, 247, 0.2);
}
.searchbox svg {
  width: 20px;
  height: 20px;
  color: var(--muted);
}
.searchbox input {
  flex: 1;
  height: 56px;
  border: 0;
  background: none;
  outline: none;
  font-size: 18px;
  color: var(--ink);
}
.results {
  display: grid;
  gap: 4px;
  max-width: 760px;
  margin-top: 20px;
}
