/* ============================================================
   TopoMapping — Documentation
   Page-specific styles for the docs hub. Shares the brass &
   emerald color tokens, header, footer and grain from
   site-chrome.css (loaded first). Fonts: Poppins (body),
   Newsreader (serif display), IBM Plex Mono (labels/code).
   All selectors scoped to .doc-* so nothing leaks elsewhere.
   ============================================================ */

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }
body {
  font-family: 'Poppins', sans-serif;
  background: var(--paper);
  color: var(--text-dark);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
::selection { background: var(--gold); color: var(--green-900); }

/* The hero is dark, so let the header start airy and translucent. */
.ab-header { background: rgba(12, 46, 30, 0.6); }
.ab-header.scrolled { background: rgba(8, 32, 20, 0.97); }

.doc-page { position: relative; overflow-x: hidden; }

/* ---------------- shared eyebrow ---------------- */
.doc-eyebrow { display: inline-flex; align-items: center; gap: 10px; }
.doc-eyebrow .hair { width: 26px; height: 1px; background: rgba(253, 191, 45, 0.7); }
.doc-eyebrow .label {
  font-family: 'IBM Plex Mono', monospace;
  text-transform: uppercase;
  font-size: 0.74rem;
  letter-spacing: 0.3em;
  color: var(--gold);
}

/* ============ HERO ============ */
.doc-hero {
  position: relative;
  overflow: hidden;
  background: radial-gradient(120% 90% at 50% -10%, var(--green-500) 0%, var(--green-700) 45%, var(--green-800) 100%);
  color: #fff;
}
.doc-hero-glow {
  position: absolute; inset: 0; z-index: 1;
  background: radial-gradient(60% 50% at 50% 30%, rgba(253, 191, 45, 0.12), transparent 70%);
}
.doc-hero-inner {
  position: relative; z-index: 2;
  max-width: 1000px; margin: 0 auto;
  padding: 184px 48px 92px;
  text-align: center;
}
.doc-h1 {
  font-family: 'Newsreader', serif;
  font-weight: 500;
  font-size: clamp(48px, 6vw, 88px);
  line-height: 1.03;
  letter-spacing: -0.02em;
  margin: 24px 0 0;
  color: #fff;
  text-wrap: balance;
}
.doc-h1 .accent { font-style: italic; color: var(--gold); }
.doc-hero-sub {
  max-width: 620px; margin: 26px auto 0;
  font-size: 1.14rem; line-height: 1.75;
  color: rgba(255, 255, 255, 0.78);
  text-wrap: pretty;
}
/* search-style quick links under the hero */
.doc-hero-chips {
  display: flex; flex-wrap: wrap; gap: 10px;
  justify-content: center; margin-top: 34px;
}
.doc-hero-chips a {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.78rem; letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.86);
  text-decoration: none;
  padding: 9px 16px; border-radius: 999px;
  border: 1px solid rgba(253, 191, 45, 0.28);
  background: rgba(255, 255, 255, 0.04);
  transition: all .22s ease;
}
.doc-hero-chips a:hover {
  border-color: var(--gold); color: #fff;
  background: rgba(253, 191, 45, 0.12);
  transform: translateY(-1px);
}

/* ============ LAYOUT: sidebar + content ============ */
.doc-shell {
  max-width: 1240px; margin: 0 auto;
  padding: 0 48px 40px;
  display: grid;
  grid-template-columns: 248px 1fr;
  gap: 64px;
  align-items: start;
}

/* ---- sticky sidebar TOC ---- */
.doc-side {
  position: sticky; top: 104px;
  align-self: start;
  max-height: calc(100vh - 130px);
  overflow-y: auto;
  padding: 40px 0;
}
.doc-side-group { margin-bottom: 26px; }
.doc-side-head {
  display: block;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.68rem; font-weight: 500;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--gold-amber);
  margin-bottom: 12px;
}
.doc-side a {
  display: block;
  font-size: 0.9rem; font-weight: 500;
  color: var(--text-muted-light);
  text-decoration: none;
  padding: 7px 0 7px 16px;
  border-left: 2px solid rgba(16, 108, 67, 0.14);
  transition: all .18s ease;
}
.doc-side a:hover { color: var(--green-600); border-left-color: var(--green-600); }
.doc-side a.active {
  color: var(--green-700); font-weight: 600;
  border-left-color: var(--gold);
}

