/* 003 / Web Brutalism — system fonts, visible structure, no polish. */

:root {
  --bg: #ffffff;
  --ink: #000000;
  --soft: #1f1f1f;
  --alt: #efefef;
  --line: #000000;
  --link: #0000ee;
  --visited: #551a8b;
  --mark: #ffff00;
  --mark-ink: #000000;
  --alarm: #c00000;
  --alarm-ink: #ffffff;
  --brand: #364f6a;
  --xray: #ff0000;
  --rule: 3px;

  --serif: "Times New Roman", Times, "Liberation Serif", serif;
  --sans: "Helvetica Neue", Helvetica, Arial, "Liberation Sans", sans-serif;
  --mono: ui-monospace, Menlo, Consolas, "Liberation Mono", "Courier New", monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #000000;
    --ink: #ffffff;
    --soft: #e6e6e6;
    --alt: #161616;
    --line: #ffffff;
    --link: #8cb4ff;
    --visited: #d4a8ff;
    --alarm: #ff5a5a;
    --alarm-ink: #000000;
    --brand: #8fb0d3;
    --xray: #ff4d4d;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #000000;
  --ink: #ffffff;
  --soft: #e6e6e6;
  --alt: #161616;
  --line: #ffffff;
  --link: #8cb4ff;
  --visited: #d4a8ff;
  --alarm: #ff5a5a;
  --alarm-ink: #000000;
  --brand: #8fb0d3;
  --xray: #ff4d4d;
  color-scheme: dark;
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 1.1875rem/1.5 var(--serif);
  overflow-x: hidden;
}

::selection { background: var(--mark); color: var(--mark-ink); }

/* ---------- Type ---------- */

h1, h2, h3, h4 {
  font-family: var(--sans);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0 0 0.5em;
}
h1 { font-size: clamp(2.5rem, 6.5vw, 5.75rem); letter-spacing: -0.04em; line-height: 0.95; }
h2 { font-size: clamp(1.75rem, 3.4vw, 2.75rem); }
h3 { font-size: 1.375rem; letter-spacing: -0.01em; line-height: 1.2; }
h4 { font-size: 1.125rem; }

p { margin: 0 0 1em; }
.lede { font-size: clamp(1.3rem, 2vw, 1.6rem); line-height: 1.35; max-width: 42ch; }
.measure { max-width: 68ch; }

