:root {
  --body-background: #edd89d;
  --body-font-color: #050100;
  --color-link: #008153;
  --color-visited-link: #005477;
  --stuff-dark-background: #0e0c08;
  --stuff-dark-surface: #1b1713;
  --stuff-dark-white: #e9ddd2;
  --stuff-dark-black: #0a0806;
}

body {
  margin: 0;
  color: var(--body-font-color);
  font-family: "Nunito Sans", system-ui, -apple-system, sans-serif;
}

.docs-site {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}

.docs-site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid color-mix(in srgb, var(--stuff-secondary) 14%, transparent);
  background: color-mix(in srgb, var(--stuff-surface) 76%, transparent);
  backdrop-filter: blur(16px);
}

.docs-site-header-start,
.docs-site-header-end {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.site-identity {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  min-width: 0;
  color: var(--body-font-color);
  text-decoration: none;
}

.site-logo-img {
  width: 2.75rem;
  height: 2.75rem;
  flex: 0 0 auto;
}

.site-logo-name {
  font-size: 1.1rem;
  font-weight: 900;
  letter-spacing: -0.025em;
}

.nav-trigger,
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border-radius: 1rem;
  background: color-mix(in srgb, var(--stuff-surface) 82%, transparent);
  color: var(--stuff-secondary);
  cursor: pointer;
}

.nav-trigger .icon,
.theme-toggle .icon {
  width: 1.15rem;
  height: 1.15rem;
  flex: 0 0 auto;
}

.docs-shell {
  display: flex;
  flex: 1 1 auto;
  height: calc(100dvh - 4.8125rem);
  min-height: 0;
}

.book-menu,
.book-menu-content,
.book-page,
.book-article,
.book-footer {
  font-family: "Nunito Sans", system-ui, -apple-system, sans-serif;
}

.book-menu {
  display: block;
  width: 21rem;
  flex: 0 0 21rem;
  padding: 0;
}

.book-menu-content {
  position: sticky;
  top: 4.8125rem;
  height: calc(100dvh - 4.8125rem);
  box-sizing: border-box;
  overflow: hidden;
  padding: 1.25rem;
  background: var(--stuff-surface);
  box-shadow: var(--stuff-shadow-md);
}

.book-menu-content--drawer {
  height: auto;
}

.book-page {
  min-height: calc(100dvh - 8.5rem);
  width: 100%;
  display: flex;
  flex-direction: column;
  flex: 0 0 auto;
  background: var(--stuff-surface);
  border: 1px solid color-mix(in srgb, var(--stuff-secondary) 14%, transparent);
  box-shadow: var(--stuff-shadow-lg);
  overflow: hidden;
}

.book-article {
  flex: 1 0 auto;
  padding: 0.5rem 1rem;
}

.book-article > :first-child {
  margin-top: 0;
}

.book-footer {
  margin-top: auto;
  padding: 0 1.25rem 0.75rem;
}

