/* Trenchfly docs — the same lab-instrument world as the live page, laid out to be read.
   Near-black ground, hairline rules, measured values in mono. Orange / blue / grey stay
   reserved for neural state and are not used here at all. */

:root {
  --ink: #0a0b0d;
  --panel: #101218;
  --rule: #1e222b;
  --rule-bright: #2b313d;
  --text: #e8eaee;
  --text-dim: #9aa1ae;
  --text-faint: #7c8494;
  --accent: #d9c7a6;         /* a warm paper tone for links and the current page; not neural orange */
  --up: #5fd39a;
  --down: #e2607a;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: "Geist", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --gutter: 24px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { background: var(--ink); }
body {
  margin: 0;
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
::selection { background: rgba(217, 199, 166, 0.28); color: #fff; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--rule-bright); }
:focus-visible { outline: 1px solid var(--accent); outline-offset: 2px; }

.docs {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  grid-template-rows: 52px 1fr;
  grid-template-areas: "top top" "nav main";
  min-height: 100vh;
}

.docs-top {
  grid-area: top;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 var(--gutter);
  border-bottom: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
}
.mark { color: var(--text); text-decoration: none; font-weight: 500; }
.docs-top-sep { color: var(--rule-bright); }
.docs-top-here { color: var(--text-dim); }
.docs-live {
  margin-left: auto;
  color: var(--text-dim);
  text-decoration: none;
  border: 1px solid var(--rule-bright);
  padding: 4px 10px;
  letter-spacing: 0.06em;
}
.docs-live:hover { color: var(--text); border-color: var(--text-dim); }

.docs-nav {
  grid-area: nav;
  position: sticky;
  top: 52px;
  align-self: start;
  display: flex;
  flex-direction: column;
  padding: 20px 0 20px var(--gutter);
  border-right: 1px solid var(--rule);
  min-height: calc(100vh - 52px);
}
.docs-nav a {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 13.5px;
  padding: 7px 14px 7px 12px;
  border-left: 1px solid transparent;
  margin-left: -1px;
}
.docs-nav a:hover { color: var(--text); }
.docs-nav a[aria-current="page"] { color: var(--text); border-left-color: var(--accent); }

.docs-main { grid-area: main; min-width: 0; }

.prose {
  max-width: 72ch;
  padding: 48px var(--gutter) 64px 48px;
}
.prose h1 {
  font-size: 34px;
  line-height: 1.15;
  letter-spacing: -0.02em;
  font-weight: 600;
  margin: 0 0 20px;
  text-wrap: balance;
}
.prose h2 {
  font-size: 21px;
  line-height: 1.25;
  letter-spacing: -0.01em;
  font-weight: 600;
  margin: 44px 0 12px;
  padding-top: 20px;
  border-top: 1px solid var(--rule);
  text-wrap: balance;
}
.prose h3 { font-size: 16px; font-weight: 600; margin: 28px 0 8px; }
.prose p { margin: 0 0 14px; }
.prose p:first-of-type { color: var(--text); }
.prose a { color: var(--accent); text-decoration: none; border-bottom: 1px solid rgba(217, 199, 166, 0.35); }
.prose a:hover { border-bottom-color: var(--accent); }
.prose strong { font-weight: 600; color: var(--text); }
.prose em { font-style: italic; }
.prose ul, .prose ol { padding-left: 22px; margin: 0 0 14px; }
.prose li { margin: 4px 0; }
.prose li::marker { color: var(--text-faint); }
.prose hr { border: 0; border-top: 1px solid var(--rule); margin: 32px 0; }
.prose blockquote { margin: 16px 0; padding: 2px 0 2px 16px; border-left: 1px solid var(--rule-bright); color: var(--text-dim); }

.prose code {
  font-family: var(--mono);
  font-size: 0.86em;
  color: var(--text);
  background: var(--panel);
  padding: 1px 5px;
  border: 1px solid var(--rule);
}
.prose pre {
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.55;
  background: var(--panel);
  border: 1px solid var(--rule);
  padding: 14px 16px;
  overflow-x: auto;
  margin: 0 0 16px;
}
.prose pre code { background: none; border: 0; padding: 0; font-size: inherit; }

/* Tables are the reports. Mono numerals, hairlines, no zebra: what a lab notebook does. */
.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 14px 0 18px;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  display: block;
  overflow-x: auto;
}
.prose th, .prose td { padding: 7px 10px 7px 0; text-align: left; vertical-align: top; border-bottom: 1px solid var(--rule); }
.prose th { font-weight: 500; color: var(--text-dim); font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; }
.prose td { font-family: var(--mono); font-size: 12.5px; color: var(--text); white-space: nowrap; }
.prose td:first-child { white-space: normal; }

.prose video { display: block; width: 100%; max-width: 100%; border: 1px solid var(--rule); background: #000; margin: 8px 0 8px; }
.caption { font-size: 12.5px; color: var(--text-faint); margin: 6px 0 24px !important; }

.credit {
  padding: 16px var(--gutter) 24px 48px;
  border-top: 1px solid var(--rule);
  font-size: 11px;
  line-height: 1.6;
  color: var(--text-faint);
  max-width: 72ch;
}
.credit a { color: var(--text-dim); text-decoration: none; border-bottom: 1px solid var(--rule-bright); }
.credit-links { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.credit-ca {
  font: inherit; font-family: var(--mono); font-size: 10px; letter-spacing: 0.04em;
  color: var(--text-dim); background: none; border: 1px solid var(--rule-bright);
  padding: 3px 7px; cursor: pointer; display: inline-flex; gap: 6px; align-items: baseline; max-width: 100%;
}
.credit-ca code { font: inherit; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 260px; }
.credit-ca:hover { border-color: var(--text-dim); }
.credit-ca[data-copied="1"] { color: var(--up); border-color: var(--up); }
.credit-x { display: inline-flex; color: var(--text-dim); padding: 4px; border: 0; }
.credit-x:hover { color: var(--text); }

@media (max-width: 760px) {
  .docs { grid-template-columns: 1fr; grid-template-areas: "top" "nav" "main"; }
  .docs-nav { position: static; flex-direction: row; flex-wrap: wrap; gap: 2px 10px; min-height: 0; padding: 10px var(--gutter); border-right: 0; border-bottom: 1px solid var(--rule); }
  .docs-nav a { border-left: 0; padding: 4px 0; margin: 0; }
  .docs-nav a[aria-current="page"] { text-decoration: underline; text-underline-offset: 4px; }
  .prose, .credit { padding-left: var(--gutter); }
  .prose h1 { font-size: 28px; }
}
