/* Self-hosted, subset to the 108 characters this site uses. No external request,
   so the pages render even if fonts.googleapis.com is unreachable. */
@font-face{font-family:"IBM Plex Mono";font-style:normal;font-weight:400;src:url(../fonts/plex-mono-400.woff2) format("woff2");font-display:swap}
@font-face{font-family:"IBM Plex Mono";font-style:normal;font-weight:500;src:url(../fonts/plex-mono-500.woff2) format("woff2");font-display:swap}
@font-face{font-family:"IBM Plex Mono";font-style:normal;font-weight:600;src:url(../fonts/plex-mono-600.woff2) format("woff2");font-display:swap}
@font-face{font-family:"IBM Plex Mono";font-style:normal;font-weight:700;src:url(../fonts/plex-mono-700.woff2) format("woff2");font-display:swap}
@font-face{font-family:"IBM Plex Sans";font-style:normal;font-weight:400 600;src:url(../fonts/plex-sans-var.woff2) format("woff2");font-display:swap}

/* Wired Village — shared stylesheet. Plain, dark, documentation-style. */

:root {
  --bg: #0a0a0a;
  --bg-alt: #0e0e0e;
  --bg-inset: #060606;
  --border: #1e1e1e;
  --border-strong: #303030;
  --text: #e8e8e8;
  /* Three text weights, all cleared for WCAG AA body text (>= 4.5:1) against
     --bg and --bg-alt. --text-dimmer used to be #555 (2.7:1) and carried real
     copy: meta lines, captions, table headers, footer. */
  --text-dim: #9b9b9b;      /* 7.1:1 on --bg */
  --text-dimmer: #828282;   /* 5.2:1 on --bg, 5.0:1 on --bg-alt */
  --rule-dim: #555;         /* non-text uses only: list markers, hairlines */
  --accent: #35c15e;
  --accent-dim: #1f7a3c;
  --accent-text: #6fe08f;
  --red: #c8564f;
  --amber: #c2922f;
  --cyan: #4fb8d6;
  --border-bright: #3a3a3a;
  --mono: "IBM Plex Mono", "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --sans: "IBM Plex Sans", "Inter", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  --maxw: 1040px;

  /* ---------- type scale ----------
     Six body steps plus two heading steps. Every font-size in this sheet comes
     from one of these; nothing sets a bare px size any more. The steps are
     ~1.08-1.12 apart at the small end (where this site does most of its work:
     labels, metadata, table cells) and open up for headings.

       --fs-micro  10.5px  uppercase micro-labels: tags, th, status pills
       --fs-xs     11.5px  eyebrows, metadata lines, captions
       --fs-sm     12.5px  nav, TOC, crumbs, code blocks, dense tables
       --fs-ms     13.5px  secondary prose: notes, reveal bodies, glossary
       --fs-md     15px    default body copy
       --fs-lg     16.5px  lead paragraphs, index row titles
       --fs-h2     17.5 -> 20px fluid
       --fs-h1     26 -> 32px fluid                                           */
  --fs-micro: 10.5px;
  --fs-xs: 11.5px;
  --fs-sm: 12.5px;
  --fs-ms: 13.5px;
  --fs-md: 15px;
  --fs-lg: 16.5px;
  --fs-h3: 12.5px;
  --fs-h2: clamp(17.5px, 1.05vw + 14px, 20px);
  --fs-title: clamp(20px, 1.3vw + 16px, 23px);   /* a challenge title */
  --fs-h1: clamp(26px, 2.2vw + 17px, 32px);

  /* line heights: prose breathes, labels and headings sit tight */
  --lh-prose: 1.65;
  --lh-snug: 1.5;
  --lh-tight: 1.25;

  /* vertical rhythm, all multiples of 4 */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 24px;
  --sp-6: 32px;
  --sp-7: 44px;

  /* comfortable measure: ~68 characters, never past ~78 */
  --measure: 68ch;
  --measure-tight: 62ch;

  --track-caps: .08em;   /* one letter-spacing for every uppercase label */
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: var(--fs-md);
  line-height: var(--lh-prose);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--accent-text); text-decoration: none; border-bottom: 1px solid transparent; }
a:hover { border-bottom-color: var(--accent-dim); }

/* ---------- keyboard accessibility ---------- */
/* One visible ring for every focusable thing. :focus-visible keeps it off
   mouse clicks but always on for keyboard users. */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

.skip-link {
  position: absolute;
  left: 8px;
  top: -48px;                 /* parked off-screen until focused */
  z-index: 100;
  background: var(--accent);
  color: #07140b;
  font-family: var(--mono);
  font-size: var(--fs-sm);
  padding: 11px 14px;
  border-radius: 4px;
  border-bottom: none;
  transition: top .15s ease;
}
.skip-link:focus { top: 8px; }
main:focus { outline: none; }

