/* ─────────────────────────────────────────────────────────────────────────
   The documentation site.

   Reuses the app's tokens from style.css - same blue, same grey, same
   hairlines - so the docs read as part of the product rather than as a
   separate thing bolted on. Everything here is layout and prose styling; no
   colours are invented.

   No build step: the sidebar is rendered by docs.js from one list, so adding
   a page means adding a file and a line, not editing thirteen navigations.
   ───────────────────────────────────────────────────────────────────────── */

body { background: var(--bg); }

.docshell { display: grid; grid-template-columns: 262px minmax(0, 1fr); }

/* ── the rail ──────────────────────────────────────────────────────────── */

.docnav {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  padding: 20px 0 40px;
  border-right: 1px solid var(--hair-2);
  background: var(--surface);
}
.docnav .brand { display: block; padding: 0 22px 18px; }
.docnav .brand img { height: 30px; width: auto; display: block; }

.docnav .grp {
  font-size: 11px; font-weight: 700; letter-spacing: 0.05em;
  text-transform: uppercase; color: var(--ink-3);
  padding: 18px 22px 6px;
}
.docnav a {
  display: block; padding: 7px 22px;
  font-size: 13.5px; color: var(--ink-2); text-decoration: none;
  border-left: 2px solid transparent;
  transition: background 140ms var(--ease), color 140ms var(--ease);
}
.docnav a:hover { background: rgba(38, 37, 37, 0.04); color: var(--ink); }
.docnav a.on {
  color: var(--accent-ink); font-weight: 600;
  background: var(--accent-dim); border-left-color: var(--accent);
}
.docnav .back {
  margin: 4px 22px 0; padding-top: 14px;
  border-top: 1px solid var(--hair-2);
  font-size: 12.5px;
}

/* ── the page ──────────────────────────────────────────────────────────── */

.docmain { min-width: 0; }

.docbar {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 40px;
  border-bottom: 1px solid var(--hair-2);
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  position: sticky; top: 0; z-index: 5;
  font-size: 13px; color: var(--ink-3);
}
.docbar b { color: var(--ink); font-weight: 600; }
.docbar .spacer { flex: 1; }

article {
  max-width: 760px; padding: 40px 40px 120px;
  font-size: 15.5px; line-height: 1.68; color: var(--ink);
}

article h1 {
  font-size: 32px; line-height: 1.16; letter-spacing: -0.025em;
  font-weight: 700; margin: 0 0 10px;
}
article .lede {
  font-size: 17px; line-height: 1.6; color: var(--ink-2);
  margin: 0 0 34px;
}
article h2 {
  font-size: 21px; letter-spacing: -0.02em; font-weight: 650;
  margin: 44px 0 10px; scroll-margin-top: 70px;
}
article h3 {
  font-size: 16px; letter-spacing: -0.01em; font-weight: 650;
  margin: 28px 0 8px;
}
article p { margin: 0 0 15px; }
article ul, article ol { margin: 0 0 15px; padding-left: 22px; }
article li { margin-bottom: 8px; }
article li > ul, article li > ol { margin-top: 8px; }
article a { color: var(--accent-ink); }

