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

body[data-theme="dark"] {
  background:
    radial-gradient(circle at 50% -8%, rgba(168, 85, 247, 0.26), transparent 32%),
    radial-gradient(circle at 88% 18%, rgba(216, 180, 254, 0.1), transparent 28%),
    linear-gradient(180deg, #090312 0%, #130720 52%, #0a0413 100%);
}

.sidebar-layout {
  width: min(100% - 48px, 1240px);
  max-width: none;
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 28px;
  align-items: start;
  margin: 0 auto;
  padding-top: 112px;
  padding-bottom: 64px;
}

.sidebar,
.docs-hero,
[data-docs-card],
.docs-loading {
  border: 1px solid rgba(216, 180, 254, 0.16);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(216, 180, 254, 0.045), transparent 180px),
    rgba(23, 11, 38, 0.82);
  box-shadow: 0 18px 54px rgba(4, 0, 10, 0.36);
}

.sidebar {
  position: sticky;
  top: 94px;
  max-height: calc(100dvh - 120px);
  display: grid;
  gap: 5px;
  padding: 12px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(216, 180, 254, 0.34) transparent;
  --indicator-y: 12px;
  --indicator-height: 38px;
  --indicator-opacity: 0;
  --sidebar-shift: 0px;
  transform: translateY(var(--sidebar-shift));
}

@supports (backdrop-filter: blur(14px)) {
  .sidebar {
    backdrop-filter: blur(18px) saturate(1.12);
    background: rgba(23, 11, 38, 0.72);
  }
}

.sidebar::-webkit-scrollbar {
  width: 8px;
}

.sidebar::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 999px;
  background: rgba(216, 180, 254, 0.34);
  background-clip: padding-box;
}

.sidebar::before {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  top: 0;
  height: var(--indicator-height);
  border: 1px solid rgba(216, 180, 254, 0.18);
  border-radius: 8px;
  opacity: var(--indicator-opacity);
  pointer-events: none;
  transform: translateY(var(--indicator-y));
  transition: transform 220ms ease, height 220ms ease, opacity 160ms ease;
  background: rgba(168, 85, 247, 0.16);
}

.sidebar-heading,
.eyebrow,
.tabs,
.code-block::before,
.docs-mini-terminal,
.copy-btn {
  font-family: var(--font-mono);
}

