/* ---- colours --------------------------------------------------------------
   Every colour on the site comes from these tokens. --accent marks "you are
   here", the VPN tunnel and the current page; --link is for links. */
:root {
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  color-scheme: dark;
  scrollbar-color: var(--line-strong) var(--bg);
  --bg: #0c0e11; --surface: #13161a; --raised: #1a1e24; --sunken: #090b0d;
  --line: #242930; --line-strong: #353c46;
  --text: #e4e7eb; --text-2: #c2c8cf; --muted: #8d95a0; --faint: #646c77;
  --accent: #4fd1b0; --link: #93b4e6;
  --allow: #8fc18a; --red: #e58272;
}
:root {
  --accent-soft: color-mix(in srgb, var(--accent) 14%, transparent);
  --accent-mid: color-mix(in srgb, var(--accent) 24%, transparent);
  --allow-soft: color-mix(in srgb, var(--allow) 14%, transparent);
  --red-soft: color-mix(in srgb, var(--red) 14%, transparent);
  --red-line: color-mix(in srgb, var(--red) 45%, var(--bg));
  --tint: color-mix(in srgb, var(--text) 2%, transparent);
  --chip: color-mix(in srgb, var(--line-strong) 60%, var(--raised));
  --hover: color-mix(in srgb, var(--link) 8%, var(--raised));
  --code-text: color-mix(in srgb, var(--text) 94%, var(--link));
  --code-comment: color-mix(in srgb, var(--muted) 85%, var(--link));
  --wire: color-mix(in srgb, var(--muted) 60%, var(--line-strong));
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; overflow-y: scroll; }   /* a scrollbar on every page, short ones too: no sideways jump between pages */
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.6 var(--sans); }
a { color: var(--link); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.wrap { max-width: 1040px; margin: 0 auto; padding: 0 20px; }
.read { max-width: none; }

/* top bar: the site's sections */
.skip { position: absolute; left: -9999px; top: 8px; z-index: 60; background: var(--raised); color: var(--text); padding: 6px 12px; border-radius: 6px; }
.skip:focus { left: 12px; }
.bar { border-bottom: 1px solid var(--line); }
.bar .wrap { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 24px; padding-top: 18px; padding-bottom: 16px; }
.brand { color: var(--text); text-decoration: none; font-weight: 650; letter-spacing: -0.01em; }
.brand:hover { color: var(--text); }
.nav { display: flex; flex-wrap: wrap; gap: 4px 22px; font-size: 15px; }
.nav a { color: var(--muted); text-decoration: none; padding: 2px 0; border-bottom: 2px solid transparent; }
.nav a:hover { color: var(--text); }
.nav a[aria-current] { color: var(--accent); border-bottom-color: var(--accent); }
@media (max-width: 520px) { .bar .wrap { display: block; } .nav { margin-top: 10px; gap: 4px 14px; } }

/* the band under the top bar, on every page: where you are, and a fact or two */
.crumbs { border-bottom: 1px solid var(--line); background: var(--surface); }
.crumbs .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 24px; font-family: var(--mono); font-size: 13px; color: var(--muted); padding-top: 9px; padding-bottom: 9px; }
.crumbs .trail { overflow-wrap: anywhere; min-width: 0; }
.crumbs .aside { color: var(--faint); white-space: nowrap; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--accent); }
.crumbs .sep { color: var(--faint); padding: 0 6px; }
.crumbs .here { color: var(--text); }

/* the page: same frame everywhere, footer at the bottom of the window */
body { min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1 0 auto; width: 100%; }
.page-head { margin-bottom: 28px; }
.page-head h1 { margin-bottom: 12px; }
.page-head .lead { margin-bottom: 0; max-width: 62em; }
main.wrap { padding: 36px 20px 64px; }
main:focus { outline: none; }
h1 { font-size: clamp(28px, 3.4vw, 36px); line-height: 1.15; letter-spacing: -0.02em; margin: 0 0 14px; font-weight: 680; }
h2 { font-size: 21px; letter-spacing: -0.01em; margin: 44px 0 10px; font-weight: 640; }
p { margin: 0 0 14px; }
.lead { font-size: 19px; line-height: 1.55; color: var(--text-2); margin-bottom: 26px; }
.muted { color: var(--muted); }
code { font-family: var(--mono); font-size: 0.88em; background: var(--raised); padding: 1px 5px; border-radius: 4px; }
kbd { font-family: var(--mono); font-size: 12px; border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 4px; padding: 0 5px; color: var(--text); }


