html,
body {
  max-width: 100%;
  overflow-x: clip;
}

@supports not (overflow: clip) {
  html,
  body {
    overflow-x: hidden;
  }
}

* {
  box-sizing: border-box;
}

.nav {
  background: rgba(8, 8, 15, .82) !important;
  backdrop-filter: blur(20px) saturate(1.8) !important;
  -webkit-backdrop-filter: blur(20px) saturate(1.8) !important;
  border-bottom: 1px solid var(--border);
}

[data-theme="light"] .nav {
  background: rgba(243, 242, 255, .88) !important;
}

.nav__breadcrumb {
  display: flex;
  align-items: center;
  gap: 0;
  list-style: none;
  padding: 0;
  margin: 0;
}

.nav__breadcrumb li {
  display: flex;
  align-items: center;
}

.nav__breadcrumb li + li::before {
  content: '>';
  color: var(--text-muted);
  opacity: .45;
  font-size: .9em;
  padding: 0 .45rem;
  pointer-events: none;
  line-height: 1;
}

.nav__breadcrumb a {
  font-size: .875rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--t);
}

.nav__breadcrumb a:hover,
.nav__breadcrumb [aria-current] {
  color: var(--text);
}

.docs-wrap {
  max-width: 980px;
  margin: 0 auto;
  padding: calc(var(--nav-h) + 5rem) 1.5rem 6rem;
}

.docs-header {
  margin-bottom: 3.5rem;
}

.docs-header__label,
.doc-hero__eyebrow {
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: .75rem;
}

.docs-header__title {
  font-family: var(--font-h);
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 800;
  letter-spacing: -.03em;
  color: var(--text);
  margin: 0 0 .75rem;
}

.docs-header__sub {
  color: var(--text-muted);
  font-size: 1.05rem;
  margin: 0;
}

.docs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

.docs-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 1.75rem;
  text-decoration: none;
  transition: border-color var(--t), transform var(--t), box-shadow var(--t);
}

.docs-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(124, 92, 252, .12);
}

.docs-card__badge {
  display: inline-block;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-dim);
  border-radius: 99px;
  padding: .25rem .7rem;
  margin-bottom: 1rem;
  width: fit-content;
}

.docs-card__title {
  font-family: var(--font-h);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 .5rem;
}

.docs-card__desc {
  color: var(--text-muted);
  font-size: .9rem;
  line-height: 1.6;
  margin: 0 0 1.5rem;
  flex: 1;
}

.docs-card__cta {
  font-size: .875rem;
  font-weight: 600;
  color: var(--accent);
}

.doc-wrap {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 4rem;
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
  padding: calc(var(--nav-h) + 2.5rem) 1.5rem 8rem;
  align-items: start;
}

.doc-content {
  min-width: 0;
}

.doc-toc {
  position: -webkit-sticky;
  position: sticky;
  top: calc(var(--nav-h) + 2rem);
  padding: 1rem 0;
  align-self: start;
  max-height: calc(100vh - var(--nav-h) - 3rem);
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
}

.doc-toc__label {
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: .85rem;
}

.doc-toc__list {
  display: grid;
  gap: .35rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.doc-toc__list a {
  display: block;
  color: var(--text-muted);
  text-decoration: none;
  font-size: .84rem;
  line-height: 1.45;
  padding: .32rem 0 .32rem .75rem;
  border-left: 1px solid transparent;
  transition: color var(--t), border-color var(--t), transform var(--t);
}

.doc-toc__list a:hover,
.doc-toc__list a.is-active {
  color: var(--accent);
  border-left-color: var(--accent);
  transform: translateX(2px);
}

.doc-hero {
  padding: 0 0 3rem;
  margin-bottom: 3rem;
  border-bottom: 1px solid var(--border);
}

.doc-hero__title {
  font-family: var(--font-h);
  font-size: clamp(2.4rem, 6vw, 4rem);
  line-height: .95;
  letter-spacing: -.04em;
  margin: 0 0 .8rem;
  color: var(--text);
}

.doc-hero__tagline {
  font-size: 1.08rem;
  font-weight: 700;
  color: var(--accent);
  margin: 0 0 .85rem;
}

.doc-hero__sub {
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.8;
  max-width: 68ch;
  margin: 0 0 1.5rem;
}

.doc-hero__badges {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-bottom: 1.25rem;
}

.doc-hero__cta,
.doc-footer__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.25rem;
  border-radius: 99px;
  border: 1px solid var(--accent);
  color: var(--accent);
  padding: .45rem 1rem;
  text-decoration: none;
  font-size: .82rem;
  font-weight: 700;
  transition: background var(--t), color var(--t), opacity var(--t);
}

.doc-hero__cta:hover,
.doc-footer__cta:hover {
  background: var(--accent);
  color: #fff;
}

.doc-section {
  margin-bottom: 4rem;
  scroll-margin-top: calc(var(--nav-h) + 1.25rem);
}

.doc-section__heading {
  font-family: var(--font-h);
  font-size: 1.45rem;
  margin: 0 0 .9rem;
  color: var(--text);
  letter-spacing: -.02em;
}

.doc-section__heading::before {
  content: '#';
  color: var(--accent);
  margin-right: .45rem;
  opacity: .7;
}

.doc-section__sub {
  font-size: 1rem;
  color: var(--text);
  margin: 1.6rem 0 .7rem;
}