/* ---- main content ---- */
.doc-main { padding: 40px 0 0; min-width: 0; }
.doc-section { padding: 28px 0 54px; border-bottom: 1px solid rgba(16, 108, 67, 0.12); scroll-margin-top: 96px; }
.doc-section:last-child { border-bottom: none; }
.doc-section > .doc-eyebrow .hair { background: var(--gold-bronze); }
.doc-section > .doc-eyebrow .label { color: var(--gold-amber); }

.doc-h2 {
  font-family: 'Newsreader', serif;
  font-weight: 500;
  font-size: clamp(30px, 3.4vw, 42px);
  line-height: 1.08;
  letter-spacing: -0.02em;
  color: var(--green-700);
  margin: 16px 0 16px;
  text-wrap: balance;
}
.doc-h3 {
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  font-size: 1.16rem;
  color: var(--green-700);
  margin: 30px 0 10px;
}
.doc-p {
  font-size: 1.04rem; line-height: 1.78;
  color: var(--text-muted-light);
  margin: 0 0 16px; max-width: 680px;
  text-wrap: pretty;
}
.doc-p strong { color: var(--green-700); font-weight: 600; }
.doc-p a { color: var(--green-600); text-decoration: none; border-bottom: 1px solid rgba(16, 108, 67, 0.3); }
.doc-p a:hover { color: var(--gold-deep); border-bottom-color: var(--gold-deep); }

.doc-list { list-style: none; margin: 8px 0 18px; max-width: 680px; }
.doc-list li {
  position: relative;
  padding: 6px 0 6px 26px;
  font-size: 1.02rem; line-height: 1.7;
  color: var(--text-muted-light);
}
.doc-list li::before {
  content: ""; position: absolute;
  left: 2px; top: 15px;
  width: 7px; height: 7px; border-radius: 2px;
  background: var(--gold); transform: rotate(45deg);
}
.doc-list li strong { color: var(--green-700); font-weight: 600; }

/* ---- callout / note box ---- */
.doc-note {
  display: flex; gap: 14px;
  background: rgba(16, 108, 67, 0.06);
  border-left: 3px solid var(--green-600);
  border-radius: 0 12px 12px 0;
  padding: 18px 22px;
  margin: 22px 0;
  max-width: 680px;
}
.doc-note.gold { background: rgba(253, 191, 45, 0.1); border-left-color: var(--gold-deep); }
.doc-note .doc-note-ic { flex: none; color: var(--green-600); margin-top: 1px; }
.doc-note.gold .doc-note-ic { color: var(--gold-deep); }
.doc-note p { margin: 0; font-size: 0.96rem; line-height: 1.65; color: var(--text-dark); }
.doc-note p strong { color: var(--green-700); }

/* ---- feature / format cards ---- */
.doc-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px; margin: 22px 0 8px;
}
.doc-card {
  background: #fff;
  border: 1px solid rgba(16, 108, 67, 0.1);
  border-radius: 16px;
  padding: 22px 20px;
  box-shadow: 0 8px 24px rgba(16, 108, 67, 0.05);
  transition: transform .2s ease, box-shadow .2s ease;
}
.doc-card:hover { transform: translateY(-3px); box-shadow: 0 16px 36px rgba(16, 108, 67, 0.1); }
.doc-card-ic {
  width: 44px; height: 44px; border-radius: 12px;
  background: rgba(16, 108, 67, 0.08);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 14px;
}
.doc-card strong { display: block; font-size: 1.02rem; font-weight: 700; color: var(--green-700); margin-bottom: 6px; }
.doc-card p { font-size: 0.88rem; line-height: 1.55; color: var(--text-muted-light); margin: 0; }
.doc-card .doc-tag {
  display: inline-block; margin-top: 12px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.66rem; letter-spacing: 0.08em;
  color: var(--gold-amber);
  background: rgba(253, 191, 45, 0.14);
  padding: 3px 9px; border-radius: 6px;
}

/* ---- format pill table ---- */
.doc-fmt {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 28px; margin: 22px 0; max-width: 700px;
}
.doc-fmt-col strong {
  display: block;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.72rem; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--gold-amber); margin-bottom: 12px;
}
.doc-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.doc-pill {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.8rem; font-weight: 500;
  color: var(--green-700);
  background: #fff;
  border: 1px solid rgba(16, 108, 67, 0.16);
  border-radius: 8px; padding: 7px 12px;
}

