/* COAL — engineering drawing sheet
   palette contrast against --bg #0a0a0a (L=0.00304):
   #e8e6e3 15.0:1 | #a5a29e 7.79:1 | #7d7a76 4.64:1 | #ff6a00 6.89:1
   #ff6a00 with #0a0a0a text: 7.31:1                                   */

:root {
  --bg:      #0a0a0a;
  --ink:     #e8e6e3;
  --body:    #a5a29e;
  --mute:    #7d7a76;
  --line:    #1c1b1a;
  --line-2:  #2a2826;
  --orange:  #ff6a00;

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

  --frame-inset: 20px;
  --gutter: 48px;
  --maxw: 1080px;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--body);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  font-feature-settings: "kern" 1;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection { background: var(--orange); color: #0a0a0a; }

a { color: var(--ink); text-decoration: none; }
a:hover { color: var(--orange); }

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

.skip {
  position: absolute; left: -9999px; top: 0;
  background: var(--orange); color: #0a0a0a;
  font-family: var(--mono); font-size: 12px; letter-spacing: .14em;
  padding: 10px 16px; z-index: 200; text-transform: uppercase;
}
.skip:focus { left: var(--frame-inset); top: var(--frame-inset); }

/* ---------- the drawing sheet frame ---------- */

.sheet {
  position: fixed;
  inset: var(--frame-inset);
  pointer-events: none;
  z-index: 60;
}
.sheet__rule { position: absolute; inset: 0; border: 1px solid var(--line-2); }

.sheet__cols,
.sheet__rows {
  position: absolute;
  display: flex;
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 400;
  letter-spacing: .3em;
  color: var(--mute);
  line-height: 1;
}
.sheet__cols { left: 0; right: 0; top: 7px; flex-direction: row; justify-content: space-around; }
.sheet__rows { top: 0; bottom: 0; flex-direction: column; justify-content: space-around; }
.sheet__rows--l { left: 7px; }
.sheet__rows--r { right: 7px; }

.sheet span { position: relative; display: block; }
.sheet__cols span::before {
  content: ""; position: absolute; left: 50%; top: -7px;
  width: 1px; height: 5px; background: var(--line-2);
}
.sheet__rows--l span::before,
.sheet__rows--r span::before {
  content: ""; position: absolute; top: 50%;
  width: 5px; height: 1px; background: var(--line-2);
}
.sheet__rows--l span::before { left: -7px; }
.sheet__rows--r span::before { right: -7px; }

/* ---------- shell ---------- */

.shell {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.nav {
  position: sticky; top: 0; z-index: 50;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.nav__in {
  max-width: var(--maxw);
  margin: 0 auto;
  /* The bar carries every route now, so it wraps to two rows. The old 46px top padding was sized
     for four links on one row; at eleven it made a 176px sticky header, a fifth of the viewport. */
  padding: 16px var(--gutter) 14px;
  display: flex; align-items: baseline; gap: 10px 24px;
  flex-wrap: wrap;
}
.nav__mark {
  font-family: var(--mono);
  font-size: 14px; font-weight: 400;
  letter-spacing: .42em;
  color: var(--ink);
  text-transform: uppercase;
  margin-right: auto;
}
.nav__mark:hover { color: var(--orange); }
.nav__links { display: flex; gap: 8px 18px; flex-wrap: wrap; }
.nav__links a {
  font-family: var(--mono);
  font-size: 11px; letter-spacing: .18em; text-transform: uppercase;
  color: var(--mute);
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
}
.nav__links a:hover { color: var(--ink); }
.nav__links a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--orange); }

main { display: block; }

/* ---------- typography ---------- */

.label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--mute);
  margin: 0 0 18px;
}
.label--ink { color: var(--ink); }

h1, h2, h3 { color: var(--ink); font-weight: 500; margin: 0; }

.h-display {
  font-family: var(--mono);
  font-weight: 200;
  font-size: clamp(2.6rem, 11vw, 5.2rem);
  letter-spacing: .32em;
  line-height: 1;
  color: var(--ink);
  margin: 0 0 34px;
  text-indent: .32em;
}

.h1 {
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: -.015em;
  max-width: 20ch;
}
.h2 {
  font-size: clamp(1.6rem, 3.2vw, 2.2rem);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -.012em;
  max-width: 24ch;
}
.h3 {
  font-size: 1.05rem;
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: -.005em;
}

.rule-accent {
  width: 68px; height: 2px;
  background: var(--orange);
  margin: 26px 0 26px;
  border: 0;
}

p { margin: 0 0 18px; max-width: 68ch; }
p.lead { font-size: 1.075rem; color: var(--body); max-width: 62ch; }
strong { color: var(--ink); font-weight: 500; }
em { font-style: normal; color: var(--ink); }

/* ---------- centred section heading with rules out to both sides ---------- */

.sechead {
  display: flex; align-items: center; gap: 20px;
  margin: 0 0 44px;
}
.sechead::before, .sechead::after {
  content: ""; flex: 1 1 0; height: 1px; background: var(--line-2);
}
.sechead__t {
  font-family: var(--mono);
  font-size: 11px; letter-spacing: .18em; text-transform: uppercase;
  color: var(--mute);
  text-align: center;
  white-space: nowrap;
}
.sechead__n { color: var(--ink); }

section { padding: 80px 0; border-bottom: 1px solid var(--line); }
section:last-of-type { border-bottom: 0; }

.grid-2 {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 56px;
  align-items: start;
}
.grid-2--wide { grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); }

/* ---------- panels ---------- */

.panel {
  border: 1px solid var(--line-2);
  background: transparent;
  box-shadow: none;
  border-radius: 0;
}
.panel__head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 16px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line-2);
  font-family: var(--mono);
  font-size: 11px; letter-spacing: .18em; text-transform: uppercase;
  color: var(--mute);
}
.panel__head b { color: var(--ink); font-weight: 400; }
.panel__body { padding: 18px 16px; }
.panel__note {
  max-width: none;
  padding: 12px 16px;
  border-top: 1px solid var(--line-2);
  font-family: var(--mono);
  font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--mute);
}

/* code */

/* a printed command must be retypable: JetBrains Mono ligates `--` into one long dash */
code, .code { font-variant-ligatures: none; font-feature-settings: "liga" 0, "calt" 0; }

