/* moonip — the documentation is a wire diagram, not a landing page.
   A live IP header rides the top of the window, every section is a field in a
   register map with its own rail, and the bit grid is drawn the way RFC field
   diagrams are: bytes separated, groups outlined, the mask shown as a bracket.
   Two signal colours, used only for the two families. */

:root {
  --ground: #e6e2d6;
  --field: #fbfaf5;
  --panel: #101314;
  --panel-ink: #ded9ca;
  --ink: #0c0e0f;
  --ink-2: #4c5250;
  --rule: #0c0e0f;
  --rule-soft: color-mix(in srgb, var(--ink) 16%, transparent);
  --rule-mid: color-mix(in srgb, var(--ink) 42%, transparent);
  --v4: #b03d0a;
  --v4-soft: color-mix(in srgb, #d7711f 22%, var(--field));
  --v6: #0a6459;
  --v6-soft: color-mix(in srgb, #12857a 22%, var(--field));
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Archivo", "Inter", ui-sans-serif, system-ui, sans-serif;
  --rail: clamp(40px, 6vw, 88px);
  --pad: clamp(16px, 2.6vw, 34px);
  --hdr: 44px;
  color-scheme: light dark;
}

/* The same dark palette twice, because a media query and an attribute cannot share
   a block: the first copy answers the system, the second answers the switch on the
   explorer, which writes data-theme on the root and outranks the system either way.
   Change one and change the other. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ground: #070809;
    --field: #0e1113;
    --panel: #151a1c;
    --panel-ink: #e2ddce;
    --ink: #e7e2d4;
    --ink-2: #9aa09c;
    --rule: color-mix(in srgb, var(--ink) 72%, transparent);
    --rule-soft: color-mix(in srgb, var(--ink) 15%, transparent);
    --rule-mid: color-mix(in srgb, var(--ink) 34%, transparent);
    --v4: #f0863a;
    --v4-soft: color-mix(in srgb, #f0863a 16%, var(--field));
    --v6: #3fc7b8;
    --v6-soft: color-mix(in srgb, #3fc7b8 16%, var(--field));
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --ground: #070809;
  --field: #0e1113;
  --panel: #151a1c;
  --panel-ink: #e2ddce;
  --ink: #e7e2d4;
  --ink-2: #9aa09c;
  --rule: color-mix(in srgb, var(--ink) 72%, transparent);
  --rule-soft: color-mix(in srgb, var(--ink) 15%, transparent);
  --rule-mid: color-mix(in srgb, var(--ink) 34%, transparent);
  --v4: #f0863a;
  --v4-soft: color-mix(in srgb, #f0863a 16%, var(--field));
  --v6: #3fc7b8;
  --v6-soft: color-mix(in srgb, #3fc7b8 16%, var(--field));
  color-scheme: dark;
}

:root[data-theme="light"] {
  color-scheme: light;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  background: var(--ground);
}

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

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.62;
  font-feature-settings: "kern" 1;
  -webkit-font-smoothing: antialiased;
}

html,
button,
input,
textarea,
select {
  font-variant-ligatures: no-contextual;
}

code,
kbd,
pre,
.mono {
  font-family: var(--mono);
  font-variant-ligatures: none;
}

a {
  color: inherit;
  text-decoration-color: var(--rule-mid);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  text-decoration-color: var(--v4);
}

::selection {
  background: color-mix(in srgb, var(--v4) 30%, transparent);
}

/* ---------- what a click does not do ----------
   A header strip, a rail, a bit grid and a ladder are surfaces, not text. Dragging
   across them should never leave a selection smear, and a long press on a phone
   should not raise the copy sheet over a diagram. Prose, code, signatures, form
   fields and the answer lines keep their text: those are what a reader copies. */

button,
.hdr,
.totop,
.rail,
.label,
.kicker,
.figcap b,
.bits,
.hmap,
.hmap-out,
.encap,
.spec,
.tag,
.blocks,
.guide-nav,
.exhibit-head,
.frag-stage,
.frag-side,
.ladder,
.chips,
.trailer {
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

/* ---------- frame ---------- */

.frame {
  max-width: 1280px;
  margin: 0 auto;
  border-left: 1px solid var(--rule);
  border-right: 1px solid var(--rule);
  background: var(--field);
}

@media (width <= 1080px) {
  .frame {
    border-left: 0;
    border-right: 0;
  }
}

/* ---------- the header is a header ---------- */

.hdr {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--ground);
  border-bottom: 1px solid var(--rule);
}

.hdr-in {
  max-width: 1280px;
  margin: 0 auto;
  height: var(--hdr);
  display: flex;
  align-items: stretch;
  border-left: 1px solid var(--rule);
  border-right: 1px solid var(--rule);
  background: var(--field);
}

@media (width <= 1080px) {
  .hdr-in {
    border-left: 0;
    border-right: 0;
  }
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 14px;
  border-right: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.01em;
  text-decoration: none;
  flex: none;
}

.glyph {
  display: grid;
  grid-template-columns: repeat(4, 4px);
  grid-auto-rows: 4px;
  gap: 2px;
  padding: 2px;
  border: 1px solid var(--rule);
}

.glyph i {
  display: block;
  background: var(--rule-soft);
}

.glyph i.v4 {
  background: var(--v4);
}

.glyph i.v6 {
  background: var(--v6);
}

.pkt {
  display: flex;
  min-width: 0;
  overflow: hidden;
}

.pkt .c {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  padding: 0 10px;
  border-right: 1px solid var(--rule-soft);
  min-width: 0;
}

.pkt .c:last-child {
  border-right: 0;
}

.pkt .c i {
  font-family: var(--mono);
  font-style: normal;
  font-size: 8px;
  line-height: 1;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-2);
  white-space: nowrap;
}

.pkt .c b {
  font-family: var(--mono);
  font-weight: 500;
  font-size: 11px;
  line-height: 1;
  white-space: nowrap;
}

@media (width <= 1120px) {
  .pkt .c.maybe {
    display: none;
  }
}

@media (width <= 860px) {
  .pkt {
    display: none;
  }
}

nav.nav {
  margin-left: auto;
  display: flex;
  align-items: stretch;
  border-left: 1px solid var(--rule);
}

nav.nav a {
  display: flex;
  align-items: center;
  padding: 0 13px;
  border-right: 1px solid var(--rule-soft);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.02em;
  text-decoration: none;
  color: var(--ink-2);
  white-space: nowrap;
}

nav.nav a:hover {
  color: var(--ink);
  background: color-mix(in srgb, var(--ink) 6%, transparent);
}

nav.nav a.on {
  color: var(--field);
  background: var(--ink);
}

nav.nav a.gh {
  padding: 0 11px;
  border-right: 0;
}

nav.nav svg {
  width: 15px;
  height: 15px;
  display: block;
}

@media (width <= 620px) {
  nav.nav a {
    padding: 0 5px;
    font-size: 11px;
  }

  nav.nav a.gh {
    display: none;
  }
}

/* ---------- sections are fields ---------- */

.row {
  display: grid;
  grid-template-columns: var(--rail) minmax(0, 1fr);
  border-top: 1px solid var(--rule);
}

.row:first-child {
  border-top: 0;
}

.rail {
  border-right: 1px solid var(--rule);
  padding: 14px 0;
  position: relative;
  background: color-mix(in srgb, var(--ink) 3%, var(--field));
}

.rail span {
  position: sticky;
  top: calc(var(--hdr) + 14px);
  display: block;
  padding: 0 8px;
  font-family: var(--mono);
  font-size: 10px;
  line-height: 1.5;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-2);
  writing-mode: vertical-rl;
  height: max-content;
}

