:root {
  --bg: #08090b;
  --bg-soft: #0c0e12;
  --panel: rgba(15, 17, 22, 0.88);
  --panel-strong: #10131a;
  --panel-hover: #171a21;
  --line: rgba(255,255,255,0.08);
  --line-strong: rgba(255,255,255,0.12);
  --text: #f4f5f7;
  --text-soft: #c2c7d0;
  --text-dim: #8f96a3;
  --accent: #ffffff;
  --shadow: 0 16px 40px rgba(0,0,0,0.36);
  --radius: 18px;
  --radius-sm: 14px;
  --content-width: 760px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top center, rgba(255,255,255,0.04), transparent 28%),
    linear-gradient(180deg, #07080a 0%, #090b0f 100%);
  color: var(--text);
  min-height: 100vh;
}

.page-noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .16;
  background-image:
    linear-gradient(rgba(255,255,255,.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.015) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: radial-gradient(circle at center, rgba(0,0,0,.95), rgba(0,0,0,.45));
}

a { color: inherit; text-decoration: none; }
button, input { font: inherit; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: auto minmax(320px, 520px) auto;
  align-items: center;
  gap: 24px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
  background: rgba(8, 9, 11, 0.84);
  backdrop-filter: blur(18px);
}

.mobile-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255,255,255,0.02);
  color: var(--text);
  align-items: center;
  justify-content: center;
  padding: 0;
}
.mobile-toggle svg,
.nav-group svg,
.search-icon { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: max-content;
}

.brand-word {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -.02em;
}

.brand-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 28px;
  padding: 0 10px;
  margin-top: 1px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1;
  background: rgba(255,255,255,0.02);
}

.search-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255,255,255,0.02);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
}

.search-wrap:focus-within {
  border-color: rgba(255,255,255,0.16);
  background: rgba(255,255,255,0.03);
}

.search-icon {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  color: var(--text-dim);
}

.search-wrap input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--text);
  font-size: 15px;
}

.search-wrap input::placeholder { color: var(--text-dim); }
.search-wrap input::-webkit-search-decoration,
.search-wrap input::-webkit-search-cancel-button,
.search-wrap input::-webkit-search-results-button,
.search-wrap input::-webkit-search-results-decoration { display: none; }

.shortcut,
.version-pill,
.release-head > span,
.latest {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.02);
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.version-pill { justify-self: end; }

.layout {
  width: min(1440px, 100% - 32px);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 260px minmax(0, var(--content-width)) 220px;
  gap: 54px;
  padding: 36px 0 80px;
}

.sidebar,
.toc { position: sticky; top: 98px; align-self: start; }
.sidebar-label,
.toc-label,
.eyebrow {
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: 12px;
  color: var(--text-dim);
  font-weight: 700;
}

#navigation {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 14px;
}

.nav-link,
.nav-group {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 12px;
  color: var(--text-soft);
  border: 1px solid transparent;
  background: transparent;
  transition: background .18s ease, color .18s ease, border-color .18s ease, transform .18s ease;
}

.nav-link:hover,
.nav-group:hover {
  background: rgba(255,255,255,0.03);
  color: var(--text);
}

.nav-link.active {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.08);
  color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}

.nav-group {
  cursor: pointer;
  border: 0;
  text-align: left;
  color: var(--text-soft);
  padding-right: 10px;
}
.nav-group svg { width: 16px; height: 16px; color: var(--text-dim); transition: transform .2s ease; }
.nav-group[aria-expanded="false"] svg { transform: rotate(-90deg); }
.nav-children { display: flex; flex-direction: column; gap: 4px; padding-left: 10px; margin-top: 2px; }
.nav-group[aria-expanded="false"] + .nav-children { display: none; }
.nav-link.child { font-size: 14px; min-height: 40px; color: var(--text-dim); }

.content { min-width: 0; }
.doc-section {
  padding: 14px 0 52px;
  border-bottom: 1px solid var(--line);
}
.doc-section:last-of-type { border-bottom: 0; }
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .5s ease, transform .5s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