.code {
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.9;
  color: var(--ink);
  border: 1px solid var(--line-2);
  padding: 18px 16px;
  overflow-x: auto;
  margin: 0 0 22px;
  /* pre-wrap, not pre: at 1440 the keccak line was 30px wider than its column and
     `< target` was cut off the right edge with the scrollbar hidden. */
  white-space: pre-wrap;
}
.code .c { color: var(--mute); }
.code .k { color: var(--orange); }
.code--tight { font-size: 12.5px; }

/* ---------- data rows: hover marker slides in from the left ---------- */

.rows { border-top: 1px solid var(--line); }
.row {
  position: relative;
  display: grid;
  grid-template-columns: minmax(8.5rem, 1fr) auto;
  gap: 20px;
  align-items: baseline;
  padding: 11px 0 11px 14px;
  border-bottom: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--body);
}
.row::before {
  content: "";
  position: absolute; left: 0; top: 11px; bottom: 11px;
  width: 2px; background: var(--orange);
  opacity: 0;
  transform: translateX(-6px);
  transition: transform 120ms ease-out, opacity 120ms ease-out;
}
.row:hover::before, .row:focus-within::before { opacity: 1; transform: translateX(0); }
.row__k { color: var(--mute); letter-spacing: .1em; text-transform: uppercase; font-size: 11px; }
.row__v { color: var(--ink); text-align: right; white-space: nowrap; }
.row__v--crit { color: var(--orange); }
.row--wide { grid-template-columns: minmax(0, 1fr); }
.row--wide .row__v { text-align: left; white-space: normal; }

@media (prefers-reduced-motion: reduce) {
  .row::before { transition: none; }
}

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

.tablewrap {
  overflow-x: auto;
  border: 1px solid var(--line-2);
  background:
    linear-gradient(to right, var(--bg) 40%, rgba(10,10,10,0)) left center / 32px 100% no-repeat,
    linear-gradient(to left,  var(--bg) 40%, rgba(10,10,10,0)) right center / 32px 100% no-repeat,
    linear-gradient(to right, rgba(255,106,0,.55), rgba(255,106,0,0)) left center / 3px 100% no-repeat,
    linear-gradient(to left,  rgba(255,106,0,.55), rgba(255,106,0,0)) right center / 3px 100% no-repeat;
  background-attachment: local, local, scroll, scroll;
  background-color: var(--bg);
}
table { border-collapse: collapse; width: 100%; min-width: 520px; }

.tscroll {
  font-family: var(--mono);
  font-size: 10px; letter-spacing: .18em; text-transform: uppercase;
  color: var(--orange);
  margin: 7px 0 0;
  text-align: right;
}

/* a mono caption over a row list, matching a table caption */
.rows__cap {
  font-family: var(--mono);
  font-size: 11px; letter-spacing: .18em; text-transform: uppercase;
  color: var(--mute);
  margin: 0 0 12px;
}
caption {
  caption-side: top;
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line-2);
  font-family: var(--mono);
  font-size: 11px; letter-spacing: .18em; text-transform: uppercase;
  color: var(--mute);
}
th, td {
  font-family: var(--mono);
  font-size: 12.5px;
  text-align: left;
  padding: 11px 16px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
thead th {
  font-size: 11px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--mute);
  font-weight: 400;
  border-bottom: 1px solid var(--line-2);
}
tbody th { color: var(--ink); font-weight: 400; }
td { color: var(--body); }
td.n, th.n { text-align: right; white-space: nowrap; }
td.v { color: var(--ink); }
td.crit, th.crit { color: var(--orange); }
tbody tr:last-child th, tbody tr:last-child td { border-bottom: 0; }
tbody tr { position: relative; }
tbody tr th:first-child, tbody tr td:first-child { position: relative; }
tbody tr th:first-child::before, tbody tr td:first-child::before {
  content: "";
  position: absolute; left: 0; top: 8px; bottom: 8px;
  width: 2px; background: var(--orange);
  opacity: 0; transform: translateX(-6px);
  transition: transform 120ms ease-out, opacity 120ms ease-out;
}
tbody tr:hover th:first-child::before,
tbody tr:hover td:first-child::before { opacity: 1; transform: translateX(0); }
@media (prefers-reduced-motion: reduce) {
  tbody tr th:first-child::before, tbody tr td:first-child::before { transition: none; }
}

.tnote {
  max-width: none;
  font-family: var(--mono);
  font-size: 11px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--mute);
  margin: 12px 0 0;
}

/* ---------- buttons ---------- */

.btnrow { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; margin-top: 34px; }
.btn {
  display: inline-block;
  font-family: var(--mono);
  font-size: 11.5px; letter-spacing: .18em; text-transform: uppercase;
  padding: 13px 22px;
  border-radius: 2px;
  border: 1px solid var(--orange);
  background: var(--orange);
  color: #0a0a0a;
  cursor: pointer;
}
.btn:hover { background: #ff7d1f; border-color: #ff7d1f; color: #0a0a0a; }
.btn--ghost {
  background: transparent; color: var(--ink); border-color: var(--line-2);
}
.btn--ghost:hover { background: transparent; color: var(--orange); border-color: var(--orange); }

/* ---------- hero ---------- */

.hero { padding: 76px 0 84px; border-bottom: 1px solid var(--line); }
.hero__top {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr);
  gap: 56px;
  align-items: end;
  margin-bottom: 56px;
}

/* the drawing sheet's title block */
.titleblk { border: 1px solid var(--line-2); }
.titleblk__head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 16px;
  padding: 11px 16px;
  border-bottom: 1px solid var(--line-2);
  font-family: var(--mono);
  font-size: 11px; letter-spacing: .18em; text-transform: uppercase;
  color: var(--mute);
}
.titleblk__head b { color: var(--ink); font-weight: 400; }
.titleblk .rows { border-top: 0; padding: 0 16px 4px; }
.titleblk .row:last-child { border-bottom: 0; }

/* ---------- Fig. 01: the seam, with annotation gutters ---------- */

.seamfig { margin: 0; border: 1px solid var(--line-2); }
.seamfig__head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 16px;
  padding: 11px 16px;
  border-bottom: 1px solid var(--line-2);
  font-family: var(--mono);
  font-size: 11px; letter-spacing: .18em; text-transform: uppercase;
  color: var(--mute);
}
.seamfig__head b {
  color: var(--ink); font-weight: 400; letter-spacing: .08em; text-transform: none;
  font-size: 12px;
}
.seamfig__stage { display: grid; grid-template-columns: 78px minmax(0, 1fr) 78px; }
.seamfig__canvas { position: relative; }
.seam { width: 100%; height: clamp(420px, 46vw, 660px); display: block; }

