@font-face {
  font-family: "JetBrainsMono Nerd Font Mono";
  src: url("./fonts/JetBrainsMonoNerdFontMono-Regular.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "JetBrainsMono Nerd Font Mono";
  src: url("./fonts/JetBrainsMonoNerdFontMono-Italic.woff2") format("woff2");
  font-style: italic;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "JetBrainsMono Nerd Font Mono";
  src: url("./fonts/JetBrainsMonoNerdFontMono-Bold.woff2") format("woff2");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: "JetBrainsMono Nerd Font Mono";
  src: url("./fonts/JetBrainsMonoNerdFontMono-BoldItalic.woff2") format("woff2");
  font-style: italic;
  font-weight: 700;
  font-display: swap;
}

:root {
  color-scheme: light;
  --paper: #f5f3ec;
  --sheet: #fffefa;
  --ink: #25221e;
  --muted: #6c665e;
  --accent: #742d2d;
  --accent-hover: #4f1d1d;
  --rule: #c9c3b8;
  --soft-rule: #e5e0d7;
  --code-paper: #f0eee7;
  --typeface: "JetBrainsMono Nerd Font Mono", "JetBrains Mono",
    "Iosevka Term", "SFMono-Regular", Menlo, Consolas, "Liberation Mono",
    monospace;
  --serif: var(--typeface);
  --mono: var(--typeface);
}

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

html {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 18px;
  font-synthesis: none;
  scroll-behavior: smooth;
  text-rendering: optimizeLegibility;
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--sheet);
}

::selection {
  background: #e8d8cf;
}

a {
  color: var(--accent);
  text-decoration-thickness: 0.055em;
  text-underline-offset: 0.16em;
}

a:hover {
  color: var(--accent-hover);
}

a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 0.18rem;
}

.skip-link {
  position: absolute;
  z-index: 10;
  top: 0.5rem;
  left: 0.5rem;
  padding: 0.45rem 0.65rem;
  transform: translateY(-180%);
  background: var(--ink);
  color: var(--sheet);
  font-family: var(--mono);
  font-size: 0.72rem;
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  border-bottom: 1px solid var(--rule);
  background: var(--sheet);
}

.site-header-inner {
  display: flex;
  width: min(100% - 2.5rem, 76ch);
  min-height: 3.35rem;
  margin: 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
}

.wordmark {
  color: var(--ink);
  font-size: 0.88rem;
  font-variant: small-caps;
  font-weight: 600;
  letter-spacing: 0.11em;
  text-decoration: none;
  white-space: nowrap;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.35rem 1.05rem;
  font-size: 0.78rem;
  letter-spacing: 0.035em;
}

.site-nav a {
  color: var(--muted);
  text-decoration: none;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--ink);
}

#doc-root {
  width: min(100% - 2.5rem, 76ch);
  margin: 0 auto;
  padding: 4.5rem 0 7rem;
}

.document {
  line-height: 1.68;
}

h1,
h2,
h3 {
  color: var(--ink);
  font-family: var(--serif);
  text-wrap: balance;
}

h1 {
  max-width: 22ch;
  margin: 0 0 1.7rem;
  font-size: clamp(2.35rem, 8vw, 3.7rem);
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 1.02;
}

h2 {
  margin: 3.6rem 0 1.1rem;
  padding-bottom: 0.32rem;
  border-bottom: 1px solid var(--rule);
  font-size: 1.48rem;
  font-weight: 500;
  letter-spacing: -0.015em;
  line-height: 1.2;
}

h3 {
  margin: 2.2rem 0 0.45rem;
  padding-top: 1.05rem;
  border-top: 1px solid var(--soft-rule);
  font-size: 1.04rem;
  font-weight: 600;
  line-height: 1.3;
}

h1 + p {
  max-width: 60ch;
  margin-top: -0.6rem;
  color: var(--muted);
  font-size: 1.12rem;
  line-height: 1.55;
}

p,
ul,
ol,
pre,
blockquote,
table {
  margin-top: 0.9rem;
  margin-bottom: 1rem;
}

ul,
ol {
  padding-left: 1.35rem;
}

li {
  padding-left: 0.15rem;
}

li + li {
  margin-top: 0.24rem;
}

code {
  padding: 0.06em 0.22em;
  background: var(--code-paper);
  color: #322c27;
  font-family: var(--mono);
  font-size: 0.86em;
  font-variant-ligatures: none;
}

h1 code,
h2 code,
h3 code {
  padding: 0;
  background: transparent;
  color: inherit;
  font-size: 0.88em;
  font-weight: inherit;
}

pre {
  max-width: 100%;
  overflow-x: auto;
  padding: 1rem 1.1rem;
  border: 0;
  border-left: 3px solid var(--accent);
  background: var(--code-paper);
  color: #2e2924;
  font-family: var(--mono);
  font-size: 0.83rem;
  line-height: 1.62;
  tab-size: 2;
}

pre code {
  padding: 0;
  background: transparent;
  color: inherit;
  font-size: inherit;
}

blockquote {
  margin-left: 0;
  padding: 0.05rem 0 0.05rem 1rem;
  border-left: 1px solid var(--rule);
  color: var(--muted);
  font-style: italic;
}

hr {
  width: 7rem;
  margin: 3rem auto;
  border: 0;
  border-top: 1px solid var(--rule);
}

.table-wrap {
  max-width: 100%;
  margin: 1.4rem 0;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  border-top: 1.5px solid var(--ink);
  border-bottom: 1.5px solid var(--ink);
  font-size: 0.9rem;
  line-height: 1.45;
}

th,
td {
  padding: 0.52rem 0.7rem 0.52rem 0;
  border: 0;
  text-align: left;
  vertical-align: top;
}

th:last-child,
td:last-child {
  padding-right: 0;
}

thead {
  border-bottom: 1px solid var(--rule);
}

th {
  font-weight: 600;
}

tbody tr + tr {
  border-top: 1px solid var(--soft-rule);
}

img {
  max-width: 100%;
  height: auto;
}

.portal-alert {
  padding: 0.8rem 1rem;
  border-left: 3px solid var(--accent);
  background: var(--code-paper);
  white-space: pre-wrap;
}

html[data-site="libs"] #packages + ul {
  columns: 2 15rem;
  column-gap: 2.5rem;
  padding-left: 1.1rem;
}

html[data-site="libs"] #packages + ul li {
  break-inside: avoid;
  margin: 0 0 0.22rem;
}

@media (max-width: 38rem) {
  html {
    font-size: 17px;
  }

  .site-header-inner {
    width: min(100% - 1.5rem, 76ch);
    padding: 0.68rem 0;
    align-items: flex-start;
    flex-direction: column;
    gap: 0.35rem;
  }

  .site-nav {
    justify-content: flex-start;
  }

  #doc-root {
    width: min(100% - 1.5rem, 76ch);
    padding: 3.25rem 0 5rem;
  }

  h2 {
    margin-top: 3rem;
  }

  html[data-site="libs"] #packages + ul {
    columns: 1;
  }
}

@media print {
  :root {
    --paper: #fff;
    --sheet: #fff;
  }

  html,
  body {
    background: #fff;
  }

  .site-header,
  .skip-link {
    display: none;
  }

  #doc-root {
    width: auto;
    padding: 0;
  }

  a {
    color: inherit;
  }

  pre,
  blockquote,
  h2,
  h3 {
    break-inside: avoid;
  }
}
