:root {
  --bg: #07060b;
  --bg-subtle: #0c0a14;
  --bg-elevated: #110e1c;
  --bg-card: #151225;
  --bg-code: #0b0913;
  --border: #262040;
  --border-strong: #392f61;
  --text: #f4f2ff;
  --text-secondary: #cbc5e6;
  --text-muted: #9b93bd;
  --accent: #8b5cf6;
  --accent-bright: #a78bfa;
  --accent-soft: rgba(139, 92, 246, 0.14);
  --accent-glow: rgba(139, 92, 246, 0.28);
  --accent-deep: #6d28d9;
  --success: #34d399;
  --warning: #fbbf24;
  --danger: #f87171;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.45);
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  --header-h: 64px;
  --max-w: 1200px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  color-scheme: dark;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(900px 520px at 15% -10%, rgba(124, 58, 237, 0.18), transparent 65%),
    radial-gradient(760px 460px at 88% 4%, rgba(91, 33, 182, 0.15), transparent 60%),
    var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent-bright);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
  color: #ddd6fe;
}

:focus-visible {
  outline: 2px solid var(--accent-bright);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent-deep);
  color: #ffffff;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  z-index: 1000;
  font-weight: 600;
}

.skip-link:focus {
  left: 12px;
  top: 12px;
}

.container {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 20px;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  background: rgba(7, 6, 11, 0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 100%;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 700;
  font-size: 1.08rem;
  letter-spacing: -0.01em;
}

.brand:hover {
  text-decoration: none;
  color: #ffffff;
}

.brand img {
  width: 30px;
  height: 30px;
  display: block;
}

.brand-badge {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--accent-bright);
  background: var(--accent-soft);
  border: 1px solid var(--border-strong);
  padding: 2px 8px;
  border-radius: 999px;
}

.nav-links {
  display: none;
  align-items: center;
  gap: 20px;
}

.nav-links a {
  color: var(--text-secondary);
  font-size: 0.94rem;
  font-weight: 500;
}

.nav-links a:hover,
.nav-links a[aria-current="page"] {
  color: var(--text);
  text-decoration: none;
}

.nav-links a.nav-cta {
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  border: 1px solid var(--border-strong);
  color: var(--accent-bright);
}

.nav-links a.nav-cta:hover {
  background: rgba(139, 92, 246, 0.24);
}

.menu-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 7px 12px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
}

.mobile-drawer {
  display: none;
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border);
  padding: 14px 20px 18px;
}

.mobile-drawer.is-open {
  display: block;
}

.mobile-drawer a {
  display: block;
  padding: 9px 0;
  color: var(--text-secondary);
  border-bottom: 1px solid rgba(38, 32, 64, 0.55);
  font-weight: 500;
}

.mobile-drawer a:last-child {
  border-bottom: none;
}

@media (min-width: 820px) {
  .nav-links {
    display: flex;
  }
  .menu-toggle,
  .mobile-drawer {
    display: none !important;
  }
}

/* Buttons */
.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.btn:hover {
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, #7c3aed, #6d28d9);
  color: #ffffff;
  box-shadow: 0 8px 24px rgba(109, 40, 217, 0.35);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #8b5cf6, #7c3aed);
  color: #ffffff;
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-elevated);
  border-color: var(--border-strong);
  color: var(--text);
}

.btn-secondary:hover {
  background: var(--bg-card);
  border-color: var(--accent);
  color: #ffffff;
}

/* Hero */
.hero {
  padding: 56px 0 44px;
}

@media (min-width: 860px) {
  .hero {
    padding: 80px 0 56px;
  }
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent-bright);
  background: var(--accent-soft);
  border: 1px solid var(--border-strong);
  padding: 5px 12px;
  border-radius: 999px;
  margin-bottom: 18px;
}

