:root {
  --void:   #070B18;
  --panel:  #0F1730;
  --panel-2:#141F3E;
  --wire:   #1C2A50;
  --cyan:   #35E3F5;
  --magenta:#F0378F;
  --amber:  #FFB020;
  --good:   #35F5A7;
  --ink:    #E8EEFF;
  --ink-dim:#8DA0C8;
  --ink-faint:#5A6B94;

  --font-display: "Bahnschrift", "DIN Alternate", "Roboto Condensed", "Arial Narrow", system-ui, sans-serif;
  --font-body: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", sans-serif;
  --font-mono: "Cascadia Mono", "Cascadia Code", "JetBrains Mono", ui-monospace, Consolas, "SF Mono", monospace;

  --step--1: clamp(.78rem, .76rem + .1vw, .84rem);
  --step-0:  clamp(.95rem, .92rem + .15vw, 1.02rem);
  --step-1:  clamp(1.15rem, 1.08rem + .35vw, 1.35rem);
  --step-2:  clamp(1.5rem, 1.35rem + .75vw, 2rem);
  --step-3:  clamp(2rem, 1.6rem + 2vw, 3.2rem);
  --step-4:  clamp(2.6rem, 1.9rem + 3.4vw, 4.6rem);

  --gutter: clamp(1.1rem, .6rem + 2.2vw, 3rem);
  --measure: 66ch;
  --rule: 1px solid var(--wire);
}

/* Committed to a single dark world: this is instrument panel language, and the glow
   that carries the signal colours has no light-ground equivalent. Tokens are pinned
   under both theme selectors so a viewer toggle cannot half-apply and break contrast. */
:root[data-theme="light"], :root[data-theme="dark"] { color-scheme: dark; }

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

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--void);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

/* Ambient plant-floor glow. Fixed so it never scrolls into a seam. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(60vw 50vh at 78% -5%, rgba(53,227,245,.14), transparent 65%),
    radial-gradient(45vw 40vh at 8% 8%, rgba(240,55,143,.11), transparent 62%);
  z-index: 0;
}

h1, h2, h3, .eyebrow, .nav-link, .stat-num, .btn {
  font-family: var(--font-display);
  font-weight: 600;
  text-wrap: balance;
}
h1 { font-size: var(--step-4); line-height: 1.02; letter-spacing: -.015em; margin: 0; }
h2 { font-size: var(--step-3); line-height: 1.08; letter-spacing: -.01em; margin: 0; }
h3 { font-size: var(--step-1); line-height: 1.25; margin: 0; }
p  { margin: 0; max-width: var(--measure); }
a  { color: var(--cyan); }

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

.eyebrow {
  font-size: var(--step--1);
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--cyan);
  display: flex;
  align-items: center;
  gap: .7em;
  margin: 0;
}
.eyebrow::before, .eyebrow::after {
  content: "";
  width: 5px; height: 5px;
  border-radius: 50%;
  background: currentColor;
  flex: none;
}
.eyebrow::after { flex: 1 1 auto; height: 1px; width: auto; border-radius: 0; opacity: .35; }

.wrap { width: min(1180px, 100% - var(--gutter) * 2); margin-inline: auto; position: relative; z-index: 1; }

/* ---------- masthead ---------- */
.masthead {
  position: sticky; top: 0; z-index: 40;
  background: rgba(7,11,24,.82);
  backdrop-filter: blur(14px);
  border-bottom: var(--rule);
}
.masthead > .wrap { display: flex; align-items: center; gap: 1.5rem; min-height: 66px; flex-wrap: wrap; }

.brand { display: flex; align-items: center; gap: .7rem; text-decoration: none; color: var(--ink); margin-right: auto; }
.brand-mark { width: 26px; height: 26px; flex: none; }
.brand-name { font-family: var(--font-display); font-size: 1.06rem; letter-spacing: .17em; text-transform: uppercase; }
.brand-name b { color: var(--cyan); font-weight: 600; }