.sidebar-heading {
  position: relative;
  z-index: 1;
  margin: 14px 0 2px;
  padding: 8px 10px 2px;
  color: rgba(216, 180, 254, 0.62);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sidebar-heading:first-of-type {
  margin-top: 2px;
}

.sidebar a {
  position: relative;
  z-index: 1;
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: #b7a3cf;
  font-family: "Geist", "Manrope", system-ui, sans-serif;
  font-size: 14px;
  font-weight: 700;
  transition: color 160ms ease, background 160ms ease, border-color 160ms ease;
}

.sidebar a i {
  color: #d8b4fe;
  font-size: 16px;
  flex: 0 0 auto;
}

.sidebar a span {
  min-width: 0;
}

.sidebar a em {
  margin-left: auto;
  font-style: normal;
  color: #fb7185;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.sidebar a .sidebar-badge-new {
  color: #dcfce7;
  background: rgba(34, 197, 94, 0.16);
  border: 1px solid rgba(34, 197, 94, 0.34);
  border-radius: 999px;
  padding: 3px 7px;
}

.sidebar a:hover,
.sidebar a.active {
  color: #fbf7ff;
  border-color: rgba(216, 180, 254, 0.16);
  background: rgba(216, 180, 254, 0.07);
}

.docs-body {
  display: grid;
  gap: 18px;
}


.docs-body > .panel {
  scroll-margin-top: 112px;
}

.docs-hero {
  position: relative;
  min-height: 360px;
  display: grid;
  align-content: end;
  padding: 34px;
  overflow: hidden;
}

.docs-hero::before {
  content: "docs";
  position: absolute;
  right: 24px;
  top: 20px;
  color: rgba(216, 180, 254, 0.07);
  font-family: var(--font-display);
  font-size: clamp(82px, 14vw, 180px);
  line-height: 0.8;
  pointer-events: none;
}

.docs-hero-scene {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.docs-hero-scene span {
  position: absolute;
  left: 34px;
  right: 34px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(216, 180, 254, 0.42), transparent);
}

.docs-hero-scene span:nth-child(1) { top: 30%; }
.docs-hero-scene span:nth-child(2) { top: 55%; opacity: 0.45; }
.docs-hero-scene span:nth-child(3) { display: none; }
.docs-hero-scene i,
.docs-hero-scene b { display: none; }

.eyebrow {
  position: relative;
  z-index: 1;
  margin: 0 0 12px;
  color: #d8b4fe;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.docs-hero-meta {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  min-height: 34px;
  margin-bottom: 14px;
  padding: 0 12px;
  border: 1px solid rgba(216, 180, 254, 0.16);
  border-radius: 999px;
  color: #b7a3cf;
  background: rgba(216, 180, 254, 0.07);
  font-family: "Geist", "Manrope", system-ui, sans-serif;
  font-size: 13px;
  font-weight: 700;
}

.docs-hero-meta i {
  color: #d8b4fe;
  font-size: 16px;
}

.docs-hero h1 {
  position: relative;
  z-index: 1;
  max-width: 760px;
  margin: 0;
  color: #fbf7ff;
  font-family: var(--font-display);
  font-size: clamp(48px, 8vw, 96px);
  font-weight: 400;
  line-height: 0.92;
  letter-spacing: 0;
}

.sub,
.docs-points,
.docs-callout,
.docs-source,
.docs-steps {
  color: #b7a3cf;
  font-family: "Geist", "Manrope", system-ui, sans-serif;
}

.docs-hero .sub {
  position: relative;
  z-index: 1;
  max-width: 720px;
  margin: 18px 0 0;
  font-size: 18px;
  line-height: 1.7;
}

.docs-hero-pills {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid rgba(216, 180, 254, 0.16);
  border-radius: 999px;
  color: #b7a3cf;
  background: rgba(216, 180, 254, 0.07);
  font-size: 12px;
  font-weight: 800;
}

.tag.live {
  color: #fbf7ff;
  border-color: rgba(216, 180, 254, 0.28);
  background: rgba(168, 85, 247, 0.22);
}

.docs-mini-terminal {
  position: relative;
  z-index: 1;
  width: min(100%, 460px);
  margin-top: 22px;
  padding: 14px;
  border: 1px solid rgba(216, 180, 254, 0.16);
  border-radius: 8px;
  background: #0d0617;
  color: #b7a3cf;
  font-size: 13px;
}

.docs-mini-terminal div {
  line-height: 1.8;
}

.docs-mini-terminal span {
  color: #d8b4fe;
}

[data-docs-card] {
  position: relative;
  padding: 30px;
  overflow: hidden;
  font-family: "Geist", "Manrope", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.72;
}

[data-docs-card]::before {
  content: "";
  position: absolute;
  left: 24px;
  right: 24px;
  top: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(216, 180, 254, 0.48), transparent);
}

[data-docs-card] h2 {
  max-width: 880px;
  margin: 0;
  color: #fbf7ff;
  font-family: "Geist", "Sora", system-ui, sans-serif;
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 800;
  line-height: 1.04;
  letter-spacing: -0.02em;
}

.docs-section-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: start;
  margin-bottom: 12px;
}

.docs-section-head .docs-status + .docs-status {
  margin-left: 8px;
}

.docs-section-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.docs-section-title i {
  color: #d8b4fe;
  font-size: 20px;
}