.rail span b {
  color: var(--v4);
  font-weight: 500;
}

.field {
  padding: 30px var(--pad) 38px;
  min-width: 0;
}

.field > :first-child {
  margin-top: 0;
}

@media (width <= 860px) {
  :root {
    --rail: 30px;
  }

  .rail span {
    font-size: 9px;
    padding: 0 5px;
  }

  .field {
    padding: 22px 16px 28px;
  }
}

/* ---------- type ---------- */

h1,
h2,
h3,
h4 {
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 0.94;
  margin: 0;
  text-wrap: balance;
}

.display {
  font-size: clamp(34px, 6.4vw, 76px);
  text-transform: uppercase;
  letter-spacing: -0.035em;
}

h2.section {
  font-size: clamp(21px, 2.5vw, 30px);
  text-transform: uppercase;
  letter-spacing: -0.02em;
}

h3 {
  font-size: 17px;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

p {
  margin: 0 0 1em;
  max-width: 66ch;
}

p:last-child {
  margin-bottom: 0;
}

.lede {
  font-size: clamp(15.5px, 1.4vw, 18px);
  line-height: 1.55;
  color: var(--ink-2);
  max-width: 58ch;
}

strong {
  font-weight: 600;
  color: var(--ink);
}

.label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.label b {
  color: var(--ink);
  font-weight: 500;
}

.kicker {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.kicker::before {
  content: "";
  width: 26px;
  height: 1px;
  background: var(--v4);
  flex: none;
}

/* ---------- the bit grid ---------- */

.wire {
  border: 1px solid var(--rule);
  background: var(--field);
  margin: 0;
}

.wire-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 16px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: 11.5px;
}

.wire-head .addr {
  font-weight: 500;
}

.wire-head .meta {
  margin-left: auto;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.bits {
  display: grid;
  grid-template-columns: repeat(32, minmax(0, 1fr));
  padding: 10px;
}

.bits .b {
  height: 25px;
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--rule-mid);
  border-right: 1px solid var(--rule-soft);
  border-bottom: 1px solid var(--rule-soft);
  background: transparent;
}

.bits .b:nth-child(8n) {
  border-right-color: var(--rule-mid);
}

.bits .b:nth-child(16n) {
  border-right-color: var(--rule);
}

.bits .b:nth-child(32n) {
  border-right: 0;
}

.bits .b.one {
  color: var(--ink);
  font-weight: 500;
}

.bits .b.v4.one {
  background: var(--v4-soft);
  color: var(--v4);
}

.bits .b.v6.one {
  background: var(--v6-soft);
  color: var(--v6);
}

/* Host bits are the same bits, one mask quieter. */
.bits .b.host.one {
  background: color-mix(in srgb, var(--ink) 7%, transparent);
  color: var(--ink-2);
}

.bits.sixteen {
  grid-template-columns: repeat(16, minmax(0, 1fr));
}

.bits.sixteen .b:nth-child(16n) {
  border-right: 0;
}

.wire-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 20px;
  padding: 8px 10px;
  border-top: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-2);
}

.wire-foot b {
  color: var(--ink);
  font-weight: 500;
}

.wire-foot .m {
  color: var(--v4);
  margin-left: auto;
}