/* ---------- reduced motion ---------- */
/* Anything decorative stops; the page must still read as complete. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}

img { max-width: 100%; display: block; }

code, .mono { font-family: var(--mono); }
code {
  background: var(--bg-inset);
  border: 1px solid var(--border);
  color: var(--accent-text);
  padding: 1px 5px;
  border-radius: 3px;
  font-size: .87em;
  overflow-wrap: anywhere;   /* long inline tokens wrap instead of forcing page scroll on phones */
}
/* Markdown-imported pages emit <pre><code class="language-x">. Without this the
   inline-code chrome (box, border, green, radius) was drawn a second time
   inside every code block, so each line looked boxed within its own block. */
pre code {
  background: none;
  border: 0;
  padding: 0;
  border-radius: 0;
  color: inherit;
  font-size: inherit;
  overflow-wrap: normal;
}
pre {
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 12px 14px;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: var(--fs-sm);
  color: #b7c9bb;
  line-height: 1.55;
  margin: var(--sp-3) 0;
}
/* a code block that is the whole of a list item shouldn't double its gap */
li > pre:last-child { margin-bottom: var(--sp-2); }

hr { border: none; border-top: 1px solid var(--border); margin: var(--sp-6) 0; }

/* ---------- header ---------- */
.topbar {
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: var(--mono);
  font-size: var(--fs-ms);
  letter-spacing: .02em;
  color: var(--text);
}
/* transparent wordmark, so no tile/plate behind it */
/* Home already carries the big hero wordmark, so its topbar mark stays small;
   subpages have no hero logo, so theirs is larger. */
.brand img { height: 23px; width: auto; display: block; }
.brand-link img { height: 34px; }
/* The wordmark is only ~23px tall, so the link around it was a 23px tap
   target. Padding + an equal negative margin grows the hit area to 45px
   without moving anything on the page. */
.brand-link { display: flex; align-items: center; gap: 9px; color: inherit; border-bottom: none;
              padding: 11px 6px; margin: -11px -6px; }
.brand .sep { color: var(--text-dimmer); }
.navlinks {
  display: flex;
  gap: 4px;
  font-family: var(--mono);
  font-size: var(--fs-sm);
}
.navlinks a {
  color: var(--text-dim);
  padding: 11px 12px;       /* 36px tall: a real tap target on every width */
  line-height: 1.1;
  border-bottom: none;
  border-radius: 3px;
}
.navlinks a:hover { color: var(--text); background: var(--bg-alt); }
.navlinks a.active { color: var(--bg); background: var(--accent); }
.navlinks a.active:hover { color: var(--bg); background: var(--accent); }

/* ---------- layout ---------- */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.section { padding: 44px 0; }

.hero-row {
  display: flex;
  align-items: center;
  gap: 28px;
  flex-wrap: wrap;
}
.hero-row .hero-text { flex: 1 1 360px; min-width: 260px; }

.iot { color: var(--accent-text); }

.eyebrow {
  font-family: var(--mono);
  font-size: var(--fs-xs);
  line-height: var(--lh-tight);
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin: 0 0 var(--sp-3);
}

/* ---------- headings ----------
   One ladder for the whole site: h1 (fluid 26-32) > h2 (fluid 17.5-20) >
   h3 (12.5 caps) > h4 (10.5 caps). All mono, because headings are the
   terminal/editorial voice here; prose underneath is sans. The space above a
   heading is always larger than the space below it, so a heading binds to the
   text it introduces rather than floating between two blocks. */
h1, h2, h3, h4 {
  font-family: var(--mono);
  font-weight: 600;
  color: var(--text);
  text-wrap: balance;
  overflow-wrap: break-word;
}
h1 {
  font-size: var(--fs-h1);
  line-height: 1.18;
  letter-spacing: -.015em;
  margin: 0 0 var(--sp-4);
}
h2 {
  font-size: var(--fs-h2);
  line-height: var(--lh-tight);
  letter-spacing: -.005em;
  margin: var(--sp-7) 0 var(--sp-3);
  scroll-margin-top: var(--sp-5);
}
h3 {
  font-size: var(--fs-h3);
  line-height: var(--lh-tight);
  text-transform: uppercase;
  letter-spacing: var(--track-caps);
  color: var(--text-dim);
  margin: var(--sp-5) 0 var(--sp-2);
}
h4 {
  font-size: var(--fs-xs);
  line-height: var(--lh-tight);
  text-transform: uppercase;
  letter-spacing: var(--track-caps);
  color: var(--text-dim);
  margin: var(--sp-4) 0 var(--sp-2);
}
/* first heading in a block owns no space above it: the container's padding
   already provides it, and doubling the two is what made sections drift apart */
section > h2:first-child, section > h3:first-child,
.content > h2:first-child, .sec-body > *:first-child,
.reveal-body > *:first-child, .legend-item > *:first-child,
.bm-detail > *:first-child { margin-top: 0; }

/* ---------- prose ---------- */
p { margin: 0 0 var(--sp-3); color: var(--text-dim); max-width: var(--measure); }
p.lead {
  color: var(--text);
  font-size: var(--fs-lg);
  line-height: 1.55;
  max-width: var(--measure-tight);
  margin-bottom: var(--sp-4);
}
/* a small aside under a lead, e.g. "New to all this? Start with the glossary" */
p.sub-note { font-size: var(--fs-ms); margin-bottom: 0; }