.nav { display: flex; gap: .15rem; flex-wrap: wrap; }
.nav-link {
  font-size: var(--step--1);
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink-dim);
  text-decoration: none;
  padding: .5rem .7rem;
  border-radius: 3px;
  white-space: nowrap;
}
.nav-link:hover { color: var(--ink); background: rgba(53,227,245,.07); }
.nav-link[aria-current="page"] { color: var(--cyan); background: rgba(53,227,245,.1); }

/* ---------- views ---------- */
.view { display: none; }
.view.is-active { display: block; animation: rise .34s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .view.is-active { animation: none; } }

.band { padding-block: clamp(3rem, 6vw, 6rem); }
.band + .band { border-top: var(--rule); }
.band-head { display: flex; flex-direction: column; gap: 1rem; margin-bottom: 2.75rem; }

/* ---------- hero ---------- */
.hero { padding-block: clamp(3rem, 7vw, 6.5rem) clamp(3rem, 6vw, 5rem); }
.hero-grid { display: grid; gap: clamp(2rem, 5vw, 4rem); grid-template-columns: 1fr; align-items: center; }
@media (min-width: 62rem) { .hero-grid { grid-template-columns: 1.05fr .95fr; } }

.hero-copy { display: flex; flex-direction: column; gap: 1.6rem; align-items: flex-start; }
.swash { position: relative; white-space: nowrap; }
.swash::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: -.08em;
  height: 3px;
  background: linear-gradient(90deg, var(--cyan), rgba(53,227,245,0));
  border-radius: 2px;
}
.lede { color: var(--ink-dim); font-size: var(--step-1); line-height: 1.55; }

