:root {
  color-scheme: dark;
  --ground: #0c1a16;
  --raised: #12241f;
  --paper: #ebe6d8;
  --muted: #93a69d;
  --line: #24403a;
  --engrave: #c9ad72;
  --display: "Newsreader", Georgia, serif;
  --text: "Hanken Grotesk", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

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

body {
  background: var(--ground);
  color: var(--paper);
  font: 400 1.125rem/1.7 var(--text);
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: 42rem;
  margin: 0 auto;
  padding: clamp(24px, 6vw, 72px) 20px 96px;
}

a { color: inherit; }

a:focus-visible {
  outline: 2px solid var(--engrave);
  outline-offset: 4px;
  border-radius: 2px;
}

/* Site header: name links home, Blog links to the index */
.site {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: clamp(3rem, 8vw, 5rem);
}
.site a { text-decoration: none; }
.site .home {
  font-family: var(--display);
  font-size: 1.375rem;
  line-height: 1;
}
.site nav { display: flex; gap: 1.5rem; font-size: 0.9375rem; color: var(--muted); }
.site nav a:hover,
.site nav a[aria-current="page"] { color: var(--paper); }

h1, h2, h3 {
  font-family: var(--display);
  font-optical-sizing: auto;
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.01em;
}

/* Index */
.index h1 { font-size: clamp(2.75rem, 7vw, 4.5rem); }
.index .lede { margin-top: 1rem; color: var(--muted); max-width: 34ch; }

.posts { list-style: none; padding: 0; margin-top: 3.5rem; }
.posts li { border-top: 1px solid var(--line); }
.posts li:last-child { border-bottom: 1px solid var(--line); }
.posts a {
  display: block;
  padding: 1.25rem 0;
  text-decoration: none;
}
.posts .title { font-family: var(--display); font-size: 1.5rem; line-height: 1.25; }
.posts a:hover .title { color: var(--engrave); }
.empty { margin-top: 3.5rem; color: var(--muted); }

/* Post */
.post header { margin-bottom: 3rem; }
.post h1 { font-size: clamp(2.25rem, 6vw, 3.75rem); }

.prose > * + * { margin-top: 1.25em; }
.prose h2 { font-size: 1.875rem; margin-top: 2.25em; }
.prose h3 { font-size: 1.375rem; margin-top: 2em; }
.prose a { text-decoration-color: var(--engrave); text-underline-offset: 3px; }
.prose a:hover { color: var(--engrave); }
.prose ul, .prose ol { padding-left: 1.25em; }
.prose li + li { margin-top: 0.4em; }
.prose blockquote {
  border-left: 2px solid var(--engrave);
  padding-left: 1.25rem;
  color: var(--muted);
  font-family: var(--display);
  font-size: 1.3rem;
  line-height: 1.5;
}
.prose code {
  font-family: var(--mono);
  font-size: 0.875em;
  background: var(--raised);
  padding: 0.1em 0.35em;
  border-radius: 4px;
}
.prose pre {
  background: var(--raised);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1rem 1.25rem;
  overflow-x: auto;
  font-size: 0.9375rem;
  line-height: 1.55;
}
.prose pre code { background: none; padding: 0; font-size: inherit; }
.prose img { max-width: 100%; height: auto; border-radius: 4px; }
.prose figure { margin-left: 0; margin-right: 0; }
.prose figure img { display: block; border: 1px solid var(--line); }
.prose figcaption { margin-top: 0.6rem; color: var(--muted); font-size: 0.875rem; line-height: 1.5; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 3rem 0; }
.prose table { width: 100%; border-collapse: collapse; font-size: 0.9375rem; }
.prose th, .prose td { text-align: left; padding: 0.5rem 0.75rem 0.5rem 0; border-bottom: 1px solid var(--line); }
.prose th { color: var(--muted); font-weight: 500; }
.prose td.num, .prose th.num { text-align: right; font-variant-numeric: tabular-nums; }

.post footer {
  margin-top: 4.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
  font-size: 0.9375rem;
  color: var(--muted);
}
.post footer a { text-decoration-color: var(--engrave); text-underline-offset: 3px; }