ul, ol { color: var(--text-dim); padding-left: 20px; margin: 0 0 var(--sp-3); max-width: var(--measure); }
li { margin-bottom: var(--sp-2); }
li > ul, li > ol { margin-top: var(--sp-2); }
ul > li::marker { color: var(--rule-dim); }
ol > li::marker { color: var(--text-dimmer); font-family: var(--mono); font-size: .9em; }
b, strong { font-weight: 600; color: var(--text); }
/* a paragraph directly after a list or a block gets its gap from them, not twice */
p + h2, ul + h2, ol + h2, pre + h2, table + h2, .note + h2 { margin-top: var(--sp-7); }

/* ---------- index table (home + category index) ---------- */
.index-table { width: 100%; border-collapse: collapse; margin: 6px 0; }
.index-table tr { border-top: 1px solid var(--border); transition: background-color .12s; }
.index-table tr:first-child { border-top: none; }
.index-table tr[data-href] { cursor: pointer; }
.index-table tr[data-href]:hover { background: rgba(53,193,94,.055); }
.index-table tr[data-href]:hover td.ix-name a { color: var(--accent-text); }
.index-table td { padding: 18px 14px; vertical-align: top; }
.index-table td.ix-name { width: 34%; min-width: 240px; padding-left: 14px; }
.index-table td.ix-name a { font-family: var(--mono); font-size: var(--fs-lg); line-height: 1.3; color: var(--text); font-weight: 600; }
.index-table td.ix-name a:hover { color: var(--accent-text); }
.index-table td.ix-name .status { display: block; font-family: var(--mono); font-size: var(--fs-micro); line-height: var(--lh-tight); letter-spacing: var(--track-caps); text-transform: uppercase; color: var(--accent); margin-top: 6px; }
.index-table td.ix-name .status.soon { color: var(--text-dimmer); }
.index-table td.ix-desc p { margin: 0 0 var(--sp-2); font-size: var(--fs-ms); line-height: 1.6; max-width: var(--measure); }
.index-table td.ix-desc .meta { font-family: var(--mono); font-size: var(--fs-xs); line-height: 1.5; color: var(--text-dimmer); }
.index-table td.ix-desc .meta b { color: var(--text-dim); font-weight: 500; }
.index-table tr.disabled td.ix-name a { color: var(--text-dim); pointer-events: none; }
.index-table tr.disabled { opacity: .55; }
.index-table td.ix-arrow {
  width: 28px;
  padding-right: 14px;
  padding-left: 0;
  text-align: right;
  color: var(--text-dimmer);
  font-family: var(--mono);
  font-size: var(--fs-md);
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity .12s, transform .12s;
}
.index-table tr[data-href]:hover td.ix-arrow { opacity: 1; transform: translateX(0); color: var(--accent-text); }
.index-table .ix-thumb {
  display: flex;
  /* top-aligned so the badge name sits on the same line as the first line of
     its description; centred, it floated halfway down the row */
  align-items: flex-start;
  gap: 18px;
  min-width: 0;
}
.index-table .ix-thumb > div { padding-top: 2px; }
.index-table .ix-thumb img {
  width: 128px;
  height: 128px;
  object-fit: contain;
  flex-shrink: 0;
}
@media (max-width: 760px) {
  .index-table .ix-thumb img { width: 92px; height: 92px; }
}
@media (max-width: 560px) {
  .index-table, .index-table tbody, .index-table tr, .index-table td { display: block; width: auto; }
  .index-table tr { padding: 16px 0; }
  /* the stacked layout has no second column to balance against, so the fixed
     title width just squeezed the title into needless wrapping */
  .index-table td.ix-name { width: auto; min-width: 0; padding: 0 0 var(--sp-2); }
  .index-table td.ix-desc { padding: 0; }
  .index-table td.ix-arrow { display: none; }
}

/* ---------- docs layout: sidebar + content ---------- */
.docs {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 48px;
  align-items: start;
}
/* Grid items default to min-width:auto, so a wide child (a pin table, a long
   code span) can force the whole column wider than the viewport. Pin them to 0
   and let the individual wide things scroll inside themselves instead. */
.docs > * { min-width: 0; }
@media (max-width: 760px) { .docs { grid-template-columns: minmax(0, 1fr); } }

.toc {
  position: sticky;
  top: 24px;
  font-family: var(--mono);
  font-size: var(--fs-sm);
  line-height: var(--lh-snug);
}
/* 13px of left padding lines the label up with the link text, not the rail */
.toc .toc-label { color: var(--text-dimmer); text-transform: uppercase; letter-spacing: var(--track-caps); font-size: var(--fs-micro); margin-bottom: var(--sp-3); padding-left: 13px; }
.toc ol { list-style: none; padding: 0; margin: 0; }
.toc li { margin-bottom: 0; }   /* an unbroken rail down the left of the list */
.toc a {
  /* flex so a trailing point value or difficulty tag parks on the right of the
     first line instead of wrapping onto a line of its own */
  display: flex;
  align-items: baseline;
  gap: 4px 10px;
  padding: 10px 8px 10px 11px;   /* ~39px rows: tappable, and a calmer rhythm in the rail */
  border-left: 2px solid var(--border);
  color: var(--text-dim);
  border-bottom: none;
}
.toc a:hover { color: var(--text); border-left-color: var(--border-strong); }
.toc small { color: var(--text-dimmer); font-size: var(--fs-micro); letter-spacing: .05em;
             text-transform: uppercase; margin-left: auto; flex: 0 0 auto; }

