/* docs.twinfinity.com's layout in twinfinity.com's colours and shapes, on TypeDoc's theme. TypeDoc's styles sit
   in `@layer typedoc`, so these win. */

@font-face {
  font-family: 'Inter';
  font-weight: 100 900;
  src: url('inter.woff2') format('woff2');
}
@font-face {
  font-family: 'JetBrains Mono';
  font-weight: 100 800;
  src: url('jetbrains-mono.woff2') format('woff2');
}

:root {
  --dim-toolbar-contents-height: 64px;
  --dim-toolbar-border-bottom-width: 0px;
  --light-color-background: #fff;
  --light-color-background-secondary: #fff;
  --light-color-text: #101010;
  --light-color-link: var(--site-blue);
  --light-color-active-menu-item: #101010;
  --dark-color-background: #1b1b1d;
  --dark-color-background-secondary: #1b1b1d;
  --dark-color-text: #e3e3e3;
  --dark-color-link: #5c8aff;
  --dark-color-active-menu-item: #3d4048;
  /* twinfinity.com's greys, corners and button hover, in either theme */
  --site-shade: color-mix(in srgb, var(--color-text) 7%, transparent);
  --site-muted: color-mix(in srgb, var(--color-text) 62%, transparent);
  --site-radius: 8px;
  --site-blue: #2461ff;
  --site-blue-hover: #0054d1;
  /* the kinds' icon colours (Infima's info, success, warning and danger) */
  --site-info: #54c7ec;
  --site-success: #00a400;
  --site-warning: #ffba00;
  --site-danger: #fa383e;
  --font-family-code: 'JetBrains Mono', monospace;
}

/* The footer sits at the bottom of the window when the page is shorter than the window. Long names and URLs wrap
   instead of making the page or a menu scroll sideways. */
body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 16px;
  overflow-wrap: anywhere;
}
.container-main {
  --dim-container-main-margin-y: 0rem;
  flex: 1 0 auto;
  min-height: 0;
  margin: 0;
}

/* Navbar */
.container {
  max-width: none;
  padding: 0;
}
.tsd-toolbar-contents.container {
  padding: 0 16px;
}
.tsd-toolbar-contents > .title {
  width: 158px;
  height: 32px;
  margin-right: 16px;
  font-size: 0;
  background: var(--color-text);
  mask: url('logo.svg') left center / contain no-repeat;
}
#tsd-toolbar-links {
  gap: 0;
  margin-right: auto;
}
/* Phones hide the links, so the logo pushes the buttons to the right edge. */
@media (max-width: 769px) {
  .tsd-toolbar-contents > .title {
    margin-right: auto;
  }
}
#tsd-toolbar-links a {
  padding: 4px 12px;
  font-weight: 500;
}
#tsd-toolbar-links a:hover,
.tsd-navigation a:hover {
  color: var(--color-link);
  text-decoration: none;
}
.api-menu {
  position: relative;
}
.api-menu > a::after {
  content: '';
  display: inline-block;
  margin-left: 6px;
  vertical-align: 2px;
  border: 5px solid transparent;
  border-top-color: currentColor;
  border-bottom: 0;
}
.api-menu > div {
  border: 1px solid var(--site-shade);
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 10rem;
  padding: 8px;
  background: var(--color-background);
  border-radius: var(--site-radius);
  box-shadow: 0 5px 40px rgb(0 0 0 / 20%);
}
.api-menu:not(.closed):hover > div,
.api-menu:not(.closed):focus-within > div {
  display: block;
}
#tsd-toolbar-links .api-menu > div a {
  display: block;
  padding: 4px 8px;
  font-size: 14px;
  border-radius: 4px;
}
.api-menu > div a:hover,
.theme-toggle:hover {
  background: var(--site-shade);
}
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--color-text);
  cursor: pointer;
}

/* Layout: the sidebar against the left edge, the content, and the page menu on wide screens; narrower, the
   page menu sits above the packages in the sidebar, as in TypeDoc. The menus fill the content's height up to
   the window's, but never make a short page taller (`contain: size`). */
