:root,
.light,
.rust {
  --bg: #eeede8;
  --fg: #181a1d;
  --sidebar-bg: #0b0d10;
  --sidebar-fg: #f4f5f3;
  --sidebar-non-existant: #818892;
  --sidebar-active: #f08a72;
  --sidebar-spacer: #2c3239;
  --scrollbar: #767b7f;
  --icons: #59616b;
  --icons-hover: #c54b34;
  --links: #334f6f;
  --inline-code-color: #a33d29;
  --theme-popup-bg: #f6f5f0;
  --theme-popup-border: #aaa9a3;
  --theme-hover: #dfddd6;
  --quote-bg: #e5e3dd;
  --quote-border: #596673;
  --warning-border: #c54b34;
  --table-border-color: #c8c6bf;
  --table-header-bg: #dedcd5;
  --table-alternate-bg: #e9e7e1;
  --searchbar-border-color: #93938f;
  --searchbar-bg: #f6f5f0;
  --searchbar-fg: #181a1d;
  --searchbar-shadow-color: #c54b34;
  --searchresults-header-fg: #60656a;
  --searchresults-border-color: #aaa9a3;
  --searchresults-li-bg: #f6f5f0;
  --search-mark-bg: #e8b3a7;
  --copy-button-filter: invert(34%) sepia(10%) saturate(778%) hue-rotate(174deg)
    brightness(92%) contrast(89%);
  --copy-button-filter-hover: invert(38%) sepia(60%) saturate(1181%)
    hue-rotate(333deg) brightness(84%) contrast(94%);
  --footnote-highlight: #c54b34;
  --overlay-bg: rgba(11, 13, 16, 0.55);
  --blockquote-note-color: #465a70;
  --blockquote-tip-color: #2f6d4b;
  --blockquote-important-color: #6a4c79;
  --blockquote-warning-color: #8a5b13;
  --blockquote-caution-color: #a33d29;
  --sidebar-header-border-color: #e05a3f;
  --color-scheme: light;

  --paper: #eeede8;
  --surface: #f6f5f0;
  --surface-muted: #e5e3dd;
  --edge: #c8c6bf;
  --edge-strong: #93938f;
  --muted: #60656a;
  --accent: #c54b34;
  --accent-hover: #96331f;
  --code-bg: #11151a;
  --code-fg: #e7ebef;
  --focus-ring: #c54b34;
  --focus-halo: rgba(197, 75, 52, 0.2);
  --toolbar-bg: #eeede8;
  --content-max-width: 96rem;
  --reading-width: 68rem;
}

.navy,
.ayu,
.coal {
  --bg: #0f1216;
  --fg: #edf0f2;
  --sidebar-bg: #090b0e;
  --sidebar-fg: #f4f5f3;
  --sidebar-non-existant: #818892;
  --sidebar-active: #f08a72;
  --sidebar-spacer: #2c3239;
  --scrollbar: #747c85;
  --icons: #a6afb9;
  --icons-hover: #f08a72;
  --links: #aabed6;
  --inline-code-color: #f08a72;
  --theme-popup-bg: #181d23;
  --theme-popup-border: #353d46;
  --theme-hover: #252c34;
  --quote-bg: #171c22;
  --quote-border: #8492a1;
  --warning-border: #f08a72;
  --table-border-color: #353d46;
  --table-header-bg: #1b2128;
  --table-alternate-bg: #14191f;
  --searchbar-border-color: #56606b;
  --searchbar-bg: #181d23;
  --searchbar-fg: #edf0f2;
  --searchbar-shadow-color: #f08a72;
  --searchresults-header-fg: #a6afb9;
  --searchresults-border-color: #353d46;
  --searchresults-li-bg: #181d23;
  --search-mark-bg: #6a3228;
  --copy-button-filter: invert(76%) sepia(7%) saturate(489%) hue-rotate(173deg)
    brightness(94%) contrast(88%);
  --copy-button-filter-hover: invert(72%) sepia(40%) saturate(951%)
    hue-rotate(315deg) brightness(101%) contrast(89%);
  --footnote-highlight: #f08a72;
  --overlay-bg: rgba(0, 0, 0, 0.7);
  --blockquote-note-color: #aabed6;
  --blockquote-tip-color: #86c59f;
  --blockquote-important-color: #c5a9d4;
  --blockquote-warning-color: #e0b268;
  --blockquote-caution-color: #f08a72;
  --sidebar-header-border-color: #e05a3f;
  --color-scheme: dark;

  --paper: #0f1216;
  --surface: #181d23;
  --surface-muted: #171c22;
  --edge: #353d46;
  --edge-strong: #56606b;
  --muted: #a6afb9;
  --accent: #f08a72;
  --accent-hover: #ffad99;
  --code-bg: #090c10;
  --code-fg: #e7ebef;
  --focus-ring: #f08a72;
  --focus-halo: rgba(240, 138, 114, 0.24);
  --toolbar-bg: #0f1216;
}

