:root {
  --bg: #fbfaf7;
  --surface: #ffffff;
  --text: #1c1b19;
  --muted: #6e6a63;
  --rule: #e6e2da;
  --link: #2451a6;
  --code-bg: #f2efe8;
  --sans: "Inter", system-ui, -apple-system, sans-serif;
  --serif: "Source Serif 4", Georgia, serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141413;
    --surface: #1c1c1a;
    --text: #e9e6df;
    --muted: #9b968c;
    --rule: #2e2d2a;
    --link: #8fb4f5;
    --code-bg: #22211f;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 18px/1.7 var(--serif);
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
}
main, .site-header, .site-footer {
  max-width: 680px;
  width: calc(100% - 40px);
  padding-left: 0;
  padding-right: 0;
  max-width: 720px;
  margin: 0 auto;
  padding: 0 20px;
}
a { color: var(--link); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
img { max-width: 100%; height: auto; display: block; }

/* Header and footer */
.site-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-top: 28px;
  padding-bottom: 28px;
  font-family: var(--sans);
  font-size: 15px;
}
.site-name { font-weight: 600; color: var(--text); text-decoration: none; letter-spacing: -0.01em; }
.site-header nav a { color: var(--muted); text-decoration: none; }
.site-header nav a:hover { color: var(--text); }
.site-footer {
  max-width: 680px;
  width: calc(100% - 40px);
  padding-left: 0;
  padding-right: 0;
  margin-top: 96px;
  padding-top: 24px;
  padding-bottom: 48px;
  border-top: 1px solid var(--rule);
  font: 14px var(--sans);
  color: var(--muted);
}

/* Headings */
h1, h2, h3 {
  font-family: var(--sans);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  text-wrap: balance;
}
time {
  display: block;
  font: 500 13px var(--sans);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Home */
.intro { padding: 40px 0 24px; }
.intro h1 { font-size: clamp(2.2rem, 6vw, 3.2rem); margin: 0 0 16px; }
.intro p { font-size: 1.15rem; color: var(--muted); margin: 0; max-width: 34em; }

.post-list { list-style: none; padding: 0; margin: 32px 0 0; border-top: 1px solid var(--rule); }
.post-list li { border-bottom: 1px solid var(--rule); }
.post-card {
  display: flex;
  gap: 24px;
  align-items: center;
  padding: 28px 0;
  color: inherit;
  text-decoration: none;
}
.post-card-text { flex: 1; min-width: 0; }
.post-card h2 { font-size: 1.35rem; margin: 6px 0 6px; }
.post-card p { margin: 0; color: var(--muted); font-size: 1rem; line-height: 1.55; }
.post-card:hover h2 { color: var(--link); }
.thumb {
  width: 132px;
  height: 92px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--rule);
  background: #fff;
  flex-shrink: 0;
}
@media (max-width: 560px) {
  .thumb { display: none; }
}

/* Post */
.post-header { padding: 32px 0 8px; }
.post-header h1 { font-size: clamp(2rem, 5vw, 2.6rem); margin: 10px 0 14px; }
.lede { font-size: 1.2rem; color: var(--muted); margin: 0 0 20px; line-height: 1.5; }
.links { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.links a {
  display: inline-block;
  padding: 6px 14px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  font: 500 14px var(--sans);
  text-decoration: none;
  background: var(--surface);
}
.links a:hover { border-color: var(--link); }
.links li:first-child a { background: var(--text); color: var(--bg); border-color: var(--text); }

figure { margin: 32px 0; }
.cover img, .prose img { border-radius: 6px; border: 1px solid var(--rule); background: #fff; }
figcaption { font: 14px/1.5 var(--sans); color: var(--muted); margin-top: 10px; }

.prose h2 { font-size: 1.45rem; margin: 2.2em 0 0.6em; }
.prose h3 { font-size: 1.15rem; margin: 1.8em 0 0.5em; }
.prose p, .prose ul, .prose ol { margin: 0 0 1.2em; }
.prose li { margin-bottom: 0.4em; }
.prose strong { font-weight: 600; }
.prose img { margin: 28px 0; }
.panels { display: flex; gap: 12px; justify-content: center; margin: 28px 0; flex-wrap: wrap; }
.panels img { height: 300px; width: auto; margin: 0; border-radius: 4px; }

code { font-family: var(--mono); font-size: 0.82em; background: var(--code-bg); padding: 0.15em 0.35em; border-radius: 4px; }
pre { background: var(--code-bg); padding: 16px 18px; overflow-x: auto; border-radius: 6px; line-height: 1.55; margin: 0 0 1.4em; }
pre code { background: none; padding: 0; font-size: 0.8em; }

.back { margin-top: 56px; font: 500 15px var(--sans); }