/* ---- steps ---- */
.doc-steps { counter-reset: step; margin: 20px 0; max-width: 680px; }
.doc-step {
  position: relative;
  padding: 4px 0 24px 52px;
  border-left: 1px solid rgba(16, 108, 67, 0.18);
  margin-left: 16px;
}
.doc-step:last-child { border-left-color: transparent; padding-bottom: 4px; }
.doc-step::before {
  counter-increment: step; content: counter(step);
  position: absolute; left: -16px; top: -2px;
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), var(--gold-deep));
  color: #10331f; font-weight: 800; font-size: 0.92rem;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 16px -6px rgba(253, 191, 45, 0.7);
}
.doc-step h4 { font-size: 1.04rem; font-weight: 700; color: var(--green-700); margin: 0 0 5px; }
.doc-step p { font-size: 0.96rem; line-height: 1.6; color: var(--text-muted-light); margin: 0; }

/* ---- keyboard shortcut table ---- */
.doc-kbd-table { width: 100%; max-width: 680px; border-collapse: collapse; margin: 18px 0; }
.doc-kbd-table tr { border-bottom: 1px solid rgba(16, 108, 67, 0.12); }
.doc-kbd-table td { padding: 13px 4px; font-size: 0.98rem; color: var(--text-muted-light); vertical-align: middle; }
.doc-kbd-table td:last-child { text-align: right; white-space: nowrap; }
kbd {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.8rem; font-weight: 600;
  color: var(--green-700);
  background: #fff;
  border: 1px solid rgba(16, 108, 67, 0.22);
  border-bottom-width: 2px;
  border-radius: 6px; padding: 4px 9px;
  margin-left: 5px;
}

/* ---- CTA band ---- */
.doc-cta {
  position: relative; overflow: hidden;
  background: radial-gradient(120% 120% at 80% 0%, var(--green-500) 0%, var(--green-700) 45%, var(--green-800) 100%);
  color: #fff; text-align: center;
  padding: 110px 48px;
}
.doc-cta-inner { position: relative; z-index: 1; max-width: 680px; margin: 0 auto; }
.doc-cta h2 {
  font-family: 'Newsreader', serif; font-weight: 500;
  font-size: clamp(32px, 4.4vw, 52px); line-height: 1.05;
  letter-spacing: -0.02em; color: #fff; margin: 14px 0 14px;
  text-wrap: balance;
}
.doc-cta p { font-size: 1.08rem; color: rgba(255, 255, 255, 0.78); margin: 0 auto 30px; max-width: 520px; }
.doc-cta .doc-eyebrow { justify-content: center; }
.doc-cta-btns { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.doc-btn-gold {
  display: inline-flex; align-items: center; gap: 9px;
  text-decoration: none;
  background: linear-gradient(135deg, var(--gold), var(--gold-deep));
  color: #10331f; font-weight: 700; font-size: 1.02rem;
  padding: 16px 32px; border-radius: 999px;
  box-shadow: 0 14px 36px -12px rgba(253, 191, 45, 0.85);
  transition: all .25s ease;
}
.doc-btn-gold:hover { transform: translateY(-2px); box-shadow: 0 20px 46px -12px rgba(253, 191, 45, 0.95); }
.doc-btn-outline {
  display: inline-flex; align-items: center; gap: 9px;
  text-decoration: none; background: transparent;
  border: 1px solid rgba(253, 191, 45, 0.4);
  color: #fff; font-weight: 600; font-size: 1.02rem;
  padding: 16px 32px; border-radius: 999px;
  transition: all .25s ease;
}
.doc-btn-outline:hover { border-color: var(--gold); background: rgba(253, 191, 45, 0.1); }

/* ---- mobile TOC toggle (hidden on desktop) ---- */
.doc-toc-toggle { display: none; }

/* ============ responsive ============ */
@media (max-width: 980px) {
  .doc-hero-inner { padding: 150px 22px 72px; }
  .doc-shell { grid-template-columns: 1fr; gap: 0; padding: 0 22px 30px; }

  .doc-side {
    position: static; max-height: none; overflow: visible;
    padding: 22px 0 0;
  }
  .doc-toc-toggle {
    display: flex; align-items: center; justify-content: space-between;
    width: 100%; cursor: pointer;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.74rem; letter-spacing: 0.16em; text-transform: uppercase;
    color: var(--green-700); font-weight: 600;
    background: #fff; border: 1px solid rgba(16, 108, 67, 0.16);
    border-radius: 12px; padding: 14px 18px;
  }
  .doc-side-nav { display: none; margin-top: 14px; }
  .doc-side-nav.open { display: block; }

  .doc-main { padding: 14px 0 0; }
  .doc-cta { padding: 80px 24px; }
}
