@font-face {
  font-family: "Newsreader";
  src: url("/fonts/newsreader-latin-standard-normal.woff2") format("woff2");
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
}

@font-face {
  font-family: "Newsreader";
  src: url("/fonts/newsreader-latin-standard-italic.woff2") format("woff2");
  font-style: italic;
  font-weight: 200 800;
  font-display: swap;
}

:root {
  --bg: #13110f;
  --surface: #1c1916;
  --line: #2f2a24;
  --text: #e9e2d7;
  --muted: #a09585;
  --accent: #e8a33d;
  --heat: #7cb56b;
  --serif: "Newsreader", Georgia, "Noto Serif", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", "DejaVu Sans Mono", Menlo, Consolas, monospace;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0 auto;
  max-width: 50rem;
  padding: 1.5rem 1.25rem 4rem;
  background: var(--bg);
  color: var(--text);
  font: 1.0625rem/1.6 var(--sans);
}

a { color: var(--accent); text-underline-offset: 0.15em; }
a:hover { color: var(--text); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

h1, h2, h3, h4 { font-family: var(--serif); font-weight: 600; line-height: 1.2; }

/* Site frame */

.site-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.25rem 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 0.8125rem;
}

.brand {
  color: var(--text);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-decoration: none;
}

.site-head nav { display: flex; flex-wrap: wrap; gap: 0.25rem 1.1rem; }
/* Pages share the name's line; the post categories always get their own. */
.site-sections { flex-basis: 100%; }
.site-head nav a { color: var(--muted); text-decoration: none; }
.site-head nav a:hover { color: var(--accent); }
/* Pages are a different kind of link from the categories: boxed, in the accent colour. */
.site-head .site-pages { gap: 0.25rem 0.5rem; }
.site-head .site-pages a {
  padding: 0.05rem 0.5rem;
  border: 1px solid color-mix(in oklab, var(--accent) 45%, transparent);
  border-radius: 3px;
  color: var(--accent);
}
.site-head .site-pages a:hover { background: var(--accent); color: var(--bg); }

.site-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.1rem;
  margin-top: 3rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 0.8125rem;
}
.site-foot a { color: var(--muted); }

/* Homepage */

.intro { margin-top: 2rem; font-size: 1.125rem; }
.intro p:last-child { margin-bottom: 0; }

.heatmap { margin: 1.75rem 0 2.25rem; }
.heatmap svg { display: block; width: 100%; height: auto; overflow: visible; }

.hm-month { fill: var(--muted); font: 10px var(--mono); }

.hm-0 { fill: var(--surface); background: var(--surface); }
.hm-1 { fill: color-mix(in oklab, var(--heat) 30%, var(--surface)); background: color-mix(in oklab, var(--heat) 30%, var(--surface)); }
.hm-2 { fill: color-mix(in oklab, var(--heat) 52%, var(--surface)); background: color-mix(in oklab, var(--heat) 52%, var(--surface)); }
.hm-3 { fill: color-mix(in oklab, var(--heat) 76%, var(--surface)); background: color-mix(in oklab, var(--heat) 76%, var(--surface)); }
.hm-4 { fill: var(--heat); background: var(--heat); }

.hm-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.25rem 1rem;
  margin-top: 0.6rem;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.75rem;
}
.hm-date { white-space: nowrap; }
.hm-scale { display: inline-flex; align-items: center; gap: 3px; }
.hm-scale i { display: block; width: 10px; height: 10px; border-radius: 2px; }
.hm-scale i:first-of-type { margin-left: 3px; }
.hm-scale i:last-of-type { margin-right: 3px; }

/* What the activity goes into: a page's sections, listed under the heatmap. */
.home-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem 1.1rem;
  margin: 0 0 2.25rem;
  font-family: var(--mono);
  font-size: 0.8rem;
}
.heatmap + .home-strip { margin-top: -1.25rem; }
.home-strip + .home-strip { margin-top: -1.5rem; }
.home-strip a { color: var(--text); text-decoration: none; }
.home-strip a:hover { color: var(--accent); }
.home-strip .home-strip-label {
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.7rem;
}

/* Feed */

.post {
  scroll-margin-top: 1rem;
  display: grid;
  grid-template-columns: 6.25rem minmax(0, 1fr);
  gap: 0 1.25rem;
  padding: 1.35rem 0;
  border-top: 1px solid var(--line);
}

.post-meta {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding-top: 0.2rem;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.75rem;
}
.post-date { color: var(--muted); text-decoration: none; }
.post-date:hover { color: var(--text); }
.post-category { color: var(--accent); text-decoration: none; }

.post-title { margin: 0 0 0.6rem; font-size: 1.625rem; }
.post-title a { color: var(--text); text-decoration: none; }
.post-title a:hover { color: var(--accent); }

.post-cover img {
  display: block;
  width: 100%;
  max-height: 22rem;
  object-fit: cover;
  margin-bottom: 0.85rem;
  border-radius: 4px;
}