.hero h1 {
  margin: 0 0 16px;
  font-size: clamp(2rem, 5vw, 3.35rem);
  line-height: 1.12;
  letter-spacing: -0.03em;
  max-width: 18ch;
  background: linear-gradient(180deg, #ffffff 15%, #c4b5fd 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-lead {
  font-size: clamp(1.04rem, 2.2vw, 1.22rem);
  color: var(--text-secondary);
  max-width: 62ch;
  margin: 0 0 28px;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  margin-top: 22px;
  color: var(--text-muted);
  font-size: 0.88rem;
}

.hero-meta span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* Sections */
.section {
  padding: 44px 0;
  border-top: 1px solid rgba(38, 32, 64, 0.7);
}

.section-header {
  max-width: 68ch;
  margin-bottom: 28px;
}

.section-kicker {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-bright);
  font-weight: 700;
  margin-bottom: 6px;
}

.section-header h2 {
  margin: 0 0 10px;
  font-size: clamp(1.45rem, 3vw, 2.05rem);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.section-header p {
  margin: 0;
  color: var(--text-secondary);
}

/* Install Command Box */
.install-box {
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}

.install-box-top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.install-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill {
  font-size: 0.76rem;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

.code-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}

.code-bar pre {
  margin: 0;
  padding: 0;
  background: transparent;
  border: none;
  overflow-x: auto;
  flex: 1;
}

.code-bar code {
  color: #e9e4ff;
  font-family: var(--font-mono);
  font-size: 0.92rem;
  white-space: nowrap;
}

.copy-btn {
  flex-shrink: 0;
  background: var(--bg-elevated);
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.copy-btn:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
}

.copy-btn.is-copied {
  border-color: var(--success);
  color: var(--success);
}

/* Grids & Cards */
.grid {
  display: grid;
  gap: 18px;
  grid-template-columns: 1fr;
}

@media (min-width: 680px) {
  .grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .grid-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 980px) {
  .grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .grid-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.card h3 {
  margin: 0 0 8px;
  font-size: 1.08rem;
  letter-spacing: -0.01em;
}

.card p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.card-link {
  display: block;
  color: inherit;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.card-link:hover {
  text-decoration: none;
  border-color: var(--accent);
  transform: translateY(-2px);
}

.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--accent-soft);
  border: 1px solid var(--border-strong);
  color: var(--accent-bright);
  font-weight: 700;
  font-size: 0.84rem;
  margin-bottom: 12px;
}

/* Code blocks inside content */
.code-wrap {
  position: relative;
  margin: 16px 0;
}

pre {
  margin: 16px 0;
  padding: 16px;
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  line-height: 1.55;
  color: #ebe6ff;
}

.code-wrap pre {
  margin: 0;
  padding-right: 84px;
}

.code-wrap .copy-btn {
  position: absolute;
  top: 10px;
  right: 10px;
}

code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: rgba(139, 92, 246, 0.12);
  border: 1px solid rgba(139, 92, 246, 0.22);
  padding: 1px 6px;
  border-radius: 5px;
  color: #e5dcff;
}

pre code {
  background: transparent;
  border: none;
  padding: 0;
  font-size: inherit;
  color: inherit;
}

/* Architecture diagram */
.arch-diagram {
  background: var(--bg-code);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 20px;
}

.arch-flow {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.arch-node {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
}

.arch-node strong {
  display: block;
  margin-bottom: 4px;
  color: var(--text);
}

.arch-node span {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.arch-arrow {
  text-align: center;
  color: var(--accent-bright);
  font-family: var(--font-mono);
  font-size: 0.86rem;
}

.arch-split {
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr;
}

@media (min-width: 720px) {
  .arch-split {
    grid-template-columns: 1fr 1fr;
  }
}

/* Callouts */
.callout {
  margin: 18px 0;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  background: var(--bg-elevated);
  font-size: 0.95rem;
}

.callout strong {
  display: block;
  margin-bottom: 4px;
  color: var(--text);
}

.callout-warn {
  border-left-color: var(--warning);
}

.callout-security {
  border-left-color: var(--success);
}

/* Tables */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  margin: 18px 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  text-align: left;
}

th,
td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

th {
  background: var(--bg-elevated);
  color: var(--text);
  font-weight: 600;
}

tr:last-child td {
  border-bottom: none;
}

/* Docs Layout */
.docs-shell {
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
  padding: 28px 0 64px;
}

@media (min-width: 960px) {
  .docs-shell {
    grid-template-columns: 270px minmax(0, 1fr);
    align-items: start;
  }
}

.docs-sidebar-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
}

