/* ==========================================================================
   OAC Docs — single-page documentation with TOC sidebar.
   Inherits the aurora palette + Geist/Instrument from wizard.css.
   ========================================================================== */

.docs-body {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  overflow-y: auto;
}

.docs-shell {
  position: relative;
  z-index: 2;
  flex: 1;
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: clamp(24px, 4vw, 56px) clamp(20px, 4vw, 40px);
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: clamp(24px, 4vw, 56px);
  align-items: start;
}

/* ---------- TOC sidebar ---------- */
.docs-toc {
  position: sticky;
  top: 80px;
  align-self: start;
  font-size: 0.86rem;
}
.docs-toc__eyebrow {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent-mint, #5eead4);
  margin-bottom: 12px;
}
.docs-toc__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  counter-reset: toc;
}
.docs-toc__list li {
  counter-increment: toc;
}
.docs-toc__list a {
  display: block;
  padding: 6px 10px;
  border-radius: 8px;
  color: var(--ink-2);
  text-decoration: none;
  transition: color 180ms ease, background 180ms ease;
  border-left: 2px solid transparent;
}
.docs-toc__list a::before {
  content: counter(toc, decimal-leading-zero) "  ";
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--ink-3);
  margin-right: 4px;
}
.docs-toc__list a:hover {
  color: var(--ink-0);
  background: var(--surface);
}
.docs-toc__list a.is-current {
  color: var(--accent-mint, #5eead4);
  background: rgba(94, 234, 212, 0.06);
  border-left-color: var(--accent-mint, #5eead4);
}
.docs-toc__footer {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 0.72rem;
}
.docs-toc__link {
  color: var(--ink-3);
  text-decoration: none;
}
.docs-toc__link:hover { color: var(--accent-mint, #5eead4); }

/* ---------- article ---------- */
.docs-article {
  min-width: 0;
}

.docs-hero {
  padding-bottom: 32px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 48px;
}
.docs-hero__eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent-mint, #5eead4);
  margin-bottom: 14px;
}
.docs-hero__title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  letter-spacing: -0.02em;
  line-height: 1.05;
  color: var(--ink-0);
  margin: 0 0 16px;
}
.docs-hero__title em {
  font-style: italic;
  color: var(--accent-mint, #5eead4);
}
.docs-hero__sub {
  margin: 0;
  color: var(--ink-1);
  font-size: 1.05rem;
  line-height: 1.6;
  max-width: 680px;
}

/* ---------- sections ---------- */
.docs-section {
  padding: 32px 0 48px;
  border-bottom: 1px solid var(--line);
  scroll-margin-top: 80px;
}
.docs-section:last-of-type { border-bottom: 0; }

.docs-section h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 2rem;
  letter-spacing: -0.02em;
  color: var(--ink-0);
  margin: 0 0 18px;
  line-height: 1;
}
.docs-section h3 {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: 0;
  color: var(--ink-0);
  margin: 28px 0 12px;
}

.docs-section p,
.docs-section li {
  color: var(--ink-1);
  font-size: 0.95rem;
  line-height: 1.65;
}
.docs-section p { margin: 0 0 14px; }
.docs-section ul,
.docs-section ol {
  margin: 0 0 14px;
  padding-left: 1.4em;
}
.docs-section li { margin-bottom: 6px; }
.docs-section li::marker { color: var(--ink-3); }

.docs-section a {
  color: var(--accent-mint, #5eead4);
  text-decoration: none;
  border-bottom: 1px solid rgba(94, 234, 212, 0.25);
  transition: border-color 180ms ease;
}
.docs-section a:hover { border-bottom-color: var(--accent-mint, #5eead4); }

.docs-section strong { color: var(--ink-0); font-weight: 500; }
.docs-section em { font-style: italic; color: var(--ink-0); }

.docs-section code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  padding: 2px 7px;
  border-radius: 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink-0);
}

/* ---------- cards (overview teasers) ---------- */
.docs-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 20px;
}
.docs-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px 18px;
  color: var(--ink-1);
  text-decoration: none;
  border-bottom: 1px solid var(--line);
  transition: border-color 200ms ease, transform 200ms ease;
}
.docs-card:hover {
  border-color: rgba(94, 234, 212, 0.4);
  transform: translateY(-1px);
}
.docs-card__label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent-mint, #5eead4);
  margin-bottom: 6px;
}
.docs-card__title {
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: var(--ink-0);
  letter-spacing: -0.01em;
  margin-bottom: 4px;
}
.docs-card__desc {
  font-size: 0.85rem;
  color: var(--ink-2);
  line-height: 1.5;
}

/* ---------- ASCII diagram ---------- */
.docs-diagram {
  margin: 18px 0;
}
.docs-diagram pre {
  margin: 0;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  line-height: 1.4;
  color: var(--ink-1);
}

/* ---------- module mini-grid ---------- */
.docs-modgrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
  margin: 18px 0;
}
.docs-mod {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
}
.docs-mod__name {
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: var(--ink-0);
  margin-bottom: 4px;
}
.docs-mod__desc {
  font-size: 0.78rem;
  line-height: 1.5;
  color: var(--ink-2);
}

/* ---------- tables ---------- */
.docs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  margin: 16px 0 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}
.docs-table thead th {
  text-align: left;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-3);
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(7, 16, 12, 0.4);
}
.docs-table tbody td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  color: var(--ink-1);
  vertical-align: top;
}
.docs-table tbody tr:last-child td { border-bottom: 0; }
.docs-table tbody tr:hover { background: rgba(94, 234, 212, 0.03); }
.docs-table code { padding: 1px 6px; }

/* ---------- footer ---------- */
.docs-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 48px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--ink-3);
  letter-spacing: 0.04em;
}
.docs-foot__link {
  color: var(--ink-3);
  text-decoration: none;
}
.docs-foot__link:hover { color: var(--accent-mint, #5eead4); }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .docs-shell {
    grid-template-columns: 1fr;
  }
  .docs-toc {
    position: static;
    margin-bottom: 24px;
  }
  .docs-toc__list { flex-direction: row; flex-wrap: wrap; gap: 6px; }
  .docs-toc__list a { padding: 5px 10px; border-left: 0; border: 1px solid var(--line); border-radius: 999px; font-size: 0.78rem; }
  .docs-toc__list a::before { display: none; }
  .docs-toc__list a.is-current {
    border-color: rgba(94, 234, 212, 0.5);
    background: rgba(94, 234, 212, 0.08);
  }
  .docs-toc__footer { display: none; }
}