.content h2 { scroll-margin-top: 20px; }

/* ---------- challenge entries (flowing sections, not cards) ---------- */
.entry { padding: var(--sp-6) 0; border-top: 1px solid var(--border); scroll-margin-top: var(--sp-5); }
.entry:first-child { border-top: none; padding-top: 0; }
.entry-head { display: flex; align-items: baseline; gap: var(--sp-1) var(--sp-3); flex-wrap: wrap; margin-bottom: var(--sp-3); }
.entry-num { font-family: var(--mono); font-size: var(--fs-ms); color: var(--text-dimmer); }
.diff-tag {
  font-family: var(--mono); font-size: var(--fs-micro); line-height: 1.5; letter-spacing: .07em; text-transform: uppercase;
  padding: 1px 7px; border: 1px solid var(--border-strong); border-radius: 3px; color: var(--text-dim);
}
.diff-tag.easy { color: var(--accent-text); border-color: var(--accent-dim); }
.diff-tag.med { color: var(--amber); border-color: #5b4a1e; }
.diff-tag.hard { color: var(--red); border-color: #5c2d2a; }

.entry h4 { color: var(--text-dimmer); margin: var(--sp-5) 0 var(--sp-2); }
.entry > p { font-size: var(--fs-md); }
/* A challenge title has to outrank the step headings inside the challenge.
   The sysrupt-v2 guides are imported markdown and use <h2> for their steps,
   so without this the title and its own steps rendered identically. */
.entry-head h2, h2.entry-title {
  font-size: var(--fs-title);
  line-height: 1.22;
  margin: 0 0 var(--sp-2);
}
/* step headings inside a challenge sit below the title */
.entry > h2:not(.entry-title) {
  font-size: clamp(16px, .6vw + 13.5px, 17.5px);
  color: var(--text);
  margin: var(--sp-6) 0 var(--sp-3);
}
.entry > hr { margin: var(--sp-6) 0; }
.entry > hr + h2 { margin-top: var(--sp-5); }

/* ---------- reveal (hint / full guide) ---------- */
.reveal {
  margin: var(--sp-3) 0;   /* was top-only, so the text after a closed
                              hint/guide box ran straight into it */
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--bg-alt);
}
.reveal + .reveal { margin-top: var(--sp-2); }
.reveal summary {
  cursor: pointer;
  list-style: none;
  padding: 11px 14px;
  font-family: var(--mono);
  font-size: var(--fs-sm);
  line-height: var(--lh-tight);
  letter-spacing: .04em;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  flex-wrap: wrap;          /* let a trailing pill (e.g. "locked") wrap instead of overflowing */
  gap: 4px 8px;
  min-width: 0;
  user-select: none;
}
.reveal summary::-webkit-details-marker { display: none; }
.reveal summary::before { content: "+"; color: var(--text-dimmer); width: 10px; display: inline-block; flex: 0 0 auto; }
.reveal[open] summary::before { content: "−"; }
.reveal summary:hover { color: var(--text); }
.reveal.hint { border-left: 2px solid #5b4a1e; }
.reveal.hint summary { color: var(--amber); }
.reveal.guide { border-left: 2px solid var(--accent-dim); }
.reveal.guide summary { color: var(--accent-text); }
.reveal.conn { border-left: 2px solid #1c5566; }
.reveal.conn summary { color: var(--cyan); }
.reveal .reveal-body img { border-radius: 3px; margin: 6px 0 4px; }
.reveal .reveal-body { padding: var(--sp-3) 16px var(--sp-4); border-top: 1px solid var(--border); }
.reveal .reveal-body p { font-size: var(--fs-ms); line-height: 1.62; margin: 0 0 var(--sp-3); }
.reveal .reveal-body ol, .reveal .reveal-body ul { font-size: var(--fs-ms); line-height: 1.62; margin: 0 0 var(--sp-3); }
.reveal .reveal-body li { margin-bottom: var(--sp-2); }
.reveal .reveal-body > *:last-child { margin-bottom: 0; }

.note {
  border-left: 2px solid var(--border-strong);
  padding: 2px 0 2px 14px;
  font-size: var(--fs-ms);
  line-height: 1.62;
  color: var(--text-dim);
  max-width: var(--measure);
  margin: var(--sp-4) 0 var(--sp-5);
}
.note b { color: var(--text); }

/* ---------- section-level collapsible (install/tools blocks) ---------- */
.sec-collapse {
  border: 1px solid var(--border);
  border-radius: 6px;
  margin: 0 0 var(--sp-6);
  background: var(--bg-alt);
}
.sec-collapse summary {
  cursor: pointer;
  list-style: none;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;          /* the tally badge wraps under the heading on narrow screens */
  gap: 6px 10px;
  min-width: 0;
  user-select: none;
}
.sec-collapse summary::-webkit-details-marker { display: none; }
.sec-collapse summary::before { content: "▸"; color: var(--text-dimmer); font-size: var(--fs-sm); transition: transform .1s; flex: 0 0 auto; }
.sec-collapse[open] summary::before { transform: rotate(90deg); }
.sec-collapse summary h2 { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.sec-collapse summary .tally { font-family: var(--mono); font-size: var(--fs-xs); color: var(--text-dimmer); margin-left: auto; }
.sec-collapse .sec-body { padding: var(--sp-4) 18px 18px; border-top: 1px solid var(--border); }
.sec-collapse .sec-body > *:last-child { margin-bottom: 0; }
.arsenal-note {
  border: 1px solid var(--border-strong);
  border-left: 3px solid var(--accent);
  background: rgba(53,193,94,.06);
  border-radius: 5px;
  padding: 11px 14px;
  font-size: var(--fs-ms);
  line-height: 1.55;
  color: var(--text-dim);
  max-width: var(--measure);
  margin: 0 0 var(--sp-5);
}
.arsenal-note b { color: var(--text); }

.pin-table { width: 100%; border-collapse: collapse; font-family: var(--mono); font-size: var(--fs-sm); line-height: 1.5; margin: var(--sp-3) 0 var(--sp-5); }
.pin-table th, .pin-table td { text-align: left; padding: 7px 14px 7px 0; border-bottom: 1px solid var(--border); vertical-align: top; }
.pin-table tr:last-child td { border-bottom: none; }
.pin-table th { color: var(--text-dimmer); font-weight: 500; text-transform: uppercase; font-size: var(--fs-micro); letter-spacing: var(--track-caps); }
.pin-table td { color: var(--text-dim); }
.pin-table td.sig { color: var(--accent-text); }

/* ---------- diagrams ---------- */
.diagram {
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 16px;
  margin: var(--sp-4) 0 var(--sp-5);
  overflow-x: auto;
}
/* viewBox + width:100% scales the drawing; height must come from CSS, because
   height="auto" is not a valid SVG length attribute (it throws in the console). */
.diagram svg { display: block; width: 100%; height: auto; }
.diagram svg text { font-family: var(--mono); }

/* ---------- tool cards ---------- */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--sp-4);
  margin: var(--sp-4) 0 var(--sp-5);
}
.tool-card {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}
.tool-card .shot {
  background: #ececea;
  height: 130px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
}
.tool-card .shot img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; }
.tool-card .info { padding: 11px 13px 13px; }
.tool-card .name { font-family: var(--mono); font-size: var(--fs-ms); line-height: var(--lh-tight); color: var(--text); font-weight: 600; margin-bottom: 5px; }
.tool-card .desc { font-size: var(--fs-sm); color: var(--text-dim); line-height: 1.55; }

/* ---------- legend (overview page) ---------- */
.legend-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: var(--sp-4);
  margin: var(--sp-4) 0 var(--sp-2);
}
.legend-item {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 14px 16px;
  background: var(--bg-alt);
}
.legend-item p { font-size: var(--fs-sm); line-height: 1.55; margin: var(--sp-3) 0 0; }
.legend-item .diff-tag { margin-right: 6px; }
.reveal-fake-summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: var(--fs-sm);
  line-height: var(--lh-tight);
  letter-spacing: .04em;
  /* same box as a real .reveal summary; without the side padding the sample
     label sat flush against its own border and read as clipped */
  padding: 11px 14px;
}
.legend-item .reveal { display: inline-block; max-width: 100%; margin-top: 0; }