@media (width <= 760px) {
  .bits {
    grid-template-columns: repeat(16, minmax(0, 1fr));
  }

  .bits .b {
    height: 20px;
    font-size: 0;
  }

  .bits .b.one::after {
    content: "";
    width: 3px;
    height: 3px;
    background: currentColor;
    border-radius: 50%;
  }

  .bits .b:nth-child(16n) {
    border-right: 0;
  }
}

/* ---------- encapsulation ---------- */

.encap {
  display: flex;
  border: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: 11px;
  overflow-x: auto;
}

.encap > div {
  padding: 10px 10px 12px;
  border-right: 1px solid var(--rule);
  min-width: 96px;
  flex: 0 0 auto;
}

.encap > div:last-child {
  border-right: 0;
  flex: 1 1 auto;
  min-width: 90px;
}

.encap b {
  display: block;
  font-weight: 500;
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.encap span {
  color: var(--ink-2);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.encap .here {
  background: var(--v4-soft);
}

.encap .here b {
  color: var(--v4);
}

.encap .above,
.encap .below {
  background: repeating-linear-gradient(
    -45deg,
    transparent 0 5px,
    color-mix(in srgb, var(--ink) 7%, transparent) 5px 6px
  );
  color: var(--ink-2);
}

/* ---------- tables ---------- */

.tbl-wrap {
  border: 1px solid var(--rule);
  overflow-x: auto;
}

/* A data table narrower than this would break every cell onto its own line, so it
   scrolls in its own box instead of squeezing. */
.tbl-wrap table {
  min-width: 560px;
}

table {
  border-collapse: collapse;
  width: 100%;
  font-size: 13.5px;
}

th,
td {
  text-align: left;
  padding: 8px 12px;
  border-bottom: 1px solid var(--rule-soft);
  border-right: 1px solid var(--rule-soft);
  vertical-align: baseline;
}

th:last-child,
td:last-child {
  border-right: 0;
}

tr:last-child td {
  border-bottom: 0;
}

th {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-2);
  font-weight: 500;
  white-space: nowrap;
  background: color-mix(in srgb, var(--ink) 4%, transparent);
  border-bottom-color: var(--rule);
}

td {
  color: var(--ink-2);
}

td:first-child {
  color: var(--ink);
}

td.t {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--ink);
  white-space: nowrap;
}

td.n {
  font-family: var(--mono);
  font-size: 12px;
  white-space: nowrap;
  color: var(--ink);
}

td code,
p code,
li code,
dd code {
  font-size: 12.5px;
  background: color-mix(in srgb, var(--ink) 7%, transparent);
  padding: 1px 4px;
  color: var(--ink);
  overflow-wrap: anywhere;
}

/* ---------- code ---------- */

.code {
  position: relative;
  background: var(--panel);
  color: var(--panel-ink);
  border: 1px solid var(--rule);
  overflow: hidden;
}

.code-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 12px;
  border-bottom: 1px solid color-mix(in srgb, var(--panel-ink) 18%, transparent);
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--panel-ink) 62%, transparent);
}

.code-bar .r {
  margin-left: auto;
  color: color-mix(in srgb, var(--panel-ink) 42%, transparent);
}

pre {
  margin: 0;
  padding: 13px 15px 15px;
  overflow-x: auto;
  font-size: 12.5px;
  line-height: 1.72;
  tab-size: 2;
}

.code pre {
  color: var(--panel-ink);
}

pre code {
  background: none;
  padding: 0;
  border: 0;
  color: inherit;
  font-size: inherit;
}

.cmt {
  color: color-mix(in srgb, var(--panel-ink) 42%, transparent);
}

.kw {
  color: color-mix(in srgb, var(--v4) 88%, white);
}

.str {
  color: color-mix(in srgb, var(--v6) 82%, white);
}

/* A shell line standing alone, outside a panel. */
.sh {
  border: 1px solid var(--rule);
  background: color-mix(in srgb, var(--ink) 4%, transparent);
  padding: 10px 13px;
  font-family: var(--mono);
  font-size: 13px;
  overflow-x: auto;
}

.sh::before {
  content: "$ ";
  color: var(--v4);
}

/* ---------- output ---------- */

.out {
  border: 1px solid var(--rule);
  border-left: 3px solid var(--v4);
  background: color-mix(in srgb, var(--ink) 3%, transparent);
  padding: 10px 13px;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.7;
  color: var(--ink-2);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.out .what {
  display: block;
  font-size: 9.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-2);
  opacity: 0.75;
  margin-bottom: 4px;
}

/* ---------- notes ---------- */

.note {
  border-left: 3px solid var(--v4);
  padding: 2px 0 2px 13px;
  color: var(--ink-2);
  font-size: 14px;
  max-width: 64ch;
}

.note.v6 {
  border-left-color: var(--v6);
}

.note b {
  color: var(--ink);
}

/* ---------- probe ---------- */

.probe {
  border: 1px solid var(--rule);
  background: var(--field);
}

.probe-form {
  display: flex;
  border-bottom: 1px solid var(--rule);
}

.probe-form input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 14px;
  padding: 12px 13px;
}

.probe-form input:focus {
  outline: 2px solid var(--v4);
  outline-offset: -2px;
}

.probe-form button {
  border: 0;
  border-left: 1px solid var(--rule);
  background: var(--ink);
  color: var(--field);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 0 16px;
  cursor: pointer;
}

.probe-form button:hover {
  background: var(--v4);
}

.probe-body {
  padding: 12px 13px;
  display: grid;
  gap: 12px;
}

.hint {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-2);
  margin: 0;
}

