:root {
  --bg: var(--layer-0);
  --bg-strong: var(--layer-1);
  --panel: color-mix(in srgb, var(--layer-1) 88%, transparent);
  --panel-strong: color-mix(in srgb, var(--layer-2) 92%, transparent);
  --line: hsla(var(--on-layer-tuple), 0.14);
  --line-strong: hsla(var(--on-layer-tuple), 0.2);
  --ink: var(--on-layer);
  --muted: var(--on-layer-600);
  --soft: var(--on-layer-400);
  --accent: var(--purple);
  --accent-2: var(--blue);
  --accent-soft: var(--purple-200);
  --accent-strong: var(--orangeSecondary);
  --success-soft: var(--green-200);
  --warn-soft: var(--yellow-100);
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.38);
  --radius: 22px;
  --radius-sm: 14px;
  --content-width: 860px;
  --topbar-height: 78px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, color-mix(in srgb, var(--purple) 18%, transparent), transparent 26%),
    radial-gradient(circle at top right, color-mix(in srgb, var(--blue) 16%, transparent), transparent 28%),
    radial-gradient(circle at 50% 0%, color-mix(in srgb, var(--orange) 9%, transparent), transparent 35%),
    linear-gradient(180deg, var(--layer-0) 0%, color-mix(in srgb, var(--layer-0) 88%, black) 100%);
  font-family: var(--font-interface-theme, "Fira Sans", sans-serif);
  font-size: 16px;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

code,
pre,
kbd {
  font-family: var(--font-monospace-theme, "Fira Code", monospace);
  font-variant-ligatures: none;
  font-feature-settings: "calt" 0, "liga" 0, "dlig" 0;
}

.site-shell {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: grid;
  grid-template-columns: auto minmax(240px, 1fr) auto;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.4rem;
  backdrop-filter: blur(18px);
  background: color-mix(in srgb, var(--layer-0) 84%, transparent);
  border-bottom: 1px solid var(--line);
}

.brand-block,
.brand {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 0.8rem;
  color: white;
  font-family: var(--font-text-theme, "Fira Sans", sans-serif);
  font-size: 1.1rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--purple), var(--blue));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.brand-copy strong,
.eyebrow,
.toc-heading,
.sidebar-group-title {
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.brand-copy strong {
  display: block;
  font-size: 0.95rem;
}

.brand-copy small {
  display: block;
  color: var(--muted);
  font-size: 0.74rem;
}

.search-shell {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.8rem 0.95rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--layer-2) 92%, transparent);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.search-shell svg {
  width: 1.1rem;
  height: 1.1rem;
  fill: var(--muted);
}

.search-shell input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
}

.search-shell kbd {
  padding: 0.2rem 0.45rem;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 0.5rem;
  color: var(--muted);
  font-size: 0.8rem;
  background: color-mix(in srgb, var(--layer-3) 92%, transparent);
}

.topbar-link,
.button,
.sidebar-link,
.toc-link,
.search-result {
  transition: transform 140ms ease, background-color 140ms ease, color 140ms ease, border-color 140ms ease;
}

.topbar-link {
  padding: 0.8rem 1rem;
  border-radius: 999px;
  color: var(--muted);
}

.topbar-link:hover,
.sidebar-link:hover,
.toc-link:hover,
.button:hover,
.search-result:hover {
  transform: translateY(-1px);
}

.content-shell {
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr) 250px;
  gap: 1.4rem;
  padding: 1.4rem;
}

.sidebar,
.toc-card,
.hero-panel,
.doc-article,
.search-results {
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.sidebar,
.toc-card {
  position: sticky;
  top: 5.7rem;
  align-self: start;
  border-radius: var(--radius);
}

.sidebar-scroll {
  max-height: calc(100vh - 7rem);
  overflow: auto;
  padding: 1rem;
}

.sidebar-intro {
  padding: 1rem;
  border-radius: 1rem;
  background: linear-gradient(180deg, color-mix(in srgb, var(--purple) 16%, transparent), color-mix(in srgb, var(--blue) 10%, transparent));
  margin-bottom: 1rem;
}

.sidebar-intro p {
  margin: 0 0 0.8rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.32rem 0.65rem;
  border-radius: 999px;
  color: var(--accent);
  background: var(--accent-soft);
  font-size: 0.8rem;
  font-weight: 600;
}

.sidebar-group {
  margin-top: 1.2rem;
}

.sidebar-group-title {
  margin: 0 0 0.65rem;
  color: color-mix(in srgb, var(--blue) 72%, white);
  font-size: 0.76rem;
  font-weight: 700;
  text-shadow: 0 0 18px color-mix(in srgb, var(--blue) 18%, transparent);
}

.sidebar-list {
  display: grid;
  gap: 0.3rem;
}

.sidebar-link {
  display: block;
  padding: 0.72rem 0.85rem;
  border-radius: 0.95rem;
  color: var(--muted);
}

.sidebar-link.active {
  color: var(--ink);
  background: color-mix(in srgb, var(--layer-2) 94%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--purple) 20%, transparent);
}

