:root {
  color-scheme: light;
  --paper: #fcf8ef;
  --ink: #27221d;
  --muted: #695b4c;
  --rule: #ded1bd;
  --accent: #8a3825;
  --serif: "Charter", "Bitstream Charter", "Palatino Linotype", Georgia, serif;
  --labels: "Lucida Sans", "Trebuchet MS", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 1.125rem/1.65 var(--serif);
}

.site {
  width: min(100% - 3rem, 47rem);
  margin: 0 auto;
  padding: clamp(2rem, 7vw, 5.5rem) 0 4rem;
}

.masthead { border-top: .25rem solid var(--accent); }
.masthead h1 {
  margin: .48em 0 .58em;
  font-size: clamp(2.65rem, 8.5vw, 5rem);
  font-weight: 500;
  letter-spacing: -.06em;
  line-height: 1;
}

.masthead > a {
  display: inline-block;
  margin: .65rem 0 0;
  color: var(--ink);
  font-size: 1.22rem;
  font-weight: 700;
  text-decoration: none;
}

a { color: var(--accent); text-underline-offset: .17em; }
a:hover { text-decoration-thickness: .11em; }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }

.post-list, .simulations ul { margin: 0; padding: 0; list-style: none; }
.post-list { border-bottom: 1px solid var(--rule); }
.post-list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 0 1.4rem;
  border-top: 1px solid var(--rule);
  padding: .74rem 0;
  scroll-margin-top: 1rem;
}

.post-list li:target { background: #f4e8d6; }
.post-list a { color: var(--ink); font-size: clamp(1.1rem, 2.8vw, 1.29rem); line-height: 1.35; text-decoration: none; }
.post-list a:hover, .masthead > a:hover { color: var(--accent); text-decoration: underline; }
.post-list time, .byline {
  color: var(--muted);
  font: .79rem/1.4 var(--labels);
  font-variant-numeric: tabular-nums;
}

.simulations { margin-top: 2rem; }
.simulations h2 { margin: 0 0 .45rem; font-size: 1.25rem; }
.simulations ul { display: flex; flex-wrap: wrap; gap: .35rem 1.25rem; font-size: 1rem; }
.post-heading { margin: clamp(2rem, 6vw, 4rem) 0 2.1rem; }
.post-heading h1, .section-heading {
  margin: 0 0 .7rem;
  font-size: clamp(2rem, 5.5vw, 3.55rem);
  font-weight: 500;
  letter-spacing: -.045em;
  line-height: 1.06;
  overflow-wrap: anywhere;
}
.section-heading { margin: 2rem 0 1rem; text-transform: capitalize; }
.byline { margin: 0; }
.byline span { margin: 0 .35rem; }

.prose { max-width: 65ch; overflow-wrap: anywhere; }
.prose h2, .prose h3, .prose h4 { line-height: 1.25; margin: 1.4em 0 .45em; }
.prose h2 { font-size: 1.58em; }
.prose h3 { font-size: 1.2em; }
.prose p, .prose ul, .prose ol, .prose figure { margin: 0 0 .95em; }
.prose li + li { margin-top: .25em; }
.prose img { display: block; max-width: 100%; height: auto; }
.prose blockquote { border-left: 2px solid var(--rule); padding-left: 1rem; margin: 1.25rem 0; color: var(--muted); }
.prose pre, .prose table { display: block; max-width: 100%; overflow-x: auto; }
.prose table { border-collapse: collapse; margin: 1.25rem 0; }
.prose th, .prose td { border: 1px solid var(--rule); padding: .36em .55em; text-align: left; }
.prose pre { padding: .7rem; background: #f4e8d6; }
.prose hr { border: 0; border-top: 1px solid var(--rule); margin: 1.6rem 0; }
.prose .key-point, .prose .quote-box { margin: 1.1rem 0; padding: .8rem 1rem; border-left: 2px solid var(--accent); background: #f4e8d6; }
.prose .source-credit { margin-top: 1.5rem; color: var(--muted); font-style: italic; }

@media (max-width: 36rem) {
  .site { width: calc(100% - 2rem); }
  .post-list li { grid-template-columns: 1fr; gap: .3rem; }
}