/* ---- the diagram ------------------------------------------------------ */
.diagram-frame { border: 1px solid var(--line); background: var(--surface); border-radius: 14px; padding: 8px; }
.netmap { display: block; width: 100%; height: auto; }
.trace-caption { font-size: 15px; color: var(--muted); margin: 12px 2px 0; min-height: 1.6em; }
.trace-caption strong { color: var(--text); font-weight: 600; }
.trace-caption .amber { color: var(--accent); }
.trace-caption.probe { position: absolute; visibility: hidden; display: block !important; min-height: 0; left: 0; top: 0; }
.map-area { position: relative; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 22px; font-size: 14px; color: var(--muted); margin: 8px 2px 0; }
.legend span { display: inline-flex; align-items: center; gap: 8px; }
.legend i { display: inline-block; width: 26px; height: 0; border-top: 2px solid var(--line-strong); }
.legend i.tunnel { border-top-color: var(--accent); }
.legend i.direct { border-top: 2px dashed var(--muted); }
.legend i.sel { width: 18px; height: 12px; border: 1.5px solid var(--accent); background: var(--accent-soft); border-radius: 3px; }

.d-cable { fill: none; stroke: var(--line-strong); stroke-width: 1.5; transition: opacity .15s; }
.d-cable.tunnel { stroke: var(--accent); stroke-width: 2.5; }
.d-cable.direct { stroke: var(--muted); stroke-dasharray: 5 5; }
.d-box { fill: var(--raised); stroke: var(--line-strong); stroke-width: 1.2; }
.d-group { fill: var(--tint); stroke: var(--line); stroke-width: 1.2; }
.d-chip { fill: var(--chip); }
.d-chip-text { fill: var(--text); }
.d-name { fill: var(--text); font: 600 14px var(--sans); }
.d-sub { fill: var(--muted); font: 12.5px var(--sans); }
.d-port { fill: var(--faint); font: 12px var(--mono); }
.d-label { fill: var(--muted); font: 12.5px var(--sans); }
.d-label.amber { fill: var(--accent); }

.node { cursor: pointer; }
.node:focus { outline: none; }
.node:hover > .d-box, .node:focus-visible > .d-box,
.node:hover > .d-group, .node:focus-visible > .d-group { stroke: var(--link); }
.node:focus-visible > .d-box, .node:focus-visible > .d-group { stroke-width: 2; }
.net:hover > .d-box { stroke: var(--link); fill: var(--hover); }

/* you are here */
.sel > .d-box, .sel > .d-group { fill: var(--accent-soft); stroke: var(--accent); stroke-width: 1.6; }
.node.sel:hover > .d-box, .node.sel:focus-visible > .d-box { fill: var(--accent-mid); stroke: var(--accent); }
.sel > .d-name { fill: var(--text); }
.d-cable.tunnel.sel { stroke-width: 3.5; }

/* tracing a network's way out */
.trace { fill: none; stroke: none; stroke-width: 3; stroke-linejoin: round; }
.trace-stop { display: none; fill: var(--red); font: 600 12.5px var(--sans); }
.netmap.tracing .d-cable { opacity: 0.3; }
.netmap.tracing .trace.on { stroke: var(--text); }
.netmap.tracing .trace.up-tunnel.on { stroke: var(--accent); }
.netmap.tracing .trace.up-direct.on { stroke: var(--text); stroke-dasharray: 6 5; }
.netmap.tracing.nowhere .trace-stop { display: block; }

/* ---- phones: a stacked list instead of the drawing --------------------- */
.stack { display: none; }
@media (max-width: 720px) {
  .diagram-frame, .legend { display: none; }
  .stack { display: block; border: 1px solid var(--line); background: var(--surface); border-radius: 14px; padding: 6px; }
  .trace-caption { display: none; }
}
.s-head { color: var(--muted); font-size: 13px; padding: 10px 10px 4px; }
.s-row {
  display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; align-items: baseline;
  padding: 10px; border-radius: 9px; text-decoration: none; color: var(--text); border: 1px solid transparent;
}
.s-row:hover { color: var(--text); background: var(--raised); }
.s-row .s-name { font-weight: 620; }
.s-row .s-sub { grid-column: 1 / -1; color: var(--muted); font-size: 14px; }
.s-row.indent { margin-left: 18px; }
.s-row.sel { background: var(--accent-soft); border-color: var(--accent); }
.badge { font-size: 12.5px; border-radius: 999px; padding: 1px 9px; border: 1px solid var(--line-strong); color: var(--muted); white-space: nowrap; }
.badge.tunnel { border-color: var(--accent); color: var(--accent); }
.badge.none { border-color: var(--red-line); color: var(--red); }

