:root {
  color-scheme: light dark;
  --bg: #f7f5ef;
  --text: #1b1b18;
  --muted: #6b6a61;
  --line: #d9d5ca;
  --soft: #eeebe2;
  --accent: #174f9c;
  --measure: 42rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121210;
    --text: #eeece5;
    --muted: #aaa79d;
    --line: #37352f;
    --soft: #1d1c19;
    --accent: #91bbf4;
  }
}

* { box-sizing: border-box; }

html {
  background: var(--bg);
  color: var(--text);
  font-family: Charter, "Bitstream Charter", Georgia, Cambria, "Times New Roman", serif;
  font-size: 18px;
  line-height: 1.72;
  text-rendering: optimizeLegibility;
  -webkit-text-size-adjust: 100%;
}

body {
  width: min(var(--measure), calc(100% - 2.5rem));
  margin: 0 auto;
  padding: 2.2rem 0 4rem;
}

.skip-link {
  position: absolute;
  left: -9999px;
}

.skip-link:focus {
  left: 1rem;
  top: 1rem;
  z-index: 10;
  padding: .45rem .65rem;
  background: var(--text);
  color: var(--bg);
}

.site-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1.2rem;
  margin-bottom: 4.4rem;
}

.site-name {
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: .92rem;
  font-weight: 720;
  letter-spacing: -.025em;
  text-decoration: none;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: .25rem .9rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: .74rem;
}

.site-nav a,
.meta,
time,
.eyebrow,
.post-navigation span,
.footer-note {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

main { min-height: 55vh; }

h1, h2, h3 {
  line-height: 1.15;
  letter-spacing: -.038em;
  text-wrap: balance;
}

h1 {
  max-width: 18ch;
  margin: 0 0 1.1rem;
  font-size: clamp(2.15rem, 8vw, 3.7rem);
  font-weight: 600;
}

h2 {
  margin: 3rem 0 .85rem;
  font-size: 1.42rem;
  font-weight: 650;
}

h3 {
  margin: 2.25rem 0 .7rem;
  font-size: 1.08rem;
}

p { margin: 1.15rem 0; }

.lede {
  max-width: 37rem;
  margin: 0 0 3.8rem;
  color: var(--muted);
  font-size: 1.22rem;
  line-height: 1.58;
}

.eyebrow {
  margin: 0 0 .65rem;
  color: var(--muted);
  font-size: .72rem;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.now-line {
  margin: 0 0 3.6rem;
  padding-left: 1rem;
  border-left: 2px solid var(--line);
}

.now-line p { margin: .25rem 0; }

.now-line .updated {
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: .72rem;
}

a {
  color: var(--accent);
  text-decoration-thickness: .075em;
  text-underline-offset: .18em;
}

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

a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.posts {
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
}

.posts li {
  display: grid;
  grid-template-columns: 6.7rem minmax(0, 1fr);
  gap: 1rem;
  padding: .82rem 0;
  border-bottom: 1px solid var(--line);
}

.posts li:first-child { border-top: 1px solid var(--line); }

.posts time {
  color: var(--muted);
  font-size: .72rem;
  font-variant-numeric: tabular-nums;
}

.posts a {
  color: var(--text);
  font-weight: 600;
  text-decoration-color: var(--line);
}

.more-link {
  display: inline-block;
  margin-top: 1.3rem;
  font-size: .95rem;
}

.archive-year {
  display: grid;
  grid-template-columns: 5rem 1fr;
  gap: 1.25rem;
  margin: 2.2rem 0 3rem;
}

.archive-year h2 {
  margin: .15rem 0;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: .84rem;
  letter-spacing: 0;
}

.archive-year .posts { margin: 0; }

.archive-year .posts li {
  grid-template-columns: 3.7rem 1fr;
  padding: .58rem 0;
}

.article-header { margin-bottom: 3.2rem; }

.article-header h1 { max-width: 20ch; }

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem .7rem;
  color: var(--muted);
  font-size: .72rem;
}

.meta > * + *::before {
  content: "·";
  margin-right: .7rem;
}

article { overflow-wrap: anywhere; }

article > p,
article > ul,
article > ol,
article > blockquote,
article > pre,
article > figure,
article > table {
  margin-top: 1.35rem;
  margin-bottom: 1.35rem;
}

article ul,
article ol { padding-left: 1.4rem; }
article li + li { margin-top: .35rem; }

article h2,
article h3 { scroll-margin-top: 1rem; }

.heading-link {
  color: inherit;
  text-decoration: none;
}

.heading-link::after {
  content: " #";
  color: transparent;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: .72em;
}

.heading-link:hover::after,
.heading-link:focus-visible::after { color: var(--muted); }

blockquote {
  margin-left: 0;
  padding: .1rem 0 .1rem 1.1rem;
  border-left: 2px solid var(--line);
  color: var(--muted);
  font-style: italic;
}

blockquote p { margin: .5rem 0; }

code,
kbd,
pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

code {
  padding: .1em .28em;
  border-radius: .25rem;
  background: var(--soft);
  font-size: .86em;
}

pre {
  overflow-x: auto;
  padding: 1rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: .35rem;
  background: var(--soft);
  font-size: .82rem;
  line-height: 1.55;
}

pre code { padding: 0; background: none; font-size: inherit; }

hr {
  margin: 3rem 0;
  border: 0;
  border-top: 1px solid var(--line);
}

img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: .2rem;
}

figure { margin-left: 0; margin-right: 0; }
figcaption { margin-top: .5rem; color: var(--muted); font-size: .82rem; }

table {
  display: block;
  width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
  font-size: .9rem;
}

th,
td {
  padding: .5rem .7rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.post-navigation {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.2rem;
  margin-top: 4rem;
  padding-top: 1.3rem;
  border-top: 1px solid var(--line);
}

.post-navigation a { text-decoration-color: var(--line); }
.post-navigation .newer { text-align: right; }

.post-navigation span {
  display: block;
  margin-bottom: .25rem;
  color: var(--muted);
  font-size: .68rem;
  text-transform: uppercase;
}

.site-footer {
  margin-top: 5rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .82rem;
}

.site-footer p { margin: .35rem 0; }
.footer-note { font-size: .68rem; }

.not-found {
  display: grid;
  min-height: 50vh;
  align-content: center;
}

::selection { background: #f0cd5b; color: #171713; }

@media (max-width: 600px) {
  html { font-size: 17px; }
  body { width: min(var(--measure), calc(100% - 2rem)); padding-top: 1.4rem; }
  .site-header { display: block; margin-bottom: 3.4rem; }
  .site-nav { justify-content: flex-start; margin-top: .55rem; }
  .posts li { display: block; }
  .posts time { display: block; margin-bottom: .12rem; }
  .archive-year { display: block; }
  .archive-year h2 { margin-bottom: .6rem; }
  .archive-year .posts li { display: grid; }
  .post-navigation { grid-template-columns: 1fr; }
  .post-navigation .newer { text-align: left; }
}

@media print {
  :root { --bg: #fff; --text: #000; --muted: #444; --line: #ccc; }
  body { width: 100%; padding: 0; }
  .site-header, .site-footer, .post-navigation, .skip-link { display: none; }
  a { color: inherit; text-decoration: none; }
  article { max-width: none; }
}