a { color: var(--link); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:visited { color: var(--visited); }
a:hover { background: var(--mark); color: var(--mark-ink); text-decoration-thickness: 2px; }

.mono, code, kbd, samp { font-family: var(--mono); }
code { font-size: 0.92em; background: var(--alt); padding: 0.05em 0.3em; border: 1px solid var(--line); }
mark { background: var(--mark); color: var(--mark-ink); padding: 0 0.15em; }

.meta {
  font: 400 0.875rem/1.45 var(--mono);
  color: var(--soft);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.vh {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
a:focus-visible, button:focus-visible { background: var(--mark); color: var(--mark-ink); }

hr { border: 0; border-top: var(--rule) solid var(--line); margin: 2rem 0; }

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

.wrap { max-width: 1440px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 768px) { .wrap { padding: 0 28px; } }

.skip {
  position: absolute; left: 8px; top: -60px; z-index: 10;
  background: var(--mark); color: var(--mark-ink); padding: 0.6rem 1rem;
  font: 700 1rem var(--sans); border: var(--rule) solid #000;
}
.skip:focus { top: 8px; }

/* Every labelled region prints its own tag. */
[data-tag] { position: relative; }
[data-tag]::before {
  content: attr(data-tag);
  position: absolute;
  top: calc(var(--rule) * -1);
  left: calc(var(--rule) * -1);
  background: var(--ink);
  color: var(--bg);
  font: 400 0.8125rem/1 var(--mono);
  padding: 0.35rem 0.5rem;
  z-index: 1;
  white-space: nowrap;
  max-width: calc(100% + var(--rule));
  overflow: hidden;
  text-overflow: ellipsis;
}

.box {
  border: var(--rule) solid var(--line);
  padding: 2.75rem 1rem 1.25rem;
  margin: 0 0 2rem;
}
@media (min-width: 768px) { .box { padding: 3rem 1.75rem 1.75rem; } }

/* ---------- Masthead + nav ---------- */

.masthead { border-bottom: var(--rule) solid var(--line); margin-bottom: 2rem; }
.mast-top {
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between;
  gap: 0.75rem 2rem; padding: 1rem 0 0.9rem;
}
.wordmark {
  display: inline-flex; align-items: center; gap: 0.6rem;
  text-decoration: none; color: var(--ink);
  font: 700 clamp(1.75rem, 4vw, 2.75rem)/1 var(--sans); letter-spacing: -0.05em;
}
.wordmark:visited { color: var(--ink); }
.monogram {
  display: inline-grid; place-items: center;
  width: 2.75rem; height: 2.75rem; flex: none;
  background: var(--ink); color: var(--bg);
  font: 700 1.2rem/1 var(--sans); letter-spacing: -0.04em;
}
.mast-meta { margin: 0; text-align: right; }
@media (max-width: 640px) { .mast-meta { text-align: left; } }

.nav {
  display: grid;
  grid-template-columns: 1fr;
  border-top: var(--rule) solid var(--line);
}
.nav ul {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(3, 1fr);
}
.nav li { border-right: var(--rule) solid var(--line); border-bottom: var(--rule) solid var(--line); }
.nav li:nth-child(3n) { border-right: 0; }
.nav a {
  display: flex; align-items: center; min-height: 48px; padding: 0.5rem 0.9rem;
  font: 700 1.0625rem/1.1 var(--sans); text-transform: uppercase; letter-spacing: 0.01em;
  color: var(--ink);
}
.nav a:visited { color: var(--ink); }
.nav a.nav-ai { background: var(--mark); color: var(--mark-ink); }
.nav a[aria-current="page"] { background: var(--ink); color: var(--bg); text-decoration: none; }
.nav a[aria-current="page"]::before { content: "\2192\00a0"; }

.nav-tools {
  display: grid; grid-template-columns: 1fr;
}
.search { display: flex; border-bottom: var(--rule) solid var(--line); }
.search input {
  flex: 1; min-width: 0; min-height: 48px; border: 0; padding: 0.5rem 0.9rem;
  background: var(--bg); color: var(--ink); font: 1.0625rem var(--mono);
}
.search input::placeholder { color: var(--soft); opacity: 1; }
.search button, .tool {
  min-height: 48px; border: 0; border-left: var(--rule) solid var(--line);
  background: var(--bg); color: var(--ink); padding: 0.5rem 0.9rem; cursor: pointer;
  font: 700 0.9375rem/1 var(--sans); text-transform: uppercase;
}
.search button:hover, .tool:hover { background: var(--ink); color: var(--bg); }
.toolrow { display: grid; grid-template-columns: 1fr 1fr; }
.toolrow .tool:first-child { border-left: 0; }
.tool[aria-pressed="true"] { background: var(--ink); color: var(--bg); }

@media (min-width: 1000px) {
  .nav { grid-template-columns: 1fr auto; }
  .nav ul { grid-template-columns: repeat(6, auto); justify-content: start; }
  .nav li { border-bottom: 0; }
  .nav li:nth-child(3n) { border-right: var(--rule) solid var(--line); }
  .nav-tools { grid-template-columns: auto auto; border-left: 0; }
  .search { border-bottom: 0; border-left: var(--rule) solid var(--line); }
  .search input { width: 13rem; }
  .toolrow .tool:first-child { border-left: var(--rule) solid var(--line); }
}

.crumb { font: 0.9375rem/1.4 var(--mono); margin: 0 0 1.5rem; }

/* ---------- Page heads ---------- */

.pagehead { border-bottom: var(--rule) solid var(--line); padding-bottom: 1.75rem; margin-bottom: 2.25rem; }
.pagehead h1 { margin-bottom: 0.3em; }
.pagehead .eyebrow { margin-bottom: 1rem; }
.eyebrow {
  display: inline-block; font: 400 0.875rem/1 var(--mono); text-transform: uppercase;
  border: 2px solid var(--line); padding: 0.4rem 0.55rem; letter-spacing: 0.04em;
}

.split { display: grid; gap: 2rem; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 960px) {
  .split { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); align-items: start; }
  .split.rev { grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr); }
}

.sectionhead {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline;
  gap: 0.5rem 1.5rem; border-bottom: var(--rule) solid var(--line); padding-bottom: 0.6rem; margin-bottom: 1.25rem;
}
.sectionhead h2 { margin: 0; }
.sectionhead p { margin: 0; }
.count { font: 400 0.875rem var(--mono); }

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

.hero { display: grid; gap: 0; grid-template-columns: minmax(0, 1fr); border: var(--rule) solid var(--line); margin-bottom: 2.5rem; }
.hero-text { padding: 3rem 1rem 1.5rem; }
.hero-fig { margin: 0; border-top: var(--rule) solid var(--line); }
.hero-fig img { border: 0; width: 100%; height: 100%; object-fit: cover; object-position: 20% 30%; aspect-ratio: 4 / 3; }
.hero-fig figcaption { border-top: var(--rule) solid var(--line); padding: 0.5rem 0.75rem; }
.hero h1 { font-size: clamp(2.75rem, 7.2vw, 7rem); }
@media (min-width: 960px) {
  .hero { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); }
  .hero-text { padding: 3.5rem 2rem 2rem; }
  .hero-fig { border-top: 0; border-left: var(--rule) solid var(--line); display: flex; flex-direction: column; }
  .hero-fig img { flex: 1; aspect-ratio: auto; min-height: 30rem; }
}

