:root {
  --color-page: #fff;
  --color-surface: #f9fafb;
  --color-surface-secondary: #f3f4f6;
  --color-text: #111827;
  --color-text-subtle: #374151;
  --color-text-muted: #6b7280;
  --color-brand: #3b82f6;
  --color-clickable: #3b82f6;
  --color-clickable-hover: #2563eb;
  --color-border: #e5e7eb;
  --color-hover: #f9fafb;
  --font-sans: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-serif: "Roboto Slab", serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, "SF Mono", Consolas, "Liberation Mono", Menlo, monospace;
}

[data-theme="dark"] {
  --color-page: #111827;
  --color-surface: #1f2937;
  --color-surface-secondary: #374151;
  --color-text: #f9fafb;
  --color-text-subtle: #d1d5db;
  --color-text-muted: #9ca3af;
  --color-border: #374151;
  --color-hover: #1f2937;
}

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--color-page);
  color: var(--color-text);
  font-family: var(--font-sans);
  line-height: 1.75;
}

a {
  color: var(--color-clickable);
}

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

h1, h2, h3, h4, h5, h6 {
  line-height: 1.5;
  font-family: var(--font-serif);
  font-optical-sizing: auto;
  font-style: normal;
  font-weight: 700;
}

h1 {
  margin: 1rem 0 .5rem;
  font-size: 1.875rem;
}

h2 {
  margin: 3rem 0 .5rem;
  font-size: 1.5rem;
}

h3 {
  margin: 1.5rem 0 0;
  font-size: 1.125rem;
}

pre, code {
  font-family: var(--font-mono);
  font-size: .875rem;
}

.sr-only {
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  position: absolute;
  overflow: hidden;
}

p {
  margin: 1rem 0;
}

h1 + *, h2 + *, h3 + *, h4 + *, h5 + *, h6 + * {
  margin-top: 0;
}

ul, ol {
  margin: .5rem 0;
  padding-left: .5rem;
}

ul {
  list-style: inside;
}

ol {
  list-style: inside decimal;
}

li {
  margin: .25rem 0;
  padding-left: .5rem;
}

code:not(.shiki *) {
  background-color: var(--color-surface-secondary);
  border-radius: .375rem;
  padding: .25rem;
}

pre:not(.shiki) {
  background-color: var(--color-surface-secondary);
  border-radius: .375rem;
  margin: .5rem 0;
  padding: 1rem;
  overflow: auto;
}

pre.shiki {
  border: 1px solid var(--color-border);
  border-radius: .375rem;
  margin: .5rem 0;
  padding: 1rem;
}

blockquote {
  border-left: 4px solid var(--color-border);
  margin: 0;
  padding-left: .5rem;
}

hr {
  border-color: var(--color-border);
  margin: 1rem 0;
}

table {
  border-collapse: collapse;
  width: 100%;
  margin: 1rem 0;
}

th, td {
  border: 1px solid var(--color-border);
  padding: .5rem;
}

th {
  background-color: var(--color-surface-secondary);
}

img {
  max-width: 100%;
  height: auto;
  margin: 1rem 0;
}

strong {
  font-weight: 700;
}

em {
  font-style: italic;
}

sup {
  vertical-align: super;
  font-size: .8em;
}

sub {
  vertical-align: sub;
}

.site-header {
  z-index: 40;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  background-color: #fffffff2;
  border-bottom: 1px solid #e5e7ebcc;
  position: sticky;
  top: 0;
}

[data-theme="dark"] .site-header {
  background-color: #111827f2;
  border-bottom-color: #1f2937cc;
}

.header-container {
  justify-content: space-between;
  align-items: center;
  max-width: 80rem;
  height: 4rem;
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
}

@media (min-width: 640px) {
  .header-container {
    padding: 0 1.5rem;
  }
}

@media (min-width: 1024px) {
  .header-container {
    padding: 0 2rem;
  }
}

.header-brand, .header-logo-link {
  color: inherit;
  align-items: center;
  gap: .5rem;
  text-decoration: none;
  display: flex;
}

.header-logo {
  width: 2rem;
  height: 2rem;
  color: var(--color-brand);
}

.header-title {
  letter-spacing: -.025em;
  font-size: 1.125rem;
  font-weight: 700;
}