.main-panel {
  min-width: 0;
}

.article-wrap {
  max-width: calc(var(--content-width) + 2rem);
  margin: 0 auto;
}

.article-header {
  margin-bottom: 1rem;
}

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.85rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.breadcrumbs span:last-child {
  color: var(--ink);
}

.hero-panel {
  display: flex;
  justify-content: space-between;
  gap: 1.25rem;
  padding: 1.5rem;
  border-radius: 1.6rem;
  background:
    radial-gradient(circle at right top, color-mix(in srgb, var(--orange) 18%, transparent), transparent 32%),
    radial-gradient(circle at left bottom, color-mix(in srgb, var(--purple) 14%, transparent), transparent 34%),
    linear-gradient(135deg, color-mix(in srgb, var(--layer-1) 96%, transparent), color-mix(in srgb, var(--layer-2) 94%, transparent));
}

.eyebrow {
  margin: 0 0 0.5rem;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
}

#page-title,
.doc-article h1,
.doc-article h2,
.doc-article h3 {
  font-family: var(--font-text-theme, "Fira Sans", sans-serif);
  letter-spacing: -0.03em;
}

#page-title {
  margin: 0;
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  line-height: 0.98;
}

.page-description {
  max-width: 52rem;
  margin: 0.8rem 0 0;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.75;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: start;
  gap: 0.7rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.88rem 1rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-weight: 600;
}

.button.primary {
  color: white;
  background: linear-gradient(135deg, var(--purple), var(--blue));
  border-color: transparent;
}

.button.subtle {
  background: color-mix(in srgb, var(--layer-2) 94%, transparent);
}

.doc-article,
.search-results {
  padding: 1.9rem;
  border-radius: 1.5rem;
  background: color-mix(in srgb, var(--layer-1) 90%, transparent);
}

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

.doc-article h1 {
  margin-top: 0;
  font-size: 2.35rem;
}

.doc-article h2 {
  margin-top: 2.4rem;
  margin-bottom: 0.8rem;
  font-size: 1.65rem;
  scroll-margin-top: 6.5rem;
}

.doc-article h3 {
  margin-top: 1.6rem;
  margin-bottom: 0.65rem;
  font-size: 1.24rem;
  scroll-margin-top: 6.5rem;
}

.doc-article p,
.doc-article li,
.doc-article td,
.doc-article th {
  line-height: 1.78;
  font-size: 1rem;
}

.doc-article p,
.doc-article ul,
.doc-article ol,
.doc-article table,
.doc-article pre,
.doc-article blockquote {
  margin: 0 0 1rem;
}

.doc-article ul,
.doc-article ol {
  padding-left: 1.2rem;
}

.doc-article li + li {
  margin-top: 0.35rem;
}

.doc-article a {
  color: var(--accent);
}

.doc-article code:not(pre code) {
  padding: 0.16rem 0.42rem;
  border-radius: 0.4rem;
  background: color-mix(in srgb, var(--purple) 14%, transparent);
  color: color-mix(in srgb, var(--purple) 72%, white);
}

.doc-article pre {
  position: relative;
  overflow: auto;
  padding: 1rem;
  border-radius: 1rem;
  border: 1px solid color-mix(in srgb, var(--blue) 22%, transparent);
  background:
    radial-gradient(circle at top right, color-mix(in srgb, var(--blue) 18%, transparent), transparent 30%),
    linear-gradient(180deg, color-mix(in srgb, var(--layer-0) 92%, black), color-mix(in srgb, var(--layer-1) 82%, black));
  color: color-mix(in srgb, var(--on-layer) 92%, white);
}

.doc-article pre code {
  display: block;
  white-space: pre;
  font-size: 0.96rem;
  line-height: 1.7;
}

.doc-article pre code.is-highlighted {
  color: var(--ink);
}

.doc-article pre .tok-keyword {
  color: var(--blue);
  font-weight: 650;
}

