/* Buggins — docs.css : documentation layout + prose components */
* { box-sizing: border-box; }
body { margin: 0; }

/* ---- Top bar ---- */
.docs-top {
  position: sticky; top: 0; z-index: 50; height: 60px;
  display: flex; align-items: center; gap: 18px; padding: 0 22px;
  background: rgba(11, 15, 20, 0.82); backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.docs-top .brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.docs-top .brandmark { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 8px; background: var(--accent-grad); }
.docs-top .word { font-family: var(--font-display); font-weight: 700; font-size: 16px; }
.docs-top .docs-pill { font-size: 12px; color: var(--muted); border: 1px solid var(--border-strong); padding: 2px 9px; border-radius: 999px; }
.docs-top .spacer { flex: 1; }
.docs-top .top-link { color: var(--muted); text-decoration: none; font-size: 13.5px; font-weight: 600; padding: 7px 10px; border-radius: 8px; }
.docs-top .top-link:hover { color: var(--text); }
.docs-top .top-cta { background: var(--accent); color: #fff; padding: 8px 14px; border-radius: 9px; font-size: 13.5px; font-weight: 700; text-decoration: none; }
.docs-top .top-cta:hover { background: #0f8c80; }
.docs-burger { display: none; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; width: 36px; height: 36px; color: var(--text); cursor: pointer; }

/* ---- Shell grid ---- */
.docs-shell { display: grid; grid-template-columns: 256px minmax(0, 1fr) 232px; gap: 0; max-width: 1380px; margin: 0 auto; }

/* ---- Left nav ---- */
.docs-nav { position: sticky; top: 60px; align-self: start; height: calc(100vh - 60px); overflow-y: auto; padding: 26px 16px 60px 22px; border-right: 1px solid var(--border); }
.docs-nav .nav-group { margin-bottom: 22px; }
.docs-nav .nav-group > span { display: block; font-size: 11px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint); margin: 0 0 8px 10px; }
.docs-nav a { display: block; padding: 6px 10px; border-radius: 8px; font-size: 13.5px; color: var(--muted); text-decoration: none; line-height: 1.35; border-left: 2px solid transparent; }
.docs-nav a:hover { color: var(--text); background: var(--surface-2); }
.docs-nav a.active { color: var(--cyan); background: rgba(var(--violet-rgb), 0.10); border-left-color: var(--cyan); font-weight: 600; }

/* ---- Content ---- */
.docs-main { min-width: 0; padding: 40px clamp(24px, 4vw, 60px) 120px; }
.docs-main .crumb { font-size: 12.5px; color: var(--faint); margin-bottom: 10px; font-family: var(--mono); }
.docs-main h1 { font-family: var(--font-display); font-size: clamp(28px, 4vw, 38px); letter-spacing: -0.02em; margin: 0 0 14px; }
.docs-lede { font-size: 17px; color: var(--muted); line-height: 1.6; margin: 0 0 36px; max-width: 720px; }
.docs-main section { scroll-margin-top: 80px; padding-top: 18px; margin-bottom: 14px; }
.docs-main h2 { font-family: var(--font-display); font-size: 23px; letter-spacing: -0.01em; margin: 28px 0 14px; padding-bottom: 9px; border-bottom: 1px solid var(--border); }
.docs-main h3 { font-size: 16.5px; margin: 26px 0 10px; }
.docs-main p { font-size: 15px; line-height: 1.72; color: #c4cdd9; margin: 0 0 14px; max-width: 760px; }
.docs-main a.inline { color: var(--cyan); text-decoration: none; border-bottom: 1px solid rgba(var(--cyan-rgb), 0.4); }
.docs-main a.inline:hover { border-bottom-color: var(--cyan); }
.docs-main ul, .docs-main ol { margin: 0 0 16px; padding-left: 22px; max-width: 760px; }
.docs-main li { font-size: 15px; line-height: 1.7; color: #c4cdd9; margin-bottom: 7px; }
.docs-main strong { color: var(--text); font-weight: 650; }
.anchor { color: inherit; text-decoration: none; }
.anchor:hover::after { content: " #"; color: var(--faint); }

/* Code */
.docs-main code { font-family: var(--mono); font-size: 12.8px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px; padding: 1.5px 6px; color: #9fe9dd; }
.codeblock { position: relative; margin: 0 0 20px; max-width: 760px; }
.codeblock pre { background: #0a1016; border: 1px solid var(--border-strong); border-radius: 12px; padding: 16px 18px; overflow-x: auto; margin: 0; }
.codeblock pre code { background: none; border: none; padding: 0; color: #cdd9e5; font-size: 12.8px; line-height: 1.7; display: block; }
.codeblock .copy { position: absolute; top: 9px; right: 9px; background: var(--surface-3); border: 1px solid var(--border-strong); color: var(--muted); border-radius: 7px; font-size: 11.5px; font-weight: 600; padding: 4px 9px; cursor: pointer; font-family: var(--font); }
.codeblock .copy:hover { color: var(--text); }

/* Callouts */
.callout { display: flex; gap: 12px; padding: 13px 16px; border-radius: 12px; margin: 0 0 20px; max-width: 760px; border: 1px solid var(--border-strong); background: var(--surface); }
.callout .ci { flex: none; font-size: 15px; line-height: 1.5; }
.callout p { margin: 0; font-size: 13.8px; color: var(--muted); line-height: 1.6; }
.callout.tip { border-color: rgba(var(--cyan-rgb), 0.3); background: rgba(var(--violet-rgb), 0.07); }
.callout.note { border-color: var(--border-strong); }
.callout.warn { border-color: rgba(251, 191, 36, 0.35); background: rgba(251, 191, 36, 0.06); }
.callout.council { border-color: rgba(var(--cyan-rgb), 0.4); background: var(--accent-grad-soft); }
.callout b { color: var(--text); }

/* Pills for tier tags */
.tier-tag { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 9px; border-radius: 999px; vertical-align: middle; margin-left: 6px; }
.tier-tag.free { background: var(--surface-3); color: var(--muted); }
.tier-tag.fellowship { background: rgba(var(--violet-rgb), 0.18); color: #5eead4; border: 1px solid rgba(var(--violet-rgb), 0.4); }
.tier-tag.council { background: var(--accent-grad); color: #fff; }

/* Tables */
.docs-table { width: 100%; max-width: 760px; border-collapse: collapse; margin: 0 0 22px; font-size: 14px; }
.docs-table th, .docs-table td { text-align: left; padding: 10px 13px; border-bottom: 1px solid var(--border); }
.docs-table th { font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--faint); }
.docs-table td { color: #c4cdd9; }
.docs-table tr:last-child td { border-bottom: none; }
.docs-table .yes { color: #34d399; }
.docs-table .no { color: var(--faint); }

kbd { font-family: var(--mono); font-size: 11.5px; background: var(--surface-3); border: 1px solid var(--border-strong); border-bottom-width: 2px; border-radius: 6px; padding: 2px 7px; color: var(--text); }

.step-card { border: 1px solid var(--border); border-radius: 12px; padding: 16px 18px; margin: 0 0 14px; max-width: 760px; background: var(--surface); }
.step-card .sc-n { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 7px; background: var(--accent); color: #fff; font-weight: 700; font-size: 13px; margin-right: 9px; }
.step-card h3 { display: inline; margin: 0; font-size: 15.5px; }

.docs-foot { max-width: 760px; margin-top: 50px; padding-top: 22px; border-top: 1px solid var(--border); display: flex; justify-content: space-between; gap: 16px; }
.docs-foot a { color: var(--cyan); text-decoration: none; font-size: 14px; font-weight: 600; }
.docs-foot .nxt { text-align: right; }
.docs-foot small { display: block; color: var(--faint); font-size: 11.5px; font-weight: 500; margin-bottom: 2px; }

/* ---- Right TOC ---- */
.docs-toc { position: sticky; top: 60px; align-self: start; height: calc(100vh - 60px); overflow-y: auto; padding: 40px 22px 60px 8px; }
.docs-toc span { display: block; font-size: 11px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint); margin-bottom: 10px; }
.docs-toc a { display: block; font-size: 12.5px; color: var(--muted); text-decoration: none; padding: 4px 0 4px 12px; border-left: 2px solid var(--border); line-height: 1.4; }
.docs-toc a:hover { color: var(--text); }
.docs-toc a.active { color: var(--cyan); border-left-color: var(--cyan); }

/* ---- Responsive ---- */
@media (max-width: 1080px) {
  .docs-shell { grid-template-columns: 240px minmax(0, 1fr); }
  .docs-toc { display: none; }
}
@media (max-width: 800px) {
  .docs-burger { display: grid; place-items: center; }
  .docs-shell { grid-template-columns: minmax(0, 1fr); }
  .docs-nav {
    position: fixed; top: 60px; left: 0; bottom: 0; width: 280px; z-index: 60;
    background: var(--bg); transform: translateX(-100%); transition: transform 0.22s ease; height: auto;
  }
  .docs-nav.open { transform: none; }
  .docs-scrim { display: none; position: fixed; inset: 60px 0 0 0; background: rgba(0,0,0,0.5); z-index: 55; }
  .docs-scrim.show { display: block; }
}

/* ---- #docs route takes over the page ---- */
body.docs-mode .site-header,
body.docs-mode #marketing,
body.docs-mode #app,
body.docs-mode .site-footer { display: none !important; }