@media (min-width: 770px) {
  .container-main {
    grid-template-columns: 300px minmax(0, 1fr);
  }
}
@media (min-width: 770px) and (width < 997px) {
  .col-sidebar {
    position: sticky;
    top: var(--dim-header-height);
    max-height: calc(100vh - var(--dim-header-height));
    box-sizing: border-box;
    contain: size;
    overflow-y: auto;
    padding: 8px;
    border-right: 1px solid var(--site-shade);
  }
  .page-menu {
    padding: 8px 12px 16px;
    border-bottom: 1px solid var(--site-shade);
  }
  .site-menu {
    margin: 0;
  }
  /* The list of members can be folded away, above the packages, with the chevron on the right as in Settings. */
  .page-menu .tsd-page-navigation > summary {
    display: flex;
    margin-top: 8px;
  }
  .page-menu .tsd-page-navigation > summary > svg {
    order: 1;
    margin: 4px 12px 0 auto;
  }
  .page-menu .tsd-page-navigation:not([open])::details-content {
    content-visibility: hidden;
  }
}
@media (min-width: 997px) {
  .container-main {
    grid-template-columns: 300px minmax(0, 1fr) 240px;
  }
  .col-sidebar {
    display: contents;
  }
  .site-menu {
    grid-area: sidebar;
    position: sticky;
    top: var(--dim-header-height);
    max-height: calc(100vh - var(--dim-header-height));
    box-sizing: border-box;
    contain: size;
    margin: 0;
    overflow-y: auto;
    padding: 8px;
    border-right: 1px solid var(--site-shade);
  }
  .page-menu {
    display: block;
    position: sticky;
    top: calc(var(--dim-header-height) + 16px);
    max-height: calc(100vh - var(--dim-header-height) - 32px);
    contain: size;
    overflow-y: auto;
    margin-top: 16px;
    padding: 0 16px;
    border-left: 1px solid var(--site-shade);
  }
}

/* Sidebar: the packages at the top, folders with a chevron on the right */
.site-menu .tsd-navigation > a:not(.tsd-nav-link),
.tsd-navigation .tsd-kind-icon,
.tsd-navigation summary > :is(a, span) > svg {
  display: none;
}
#tsd-nav-container,
.tsd-nested-navigation > li > details,
.tsd-small-nested-navigation > li > details {
  margin-left: 0;
}
.tsd-nested-navigation {
  margin-left: 12px;
}
.tsd-navigation .tsd-accordion-summary {
  width: auto;
}
.tsd-navigation .tsd-accordion-summary > svg {
  order: 1;
  flex-shrink: 0;
  margin: 4px 12px 0 auto;
}
.tsd-navigation a,
.tsd-navigation summary > span {
  width: auto;
  flex: 1;
  margin: 4px 0 0;
  padding: 7px 12px;
  border-radius: var(--site-radius);
  font-weight: 500;
  line-height: 20px;
}
.tsd-navigation a.current,
.tsd-navigation a.current * {
  color: #fff;
}
.tsd-navigation details:has(a.current) > summary > :is(a:not(.current), span),
.tsd-navigation details:has(a.current) > summary > :is(a:not(.current), span) * {
  color: var(--color-link);
}

