/* Deliberately small and hand-rolled rather than a vendored theme: a theme is
   another dependency to track, and customising someone else's Go templates is
   usually more work than 200 lines of CSS. Revisit if the site grows. */

:root {
  --bg: #fbfaf8;
  --fg: #1c1b19;
  --muted: #6b675f;
  --rule: #e2ded6;
  --link: #9a3412;
  --accent: #7c2d12;
  --code-bg: #f2efe9;
  --measure: 34rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #171614;
    --fg: #e8e5df;
    --muted: #9a958c;
    --rule: #302e2a;
    --link: #f0a97a;
    --accent: #f0a97a;
    --code-bg: #221f1c;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 1.0625rem/1.65 ui-serif, Georgia, "Times New Roman", serif;
  -webkit-text-size-adjust: 100%;
}

a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { text-decoration-style: dotted; }

/* ---------- chrome ---------- */

.site-header,
main,
.site-footer {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 1.25rem;
}

.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 1.25rem;
  padding-top: 2.5rem;
  padding-bottom: 1.25rem;
}

.site-title {
  font-weight: 600;
  font-size: 1.0625rem;
  letter-spacing: 0.02em;
  color: var(--fg);
  text-decoration: none;
}

.site-header nav { display: flex; gap: 1rem; margin-left: auto; }
.site-header nav a {
  font: 0.8125rem/1 ui-sans-serif, system-ui, sans-serif;
  text-transform: lowercase;
  letter-spacing: 0.04em;
  text-decoration: none;
  color: var(--muted);
}
.site-header nav a:hover { color: var(--link); }

.site-footer {
  border-top: 1px solid var(--rule);
  margin-top: 4rem;
  padding-top: 1.25rem;
  padding-bottom: 3rem;
}
.site-footer p {
  font: 0.8125rem/1.5 ui-sans-serif, system-ui, sans-serif;
  color: var(--muted);
}

/* ---------- headings & meta ---------- */

h1, h2, h3 { line-height: 1.25; letter-spacing: -0.01em; }
h1 { font-size: 1.75rem; margin: 0 0 0.5rem; }
h2 { font-size: 1.1875rem; margin: 2.25rem 0 0.5rem; }
h3 { font-size: 1rem; margin: 1.75rem 0 0.4rem; }

.section-intro { margin-bottom: 2.5rem; }
.lede { color: var(--muted); font-size: 1rem; }

.meta, .taxo {
  font: 0.75rem/1.5 ui-sans-serif, system-ui, sans-serif;
  color: var(--muted);
  margin: 0.25rem 0;
}
.meta .sep { margin: 0 0.4rem; opacity: 0.5; }
.week { font-variant-numeric: tabular-nums; }

.tag {
  display: inline-block;
  margin: 0.25rem 0.3rem 0 0;
  padding: 0.1rem 0.45rem;
  border: 1px solid var(--rule);
  border-radius: 2px;
  font-size: 0.6875rem;
  letter-spacing: 0.03em;
  text-decoration: none;
  color: var(--muted);
}
.tag-project { border-color: var(--accent); color: var(--accent); }
.tag:hover { background: var(--code-bg); }

/* ---------- lists ---------- */

.post-list { list-style: none; padding: 0; margin: 0; }
.post-list > li {
  padding: 1.5rem 0;
  border-top: 1px solid var(--rule);
}
.post-link {
  font-size: 1.125rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--fg);
}
.post-link:hover { color: var(--link); text-decoration: underline; }
.excerpt { color: var(--muted); font-size: 0.9375rem; margin: 0.5rem 0 0; }

.term-list { list-style: none; padding: 0; }
.term-list > li { padding: 0.4rem 0; border-bottom: 1px solid var(--rule); }
.term-list .count { color: var(--muted); font-size: 0.75rem; margin-left: 0.5rem; }

/* ---------- article body ---------- */

.post-header { margin-bottom: 2rem; }
.prose { max-width: 100%; }
.prose > p:first-child { margin-top: 0; }
.prose p, .prose li { overflow-wrap: break-word; }
.prose ul, .prose ol { padding-left: 1.25rem; }
.prose li { margin: 0.25rem 0; }

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

.prose hr { border: 0; border-top: 1px solid var(--rule); margin: 2.5rem 0; }

.prose code {
  background: var(--code-bg);
  padding: 0.1em 0.35em;
  border-radius: 2px;
  font-size: 0.875em;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.prose pre {
  background: var(--code-bg);
  padding: 0.9rem 1rem;
  border-radius: 3px;
  overflow-x: auto;
  font-size: 0.8125rem;
  line-height: 1.5;
}
.prose pre code { background: none; padding: 0; font-size: inherit; }

/* Wide content must scroll inside its own box, never the page. */
.prose .table-wrap { overflow-x: auto; }
.prose table { border-collapse: collapse; width: 100%; font-size: 0.875rem; }
.prose th, .prose td {
  text-align: left;
  padding: 0.4rem 0.6rem;
  border-bottom: 1px solid var(--rule);
}

.prose img { max-width: 100%; height: auto; display: block; }

figure { margin: 2rem 0; }
figure img { border-radius: 3px; }
figcaption {
  font: 0.75rem/1.5 ui-sans-serif, system-ui, sans-serif;
  color: var(--muted);
  margin-top: 0.5rem;
}
figcaption .credit { display: block; opacity: 0.8; }

.video-embed {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--code-bg);
  border: 1px solid var(--rule);
  border-radius: 3px;
  overflow: hidden;
}
.video-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.notice {
  margin: 1.5rem 0;
  padding: 0.75rem 1rem;
  border-left: 2px solid var(--accent);
  background: var(--code-bg);
  font: 0.875rem/1.5 ui-sans-serif, system-ui, sans-serif;
}

/* The provenance block that closes every logbook entry. */
.provenance {
  margin-top: 3rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
  font: 0.8125rem/1.6 ui-sans-serif, system-ui, sans-serif;
  color: var(--muted);
}
.provenance h2 {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0 0 0.5rem;
}
.provenance ul { padding-left: 1.1rem; margin: 0.5rem 0; }