.doc-section p,
.doc-faq__item p {
  color: var(--text-muted);
  line-height: 1.75;
  font-size: .94rem;
}

.doc-section code:not(.doc-code) {
  color: var(--accent);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: .12rem .35rem;
  font-family: var(--font-mono);
  font-size: .86em;
}

.doc-pre {
  position: relative;
  margin: 1rem 0 1.75rem;
}

.doc-pre__label {
  position: absolute;
  top: .75rem;
  right: .85rem;
  z-index: 1;
  font-family: var(--font-mono);
  color: var(--text-muted);
  font-size: .62rem;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.doc-code {
  display: block;
  width: 100%;
  overflow-x: auto;
  white-space: pre;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 1.25rem;
  font-family: var(--font-mono);
  color: var(--text);
  font-size: .82rem;
  line-height: 1.75;
  tab-size: 2;
}

.doc-code .cm { color: var(--text-muted); opacity: .75; }
.doc-code .ck { color: #c4a7ff; }
.doc-code .cs { color: #7fd88a; }
.doc-code .cat { color: #f0b060; }
.doc-code .cac { color: var(--accent); }

.doc-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: .75rem 0 2rem;
}

.doc-table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
  font-size: .86rem;
}

.doc-table th {
  text-align: left;
  font-size: .68rem;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: var(--surface-2);
  padding: .7rem .9rem;
}

.doc-table td {
  padding: .7rem .9rem;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  vertical-align: top;
}

.doc-table td:first-child,
.doc-table td:nth-child(2) {
  color: var(--text);
  font-family: var(--font-mono);
  white-space: nowrap;
}

.doc-browsers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: .75rem;
  margin: .75rem 0 1.5rem;
}

.doc-browser,
.doc-faq__item {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--r);
}

.doc-browser {
  padding: .9rem;
}

.doc-browser__name {
  color: var(--text);
  font-weight: 700;
  font-size: .86rem;
}

.doc-browser__ver {
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: .78rem;
  margin-top: .25rem;
}

.doc-log {
  position: relative;
  border-left: 1px solid var(--border);
  padding-left: 1.4rem;
  margin-top: 1rem;
}

.doc-log::before {
  content: '';
  position: absolute;
  left: -5px;
  top: .2rem;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
}

.doc-log__ver {
  color: var(--text);
  font-family: var(--font-mono);
  font-weight: 700;
}

.doc-log__date {
  color: var(--text-muted);
  font-size: .8rem;
  margin: .15rem 0 .75rem;
}

.doc-log ul {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--text-muted);
  line-height: 1.7;
  font-size: .9rem;
}

.doc-faq {
  display: grid;
  gap: .75rem;
}

.doc-faq__item {
  padding: .75rem 1rem;
}

.doc-faq__item summary {
  cursor: pointer;
  color: var(--text);
  font-weight: 700;
  list-style: none;
}

.doc-faq__item summary::-webkit-details-marker {
  display: none;
}

.doc-faq__item summary::marker {
  content: '';
}

.doc-faq__item summary::before {
  content: '+ ';
  color: var(--accent);
}

.doc-faq__item[open] summary::before {
  content: '- ';
}

.doc-video {
  margin: 1rem 0 2rem;
}

.doc-video__frame {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: #050509;
  aspect-ratio: 16 / 9;
}

.doc-video__frame video,
.doc-video__frame iframe {
  width: 100%;
  height: 100%;
  display: block;
  border: 0;
}

.doc-video__frame video {
  object-fit: cover;
}

.doc-video__caption {
  color: var(--text-muted);
  font-size: .82rem;
  line-height: 1.6;
  margin: .55rem 0 0;
}

.doc-footer,
.docs-footer {
  max-width: 1080px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.doc-footer a,
.docs-footer a {
  font-size: .875rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--t);
}

.doc-footer a:hover,
.docs-footer a:hover {
  color: var(--accent);
}

.doc-footer a.doc-footer__cta:hover {
  color: #fff;
}

@media (max-width: 900px) {
  .doc-wrap {
    grid-template-columns: 1fr;
    gap: 0;
    padding-top: calc(var(--nav-h) + 2rem);
  }

  .doc-toc {
    display: none;
  }
}

@media (max-width: 680px) {
  .docs-wrap {
    padding: calc(var(--nav-h) + 2rem) 1rem 4rem;
  }

  .doc-wrap {
    padding: calc(var(--nav-h) + 1.25rem) 1rem 4rem;
  }

  .doc-hero {
    padding-bottom: 2rem;
    margin-bottom: 2rem;
  }

  .doc-hero__title {
    font-size: clamp(1.9rem, 8vw, 2.6rem);
  }

  .doc-hero__sub,
  .doc-section p,
  .doc-faq__item p {
    font-size: .88rem;
  }

  .doc-section {
    margin-bottom: 3rem;
  }

  .doc-section__heading {
    font-size: 1.15rem;
  }

  .doc-code {
    font-size: .74rem;
    padding: 1rem;
  }

  .doc-table-wrap {
    margin-left: -1rem;
    margin-right: -1rem;
    padding: 0 1rem;
  }

  .doc-table {
    font-size: .78rem;
  }

  .doc-footer,
  .docs-footer {
    text-align: center;
    flex-direction: column;
    align-items: center;
  }
}