/* ---- content below the diagram ----------------------------------------- */
.content { margin-top: 40px; padding-top: 34px; border-top: 1px solid var(--line); }

/* home: list of areas */
.areas { list-style: none; margin: -18px 0 0; padding: 0; }
.areas li { border-bottom: 1px solid var(--line); }
.areas a { display: grid; grid-template-columns: minmax(150px, 220px) 1fr; gap: 6px 24px; padding: 16px 0; text-decoration: none; color: var(--text); }
.areas a:hover .a-name { color: var(--accent); }
.a-name { font-weight: 620; }
.a-line { color: var(--muted); }
@media (max-width: 640px) { .areas a { grid-template-columns: 1fr; } }

.facts { display: grid; grid-template-columns: max-content 1fr; gap: 8px 22px; margin: 0 0 8px; padding: 18px 20px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
@media (max-width: 560px) { .facts { grid-template-columns: 1fr; gap: 2px; } .facts dd { margin-bottom: 8px; } }

table { width: 100%; border-collapse: collapse; margin: 6px 0 18px; font-size: 15px; }
th, td { text-align: left; padding: 9px 12px 9px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 560; }
.table-scroll { overflow-x: auto; }
ul.plain { padding-left: 20px; margin: 0 0 14px; }
ul.plain li { margin-bottom: 6px; }

/* figures */
figure.fig { margin: 18px 0 24px; }
figure.fig .fig-frame { border: 1px solid var(--line); background: var(--surface); border-radius: 12px; padding: 10px; }
figure.fig svg { display: block; width: 100%; height: auto; }
figure.fig figcaption { color: var(--muted); font-size: 14.5px; margin-top: 8px; }
.fig .box { fill: var(--raised); stroke: var(--line-strong); stroke-width: 1.2; }
.fig .box.hi { fill: var(--accent-soft); stroke: var(--accent); }
.fig .grp { fill: var(--tint); stroke: var(--line); stroke-width: 1.2; }
.fig .name { fill: var(--text); font: 600 14px var(--sans); }
.fig .sub { fill: var(--muted); font: 12.5px var(--sans); }
.fig .lbl { fill: var(--muted); font: 12px var(--mono); }
.fig .lbl.amber { fill: var(--accent); }
.fig .wire { fill: none; stroke: var(--wire); stroke-width: 1.4; }
.arrowhead { fill: var(--wire); }
.fig .wire.amber { stroke: var(--accent); stroke-width: 2; }
.fig .wire.dash { stroke-dasharray: 5 4; }

/* code */
figure.code { margin: 22px 0 26px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--sunken); }
figure.code figcaption { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 9px 12px 9px 16px; border-bottom: 1px solid var(--line); background: var(--surface); font: 13px var(--mono); color: var(--muted); }
figure.code button { font: 13px var(--sans); color: var(--muted); background: transparent; border: 1px solid var(--line); border-radius: 6px; padding: 3px 10px; cursor: pointer; }
figure.code button:hover { color: var(--text); border-color: var(--line-strong); }
figure.code pre { margin: 0; padding: 14px 16px; overflow-x: auto; font: 13.5px/1.6 var(--mono); color: var(--code-text); tab-size: 4; }
figure.code pre code { background: none; padding: 0; font-size: inherit; border-radius: 0; }
figure.code pre .c { color: var(--code-comment); }
figure.code .notes { margin: 0; padding: 12px 16px 14px 34px; border-top: 1px solid var(--line); font-size: 15px; color: var(--text-2); }
figure.code .notes li { margin-bottom: 4px; }

