:root {
  color-scheme: light;
  --ink: #335050;
  --body: #113030;
  --background: #F6F9F9;
  --rule: #c7d4d4;
  --mono: "IBM Plex Mono", monospace;
  --sans: "IBM Plex Sans", sans-serif;
  --serif: "IBM Plex Serif", serif;
  font-family: var(--sans);
  color: var(--body);
  background: var(--background);
  font-synthesis: none;
}
* { box-sizing: border-box; }
body { margin: 0; }
a { color: inherit; text-underline-offset: .2em; text-decoration-thickness: 1px; }
a:hover { text-decoration: underline; }
a:focus-visible { outline: 2px solid var(--ink); outline-offset: 5px; }
::selection { background: var(--ink); color: var(--background); }
.shell { width: min(100% - 3rem, 1000px); margin-inline: auto; padding-bottom: 5rem; }
.skip-link { position: absolute; left: 1rem; top: -5rem; background: var(--background); padding: .75rem; z-index: 1; }
.skip-link:focus { top: 1rem; }
h1, h2, h3, h4, h5, h6 { color: var(--ink); font-family: var(--mono); }
h1 { margin: 0; font-size: clamp(2rem, 5vw, 3rem); line-height: 1.25; font-weight: 400; text-wrap: balance; }
.home-header { padding-top: clamp(4rem, 10vw, 8rem); }
.essay-pathway { padding-top: 4rem; }
.essay-list {
  --node-size: 3rem;
  --branch-indent: 4rem;
  --node-gap: 2.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
  font-family: var(--mono);
  font-size: 1rem;
}
.essay-list > li { position: relative; padding-bottom: var(--node-gap); }
.essay-list > li:last-child { padding-bottom: 0; }
.essay-list > li:not(:last-child)::after {
  content: "";
  position: absolute;
  left: calc(var(--node-size) / 2 - .5px);
  top: var(--node-size);
  bottom: 0;
  border-left: 1px solid var(--ink);
  pointer-events: none;
}
.essay-list a { position: relative; display: grid; grid-template-columns: var(--node-size) minmax(0, 1fr); gap: 1.5rem; align-items: start; text-decoration: none; }
.essay-list a:hover h2 { text-decoration: underline; text-underline-offset: .2em; }
.essay-number {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--node-size);
  height: var(--node-size);
  border: 1px solid var(--ink);
  border-radius: 50%;
  background: var(--background);
  color: var(--ink);
  font-family: var(--mono);
  font-size: .875rem;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.essay-list a:hover .essay-number, .essay-list a:focus-visible .essay-number { background: var(--ink); color: var(--background); }
.essay-list h2 { margin: 0; padding-block: .375rem; font-size: clamp(1rem, 3vw, 1.5rem); font-weight: 400; line-height: 2.25rem; overflow-wrap: anywhere; }
.essay-list .essay-list { position: relative; margin-left: var(--branch-indent); padding-top: var(--node-gap); }
/* One continuous stroke avoids seams between separately rounded borders. */
.branch-connector {
  position: absolute;
  left: calc(var(--node-size) / 2 - var(--branch-indent));
  top: calc(-1 * var(--node-gap));
  width: var(--branch-indent);
  height: var(--node-gap);
  overflow: visible;
  fill: none;
  stroke: var(--ink);
  stroke-width: 1px;
  pointer-events: none;
}
/* Keep the connection intact if a parent title wraps below its circle. */
.essay-list > li:has(> .essay-list) > a::after {
  content: "";
  position: absolute;
  left: calc(var(--node-size) / 2 - .5px);
  top: var(--node-size);
  bottom: 0;
  border-left: 1px solid var(--ink);
  pointer-events: none;
}
.article { max-width: 700px; margin-inline: auto; }
.article-header { padding-top: 2.5rem; margin-bottom: 2.5rem; }
.back-link { display: inline-block; margin-bottom: 3rem; font-size: .85rem; text-decoration: none; }
.eyebrow { margin: 0 0 1rem; font-size: .75rem; font-weight: 500; text-transform: uppercase; letter-spacing: .13em; }
.eyebrow span { margin-inline: .6rem; }
.prose { font-family: var(--sans); font-size: 1.2rem; line-height: 1.85; overflow-wrap: break-word; }
.prose p { margin: 0 0 1.4em; }
.prose h2, .prose h3 { line-height: 1.3; margin-top: 2em; }
.prose a { text-decoration: underline; }
.prose blockquote, .clanker-rules, clanker-output { border-left: 3px solid var(--ink); margin: 1.5em 0; padding: 1rem 1.5rem; }
clanker-output {
  --invader-width: 9rem;
  --invader-pixel: calc(var(--invader-width) / 11);
  display: block;
  font-family: var(--serif);
  color: var(--body);
  background-color: #ced6d6;
  background-image: url("./space-invader.svg");
  background-repeat: no-repeat;
  /* Center in short blocks; cap the top inset at two of the sprite's pixels. */
  background-position: .5rem min(calc(2 * var(--invader-pixel)), 50%);
  background-size: var(--invader-width) auto;
}
.prose blockquote > :last-child, .clanker-rules > :last-child, clanker-output > :last-child { margin-bottom: 0; }
.prose code { font-family: var(--mono); padding: .1em .25em; font-size: .85em; }
.prose pre { overflow-x: auto; padding: 1rem; border: 1px solid var(--rule); line-height: 1.5; }
.prose pre code { padding: 0; }
.prose img { max-width: 100%; height: auto; }
.prose hr { border: 0; border-top: 1px solid var(--rule); margin-block: 2.5rem; }
.graphviz-diagram { margin-block: 2rem; overflow-x: auto; text-align: center; }
.graphviz-diagram svg { display: block; max-width: 100%; height: auto; margin-inline: auto; }
.graphviz-diagram text { font-family: var(--sans); }
.prose dt { font-weight: 600; margin-top: 1.25em; }
.prose dd { margin: .5em 0 1.25em 1.5rem; }
.footnotes { font-size: .875em; }
.footnotes-list { padding-left: 1.5rem; }
.footnote-item { scroll-margin-top: 2rem; }
.footnote-item p { margin-bottom: .75em; }
.footnote-ref { font-size: .75em; line-height: 0; }
.footnote-ref a, .footnote-backref { text-decoration: none; }
.essay-navigation { border-top: 1px solid var(--rule); margin-top: 3rem; padding-top: 1.5rem; display: flex; justify-content: space-between; gap: 2rem; }
.essay-navigation a { max-width: 48%; text-decoration: none; font-family: var(--mono); font-size: 1rem; line-height: 1.5; }
.essay-navigation a:hover { text-decoration: underline; }
.essay-navigation span { display: block; margin-bottom: .5rem; font-family: var(--sans); font-size: .75rem; }
.next-essay { margin-left: auto; text-align: right; }
@media (max-width: 540px) {
  .shell { width: calc(100% - 2.5rem); }
  .essay-pathway { padding-top: 3rem; }
  .essay-list a { gap: .75rem; }
  .essay-list { --branch-indent: 2.5rem; --node-gap: 2rem; }
  .prose { font-size: 1.125rem; line-height: 1.8; }
}
@media print {
  .back-link, .essay-navigation, .skip-link { display: none; }
  .shell, .article { width: 100%; max-width: none; }
  .article-header { padding-top: 0; }
  .prose { font-size: 11pt; }
  h1, h2, h3 { break-after: avoid; }
}