.docs-status {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.docs-status-unstable {
  border: 1px solid rgba(251, 113, 133, 0.28);
  color: #fecdd3;
  background: rgba(251, 113, 133, 0.12);
}

.docs-status-new {
  border: 1px solid rgba(34, 197, 94, 0.32);
  color: #dcfce7;
  background: rgba(34, 197, 94, 0.16);
}

[data-docs-card] .sub {
  max-width: 78ch;
  margin: 0 0 18px;
  line-height: 1.72;
}

.docs-points {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 10px;
  margin: 18px 0;
  padding: 0;
  list-style: none;
}

.docs-points li,
.docs-callout,
.docs-source {
  border: 1px solid rgba(216, 180, 254, 0.12);
  border-radius: 8px;
  background: rgba(216, 180, 254, 0.055);
}

.docs-points li {
  padding: 12px 14px;
}

.docs-callout,
.docs-source {
  margin: 16px 0;
  padding: 14px 16px;
}

.docs-callout.warning {
  border-color: rgba(251, 113, 133, 0.3);
  background: rgba(251, 113, 133, 0.08);
}

.tabs {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 6px 0 14px;
  padding: 5px;
  border: 1px solid rgba(216, 180, 254, 0.14);
  border-radius: 999px;
  background: rgba(9, 3, 18, 0.46);
}

.tab {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: #b7a3cf;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
}

.tab:hover,
.tab.active {
  color: #fbf7ff;
  border-color: rgba(216, 180, 254, 0.18);
  background: rgba(168, 85, 247, 0.2);
}

.tab-pane { display: none; }
.tab-pane.active { display: block; }

.code-block {
  position: relative;
  margin-top: 14px;
  padding: 42px 16px 16px;
  border: 1px solid rgba(216, 180, 254, 0.14);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(216, 180, 254, 0.06), transparent 42px),
    #0d0617;
  box-shadow: none !important;
  overflow-x: auto;
}

.code-block::before {
  content: attr(data-lang);
  position: absolute;
  top: 12px;
  left: 16px;
  color: #d8b4fe;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.code-block pre {
  min-width: max-content;
  margin: 0;
  color: #f5edff;
  font-family: var(--font-mono);
  line-height: 1.8;
}

.copy-btn {
  position: absolute;
  top: 9px;
  right: 10px;
  z-index: 2;
  padding: 6px 10px;
  border: 1px solid rgba(216, 180, 254, 0.16);
  border-radius: 999px;
  background: rgba(23, 11, 38, 0.96);
  color: #d8b4fe;
  cursor: pointer;
  font-size: 12px;
}

.docs-steps {
  display: grid;
  gap: 10px;
  margin: 16px 0 0;
  padding-left: 22px;
}

.docs-steps li::marker {
  color: #d8b4fe;
  font-weight: 800;
}

@media (max-width: 1020px) {
  .sidebar-layout {
    width: min(100% - 32px, 1240px);
    grid-template-columns: 1fr;
    padding-top: 34px;
    padding-bottom: 112px;
  }

  .sidebar {
    position: sticky;
    top: 12px;
    z-index: 20;
    max-height: none;
    display: flex;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
  }

  .sidebar::before,
  .sidebar-heading {
    display: none;
  }

  .sidebar a {
    flex: 0 0 auto;
    white-space: nowrap;
  }
}

@media (max-width: 640px) {
  .docs-hero,
  [data-docs-card] {
    padding: 22px;
  }

  .docs-hero {
    min-height: 340px;
  }

  .docs-hero h1 {
    font-size: 46px;
  }

  [data-docs-card] h2 {
    font-size: 28px;
  }

  .docs-section-head {
    display: grid;
  }

  .docs-points {
    grid-template-columns: 1fr;
  }
}

/* =============================================
   Docs redesign
   ============================================= */

/* Hero: dot-grid overlay + gradient title */
.docs-hero {
  background:
    radial-gradient(circle at 18% 82%, rgba(168, 85, 247, 0.22), transparent 48%),
    radial-gradient(circle at 88% 14%, rgba(216, 180, 254, 0.1), transparent 38%),
    linear-gradient(180deg, rgba(216, 180, 254, 0.05), transparent 200px),
    rgba(19, 9, 33, 0.88);
  border-color: rgba(216, 180, 254, 0.22);
}

.docs-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(216, 180, 254, 0.14) 1px, transparent 1px);
  background-size: 26px 26px;
  pointer-events: none;
  mask-image: radial-gradient(ellipse 70% 60% at 70% 20%, black 10%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 70% 20%, black 10%, transparent 75%);
  border-radius: inherit;
}

