* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: #333;
  background: #fff;
}

a {
  color: #1a0dab;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

h1, h2, h3 {
  color: #111;
  font-weight: 600;
}

nav {
  margin-bottom: 48px;
  padding-bottom: 16px;
  border-bottom: 1px solid #e0e0e0;
  display: flex;
  justify-content: flex-start;
  align-items: baseline;
  gap: 28px;
}

nav a {
  color: #555;
  font-size: 21px;
}

nav a:hover {
  color: #111;
  text-decoration: none;
}

nav a.active {
  color: #111;
}

#holder {
  margin-top: 25px;
  margin-bottom: 25px;
  display: flex;
}

#left {
  flex-grow: 100;
  min-width: 1em;
  max-width: 4em;
}

#middle {
  flex: 0 1 34em;
  max-width: 34em;
  padding: 0 1em;
}

#right {
  min-width: 1em;
  flex-grow: 100;
}

#middle nav {
  margin-top: 8px;
  margin-bottom: 32px;
}

#middle h1 {
  font-size: 2em;
  margin-bottom: 0.5em;
}

#middle p {
  margin-bottom: 1em;
}

#middle.wide {
  flex-basis: 72em;
  max-width: 72em;
}

body.post .post-header,
body.post .post-body {
  margin-left: 7em;
}

.section-title {
  font-size: 20px;
  margin-bottom: 20px;
  padding-bottom: 8px;
  border-bottom: 1px solid #e0e0e0;
}

.page-intro {
  margin-bottom: 24px;
  color: #555;
  font-size: 19px;
}

.post-list {
  list-style: none;
}

.post-list li {
  padding: 8px 0;
  border-bottom: 1px solid #f0f0f0;
  font-size: 19px;
}

.post-list .post-date {
  display: inline-block;
  width: 8em;
}

.post-list .post-link {
  font-size: 19px;
}

.post-list .post-extra {
  font-size: 14px;
  margin-top: 2px;
  margin-left: calc(8em * 19 / 14 + 0.3em);
}

.post-list .post-extra a {
  color: #111;
}

.back-link {
  display: inline-block;
  margin-bottom: 24px;
  font-size: 14px;
  color: #888;
}

.back-link:hover {
  color: #1a0dab;
}

.post-header {
  margin-bottom: 32px;
}

.post-header h1 {
  font-size: 26px;
  line-height: 1.3;
  margin-bottom: 8px;
}

.post-header .post-meta {
  color: #888;
  font-size: 14px;
}

.post-body {
  line-height: 1.75;
}

.post-body .toc {
  margin: 0 0 16px;
  font-size: 16px;
  line-height: 1.75;
}

.post-body .toc ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.post-body .toc ul ul {
  padding-left: 18px;
}

.post-body .toc li {
  margin: 2px 0;
}

.post-body .toc a {
  color: #555;
}

.post-body .toc a:hover {
  color: #1a0dab;
  text-decoration: none;
}

.post-body h2 {
  font-size: 20px;
  margin-top: 32px;
  margin-bottom: 12px;
}

.post-body h3 {
  font-size: 17px;
  color: #222;
  margin-top: 24px;
  margin-bottom: 8px;
}

.post-body p {
  margin-bottom: 16px;
}

.post-body .footnote {
  font-size: 14px;
  color: #666;
}

.post-body code {
  font-family: "SF Mono", "Fira Code", "Fira Mono", Menlo, monospace;
  font-size: 14px;
  background: #f5f5f5;
  padding: 2px 6px;
  border-radius: 3px;
}

.post-body pre {
  background: #f6f8fa;
  padding: 16px;
  border-radius: 6px;
  overflow-x: auto;
  margin-bottom: 16px;
}

.post-body pre code,
.post-body pre code.hljs {
  background: none;
  padding: 0;
  line-height: 1.5;
}

.post-body ul, .post-body ol {
  margin-bottom: 16px;
  padding-left: 24px;
}

.post-body li {
  margin-bottom: 4px;
}

.post-body blockquote {
  border-left: 3px solid #ddd;
  padding-left: 16px;
  color: #555;
  margin-bottom: 16px;
}

.post-body figure {
  margin: 24px 0;
  text-align: center;
}

.post-body figure img {
  max-width: min(100%, 520px);
  height: auto;
}

.post-body figure.side-by-side > div {
  display: flex;
  gap: 16px;
  justify-content: center;
  align-items: center;
  max-width: 820px;
  margin: 0 auto;
}