.btn-row { display: flex; gap: .8rem; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .68rem 1.35rem;
  border-radius: 999px;
  font-size: var(--step--1);
  letter-spacing: .09em;
  text-transform: uppercase;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
}
.btn-primary { background: var(--cyan); color: #04121A; box-shadow: 0 0 0 rgba(53,227,245,.5); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 8px 26px -8px rgba(53,227,245,.75); }
.btn-ghost { border-color: var(--wire); color: var(--ink); }
.btn-ghost:hover { border-color: var(--cyan); color: var(--cyan); }
.btn-fab { background: var(--magenta); color: #fff; }
.btn-fab:hover { transform: translateY(-1px); box-shadow: 0 8px 26px -8px rgba(240,55,143,.8); }
.btn[aria-disabled="true"] { background: var(--panel-2); color: var(--ink-faint); border-color: var(--wire); cursor: not-allowed; box-shadow: none; transform: none; }
@media (prefers-reduced-motion: reduce) { .btn:hover { transform: none; } }

/* ---------- live tag readout ---------- */
.readout {
  background: linear-gradient(180deg, var(--panel), #0B1226);
  border: var(--rule);
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 30px 70px -40px rgba(0,0,0,.9), inset 0 1px 0 rgba(255,255,255,.04);
}
.readout-bar {
  display: flex; align-items: center; gap: .6rem;
  padding: .6rem .9rem;
  border-bottom: var(--rule);
  background: rgba(255,255,255,.02);
  font-family: var(--font-mono);
  font-size: .72rem;
  color: var(--ink-faint);
  letter-spacing: .04em;
}
.lamp { width: 7px; height: 7px; border-radius: 50%; background: var(--good); box-shadow: 0 0 9px var(--good); flex: none; }
.readout-bar .spacer { margin-left: auto; }

table.tags { width: 100%; border-collapse: collapse; font-family: var(--font-mono); font-size: .78rem; }
table.tags th {
  text-align: left;
  font-weight: 400;
  color: var(--ink-faint);
  font-size: .66rem;
  letter-spacing: .13em;
  text-transform: uppercase;
  padding: .55rem .9rem;
  border-bottom: var(--rule);
}
table.tags td { padding: .5rem .9rem; border-bottom: 1px solid rgba(28,42,80,.5); }
table.tags tr:last-child td { border-bottom: 0; }
.t-name { color: var(--ink-dim); }
.t-val { color: var(--cyan); text-align: right; font-variant-numeric: tabular-nums; transition: color .3s ease; }
.t-val.bump { color: #fff; }
.t-time { color: var(--ink-faint); text-align: right; font-variant-numeric: tabular-nums; font-size: .72rem; }

.pill {
  display: inline-block;
  padding: .08rem .5rem;
  border-radius: 999px;
  font-size: .62rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  border: 1px solid currentColor;
}
.pill-good { color: var(--good); }
.pill-uncertain { color: var(--amber); }

/* ---------- stats ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1px; background: var(--wire); border: var(--rule); border-radius: 6px; overflow: hidden; }
.stat { background: var(--panel); padding: 1.3rem 1.4rem; }
.stat-num { display: block; font-size: var(--step-2); color: var(--cyan); line-height: 1; font-variant-numeric: tabular-nums; }
.stat-lbl { display: block; margin-top: .45rem; font-size: var(--step--1); color: var(--ink-dim); }

/* ---------- cards ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 270px), 1fr)); gap: 1.1rem; }
.card {
  background: var(--panel);
  border: var(--rule);
  border-radius: 6px;
  padding: 1.6rem;
  display: flex; flex-direction: column; gap: .75rem;
  transition: border-color .18s ease, transform .18s ease;
}
.card:hover { border-color: rgba(53,227,245,.42); transform: translateY(-2px); }
@media (prefers-reduced-motion: reduce) { .card:hover { transform: none; } }
.card p { color: var(--ink-dim); font-size: var(--step--1); }
.card-icon { width: 30px; height: 30px; color: var(--cyan); }

a.card { text-decoration: none; color: inherit; }
.card-more { margin-top: auto; padding-top: .4rem; color: var(--cyan); font-size: var(--step--1); letter-spacing: .06em; text-transform: uppercase; font-family: var(--font-display); }
.card-more::after { content: " \2192"; }

.proto-tag { font-family: var(--font-mono); font-size: .68rem; color: var(--ink-faint); letter-spacing: .08em; }

/* ---------- connector view ---------- */
.conn-head { display: grid; gap: 1.4rem; margin-bottom: 3rem; }
.conn-head .lede { max-width: var(--measure); }

/* minmax(0, 1fr), not 1fr. A bare 1fr is minmax(auto, 1fr), and auto is the content's min-content
   width -- which for a <pre> is its longest line. One long command then widened its column to fit
   and crushed the other to a sliver, and .codeblock's overflow-x never engaged because the column
   grew instead of the block scrolling. On a phone the same thing scrolled the whole page. */
.split { display: grid; gap: clamp(1.6rem, 4vw, 3rem); grid-template-columns: minmax(0, 1fr); }
@media (min-width: 58rem) { .split { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }

.spec { width: 100%; border-collapse: collapse; font-size: var(--step--1); }
.spec th, .spec td { text-align: left; padding: .62rem 0; border-bottom: 1px solid rgba(28,42,80,.65); vertical-align: top; }
.spec th { color: var(--ink-faint); font-weight: 400; width: 38%; padding-right: 1rem; font-family: var(--font-display); letter-spacing: .04em; }
.spec td { color: var(--ink); }
.spec code { font-family: var(--font-mono); font-size: .93em; color: var(--cyan); }

.codeblock {
  background: #050912;
  border: var(--rule);
  border-radius: 6px;
  overflow-x: auto;
  margin: 0;
}
.codeblock pre { margin: 0; padding: 1.1rem 1.25rem; font-family: var(--font-mono); font-size: .76rem; line-height: 1.75; }
/* For a command too long for its column. Wraps on screen only -- the text is still one line, so it
   copies and pastes as the single command it is. */
.codeblock pre.wrap { white-space: pre-wrap; overflow-wrap: anywhere; }
.codeblock .c { color: var(--ink-faint); }
.codeblock .k { color: var(--magenta); }
.codeblock .s { color: var(--good); }

.notice {
  border-left: 2px solid var(--amber);
  background: rgba(255,176,32,.06);
  padding: .9rem 1.1rem;
  border-radius: 0 4px 4px 0;
  font-size: var(--step--1);
}
.notice strong { color: var(--amber); }

.limits { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .7rem; }
/* Hanging indent rather than flex on the li. A flex li turns every inline child into its own
   flex item, so an entry containing several <code> spans is laid out as columns with the prose
   between them torn apart -- which is what these lists were doing. */
.limits li { font-size: var(--step--1); color: var(--ink-dim); padding-left: 1.5rem; }
.limits li::before { content: "\2014"; color: var(--ink-faint); display: inline-block; width: 1.5rem; margin-left: -1.5rem; }

/* The getting-started steps. Counted by CSS rather than the browser's own marker, so the numeral
   takes the display face and the brand colour; the text keeps .limits' hanging indent, for the
   same reason given there. */
.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .9rem; counter-reset: step; }
.steps li { font-size: var(--step--1); color: var(--ink-dim); padding-left: 2rem; counter-increment: step; }
.steps li::before { content: counter(step); color: var(--cyan); font-family: var(--font-display); font-weight: 600; display: inline-block; width: 2rem; margin-left: -2rem; }
.steps strong { color: var(--ink); font-weight: 600; }
/* A step's own screenshot sits under its text at the column's full width, in the gallery's tile
   shape, so a run of steps reads evenly whichever frames have arrived. */
.steps .shots-step { margin-top: .75rem; }

/* The page SupportURL points at, so it has to end somewhere a person can actually write to. */
.support { font-size: var(--step--1); color: var(--ink-dim); max-width: var(--measure); }
.support strong { color: var(--ink); font-weight: 600; }
.support a { color: var(--cyan); text-decoration: none; border-bottom: 1px solid rgba(53,227,245,.35); }
.support a:hover { border-bottom-color: var(--cyan); }

/* ---------- screenshot slots ---------- */
.shots { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 1.1rem; }

/* Says what was on the other end of the wire. Where that is third-party software it needs
   naming for credit and, more importantly, so nobody reads a screenshot as a claim that the
   thing in it is included. */
.shots-source { font-size: var(--step--1); color: var(--ink-dim); margin: -.6rem 0 1.4rem; max-width: var(--measure); }
.shots-source strong { color: var(--ink); font-weight: 600; }
figure.shot { margin: 0; display: flex; flex-direction: column; gap: .6rem; }
/* Every shot is a tile of the same proportions regardless of what it captures. Editor
   screenshots arrive anywhere between 3.6:1 and 5:6, and letting each keep its own shape makes
   a row of them read as rubble -- captions floating at three different heights. The tile shows
   an excerpt; the full image is a click away, which is where anyone reading a register value
   was always going to end up. */
figure.shot a.zoom {
  display: block;
  position: relative;
  aspect-ratio: 16 / 10;
  border: var(--rule);
  border-radius: 5px;
  overflow: hidden;
  background: var(--panel);
  text-decoration: none;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
figure.shot a.zoom img { width: 100%; height: 100%; object-fit: cover; object-position: center; display: block; }
figure.shot a.zoom:hover,
figure.shot a.zoom:focus-visible {
  transform: translateY(-5px);
  border-color: rgba(53,227,245,.55);
  box-shadow: 0 18px 38px -16px rgba(0,0,0,.95), 0 0 0 1px rgba(53,227,245,.2);
}
@media (prefers-reduced-motion: reduce) { figure.shot a.zoom { transition: none; } figure.shot a.zoom:hover { transform: none; } }

/* Lightbox */
.lightbox {
  position: fixed; inset: 0; z-index: 90;
  display: flex; align-items: center; justify-content: center;
  padding: clamp(1rem, 4vw, 3rem);
  background: rgba(4,7,15,.93);
  backdrop-filter: blur(6px);
}
.lightbox[hidden] { display: none; }
.lightbox img {
  max-width: 100%; max-height: 100%;
  border: var(--rule); border-radius: 6px;
  box-shadow: 0 40px 90px -30px rgba(0,0,0,1);
}
.lightbox .lb-close {
  position: absolute; top: 1.1rem; right: 1.3rem;
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; line-height: 1;
  background: var(--panel); color: var(--ink);
  border: var(--rule); border-radius: 50%;
  cursor: pointer;
}
.lightbox .lb-close:hover { border-color: var(--cyan); color: var(--cyan); }
.lightbox .lb-caption {
  position: absolute; left: 0; right: 0; bottom: 1.1rem;
  text-align: center; font-size: var(--step--1); color: var(--ink-dim);
}
figure.shot figcaption { font-size: var(--step--1); color: var(--ink-dim); }
figure.shot .slot { display: none; }
figure.shot.missing .zoom { display: none; }
figure.shot.missing .slot {
  display: flex; flex-direction: column; gap: .5rem;
  border: 1px dashed var(--wire);
  border-radius: 5px;
  padding: 1.15rem;
  background: repeating-linear-gradient(45deg, transparent, transparent 9px, rgba(28,42,80,.22) 9px, rgba(28,42,80,.22) 18px);
  min-height: 170px;
  justify-content: center;
}
.slot-file { font-family: var(--font-mono); font-size: .72rem; color: var(--cyan); word-break: break-all; }
.slot-spec { font-size: var(--step--1); color: var(--ink-dim); }
.slot-tag { font-family: var(--font-display); font-size: .66rem; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-faint); }

/* ---------- footer ---------- */
.footer { border-top: var(--rule); padding-block: 3rem 4rem; background: rgba(5,9,18,.6); }
.footer-grid { display: grid; gap: 2rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }
.footer h3 { font-size: var(--step--1); letter-spacing: .16em; text-transform: uppercase; color: var(--ink-faint); margin-bottom: .9rem; }
.footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .45rem; }
.footer a { color: var(--ink-dim); text-decoration: none; font-size: var(--step--1); }
.footer a:hover { color: var(--cyan); }
.legal { margin-top: 2.5rem; padding-top: 1.6rem; border-top: var(--rule); font-size: .76rem; color: var(--ink-faint); line-height: 1.75; }
.legal p { max-width: none; }
.legal p + p { margin-top: .75rem; }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 1rem; top: 1rem; position: fixed; z-index: 100; background: var(--cyan); color: #04121A; padding: .6rem 1rem; border-radius: 4px; }

/* ---------- utilities ----------
   These replace the inline style attributes the markup used to carry. Moving them here is not
   tidiness for its own sake: with no style="" left in the document, the Content-Security-Policy
   can drop 'unsafe-inline' from style-src, which is what makes the policy worth having. Named
   for what the element is rather than what it looks like, so a change of spacing does not
   turn a class called .mt3 into a lie.                                                       */
.stack { display: flex; flex-direction: column; gap: 1.1rem; }
.stack-tight { gap: 1rem; }
.h-section { margin-top: 3rem; margin-bottom: 1.2rem; }
.dim { color: var(--ink-dim); }
.meta { color: var(--ink-dim); font-size: var(--step--1); }
.num { text-align: right; }
.cards-spaced { margin-top: 2.5rem; }
.spec-narrow { max-width: 760px; }

/* Scoped under .spec because `.spec th` already sets a width and would otherwise win on
   specificity, silently leaving these two columns at 38%. */
.spec th.col-a { width: 22%; }
.spec th.col-b { width: 34%; }

/* .num lands on headers in table.tags, which left-aligns every th at a specificity the bare
   class cannot beat. Checked by reading the rule rather than the rendering: a right-aligned
   column that silently stays left is the kind of thing that survives a glance at the page. */
table.tags th.num, table.tags td.num { text-align: right; }