.doc-article pre .tok-type {
  color: color-mix(in srgb, var(--blue) 72%, white);
}

.doc-article pre .tok-type-name {
  color: var(--purple);
}

.doc-article pre .tok-func {
  color: var(--orangeSecondary);
}

.doc-article pre .tok-member {
  color: color-mix(in srgb, var(--green) 78%, white);
}

.doc-article pre .tok-string {
  color: color-mix(in srgb, var(--green) 74%, white);
}

.doc-article pre .tok-number {
  color: color-mix(in srgb, var(--orange) 82%, white);
}

.doc-article pre .tok-comment {
  color: var(--on-layer-400);
  font-style: italic;
}

.doc-article pre .tok-operator {
  color: color-mix(in srgb, var(--on-layer) 78%, white);
}

.copy-button {
  position: absolute;
  top: 0.8rem;
  right: 0.8rem;
  padding: 0.38rem 0.6rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  color: white;
  background: color-mix(in srgb, var(--purple) 28%, transparent);
  cursor: pointer;
}

.doc-article table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  border-radius: 1rem;
  border: 1px solid var(--line);
}

.doc-article th,
.doc-article td {
  padding: 0.8rem 0.9rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}

.doc-article th {
  background: color-mix(in srgb, var(--blue) 10%, transparent);
}

.doc-article blockquote {
  margin-left: 0;
  padding: 0.9rem 1rem;
  border-left: 4px solid var(--accent-strong);
  color: var(--muted);
  background: color-mix(in srgb, var(--orange) 10%, transparent);
}

.doc-article hr {
  margin: 2rem 0;
  border: 0;
  border-top: 1px solid var(--line);
}

.callout-grid,
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin: 1.2rem 0 1.5rem;
}

.mini-card,
.callout {
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: color-mix(in srgb, var(--layer-2) 90%, transparent);
}

.mini-card h3,
.callout h3 {
  margin-top: 0;
}

.toc-card {
  padding: 1rem;
}

.toc-heading {
  margin: 0 0 0.75rem;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
}

.toc-link {
  display: block;
  padding: 0.42rem 0.55rem;
  border-radius: 0.75rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.toc-link.depth-3 {
  margin-left: 0.8rem;
  font-size: 0.87rem;
}

.toc-link.active {
  color: var(--ink);
  background: color-mix(in srgb, var(--purple) 10%, transparent);
}

.article-footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1rem;
}

.footer-card {
  flex: 1;
  padding: 1rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: color-mix(in srgb, var(--layer-1) 88%, transparent);
}

.footer-card small {
  display: block;
  color: var(--muted);
  margin-bottom: 0.3rem;
}

.search-results {
  margin-bottom: 1rem;
}

.hidden {
  display: none;
}

.search-result {
  display: block;
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--line);
}

.search-result:last-child {
  border-bottom: 0;
}

.search-result strong {
  display: block;
  margin-bottom: 0.2rem;
}

.search-result span {
  display: block;
  color: var(--muted);
  font-size: 0.92rem;
}

.search-empty {
  color: var(--muted);
}

.icon-button {
  display: inline-flex;
  flex-direction: column;
  gap: 0.22rem;
  width: 2.4rem;
  height: 2.4rem;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 0.85rem;
  background: color-mix(in srgb, var(--layer-2) 90%, transparent);
}

.icon-button span {
  width: 1rem;
  height: 2px;
  background: var(--ink);
}

.mobile-only {
  display: none;
}

@media (max-width: 1180px) {
  .content-shell {
    grid-template-columns: 270px minmax(0, 1fr);
  }

  .toc-panel {
    display: none;
  }
}

@media (max-width: 900px) {
  .topbar {
    grid-template-columns: auto 1fr;
  }

  .topbar-link {
    display: none;
  }

  .content-shell {
    grid-template-columns: 1fr;
  }

  .mobile-only {
    display: inline-flex;
  }

  .sidebar {
    position: fixed;
    left: 1rem;
    top: 5.2rem;
    bottom: 1rem;
    width: min(320px, calc(100vw - 2rem));
    transform: translateX(-120%);
    transition: transform 180ms ease;
    z-index: 50;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-scroll {
    max-height: 100%;
  }

  .hero-panel {
    flex-direction: column;
  }
}

@media (max-width: 640px) {
  .topbar,
  .content-shell {
    padding: 1rem;
  }

  .doc-article,
  .search-results,
  .hero-panel {
    padding: 1.2rem;
  }

  #page-title {
    font-size: 2.2rem;
  }
}