h1, h2, h3 {
  margin: 0;
  letter-spacing: -.035em;
}
h1 {
  margin-top: 10px;
  font-size: clamp(2.5rem, 4vw, 4rem);
  line-height: .98;
}
h2 {
  margin-top: 10px;
  font-size: clamp(2rem, 3vw, 2.7rem);
  line-height: 1.05;
}
h3 { font-size: 1.16rem; }

p, li, summary, label {
  color: var(--text-soft);
  font-size: 1.04rem;
  line-height: 1.7;
}
.lead {
  max-width: 690px;
  font-size: 1.1rem;
  line-height: 1.75;
}

.callout,
.feature-card,
.feature-grid article,
pre,
details,
.search-results {
  background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.015));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.callout {
  margin-top: 28px;
  padding: 22px 22px 20px;
}
.callout strong {
  display: block;
  font-size: 1.05rem;
  margin-bottom: 8px;
}
.callout p { margin: 0; }
.callout.warning { border-color: rgba(255,255,255,0.12); }

.cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 26px;
}
.feature-card {
  padding: 18px 18px 16px;
  transition: transform .2s ease, border-color .2s ease, background .2s ease;
}
.feature-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255,255,255,0.12);
  background: linear-gradient(180deg, rgba(255,255,255,0.045), rgba(255,255,255,0.02));
}
.card-index,
.steps > li > span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  padding: 0 10px;
  border-radius: 10px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .04em;
}
.feature-card h3 { margin-top: 16px; color: var(--text); }
.feature-card p { margin: 8px 0 0; font-size: .98rem; }

.steps {
  list-style: none;
  padding: 0;
  margin: 30px 0 0;
}
.steps > li {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 16px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}
.steps > li:last-child { border-bottom: 0; }
.steps strong { display: block; color: var(--text); font-size: 1.05rem; margin-top: 2px; }
.steps p { margin: 6px 0 0; }

.checklist {
  display: grid;
  gap: 12px;
  margin-top: 22px;
}
.checklist label {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255,255,255,0.02);
}
.checklist input { width: 16px; height: 16px; accent-color: #d4d7dd; }

pre {
  overflow: auto;
  margin-top: 24px;
  padding: 20px;
}
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: #e9ebef; }

.feature-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 24px;
}
.feature-grid article { padding: 20px; }
.feature-grid h3 { margin-bottom: 8px; color: var(--text); }
.feature-grid p { margin: 0; font-size: .98rem; }

details {
  margin-top: 16px;
  padding: 0 18px;
  overflow: hidden;
}
summary {
  cursor: pointer;
  list-style: none;
  padding: 18px 0;
  font-weight: 600;
  color: var(--text);
}
summary::-webkit-details-marker { display: none; }
details p {
  margin: 0 0 18px;
  font-size: .98rem;
}

.release-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 10px;
}
.latest { color: var(--text); }
.release ul,
.release ol { padding-left: 22px; }

.toc {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.toc a {
  color: var(--text-dim);
  font-size: 14px;
  transition: color .18s ease;
}
.toc a:hover,
.toc a.active { color: var(--text); }

footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 30px 0 14px;
  color: var(--text-dim);
  font-size: 14px;
}

.search-results {
  position: fixed;
  top: 84px;
  left: 50%;
  transform: translateX(-50%);
  width: min(720px, calc(100vw - 24px));
  max-height: 60vh;
  overflow: auto;
  z-index: 30;
  padding: 10px;
}
.search-results[hidden] { display: none; }
.search-result {
  display: block;
  padding: 14px;
  border-radius: 14px;
  transition: background .18s ease;
}
.search-result:hover { background: rgba(255,255,255,0.04); }
.search-result strong { display: block; margin-bottom: 4px; color: var(--text); }
.search-result p { margin: 0; font-size: 14px; color: var(--text-dim); }
.search-empty {
  padding: 16px;
  color: var(--text-soft);
}

@media (max-width: 1200px) {
  .layout {
    grid-template-columns: 240px minmax(0, 1fr);
  }
  .toc { display: none; }
}