.seamfig__gut {
  position: relative;
  font-family: var(--mono);
  font-size: 10px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--mute);
}
.seamfig__gutlab {
  /* no opacity multiplier anywhere on this sheet: it would divide the contrast
     of whatever colour is set here and there is no way to see that in the token */
  position: absolute; top: 6px; left: 0; right: 0;
  text-align: center; color: var(--body);
}
.seamfig__gut .tick { position: absolute; left: 0; right: 0; height: 1px; }
.seamfig__gut i { font-style: normal; position: absolute; top: -.62em; }
.seamfig__gut--l i { right: 18px; }
.seamfig__gut--r i { left: 18px; }
.seamfig__gut .tick::after {
  content: ""; position: absolute; top: 0; width: 10px; height: 1px;
  background: var(--line-2);
}
.seamfig__gut--l .tick::after { right: 0; }
.seamfig__gut--r .tick::after { left: 0; }

.seamfig__corner {
  position: absolute; width: 9px; height: 9px; pointer-events: none;
  border: 0 solid var(--line-2);
}
.seamfig__corner--tl { top: 10px; left: 10px; border-top-width: 1px; border-left-width: 1px; }
.seamfig__corner--tr { top: 10px; right: 10px; border-top-width: 1px; border-right-width: 1px; }
.seamfig__corner--bl { bottom: 10px; left: 10px; border-bottom-width: 1px; border-left-width: 1px; }
.seamfig__corner--br { bottom: 10px; right: 10px; border-bottom-width: 1px; border-right-width: 1px; }

.seamfig__axis {
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 10px 16px;
  border-top: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 10px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--mute);
}
.seamfig__cap {
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 11px 16px;
  border-top: 1px solid var(--line-2);
  font-family: var(--mono);
  font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--mute);
}

/* ---------- status band ---------- */

.status {
  border: 1px solid var(--line-2);
  padding: 22px 24px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}
.status__tag {
  font-family: var(--mono);
  font-size: 11px; letter-spacing: .18em; text-transform: uppercase;
  color: var(--mute);
  white-space: nowrap;
  padding-top: 3px;
}
.status__t { font-size: 1.125rem; color: var(--ink); font-weight: 500; margin: 0 0 8px; line-height: 1.4; }
.status__p { font-size: 1rem; color: var(--body); margin: 0; max-width: 70ch; }
.status--band { margin: 40px 0 0; }

/* ---------- counters ---------- */

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  border-top: 1px solid var(--line-2);
  border-left: 1px solid var(--line-2);
}
.stat {
  border-right: 1px solid var(--line-2);
  border-bottom: 1px solid var(--line-2);
  padding: 22px 20px 20px;
}
.stat__n {
  font-family: var(--mono);
  font-size: clamp(1.6rem, 3.4vw, 2.1rem);
  font-weight: 300;
  color: var(--ink);
  line-height: 1.1;
  letter-spacing: -.01em;
  display: block;
}
.stat__n--crit { color: var(--orange); }
.stat__u { font-size: .5em; color: var(--mute); letter-spacing: .1em; margin-left: .4em; }
.stat__k {
  font-family: var(--mono);
  font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--mute);
  margin: 12px 0 0;
  display: block;
}

/* ---------- mock application panel ---------- */

.app { border: 1px solid var(--line-2); }
.app__bar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 11px 16px;
  border-bottom: 1px solid var(--line-2);
  font-family: var(--mono);
  font-size: 11px; letter-spacing: .18em; text-transform: uppercase;
  color: var(--mute);
}
.app__bar b { color: var(--ink); font-weight: 400; }
.app__cols { display: grid; grid-template-columns: 254px minmax(0, 1fr); }
.app__side { border-right: 1px solid var(--line-2); padding: 14px 0 14px; }
.app__sidehead {
  font-family: var(--mono);
  font-size: 10px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--mute);
}
.app__item {
  position: relative;
  display: flex; justify-content: space-between; gap: 12px;
  padding: 8px 16px 8px 16px;
  font-family: var(--mono); font-size: 11.5px;
  color: var(--body);
}
.app__item::before {
  content: ""; position: absolute; left: 0; top: 6px; bottom: 6px; width: 2px;
  background: var(--orange); opacity: 0; transform: translateX(-6px);
  transition: transform 120ms ease-out, opacity 120ms ease-out;
}
.app__item:hover::before { opacity: 1; transform: translateX(0); }
@media (prefers-reduced-motion: reduce) { .app__item::before { transition: none; } }
.app__item b { color: var(--ink); font-weight: 400; }
.app__item .crit { color: var(--orange); }

.app__main { padding: 0; min-width: 0; }
.tabs {
  display: flex; gap: 0;
  border-bottom: 1px solid var(--line-2);
  overflow-x: auto;
}
.tab {
  appearance: none;
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  color: var(--mute);
  font-family: var(--mono);
  font-size: 11px; letter-spacing: .16em; text-transform: uppercase;
  padding: 13px 18px;
  cursor: pointer;
  white-space: nowrap;
}
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] { color: var(--orange); border-bottom-color: var(--orange); }
.tabpanel { padding: 6px 16px 16px; }
.tabpanel[hidden] { display: none; }

/* ---------- difficulty plot ---------- */

