:root {
  color-scheme: light dark;
  --background: #faf9f6;
  --text: #252521;
  --muted: #6c6b64;
  --rule: #d8d6ce;
  --link: #174f87;
  --code: #efede7;
  --width: 44rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --background: #191918;
    --text: #e6e3dc;
    --muted: #aaa79f;
    --rule: #3b3a36;
    --link: #8fbee8;
    --code: #282826;
  }
}

* { box-sizing: border-box; }

html { font-size: 17px; }

body {
  max-width: var(--width);
  margin: 0 auto;
  padding: 2.75rem 1.25rem 2rem;
  background: var(--background);
  color: var(--text);
  font-family: Charter, "Bitstream Charter", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--link);
  text-decoration-thickness: .06em;
  text-underline-offset: .13em;
}

a:hover { text-decoration-thickness: .12em; }

.site-header,
.site-footer,
.section-heading,
.post-list li {
  display: flex;
  align-items: baseline;
}

.site-header {
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 4.5rem;
}

.site-name {
  color: var(--text);
  font-weight: 700;
  text-decoration: none;
}

nav { display: flex; gap: 1rem; }
nav a { color: var(--muted); }

main { min-height: 55vh; }

h1, h2, h3 {
  line-height: 1.2;
  letter-spacing: -.018em;
}

h1 { font-size: clamp(2rem, 6vw, 2.8rem); margin: 0 0 1.25rem; }
h2 { font-size: 1.35rem; margin: 2.5rem 0 1rem; }
h3 { font-size: 1.08rem; margin: 2rem 0 .5rem; }

.intro { margin-bottom: 4rem; }
.intro h1 { margin-bottom: 1rem; }
.intro p { max-width: 37rem; font-size: 1.15rem; }

.section-heading {
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid var(--rule);
}

.section-heading h2 { margin: 0 0 .45rem; }
.section-heading a { font-size: .9rem; }

.page-header,
.article-header { margin-bottom: 2.5rem; }

.lede { color: var(--muted); font-size: 1.08rem; }
.lede p { margin: 0; }
.article-header time { color: var(--muted); font-size: .9rem; }

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

.post-list li {
  gap: 1.25rem;
  padding: 1.15rem 0;
  border-bottom: 1px solid var(--rule);
}

.post-list time {
  flex: 0 0 2.75rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.post-list a { font-size: 1.05rem; font-weight: 600; }
.post-list p { margin: .15rem 0 0; color: var(--muted); font-size: .92rem; line-height: 1.45; }

.prose p,
.prose ul,
.prose ol { margin: 1rem 0; }

.prose img { display: block; max-width: 100%; height: auto; margin: 2rem auto; }
.prose hr { border: 0; border-top: 1px solid var(--rule); margin: 2.5rem 0; }
.prose blockquote { margin-left: 0; padding-left: 1rem; border-left: 2px solid var(--rule); color: var(--muted); }
.prose table { width: 100%; border: 1px solid var(--rule); border-collapse: collapse; text-align: left; }
.prose th,
.prose td { padding: .6rem .7rem; border: 1px solid var(--rule); vertical-align: top; }
.prose th { font-weight: 700; }

code, pre { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .86em; }
code { padding: .1rem .25rem; background: var(--code); }
pre { overflow-x: auto; padding: 1rem; background: var(--code); }
pre code { padding: 0; }

.katex-display {
  overflow-x: auto;
  overflow-y: hidden;
  padding: .25rem 0;
}

.site-footer {
  flex-wrap: wrap;
  gap: .35rem .75rem;
  margin-top: 5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: .85rem;
}

.not-found { padding: 3rem 0; }

@media (max-width: 34rem) {
  body { padding-top: 1.5rem; }
  .site-header { align-items: flex-start; flex-direction: column; margin-bottom: 3.5rem; }
  .post-list li { align-items: flex-start; flex-direction: column; gap: .15rem; }
}