.post-body figure.side-by-side img {
  flex: 1 1 0;
  min-width: 0;
  max-width: calc(50% - 8px);
}

.post-body figure.grid-2col > div,
.post-body figure.grid-2x2 > div {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  max-width: 100%;
  margin: 0 auto;
}

.post-body figure.grid-2col img,
.post-body figure.grid-2x2 img {
  width: 100%;
  max-width: 100%;
}

.post-body figure.grid-2col > div > img:last-child:nth-child(odd) {
  grid-column: 1 / -1;
  justify-self: center;
  width: calc(50% - 4px);
}

.post-body figcaption {
  font-size: 14px;
  color: #888;
  margin-top: 8px;
}

.post-body sup.fn {
  font-size: 12px;
  line-height: 0;
  vertical-align: super;
}

.post-body sup.fn a {
  color: #1a0dab;
}

.post-body .footnotes {
  margin-top: 40px;
  padding-top: 16px;
  border-top: 1px solid #e0e0e0;
  font-size: 14px;
  color: #555;
}

.post-body .footnotes ol {
  padding-left: 20px;
}

.post-body .footnotes li {
  margin-bottom: 8px;
}

.post-body .footnotes pre {
  margin: 10px 0;
  padding: 16px 28px;
  border-radius: 12px;
}

.post-body .fn-back {
  margin-left: 4px;
  color: #888;
}

.post-body .fn-back:hover {
  color: #1a0dab;
}

.post-body a.cite {
  color: #1a0dab;
}

.post-body .references ol {
  padding-left: 24px;
}

.post-body .references li {
  margin-bottom: 12px;
  font-size: 15px;
}

.post-body .footnotes li:target,
.post-body .references li:target {
  background: #fffbe6;
}

.post-body table {
  border-collapse: collapse;
  margin-bottom: 16px;
  font-size: 15px;
}

.post-body th, .post-body td {
  border: 1px solid #e0e0e0;
  padding: 6px 12px;
  text-align: left;
}

.post-body th {
  background: #f5f5f5;
}

.post-body mjx-container[display="true"] {
  overflow-x: auto;
  overflow-y: hidden;
  max-width: 100%;
}

@media (max-width: 600px) {
  nav {
    flex-wrap: wrap;
    gap: 12px 20px;
  }

}

/* ==========================================================================
   Site overrides.

   The blog's typography is left exactly as it is above — same faces, sizes,
   measure and layout. Only the things that tie the page to the rest of this
   site are changed: the paper colour, the link colour, and the About/More
   tabs.
   ========================================================================== */

:root {
  --bg: #f6f5f2;
  --fg: #0a0a0a;
  --muted: #737373;
  --rule: #0a0a0a1a;
  --link: #0b7a3b;
  --link-hover: #085c2c;
}

body {
  background: var(--bg);
  /* the site's face, so the blog and the other pages read as one thing and
     every device renders the same rather than falling back to its own sans */
  font-family: "Instrument Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}

a {
  color: var(--link);
}

a:hover {
  color: var(--link-hover);
}

/* ---------- About / More tabs, matching the other pages ---------- */

nav {
  margin-bottom: 40px;
  padding-bottom: 0;
  border-bottom: 0;
  gap: 1.5rem;
}

nav a {
  font-family: "Instrument Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 17px;
  color: var(--muted);
}

nav a:hover,
nav a.active {
  color: var(--fg);
}

/* ---------- surfaces that were tuned for a white page ---------- */

.post-body code {
  background: #0a0a0a0d;
}

.post-body pre {
  background: #fbfaf8;
  border: 1px solid var(--rule);
}

.post-body pre code,
.post-body pre code.hljs {
  background: none;
}

.section-title,
.post-body .footnotes,
.post-list li {
  border-color: var(--rule);
}

.post-body .footnotes li:target,
.post-body .references li:target {
  background: #efe9cf;
}

/* citations, footnote markers and back-links carried the old blue */
.post-body a.cite,
.post-body sup.fn a {
  color: var(--link);
}

.back-link:hover,
.post-body .fn-back:hover {
  color: var(--link);
}

/* the post title uses the site's display face, as on the About page */
.post-header h1 {
  font-family: "Newsreader", Georgia, "Times New Roman", serif;
  font-size: 32px;
  font-weight: 500;
  letter-spacing: -0.01em;
}

/* his table of contents links are a bare grey; keep them muted but on-palette */
.post-body .toc a {
  color: var(--muted);
}

.post-body .toc a:hover {
  color: var(--link);
}
