@import url('https://fonts.googleapis.com/css2?family=DotGothic16&family=IBM+Plex+Mono:wght@400;500;600;700&family=IBM+Plex+Sans:ital,wght@0,400;0,500;1,400&display=swap');
/* ---------------------------------------------------------------------------
   Repainted to P1 Green.
   
   The legacy palette is remapped onto the P1 tokens rather than the markup
   being rewritten, because these files are token-driven and seventeen pages
   share them. One edit here moves every page.
   
   What this DOES achieve: ground, phosphor, rules, faces and the accent are
   the terminal system everywhere.
   
   What it does NOT: rule 1 says direction must be carried by a glyph, because
   green is already the text colour. Retrofitting ▲/▼ needs markup, so any page
   still signalling gain by hue alone is repainted but not yet compliant.
   --------------------------------------------------------------------------- */
/* ============================================================================
   docs.css: documentation chrome.

   Three columns on wide screens: navigation, content, contents rail. Collapses
   to a single column with a toggled drawer below 1000px. Generated pages share
   this one stylesheet; nothing is inlined per page.
   ========================================================================== */


:root {
  --paper: #050B07;
  --sunk: #091308;
  --ink: #7DFFA6;
  --ink-2: rgba(125,255,166,.84);
  --ink-3: rgba(125,255,166,.62);
  --ink-4: rgba(125,255,166,.42);
  --rule: rgba(125,255,166,.24);
  --rule-2: #1c242c;
  --accent: #3DE874;
  --accent-soft: rgba(92,201,139,.12);
  --flag: #e0a35a;
  --flag-soft: rgba(224,163,90,.10);
  --bad: #FF6B47;
  --sans: 'IBM Plex Sans', system-ui, sans-serif;
  --serif: 'IBM Plex Sans', system-ui, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, Menlo, monospace;
  --topbar: 56px;
  --r: 0px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--topbar) + 20px);
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15.5px;
  line-height: 1.68;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.skip {
  position: absolute;
  left: -9999px;
}

.skip:focus {
  left: 12px;
  top: 12px;
  z-index: 100;
  background: var(--accent);
  color: var(--paper);
  padding: 10px 14px;
  border-radius: 0;
}

/* ---------------------------------------------------------------- topbar */

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--topbar);
  background: rgba(11, 15, 20, 0.94);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--rule);
}

.topbar-in {
  height: 100%;
  max-width: 1500px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 15px;
  color: var(--ink);
  letter-spacing: -0.015em;
  white-space: nowrap;
}

.brand:hover {
  text-decoration: none;
}

.brand .dot {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #00ec97;
  border: 1px solid rgba(0, 0, 0, 0.12);
  flex: none;
}

.brand-sep {
  color: var(--ink-4);
}

.brand-docs {
  font-weight: 500;
  color: var(--ink-2);
  font-size: 15px;
}

.topbar-search {
  position: relative;
  margin-left: auto;
  width: min(300px, 38vw);
}

.topbar-search input {
  width: 100%;
  font-family: var(--sans);
  font-size: 13.5px;
  padding: 7px 11px;
  border: 1px solid var(--rule);
  border-radius: 0;
  background: var(--sunk);
  color: var(--ink);
}

.topbar-search input:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--sunk);
}

.results {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: min(460px, 86vw);
  background: var(--sunk);
  border: 1px solid var(--rule);
  border-radius: 0;
  box-shadow: none;
  overflow: hidden;
  z-index: 60;
}

.results a {
  display: block;
  padding: 10px 13px;
  border-bottom: 1px solid var(--rule-2);
  color: var(--ink);
}

.results a:last-child {
  border-bottom: 0;
}

.results a:hover {
  background: var(--sunk);
  text-decoration: none;
}

.results strong {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
}

.results span {
  display: block;
  font-size: 11px;
  color: var(--accent);
  margin: 1px 0 3px;
}

.results em {
  display: block;
  font-style: normal;
  font-size: 12px;
  color: var(--ink-3);
  line-height: 1.45;
}

.topbar-links {
  display: none;
  gap: 18px;
}

@media (min-width: 900px) {
  .topbar-links {
    display: flex;
  }
}

.topbar-links a {
  font-size: 13.5px;
  color: var(--ink-2);
}

.menu-btn {
  font-family: var(--sans);
  font-size: 13px;
  padding: 6px 11px;
  border: 1px solid var(--rule);
  border-radius: 0;
  background: var(--sunk);
  color: var(--ink-2);
  cursor: pointer;
}

@media (min-width: 1000px) {
  .menu-btn {
    display: none;
  }
}

