@font-face {
  font-family: "Inter";
  src: url("/fonts/inter-regular.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Inter";
  src: url("/fonts/inter-medium.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}

@font-face {
  font-family: "Inter";
  src: url("/fonts/inter-semibold.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
}

@font-face {
  font-family: "Space Mono";
  src: url("/fonts/space-mono-regular.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

:root {
  --page: #120c18;
  --raised: #19131f;
  --well: #221a2a;
  --line: #2b2433;
  --line-strong: #3d3447;
  --rail: #4b4257;
  --ink: #e7e3ec;
  --ink-2: #b0a9ba;
  --ink-3: #887f94;
  --accent: #b996e8;
  --link: #cdb5f2;
  --careful: #e6bb55;

  --code-word: #9f8cf2;
  --code-name: #6fb7f2;
  --code-text: #5fcb93;
  --code-number: #f0c254;
  --code-note: rgb(145 151 163 / 0.85);
  --code-sign: #b3b8c2;
  --code-wrong: #ef5e6e;
  --code-plain: #e6e8ec;
  --body: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "Space Mono", "Cascadia Mono", "Consolas", monospace;
  --bar: 57px;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--page);
  color-scheme: dark;
  scroll-padding-top: calc(var(--bar) + 20px);
}

body {
  margin: 0;
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink);
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection {
  background: rgba(185, 150, 232, 0.32);
}

a {
  color: var(--link);
  text-decoration-thickness: 1px;
  text-decoration-color: rgba(205, 181, 242, 0.45);
  text-underline-offset: 3px;
}

a:hover {
  color: #fff;
  text-decoration-color: currentColor;
}

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

.skip {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 5;
  padding: 8px 14px;
  background: var(--ink);
  color: var(--page);
  border-radius: 6px;
  font-weight: 500;
}

.skip:focus {
  top: 12px;
}

/* ---- the bar along the top */
.top {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 16px;
  height: var(--bar);
  padding: 0 24px;
  background: var(--page);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
}

.brand .name {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.unseen {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.search {
  display: flex;
  align-items: center;
  flex: 0 1 360px;
  min-width: 0;
  height: 36px;
  margin-left: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--raised);
}

.search:hover {
  border-color: var(--line-strong);
}

.search:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

.search button {
  flex: none;
  display: grid;
  place-items: center;
  width: 36px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 7px 0 0 7px;
  background: none;
  color: var(--ink-3);
  font-size: 18px;
  cursor: pointer;
}

.search button:hover,
.search:focus-within button {
  color: var(--accent);
}

.search input {
  flex: 1;
  min-width: 0;
  height: 34px;
  padding: 0 10px 0 0;
  border: 0;
  outline: none;
  background: none;
  color: var(--ink);
  font: inherit;
  font-size: 14.5px;
  text-overflow: ellipsis;
}

.search input::placeholder {
  color: var(--ink-3);
  opacity: 1;
}

.to-pages {
  display: none;
  align-items: center;
  gap: 8px;
  color: var(--ink-2);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}

.to-pages .i {
  font-size: 19px;
}

/* ---- the list of pages, the page, and what is on it */
.frame {
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
  max-width: 1380px;
  margin: 0 auto;
}

.pages {
  position: sticky;
  top: var(--bar);
  align-self: start;
  max-height: calc(100vh - var(--bar));
  overflow-y: auto;
  padding: 24px 14px 40px 16px;
  border-right: 1px solid var(--line);
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

.pages section + section {
  margin-top: 26px;
}

.pages h2,
.toc h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 6px;
  padding: 0 8px;
  border: 0;
  font-size: 12.5px;
  line-height: 1.5;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--ink-3);
}

.pages h2 .i,
.toc h2 .i {
  margin: 0;
  font-size: 15px;
  color: inherit;
}

.pages h2 {
  margin-bottom: 4px;
}

.pages ul {
  list-style: none;
  margin: 0 0 0 15px;
  padding: 0;
}

.pages li {
  padding: 0.5px 0 0.5px 9px;
  border-left: 1px solid var(--rail);
}

.pages li:hover {
  border-left-color: var(--ink-3);
}

.pages a {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 5px 8px;
  border-radius: 6px;
  color: var(--ink-2);
  font-size: 14.5px;
  line-height: 1.4;
  text-decoration: none;
}

.pages a .i {
  margin-top: 1.5px;
  font-size: 17px;
  color: var(--ink-3);
}

.pages a:hover {
  background: var(--raised);
  color: #fff;
}

.pages .here h2 {
  color: var(--ink);
}

.pages .here h2 .i {
  color: var(--accent);
}

.pages .here li {
  border-left-color: rgba(185, 150, 232, 0.34);
}

.pages .here li:hover {
  border-left-color: rgba(185, 150, 232, 0.7);
}

.pages li.here,
.pages li.here:hover {
  border-left-color: var(--accent);
  box-shadow: inset 1px 0 0 var(--accent);
}

.pages a[aria-current="page"] {
  background: var(--well);
  color: #fff;
  font-weight: 500;
}

.pages a:hover .i,
.pages a[aria-current="page"] .i {
  color: var(--accent);
}

main {
  min-width: 0;
  padding: 40px 56px 72px;
}

article {
  max-width: 44rem;
}

/* ---- headings */
h1,
h2,
h3,
h4 {
  margin: 0;
  font-weight: 600;
}

h1 {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
  font-size: 36px;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.page-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--raised);
  font-size: 28px;
  color: var(--accent);
}

h1 + p {
  font-size: 18px;
  line-height: 1.6;
  color: var(--ink-2);
}

h2 {
  margin-top: 48px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
  font-size: 24px;
  line-height: 1.3;
  letter-spacing: -0.012em;
}

h2 .i {
  margin-top: 4.5px;
  font-size: 22px;
  color: var(--accent);
}

h3 {
  margin-top: 32px;
  font-size: 18px;
  line-height: 1.4;
  letter-spacing: -0.006em;
}

h4 {
  margin-top: 24px;
  font-size: 15px;
  color: var(--ink-2);
}

.anchor {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.anchor:hover {
  color: inherit;
}

.anchor:hover > span:not(.i) {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: var(--ink-3);
  text-underline-offset: 4px;
}

p,
ul,
ol {
  margin: 14px 0 0;
}

article ul,
article ol {
  padding-left: 1.4em;
}

article li + li {
  margin-top: 5px;
}

article li::marker {
  color: var(--ink-3);
}

strong {
  font-weight: 600;
  color: #fff;
}

hr {
  margin: 40px 0 0;
  border: 0;
  border-top: 1px solid var(--line);
}

/* ---- code */
code,
pre {
  font-family: var(--mono);
}

:not(pre) > code {
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--well);
  font-size: 0.84em;
  color: #f0ebf6;
  white-space: nowrap;
}

.code {
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--raised);
  overflow: hidden;
}

.code pre {
  color: var(--code-plain);
  margin: 0;
  padding: 14px 16px;
  overflow-x: auto;
  font-size: 13.5px;
  line-height: 1.65;
  tab-size: 4;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

.code .k {
  color: var(--code-word);
}

.code .b {
  color: var(--code-name);
}

.code .s {
  color: var(--code-text);
}

.code .n {
  color: var(--code-number);
}

.code .c {
  color: var(--code-note);
}

.code .p {
  color: var(--code-sign);
}

.code .w {
  color: var(--code-wrong);
}

.code.output {
  background: #0d0812;
}

.code.output pre {
  padding-top: 6px;
  color: var(--ink-2);
}

.says {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  padding: 10px 16px 0;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-3);
}

.says .i {
  font-size: 15px;
}

.code.signature {
  display: inline-block;
  max-width: 100%;
  margin-top: 10px;
  border: 0;
  background: var(--well);
}

.code.signature pre {
  padding: 7px 12px;
  font-size: 14px;
}

.reference h3 {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  font-family: var(--mono);
  font-weight: 400;
  font-size: 17.5px;
  letter-spacing: 0;
  color: #fff;
}

.reference h3 .anchor {
  align-items: center;
  gap: 10px;
  min-width: 0;
  overflow-wrap: anywhere;
}

.kind {
  font-size: 18px;
}

.is-function {
  color: var(--code-word);
}

.is-event {
  color: var(--code-number);
}

.is-value {
  color: var(--code-name);
}

.kind-word {
  margin-left: auto;
  padding: 1px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-family: var(--body);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-3);
  white-space: nowrap;
}

/* ---- notes and tables */
.note {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-top: 18px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 6px;
  background: var(--raised);
}

.note .i {
  margin-top: 3.5px;
  font-size: 19px;
  color: var(--accent);
}

.note p {
  margin: 0;
  min-width: 0;
}

.note.careful {
  border-left-color: var(--careful);
}

.note.careful .i {
  color: var(--careful);
}

.table {
  margin-top: 18px;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}

th {
  text-align: left;
  font-weight: 500;
  color: var(--ink-3);
  font-size: 13px;
}

th,
td {
  padding: 8px 14px 8px 0;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

/* ---- the search's own page */
.searching .top .search {
  display: none;
}

.searching .to-pages {
  margin-left: auto;
}

.search.big {
  flex: none;
  height: 48px;
  margin: 4px 0 0;
}

.search.big button {
  width: 48px;
  height: 46px;
  font-size: 22px;
}

.search.big input {
  height: 46px;
  font-size: 17px;
}

.found {
  margin-top: 22px;
  color: var(--ink-2);
}

article ol.results {
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
}

.results li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: baseline;
  column-gap: 14px;
  margin: 0;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.results li:last-child {
  border-bottom: 1px solid var(--line);
}

.results a {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
  color: var(--ink);
  font-size: 16.5px;
  font-weight: 500;
  line-height: 1.4;
  text-decoration: none;
}

.results a > .i {
  margin-top: 2px;
  font-size: 19px;
}

.results a > .i:not(.kind) {
  color: var(--accent);
}

.results .where {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: 6px;
  min-width: 0;
  overflow-wrap: anywhere;
}

.results .of {
  font-weight: 400;
  color: var(--ink-2);
}

.results .then {
  font-size: 16px;
  color: var(--ink-3);
}

.results .name {
  font-family: var(--mono);
  font-size: 15.5px;
  font-weight: 400;
}

.results a:hover .part {
  color: #fff;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: var(--ink-3);
  text-underline-offset: 4px;
}

.results .in {
  font-size: 12.5px;
  color: var(--ink-3);
  white-space: nowrap;
}

.results p {
  grid-column: 1 / -1;
  margin: 6px 0 0 29px;
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--ink-2);
  overflow-wrap: anywhere;
}

mark {
  padding: 0 2px;
  border-radius: 3px;
  background: rgba(185, 150, 232, 0.26);
  color: #fff;
}

/* ---- the pages before and after */
.pager {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  max-width: 44rem;
  margin-top: 56px;
}

.pager a {
  flex: 1 1 220px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  text-decoration: none;
}

.pager a:hover {
  border-color: var(--line-strong);
  background: var(--raised);
}

.pager .way {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-3);
}

.pager .way .i {
  font-size: 15px;
}

.pager .where {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  font-size: 15px;
  line-height: 1.4;
  font-weight: 500;
}

.pager .where .i {
  margin-top: 1.5px;
  font-size: 18px;
  color: var(--accent);
}

.pager .after {
  align-items: flex-end;
  text-align: right;
}

/* ---- "On this page", at the right when there is room */
.toc {
  display: none;
}

.toc h2 {
  padding: 0;
  margin-bottom: 10px;
}

.toc ul {
  list-style: none;
  margin: 0;
  padding: 0;
  border-left: 1px solid var(--line);
}

.toc a {
  display: block;
  margin-left: -1px;
  padding: 4px 0 4px 14px;
  border-left: 1px solid transparent;
  color: var(--ink-2);
  font-size: 13.5px;
  line-height: 1.4;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.toc a:hover {
  border-left-color: var(--accent);
  color: #fff;
}

@media (min-width: 1240px) {
  .frame {
    grid-template-columns: 290px minmax(0, 1fr) 236px;
  }
  .toc {
    display: block;
    position: sticky;
    top: var(--bar);
    align-self: start;
    max-height: calc(100vh - var(--bar));
    overflow-y: auto;
    padding: 46px 24px 40px 4px;
    scrollbar-width: thin;
    scrollbar-color: var(--line-strong) transparent;
  }
}

/* ---- the foot */
.foot {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 22px 24px 30px;
  border-top: 1px solid var(--line);
  color: var(--ink-3);
  font-size: 13.5px;
}

.foot img {
  flex: none;
  border-radius: 8px;
}

.foot p {
  margin: 0;
  max-width: 62rem;
}

.foot .also {
  margin-left: 10px;
}

/* ---- the guide's first page */
.emblem {
  display: none;
}

.front .emblem {
  display: block;
  float: right;
  width: 208px;
  height: 208px;
  margin: 0 0 24px 44px;
}

.front h1 {
  margin-top: 8px;
  font-size: clamp(44px, 6vw, 60px);
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.front .page-icon {
  display: none;
}

.front h1 + p {
  font-size: 19px;
  color: var(--ink);
}

.front article {
  max-width: 50rem;
}

.front .code,
.front h2 {
  clear: both;
}

/* ---- narrow screens */
@media (max-width: 940px) {
  .frame {
    display: flex;
    flex-direction: column;
  }
  main {
    order: 1;
    padding: 28px 20px 48px;
  }
  .pages {
    order: 2;
    position: static;
    max-height: none;
    border-right: 0;
    border-top: 1px solid var(--line);
    padding: 24px 12px 30px;
  }
  .pages ul {
    columns: 2 200px;
  }
  .pages li {
    break-inside: avoid;
  }
  .to-pages {
    display: flex;
  }
  .top {
    gap: 12px;
    padding: 0 16px;
  }
  .search {
    flex: 1 1 auto;
    max-width: 420px;
  }
  .results p {
    margin-left: 0;
  }
  h1 {
    gap: 12px;
    font-size: 30px;
  }
  .page-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    font-size: 24px;
  }
  h2 {
    font-size: 22px;
  }
  h2 .i {
    margin-top: 4px;
    font-size: 20px;
  }
  .anchor {
    gap: 10px;
  }
  .front .emblem {
    float: none;
    width: 132px;
    height: 132px;
    margin: 0 0 16px;
  }
}

@media (max-width: 560px) {
  .to-pages .words {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
  .to-pages .i {
    font-size: 22px;
  }
  .results li {
    grid-template-columns: minmax(0, 1fr);
  }
  .results .in {
    order: 3;
    margin-top: 6px;
  }
}

@media print {
  .search,
  .top,
  .pages,
  .toc,
  .pager,
  .skip {
    display: none;
  }
  .frame {
    display: block;
  }
  html,
  body {
    background: #fff;
    color: #000;
  }
}