.plot { width: 100%; height: auto; display: block; }
.plot__axis { stroke: var(--line-2); stroke-width: 1; }
.plot__grid { stroke: var(--line); stroke-width: 1; }
.plot__curve {
  fill: none;
  stroke: var(--orange);
  stroke-width: 1.5;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  transition: stroke-dashoffset 1600ms cubic-bezier(.4, 0, .2, 1);
}
.plot.is-drawn .plot__curve { stroke-dashoffset: 0; }
.plot__mark { stroke: var(--orange); stroke-width: 1; opacity: 0; transition: opacity 500ms 900ms linear; }
.plot__node { fill: var(--orange); opacity: 0; transition: opacity 500ms 900ms linear; }
.plot.is-drawn .plot__mark, .plot.is-drawn .plot__node { opacity: .85; }
.plot__t--o { fill: #ff6a00; }
.plot__no { fill: none; stroke: #7d7a76; stroke-width: 1; stroke-dasharray: 3 4; }
.plot__t {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: .06em;
  fill: #7d7a76;
}
.plot__t--ink { fill: #e8e6e3; }
@media (prefers-reduced-motion: reduce) {
  .plot__curve { transition: none; stroke-dashoffset: 0; }
  .plot__mark, .plot__node { transition: none; opacity: .85; }
}

/* ---------- lists ---------- */

.blist { list-style: none; margin: 0 0 22px; padding: 0; }
.blist li {
  position: relative;
  padding: 0 0 0 26px;
  margin: 0 0 14px;
  max-width: 66ch;
}
.blist li::before {
  content: "";
  position: absolute; left: 0; top: .68em;
  width: 12px; height: 1px; background: var(--line-2);
}
.blist li:last-child { margin-bottom: 0; }

/* ---------- footer ---------- */

.foot {
  border-top: 1px solid var(--line-2);
  padding: 40px 0 72px;
}
.foot__in {
  display: flex; justify-content: space-between; gap: 28px; flex-wrap: wrap;
  font-family: var(--mono);
  font-size: 11px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--mute);
}
.foot__links { display: flex; gap: 22px; flex-wrap: wrap; }
.foot a { color: var(--mute); }
.foot a:hover { color: var(--orange); }

/* ---------- responsive ---------- */

@media (max-width: 1000px) {
  :root { --gutter: 40px; }
  .hero__top { grid-template-columns: minmax(0, 1fr); gap: 44px; align-items: start; }
  .seamfig__stage { grid-template-columns: 56px minmax(0, 1fr) 56px; }
  .grid-2, .grid-2--wide { grid-template-columns: minmax(0, 1fr); gap: 40px; }
  /* two columns of one list read as one list when they stack: the column break must carry
     the list's own rhythm, not a 40px hole that looks like something is missing */
  .grid-2--list { gap: 14px; }
  .grid-2--list .blist { margin-bottom: 0; }
  .app__cols { grid-template-columns: minmax(0, 1fr); }
  .app__side { border-right: 0; border-bottom: 1px solid var(--line-2); }
}

@media (max-width: 640px) {
  :root { --frame-inset: 10px; --gutter: 30px; }
  body { font-size: 15.5px; }
  .sheet__cols, .sheet__rows { font-size: 8px; letter-spacing: .22em; }
  .sheet__cols { top: 5px; }
  .sheet__rows--l { left: 5px; }
  .sheet__rows--r { right: 5px; }
  .sheet__cols span::before { top: -5px; height: 4px; }
  .sheet__rows--l span::before { left: -5px; width: 4px; }
  .sheet__rows--r span::before { right: -5px; width: 4px; }

  .nav__in { padding: 30px var(--gutter) 12px; gap: 12px; }
  .nav__mark { font-size: 12px; letter-spacing: .34em; margin-right: 0; flex: 1 0 100%; }
  .nav__links { gap: 18px; }

  .hero { padding: 46px 0 54px; }
  section { padding: 56px 0; }
  .seam { height: 330px; }
  .seamfig__stage { grid-template-columns: 42px minmax(0, 1fr) 42px; }
  .seamfig__gut { font-size: 9px; letter-spacing: .08em; }
  .seamfig__gut--l i { right: 10px; }
  .seamfig__gut--r i { left: 10px; }
  .seamfig__gut .tick::after { width: 6px; }
  .seamfig__head { flex-wrap: wrap; gap: 6px; }
  .seamfig__head b { font-size: 10.5px; }
  .seamfig__axis { font-size: 9px; letter-spacing: .06em; }
  .h-display { font-size: clamp(2rem, 13vw, 3rem); letter-spacing: .24em; text-indent: .24em; margin-bottom: 26px; }
  .status { grid-template-columns: minmax(0, 1fr); gap: 12px; padding: 18px 18px; }
  .status__tag { padding-top: 0; }
  .sechead { gap: 12px; margin-bottom: 32px; }
  .sechead__t { white-space: normal; }
  .code { font-size: 11.5px; padding: 14px 12px; }
  /* 520px inside a 328px column truncated every row mid-word. 0 is the other failure: the
     prose column collapses to one word per line. 430 fits three columns and the wrapper
     scrolls, with the hint the script adds when it really is scrollable. */
  table { min-width: 430px; }
  th, td { padding: 10px 11px; font-size: 11.5px; }
  /* Data cells may break anywhere so a prose column can give width back to the row
     header. Row headers only break-word: `anywhere` there drops their min-content to
     one character and stacks the identifier down the page, one letter per line. */
  td { overflow-wrap: anywhere; }
  th { overflow-wrap: break-word; }
  /* the caption sits inside the scroller: keep it short enough that it never scrolls away */
  caption { padding: 10px 11px; font-size: 10px; letter-spacing: .1em; }
  /* numeric columns stay on one line; only prose and identifiers wrap */
  td.n, th.n { white-space: nowrap; overflow-wrap: normal; }
  .row { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .row__v { text-align: left; white-space: normal; }
  .panel__body { padding: 16px 14px; }
  .app__item { font-size: 11px; }
}

/* ---------- audit rule list ---------- */

.crit { color: var(--orange); }

/* long identifiers (test names) must wrap rather than widen the page */
.panel__note, .tnote { overflow-wrap: anywhere; }
.blist li, p { overflow-wrap: break-word; }
.code { overflow-wrap: break-word; }

/* ---------- full-width blocks (tables and the mock panel) ---------- */

.wide { margin: 44px 0 0; }
.wide:first-child { margin-top: 0; }
.prose { max-width: 68ch; }
.stack > * + * { margin-top: 16px; }

/* ---------- the plot keeps its own scale so its labels stay legible ---------- */

.panel__body--plot { padding: 22px 20px 18px; }
.plot { width: 100%; height: auto; display: block; margin: 0 auto; }
.plot--wide { max-width: 760px; }
.plot--compact { display: none; max-width: 380px; }

@media (max-width: 640px) {
  /* long identifiers in a pasted run must wrap, not be clipped mid-word */
  .code { white-space: pre-wrap; }
  .panel__body--plot { padding: 16px 10px 14px; }
  .plot--wide { display: none; }
  .plot--compact { display: block; }
}

/* ---------- mock-panel sidebar: three aligned columns ---------- */

.app__sidehead,
.app__item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 4.6em 4.6em;
  gap: 10px;
  align-items: baseline;
}
.app__sidehead {
  padding: 0 16px 10px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 8px;
}
.app__sidehead span:not(:first-child),
.app__item span { text-align: right; }
.app__sidenote {
  max-width: none;
  font-family: var(--mono);
  font-size: 10px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--mute);
  padding: 14px 16px 0;
  margin: 0;
  border-top: 1px solid var(--line);
  margin-top: 10px;
}

/* ---------- the mine console ---------- */

.app--console .app__cols { grid-template-columns: 288px minmax(0, 1fr); }
.app--console .app__sidehead,
.app--console .app__item {
  grid-template-columns: 4.2em minmax(0, 1fr) 2.6em;
  gap: 16px;
}
.app__group {
  font-family: var(--mono);
  font-size: 10px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink);
  padding: 14px 16px 6px;
  border-top: 1px solid var(--line);
  margin-top: 8px;
}
.app__side > .app__group:first-of-type { border-top: 0; margin-top: 0; }
.app__item--on b { color: var(--orange); }