article code {
  font-family: "SF Mono", "Cascadia Mono", ui-monospace, Consolas, monospace;
  font-size: 0.87em; background: var(--surface);
  border: 1px solid var(--hair-2); border-radius: 5px; padding: 1px 5px;
}
article pre {
  background: var(--console); color: #d8d6d6;
  border-radius: var(--r); padding: 16px 18px; overflow-x: auto;
  font-family: "SF Mono", "Cascadia Mono", ui-monospace, Consolas, monospace;
  font-size: 12.8px; line-height: 1.7; margin: 0 0 18px;
}
article pre code { background: none; border: 0; padding: 0; font-size: inherit; color: inherit; }
article pre .c { color: #8e8b8b; }
article pre .s { color: #9fe0b4; }
article pre .k { color: var(--soft); }

/* a step someone follows, numbered by the browser */
article ol.steps { counter-reset: step; list-style: none; padding-left: 0; }
article ol.steps > li {
  counter-increment: step; position: relative;
  padding-left: 42px; margin-bottom: 20px;
}
article ol.steps > li::before {
  content: counter(step);
  position: absolute; left: 0; top: 1px;
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--elevated); color: var(--accent-ink);
  font-size: 12.5px; font-weight: 700;
  display: grid; place-items: center;
}
article ol.steps > li > b { display: block; margin-bottom: 2px; }

/* call-outs, reusing the app's banner colours */
article .note {
  border: 1px solid var(--hair); border-left-width: 3px;
  border-radius: 0 var(--r) var(--r) 0;
  background: var(--surface);
  padding: 14px 17px; margin: 0 0 18px;
  font-size: 14.5px; line-height: 1.62;
}
article .note > b { display: block; margin-bottom: 3px; }
article .note > :last-child { margin-bottom: 0; }
article .note.warn { border-left-color: var(--warn); background: #fffaf0; }
article .note.warn > b { color: var(--warn-ink); }
article .note.stop { border-left-color: var(--err); background: #fff5f6; }
article .note.stop > b { color: var(--err-ink); }
article .note.ok { border-left-color: var(--ok); background: #f4fdf8; }
article .note.ok > b { color: var(--ok-ink); }
article .note.info { border-left-color: var(--accent); background: var(--accent-dim); }
article .note.info > b { color: var(--accent-ink); }

article table {
  width: 100%; border-collapse: collapse; margin: 0 0 20px; font-size: 14.2px;
}
article th {
  text-align: left; font-size: 11.5px; font-weight: 700;
  letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-3);
  padding: 0 14px 8px 0; border-bottom: 1px solid var(--hair);
}
article td {
  padding: 11px 14px 11px 0; border-bottom: 1px solid var(--hair-2);
  vertical-align: top; color: var(--ink-2);
}
article td:first-child { color: var(--ink); font-weight: 500; }

/* the contents grid on the docs home */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; margin-bottom: 26px; }
.cards a {
  display: block; text-decoration: none; color: inherit;
  border: 1px solid var(--hair); border-radius: var(--r-lg);
  background: var(--surface); padding: 17px 18px;
  box-shadow: var(--shadow-1);
  transition: transform 160ms var(--ease), box-shadow 160ms var(--ease), border-color 160ms var(--ease);
}
.cards a:hover {
  border-color: var(--soft); transform: translateY(-2px);
  box-shadow: 0 1px 2px rgba(38, 37, 37, 0.05), 0 18px 40px -20px rgba(1, 166, 255, 0.35);
}
.cards b { display: block; font-size: 14.5px; margin-bottom: 4px; letter-spacing: -0.01em; }
.cards span { font-size: 13px; color: var(--ink-3); line-height: 1.5; }

/* previous / next */
.docfoot {
  display: flex; gap: 12px; justify-content: space-between;
  margin-top: 52px; padding-top: 22px; border-top: 1px solid var(--hair-2);
}
.docfoot a {
  flex: 1; text-decoration: none; color: inherit;
  border: 1px solid var(--hair); border-radius: var(--r);
  background: var(--surface); padding: 12px 15px; box-shadow: var(--shadow-1);
}
.docfoot a.next { text-align: right; }
.docfoot span { display: block; font-size: 11.5px; color: var(--ink-3); margin-bottom: 2px; }
.docfoot b { font-size: 14px; font-weight: 600; letter-spacing: -0.01em; }

@media (max-width: 900px) {
  .docshell { grid-template-columns: 1fr; }
  .docnav {
    position: static; height: auto;
    border-right: 0; border-bottom: 1px solid var(--hair-2);
    padding-bottom: 12px;
  }
  .docbar { padding: 10px 20px; }
  article { padding: 26px 20px 90px; }
  article h1 { font-size: 26px; }
}