/* deeper, related, prev/next */
.deeper { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 10px; }
.deeper a { display: block; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; text-decoration: none; color: var(--text); background: var(--surface); }
.deeper a:hover { border-color: var(--accent); }
.deeper .d-t { font-weight: 620; display: block; }
.deeper .d-l { color: var(--muted); font-size: 15px; }
.related { margin-top: 30px; color: var(--muted); font-size: 15px; }
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 44px; padding-top: 22px; border-top: 1px solid var(--line); }
.pager a { display: block; text-decoration: none; color: var(--text); padding: 10px 0; }
.pager a:hover .p-t { color: var(--accent); }
.pager .p-k { display: block; color: var(--muted); font-size: 13.5px; }
.pager .p-t { font-weight: 620; }
.pager .next { text-align: right; grid-column: 2; }

/* footer */
footer { border-top: 1px solid var(--line); color: var(--faint); font-size: 14px; }
footer .wrap { padding-top: 18px; padding-bottom: 28px; display: grid; gap: 6px; }
footer a { color: var(--muted); }
footer .owner { color: var(--muted); }


/* ---- additions: switch, flows, motion, glossary, anchors ------------- */
.red { color: var(--red); }
.legend i.allow { border-top-color: var(--allow); }

.controls { display: flex; flex-wrap: wrap; gap: 10px; margin: 14px 2px 0; }
.toggle {
  font: 14px var(--sans); color: var(--text); background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: 999px; padding: 6px 14px; cursor: pointer;
}
.toggle:hover { border-color: var(--link); }
.toggle[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
#plug[aria-pressed="true"] { border-color: var(--red); background: var(--red-soft); }

.flows { margin: 12px 2px 0; }
.flows[hidden] { display: none; }
.flows-head { color: var(--muted); font-size: 14.5px; margin-bottom: 8px; }
.flows ul { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 8px; }
.flow {
  width: 100%; text-align: left; display: grid; grid-template-columns: 1fr auto; gap: 2px 12px;
  font: 14px var(--sans); color: var(--text); background: var(--surface); border: 1px solid var(--line);
  border-radius: 10px; padding: 10px 12px; cursor: pointer;
}
.flow:hover, .flow:focus-visible { border-color: var(--allow); }
.flow .f-what { font-weight: 600; }
.flow .f-ports { font: 12.5px var(--mono); color: var(--allow); white-space: nowrap; }
.flow .f-why { grid-column: 1 / -1; color: var(--muted); font-size: 13.5px; }

/* allowed flow in the diagram */
.netmap.flowing .d-cable { opacity: 0.3; }
.netmap.flowing .trace.flow { stroke: var(--allow); }
.ep > .d-box, .ep > .d-group { stroke: var(--allow) !important; fill: var(--allow-soft) !important; stroke-width: 1.8; }

/* tunnel down */
.plug-cut, .plug-note { display: none; font: 600 12.5px var(--sans); fill: var(--red); }
.plug-note { fill: var(--muted); font-weight: 400; }
.netmap.plugged .lbl-tunnel { display: none; }
.netmap.plugged .plug-cut, .netmap.plugged .plug-note { display: block; }
.netmap.plugged .d-cable.tunnel { stroke: var(--red); stroke-dasharray: 3 5; }
.netmap.plugged [data-up="tunnel"] > .d-box, .netmap.plugged [data-up="tunnel"] > .d-group { stroke: var(--red); fill: var(--red-soft); }
.netmap.plugged [data-up="direct"] > .d-box { stroke-dasharray: 5 4; }
.netmap.plugged.tracing .trace.up-tunnel.on { stroke: var(--red); stroke-dasharray: 3 5; animation: none; }
.stack.plugged .s-row[data-up="tunnel"], .stack.plugged .s-row[data-tunnel] { border-color: var(--red); background: var(--red-soft); }
@media (max-width: 720px) { .map-area.plugged .trace-caption { display: block; } }

/* packets moving along a traced path */
@media (prefers-reduced-motion: no-preference) {
  .netmap.tracing .trace.on { stroke-dasharray: 9 6; animation: flow 0.8s linear infinite; }
  @keyframes flow { to { stroke-dashoffset: -30; } }
}

/* a selected network row in the table */
tr.row-sel td { background: var(--accent-soft); }
tr.row-sel td:first-child { box-shadow: inset 3px 0 0 var(--accent); padding-left: 10px; }

/* glossary */
.term { border-bottom: 1px dotted var(--muted); cursor: help; }
.term:focus { outline: none; border-bottom-color: var(--accent); }
.term.open { border-bottom-color: var(--accent); }
/* one floating box for every definition, so no table or code box can clip it */
#tip {
  position: fixed; z-index: 50; max-width: min(340px, calc(100vw - 24px));
  background: var(--raised); color: var(--text); border: 1px solid var(--line-strong); border-radius: 8px;
  padding: 8px 10px; font: 400 14px/1.45 var(--sans); box-shadow: 0 6px 24px rgba(0,0,0,0.4);
  pointer-events: none;
}
#tip[hidden] { display: none; }

