:root {
  color-scheme: light dark;
  --bg: #f7f5ef;
  --surface: #fffdf8;
  --text: #25231f;
  --muted: #706c63;
  --line: #ded9ce;
  --accent: #176b5b;
  --measure: 720px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #171917;
    --surface: #1e211f;
    --text: #e9e7df;
    --muted: #aaa69d;
    --line: #393d39;
    --accent: #72cdb5;
  }
}

* { box-sizing: border-box; }

html { font-size: 18px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: ui-serif, Georgia, Cambria, "Times New Roman", serif;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
}

a { color: var(--accent); text-underline-offset: 0.15em; }
a:hover { text-decoration-thickness: 2px; }

.site-header,
main,
.site-footer {
  width: min(calc(100% - 2rem), var(--measure));
  margin-inline: auto;
}

.site-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 2rem 1.25rem;
  border-bottom: 1px solid var(--line);
}

.site-title {
  color: var(--text);
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 1.05rem;
  font-weight: 750;
  letter-spacing: -0.02em;
  text-decoration: none;
}

nav { display: flex; gap: 1rem; font-family: ui-sans-serif, system-ui, sans-serif; font-size: 0.85rem; }

main { min-height: calc(100vh - 12rem); padding-block: 3.5rem; }

h1, h2, h3 {
  font-family: ui-sans-serif, system-ui, sans-serif;
  line-height: 1.15;
  letter-spacing: -0.035em;
}

h1 { margin: 0 0 1rem; font-size: clamp(2rem, 8vw, 3.4rem); }
h2 { margin-top: 2.75rem; font-size: 1.45rem; }

.intro { max-width: 36rem; color: var(--muted); font-size: 1.15rem; }
.section-title { margin-top: 4rem; padding-bottom: 0.6rem; border-bottom: 1px solid var(--line); }

.post-list { list-style: none; margin: 0; padding: 0; }
.post-list li { padding-block: 1.25rem; border-bottom: 1px solid var(--line); }
.post-list a { color: var(--text); font-family: ui-sans-serif, system-ui, sans-serif; font-size: 1.15rem; font-weight: 700; }
.post-list time, .post-meta { display: block; margin-top: 0.25rem; color: var(--muted); font-family: ui-sans-serif, system-ui, sans-serif; font-size: 0.8rem; }

article img { display: block; max-width: 100%; height: auto; margin: 2rem auto; border-radius: 0.25rem; }
article figure { margin: 2rem 0; }
article figure img { margin-bottom: 0.5rem; }
figcaption { color: var(--muted); font-size: 0.85rem; text-align: center; }
blockquote { margin: 2rem 0; padding-left: 1.25rem; border-left: 3px solid var(--accent); color: var(--muted); }
code { font-size: 0.85em; }
pre {
  max-width: 100%;
  overflow-x: auto;
  margin: 1.75rem 0;
  padding: 1rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: 0.35rem;
  background: var(--surface);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 0.78rem;
  line-height: 1.55;
}
.note { margin: 2rem 0; padding: 1rem 1.2rem; border-left: 3px solid var(--accent); background: var(--surface); }
.note p { margin: 0; }
.article-lede { color: var(--muted); font-size: 1.15rem; }

.site-footer { padding-block: 1.5rem 2.5rem; border-top: 1px solid var(--line); color: var(--muted); font-family: ui-sans-serif, system-ui, sans-serif; font-size: 0.78rem; }

@media (max-width: 520px) {
  html { font-size: 17px; }
  .site-header { align-items: flex-start; flex-direction: column; padding-top: 1.25rem; }
  main { padding-block: 2.5rem; }
}

article .table-scroll { max-width: 100%; overflow-x: auto; margin: 1.75rem 0; }
article table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
article caption { margin-bottom: 0.75rem; text-align: left; color: var(--muted); }
article th, article td { padding: 0.65rem 0.75rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
article th { font-family: ui-sans-serif, system-ui, sans-serif; font-weight: 650; }