.ctas { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1.5rem; margin-top: 1.75rem; }
.ctas .tertiary { font-family: var(--mono); font-size: 1rem; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  min-height: 48px; padding: 0.6rem 1.1rem;
  border: var(--rule) solid var(--line); background: var(--bg); color: var(--ink);
  font: 700 1rem/1.1 var(--sans); text-transform: uppercase; letter-spacing: 0.02em;
  text-decoration: none; cursor: pointer;
}
.btn:visited { color: var(--ink); }
.btn:hover { background: var(--ink); color: var(--bg); }
.btn.primary, .btn.primary:visited { background: var(--ink); color: var(--bg); }
.btn.primary:hover { background: var(--mark); color: var(--mark-ink); }
.btn[aria-busy="true"] { cursor: progress; }
.btn.small { min-height: 44px; font-size: 0.875rem; padding: 0.4rem 0.8rem; }

/* ---------- Stats table ---------- */

.stats { display: grid; grid-template-columns: repeat(3, 1fr); border: var(--rule) solid var(--line); margin: 1.5rem 0 0; }
.stats div { padding: 0.75rem 0.9rem; border-left: var(--rule) solid var(--line); }
.stats div:first-child { border-left: 0; }
.stats b { display: block; font: 700 clamp(1.75rem, 3.5vw, 2.75rem)/1 var(--sans); letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
.stats span { display: block; margin-top: 0.35rem; font: 0.875rem/1.3 var(--mono); text-transform: uppercase; }

/* ---------- Tables ---------- */

.tablewrap { border: var(--rule) solid var(--line); overflow-x: auto; margin-bottom: 2rem; }
table { border-collapse: collapse; width: 100%; }
th, td { border: 2px solid var(--line); padding: 0.7rem 0.8rem; text-align: left; vertical-align: top; }
.tablewrap table { margin: -2px; width: calc(100% + 4px); }
thead th {
  background: var(--ink); color: var(--bg); border-color: var(--line);
  font: 400 0.875rem/1.2 var(--mono); text-transform: uppercase; letter-spacing: 0.04em; white-space: nowrap;
}
tbody tr:nth-child(even) td { background: var(--alt); }
td.date, td.num { font: 0.9375rem/1.5 var(--mono); white-space: nowrap; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td .title { font: 700 1.1875rem/1.25 var(--sans); letter-spacing: -0.01em; }
td p { margin: 0.35rem 0 0; }
td .tags { margin-top: 0.45rem; }
@media (max-width: 720px) {
  .hide-sm { display: none; }
  th, td { padding: 0.6rem; }
}

/* ---------- Tag chips ---------- */

.tags { display: flex; flex-wrap: wrap; gap: 0.4rem; list-style: none; margin: 0; padding: 0; }
.tag {
  display: inline-block; border: 2px solid var(--line); padding: 0.15rem 0.45rem;
  font: 0.875rem/1.3 var(--mono); color: var(--ink); text-decoration: none; background: var(--bg);
}
a.tag:visited { color: var(--ink); }
a.tag:hover { background: var(--mark); color: var(--mark-ink); }
.badge {
  display: inline-block; font: 700 0.8125rem/1 var(--mono); text-transform: uppercase;
  padding: 0.3rem 0.45rem; border: 2px solid var(--line); vertical-align: middle; letter-spacing: 0.04em;
}
.badge.new { background: var(--mark); color: var(--mark-ink); border-color: var(--mark-ink); }
.badge.upd { background: var(--bg); color: var(--ink); }
.badge.soon { background: var(--bg); color: var(--ink); border-style: dashed; }

/* ---------- Cell grid (collapsed borders) ---------- */

.cells {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr));
  border-top: var(--rule) solid var(--line); border-left: var(--rule) solid var(--line);
  margin-bottom: 2rem;
}
.cells > * { border-right: var(--rule) solid var(--line); border-bottom: var(--rule) solid var(--line); padding: 1rem; min-width: 0; }
.cells.two { grid-template-columns: repeat(auto-fit, minmax(min(100%, 26rem), 1fr)); }
.cell h3 { margin: 0.4rem 0 0.45rem; }
.cell p { margin-bottom: 0.6rem; }
.cell figure { margin: -1rem -1rem 1rem; }
.cell figure img { border: 0; border-bottom: var(--rule) solid var(--line); width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }

