/* benchControlPlatform site. Colours are the app's theme tokens. */

@font-face {
  font-family: "Inter";
  src: url("/assets/fonts/Inter-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("/assets/fonts/Inter-SemiBold.ttf") format("truetype");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("/assets/fonts/JetBrainsMono-Medium.ttf") format("truetype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg0: #0b0c0e;
  --bg1: #131517;
  --bg2: #1a1d20;
  --bg3: #23272c;
  --line: #272b31;
  --line2: #1b1e22;
  --text: #e9ebee;
  --text2: #a4abb5;
  --text3: #69717d;
  --ok: #3ddc97;
  --warn: #f7b955;
  --bad: #ff6b6b;
  --plot: #070809;
  --series-v: #9ec1ff;
  --series-a: #ffa970;
  --series-w: #c8adff;

  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

  --wrap: 1200px;
  --gutter: 16px;
  --radius: 4px;
  color-scheme: dark;
}

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

html {
  background: var(--bg0);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg0);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  overflow-wrap: break-word;
}

img, svg { display: block; max-width: 100%; height: auto; }

a { color: var(--text); text-decoration: underline; text-decoration-color: var(--text3); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--ok); }

:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--ok);
  outline-offset: 2px;
  border-radius: 2px;
}

code, kbd, pre, .mono { font-family: var(--mono); font-weight: 500; font-variant-ligatures: none; font-feature-settings: "calt" 0, "liga" 0; }
code { font-size: 0.875em; color: var(--text); background: var(--bg2); border: 1px solid var(--line2); border-radius: 3px; padding: 0.05em 0.35em; }
kbd { font-size: 0.8em; color: var(--text); background: var(--bg3); border: 1px solid var(--line); border-radius: 3px; padding: 0.05em 0.4em; }

.skip {
  position: absolute; left: -9999px; top: 8px;
  background: var(--bg2); color: var(--text); padding: 8px 12px; border: 1px solid var(--ok); z-index: 10;
}
.skip:focus { left: 8px; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
@media (min-width: 720px) { :root { --gutter: 32px; } }

/* ---------- header: a bar like the app's tab bar ---------- */
.site-head { background: var(--bg1); border-bottom: 1px solid var(--line); }
.site-head .wrap {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 8px 24px; padding-top: 10px; padding-bottom: 10px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 600; letter-spacing: -0.01em; }
.brand img { width: 28px; height: 28px; border-radius: 3px; }
.brand:hover { color: var(--text); }
.nav ul { display: flex; flex-wrap: wrap; gap: 4px; margin: 0; padding: 0; list-style: none; }
.nav a {
  display: block; padding: 4px 10px; border: 1px solid transparent; border-radius: var(--radius);
  color: var(--text2); text-decoration: none; font-size: 14px;
}
.nav a:hover { color: var(--text); border-color: var(--line); }
.nav a[aria-current="page"] { color: var(--text); background: var(--bg3); border-color: var(--line); }
.nav .ext::after { content: " (external)"; position: absolute; left: -9999px; }

/* ---------- type ---------- */
h1, h2, h3 { font-weight: 600; letter-spacing: -0.015em; line-height: 1.2; margin: 0; }
h1 { font-size: clamp(32px, 6vw, 56px); letter-spacing: -0.03em; }
h2 { font-size: clamp(22px, 3vw, 28px); }
h3 { font-size: 18px; }
p, ul, ol, dl { margin: 0 0 1em; }
.prose { max-width: 72ch; }
.prose ul, .prose ol { padding-left: 1.25em; }
.prose li { margin-bottom: 0.35em; }
.prose li::marker { color: var(--text3); }
.muted { color: var(--text2); }
.small { font-size: 14px; }

/* the small uppercase region label of the app */
.label {
  display: block; margin: 0 0 6px; font-family: var(--sans); font-weight: 600;
  font-size: 11px; line-height: 1.4; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text3);
}

/* ---------- regions: a 1 px framed block like the app's columns ---------- */
.section { padding: 56px 0; border-top: 1px solid var(--line2); }
.section:first-child { border-top: 0; }
.section-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 24px; flex-wrap: wrap; }
.section-head h2 { margin: 0; }
.section-head p { margin: 0; color: var(--text2); }

/* ---------- hero ---------- */
.hero { padding: 48px 0 40px; }
.hero h1 { margin-bottom: 12px; }
.hero .lede { font-size: clamp(18px, 2.2vw, 22px); color: var(--text2); max-width: 40ch; margin-bottom: 28px; }

/* the facts strip, drawn like the app's tab bar */
/* the wrapper clips the right and bottom lines of the outer cells */
.strip-clip { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg1); margin: 0 0 28px; }
.strip {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  margin: 0 -1px -1px 0; padding: 0;
}
.strip > div { padding: 10px 14px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.strip dt { font-size: 12px; color: var(--text3); margin: 0; }
.strip dd { margin: 2px 0 0; font-family: var(--mono); font-weight: 500; font-size: 14px; color: var(--text); }
.strip dd .dot { margin-right: 6px; }

.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); vertical-align: 1px; }
.dot.off { background: var(--text3); }