/* ---------------------------------------------------------------- layout */

.layout {
  max-width: 1500px;
  margin: 0 auto;
  padding: 0 20px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
}

@media (min-width: 1000px) {
  .layout {
    grid-template-columns: 250px minmax(0, 1fr);
    gap: 44px;
  }
}

@media (min-width: 1320px) {
  .layout {
    grid-template-columns: 250px minmax(0, 1fr) 210px;
  }
}

/* --------------------------------------------------------------- sidebar */

.sidebar {
  display: none;
  position: sticky;
  top: var(--topbar);
  align-self: start;
  max-height: calc(100vh - var(--topbar));
  overflow-y: auto;
  padding: 26px 0 60px;
  scrollbar-width: thin;
}

@media (min-width: 1000px) {
  .sidebar {
    display: block;
  }
}

.sidebar.open {
  display: block;
  position: fixed;
  inset: var(--topbar) 0 0 0;
  background: var(--paper);
  z-index: 45;
  padding: 20px;
  max-height: none;
}

.nav-group {
  margin-bottom: 20px;
}

.nav-group h3 {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-4);
  margin: 0 0 7px;
}

.nav-group ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-group li {
  margin: 0;
}

.nav-group a {
  display: block;
  padding: 4.5px 10px 4.5px 11px;
  font-size: 13.5px;
  color: var(--ink-2);
  border-left: 2px solid transparent;
  border-radius: 0 var(--r) var(--r) 0;
  line-height: 1.45;
}

.nav-group a:hover {
  color: var(--ink);
  background: var(--sunk);
  text-decoration: none;
}

.nav-group a[aria-current='page'] {
  color: var(--accent);
  font-weight: 600;
  border-left-color: var(--accent);
  background: var(--accent-soft);
}

/* --------------------------------------------------------------- content */

main {
  min-width: 0;
  padding: 26px 0 90px;
  max-width: 45rem;
}

.crumbs {
  font-size: 12.5px;
  color: var(--ink-3);
  margin-bottom: 18px;
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  align-items: center;
}

.crumbs a {
  color: var(--ink-3);
}

.crumbs em {
  font-style: normal;
  color: var(--ink);
}

.crumbs span {
  color: var(--ink-4);
}

article h1 {
  font-family: var(--sans);
  font-size: clamp(1.7rem, 3.4vw, 2.15rem);
  font-weight: 600;
  letter-spacing: -0.024em;
  line-height: 1.15;
  margin: 0 0 10px;
}

.blurb {
  font-size: 1.04rem;
  color: var(--ink-3);
  margin: 0 0 34px;
  line-height: 1.55;
  max-width: 40rem;
}

article h2 {
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  margin: 2.6rem 0 0.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
  scroll-margin-top: calc(var(--topbar) + 16px);
}

article h3 {
  font-size: 1rem;
  font-weight: 600;
  margin: 1.9rem 0 0.5rem;
  scroll-margin-top: calc(var(--topbar) + 16px);
}

article h4 {
  font-size: 0.9rem;
  font-weight: 600;
  margin: 1.5rem 0 0.4rem;
}

article p {
  margin: 0 0 1.05rem;
  max-width: 42rem;
}

article ul,
article ol {
  margin: 0 0 1.1rem;
  padding-left: 1.3rem;
  max-width: 42rem;
}

article li {
  margin-bottom: 0.4rem;
}

article strong {
  font-weight: 600;
  color: var(--ink);
}

code {
  font-family: var(--mono);
  font-size: 0.855em;
  background: var(--sunk);
  border: 1px solid var(--rule-2);
  padding: 0.09em 0.34em;
  border-radius: 0;
  color: var(--ink);
}

.num {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-size: 0.9em;
}

/* --------------------------------------------------------------- figures */

.eq {
  margin: 1.5rem 0;
  padding: 0.9rem 1.1rem;
  background: var(--sunk);
  border: 1px solid var(--rule-2);
  border-radius: 0;
  overflow-x: auto;
}

math {
  font-size: 1.04rem;
}

.listing {
  margin: 1.4rem 0;
  border: 1px solid var(--rule);
  border-radius: 0;
  overflow: hidden;
  max-width: 44rem;
}

.listing-head {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
  padding: 6px 12px;
  background: var(--sunk);
  border-bottom: 1px solid var(--rule);
  font-family: var(--mono);
}

.listing pre {
  margin: 0;
  padding: 13px 14px;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 12.4px;
  line-height: 1.62;
  color: var(--ink-2);
}

.listing .c {
  color: var(--ink-4);
}

.listing .v {
  color: var(--accent);
}