@media (max-width: 900px) {
  .topbar {
    grid-template-columns: auto 1fr auto;
    gap: 14px;
  }
  .mobile-toggle { display: inline-flex; }
  .brand { order: 2; }
  .search-wrap {
    grid-column: 1 / -1;
    order: 4;
  }
  .version-pill { order: 3; }
  .layout {
    width: min(100% - 24px, 100%);
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }
  .sidebar {
    position: fixed;
    top: 78px;
    left: 12px;
    bottom: 12px;
    width: min(320px, calc(100vw - 24px));
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: rgba(8, 9, 11, 0.95);
    backdrop-filter: blur(20px);
    transform: translateX(-110%);
    transition: transform .22s ease;
    z-index: 25;
    overflow: auto;
  }
  .sidebar.open { transform: translateX(0); }
  .content { padding-top: 8px; }
  .cards,
  .feature-grid { grid-template-columns: 1fr; }
  footer { flex-direction: column; }
}

@media (max-width: 560px) {
  .topbar { padding: 14px 12px; }
  .brand-word { font-size: 18px; }
  .brand-pill,
  .version-pill,
  .shortcut { font-size: 11px; }
  .search-wrap { min-height: 48px; }
  .shortcut { display: none; }
  h1 { font-size: 2.2rem; }
  h2 { font-size: 1.8rem; }
  .callout,
  .feature-card,
  .feature-grid article,
  pre,
  details { border-radius: 16px; }
}

/* Discord and purchase additions */
.top-actions {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 10px;
}

.discord-button {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  height: 40px;
  padding: 0 13px 0 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255,255,255,0.025);
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 650;
  transition: border-color .18s ease, background .18s ease, color .18s ease, transform .18s ease;
}

.discord-button:hover {
  transform: translateY(-1px);
  color: var(--text);
  background: rgba(255,255,255,0.05);
  border-color: rgba(255,255,255,0.14);
}

.discord-button img {
  width: 23px;
  height: 23px;
  object-fit: contain;
}

.pricing-block {
  margin-top: 42px;
  padding-top: 38px;
  border-top: 1px solid var(--line);
}

.pricing-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, .8fr);
  align-items: end;
  gap: 30px;
  margin-bottom: 22px;
}

.pricing-heading h2 {
  font-size: clamp(1.75rem, 3vw, 2.35rem);
}

.pricing-heading p {
  margin: 0;
  font-size: .95rem;
  line-height: 1.6;
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.price-card {
  display: grid;
  grid-template-columns: 46px 1fr;
  grid-template-areas:
    "icon name"
    "icon price"
    "desc desc";
  align-items: center;
  gap: 2px 13px;
  min-height: 152px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255,255,255,0.032), rgba(255,255,255,0.014));
  box-shadow: var(--shadow);
  transition: transform .2s ease, border-color .2s ease, background .2s ease;
}

.price-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255,255,255,.14);
  background: linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.02));
}

.price-icon {
  grid-area: icon;
  width: 46px;
  height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255,255,255,.035);
}

.price-icon img {
  width: 34px;
  height: 34px;
  object-fit: contain;
}

.price-name {
  grid-area: name;
  color: var(--text-dim);
  font-size: 13px;
  font-weight: 650;
}

.price-card strong {
  grid-area: price;
  color: var(--text);
  font-size: 1.7rem;
  letter-spacing: -.035em;
}

.price-card small {
  grid-area: desc;
  margin-top: 17px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: var(--text-dim);
  font-size: 12px;
}

/* Search popup readability */
.search-results {
  top: 82px;
  background: #0d0f13;
  border-color: rgba(255,255,255,.13);
  box-shadow: 0 28px 80px rgba(0,0,0,.72), 0 0 0 9999px rgba(0,0,0,.38);
  backdrop-filter: none;
}

.search-result {
  background: #0d0f13;
  border: 1px solid transparent;
}

.search-result + .search-result {
  border-top-color: var(--line);
  border-radius: 0;
}

.search-result:hover {
  background: #15181e;
  border-color: rgba(255,255,255,.08);
  border-radius: 12px;
}

.search-result strong {
  font-size: 15px;
}

.search-result p {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: #a9b0bc;
  line-height: 1.45;
}

@media (max-width: 900px) {
  .top-actions { order: 3; }
  .discord-button span { display: none; }
  .discord-button { width: 40px; padding: 0; justify-content: center; }
  .pricing-heading { grid-template-columns: 1fr; gap: 12px; }
  .pricing-grid { grid-template-columns: 1fr; }
}
