/* nullwave fm1's guide and manual: finding your way (tools/site_look.py). Only the site's tokens (style.css); new
   pieces the website may take over: a contents sidebar, a contents sheet on phones, heading anchors, previous / next
   section links. */
.nw-docwrap{max-width:1120px;margin:0 auto;padding:0 32px;display:grid;grid-template-columns:220px minmax(0,1fr);gap:64px}
.nw-docwrap>*{min-width:0}
.nw-docwrap>.nw-page{max-width:760px;margin:0;padding:72px 0 96px}

/* the sidebar: every section, the one you're in marked */
.nw-toc{position:sticky;top:64px;align-self:start;max-height:calc(100vh - 64px);overflow:auto;padding:72px 4px 40px 0;
  overscroll-behavior:contain}
.nw-toc .kicker{margin-bottom:16px}
.nw-toc ol{list-style:none;margin:0;padding:0}
.nw-toc li{margin:0}
.nw-toc a{display:block;padding:5px 0 5px 14px;border-left:1px solid var(--line);color:var(--dim);font-size:14px;
  line-height:1.4;transition:color .2s,border-color .2s}
.nw-toc a:hover{color:var(--fg)}
.nw-toc a[aria-current="true"]{color:var(--fg);border-left-color:var(--red)}
.nw-toc ol ol a{padding-left:28px;font-size:13px}
.nw-toc .n{font:12px var(--mono);color:var(--faint);margin-right:8px}

/* phones: a bar under the nav with the section you're in, and the contents as a sheet */
.nw-bar{display:none}
.nw-sheet{position:fixed;inset:auto 0 0 0;margin:0;width:100%;max-width:none;max-height:82vh;padding:20px 20px 28px;
  border:0;border-top:1px solid var(--edge);border-radius:16px 16px 0 0;background:var(--bg);color:var(--fg)}
.nw-sheet::backdrop{background:color-mix(in srgb,var(--bg) 60%,transparent)}
.nw-sheet .top{display:flex;justify-content:space-between;align-items:center;margin-bottom:12px}
.nw-sheet .nw-toc{position:static;max-height:none;padding:0;overflow:visible}

/* each heading's own link, and the way on at a section's end */
.nw-doc h2,.nw-doc h3{scroll-margin-top:88px}
.nw-anchor{margin-left:10px;color:var(--faint);font-weight:400;opacity:0;transition:opacity .2s}
.nw-doc h2:hover .nw-anchor,.nw-doc h3:hover .nw-anchor,.nw-anchor:focus-visible{opacity:1}
.nw-pn{display:flex;justify-content:space-between;align-items:baseline;gap:16px;margin:56px 0 0;padding-top:18px;
  border-top:1px solid var(--line);font-size:14px}
.nw-pn a{color:var(--dim);transition:color .2s}
.nw-pn a:hover{color:var(--fg)}
.nw-pn .up{font:12px var(--mono);letter-spacing:.06em;text-transform:uppercase;color:var(--faint)}
.nw-pn .next{text-align:right}
.nw-doc nav.contents{display:none}   /* (the sidebar and the sheet have it) */

@media(max-width:960px){
  .nw-docwrap{grid-template-columns:1fr;gap:0;padding:0 20px}
  .nw-docwrap>.nw-toc{display:none}
  .nw-docwrap>.nw-page{padding:32px 0 72px}
  .nw-bar{display:flex;position:sticky;top:64px;z-index:9;align-items:center;justify-content:space-between;gap:12px;
    margin:0 -20px;padding:10px 20px;background:color-mix(in srgb,var(--bg) 92%,transparent);
    backdrop-filter:blur(14px);-webkit-backdrop-filter:blur(14px);border-bottom:1px solid var(--line)}
  .nw-bar .here{flex:1;min-width:0;font:12px var(--mono);letter-spacing:.06em;text-transform:uppercase;color:var(--dim);
    white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .nw-bar button{flex:none}
  .nw-bar button,.nw-sheet button{min-height:36px;padding:0 16px;border-radius:999px;border:1px solid var(--edge);
    background:none;color:var(--fg);font:500 14px var(--sans);cursor:pointer}
  .nw-doc h2,.nw-doc h3{scroll-margin-top:128px}
  .nw-anchor{opacity:1}
}
@media(prefers-reduced-motion:reduce){.nw-toc a,.nw-anchor,.nw-pn a{transition:none}}
.nw-sheet .nw-toc .kicker{display:none}