.listing .x {
  color: var(--bad);
}

.tablewrap {
  overflow-x: auto;
  margin: 1.4rem 0;
  max-width: 44rem;
}

table {
  border-collapse: collapse;
  width: 100%;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

caption {
  caption-side: bottom;
  text-align: left;
  font-size: 12.5px;
  color: var(--ink-3);
  padding-top: 9px;
  line-height: 1.5;
}

th {
  text-align: left;
  font-weight: 600;
  border-bottom: 1.5px solid var(--ink);
  padding: 7px 14px 7px 0;
  white-space: nowrap;
}

td {
  padding: 6px 14px 6px 0;
  border-bottom: 1px solid var(--rule-2);
  color: var(--ink-2);
  vertical-align: top;
}

td.r,
th.r {
  text-align: right;
  padding-right: 0;
}

td.r {
  font-family: var(--mono);
  font-size: 0.95em;
}

td.k {
  font-family: var(--mono);
  font-size: 0.95em;
  color: var(--ink);
}

/* -------------------------------------------------------------- callouts */

.hint {
  margin: 1.4rem 0;
  padding: 0.85rem 1.05rem;
  border-radius: 0;
  border: 1px solid var(--rule);
  border-left: 3px solid var(--ink-4);
  background: var(--sunk);
  font-size: 0.94rem;
  max-width: 42rem;
}

.hint.result {
  border-left-color: var(--accent);
  background: var(--accent-soft);
  border-color: rgba(92,201,139,.35);
}

.hint.warn {
  border-left-color: var(--flag);
  background: var(--flag-soft);
  border-color: rgba(224,163,90,.35);
}

.hint .lab {
  display: block;
  font-size: 10.5px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 5px;
  font-weight: 600;
}

.hint p:last-child {
  margin-bottom: 0;
}

dl.sig {
  display: grid;
  grid-template-columns: minmax(7rem, auto) 1fr;
  gap: 0.3rem 1.1rem;
  margin: 1rem 0 1.4rem;
  font-size: 0.93rem;
  max-width: 42rem;
}

dl.sig dt {
  font-family: var(--mono);
  font-size: 0.86rem;
  color: var(--ink);
}

dl.sig dd {
  margin: 0;
  color: var(--ink-2);
}

/* ----------------------------------------------------------------- pager */

.pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 3.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
}

.pager a {
  display: block;
  padding: 12px 15px;
  border: 1px solid var(--rule);
  border-radius: 0;
  color: var(--ink);
}

.pager a:hover {
  border-color: var(--accent);
  text-decoration: none;
}

.pager .next {
  text-align: right;
}

.pager span {
  display: block;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-4);
  margin-bottom: 3px;
}

.pager strong {
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
}

/* --------------------------------------------------------- contents rail */

.onthispage {
  display: none;
}

@media (min-width: 1320px) {
  .onthispage {
    display: block;
    position: sticky;
    top: var(--topbar);
    align-self: start;
    padding: 28px 0 60px;
    max-height: calc(100vh - var(--topbar));
    overflow-y: auto;
  }
}

.onthispage h4 {
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-4);
  margin: 0 0 8px;
  font-weight: 600;
}

.onthispage ul {
  list-style: none;
  margin: 0;
  padding: 0;
  border-left: 1px solid var(--rule);
}

.onthispage li {
  margin: 0;
}

.onthispage a {
  display: block;
  padding: 3.5px 0 3.5px 12px;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--ink-3);
  margin-left: -1px;
  border-left: 1px solid transparent;
}

.onthispage a:hover {
  color: var(--ink);
  text-decoration: none;
}

.onthispage a.on {
  color: var(--accent);
  border-left-color: var(--accent);
}

.onthispage .lvl-h3 a {
  padding-left: 24px;
  font-size: 12px;
}

/* ----------------------------------------------------------- docs index */

.group {
  margin-bottom: 2.6rem;
}

.group h2 {
  border-top: 0;
  padding-top: 0;
  margin-top: 0;
  font-size: 1.05rem;
}

.cards {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  max-width: 44rem;
}

.card {
  display: block;
  padding: 13px 15px;
  border: 1px solid var(--rule);
  border-radius: 0;
  color: var(--ink);
}

.card:hover {
  border-color: var(--accent);
  text-decoration: none;
  background: var(--accent-soft);
}

.card strong {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 3px;
}

.card span {
  display: block;
  font-size: 12.5px;
  color: var(--ink-3);
  line-height: 1.5;
}

@media print {
  .topbar, .sidebar, .onthispage, .pager, .crumbs { display: none; }
  .layout { grid-template-columns: 1fr; }
}