.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 36px; }
.btn {
  display: inline-block; padding: 9px 16px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--bg2); color: var(--text); text-decoration: none; font-weight: 600; font-size: 15px;
}
.btn:hover { background: var(--bg3); border-color: var(--text3); }
.btn.primary { background: var(--ok); border-color: var(--ok); color: var(--bg0); }
.btn.primary:hover { background: #5fe6ab; border-color: #5fe6ab; }

/* the logo's square pulse as a trace line */
.trace { display: flex; align-items: flex-end; gap: 0; height: 22px; margin: 0 0 20px; }
.trace .rail { flex: 1 1 auto; height: 2px; background: var(--line); margin-bottom: 0; }
.trace .rail.lit { flex: 0 0 48px; background: var(--ok); }
.trace svg { flex: 0 0 auto; width: 52px; height: 22px; }

.hero .hero-sub { color: var(--text2); max-width: 64ch; margin-bottom: 28px; }
.section.first { border-top: 0; padding-top: 16px; }

/* the layers an instrument passes, left to right like a signal chain */
.chain {
  list-style: none; margin: 0 0 24px; padding: 0;
  display: grid; grid-template-columns: minmax(0, 1fr);
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg1);
}
.chain li { position: relative; padding: 16px 18px; border-top: 1px solid var(--line); }
.chain li:first-child { border-top: 0; }
.chain code { display: inline-block; margin-bottom: 8px; font-size: 13px; }
.chain p { margin: 0; color: var(--text2); font-size: 15px; }
.chain li + li::before {
  content: ""; position: absolute; left: 24px; top: -5px; width: 9px; height: 9px;
  background: var(--ok); border-radius: 1px;
}
@media (min-width: 880px) {
  .chain { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .chain li { border-top: 0; border-left: 1px solid var(--line); }
  .chain li:first-child { border-left: 0; }
  .chain li + li::before { left: -5px; top: 22px; }
}

/* ---------- screenshots ---------- */
.shot { margin: 0; }
.shot img { width: 100%; height: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--plot); }
.shot figcaption { margin-top: 10px; color: var(--text2); font-size: 15px; max-width: 72ch; }
.shots { display: grid; gap: 48px; }

/* ---------- what it does ---------- */
.cols { display: grid; gap: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg1); }
.cols > div { padding: 18px 20px; border-top: 1px solid var(--line); }
.cols > div:first-child { border-top: 0; }
.cols p { margin: 0; color: var(--text2); }
@media (min-width: 880px) {
  .cols { grid-template-columns: repeat(3, 1fr); }
  .cols > div { border-top: 0; border-left: 1px solid var(--line); }
  .cols > div:first-child { border-left: 0; }
}

/* ---------- notes ---------- */
.note {
  border: 1px solid var(--line); border-left: 3px solid var(--warn); border-radius: var(--radius);
  background: var(--bg1); padding: 14px 18px; margin: 0 0 1em; max-width: 72ch;
}
.note p:last-child { margin-bottom: 0; }
.note .label { color: var(--warn); }
.note.info { border-left-color: var(--text3); }
.note.info .label { color: var(--text3); }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg1); margin: 0 0 1.25em; }
table { border-collapse: collapse; width: 100%; min-width: 560px; font-size: 15px; }
th, td { text-align: left; vertical-align: top; padding: 9px 14px; border-top: 1px solid var(--line2); }
thead th { border-top: 0; font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text3); background: var(--bg1); white-space: nowrap; }
tbody th { font-weight: 600; white-space: nowrap; }
td.mono, td code { white-space: nowrap; }
td.wrap-ok code { white-space: normal; }

/* status chip, like the app's chips */
.chip {
  display: inline-block; font-family: var(--mono); font-weight: 500; font-size: 12px; line-height: 1.5;
  padding: 1px 7px; border-radius: 3px; border: 1px solid transparent; white-space: nowrap;
}
.chip.ok { color: var(--ok); background: rgba(61, 220, 151, 0.12); border-color: rgba(61, 220, 151, 0.35); }
.chip.warn { color: var(--warn); background: rgba(247, 185, 85, 0.12); border-color: rgba(247, 185, 85, 0.35); }
.chip.no { color: var(--text2); background: var(--bg2); border-color: var(--line); }

/* ---------- code ---------- */
pre {
  margin: 0 0 1.25em; padding: 14px 16px; overflow-x: auto; background: var(--plot);
  border: 1px solid var(--line); border-radius: var(--radius); font-size: 14px; line-height: 1.55; color: var(--text);
  max-width: 100%;
}
p code, li code, dd code { overflow-wrap: anywhere; }
pre code { background: none; border: 0; padding: 0; font-size: inherit; }
.prompt { color: var(--text3); user-select: none; }