.docs-hero h1 {
  background: linear-gradient(130deg, #fbf7ff 0%, #d8b4fe 55%, #a855f7 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: transparent;
}

.docs-hero .sub {
  color: rgba(216, 180, 254, 0.7);
}

/* Mini terminal chrome dots */
.docs-mini-terminal::before {
  content: "";
  display: block;
  width: 44px;
  height: 10px;
  background:
    radial-gradient(circle at 5px 5px, #fb7185 5px, transparent 5px),
    radial-gradient(circle at 20px 5px, #fbbf24 5px, transparent 5px),
    radial-gradient(circle at 35px 5px, #4ade80 5px, transparent 5px);
  margin-bottom: 10px;
  opacity: 0.7;
}

/* Sidebar improvements */
.sidebar {
  background:
    linear-gradient(180deg, rgba(216, 180, 254, 0.04), transparent 220px),
    rgba(19, 9, 33, 0.9) !important;
  border-color: rgba(216, 180, 254, 0.2) !important;
}

.sidebar-heading {
  color: rgba(216, 180, 254, 0.55);
  font-size: 10px;
  letter-spacing: 0.12em;
  border-bottom: 1px solid rgba(216, 180, 254, 0.08);
  padding-bottom: 8px;
  margin-bottom: 2px;
}

.sidebar a {
  font-size: 13.5px;
  transition:
    color 130ms ease,
    background 130ms ease,
    border-color 130ms ease,
    transform 160ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.sidebar a:hover {
  transform: translateX(3px);
}

/* Docs cards: radial hover glow using mouse position from docs.js */
[data-docs-card] {
  --mx: 50%;
  --my: 35%;
  border-color: rgba(216, 180, 254, 0.16);
  background:
    linear-gradient(180deg, rgba(216, 180, 254, 0.04), transparent 160px),
    rgba(19, 9, 33, 0.84);
  transition: border-color 240ms ease, box-shadow 240ms ease;
}

[data-docs-card]:hover {
  border-color: rgba(216, 180, 254, 0.3);
  box-shadow: 0 28px 72px rgba(4, 0, 10, 0.48), 0 0 0 1px rgba(168, 85, 247, 0.1);
}

[data-docs-card]::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(560px circle at var(--mx) var(--my), rgba(168, 85, 247, 0.09), transparent 52%);
  pointer-events: none;
  border-radius: inherit;
  opacity: 0;
  transition: opacity 300ms ease;
}

[data-docs-card]:hover::after {
  opacity: 1;
}

/* Section icon: pill-style chip */
.docs-section-title i {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: rgba(168, 85, 247, 0.12);
  border: 1px solid rgba(216, 180, 254, 0.18);
  font-size: 17px;
  flex-shrink: 0;
  color: #d8b4fe;
}

/* Callout: left-border accent style */
.docs-callout {
  border-left: 3px solid rgba(168, 85, 247, 0.5) !important;
  border-top: none !important;
  border-right: none !important;
  border-bottom: none !important;
  border-radius: 0 8px 8px 0 !important;
  background: rgba(168, 85, 247, 0.07) !important;
  padding-left: 20px;
}

.docs-callout.warning {
  border-left-color: rgba(251, 113, 133, 0.6) !important;
  background: rgba(251, 113, 133, 0.07) !important;
}

/* Code block: stronger header bar */
.code-block {
  border-color: rgba(216, 180, 254, 0.16);
  background:
    linear-gradient(180deg, rgba(216, 180, 254, 0.055), transparent 48px),
    #0b0518;
}

/* Better loading placeholder */
.docs-loading {
  min-height: 420px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(216, 180, 254, 0.4);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* Mobile sidebar: pill tabs */
@media (max-width: 1020px) {
  .sidebar {
    padding: 8px;
    gap: 4px;
    border-radius: 18px !important;
    background: rgba(19, 9, 33, 0.94) !important;
    backdrop-filter: blur(22px) saturate(1.2) !important;
    -webkit-backdrop-filter: blur(22px) saturate(1.2) !important;
    border-color: rgba(216, 180, 254, 0.18) !important;
  }

  .sidebar a {
    border-radius: 999px !important;
    min-height: 34px !important;
    font-size: 12.5px !important;
    padding: 6px 14px !important;
    transform: none !important;
  }
}
