:root {
  --bg: #f6f2ff;
  --bg-deep: #ede6ff;
  --surface: rgba(255, 255, 255, 0.92);
  --surface-strong: #ffffff;
  --surface-soft: #f3edff;
  --surface-muted: #ede5ff;
  --text: #130d20;
  --muted: #685c7f;
  --border: #ddd2fa;
  --border-strong: #c8b7f5;
  --accent: #7c3aed;
  --accent-strong: #6327d9;
  --accent-soft: #efe7ff;
  --accent-ink: #140a29;
  --shadow: 0 24px 80px rgba(37, 18, 73, 0.12);
  --topbar-height: 84px;
  --sidebar-width: 304px;
  --toc-width: 250px;
  --body-font: "Geist", "Space Grotesk", "Avenir Next", sans-serif;
  --heading-font: "Sora", "Geist", "Space Grotesk", sans-serif;
  --mono-font: "JetBrains Mono", "SFMono-Regular", "Consolas", monospace;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--text);
  font-family: var(--body-font);
  background:
    radial-gradient(circle at top left, rgba(124, 58, 237, 0.14), transparent 30%),
    radial-gradient(circle at top right, rgba(167, 139, 250, 0.14), transparent 28%),
    linear-gradient(180deg, #fbf9ff 0%, var(--bg) 45%, var(--bg-deep) 100%);
}

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

a:hover {
  text-decoration: underline;
}

code,
pre {
  font-family: var(--mono-font);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: var(--topbar-height);
  padding: 16px 28px;
  background: rgba(10, 6, 19, 0.9);
  border-bottom: 1px solid rgba(167, 139, 250, 0.2);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

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

.brand-icon {
  display: block;
  height: 46px;
  width: auto;
  flex: 0 0 auto;
  filter: drop-shadow(0 10px 24px rgba(124, 58, 237, 0.22));
}

.brand-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.brand-name {
  color: #faf8ff;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
}

.brand-tagline {
  color: rgba(232, 223, 255, 0.76);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  line-height: 1;
  text-transform: uppercase;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.topbar-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.version-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid rgba(167, 139, 250, 0.25);
  border-radius: 999px;
  background: rgba(124, 58, 237, 0.14);
  color: rgba(250, 248, 255, 0.86);
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.version-badge strong {
  color: #fff;
  font-size: 0.8rem;
}

.topbar-link {
  color: rgba(232, 223, 255, 0.76);
  font-size: 0.94rem;
  font-weight: 600;
}

.topbar-link:hover {
  color: #fff;
  text-decoration: none;
}

.nav-toggle {
  display: none;
  padding: 10px 14px;
  border: 1px solid rgba(167, 139, 250, 0.24);
  border-radius: 999px;
  background: rgba(124, 58, 237, 0.14);
  color: #fff;
  font: inherit;
  cursor: pointer;
}

.layout {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  min-height: calc(100vh - var(--topbar-height));
}

.sidebar {
  position: sticky;
  top: var(--topbar-height);
  height: calc(100vh - var(--topbar-height));
  overflow: auto;
  padding: 28px 18px 36px;
  border-right: 1px solid rgba(167, 139, 250, 0.24);
  background: rgba(248, 245, 255, 0.82);
  backdrop-filter: blur(14px);
}

.sidebar-section + .sidebar-section {
  margin-top: 26px;
}

.sidebar-heading {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

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

.sidebar-list li + li {
  margin-top: 6px;
}

.sidebar-link {
  display: block;
  padding: 11px 12px;
  border-radius: 14px;
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 500;
}

.sidebar-link:hover {
  background: rgba(124, 58, 237, 0.08);
  text-decoration: none;
}

.sidebar-link.is-active {
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.16), rgba(167, 139, 250, 0.12));
  color: var(--accent-strong);
  font-weight: 700;
}

.sidebar-meta {
  margin-top: 28px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.84);
  box-shadow: var(--shadow);
}

.sidebar-meta-title {
  margin: 0 0 12px;
  color: var(--accent-ink);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.version-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sidebar-meta .version-badge {
  justify-content: space-between;
  border-color: var(--border);
  background: var(--surface-soft);
  color: var(--muted);
}

.sidebar-meta .version-badge strong {
  color: var(--accent-ink);
}

.sidebar-meta-note {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.6;
}

.content-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, var(--toc-width));
  gap: 28px;
  padding: 32px 36px 52px;
}

.content {
  min-width: 0;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.95fr);
  gap: 22px;
  margin-bottom: 24px;
}

.hero-copy,
.hero-panel {
  padding: 28px 30px;
  border: 1px solid rgba(167, 139, 250, 0.22);
  border-radius: 28px;
  box-shadow: var(--shadow);
}

.hero-copy {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(241, 234, 255, 0.94) 100%);
}

.hero-panel {
  background:
    linear-gradient(180deg, rgba(20, 10, 41, 0.98) 0%, rgba(14, 9, 31, 0.98) 100%);
}