.read-on { margin: 0.4rem 0 0; font-family: var(--mono); font-size: 0.8125rem; }

.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem 0.75rem;
  margin: 0.5rem 0 0;
  padding: 0;
  list-style: none;
  font-family: var(--mono);
  font-size: 0.75rem;
}
.post-tags a { color: var(--muted); text-decoration: none; }
.post-tags a::before { content: "#"; opacity: 0.6; }
.post-tags a:hover { color: var(--accent); }

.more-updates {
  margin: 0;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 0.875rem;
}

.list-head { margin: 2rem 0 1.5rem; }
.list-head h1 { margin: 0; font-size: 2rem; }
.list-head p { margin: 0.35rem 0 0; color: var(--muted); }
.empty { color: var(--muted); }

.pager {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.875rem;
}

/* A single post or page */

.article { margin-top: 2rem; }
.back { margin: 1.25rem 0 1rem; font-family: var(--mono); font-size: 0.8125rem; }
.back a { color: var(--muted); text-decoration: none; }
.back a:hover { color: var(--accent); }
main > .back + .post, main > .back + .article { margin-top: 0; }

.article-head { margin-bottom: 1.25rem; }
.article-head .post-meta { flex-direction: row; gap: 1rem; padding: 0; }
.article-head h1 { margin: 0.5rem 0 0; font-size: 2.25rem; }
.article-long .prose { font-size: 1.125rem; }
.article + .pager, .post + .pager { margin-top: 2.5rem; }

/* Written content */

.prose > :first-child { margin-top: 0; }
.prose > :last-child { margin-bottom: 0; }
.prose p { margin: 0 0 0.9em; }
.prose h2 { margin: 1.6em 0 0.5em; font-size: 1.5rem; }
.prose h3 { margin: 1.4em 0 0.4em; font-size: 1.25rem; }
.prose h4 { margin: 1.2em 0 0.3em; font-size: 1.0625rem; }

/* Standalone pages are read in sections, not top to bottom like a post,
   so each ## group starts under a rule and the headings take colour. */
.article-page .prose h2 {
  margin: 2.5em 0 0.6em;
  padding-top: 0.75em;
  border-top: 1px solid var(--line);
  font-size: 1.75rem;
  color: var(--accent);
}
.article-page .prose > h2:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.article-page .prose h3 { margin-top: 1.8em; color: var(--heat); }
@media (max-width: 40rem) {
  .article-page .prose h2 { font-size: 1.5rem; }
}
.prose ul, .prose ol { margin: 0 0 0.9em; padding-left: 1.5em; }
.prose li + li { margin-top: 0.2em; }
.prose hr { margin: 2em 0; border: 0; border-top: 1px solid var(--line); }

.prose img, .prose video {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0.9rem 0;
  border-radius: 4px;
}
.prose audio { display: block; width: 100%; margin: 0.9rem 0; }

.prose blockquote {
  margin: 0 0 0.9em;
  padding-left: 1em;
  border-left: 3px solid var(--line);
  color: var(--muted);
}

.prose mark { padding: 0 0.15em; border-radius: 2px; background: color-mix(in oklab, var(--accent) 30%, transparent); color: inherit; }
.prose .tag { text-decoration: none; }
.prose .tag:hover { text-decoration: underline; }

.prose code { padding: 0.1em 0.3em; border-radius: 3px; background: var(--surface); font: 0.875em var(--mono); }
.prose pre {
  margin: 0 0 0.9em;
  padding: 0.85em 1em;
  overflow-x: auto;
  border-radius: 4px;
  background: var(--surface);
  line-height: 1.45;
}
.prose pre code { padding: 0; background: none; }

.prose table { display: block; overflow-x: auto; margin: 0 0 0.9em; border-collapse: collapse; }
.prose th, .prose td { padding: 0.35em 0.7em; border: 1px solid var(--line); text-align: left; }
.prose th { background: var(--surface); }

.callout {
  margin: 0 0 0.9em;
  padding: 0.65em 0.95em;
  border-left: 3px solid var(--accent);
  border-radius: 0 4px 4px 0;
  background: var(--surface);
}
.callout-title { font-weight: 600; }
summary.callout-title { cursor: pointer; }
.callout-body > :first-child { margin-top: 0.25em; }
.callout-body > :last-child { margin-bottom: 0; }

@media (max-width: 40rem) {
  body { padding: 1rem 1rem 3rem; font-size: 1rem; }
  .post { display: block; padding: 1.1rem 0; }
  .post-meta { flex-direction: row; gap: 0.9rem; padding: 0 0 0.3rem; }
  .post-title { font-size: 1.375rem; }
  .article-head h1 { font-size: 1.75rem; }
  /* The SVG shrinks to fit a phone, so its label has to be drawn larger. */
  .hm-month { font-size: 20px; }
  .hm-month:nth-of-type(even) { display: none; }
}

@media print {
  .site-head nav, .site-foot, .pager { display: none; }
}