.answer {
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.kv {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  gap: 2px 12px;
  font-family: var(--mono);
  font-size: 12px;
}

.kv dt {
  color: var(--ink-2);
  font-size: 9.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding-top: 2px;
}

.kv dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.tag {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 2px 7px;
  border: 1px solid var(--rule-mid);
  color: var(--ink-2);
}

.tag.v4 {
  border-color: var(--v4);
  color: var(--v4);
}

.tag.v6 {
  border-color: var(--v6);
  color: var(--v6);
}

/* ---------- lists of blocks ---------- */

.blocks {
  display: grid;
  font-family: var(--mono);
  font-size: 12.5px;
  border: 1px solid var(--rule);
  max-height: 320px;
  overflow-y: auto;
}

.blocks .r {
  display: flex;
  gap: 12px;
  padding: 4px 9px;
  border-bottom: 1px solid var(--rule-soft);
}

.blocks .r:last-child {
  border-bottom: 0;
}

.blocks .r:nth-child(even) {
  background: color-mix(in srgb, var(--ink) 3%, transparent);
}

.blocks .r .i {
  color: var(--ink-2);
  font-size: 10px;
  min-width: 2.4em;
  padding-top: 1px;
}

/* ---------- guide ---------- */

.step {
  border-top: 1px solid var(--rule);
  padding: 26px 0 30px;
  scroll-margin-top: calc(var(--hdr) + 12px);
}

.step:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.step .n {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  color: var(--v4);
  margin-bottom: 8px;
}

.step h2 {
  font-size: clamp(19px, 2.2vw, 25px);
  margin-bottom: 10px;
  text-transform: none;
  letter-spacing: -0.015em;
}

.step > * + * {
  margin-top: 14px;
}

.guide-nav {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  border: 1px solid var(--rule);
  margin-bottom: 30px;
}

.guide-nav a {
  display: flex;
  gap: 9px;
  align-items: baseline;
  padding: 7px 10px;
  border-right: 1px solid var(--rule-soft);
  border-bottom: 1px solid var(--rule-soft);
  font-family: var(--mono);
  font-size: 11.5px;
  text-decoration: none;
  color: var(--ink-2);
}

.guide-nav a:hover {
  color: var(--ink);
  background: color-mix(in srgb, var(--ink) 5%, transparent);
}

.guide-nav a b {
  color: var(--ink-2);
  font-weight: 400;
  font-size: 9.5px;
}

/* ---------- reference ---------- */

.ref-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 14px;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 7px;
  margin: 34px 0 4px;
  scroll-margin-top: calc(var(--hdr) + 12px);
}

.ref-head h2 {
  font-size: 19px;
  text-transform: none;
  letter-spacing: -0.01em;
}

.ref-head .no {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink-2);
}

.ref-head .of {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.group-desc {
  color: var(--ink-2);
  font-size: 13.5px;
  margin: 10px 0 4px;
}

.item {
  padding: 9px 0;
  border-bottom: 1px solid var(--rule-soft);
}

.item:last-child {
  border-bottom: 0;
}

.sig {
  margin: 0;
  padding: 0;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: var(--ink);
}

.item-doc {
  margin: 3px 0 0;
  font-size: 13px;
  color: var(--ink-2);
  max-width: 76ch;
}

.type-body {
  margin: 5px 0 0;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--ink-2);
  white-space: pre;
  overflow-x: auto;
  padding: 6px 8px;
  border-left: 2px solid var(--rule-soft);
}

.filter {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--rule);
  margin-bottom: 6px;
}

.filter input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 12.5px;
  padding: 8px 10px;
}

.filter input:focus {
  outline: 2px solid var(--v4);
  outline-offset: -2px;
}

.filter span {
  display: flex;
  align-items: center;
  padding: 0 10px;
  border-left: 1px solid var(--rule-soft);
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink-2);
  white-space: nowrap;
}

.hidden {
  display: none;
}

/* ---------- footer is a trailer ---------- */

.foot {
  border-top: 1px solid var(--rule);
  background: color-mix(in srgb, var(--ink) 4%, var(--field));
}

.foot-in {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) repeat(2, minmax(0, 1fr));
}

.foot-in > div {
  padding: 18px var(--pad) 22px;
  border-right: 1px solid var(--rule-soft);
}

.foot-in > div:last-child {
  border-right: 0;
}

footer h4 {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-2);
  font-weight: 500;
  margin-bottom: 9px;
}

footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 5px;
  font-family: var(--mono);
  font-size: 12px;
}

footer ul a {
  color: var(--ink-2);
  text-decoration: none;
}

footer ul a:hover {
  color: var(--ink);
}

.foot .about p {
  font-size: 13px;
  color: var(--ink-2);
  margin: 9px 0 0;
  max-width: 40ch;
}