html {
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont,
    "Helvetica Neue", Arial, sans-serif;
  font-optical-sizing: auto;
  text-rendering: optimizeLegibility;
}

body {
  letter-spacing: normal;
}

code,
pre,
.chapter li.part-title,
.docs-brand-name,
.docs-brand-descriptor,
.docs-menu-descriptor {
  font-family: "JetBrains Mono", "SFMono-Regular", Menlo, Monaco, Consolas,
    monospace;
  letter-spacing: normal;
}

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

#mdbook-menu-bar {
  min-height: 5.2rem;
  background: var(--toolbar-bg);
  border-block-end: 1px solid transparent;
}

#mdbook-menu-bar.bordered {
  border-block-end-color: var(--edge);
}

#mdbook-menu-bar .icon-button,
#mdbook-menu-bar a,
.mobile-nav-chapters {
  transition:
    color 100ms ease,
    background-color 100ms ease,
    border-color 100ms ease,
    transform 100ms ease;
}

#mdbook-menu-bar .icon-button:active,
#mdbook-menu-bar a:active,
.mobile-nav-chapters:active {
  transform: scale(0.97);
}

.menu-title {
  display: flex;
  min-width: 0;
  align-items: baseline;
  gap: 0.9rem;
  color: var(--fg);
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.docs-menu-descriptor {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.docs-site-link {
  display: inline-flex;
  height: 3.2rem;
  align-items: center;
  margin-inline: 0.5rem 0.7rem;
  color: var(--muted);
  font-size: 1.2rem;
  font-weight: 650;
  letter-spacing: 0.01em;
  text-decoration: none;
}

.docs-site-link:hover {
  color: var(--accent-hover);
}

.sidebar {
  border-inline-end: 1px solid #2c3239;
}

.sidebar .sidebar-scrollbox {
  padding: 0 1.5rem 3rem;
}

.docs-brand {
  display: grid;
  min-height: 10.8rem;
  grid-template-columns: 3.8rem 1fr;
  align-items: center;
  gap: 1.25rem;
  margin: 0 -1.5rem 2rem;
  padding: 1.8rem 1.5rem;
  border-block-end: 1px solid #2c3239;
  color: #f4f5f3;
  text-decoration: none;
}

.docs-brand:hover {
  background: #11151a;
  color: #ffffff;
}

.docs-brand-mark {
  display: block;
  width: 3.8rem;
  height: 3.8rem;
}

.docs-brand-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.docs-brand-name,
.docs-brand-descriptor {
  color: #818892;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  line-height: 1.4;
  text-transform: uppercase;
}

.docs-brand-product {
  margin-block: 0.15rem 0 0.1rem;
  color: #f4f5f3;
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.2;
}

.chapter li.part-title {
  margin-block: 2.1rem 0.7rem;
  padding-inline: 0.8rem;
  color: #818892;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.chapter li a {
  display: block;
  margin: 0.1rem 0;
  padding: 0.5rem 0.8rem;
  border-inline-start: 2px solid transparent;
  border-radius: 2px;
  color: #b3bac2;
  line-height: 1.4;
}

.chapter li a:hover {
  background: #11151a;
  color: #ffffff;
}

.chapter li a.active,
.chapter a.current-header {
  border-inline-start-color: #e05a3f;
  background: #171c22;
  color: #ffffff;
  font-weight: 650;
}

.chapter li a.active:hover,
.chapter a.current-header:hover {
  color: #ffffff;
}

.on-this-page {
  border-inline-start-color: #e05a3f;
}

.content {
  padding-block-end: 5rem;
}

.content main {
  max-width: var(--reading-width);
}

.content h1,
.content h2,
.content h3,
.content h4 {
  color: var(--fg);
  font-weight: 700;
  text-wrap: balance;
}

.content h1 {
  margin-block: 6rem 1.6rem;
  font-size: clamp(3.2rem, 4vw, 4.2rem);
  letter-spacing: -0.04em;
  line-height: 1.06;
}

.content h1 + p {
  color: var(--muted);
  font-size: 1.78rem;
  line-height: 1.62;
}

.content h2 {
  margin-block: 5rem 1.4rem;
  padding-block-start: 1.7rem;
  border-block-start: 1px solid var(--edge);
  font-size: 2.45rem;
  letter-spacing: -0.025em;
  line-height: 1.2;
}

.content h3 {
  margin-block: 3.5rem 1rem;
  font-size: 1.85rem;
  letter-spacing: -0.012em;
  line-height: 1.3;
}

.content h4 {
  margin-block: 2.8rem 0.8rem;
  font-size: 1.55rem;
  line-height: 1.4;
}

.content p,
.content li {
  font-size: 1.55rem;
  line-height: 1.74;
}

.content li + li {
  margin-block-start: 0.45rem;
}

.content a:not(.header) {
  text-decoration: underline;
  text-decoration-thickness: 0.07em;
  text-underline-offset: 0.18em;
}

.content a:not(.header):hover {
  color: var(--accent-hover);
  text-decoration-thickness: 0.1em;
}

.content hr {
  margin-block: 4rem;
  border-block-start: 1px solid var(--edge);
}

.content strong {
  color: var(--fg);
  font-weight: 700;
}

.hljs {
  background: var(--code-bg);
  color: var(--code-fg);
}

pre {
  margin-block: 2.4rem;
  overflow: hidden;
  border: 1px solid var(--edge-strong);
  border-radius: 2px;
  background: var(--code-bg);
}

pre > code.hljs {
  overflow-x: auto;
  padding: 1.7rem 1.9rem;
  font-size: 1.35rem;
  line-height: 1.68;
}

:not(pre) > .hljs {
  padding: 0.12em 0.32em;
  border: 1px solid var(--edge);
  border-radius: 2px;
  background: var(--surface-muted);
}

pre > .buttons {
  visibility: visible;
  opacity: 0.7;
}

pre:hover > .buttons,
pre:focus-within > .buttons {
  opacity: 1;
}

pre > .buttons button {
  border-color: #56606b;
  border-radius: 2px;
  background: #181d23;
  box-shadow: none;
}

.table-wrapper {
  margin-block: 2.4rem;
  overflow: hidden;
  overflow-x: auto;
  border: 1px solid var(--edge-strong);
  border-radius: 2px;
}

.table-wrapper table {
  width: 100%;
  margin: 0;
  border-collapse: separate;
  border-spacing: 0;
  text-align: start;
}

.table-wrapper table th,
.table-wrapper table td {
  padding: 1.05rem 1.25rem;
  border: 0;
  border-block-start: 1px solid var(--table-border-color);
  font-size: 1.4rem;
  text-align: start;
  vertical-align: top;
}

.table-wrapper table thead th {
  border-block-start: 0;
  background: var(--table-header-bg);
  color: var(--fg);
  font-weight: 700;
}

.table-wrapper table tbody tr:nth-child(2n) {
  background: var(--table-alternate-bg);
}

blockquote,
.api-reference-status {
  margin-block: 2.6rem;
  padding: 1.4rem 1.6rem;
  border: 0;
  border-inline-start: 3px solid var(--quote-border);
  border-radius: 0;
  background: var(--quote-bg);
}

blockquote > :first-child,
.api-reference-status > :first-child {
  margin-block-start: 0;
}

blockquote > :last-child,
.api-reference-status > :last-child {
  margin-block-end: 0;
}

#mdbook-searchbar {
  padding: 1rem 1.2rem;
  border-radius: 2px;
  transition:
    border-color 100ms ease,
    box-shadow 100ms ease;
}

#mdbook-searchbar:focus,
#mdbook-searchbar.active {
  border-color: var(--focus-ring);
  box-shadow: 0 0 0 2px var(--focus-halo);
}

