/* ─── Docs page ─── */
.docs-body {
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* Top bar */
.docs-topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 2rem;
  background: rgba(6, 14, 10, 0.82);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.docs-home {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  text-decoration: none;
}
.docs-home-gear { color: var(--text); }
.docs-home-bx { color: var(--green-400); }
.docs-topnav { display: flex; gap: 1.6rem; }
.docs-topnav-link {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s var(--ease-out-quart);
}
.docs-topnav-link:hover { color: var(--green-400); }

/* Layout */
.docs-layout {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  max-width: 1180px;
  margin: 0 auto;
  gap: 3rem;
  padding: 0 2rem;
}

/* Sidebar */
.docs-sidebar {
  position: sticky;
  top: 72px;
  align-self: start;
  height: calc(100vh - 72px);
  overflow-y: auto;
  padding: 2.4rem 0;
}
.docs-nav { display: flex; flex-direction: column; gap: 1.8rem; }
.docs-nav-group { display: flex; flex-direction: column; gap: 0.25rem; }
.docs-nav-title {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-dim);
  margin-bottom: 0.5rem;
}
.docs-nav-link {
  font-size: 0.88rem;
  color: var(--text-muted);
  text-decoration: none;
  padding: 0.32rem 0.7rem;
  border-left: 2px solid transparent;
  transition: all 0.18s var(--ease-out-quart);
}
.docs-nav-link:hover { color: var(--text); }
.docs-nav-link.active {
  color: var(--green-400);
  border-left-color: var(--green-400);
}

/* Main */
.docs-main {
  padding: 2.4rem 0 6rem;
  min-width: 0;
}
.docs-hero { margin-bottom: 3.5rem; }
.docs-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--green-500);
}
.docs-h1 {
  font-size: clamp(2.2rem, 5vw, 3rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  margin: 0.6rem 0 1.2rem;
}
.docs-lead {
  font-size: 1.08rem;
  line-height: 1.7;
  color: var(--text-muted);
  max-width: 68ch;
}

.docs-section {
  margin-bottom: 3.4rem;
  scroll-margin-top: 90px;
}
.docs-h2 {
  font-size: 1.55rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 0.9rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}
.docs-section p {
  line-height: 1.7;
  color: var(--text-muted);
  max-width: 70ch;
  margin-bottom: 1.1rem;
}
.docs-section a {
  color: var(--green-400);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}
.docs-section a:hover { border-bottom-color: var(--green-400); }

code {
  font-family: var(--font-mono);
  font-size: 0.86em;
  background: var(--bg-surface);
  color: var(--green-300);
  padding: 0.12em 0.4em;
  border-radius: 4px;
}

/* Code blocks */
.docs-code {
  margin: 1.2rem 0 1.6rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg-elevated);
}
.docs-code-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 1rem;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
}
.docs-code-head span {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-dim);
}
.docs-copy {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  background: transparent;
  border: 1px solid var(--border-bright);
  color: var(--text-muted);
  padding: 0.2rem 0.6rem;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.18s var(--ease-out-quart);
}
.docs-copy:hover { color: var(--green-400); border-color: var(--green-600); }
.docs-code pre {
  margin: 0;
  padding: 1.1rem 1.2rem;
  overflow-x: auto;
}
.docs-code pre code {
  background: none;
  color: var(--text);
  padding: 0;
  font-size: 0.84rem;
  line-height: 1.65;
  white-space: pre;
}

/* Tables */
.docs-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.2rem 0 1.6rem;
  font-size: 0.88rem;
}
.docs-table th, .docs-table td {
  text-align: left;
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.docs-table th {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  font-weight: 500;
}
.docs-table td { color: var(--text-muted); line-height: 1.55; }
.docs-table td code { font-size: 0.82em; }

.docs-note {
  border-left: 2px solid var(--green-600);
  background: var(--bg-elevated);
  padding: 0.8rem 1.1rem;
  border-radius: 0 8px 8px 0;
  font-size: 0.9rem;
  color: var(--text-muted) !important;
}

/* Tiers */
.docs-tiers {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 1.2rem;
}
.docs-tier {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.2rem;
  background: var(--bg-elevated);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.docs-tier-name {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
}
.docs-tier-bits { font-size: 1.7rem; font-weight: 600; letter-spacing: -0.02em; }
.docs-tier-desc { font-size: 0.84rem; color: var(--text-muted); line-height: 1.5; }
.docs-tier-low { border-top: 2px solid var(--low-color); }
.docs-tier-low .docs-tier-name, .docs-tier-low .docs-tier-bits { color: var(--low-color); }
.docs-tier-mid { border-top: 2px solid var(--mid-color); }
.docs-tier-mid .docs-tier-name, .docs-tier-mid .docs-tier-bits { color: var(--mid-color); }
.docs-tier-high { border-top: 2px solid var(--high-color); }
.docs-tier-high .docs-tier-name, .docs-tier-high .docs-tier-bits { color: var(--high-color); }

/* Paper */
.docs-paper-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
  border: 1px solid var(--border-bright);
  border-radius: 12px;
  padding: 1.6rem 1.8rem;
  background: linear-gradient(135deg, var(--bg-surface), var(--bg-elevated));
}
.docs-paper-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--green-400);
  border: 1px solid var(--green-700);
  border-radius: 20px;
  padding: 0.2rem 0.7rem;
  margin-bottom: 0.7rem;
}
.docs-paper-title {
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 0.35rem;
  max-width: 40ch;
}
.docs-paper-meta {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0 !important;
}
.docs-btn {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  text-decoration: none;
  padding: 0.7rem 1.2rem;
  border-radius: 8px;
  white-space: nowrap;
  transition: all 0.2s var(--ease-out-quart);
}
.docs-btn-primary {
  background: var(--green-500);
  color: var(--bg);
  font-weight: 600;
}
.docs-btn-primary:hover { background: var(--green-400); transform: translateY(-1px); }

.docs-footer {
  margin-top: 4rem;
  padding-top: 1.6rem;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 0.8rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-dim);
}

/* Responsive */
@media (max-width: 860px) {
  .docs-layout { grid-template-columns: 1fr; gap: 0; }
  .docs-sidebar { display: none; }
  .docs-topbar { padding: 1rem 1.2rem; }
  .docs-layout { padding: 0 1.2rem; }
  .docs-tiers { grid-template-columns: 1fr; }
}