.trailer {
  border-top: 1px solid var(--rule);
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  padding: 9px var(--pad);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.trailer .eof {
  color: var(--v4);
}

/* ---------- scrollbars ---------- */

@supports selector(::-webkit-scrollbar) {
  html::-webkit-scrollbar {
    width: 16px;
    height: 16px;
  }

  html::-webkit-scrollbar-track {
    background: var(--ground);
    border-left: 1px solid var(--rule-soft);
  }

  /* The thumb is a frame marker on the wire: a filled block inset by the ground,
     so the position reads as a packet travelling down the page. */
  html::-webkit-scrollbar-thumb {
    background: var(--ink);
    border: 4px solid var(--ground);
    border-top-width: 5px;
    border-bottom-width: 5px;
  }

  html.at-top::-webkit-scrollbar-thumb {
    background: color-mix(in srgb, var(--ink) 20%, transparent);
  }

  .blocks::-webkit-scrollbar,
  pre::-webkit-scrollbar,
  .tbl-wrap::-webkit-scrollbar,
  .encap::-webkit-scrollbar,
  .type-body::-webkit-scrollbar,
  .sh::-webkit-scrollbar {
    width: 10px;
    height: 10px;
  }

  .blocks::-webkit-scrollbar-track,
  pre::-webkit-scrollbar-track,
  .tbl-wrap::-webkit-scrollbar-track,
  .encap::-webkit-scrollbar-track,
  .type-body::-webkit-scrollbar-track,
  .sh::-webkit-scrollbar-track {
    background: transparent;
  }

  .blocks::-webkit-scrollbar-thumb,
  pre::-webkit-scrollbar-thumb,
  .tbl-wrap::-webkit-scrollbar-thumb,
  .encap::-webkit-scrollbar-thumb,
  .type-body::-webkit-scrollbar-thumb,
  .sh::-webkit-scrollbar-thumb {
    background: color-mix(in srgb, var(--ink) 26%, transparent);
    border: 2px solid transparent;
    background-clip: content-box;
  }

  .blocks:hover::-webkit-scrollbar-thumb,
  pre:hover::-webkit-scrollbar-thumb,
  .tbl-wrap:hover::-webkit-scrollbar-thumb,
  .encap:hover::-webkit-scrollbar-thumb,
  .type-body:hover::-webkit-scrollbar-thumb,
  .sh:hover::-webkit-scrollbar-thumb {
    background: color-mix(in srgb, var(--ink) 55%, transparent);
    background-clip: content-box;
  }
}

@supports not selector(::-webkit-scrollbar) {
  html {
    scrollbar-width: auto;
    scrollbar-color: var(--ink) var(--ground);
  }

  html.at-top {
    scrollbar-color: color-mix(in srgb, var(--ink) 24%, transparent) var(--ground);
  }

  pre,
  .blocks,
  .tbl-wrap,
  .encap,
  .type-body,
  .sh {
    scrollbar-width: thin;
    scrollbar-color: color-mix(in srgb, var(--ink) 30%, transparent) transparent;
  }
}

/* ---------- narrow ---------- */

@media (width <= 620px) {
  .display {
    font-size: clamp(28px, 9vw, 44px);
  }

  .foot-in {
    grid-template-columns: minmax(0, 1fr);
  }

  .foot-in > div {
    border-right: 0;
    border-bottom: 1px solid var(--rule-soft);
  }
}

@media print {
  .hdr,
  .rail,
  nav.nav,
  .probe,
  .foot {
    display: none;
  }

  .frame {
    border: 0;
  }

  body {
    background: #fff;
    color: #000;
  }
}

/* ---------- spec strip: four facts, drawn like the fields they are ---------- */

.spec {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--rule);
  margin-top: 22px;
}

.spec > div {
  padding: 10px 12px 12px;
  border-right: 1px solid var(--rule-soft);
  min-width: 0;
}

.spec > div:last-child {
  border-right: 0;
}

.spec dt {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-2);
  margin-bottom: 5px;
}

.spec dd {
  margin: 0;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.35;
  color: var(--ink);
  overflow-wrap: anywhere;
}

@media (width <= 900px) {
  .spec {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .spec > div:nth-child(2n) {
    border-right: 0;
  }

  .spec > div:nth-child(-n + 2) {
    border-bottom: 1px solid var(--rule-soft);
  }
}

/* ---------- a caption under a diagram ---------- */

/* A hanging indent rather than two columns: the label is inline, so a caption can
   hold code or emphasis without every run of text becoming its own grid cell. */
.figcap {
  display: block;
  padding-left: 4.9em;
  text-indent: -4.9em;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.02em;
  line-height: 1.55;
  color: var(--ink-2);
  margin-top: 8px;
  max-width: 82ch;
}

.figcap b {
  display: inline-block;
  width: 4.9em;
  text-indent: 0;
  white-space: nowrap;
}

.figcap i {
  font-style: italic;
  color: var(--ink);
}

.figcap b {
  color: var(--ink);
  font-weight: 500;
}

/* ---------- signature tokens ----------
   A signature is read on the page, not in a dark panel, so it gets its own
   colours rather than borrowing the code block's. */

.sig .k {
  font-style: normal;
  color: var(--ink-2);
}

.sig .ty {
  font-style: normal;
  color: var(--ink);
}

.sig .op {
  font-style: normal;
  color: var(--v4);
}

/* ---------- the header map ----------
   The opening diagram is an IPv4 header drawn to scale: one column per bit, a cube
   per field, the width of the field as its span. Two fields are this package's
   business; the rest are struck through as somebody else's. It doubles as the
   table of contents for the reference. */

.hmap {
  border: 1px solid var(--rule);
  border-bottom: 0;
  background: var(--field);
}

.hmap-row {
  display: grid;
  grid-template-columns: repeat(32, minmax(0, 1fr));
  border-bottom: 1px solid var(--rule);
}

.hmap-f {
  grid-column: span var(--w, 8);
  padding: 7px 8px 9px;
  border-right: 1px solid var(--rule);
  min-width: 0;
  display: block;
  text-decoration: none;
  color: inherit;
  position: relative;
  transition: background 120ms ease;
}

.hmap-f:last-child {
  border-right: 0;
}

.hmap-f b {
  display: block;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--ink);
}