#mdbook-searchbar:focus-visible {
  outline: none;
}

.theme-popup,
#mdbook-help-popup {
  border-color: var(--edge-strong);
  border-radius: 2px;
  background: var(--surface);
  box-shadow: 0 1rem 2.4rem rgba(0, 0, 0, 0.2);
}

.theme-popup .theme {
  padding-block: 0.45rem;
}

.searchresults-outer {
  border-block-start: 1px solid var(--edge);
}

.mobile-nav-chapters {
  border: 1px solid var(--edge-strong);
  border-radius: 2px;
  background: var(--surface-muted);
}

.api-reference-status {
  border-inline-start-color: var(--quote-border);
}

#manifold-api-reference:not(:empty) {
  margin-block-start: 2.4rem;
  min-height: 40rem;
}

@media only screen and (max-width: 620px) {
  :root {
    --page-padding: 1.8rem;
  }

  #mdbook-menu-bar {
    min-height: 4.8rem;
  }

  .menu-title {
    font-size: 1.35rem;
  }

  .docs-menu-descriptor,
  .docs-site-link {
    display: none;
  }

  .content h1 {
    margin-block-start: 4rem;
    font-size: 3rem;
  }

  .content h1 + p {
    font-size: 1.65rem;
  }

  .content h2 {
    margin-block-start: 4.2rem;
    font-size: 2.2rem;
  }

  .content h3 {
    font-size: 1.75rem;
  }

  pre > code.hljs {
    padding: 1.45rem;
  }

  .table-wrapper table th,
  .table-wrapper table td {
    padding: 0.9rem 1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

@media (prefers-contrast: more) {
  :root,
  .light,
  .rust,
  .navy,
  .ayu,
  .coal {
    --edge: var(--edge-strong);
    --table-border-color: var(--edge-strong);
    --searchbar-border-color: var(--edge-strong);
  }

  :focus-visible {
    outline-width: 3px;
  }

  .content a:not(.header) {
    text-decoration-thickness: 0.12em;
  }
}

@media print {
  .content main {
    max-width: none;
  }

  .content h1 {
    margin-block-start: 0;
  }
}