/* links to sections */
h2 { position: relative; }
h2 .anchor { margin-left: 10px; font-weight: 400; color: var(--faint); text-decoration: none; opacity: 0; }
h2:hover .anchor, h2 .anchor:focus-visible { opacity: 1; }
h2 .anchor:hover { color: var(--accent); }
@media (hover: none) { h2 .anchor { opacity: 0.6; } }

/* a network picked from the diagram, or linked to directly */
tr:target td { background: var(--accent-soft); }
tr:target td:first-child { box-shadow: inset 3px 0 0 var(--accent); padding-left: 10px; }
.controls[hidden] { display: none; }
figure.code button[hidden] { display: none; }
.term { cursor: help; }

/* ---- the rest of the site ---------------------------------------------- */
.prose h2 { margin-top: 36px; }
.prose ul.plain li { margin-bottom: 8px; }
mark.todo { background: var(--accent-soft); color: var(--accent); border: 1px dashed var(--accent); border-radius: 4px; padding: 0 5px; }


/* write-ups */
.posts { list-style: none; padding: 0; margin: 6px 0 0; }
.posts li { border-bottom: 1px solid var(--line); }
.posts li:first-child { border-top: 1px solid var(--line); }
.posts a { display: grid; grid-template-columns: 1fr auto; gap: 4px 24px; padding: 16px 0; text-decoration: none; color: var(--text); }
.posts a:hover .p-title { color: var(--accent); }
.posts .p-title { font-weight: 620; font-size: 17px; }
.posts .p-sum { grid-column: 1; color: var(--muted); }
.posts time { grid-column: 2; grid-row: 1; color: var(--faint); font-size: 14px; white-space: nowrap; }
@media (max-width: 560px) { .posts a { grid-template-columns: 1fr; } .posts time { grid-column: 1; grid-row: auto; } }
.post .lead { margin-bottom: 30px; }

footer .keys { color: var(--faint); }
@media (hover: none) { footer .keys { display: none; } }

/* ---- build guide ------------------------------------------------------- */
.ph { color: var(--accent); background: var(--accent-soft); border-radius: 3px; }
code.ph { padding: 1px 5px; }
.callout { border-left: 3px solid var(--accent); background: var(--accent-soft); padding: 10px 14px; border-radius: 0 8px 8px 0; color: var(--text); }
figure.code figcaption .cap-actions { display: inline-flex; gap: 10px; align-items: center; }
figure.code .dl { font: 13px var(--sans); color: var(--link); }
figure.code .cap-note { color: var(--faint); margin-left: 8px; font-family: var(--sans); }
figure.code.cmd figcaption { font-family: var(--sans); font-size: 13px; color: var(--faint); }
.check { margin: -10px 0 26px; padding: 0 0 0 16px; border-left: 2px solid var(--allow); }
.check .check-k { margin: 0 0 6px; padding-top: 2px; font: 12.5px var(--mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--allow); }
.check figure.code { margin: 0 0 10px; }
.check .check-e { margin: 0; color: var(--text-2); }
.guide-ch h2 { margin-top: 40px; }
.chapters { list-style: none; padding: 0; margin: 10px 0 0; counter-reset: none; }
.chapters li { border-bottom: 1px solid var(--line); }
.chapters li:first-child { border-top: 1px solid var(--line); }
.chapters a, .chapters li.later { display: grid; grid-template-columns: 34px minmax(180px, 280px) 1fr; gap: 4px 18px; padding: 14px 0; text-decoration: none; color: var(--text); }
.chapters a:hover .c-t { color: var(--accent); }
.chapters .c-n { color: var(--faint); font: 14px var(--mono); padding-top: 2px; }
.chapters .c-t { font-weight: 620; }
.chapters .c-l { color: var(--muted); }
.chapters li.later .c-t, .chapters li.later .c-l { color: var(--faint); }
.chapters li.later em, .chapters li.soon em { font-style: normal; }
.chapters li.soon .c-t { color: var(--muted); }
@media (max-width: 640px) { .chapters a, .chapters li.later { grid-template-columns: 30px 1fr; } .chapters .c-l { grid-column: 2; } }
details.fold summary { cursor: pointer; padding: 12px 16px; color: var(--link); font-size: 14.5px; }
details.fold summary:hover { color: var(--accent); }
details.fold[open] summary { border-bottom: 1px solid var(--line); }
figure.code figcaption { flex-wrap: wrap; }
figure.code figcaption > span:first-child { overflow-wrap: anywhere; min-width: 0; }