/* ---------- docs layout ---------- */
.doc { display: grid; grid-template-columns: minmax(0, 1fr); gap: 32px; padding: 40px var(--gutter) 64px; }
.doc-head { padding-bottom: 8px; }
.doc-head h1 { font-size: clamp(30px, 5vw, 44px); margin-bottom: 10px; }
.doc-head p { color: var(--text2); max-width: 64ch; font-size: 18px; }
.toc { font-size: 14px; }
.toc ol { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line); }
.toc a { display: block; padding: 3px 0 3px 12px; margin-left: -1px; border-left: 1px solid transparent; color: var(--text2); text-decoration: none; }
.toc a:hover { color: var(--text); border-left-color: var(--ok); }
.doc-body > section { padding: 28px 0 8px; border-top: 1px solid var(--line2); scroll-margin-top: 16px; }
.doc-body > section:first-child { border-top: 0; padding-top: 0; }
.doc-body h2 { margin-bottom: 14px; }
.doc-body h3 { margin: 22px 0 8px; }
@media (min-width: 960px) {
  .doc { grid-template-columns: 200px minmax(0, 1fr); column-gap: 56px; }
  .doc-head { grid-column: 1 / -1; }
  .toc { position: sticky; top: 24px; align-self: start; }
}

/* instrument panels */
.instrument { border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg1); margin: 0 0 28px; scroll-margin-top: 16px; }
.instrument-head {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 14px 18px; border-bottom: 1px solid var(--line);
}
.instrument-head h2 { font-size: 22px; margin: 0; }
.instrument-head .kind { color: var(--text2); font-size: 14px; }
.instrument-head .chip { margin-left: auto; }
.instrument-body { padding: 4px 18px 8px; }
.instrument-body h3 { margin: 18px 0 8px; font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text3); }
.instrument-body ul { padding-left: 1.25em; max-width: 72ch; }
.instrument-body li { margin-bottom: 0.3em; }
.instrument-body li::marker { color: var(--text3); }
.instrument-body .src { color: var(--text2); font-size: 14px; border-top: 1px solid var(--line2); padding-top: 12px; margin-top: 8px; }

.kv { display: grid; grid-template-columns: minmax(110px, max-content) minmax(0, 1fr); gap: 0; margin: 0 0 1em; max-width: 72ch; font-size: 15px; }
.kv dt, .kv dd { padding: 6px 0; border-top: 1px solid var(--line2); margin: 0; }
.kv dt { color: var(--text2); padding-right: 18px; }
.kv dt:first-of-type, .kv dt:first-of-type + dd { border-top: 0; }
@media (max-width: 520px) {
  .kv { grid-template-columns: minmax(0, 1fr); }
  .kv dd { border-top: 0; padding-top: 0; }
}

/* tried / not tried */
.marks { list-style: none; padding: 0; margin: 0 0 1em; max-width: 76ch; }
.marks li { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 12px; padding: 10px 0; border-top: 1px solid var(--line2); }
.marks li:first-child { border-top: 0; }
.mark { font-family: var(--mono); font-weight: 500; font-size: 12px; color: var(--text2); white-space: nowrap; padding-top: 2px; }
.mark::before {
  content: ""; display: inline-block; width: 9px; height: 9px; margin-right: 7px; vertical-align: 0;
  border: 1px solid var(--text3); border-radius: 1px;
}
.mark.tried { color: var(--ok); }
.mark.tried::before { background: var(--ok); border-color: var(--ok); }
.marks .body > *:last-child { margin-bottom: 0; }
@media (max-width: 520px) {
  .marks li { grid-template-columns: minmax(0, 1fr); gap: 4px; }
}
.legend { display: flex; flex-wrap: wrap; gap: 8px 24px; margin: 0 0 1em; }

/* ---------- footer ---------- */
.site-foot { border-top: 1px solid var(--line); background: var(--bg1); color: var(--text2); font-size: 14px; }
.site-foot .wrap { padding-top: 24px; padding-bottom: 28px; display: grid; gap: 8px; }
.site-foot p { margin: 0; }

/* ---------- 404 ---------- */
.lost { padding: 72px 0 96px; max-width: 60ch; }
.lost h1 { margin-bottom: 12px; }

@media (prefers-reduced-motion: no-preference) {
  a, .btn, .nav a, .toc a { transition: color 120ms ease, background-color 120ms ease, border-color 120ms ease, text-decoration-color 120ms ease; }
}

/* tables of file names: let the names wrap instead of widening the table */
.table-wrap.files tbody th { white-space: normal; width: 34%; }
.table-wrap.files code { white-space: normal; overflow-wrap: anywhere; }