.hmap-f i {
  display: block;
  font-style: normal;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.06em;
  color: var(--ink-2);
  margin-top: 2px;
  white-space: nowrap;
}

/* Everything the parser does not touch is hatched out, the way a datasheet marks
   a field that is reserved, so the eye finds the two rows that matter without
   reading a word. */
.hmap-f.else {
  background: repeating-linear-gradient(
    -45deg,
    transparent 0 6px,
    color-mix(in srgb, var(--ink) 7%, transparent) 6px 7px
  );
}

.hmap-f.else b {
  color: var(--ink-2);
}

.hmap-f.else i {
  opacity: 0.65;
}

.hmap-f.ours {
  background: var(--v4-soft);
}

.hmap-f.ours b {
  color: var(--v4);
}

.hmap-f:hover,
.hmap-f:focus-visible {
  background: color-mix(in srgb, var(--v4) 14%, var(--field));
  outline: 0;
}

.hmap-f.else:hover {
  background: color-mix(in srgb, var(--v4) 12%, var(--field));
}

.hmap-out {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  align-items: baseline;
  margin-top: 14px;
  border-left: 2px solid var(--v4);
  padding: 2px 0 2px 10px;
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--ink-2);
  min-height: 26px;
  max-width: 82ch;
}

.hmap-out b {
  color: var(--v4);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 9.5px;
}

.hmap-out .api {
  color: var(--ink);
}

/* ---------- the payload ---------- */

.payload {
  border: 1px dashed var(--rule-mid);
  border-top: 0;
  padding: 22px var(--pad) 26px;
  position: relative;
}

.payload::before {
  content: "payload";
  position: absolute;
  top: -7px;
  left: var(--pad);
  padding: 0 6px;
  background: var(--field);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-2);
}

@media (width <= 760px) {
  .hmap-f {
    padding: 6px 3px 8px;
  }

  .hmap-f b {
    font-size: 7.5px;
    letter-spacing: -0.01em;
  }

  .hmap-f i {
    display: none;
  }

  /* Three bits is narrower than the word "flags". */
  .hmap-f.tiny b {
    display: none;
  }

  .hmap-f.ours b {
    font-size: 8.5px;
    letter-spacing: 0.04em;
  }

  .payload {
    padding: 18px 14px 20px;
  }

  .payload::before {
    left: 14px;
  }
}

/* ---------- back to the top, from either side ----------
   Two thin tabs in the margins, halfway down, the way a drawing marks a field at
   its edge. Nothing but the word, set vertically, and the pair mirrors across the
   frame: on the right it runs downward with the tops of the letters facing right,
   on the left it runs upward with the tops facing left.

   Where the margins are narrower than a tab there is no room for the pair: the
   left tab goes and the right one folds into the corner square, which is also
   what a phone gets. */

.totop {
  position: fixed;
  z-index: 40;
  top: 50%;
  translate: 0 -50%;
  width: 32px;
  height: 152px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--rule);
  background: var(--field);
  color: var(--ink-2);
  text-decoration: none;
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease, background 120ms ease, color 120ms ease,
    border-color 120ms ease;
}

/* Half the frame's width plus forty-eight pixels: the frame border, on either
   side, less the fourteen-pixel gap the tab keeps from it. */
.totop.left {
  left: calc(50% - 688px);
}

.totop.right {
  right: calc(50% - 688px);
}

.totop span {
  writing-mode: vertical-rl;
  font-family: var(--mono);
  font-size: 9px;
  line-height: 1;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  white-space: nowrap;
}

/* On the left the letters keep their tops to the left, so the word reads upward:
   the same strip, turned over. */
.totop.left span {
  rotate: 180deg;
}

.totop.on {
  opacity: 1;
  pointer-events: auto;
}

.totop:hover,
.totop:focus-visible {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--field);
  outline: 0;
}

@media (width < 1440px) {
  .totop {
    top: auto;
    bottom: 16px;
    translate: none;
    width: 44px;
    height: 44px;
    color: var(--ink);
  }

  .totop.left {
    display: none;
  }

  .totop.right {
    right: 16px;
  }

  .totop span {
    writing-mode: horizontal-tb;
    rotate: none;
    font-size: 8px;
    letter-spacing: 0.12em;
  }
}

@media print {
  .totop {
    display: none;
  }
}

/* ---------- the day / night switch ----------
   One button, and it says the mode it will put the page in: "night" while the page
   is light. Both words share one grid cell, so the cell is always as wide as the
   longer of them — the strip never shifts under the pointer as the label changes.
   Until a choice is made the stylesheet's media query decides, and the button
   follows it. */

.themesw {
  display: grid;
  align-items: center;
  border: 0;
  border-left: 1px solid var(--rule-soft);
  border-right: 1px solid var(--rule-soft);
  background: none;
  padding: 0 9px;
  font-family: var(--mono);
  font-size: 9.5px;
  line-height: 1;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-2);
  cursor: pointer;
}

/* The word that is not showing still holds the cell open. */
.themesw span {
  grid-area: 1 / 1;
  justify-self: center;
  white-space: nowrap;
  visibility: hidden;
}

.themesw[data-mode="light"] .when-dark,
.themesw[data-mode="dark"] .when-light {
  visibility: visible;
}

.themesw:hover {
  color: var(--ink);
  background: color-mix(in srgb, var(--ink) 6%, transparent);
}

.themesw:focus-visible {
  outline: 1px solid var(--v4);
  outline-offset: -3px;
}