/* screenshots in the guide */
.shots { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin: 18px 0 26px; align-items: start; }
.shots figure { margin: 0; }
.shots img { display: block; width: 100%; height: auto; border: 1px solid var(--line); border-radius: 10px; }
.shots figcaption { color: var(--muted); font-size: 14px; margin-top: 6px; }
.shots.photos { grid-template-columns: 2fr 3fr; }
@media (max-width: 640px) { .shots, .shots.photos { grid-template-columns: 1fr; } }
figure.shot-narrow { margin: 18px 0 26px; max-width: 300px; }
figure.shot-photo { max-width: 380px; }
figure.shot-narrow img { display: block; width: 100%; height: auto; border: 1px solid var(--line); border-radius: 10px; }
figure.shot-narrow figcaption { color: var(--muted); font-size: 14px; margin-top: 6px; }
figure.fig-shot { margin: 18px 0 26px; }
figure.fig-shot img { display: block; max-width: 100%; width: auto; height: auto; border: 1px solid var(--line); border-radius: 10px; }
figure.fig-shot figcaption { color: var(--muted); font-size: 14px; margin-top: 6px; }

/* guide: when each chapter was tested, and a table of contents for long chapters */
.guide-ch .tested { color: var(--muted); font-size: 14px; margin: 0 0 8px; }
.guide-ch .page-head + .tested { margin-top: -10px; }
.guide-ch .tested + :not(.tested) { margin-top: 22px; }
.guide-ch .tested .t-k { display: inline-block; font: 600 11px var(--sans); letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); border: 1px solid var(--line-strong); border-radius: 5px; padding: 1px 6px; margin-right: 4px; vertical-align: 1px; min-width: 62px; text-align: center; }
.toc { margin: 0 0 28px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.toc summary { cursor: pointer; padding: 10px 14px; font-weight: 600; font-size: 15px; list-style: none; }
.toc summary::-webkit-details-marker { display: none; }
.toc summary::before { content: "▸"; display: inline-block; width: 1.1em; color: var(--muted); transition: transform .15s; }
.toc[open] summary::before { transform: rotate(90deg); }
.toc .toc-n { color: var(--muted); font-weight: 400; font-size: 14px; margin-left: 6px; }
.toc ul { margin: 0; padding: 2px 14px 12px 32px; list-style: none; columns: 2; column-gap: 32px; }
.toc li { margin: 0; padding: 3px 0; break-inside: avoid; font-size: 15px; }
.toc a { color: var(--text); text-decoration: none; }
.toc a:hover { color: var(--accent); }
@media (max-width: 640px) { .toc ul { columns: 1; } }
@media (prefers-reduced-motion: reduce) { .toc summary::before { transition: none; } }

/* ---- home: a landing page, just the name ------------------- */
.landing { min-height: calc(100vh - 290px); display: grid; place-items: center; align-content: center; gap: 34px; padding: 24px 0 8px; text-align: center; }
.wordmark { margin: 0; font-size: clamp(56px, 11vw, 120px); line-height: 1; font-weight: 720; letter-spacing: -0.035em; color: var(--text); }
.wordmark::after { content: ""; display: block; width: 0.5em; height: 4px; margin: 0.22em auto 0; border-radius: 2px; background: var(--accent); }

/* ---- the design switch, and the parts only the BBS design shows ---------- */
.design-toggle { font: inherit; font-size: 13px; color: var(--muted); background: none; border: 1px solid var(--line); border-radius: 999px; padding: 0 10px; cursor: pointer; align-self: center; }
.design-toggle:hover { color: var(--accent); border-color: var(--accent); }
.design-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.crumbs .t-prompt, .ansi-logo { display: none; }