.header-nav {
  align-items: center;
  gap: 2rem;
  display: none;
}

@media (min-width: 768px) {
  .header-nav {
    display: flex;
  }
}

.header-nav-link {
  color: var(--color-text-subtle);
  font-size: .875rem;
  font-weight: 500;
  text-decoration: none;
  transition: color .2s;
}

.header-nav-link:hover {
  color: var(--color-text);
}

.theme-toggle, .mobile-menu-button {
  color: var(--color-text-muted);
  cursor: pointer;
  background: none;
  border: none;
  border-radius: .375rem;
  padding: .5rem;
  transition: all .2s;
}

:is(.theme-toggle, .mobile-menu-button):hover {
  background-color: var(--color-hover);
  color: var(--color-text);
}

@media (min-width: 768px) {
  .mobile-menu-button {
    display: none;
  }
}

.theme-toggle-icon {
  width: 1.25rem;
  height: 1.25rem;
}

.mobile-menu-icon {
  width: 1.5rem;
  height: 1.5rem;
}

.mobile-menu {
  border-top: 1px solid var(--color-border);
  background-color: var(--color-page);
  display: none;
}

@media (min-width: 768px) {
  .mobile-menu {
    display: none !important;
  }
}

.mobile-menu.show {
  display: block;
}

.mobile-menu-content {
  flex-direction: column;
  gap: .75rem;
  padding: 1rem;
  display: flex;
}

.mobile-nav-link {
  color: var(--color-text-subtle);
  font-size: 1rem;
  font-weight: 500;
  text-decoration: none;
  transition: color .2s;
}

.mobile-nav-link:hover {
  color: var(--color-text);
}

.main-container {
  max-width: 80rem;
  margin: 0 auto;
  padding: 0 1rem;
}

@media (min-width: 640px) {
  .main-container {
    padding: 0 1.5rem;
  }
}

@media (min-width: 1024px) {
  .main-container {
    padding: 0 2rem;
  }
}

.layout-wrapper {
  display: flex;
}

.sidebar {
  flex-shrink: 0;
  width: 16rem;
  display: none;
}

@media (min-width: 1024px) {
  .sidebar {
    display: block;
  }
}

.sidebar-content {
  height: calc(100vh - 4rem);
  padding: 2rem 2rem 2rem 0;
  position: sticky;
  top: 4rem;
  overflow-y: auto;
}

.main-content {
  flex: 1;
  min-width: 0;
}

@media (min-width: 1024px) {
  .main-content {
    padding-left: 2rem;
  }
}

.content-wrapper {
  padding: 2rem 0;
}

.page-header {
  margin-bottom: 2rem;
}

.page-description {
  color: var(--color-text-subtle);
  margin-top: .5rem;
  font-size: 1.25rem;
}

.page-nav {
  border-top: 1px solid var(--color-border);
  margin-top: 4rem;
  padding-top: 2rem;
}

.page-nav-content {
  justify-content: space-between;
  display: flex;
}

.page-nav-item {
  flex: 1;
}

.page-nav-item.page-nav-next {
  text-align: right;
}

.site-footer {
  border-top: 1px solid var(--color-border);
  background-color: var(--color-surface);
  color: var(--color-text-muted);
  text-align: center;
  margin-top: auto;
  padding: 1rem;
  font-size: .875rem;
}

.footer-link {
  color: var(--color-clickable);
  font-weight: 500;
  text-decoration: none;
}

.footer-link:hover {
  color: var(--color-clickable-hover);
}

.docs-nav {
  flex-direction: column;
  gap: 1.5rem;
  display: flex;
}

.docs-nav-section {
  flex-direction: column;
  gap: .5rem;
  display: flex;
}

.docs-nav-title {
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--color-text-muted);
  font-size: .75rem;
  font-weight: 600;
}

.docs-nav-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav-link {
  color: var(--color-text-subtle);
  text-decoration: none;
  transition: all .2s;
  display: block;
}

.nav-link:hover {
  background-color: var(--color-hover);
  color: var(--color-text);
}

.nav-link.active {
  color: var(--color-brand);
  font-weight: 500;
}

[data-theme="dark"] .shiki, [data-theme="dark"] .shiki span {
  background-color: var(--shiki-dark-bg) !important;
  color: var(--shiki-dark) !important;
}