.log__head {
  display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap;
  max-width: none;
  margin: 0;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--mute);
}
.log__head b { color: var(--orange); font-weight: 400; letter-spacing: .04em;
  text-transform: none; }

.log { font-family: var(--mono); font-size: 12px; }
.log__r {
  display: grid;
  grid-template-columns: 8.5em minmax(0, 1fr) 8em;
  gap: 14px;
  padding: 7px 16px;
  border-bottom: 1px solid var(--line);
  color: var(--mute);
  align-items: baseline;
}
.log__r--d { grid-template-columns: 7.5em 13.5em minmax(0, 1fr) 7.5em; }
.log__r--w { grid-template-columns: 7.5em 9.5em minmax(0, 1fr) 11.5em; }
.log__r--h {
  font-size: 10px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--mute);
  border-bottom: 1px solid var(--line-2);
}
.log__r span:first-child { color: var(--body); }
.log__h { color: var(--body); overflow-wrap: anywhere; }
.log__r--hit { color: var(--orange); }
.log__r--hit span, .log__r--hit .log__h { color: var(--orange); }
.log__w {
  display: flex; gap: 18px; flex-wrap: wrap;
  padding: 16px 16px 7px;
  font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink);
  border-bottom: 1px solid var(--line-2);
}
.log__w span:not(:first-child) { color: var(--mute); }
.log__w b { color: var(--body); font-weight: 400; text-transform: none; letter-spacing: .02em; }
.log__f {
  padding: 8px 16px 14px;
  font-size: 10px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--mute);
}
.log__note {
  max-width: none;
  margin: 0;
  padding: 14px 16px 16px;
  font-family: var(--mono);
  font-size: 11px; line-height: 1.7;
  color: var(--mute);
  border-top: 1px solid var(--line);
}
.log__note code { color: var(--body); }
.log__note strong { color: var(--orange); font-weight: 400; }
.app--console .tabpanel { padding: 0; }