.docs-main {
  min-width: 0;
  flex: 1 1 auto;
  display: flex;
  align-items: flex-start;
  padding: 0 0.5rem 0 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.docs-sidebar-nav {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

.docs-sidebar-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding-bottom: 1rem;
}

.docs-sidebar-scroll::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.docs-sidebar-footer {
  flex: 0 0 auto;
  margin-top: auto;
  background: var(--stuff-surface);
}

.docs-tree,
.docs-external-links {
  list-style: none;
  margin: 0;
  padding: 0;
}

.docs-tree-children {
  margin-left: 0.85rem;
  padding-left: 0.9rem;
  border-left: 1px solid color-mix(in srgb, var(--stuff-secondary) 16%, transparent);
}

.docs-tree-item + .docs-tree-item {
  margin-top: 0.3rem;
}

.docs-tree-toggle {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.docs-tree-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.docs-tree-toggle ~ .docs-tree-children {
  display: none;
}

.docs-tree-toggle:checked ~ .docs-tree-children {
  display: block;
}

.docs-tree-link,
.docs-menu-link {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
  padding: 0.45rem 0.65rem;
  color: var(--body-font-color);
  font-weight: 700;
  line-height: 1.25;
  text-decoration: none;
}

.docs-menu-link-icon,
.docs-menu-link-logo {
  width: 1rem;
  height: 1rem;
  flex: 0 0 auto;
}

.docs-menu-link-logo--product {
  width: 1.25rem;
  height: 1.25rem;
}

.docs-menu-link-logo {
  object-fit: contain;
}

.docs-tree-link:hover,
.docs-menu-link:hover {
  color: var(--stuff-secondary);
  background: color-mix(in srgb, var(--stuff-secondary) 10%, transparent);
}

.docs-tree-link.active {
  color: var(--stuff-secondary);
  background: color-mix(in srgb, var(--stuff-accent) 18%, var(--stuff-surface));
}

.docs-tree-chevron {
  width: 0.7rem;
  height: 0.7rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  color: color-mix(in srgb, var(--stuff-secondary) 80%, var(--body-font-color));
  transform: rotate(-45deg);
  transition: transform 150ms ease;
}

.docs-tree-toggle:checked + .docs-tree-label .docs-tree-chevron {
  transform: rotate(45deg);
}

.docs-external-links {
  margin-top: 0;
  padding-top: 1rem;
  border-top: 1px solid color-mix(in srgb, var(--stuff-secondary) 16%, transparent);
}

.docs-external-links li + li {
  margin-top: 0.4rem;
}

.markdown {
  color: var(--body-font-color);
  line-height: 1.65;
}

.markdown a,
.book-footer a {
  color: var(--color-link);
  text-decoration-color: color-mix(in srgb, var(--color-link) 35%, transparent);
  text-underline-offset: 0.16em;
}

.markdown a:hover,
.book-footer a:hover {
  color: var(--stuff-secondary);
}

.markdown h1,
.markdown h2,
.markdown h3,
.markdown h4,
.markdown h5,
.markdown h6 {
  color: var(--stuff-secondary);
  font-family: "Nunito Sans", system-ui, -apple-system, sans-serif;
  font-weight: 900;
  letter-spacing: -0.02em;
}

.markdown h1 {
  margin-top: 0;
  font-size: clamp(2rem, 3vw, 2.6rem);
  line-height: 1.1;
}

.markdown pre {
  padding: 1rem;
  background: color-mix(in srgb, var(--stuff-secondary) 8%, var(--stuff-surface));
  border: 1px solid color-mix(in srgb, var(--stuff-secondary) 16%, transparent);
  overflow: auto;
}

.markdown iframe[title*="architecture" i],
.markdown iframe[src*="architecture" i] {
  width: 100%;
  min-height: 28rem;
  border: 1px solid color-mix(in srgb, var(--stuff-secondary) 18%, transparent);
  box-shadow: var(--stuff-shadow-lg);
  background: var(--stuff-surface);
}

.brand-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 0.9rem;
  border-top: 1px solid color-mix(in srgb, var(--stuff-secondary) 16%, transparent);
}

.brand-footer-copy {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  color: color-mix(in srgb, var(--body-font-color) 78%, transparent);
  font-size: 0.9rem;
}

.brand-footer-copy p {
  margin: 0;
}

.brand-footer-mark {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
}

.brand-footer-mark img {
  display: block;
  width: auto;
  height: 2rem;
}

@media (max-width: 1023px) {
  .docs-site-header {
    position: sticky;
  }

  .docs-shell {
    height: calc(100dvh - 4.8125rem);
  }

  .docs-main {
    padding: 0.5rem;
  }

  .book-menu {
    position: fixed;
    inset: 4.8125rem auto 0 0;
    z-index: 60;
    width: min(21rem, calc(100vw - 2rem));
    max-width: calc(100vw - 2rem);
    padding: 0;
    transform: translateX(calc(-100% - 1rem));
    transition: transform 180ms ease;
  }

  .docs-nav-open .book-menu {
    transform: translateX(0);
  }

  .book-menu-content {
    position: static;
    height: calc(100dvh - 4.8125rem);
  }

  .book-page {
    min-height: calc(100dvh - 8rem);
  }
}

@media (min-width: 1024px) {
  .nav-trigger {
    display: none;
  }
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --body-background: var(--stuff-dark-background);
    --body-font-color: var(--stuff-dark-white);
    --color-link: #6bbacf;
    --color-visited-link: #5fc491;
  }
}

html[data-theme="dark"] {
  --body-background: var(--stuff-dark-background);
  --body-font-color: var(--stuff-dark-white);
  --color-link: #6bbacf;
  --color-visited-link: #5fc491;
}

html[data-theme="dark"] .book-menu-content,
html[data-theme="dark"] .book-page {
  background: var(--stuff-dark-surface);
  color: var(--stuff-dark-white);
  border-color: color-mix(in srgb, var(--stuff-dark-white) 14%, transparent);
}

html[data-theme="dark"] .docs-site-header {
  border-bottom-color: color-mix(in srgb, var(--stuff-dark-white) 14%, transparent);
  background: color-mix(in srgb, var(--stuff-dark-surface) 78%, transparent);
}

html[data-theme="dark"] .book-brand a,
html[data-theme="dark"] .docs-tree-link,
html[data-theme="dark"] .docs-menu-link,
html[data-theme="dark"] .brand-footer-copy,
html[data-theme="dark"] .markdown,
html[data-theme="dark"] .site-identity,
html[data-theme="dark"] .nav-trigger,
html[data-theme="dark"] .theme-toggle {
  color: var(--stuff-dark-white);
}

html[data-theme="dark"] .docs-tree-link:hover,
html[data-theme="dark"] .docs-menu-link:hover {
  color: #6bbacf;
  background: color-mix(in srgb, #6bbacf 12%, transparent);
}

html[data-theme="dark"] .docs-tree-link.active {
  color: #6bbacf;
  background: color-mix(in srgb, #f5c84e 10%, var(--stuff-dark-surface));
}

html[data-theme="dark"] .docs-tree-children,
html[data-theme="dark"] .docs-external-links,
html[data-theme="dark"] .brand-footer {
  border-color: color-mix(in srgb, var(--stuff-dark-white) 14%, transparent);
}

html[data-theme="dark"] .docs-sidebar-footer {
  background: var(--stuff-dark-surface);
}

html[data-theme="dark"] .markdown h1,
html[data-theme="dark"] .markdown h2,
html[data-theme="dark"] .markdown h3,
html[data-theme="dark"] .markdown h4,
html[data-theme="dark"] .markdown h5,
html[data-theme="dark"] .markdown h6,
html[data-theme="dark"] .book-footer a {
  color: var(--stuff-dark-white);
}