.hero-label {
  margin: 0 0 12px;
  color: var(--accent-strong);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero-title {
  margin: 0 0 14px;
  font-family: var(--heading-font);
  font-size: clamp(2.4rem, 4.6vw, 4.1rem);
  line-height: 1.02;
  letter-spacing: -0.04em;
}

.hero-lead {
  margin: 0;
  font-size: 1.08rem;
  line-height: 1.72;
}

.hero-summary {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.78;
}

.hero-points,
.hero-checklist {
  margin: 18px 0 0;
  padding-left: 22px;
}

.hero-points li,
.hero-checklist li {
  line-height: 1.65;
}

.hero-points li + li,
.hero-checklist li + li {
  margin-top: 10px;
}

.hero-points strong {
  color: var(--accent-ink);
}

.hero-checklist {
  margin-bottom: 24px;
  color: rgba(246, 242, 255, 0.86);
}

.hero-checklist strong {
  color: #fff;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.hero-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--text);
  font-weight: 700;
}

.hero-button:hover {
  text-decoration: none;
}

.hero-button.is-primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.hero-banner {
  display: block;
  width: 100%;
  height: auto;
  margin-bottom: 20px;
  border: 1px solid rgba(167, 139, 250, 0.2);
  border-radius: 20px;
}

.hero-command-label {
  margin: 0 0 10px;
  color: rgba(232, 223, 255, 0.72);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero-command {
  overflow: auto;
  margin: 0;
  padding: 18px 20px;
  border: 1px solid rgba(167, 139, 250, 0.22);
  border-radius: 20px;
  background: rgba(8, 5, 18, 0.78);
  color: #f6f2ff;
}

.hero-command code {
  padding: 0;
  background: transparent;
  color: inherit;
  font-size: 0.94rem;
  line-height: 1.8;
}

.article {
  max-width: 880px;
  padding: 38px 42px;
  border: 1px solid rgba(167, 139, 250, 0.22);
  border-radius: 28px;
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  margin-bottom: 18px;
  padding: 7px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.article h1,
.article h2,
.article h3,
.article h4 {
  font-family: var(--heading-font);
  letter-spacing: -0.03em;
}

.article h1 {
  margin: 0 0 18px;
  font-size: clamp(2.35rem, 4vw, 3.55rem);
  line-height: 1.04;
}

.article h2 {
  margin: 40px 0 14px;
  font-size: clamp(1.55rem, 2vw, 2.1rem);
  line-height: 1.18;
}

.article h3 {
  margin: 24px 0 12px;
  font-size: 1.2rem;
  line-height: 1.3;
}

.article h4 {
  margin: 18px 0 10px;
  font-size: 1rem;
}

.article p,
.article li,
.article blockquote {
  font-size: 1rem;
  line-height: 1.82;
}

.article p {
  margin: 14px 0;
}

.article ul,
.article ol {
  margin: 14px 0;
  padding-left: 24px;
}

.article li + li {
  margin-top: 8px;
}

.article img {
  display: block;
  max-width: 100%;
  height: auto;
}

.article code {
  padding: 0.16rem 0.44rem;
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--accent-strong);
  font-size: 0.92em;
}

.article pre {
  overflow: auto;
  margin: 20px 0;
  padding: 18px 20px;
  border: 1px solid rgba(167, 139, 250, 0.2);
  border-radius: 20px;
  background: #120c21;
  color: #f7f3ff;
}

.article pre code {
  padding: 0;
  background: transparent;
  color: inherit;
}

.article blockquote {
  margin: 20px 0;
  padding: 16px 18px;
  border-left: 4px solid var(--accent);
  border-radius: 0 16px 16px 0;
  background: var(--accent-soft);
}

.article .md-table {
  display: block;
  overflow-x: auto;
  margin: 22px 0;
  border-collapse: collapse;
  border-radius: 16px;
  font-size: 0.95rem;
  line-height: 1.55;
  max-width: 100%;
}

.article .md-table thead {
  background: var(--surface-muted);
}

.article .md-table th,
.article .md-table td {
  padding: 11px 14px;
  border: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.article .md-table th {
  font-weight: 700;
  color: var(--text);
}

.article .md-table tbody tr:nth-child(even) td {
  background: rgba(239, 231, 255, 0.56);
}

.article .md-table code {
  font-size: 0.88em;
}

.page-nav {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 40px;
}

.page-nav a,
.page-nav span {
  display: block;
  min-height: 100%;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.82);
}

.page-nav a:hover {
  text-decoration: none;
  border-color: var(--border-strong);
  background: #fff;
}

.page-nav small {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.page-nav strong {
  color: var(--text);
  font-size: 1rem;
}

.toc {
  position: sticky;
  top: 102px;
  align-self: start;
  padding: 22px 18px;
  border: 1px solid rgba(167, 139, 250, 0.22);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.toc h2 {
  margin: 0 0 14px;
  font-size: 0.86rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

.toc-item + .toc-item {
  margin-top: 8px;
}

.toc-link {
  display: block;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.55;
}

.toc-link.level-3 {
  padding-left: 14px;
}

.footer-note {
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

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

  .toc {
    display: none;
  }
}

@media (max-width: 1040px) {
  .topbar-meta {
    display: none;
  }
}

@media (max-width: 980px) {
  .nav-toggle {
    display: inline-flex;
  }

  .layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    top: var(--topbar-height);
    left: 0;
    bottom: 0;
    z-index: 40;
    width: min(88vw, 330px);
    transform: translateX(-104%);
    transition: transform 180ms ease;
    box-shadow: 0 28px 70px rgba(20, 10, 41, 0.24);
  }

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

  .content-shell {
    padding: 24px;
  }

  .hero {
    grid-template-columns: 1fr;
  }

  .article {
    padding: 28px 24px;
  }
}

@media (max-width: 640px) {
  :root {
    --topbar-height: 72px;
  }

  .topbar {
    padding: 14px 18px;
  }

  .topbar-link {
    display: none;
  }

  .brand-icon {
    height: 36px;
  }

  .brand-tagline {
    display: none;
  }

  .content-shell {
    padding: 16px;
  }

  .hero-copy,
  .hero-panel,
  .article {
    padding: 22px 18px;
    border-radius: 20px;
  }

  .page-nav {
    grid-template-columns: 1fr;
  }
}