@media (max-width: 1000px) {
  .app--console .app__cols { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .log { font-size: 10.5px; }
  .log__r { grid-template-columns: minmax(0, 1fr); gap: 2px; padding: 9px 12px; }
  .log__r--d, .log__r--w { grid-template-columns: minmax(0, 1fr); }
  .log__r--h { display: none; }
  .log__r span::before {
    content: attr(data-l) " ";
    color: var(--mute);
  }
  .log__head, .log__w, .log__f, .log__note { padding-left: 12px; padding-right: 12px; }
}

/* ---------- Fig. 04: the hash space ---------- */

.hs { width: 100%; height: auto; display: block; margin: 0 auto; }
.hs--wide { max-width: 900px; }
.hs--compact { display: none; max-width: 380px; }
.hs__bar { fill: none; stroke: var(--line-2); stroke-width: 1; }
.hs__slice { fill: var(--orange); }
.hs__guide { fill: none; stroke: var(--line-2); stroke-width: 1; stroke-dasharray: 2 4; }
.hs__state { fill: rgba(255,106,0,.45); }
.hs__state--now { fill: var(--orange); }
.hs__t {
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: .06em;
  fill: #7d7a76;
}
.hs__t--ink { fill: #e8e6e3; }
@media (max-width: 640px) {
  .hs--wide { display: none; }
  .hs--compact { display: block; }
  .hs__t { font-size: 11px; }
}

/* ---------- Fig. 05: the window grid ---------- */

.gr { width: 100%; height: auto; display: block; margin: 0 auto; }
.gr--wide { max-width: 920px; }
.gr--compact { display: none; max-width: 380px; }
.gr__cell { fill: none; stroke: var(--line-2); stroke-width: 1; }
.gr__cell--seed { fill: rgba(255,106,0,.14); stroke: var(--orange); }
.gr__per { fill: none; stroke: var(--line); stroke-width: 1; }
.gr__ans { stroke: #7d7a76; stroke-width: 1; }
.gr__drop { stroke: var(--orange); stroke-width: 1; stroke-dasharray: 2 3; }
.gr__dot { fill: var(--orange); }
.gr__arrow { fill: none; stroke: var(--orange); stroke-width: 1.4; }
.gr__head { fill: var(--orange); }
.gr__t { font-family: var(--mono); font-size: 12px; letter-spacing: .06em; fill: #7d7a76; }
.gr__t--ink { fill: #e8e6e3; }
.gr__t--o { fill: #ff6a00; }
@media (max-width: 640px) {
  .gr--wide { display: none; }
  .gr--compact { display: block; }
  .gr__t { font-size: 10.5px; }
}
.gr__ledger { fill: none; stroke: var(--line-2); stroke-width: 1; }
.gr__ledger--on { fill: rgba(255,106,0,.10); stroke: var(--orange); }
.gr__no { stroke: #7d7a76; stroke-width: 1; stroke-dasharray: 3 4; }

/* ---------- Fig. 06: the split ---------- */

.sp { width: 100%; height: auto; display: block; margin: 0 auto; }
.sp--wide { max-width: 940px; }
.sp--compact { display: none; max-width: 380px; }
.sp__seg { stroke: #0a0a0a; stroke-width: 1; }
.sp__seg--wage { fill: var(--orange); }
.sp__seg--proj { fill: rgba(255,106,0,.34); }
.sp__seg--ref  { fill: rgba(232,230,227,.30); }
.sp__seg--bnty { fill: rgba(232,230,227,.55); }
.sp__lead { fill: none; stroke: var(--line-2); stroke-width: 1; }
.sp__t { font-family: var(--mono); font-size: 12.5px; letter-spacing: .06em; fill: #7d7a76; }
.sp__t--ink { fill: #e8e6e3; }
.sp__t--o { fill: #ff6a00; }
.sp__lab { font-family: var(--mono); font-size: 11.5px; letter-spacing: .1em; fill: #e8e6e3; }
.sp__lab--on { fill: #0a0a0a; }
@media (max-width: 640px) {
  .sp--wide { display: none; }
  .sp--compact { display: block; }
  .sp__t, .sp__lab { font-size: 10px; }
}

/* ---------- Fig. 07: the comparison ---------- */

.cmp { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.cmp__col { padding: 0 0 6px; border-right: 1px solid var(--line-2); }
.cmp__col:last-child { border-right: 0; }
.cmp__col--ours { box-shadow: inset 0 0 0 1px rgba(255,106,0,.55); }
.cmp__head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  padding: 11px 16px;
  border-bottom: 1px solid var(--line-2);
  font-family: var(--mono);
  font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--mute);
}
.cmp__head b { color: var(--ink); font-weight: 400; }
.cmp__col--ours .cmp__head b { color: var(--orange); }
.cmp__fig { padding: 16px 16px 4px; }
.cmp__spark { width: 100%; height: auto; display: block; }
.cmp__line { fill: none; stroke: #7d7a76; stroke-width: 1.5; }
.cmp__line--o { stroke: var(--orange); }
.cmp__mean { stroke: var(--line-2); stroke-width: 1; stroke-dasharray: 3 4; }
.cmp__cap {
  font-family: var(--mono);
  font-size: 10px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--mute);
  margin: 10px 0 6px;
  max-width: none;
}
.cmp .row { padding-left: 16px; padding-right: 16px; }
.cmp .row--cmp { grid-template-columns: minmax(0, 1fr); gap: 3px; }
.cmp .row--cmp .row__v { text-align: left; white-space: normal; }
.cmp .row::before { left: 0; }
@media (max-width: 700px) {
  .cmp { grid-template-columns: minmax(0, 1fr); }
  .cmp__col { border-right: 0; border-bottom: 1px solid var(--line-2); }
}

/* ---------- Fig. 08: the tax path ---------- */

.fl { width: 100%; height: auto; display: block; margin: 0 auto; }
.fl--wide { max-width: 940px; }
.fl--compact { display: none; max-width: 380px; }
.fl__seg { stroke: #0a0a0a; stroke-width: 1; }
.fl__seg--tax  { fill: rgba(232,230,227,.42); }
.fl__seg--flap { fill: rgba(232,230,227,.26); }
.fl__seg--vault{ fill: rgba(255,106,0,.30); }
.fl__seg--wage { fill: var(--orange); }
.fl__seg--proj { fill: rgba(255,106,0,.34); }
.fl__seg--ref  { fill: rgba(232,230,227,.30); }
.fl__seg--bnty { fill: rgba(232,230,227,.55); }
.fl__rib { fill: rgba(255,106,0,.07); stroke: none; }
.fl__t { font-family: var(--mono); font-size: 11.5px; letter-spacing: .04em; fill: #7d7a76; }
.fl__lab { font-family: var(--mono); font-size: 11.5px; letter-spacing: .1em; fill: #e8e6e3; }
.fl__lab--on { fill: #0a0a0a; }
@media (max-width: 640px) {
  .fl--wide { display: none; }
  .fl--compact { display: block; }
  .fl__t, .fl__lab { font-size: 10px; }
}
.fl__lead { fill: none; stroke: var(--line-2); stroke-width: 1; }

/* ---------- Fig. 09: the red-gate roster ---------- */

.gates { padding: 0 0 8px; }
.gates__grp {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 14px 16px 8px;
  border-bottom: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink);
}
.gates__grp b { color: var(--mute); font-weight: 400; }
.gates__row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  border-left: 1px solid var(--line);
  margin: 0 16px 6px;
}
.gate {
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 10px 12px 11px;
  font-family: var(--mono);
}
.gate__m {
  display: block;
  font-size: 9.5px; letter-spacing: .18em; color: var(--orange);
  margin-bottom: 5px;
}
.gate__n { display: block; font-size: 12px; color: var(--ink); line-height: 1.4; }
.gate__t {
  display: block; margin-top: 5px;
  font-size: 10px; color: var(--mute); overflow-wrap: anywhere; line-height: 1.5;
}
.gate--off .gate__m { color: var(--body); }
.gate--off .gate__n { color: var(--body); }

/* ---------- Fig. 10: receive() gas ---------- */

.gs { width: 100%; height: auto; display: block; margin: 0 auto; }
.gs--wide { max-width: 960px; }
.gs--compact { display: none; max-width: 380px; }
.gs__bar { stroke: #0a0a0a; stroke-width: 1; }
.gs__bar--meas { fill: var(--orange); }
.gs__bar--asrt { fill: rgba(255,106,0,.34); }
.gs__bar--red  { fill: rgba(232,230,227,.30); }
.gs__bar--ceil { fill: rgba(232,230,227,.16); }
.gs__ax { stroke: var(--line-2); stroke-width: 1; }
.gs__gap { stroke: var(--orange); stroke-width: 1; }
.gs__t { font-family: var(--mono); font-size: 12px; letter-spacing: .06em; fill: #7d7a76; }
.gs__t--ink { fill: #e8e6e3; }
.gs__t--o { fill: #ff6a00; }
@media (max-width: 640px) {
  .gs--wide { display: none; }
  .gs--compact { display: block; }
  .gs__t { font-size: 10px; }
  .gates__row { grid-template-columns: minmax(0, 1fr); margin: 0 12px 6px; }
}
.stats--tight { margin-bottom: 44px; }
.stats--tight .stat__n { font-size: clamp(1.4rem, 2.6vw, 1.75rem); }

/* ---------- full-bleed bands: a change of ground under the figure-led sections ---------- */

section.bleed {
  /* darker, not lighter: a lighter ground would push #7d7a76 under 4.5:1 */
  background: #050505;
  border-top: 1px solid var(--line-2);
  border-bottom: 1px solid var(--line-2);
}

/* ---------- Fig. 08: the rules as a matrix ---------- */

.rm { width: 100%; height: auto; display: block; margin: 0 auto; }
.rm--wide { max-width: 940px; }
.rm--compact { display: none; max-width: 380px; }
.rm__t { font-family: var(--mono); font-size: 12px; letter-spacing: .06em; fill: #a5a29e; }
.rm__t--ink { fill: #e8e6e3; }
.rm__t--dim { fill: #a5a29e; }
.rm__t--pass { fill: #e8e6e3; }
.rm__t--open { fill: #0a0a0a; }
.rm__t--na   { fill: #a5a29e; }
.rm__ax { stroke: var(--line-2); stroke-width: 1; }
.rm__zebra { fill: rgba(232,230,227,.025); }
.rm__v--pass { fill: rgba(255,106,0,.30); }
.rm__v--open { fill: var(--orange); }
.rm__v--na   { fill: rgba(232,230,227,.06); }
.rm__tick { fill: var(--orange); }

/* ---------- the eleven rule cards, two to a line ---------- */

.rulecards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  margin-top: 22px;
}
.rulecard {
  background: var(--bg);
  padding: 16px 18px 18px;
  display: flex; flex-direction: column;
}
.rulecard__top {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  font-family: var(--mono);
  font-size: 10.5px; letter-spacing: .18em; text-transform: uppercase;
}
.rulecard__n { color: var(--ink); }
.rulecard__v { color: var(--mute); text-align: right; }
.rulecard--open .rulecard__v { color: var(--orange); }
.rulecard__t {
  font-family: var(--mono);
  font-size: 13px; font-weight: 400; letter-spacing: .04em;
  color: var(--ink);
  margin: 10px 0 8px;
  line-height: 1.45;
}
.rulecard__p { margin: 0 0 14px; font-size: 14.5px; line-height: 1.6; }
.rulecard__p code { font-size: 13px; }
.rulecard--open { border-left: 2px solid var(--orange); }
.rulecard--pass { border-left: 2px solid rgba(255,106,0,.40); }
.rulecard--na   { border-left: 2px solid var(--line-2); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chips__k {
  font-family: var(--mono); font-size: 9.5px; letter-spacing: .2em;
  text-transform: uppercase; color: var(--mute); margin-right: 2px;
}
.chip {
  font-family: var(--mono); font-size: 10.5px; line-height: 1.5;
  color: var(--body);
  border: 1px solid var(--line-2);
  padding: 3px 7px;
  overflow-wrap: anywhere;
}
.chip--x { color: var(--mute); border-style: dashed; }

.rulecard--key { border-left: 2px solid var(--line-2); }
.rulecard--key .rulecard__t { color: var(--mute); }
.keys { display: grid; gap: 10px; margin-bottom: 14px; }
.key { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 10px; align-items: baseline; }
.key b {
  font-family: var(--mono); font-weight: 400; font-size: 13px; color: var(--ink);
  border-left: 2px solid var(--line-2); padding-left: 8px;
}
.key--pass b { border-left-color: rgba(255,106,0,.40); }
.key--open b { border-left-color: var(--orange); }
.key span { font-size: 13.5px; line-height: 1.55; }

@media (max-width: 900px) {
  .rulecards { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Fig. 09: the 86 tests across nine suites ---------- */

.su { width: 100%; height: auto; display: block; margin: 0 auto; }
.su--wide { max-width: 940px; }
.su--compact { display: none; max-width: 380px; }
.su__t { font-family: var(--mono); font-size: 12px; letter-spacing: .06em; fill: #a5a29e; }
.su__t--ink { fill: #e8e6e3; }
.su__t--dim { fill: #a5a29e; }
.su__t--o { fill: #ff6a00; }
.su__t--on { fill: #e8e6e3; }
/* on the orange fill only #0a0a0a clears 4.5:1 — #e8e6e3 on it is 2.31 */
.su__t--dark { fill: #0a0a0a; }
.su__bar { stroke: #0a0a0a; stroke-width: 1; }
.su__bar--local { fill: rgba(232,230,227,.20); }
.su__bar--fork  { fill: var(--orange); }

/* ---------- Fig. 12: EIP-170 headroom ---------- */

.sz { width: 100%; height: auto; display: block; margin: 0 auto; }
.sz--wide { max-width: 940px; }
.sz--compact { display: none; max-width: 380px; }
.sz__t { font-family: var(--mono); font-size: 12px; letter-spacing: .06em; fill: #a5a29e; }
.sz__t--ink { fill: #e8e6e3; }
.sz__t--dim { fill: #a5a29e; }
.sz__t--o { fill: #ff6a00; }
.sz__track { fill: rgba(232,230,227,.06); stroke: var(--line-2); stroke-width: 1; }
.sz__fill { stroke: #0a0a0a; stroke-width: 1; }
.sz__fill--ok { fill: rgba(232,230,227,.32); }
.sz__fill--tight { fill: var(--orange); }

@media (max-width: 640px) {
  .rm--wide, .su--wide, .sz--wide { display: none; }
  .rm--compact, .su--compact, .sz--compact { display: block; }
  .rm__t, .su__t, .sz__t { font-size: 10.5px; }
}

.fl__t--o { fill: #ff6a00; }

/* ---------------------------------------------------------------- Fig. 13 / 14 — the take axis
   and the wage curve. Same wide/compact pair the other plots use: the wide one is hidden below
   the breakpoint and the compact one takes over, so neither is ever scaled down to illegibility. */
.tk { width: 100%; height: auto; display: block; margin: 0 auto; }
.tk--wide { max-width: 940px; }
.tk--compact { display: none; max-width: 380px; }
.tk__t { font-family: var(--mono); font-size: 12px; letter-spacing: .06em; fill: #7d7a76; }
.tk__t--ink { fill: #e8e6e3; }
.tk__t--o   { fill: #ff6a00; }
.tk__t--dim { fill: #7d7a76; }
.tk__ax   { stroke: var(--line-2); stroke-width: 1; }
.tk__tick { stroke: var(--line-2); stroke-width: 1; }
.tk__grid { stroke: var(--line); stroke-width: 1; }
.tk__ref  { stroke: #e8e6e3; stroke-width: 1; stroke-dasharray: 3 4; opacity: .62; }
.tk__track { fill: rgba(232,230,227,.055); }
.tk__bar   { fill: rgba(255,106,0,.38); }
.tk__bar--crit { fill: var(--orange); }
.tk__curve { fill: none; stroke: var(--orange); stroke-width: 1.6; }
.tk__dot   { fill: var(--orange); }

/* ---------------------------------------------------------------- Fig. 15 — the evidence boundary
   Eight rows, each classified. The chip carries the class, the tail carries the one thing that
   would move the item; three of them say "nothing", which is the point of drawing it this way. */
.bnd { padding: 4px 0 8px; }
.bnd__row {
  display: grid;
  grid-template-columns: 132px minmax(0,1fr) 210px;
  gap: 0 22px;
  padding: 16px 0;
  border-top: 1px solid var(--line);
}
.bnd__row:first-child { border-top: 0; }
.bnd__chip b {
  display: inline-block;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .14em;
  padding: 3px 7px;
  border: 1px solid var(--line-2);
  color: var(--body);
}
.bnd__row--open b  { border-color: var(--orange); color: var(--orange); }
.bnd__row--infra b { border-color: #6a6763; }
.bnd__row--mech b  { border-color: #6a6763; color: #e8e6e3; }
.bnd__chip span {
  display: block;
  margin-top: 7px;
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.5;
  color: var(--mute);
}
.bnd__h { margin: 0 0 6px; color: var(--ink); font-size: 15px; line-height: 1.45; }
.bnd__b { margin: 0; font-size: 14.5px; line-height: 1.62; color: var(--body); }
.bnd__mv span {
  display: block;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--mute);
  margin-bottom: 5px;
}
.bnd__mv b { font-weight: 400; font-size: 13.5px; line-height: 1.5; color: var(--ink); }
.bnd__row--mech .bnd__mv b, .bnd__row--disc .bnd__mv b { color: var(--mute); }

/* The three-column boundary row folds first — it is the widest thing on the page — and the
   wide/compact figure swap happens at 640px, the same breakpoint every other plot uses. */
@media (max-width: 900px) {
  .bnd__row { grid-template-columns: 1fr; gap: 10px 0; }
  .bnd__chip b { font-size: 10px; }
  .bnd__chip span { display: inline; margin-left: 8px; }
  .bnd__mv { padding-top: 2px; border-top: 1px dashed var(--line-2); }
  .bnd__mv span { padding-top: 8px; }
}

@media (max-width: 640px) {
  .tk--wide { display: none; }
  .tk--compact { display: block; }
}

/* ---------------------------------------------------------------- illustrations
   The drawings in art/ are pictures rather than plots, so they sit in the same frame every
   measured figure uses — same rule, same number, same caption slot — and their captions say
   what they are. Nothing here styles the artwork itself; each drawing carries its own scoped
   rules under its own class prefix. */
.artfig { margin: 0; border: 1px solid var(--line-2); }
.artfig__head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 16px;
  padding: 11px 16px;
  border-bottom: 1px solid var(--line-2);
  font-family: var(--mono);
  font-size: 11px; letter-spacing: .18em; text-transform: uppercase;
  color: var(--mute);
}
.artfig__head b {
  color: var(--ink); font-weight: 400; letter-spacing: .08em; text-transform: none;
  font-size: 12px;
}
.artfig__body { padding: 0; line-height: 0; text-align: center; }
/* :where() so this contributes NO specificity. Each drawing ships its own desktop/mobile pair and
   hides one with a plain `.x-mob{display:none}` — a (0,2,1) selector here beat that (0,1,0) rule
   and every plate rendered both variants stacked, one of them four screens tall. */
:where(.artfig__body) > svg { display: block; width: 100%; height: auto; margin: 0 auto; }
/* A portrait plate blown out to the full column is a 1,400px-tall object. Cap it at its own
   natural width and centre it. */
.artfig--tall :where(.artfig__body) > svg { width: auto; max-width: 100%; max-height: 720px; }
.artfig__cap {
  display: flex; gap: 16px; justify-content: space-between; flex-wrap: wrap;
  padding: 11px 16px;
  border-top: 1px solid var(--line-2);
  font-family: var(--mono);
  font-size: 11px; letter-spacing: .1em;
  color: var(--mute);
}
@media (max-width: 640px) {
  .artfig__head { flex-direction: column; gap: 4px; }
  .artfig__cap { font-size: 10px; }
}

/* ---------------------------------------------------------------- the opening
   FRONTEND.md rule 2. The drawing is the first thing in <main>, full bleed to the frame, and it
   plays as the page loads. It is not an overlay and it does not delay anything: the page's text
   is in the DOM underneath it from the first byte. */
.opening {
  border-bottom: 1px solid var(--line-2);
  background: #060606;
}
.opening__art { line-height: 0; }
/* The opening keeps only the landscape variant of a drawing, so the drawing's own
   `@media (max-width:640px){.x-wide{display:none}}` would leave the opening empty. Overriding
   that switch is exactly what this line is for — measured at 0.03 screens tall without it. */
/* A descendant selector, not a child one: extract.py keeps each drawing's own wrapper element
   (some scope their rules to it), so the svg is a grandchild here. Scoped to role="img" so the
   hidden sprite that holds a drawing's <defs> is left alone. */
.opening__art svg[role="img"] { display: block !important; width: 100%; height: auto; }
.opening__bar {
  display: flex; align-items: baseline; justify-content: space-between; gap: 16px;
  max-width: var(--maxw); margin: 0 auto;
  padding: 10px var(--gutter);
  border-top: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 11px; letter-spacing: .18em; text-transform: uppercase;
  color: var(--mute);
}
.opening__bar b {
  color: var(--body); font-weight: 400; letter-spacing: .08em; text-transform: none;
  font-size: 12px; text-align: right;
}
/* The opening carries the eye down; the hero under it does not need the old top padding. */
.opening + .hero { padding-top: 44px; }

@media (max-width: 640px) {
  .opening__bar { flex-direction: column; gap: 3px; padding: 9px 20px; }
  .opening__bar b { text-align: left; }
}

/* Eleven routes wrapping on a phone made a 253px sticky header — 30% of the viewport, spent on
   chrome before a word of the page. Below the breakpoint the bar becomes one scrollable row. */
@media (max-width: 640px) {
  .nav__in { padding: 12px 0 10px; gap: 8px; flex-wrap: nowrap; align-items: center; }
  .nav__mark { margin: 0 0 0 20px; font-size: 12px; letter-spacing: .34em; flex: none; }
  .nav__links {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 16px;
    padding: 0 20px 2px;
    margin-left: auto;
    /* fade the right edge so it reads as "there is more this way" */
    mask-image: linear-gradient(to right, #000 calc(100% - 22px), transparent);
  }
  .nav__links::-webkit-scrollbar { display: none; }
  .nav__links a { white-space: nowrap; }
}