@media (min-width: 960px) {
  .docs-sidebar-toggle {
    display: none;
  }
}

.docs-sidebar {
  display: none;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
}

.docs-sidebar.is-open {
  display: block;
}

@media (min-width: 960px) {
  .docs-sidebar {
    display: block;
    position: sticky;
    top: calc(var(--header-h) + 20px);
    max-height: calc(100vh - var(--header-h) - 36px);
    overflow-y: auto;
  }
}

.sidebar-group {
  margin-bottom: 18px;
}

.sidebar-group:last-child {
  margin-bottom: 0;
}

.sidebar-title {
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  font-weight: 700;
  margin: 0 0 8px;
}

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

.sidebar-list a {
  display: block;
  padding: 6px 10px;
  border-radius: 6px;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.sidebar-list a:hover {
  background: var(--bg-elevated);
  color: var(--text);
  text-decoration: none;
}

.sidebar-list a[aria-current="page"] {
  background: var(--accent-soft);
  color: var(--accent-bright);
  font-weight: 600;
}

.docs-article {
  min-width: 0;
  max-width: 78ch;
}

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 0.86rem;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.docs-article h1 {
  margin: 0 0 12px;
  font-size: clamp(1.75rem, 3.5vw, 2.45rem);
  line-height: 1.18;
  letter-spacing: -0.025em;
}

.docs-lead {
  color: var(--text-secondary);
  font-size: 1.06rem;
  margin: 0 0 24px;
}

.docs-article h2 {
  margin: 34px 0 12px;
  font-size: 1.38rem;
  letter-spacing: -0.015em;
  padding-top: 14px;
  border-top: 1px solid rgba(38, 32, 64, 0.7);
}

.docs-article h3 {
  margin: 22px 0 8px;
  font-size: 1.1rem;
}

.docs-article ul,
.docs-article ol {
  padding-left: 22px;
  color: var(--text-secondary);
}

.docs-article li {
  margin-bottom: 6px;
}

.docs-pager {
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr;
  margin-top: 40px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
}

@media (min-width: 600px) {
  .docs-pager {
    grid-template-columns: 1fr 1fr;
  }
}

.pager-link {
  display: block;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text);
}

.pager-link:hover {
  border-color: var(--accent);
  text-decoration: none;
}

.pager-label {
  display: block;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.pager-title {
  display: block;
  font-weight: 600;
  color: var(--accent-bright);
  margin-top: 2px;
}

/* Search input on Docs hub */
.docs-filter {
  width: 100%;
  max-width: 460px;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--bg-code);
  color: var(--text);
  font-size: 0.95rem;
  margin-bottom: 22px;
}

.docs-filter::placeholder {
  color: var(--text-muted);
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 36px 0;
  color: var(--text-muted);
  font-size: 0.9rem;
  background: rgba(7, 6, 11, 0.7);
}

.footer-grid {
  display: grid;
  gap: 24px;
  grid-template-columns: 1fr;
}

@media (min-width: 720px) {
  .footer-grid {
    grid-template-columns: 1.5fr 1fr 1fr;
  }
}

.footer-links {
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-links li {
  margin-bottom: 6px;
}

.footer-links a {
  color: var(--text-secondary);
}

.footer-bottom {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid rgba(38, 32, 64, 0.6);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
}