/* Content: breadcrumb, title, and twinfinity.com's square bordered cards, here with a grey header */
.tsd-breadcrumb {
  margin: 0 0 14px;
  font-size: 12.8px;
  font-weight: 600;
}
.tsd-breadcrumb a {
  color: var(--site-muted);
}
.tsd-breadcrumb li:last-child a {
  color: var(--color-text);
}
.tsd-breadcrumb li:last-child::after {
  content: none;
}
.col-content {
  box-sizing: border-box;
  padding: 16px 16px 32px;
}
/* Anchors land below the sticky navbar, also after a page swapped in place (where `:target` is not set). */
.col-content [id] {
  scroll-margin-top: calc(var(--dim-header-height) + 8px);
}
/* Reads out a page swapped in place to screen readers, unseen. */
.page-announcer {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.tsd-page-title h1 {
  margin: 0 0 25px;
  font-size: 48px;
  font-weight: 600;
  line-height: 1;
}
.tsd-panel-group > summary > svg,
.tsd-index-summary > svg {
  display: none;
}
.tsd-accordion-summary {
  height: auto;
}
/* TypeDoc draws the focus ring on the chevron, which these headings hide. */
.tsd-accordion-summary:focus-visible {
  outline: 2px solid var(--color-focus-outline);
}
.tsd-panel-group > summary h2,
.tsd-index-heading.uppercase {
  margin: 0;
  font-size: 32px;
  font-weight: 600;
  text-transform: none;
}
.tsd-panel-group.tsd-index-group,
.tsd-index-panel {
  padding: 0;
  border: 0;
  background: none;
}
.tsd-index-section,
.tsd-panel.tsd-member {
  margin-bottom: 16px;
  border: 1px solid var(--site-shade);
}
.tsd-index-section > h3,
.tsd-panel.tsd-member > h3 {
  margin: 0;
  padding: 12px 16px;
  background: var(--site-shade);
  border: 0;
  font-size: 24px;
  font-weight: 600;
}
.tsd-index-list {
  padding: 12px 16px;
}
.tsd-panel.tsd-member > :not(h3) {
  margin: 16px;
}
/* Signatures in the text's font and size, code a little smaller than the text around it; TypeDoc fixes both at 14px. */
.tsd-signature {
  border: 0;
  padding: 0;
  font-family: inherit;
  font-size: inherit;
}
code,
pre {
  font-family: var(--font-family-code);
  font-size: 0.95em;
}
pre code {
  font-size: inherit;
}
/* Flags (Readonly, Static, Optional, …): small grey tags in the text's font, also in headings. */
code.tsd-tag {
  padding: 3px 6px;
  border: 0;
  border-radius: 6px;
  background: var(--site-shade);
  color: var(--site-muted);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 400;
  vertical-align: middle;
}
a.tsd-index-link,
a.tsd-index-link span {
  color: var(--color-link);
}

/* The API index: each package with its version */
.tsd-member-summaries:has(.package-version) {
  display: grid;
  grid-template-columns: minmax(0, max-content) 1fr;
  align-items: center;
  gap: 4px 16px;
  margin-block: 16px;
  padding: 12px 16px;
  border: 1px solid var(--site-shade);
}
.tsd-member-summaries:has(.package-version) dd {
  margin: 0;
}
.package-version {
  color: var(--site-muted);
  font-family: var(--font-family-code);
}

/* Page menu: TypeDoc's settings (the theme is the navbar's button) above the list of members */
.page-menu .tsd-theme-toggle,
.tsd-page-navigation > summary,
.tsd-page-navigation-section > summary {
  display: none;
}
/* Without its summary the list stays shown, also when it was folded away in the narrower sidebar. */
.tsd-page-navigation:not([open])::details-content {
  content-visibility: visible;
}
.tsd-page-navigation-section > div {
  margin-left: 0;
}
.tsd-page-navigation a {
  font-size: 12.8px;
  color: var(--site-muted);
}

/* Home page: the project's readme as a full-width hero, with twinfinity.com's button */
.container-main:has(.hero) {
  display: block;
  padding-bottom: 64px;
}
.container-main:has(.hero) .tsd-page-title {
  display: none;
}
/* Phones keep the sidebar: it is the menu button's drawer. */
@media (min-width: 770px) {
  .container-main:has(.hero) .col-sidebar {
    display: none;
  }
}
.col-content:has(.hero),
.col-content:has(.hero) .tsd-panel {
  margin: 0;
  padding: 0;
}
/* Headings wrap between words only, and shrink to fit a phone. */
.hero {
  padding: 64px 16px;
  background: var(--site-blue);
  color: #fff;
  text-align: center;
  overflow-wrap: normal;
}
.hero h1 {
  margin: 0 0 16px;
  font-size: clamp(2rem, 8vw, 48px);
  font-weight: 600;
  color: #fff;
}
.hero p {
  margin: 0 0 24px;
  font-size: 24px;
}
.hero a {
  display: inline-block;
  padding: 8px 12px;
  border-radius: var(--site-radius);
  background: #fff;
  color: var(--light-color-text);
  font-weight: 500;
  line-height: 24px;
  text-decoration: none;
}
.hero a:hover {
  color: var(--site-blue-hover);
}
/* TypeDoc's blue focus ring barely shows on the hero's blue and the footer's grey. */
.hero a:focus-visible,
footer a:focus-visible {
  outline-color: #fff;
  outline-offset: 2px;
}

/* Footer: Docs beside Links, centred, with the packages in columns as wide as their names */
footer {
  max-height: none;
  padding: 24px 32px;
  border: 0;
  background: #3d4048;
  color: #ebedf0;
}
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 64px;
}
.footer-packages ul {
  display: grid;
  column-gap: 48px;
}
@media (min-width: 770px) {
  .footer-links {
    justify-content: center;
  }
  .footer-packages ul {
    grid-template-columns: repeat(2, max-content);
  }
}
@media (min-width: 1200px) {
  .footer-packages ul {
    grid-template-columns: repeat(4, max-content);
  }
}
.footer-links h4 {
  margin: 0 0 8px;
  color: #fff;
}
.footer-links ul {
  margin: 0;
  padding: 0;
  list-style: none;
  line-height: 28px;
}
.footer-links a,
.footer-copyright a {
  color: inherit;
}
.footer-copyright {
  margin: 16px 0 0;
  text-align: center;
}