/* ---------- showcase: two instruments ---------- */

.exhibit {
  border: 1px solid var(--rule);
  background: var(--field);
}

.exhibit-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 14px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.04em;
  color: var(--ink-2);
}

.exhibit-head b {
  color: var(--ink);
  font-weight: 500;
}

.exhibit-head .r {
  margin-left: auto;
  font-size: 9.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* ---------- fragmentation ---------- */

.frag-scroll {
  position: relative;
  height: 185vh;
  margin-top: 18px;
}

.frag-pin {
  position: sticky;
  top: var(--hdr);
  min-height: calc(100vh - var(--hdr));
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.frag-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 236px;
  align-items: center;
  gap: 24px;
  width: 100%;
  padding: 16px 14px 18px;
}

.frag-stage {
  --qgap: 40px;
  --bar-y: 262px;
  position: relative;
  height: 384px;
  width: calc(47 * 1ch);
  max-width: 100%;
  font-family: var(--mono);
  font-size: clamp(12px, 1.9vw, 21px);
}

/* The queue is where fragments wait on the wire, one row each. */
.frag-queue {
  position: absolute;
  inset: 0 0 auto 0;
  height: var(--bar-y);
  border-left: 1px dashed var(--rule-mid);
  background-image: repeating-linear-gradient(
    to bottom,
    transparent 0 calc(var(--qgap) - 1px),
    var(--rule-soft) calc(var(--qgap) - 1px) var(--qgap)
  );
  background-position: 0 0;
}

.frag-empty {
  position: absolute;
  top: 46%;
  left: 1.2ch;
  margin: 0;
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-2);
  opacity: 0;
  transition: opacity 240ms ease;
}

.frag-empty.on {
  opacity: 1;
}

.frag-queue::before {
  content: "wire";
  position: absolute;
  top: -16px;
  left: -1px;
  padding-right: 6px;
  background: var(--field);
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.frag-card {
  position: absolute;
  top: calc(var(--k) * var(--qgap));
  left: 0;
  width: calc(var(--len) / 47 * 100%);
  height: calc(var(--qgap) - 6px);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: 1px solid var(--rule-mid);
  background: var(--ground);
  font-size: 9.5px;
  line-height: 1;
  color: var(--ink-2);
  white-space: nowrap;
  overflow: hidden;
  z-index: 2;
  transition: left 560ms cubic-bezier(0.2, 0.75, 0.2, 1),
    top 560ms cubic-bezier(0.2, 0.75, 0.2, 1), background 240ms ease,
    border-color 240ms ease, color 240ms ease;
}

.frag-stage.booting .frag-card {
  transition: none;
}

.frag-card b {
  font-weight: 500;
  color: var(--ink);
}

.frag-card i {
  font-style: normal;
  font-size: 8.5px;
  letter-spacing: 0.02em;
  opacity: 0.8;
}

.frag-card.in {
  top: var(--bar-y);
  left: calc(var(--off) / 47 * 100%);
  border-color: var(--v4);
  background: var(--v4-soft);
  color: var(--v4);
}

.frag-card.in b {
  color: var(--v4);
}

/* The buffer: one cell per byte, hatched until a fragment covers its span. */
.frag-bar {
  position: absolute;
  top: var(--bar-y);
  left: 0;
  width: 100%;
  height: calc(var(--qgap) - 6px);
  display: grid;
  grid-template-columns: repeat(47, minmax(0, 1fr));
  border: 1px solid var(--rule-mid);
  background: repeating-linear-gradient(
    -45deg,
    transparent 0 5px,
    color-mix(in srgb, var(--ink) 8%, transparent) 5px 6px
  );
}

.frag-bar i {
  display: block;
  border-right: 1px solid var(--rule-soft);
}

.frag-bar i:nth-child(8n) {
  border-right-color: var(--rule-mid);
}

.frag-bar i:last-child {
  border-right: 0;
}

.frag-axis {
  position: absolute;
  top: calc(var(--bar-y) + var(--qgap) + 2px);
  left: 0;
  width: 100%;
  height: 14px;
  font-size: 8.5px;
  color: var(--ink-2);
}

.frag-axis span {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  letter-spacing: 0.02em;
}

.frag-axis span:first-child {
  transform: none;
}

.frag-axis::before {
  content: "";
  position: absolute;
  top: -2px;
  left: 0;
  width: 100%;
  height: 3px;
  border-left: 1px solid var(--rule-mid);
  border-right: 1px solid var(--rule-mid);
  border-top: 1px solid var(--rule-soft);
}

/* The payload line: the bytes themselves, one span each, so a gap is a gap. */
.frag-text {
  position: absolute;
  top: calc(var(--bar-y) + var(--qgap) + 26px);
  left: 0;
  font-size: 1em;
  letter-spacing: 0;
  white-space: pre;
  color: var(--ink);
}

.frag-text i {
  font-style: normal;
  color: transparent;
  background: color-mix(in srgb, var(--ink) 7%, transparent);
  transition: color 220ms ease, background 220ms ease;
}

.frag-text i.got {
  color: var(--ink);
  background: transparent;
}

.frag-text i.space.got {
  background: transparent;
}

.frag-side {
  align-self: center;
  min-width: 0;
}

.frag-stat {
  margin: 0 0 10px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  color: var(--ink-2);
}

.frag-stat b {
  color: var(--ink);
  font-weight: 500;
}

.frag-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: 9.5px;
}