/* ---------- Figures ---------- */

img { display: block; max-width: 100%; height: auto; border: var(--rule) solid var(--line); background: var(--alt); }
figure { margin: 0 0 1.5rem; }
figcaption { font: 0.875rem/1.45 var(--mono); padding-top: 0.45rem; overflow-wrap: anywhere; }
.bw { filter: grayscale(1) contrast(1.12); }

/* A GIF recorded from a terminal opens on a blank frame; say so instead of showing a black rectangle. */
.gifbox {
  display: grid; place-items: center; aspect-ratio: 16 / 9; margin: -1rem -1rem 1rem;
  border-bottom: var(--rule) solid var(--line); background: var(--ink); color: var(--bg);
  font: 0.9375rem/1.4 var(--mono); text-align: center; padding: 1rem;
}
.gifbox a { color: var(--mark); }
.gifbox a:visited { color: var(--mark); }
.gifbox a:hover { background: var(--mark); color: #000; }

/* ---------- Lists ---------- */

.numbered { counter-reset: row; list-style: none; margin: 0 0 2rem; padding: 0; border-top: var(--rule) solid var(--line); }
.numbered > li {
  counter-increment: row; display: grid; grid-template-columns: 3.25rem minmax(0, 1fr); gap: 0 1rem;
  border-bottom: var(--rule) solid var(--line); padding: 1rem 0;
}
.numbered > li::before { content: counter(row, decimal-leading-zero); font: 700 1.75rem/1 var(--sans); letter-spacing: -0.04em; }
.numbered h3 { margin: 0 0 0.3rem; }
.numbered p { margin: 0.25rem 0 0; }

dl.defs { display: grid; grid-template-columns: 1fr; border: var(--rule) solid var(--line); margin: 0 0 2rem; }
dl.defs dt { font: 700 1rem var(--sans); text-transform: uppercase; padding: 0.75rem 1rem 0; }
dl.defs dd { margin: 0; padding: 0.25rem 1rem 0.9rem; border-bottom: 2px solid var(--line); }
dl.defs dd:last-child { border-bottom: 0; }
@media (min-width: 720px) {
  dl.defs { grid-template-columns: 12rem minmax(0, 1fr); }
  dl.defs dt { padding: 0.9rem 1rem; border-bottom: 2px solid var(--line); border-right: 2px solid var(--line); }
  dl.defs dd { padding: 0.9rem 1rem; }
  dl.defs dt:nth-last-of-type(1) { border-bottom: 0; }
}

/* ---------- Notice ---------- */

.notice {
  border: var(--rule) solid var(--line); background: var(--mark); color: var(--mark-ink);
  padding: 1rem; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem;
  margin-bottom: 2rem;
}
.notice p { margin: 0; font-size: 1.25rem; }
.notice .btn { border-color: #000; background: #000; color: #fff; }
.notice .btn:hover { background: #fff; color: #000; }
.notice a:not(.btn) { color: #000; }

/* ---------- Forms ---------- */

fieldset { border: var(--rule) solid var(--line); margin: 0 0 1rem; padding: 1rem; min-width: 0; }
legend { font: 700 1rem var(--sans); text-transform: uppercase; padding: 0 0.4rem; }
label { font-family: var(--sans); }
input[type="email"], input[type="text"], input[type="search"], select {
  width: 100%; min-height: 48px; border: 2px solid var(--line); border-radius: 0;
  background: var(--bg); color: var(--ink); font: 1.0625rem var(--mono); padding: 0.5rem 0.7rem;
}
.formrow { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 0.5rem; }
.formrow input { flex: 1 1 14rem; width: auto; }
.check { display: flex; gap: 0.6rem; align-items: flex-start; margin-top: 0.8rem; font: 1rem/1.4 var(--serif); }
.check input { width: 1.25rem; height: 1.25rem; margin-top: 0.15rem; accent-color: var(--ink); flex: none; }
.formmsg { font: 0.9375rem/1.4 var(--mono); margin: 0.6rem 0 0; min-height: 1.4em; }
.formmsg.ok::before { content: "OK \2014 "; font-weight: 700; }
.formmsg.err::before { content: "ERROR \2014 "; font-weight: 700; }

.radios { display: flex; flex-wrap: wrap; gap: 0; border: var(--rule) solid var(--line); margin: 0 0 1rem; padding: 0; }
.radios legend { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.radios label {
  display: flex; align-items: center; gap: 0.45rem; min-height: 48px; padding: 0.4rem 0.9rem;
  border-right: 2px solid var(--line); cursor: pointer; font: 700 0.9375rem var(--sans); text-transform: uppercase;
}
.radios label:last-of-type { border-right: 0; }
.radios input { accent-color: var(--ink); width: 1.1rem; height: 1.1rem; margin: 0; }
.radios label:has(input:checked) { background: var(--ink); color: var(--bg); }
.radios label:has(input:focus-visible) { outline: 3px solid var(--ink); outline-offset: -6px; background: var(--mark); color: var(--mark-ink); }
@media (max-width: 640px) {
  .radios label { flex: 1 1 50%; border-bottom: 2px solid var(--line); }
}

/* ---------- Footer ---------- */

.footer { border-top: var(--rule) solid var(--line); margin-top: 3rem; }
.footgrid { display: grid; grid-template-columns: 1fr; border-left: var(--rule) solid var(--line); border-right: var(--rule) solid var(--line); }
.footgrid > section { padding: 2.75rem 1rem 1.25rem; border-bottom: var(--rule) solid var(--line); }
.footgrid h2 { font-size: 1.125rem; text-transform: uppercase; letter-spacing: 0.02em; }
.footgrid ul { list-style: none; margin: 0; padding: 0; }
.footgrid li { padding: 0.2rem 0; }
.footgrid li a { display: inline-block; padding: 0.3rem 0; }
@media (min-width: 900px) {
  .footgrid { grid-template-columns: 1.3fr 1fr 1fr 1.6fr; }
  .footgrid > section { border-right: var(--rule) solid var(--line); }
  .footgrid > section:last-child { border-right: 0; }
}
.footbar {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem 2rem;
  padding: 1rem 0 2rem; font: 0.875rem/1.5 var(--mono);
}

/* ---------- Article ---------- */

.article-head { border: var(--rule) solid var(--line); margin-bottom: 2rem; }
.article-head .inner { padding: 3rem 1rem 1.5rem; }
@media (min-width: 768px) { .article-head .inner { padding: 3.25rem 2rem 2rem; } }
.article-head h1 { font-size: clamp(2.4rem, 6vw, 5.25rem); max-width: 16ch; }
.article-head .lede { max-width: 50ch; }
.article-head figure { margin: 0; border-top: var(--rule) solid var(--line); }
.article-head figure img { border: 0; width: 100%; max-height: 26rem; object-fit: cover; }
.article-head figcaption { border-top: var(--rule) solid var(--line); padding: 0.5rem 0.9rem; }
.factsheet { border-top: var(--rule) solid var(--line); display: grid; grid-template-columns: repeat(2, 1fr); }
.factsheet div { padding: 0.7rem 1rem; border-right: 2px solid var(--line); border-bottom: 2px solid var(--line); }
.factsheet dt { font: 0.8125rem/1.2 var(--mono); text-transform: uppercase; }
.factsheet dd { margin: 0.2rem 0 0; font: 700 1.0625rem/1.3 var(--sans); }
@media (min-width: 900px) {
  .factsheet { grid-template-columns: repeat(4, 1fr); }
  .factsheet div { border-bottom: 0; }
  .factsheet div:last-child { border-right: 0; }
}

.article-layout { display: grid; gap: 2rem; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1100px) {
  .article-layout { grid-template-columns: 17rem minmax(0, 1fr); gap: 3rem; }
}
.toc { border: var(--rule) solid var(--line); padding: 2.75rem 1rem 1rem; align-self: start; }
.toc ol { margin: 0; padding-left: 1.6rem; font: 1rem/1.45 var(--sans); }
.toc li { padding: 0.3rem 0; }
.toc a[aria-current="true"] { background: var(--ink); color: var(--bg); text-decoration: none; padding: 0 0.2rem; }
.toc details summary { font: 700 1rem var(--sans); text-transform: uppercase; cursor: pointer; min-height: 44px; display: flex; align-items: center; }
.toc .progress { font: 0.875rem var(--mono); margin-top: 0.75rem; border-top: 2px solid var(--line); padding-top: 0.6rem; }
@media (min-width: 1100px) {
  .toc { position: sticky; top: 1rem; max-height: calc(100vh - 2rem); overflow: auto; }
}

.prose { max-width: 70ch; font-size: 1.25rem; line-height: 1.55; }
.prose > * + * { margin-top: 1.1em; }
.prose p { margin: 0; }
.prose h2 {
  font-size: clamp(1.75rem, 3vw, 2.4rem); margin: 2.4em 0 0.6em; padding-top: 0.5rem;
  border-top: var(--rule) solid var(--line); scroll-margin-top: 1rem;
}
.prose h2 .hnum { font-family: var(--mono); font-weight: 400; font-size: 0.55em; display: block; margin-bottom: 0.4rem; letter-spacing: 0; }
.prose ol, .prose ul { padding-left: 1.6em; }
.prose li + li { margin-top: 0.3em; }
.prose blockquote { margin-left: 0; margin-right: 0; }

.callout { border: var(--rule) solid var(--line); padding: 2.6rem 1rem 1rem; font-size: 1.1875rem; }
.callout p { margin: 0; }
.callout.why { border-left-width: 14px; }
.callout.ask { background: var(--mark); color: var(--mark-ink); border-color: var(--mark-ink); }
.callout.ask a { color: #000; }
.callout.ask[data-tag]::before { background: #000; color: #fff; }
.callout.skill { background: var(--alt); }

.codeblock { max-width: 84ch; }
.codehead {
  display: flex; justify-content: space-between; align-items: stretch;
  border: var(--rule) solid var(--line); border-bottom: 0; background: var(--ink); color: var(--bg);
}
.codehead span { font: 0.875rem/1 var(--mono); padding: 0.75rem 0.8rem; display: flex; align-items: center; }
.codehead button {
  border: 0; border-left: var(--rule) solid var(--bg); background: var(--ink); color: var(--bg);
  font: 700 0.875rem var(--sans); text-transform: uppercase; padding: 0 1rem; min-height: 44px; cursor: pointer;
}
.codehead button:hover, .codehead button:focus-visible { background: var(--mark); color: #000; }
pre {
  margin: 0; border: var(--rule) solid var(--line); background: var(--bg); color: var(--ink);
  padding: 1rem; overflow-x: auto; font: 0.9375rem/1.6 var(--mono); tab-size: 2;
}
pre code { background: none; border: 0; padding: 0; font-size: inherit; }
pre .cm { font-style: italic; color: var(--soft); }

.after-article { margin-top: 3.5rem; }

/* ---------- Patterns ---------- */

.pcards { grid-template-columns: repeat(auto-fill, minmax(min(100%, 20rem), 1fr)); }
.pcard { display: flex; flex-direction: column; gap: 0.5rem; }
.pthumb {
  margin: -1rem -1rem 0.5rem; border-bottom: var(--rule) solid var(--line);
  height: 9rem; display: flex; align-items: flex-end; justify-content: space-between;
  padding: 0.75rem 1rem; background:
    repeating-linear-gradient(0deg, transparent 0 23px, var(--alt) 23px 24px),
    repeating-linear-gradient(90deg, transparent 0 23px, var(--alt) 23px 24px), var(--bg);
}
.pthumb b { font: 700 5rem/0.8 var(--sans); letter-spacing: -0.06em; }
.pthumb span { font: 0.8125rem var(--mono); text-transform: uppercase; background: var(--bg); border: 2px solid var(--line); padding: 0.25rem 0.4rem; }
.pcard h3 a { color: var(--ink); }
.pcard h3 a:visited { color: var(--visited); }
.pcard .good { font-size: 1.0625rem; }
.pcard .good b { font-family: var(--sans); }
.empty { border: var(--rule) dashed var(--line); padding: 2rem 1rem; margin-bottom: 2rem; }
.empty h3 { margin-bottom: 0.4rem; }

.panes { border: var(--rule) solid var(--line); margin-bottom: 2rem; }
.panebar { display: flex; flex-wrap: wrap; justify-content: space-between; border-bottom: var(--rule) solid var(--line); }
.tablist { display: flex; flex-wrap: wrap; }
.tablist button, .paneact button {
  min-height: 48px; border: 0; border-right: 2px solid var(--line); background: var(--bg); color: var(--ink);
  font: 700 0.9375rem var(--sans); text-transform: uppercase; padding: 0 1rem; cursor: pointer;
}
.tablist button[aria-selected="true"] { background: var(--ink); color: var(--bg); }
.tablist button[aria-selected="true"]::before { content: "\25B6\00a0"; font-size: 0.75em; }
.tablist button:hover, .paneact button:hover { background: var(--mark); color: var(--mark-ink); }
.paneact { display: flex; }
.paneact button { border-right: 0; border-left: 2px solid var(--line); }
@media (max-width: 700px) {
  .tablist { width: 100%; }
  .tablist button { flex: 1 1 33%; border-bottom: 2px solid var(--line); }
  .paneact { width: 100%; }
  .paneact button { flex: 1; border-left: 0; border-right: 2px solid var(--line); }
}
.pane { padding: 1.25rem 1rem; }
.pane[hidden] { display: none; }
.pane pre { border-width: 2px; max-height: 32rem; }
.pane .note { font-size: 1.0625rem; border-left: 8px solid var(--line); padding-left: 0.8rem; margin-bottom: 1rem; }
.prompt { max-width: 70ch; font-size: 1.1875rem; }

/* The hairline stat strip, running live. */
.hss-caption { font: 0.9375rem/1.4 var(--mono); margin: 0 0 0.6rem; }
.hss-strip {
  display: grid; gap: 2px; background: var(--line); border: 2px solid var(--line);
  grid-template-columns: 1fr; margin-bottom: 1.5rem;
}
@media (min-width: 21rem) { .hss-strip { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 42rem) { .hss-strip.four { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 52rem) { .hss-strip.five { grid-template-columns: repeat(5, 1fr); } }
.hss-tile {
  background: var(--bg); color: var(--ink); padding: 0.8rem 0.9rem; min-width: 0;
  border: 0; text-align: left; font: inherit; display: block; width: 100%;
}
button.hss-tile { cursor: pointer; min-height: 44px; }
button.hss-tile:hover { background: var(--alt); }
button.hss-tile[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.hss-label { display: block; font: 0.8125rem/1.3 var(--mono); text-transform: uppercase; overflow-wrap: anywhere; }
.hss-fig { display: block; font: 700 1.6rem/1.1 var(--sans); font-variant-numeric: tabular-nums; margin: 0.25rem 0; }
.hss-fig.missing { opacity: 0.55; }
.hss-sub { display: block; font-size: 1rem; }
.hss-list { list-style: none; padding: 0; margin: 0; border: 2px solid var(--line); }
.hss-list li { display: flex; justify-content: space-between; gap: 1rem; padding: 0.55rem 0.8rem; border-bottom: 2px solid var(--line); }
.hss-list li:last-child { border-bottom: 0; }
.hss-list li[hidden] { display: none; }
.hss-list .st { font: 0.875rem var(--mono); text-transform: uppercase; white-space: nowrap; }
.hss-status { font: 0.9375rem/1.4 var(--mono); margin: 0.75rem 0 0; }

/* ---------- X-ray: expose the DOM ---------- */

html.xray body * { outline: 1px dashed var(--xray) !important; outline-offset: -1px; }
html.xray [data-tag]::before { background: var(--xray); color: #fff; }

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
@media print {
  .nav, .footer, .toc, .codehead button { display: none; }
}

/* ---------- Utilities ---------- */
.wordmark.small { font-size: 1.75rem; }
.cell.pt { padding-top: 2.75rem; }
/* Inverted panels swap the tokens, so every rule inside keeps working. */
.invert {
  --bg: #000000; --ink: #ffffff; --soft: #e6e6e6; --alt: #1c1c1c; --line: #ffffff;
  --link: #8cb4ff; --visited: #d4a8ff;
  background: var(--bg); color: var(--ink);
}
:root[data-theme="dark"] .invert {
  --bg: #ffffff; --ink: #000000; --soft: #1f1f1f; --alt: #efefef; --line: #000000;
  --link: #0000ee; --visited: #551a8b;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .invert {
    --bg: #ffffff; --ink: #000000; --soft: #1f1f1f; --alt: #efefef; --line: #000000;
    --link: #0000ee; --visited: #551a8b;
  }
}
.box.invert { border-color: var(--bg); outline: var(--rule) solid var(--ink); outline-offset: calc(var(--rule) * -1); }
.cap { caption-side: top; text-align: left; padding-bottom: 0.4rem; }
.story-art figure { margin: 0; }
.story-art img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.btn.hot, .btn.hot:visited { background: var(--mark); color: var(--mark-ink); border-color: var(--mark); }
.btn.hot:hover { background: var(--bg); color: var(--ink); border-color: var(--bg); }
.mt { margin-top: 1.5rem; }
.mt0 { margin-top: 0; }
.title { font: 700 1.1875rem/1.25 var(--sans); letter-spacing: -0.01em; }
a.cell { color: var(--ink); text-decoration: none; display: block; min-height: 44px; }
a.cell:visited { color: var(--ink); }
a.cell:hover { background: var(--mark); color: var(--mark-ink); }
a.cell .title { font-size: 1.5rem; text-decoration: underline; }
.numbered ul { margin: 0.6rem 0 0.75rem; padding-left: 1.2rem; }
.numbered ul.tags { padding-left: 0; }
.numbered ul li + li { margin-top: 0.35rem; }
.proverbs blockquote { margin: 0; }
.proverbs p { font: 700 clamp(1.4rem, 2.8vw, 2.3rem)/1.15 var(--sans); letter-spacing: -0.02em; margin: 0; }
.proverbs > li::before { font-family: var(--mono); font-weight: 400; font-size: 1rem; padding-top: 0.5rem; }
.pcards { list-style: none; padding: 0; margin-top: 0; }
.pcards > li[hidden] { display: none; }
#pattern-search { border-width: var(--rule); min-height: 56px; font-size: 1.125rem; margin-bottom: 1rem; }
.filterrow { display: flex; flex-wrap: wrap; gap: 1rem; align-items: stretch; margin-bottom: 1.5rem; }
.filterrow .radios { margin: 0; flex: 1 1 auto; }
.sortbox { display: flex; align-items: center; gap: 0.6rem; font-weight: 700; }
.sortbox select { width: auto; border-width: var(--rule); }
.story-list { border-top-color: var(--line); }
tr[hidden] { display: none; }

.cells > .invert { border-right-color: var(--bg); border-bottom-color: var(--bg); }
.ah-top { display: grid; grid-template-columns: minmax(0, 1fr); }
.article-head .ah-top figure { border-top: var(--rule) solid var(--line); }
.article-head .ah-top figure img { max-height: 18rem; }
@media (min-width: 960px) {
  .ah-top { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
  .article-head .ah-top figure { border-top: 0; border-left: var(--rule) solid var(--line); display: flex; flex-direction: column; }
  .article-head .ah-top figure img { flex: 1; max-height: none; height: 100%; object-position: 0% 50%; }
}

[hidden] { display: none !important; }
@media (min-width: 21rem) and (max-width: 51.99rem) {
  .hss-strip.five .hss-tile:last-child { grid-column: 1 / -1; }
}

/* UI pattern library article */
.prose .prose-fig { border: var(--rule) solid var(--line); margin: 2rem 0; }
.prose .prose-fig img { width: 100%; height: auto; display: block; }
.prose .prose-fig figcaption { border-top: var(--rule) solid var(--line); padding: 0.5rem 0.9rem; }
.prose .callout p + p { margin-top: 0.8rem; }
.prose .live-pattern a.btn { white-space: normal; text-decoration: none; }
.prose p code { overflow-wrap: anywhere; }
.prose > * + p { margin-top: 1.1em; }