/* ---------- glossary ---------- */
.glossary { margin: var(--sp-4) 0 0; }
.glossary dt {
  font-family: var(--mono);
  font-size: var(--fs-ms);
  font-weight: 600;
  color: var(--text);
  margin-top: var(--sp-5);
}
.glossary dt:first-child { margin-top: 0; }
.glossary dd {
  margin: var(--sp-1) 0 0;
  font-size: var(--fs-ms);
  line-height: 1.62;
  color: var(--text-dim);
  max-width: var(--measure);
}

/* ---------- crumbs ---------- */
.crumbs { font-family: var(--mono); font-size: var(--fs-sm); line-height: var(--lh-tight); color: var(--text-dimmer); margin-bottom: var(--sp-5); }
.crumbs a { color: var(--text-dim); }
.crumbs a:hover { color: var(--text); }
.crumbs .sep { margin: 0 6px; }

/* ---------- footer ---------- */
.foot-inner { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 14px; }
/* Both marks are now trimmed to their artwork, so a single shared height
   lines them up optically instead of guessing a number per logo. */
.partner { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.partner .partner-label {
  font-family: var(--mono); font-size: var(--fs-micro); letter-spacing: .12em;
  text-transform: uppercase; color: var(--text-dimmer);
  padding-right: 20px; border-right: 1px solid var(--border);
}
.partner a { border-bottom: none; display: inline-flex; align-items: center; flex: 0 0 auto;
             opacity: .82; transition: opacity .15s;
             /* 25px of artwork -> 45px of tap target, same visual position */
             padding: 10px 2px; margin: -10px -2px; }
.partner a:hover, .partner a:focus-visible { opacity: 1; }
/* Balanced by eye, not by number: Traboda is a long wordmark (aspect 5.2),
   bi0s is a compact stacked lockup (aspect 2.2), so equal heights make bi0s
   look far smaller. */
.partner img { width: auto; display: block; flex: 0 0 auto; }
.partner img.p-traboda { height: 26px; }
.partner img.p-bi0s { height: 36px; }
.partner img.p-bi0s { filter: invert(1); }   /* dark mark on a dark footer */

footer { border-top: 1px solid var(--border); padding: 28px 0 32px; margin-top: 34px; }
.foot-inner { display: flex; align-items: center; justify-content: space-between;
              flex-wrap: wrap; gap: 20px; }
.foot-left { font-family: var(--mono); font-size: var(--fs-xs); color: var(--text-dim);
             letter-spacing: .02em; }

/* ---------- misc ---------- */
.center { text-align: center; }
.tag-soon {
  font-family: var(--mono); font-size: var(--fs-micro); letter-spacing: .07em; text-transform: uppercase;
  color: var(--text-dimmer); border: 1px solid var(--border-strong); padding: 2px 8px; border-radius: 3px;
}

/* ======================= mobile ======================= */
/* Phones were getting a cramped layout: fixed 24px gutters, multi-column pin
   tables running off-screen, and nav/TOC links too small to tap reliably. */
@media (max-width: 760px) {
  .wrap { padding: 0 16px; }
  .topbar-inner { padding: 10px 16px; gap: 10px; }
  .navlinks { flex-wrap: wrap; gap: 2px; }
  .docs { gap: 20px; }
  /* the TOC becomes a plain list above the content instead of a sticky rail */
  .toc { position: static; max-height: none; border-left: none;
         border-bottom: 1px solid var(--border); padding-bottom: 14px; }
  .toc a { padding: 9px 10px; }
  /* h1/h2 are fluid via clamp(), so no per-breakpoint override is needed */
  .entry { padding: var(--sp-5) 0; }
  .entry-head { gap: var(--sp-1) var(--sp-2); }
  /* wide reference tables scroll sideways rather than squashing or overflowing */
  .pin-table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .pin-table th, .pin-table td { white-space: nowrap; }
  .diagram { overflow-x: auto; }
  pre { padding: 10px 11px; }
  .reveal summary { padding: 10px 12px; }     /* easier to tap open */
  .reveal-body { padding: 0 12px 12px; }
  .foot-inner { flex-direction: column; align-items: flex-start; gap: 10px; }
}
@media (max-width: 420px) {
  .wrap { padding: 0 16px; }
  .brand img { height: 19px; }
  .brand-link img { height: 26px; }
  .hero-row { gap: var(--sp-5); }
}

/* ---------- locked walkthroughs ---------- */
.reveal.guide.locked summary { color: var(--amber); }
.lockpill {
  font-family: var(--mono); font-size: var(--fs-micro); letter-spacing: .07em; text-transform: uppercase;
  color: var(--amber); border: 1px solid #5b4a1e; padding: 1px 6px; border-radius: 3px; margin-left: 8px;
}
.pinform { margin: 2px 0 0; }
.pinlead { font-size: var(--fs-ms); color: var(--text-dim); margin: 0 0 var(--sp-3); max-width: var(--measure); }
.pinrow { display: flex; gap: 8px; flex-wrap: wrap; }
.pinin {
  flex: 1 1 200px; min-width: 0;
  background: var(--bg-inset); border: 1px solid var(--border-strong); color: var(--text);
  font-family: var(--mono); font-size: var(--fs-ms); padding: 11px; border-radius: 4px;
}
.pinin::placeholder { color: var(--text-dimmer); opacity: 1; }
.pinin:focus { border-color: var(--accent-dim); }
.pinbtn {
  background: var(--accent); color: #07140b; border: none; cursor: pointer;
  font-family: var(--mono); font-size: var(--fs-sm); font-weight: 600;
  padding: 11px 18px; border-radius: 4px; min-height: 42px;
}
.pinbtn:hover { background: var(--accent-text); }
.pinmsg { font-family: var(--mono); font-size: var(--fs-sm); color: var(--text-dimmer); margin: var(--sp-3) 0 0; min-height: 1em; }
.pinmsg.bad { color: var(--red); }

/* ---------- board map (3D render + PCB-accurate callouts) ---------- */
.board-map { margin: 26px 0 34px; }
.bm-key { white-space: nowrap; }
.bm-key-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%;
              background: #ff5a4e; margin-right: 5px; vertical-align: baseline; }

.bm-stage { background: var(--bg-inset); border: 1px solid var(--border);
            border-radius: 6px; padding: 10px; margin: 14px 0 16px; }
.bm-inner { position: relative; }
.bm-svg { display: block; width: 100%; height: auto; border-radius: 3px; }

.bm-ring  { fill: none; stroke: #6d6d6d; stroke-width: 3; opacity: .85; }
.bm-tick  { stroke: #7a7a7a; stroke-width: 2; opacity: .55; }
.bm-badge { fill: #14181a; stroke: #6d6d6d; stroke-width: 2.5; }
.bm-num   { font-family: var(--mono); font-size: 19px; font-weight: 600; fill: #e8e8e8; }

.bm-row.is-interactive .bm-ring,
.bm-row.is-interactive .bm-tick  { stroke: var(--accent); opacity: .95; }
.bm-row.is-interactive .bm-badge { fill: #06240f; stroke: var(--accent); }
.bm-row.is-interactive .bm-num   { fill: #8ef5ab; }

.bm-pin1 { fill: #ff5a4e; stroke: #2b0b08; stroke-width: 2.5; }

.bm-hot circle { fill: transparent; cursor: pointer; }
.bm-hot:focus-visible circle { outline: none; fill: rgba(53,193,94,.2);
                               stroke: var(--accent); stroke-width: 3; }
.bm-row.is-active .bm-ring  { stroke: var(--accent); stroke-width: 5; opacity: 1; }
.bm-row.is-active .bm-badge { fill: var(--accent); stroke: #d6ffe2; }
.bm-row.is-active .bm-num   { fill: #06240f; }

/* legend */
.bm-legend { list-style: none; margin: 0 0 16px; padding: 0;
             display: grid; grid-template-columns: repeat(auto-fit, minmax(265px, 1fr)); gap: 2px 18px; }
.bm-leg a, .bm-leg span.bm-wrap, .bm-leg > span { display: grid;
  grid-template-columns: 26px 1fr; gap: 2px 10px; padding: 6px 8px; border-radius: 4px;
  border-bottom: none; color: var(--text-dim); }
.bm-leg a { color: var(--text-dim); }
.bm-leg a:hover, .bm-leg.is-active a { background: var(--bg-alt); color: var(--text); }
.bm-leg-n { grid-row: span 2; font-family: var(--mono); font-size: 12px; color: var(--text-dimmer);
            border: 1px solid var(--border-strong); border-radius: 50%; width: 24px; height: 24px;
            display: grid; place-items: center; align-self: start; }
.bm-leg.is-interactive .bm-leg-n { color: var(--accent-text); border-color: var(--accent-dim); }
.bm-leg.is-active .bm-leg-n { background: var(--accent); color: #06240f; border-color: var(--accent); }
.bm-leg-t { font-family: var(--mono); font-size: 13px; color: var(--text); }
.bm-leg.is-interactive .bm-leg-t { color: var(--accent-text); }
.bm-leg-s { font-size: 12px; color: var(--text-dimmer); grid-column: 2; }

/* detail panel */
.bm-detail { border: 1px solid var(--border); border-radius: 6px; padding: 16px 18px;
             background: var(--bg-alt); min-height: 92px; }
.bm-detail h3 { margin: 0 0 4px; font-size: 16px; }
.bm-val { font-family: var(--mono); font-size: 11.5px; color: var(--text-dimmer); margin-left: 6px; }
.bm-note, .bm-empty { margin: 0 0 12px; color: var(--text-dim); font-size: 14px; }
.bm-empty { margin: 0; }
.bm-panel-grid { display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 1fr);
                 gap: 18px; align-items: start; }
.bm-zoom { margin: 0; }
.bm-zoom img { width: 100%; height: auto; border: 1px solid var(--border-strong);
               border-radius: 4px; display: block; background: var(--bg-inset); }
.bm-zoom figcaption { font-size: 11.5px; color: var(--text-dimmer); margin-top: 6px;
                      font-family: var(--mono); }
.bm-pins { width: 100%; border-collapse: collapse; font-family: var(--mono); font-size: 12.5px; }
.bm-pins th { text-align: left; color: var(--text-dimmer); font-weight: 500; text-transform: uppercase;
              font-size: 10.5px; letter-spacing: .05em; padding: 4px 10px 4px 0;
              border-bottom: 1px solid var(--border); }
.bm-pins td { padding: 5px 10px 5px 0; border-bottom: 1px solid var(--border); color: var(--text-dim); }
.bm-pins .bm-pn { color: var(--text); width: 3em; }
.bm-pins .bm-net { color: var(--accent-text); }
.bm-pins tr.is-pin1 .bm-pn { color: #ff8a80; font-weight: 700; }
.bm-pins i { color: var(--text-dimmer); font-style: normal; }
.bm-ovl { text-decoration: overline; }

.bm-jump { margin: 10px 0 2px; font-family: var(--mono); font-size: 12.5px; }
.bm-jump-note { color: var(--text-dimmer); }

@media (max-width: 760px) {
  .bm-panel-grid { grid-template-columns: minmax(0, 1fr); }
  .bm-stage { overflow-x: auto; padding: 8px; }
  .bm-inner { min-width: 760px; }
}

/* ---------- home: minimal matrix flow behind the content ---------- */
#matrix-bg {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  /* fade it out down the page so it never fights the content below the fold */
  -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,.9) 0%, rgba(0,0,0,.5) 45%, rgba(0,0,0,0) 85%);
          mask-image: linear-gradient(to bottom, rgba(0,0,0,.9) 0%, rgba(0,0,0,.5) 45%, rgba(0,0,0,0) 85%);
}
/* lift real content above the canvas */
body > header.topbar,
body > main,
body > footer { position: relative; z-index: 1; }

/* ---------- index rows: give keyboard users the same feedback as hover ---------- */
.index-table tr[data-href]:focus-within { background: rgba(53,193,94,.055); }
.index-table tr[data-href]:focus-within td.ix-name a { color: var(--accent-text); }
.index-table tr[data-href]:focus-within td.ix-arrow { opacity: 1; transform: translateX(0); color: var(--accent-text); }

/* thumbnails sit bare on the page — no frame.
   The boards are landscape, so a landscape box lets them fill it instead of
   floating small inside a square. */
.index-table .ix-thumb img { width: 186px; height: 142px; object-fit: contain; }
@media (max-width: 760px) { .index-table .ix-thumb img { width: 124px; height: 96px; } }

/* close-up shot inside a challenge's Connection section */
.diagram.pinshot { margin: var(--sp-4) 0 var(--sp-5); }
/* height:auto is essential: the images carry width/height attributes for
   layout stability, and without it a capped width squashes them. */
.diagram.pinshot img { max-width: 460px; width: 100%; height: auto; }
.diagram.pinshot figcaption { font-family: var(--mono); font-size: var(--fs-xs);
  line-height: 1.5; color: var(--text-dimmer); margin-top: 7px; }

/* ================= layout utilities =================
   These replace per-page inline style="" attributes, which were the main
   source of the drift between pages: every page had invented its own section
   padding, its own two-column split and its own one-off font sizes. */

/* page sections. --flow is the standard gap between two stacked sections. */
.sec        { padding: var(--sp-7) 24px 0; }      /* a section in a stack */
.sec-first  { padding: var(--sp-7) 24px var(--sp-3); }  /* first one under the header */
.sec-last   { padding: var(--sp-7) 24px 72px; }   /* last one before the footer */
.sec-tight  { padding: var(--sp-5) 24px 0; }
.sec-docs   { padding: var(--sp-5) 24px 72px; }   /* the sidebar+content area */
@media (max-width: 760px) {
  .sec, .sec-first, .sec-tight, .sec-docs, .sec-last {
    padding-left: 16px; padding-right: 16px;
  }
  .sec, .sec-first { padding-top: var(--sp-6); }
  .sec-last, .sec-docs { padding-bottom: 56px; }
}

/* hero split: copy on the left, board photo on the right */
.split {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr);
  gap: var(--sp-6) 40px;
  align-items: center;
}
.split > img { width: 100%; height: auto; }
@media (max-width: 860px) {
  .split { grid-template-columns: minmax(0, 1fr); gap: var(--sp-5); }
  .split > img { max-width: 480px; margin: 0 auto; }
}

/* centred closing lines */
.closing { text-align: center; max-width: none; margin: var(--sp-6) auto var(--sp-2); color: var(--text); }
.closing + .closing { margin-top: 0; color: var(--text-dim); }

/* the home hero shows the wordmark itself as the heading */

/* Home hero: the wordmark acts as the heading, with the copy beside it. */
.hero-split { display: flex; align-items: center; justify-content: flex-start;
              gap: clamp(24px, 5vw, 64px); flex-wrap: wrap; }
.hero-split .hero-text { flex: 1 1 400px; min-width: 280px; }
.hero-mark { margin: 0; flex: 0 0 auto; line-height: 1; }
.hero-mark img { width: clamp(200px, 24vw, 310px); height: auto; display: block; }
@media (max-width: 760px) {
  .hero-split { flex-direction: column; align-items: flex-start; gap: 18px; }
  .hero-mark img { width: clamp(180px, 52vw, 240px); }
}

/* ---------- comfortable tap targets ----------
   WCAG 2.2 AA needs 24px; 44px is the comfortable thumb target. These are the
   rows people actually tap: nav, TOC entries and the hint/guide toggles. */
.navlinks a,
.toc a,
.reveal summary,
.sec-collapse > summary { min-height: 44px; box-sizing: border-box; }
.navlinks a { display: inline-flex; align-items: center; }
.skip-link, .pinin, .pinbtn { min-height: 44px; box-sizing: border-box; }
.foot-li { margin-left: 14px; padding-left: 14px; border-left: 1px solid var(--border);
           border-bottom: none; color: var(--text-dim); }
.foot-li:hover { color: var(--accent-text); }