.frag-list li {
  display: grid;
  grid-template-columns: 1.8em 1fr auto auto;
  gap: 6px;
  align-items: baseline;
  padding: 5px 2px;
  border-bottom: 1px solid var(--rule-soft);
  color: var(--ink-2);
  transition: color 200ms ease, background 200ms ease;
}

.frag-list li b {
  font-weight: 500;
  color: var(--ink);
}

.frag-list li.in {
  color: var(--v4);
  background: color-mix(in srgb, var(--v4) 7%, transparent);
}

.frag-list li.in b {
  color: var(--v4);
}

.frag-list .hex {
  grid-column: 1 / -1;
  font-size: 8.5px;
  letter-spacing: 0.03em;
  color: var(--ink-2);
  opacity: 0.75;
}

.frag-list li.in .hex {
  opacity: 1;
}

@media (width <= 900px) {
  .frag-inner {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }

  .frag-stage {
    --qgap: 30px;
    --bar-y: 200px;
    height: 300px;
    width: 100%;
    font-size: clamp(10px, 2.9vw, 14px);
  }

  .frag-bar,
  .frag-axis {
    width: 100%;
    grid-template-columns: repeat(47, minmax(0, 1fr));
  }

  .frag-bar i:nth-child(8n) {
    border-right-color: var(--rule-soft);
  }

  .frag-card {
    font-size: 8px;
  }

  .frag-card i {
    display: none;
  }

  .frag-scroll {
    height: 150vh;
  }
}

/* ---------- the hop ladder ---------- */

.trace-form {
  display: flex;
  flex-wrap: nowrap;
  gap: 10px;
  align-items: flex-end;
  max-width: 620px;
  margin: 14px 0 0;
}

.trace-form label {
  flex: 1 1 auto;
  min-width: 0;
}

.trace-form span {
  display: block;
  margin-bottom: 3px;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.trace-form input {
  width: 100%;
  min-width: 0;
  padding: 9px 11px;
  border: 1px solid var(--rule);
  background: var(--field);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 13px;
}

.trace-form input:focus {
  outline: 0;
  border-color: var(--v4);
  box-shadow: inset 0 0 0 1px var(--v4);
}

.trace-form button {
  padding: 10px 16px;
  border: 1px solid var(--rule);
  background: var(--ink);
  color: var(--field);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  cursor: pointer;
}

.trace-form button:hover {
  background: var(--v4);
  border-color: var(--v4);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 9px;
}

.chips button {
  padding: 3px 7px;
  border: 1px solid var(--rule-soft);
  background: none;
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 10px;
  cursor: pointer;
}

.chips button:hover,
.chips button:focus-visible {
  border-color: var(--v4);
  color: var(--ink);
  outline: 0;
}

.ladder {
  margin-top: 18px;
  border: 1px solid var(--rule);
  border-bottom: 0;
}

.hop {
  display: grid;
  grid-template-columns: 2.4em 15em minmax(0, 1fr) 3.4em;
  gap: 8px;
  align-items: baseline;
  padding: 8px 10px 8px 9px;
  border-bottom: 1px solid var(--rule);
  border-left: 3px solid transparent;
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.4;
  color: var(--ink-2);
  transition: background 200ms ease, border-color 200ms ease, color 200ms ease;
}

.hop .n {
  color: var(--ink-2);
  font-size: 9.5px;
}

.hop .gate {
  color: var(--ink);
  overflow-wrap: anywhere;
}

.hop .where {
  color: var(--ink-2);
  font-size: 9.5px;
  overflow-wrap: anywhere;
}

.hop .res {
  text-align: right;
  font-size: 9.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hop.idle {
  opacity: 0.42;
}

.hop.pass .res {
  color: var(--ink-2);
}

.hop.stop {
  border-left-color: var(--v4);
  background: var(--v4-soft);
  color: var(--ink);
}

.hop.stop .res {
  color: var(--v4);
  font-weight: 500;
}

.hop.stop .n {
  color: var(--v4);
}

.verdict {
  margin-top: 14px;
  padding: 12px 14px 13px;
  border: 1px solid var(--rule);
  border-left: 3px solid var(--v4);
  background: var(--field);
  min-height: 74px;
}

.verdict .k {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.verdict b {
  display: block;
  margin: 4px 0 2px;
  font-family: var(--display);
  font-size: clamp(18px, 2.1vw, 25px);
  line-height: 1;
  letter-spacing: -0.02em;
  text-transform: uppercase;
}

.verdict p {
  margin: 0;
  font-family: var(--mono);
  font-size: 10.5px;
  line-height: 1.5;
  color: var(--ink-2);
}

.verdict.neither b {
  color: var(--v4);
}

@media (width <= 700px) {
  .hop {
    grid-template-columns: 2.1em minmax(0, 1fr) 3em;
    font-size: 10px;
  }

  .hop .gate {
    grid-column: 2;
  }

  .hop .where {
    display: none;
  }
}

/* ---------- the strip on a phone ----------
   Five words plus a switch do not fit 390 pixels at desktop sizes, so the strip
   steps down twice: the words close up, then the switch's own cells do. Below 380
   the wordmark gives way — the mark alone still says whose page this is. */

@media (width <= 620px) {
  .themesw {
    padding: 0 6px;
    font-size: 9px;
    letter-spacing: 0.06em;
  }
}

@media (width <= 420px) {
  nav.nav a {
    padding: 0 4px;
    font-size: 10px;
  }
}

@media (width <= 380px) {
  .hdr .brand {
    padding: 0 10px;
    gap: 0;
  }

  .hdr .brand .word {
    display: none;
  }
}
