:root {
  --bg: #fbfaf7;
  --surface: #ffffff;
  --text: #1c1b19;
  --muted: #6b6760;
  --line: #e7e3da;
  --accent: #2f5bea;
  --accent-soft: #e8edfd;
  --radius: 14px;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-head: "Iowan Old Style", "Palatino Linotype", Georgia, serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #131312;
    --surface: #1b1b19;
    --text: #efede8;
    --muted: #a09b92;
    --line: #2d2c29;
    --accent: #7c9cff;
    --accent-soft: #212843;
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.65;
  font-size: 17px;
}

.wrap { max-width: 720px; margin: 0 auto; padding: 0 20px; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.muted { color: var(--muted); }

/* Header */
.site-header { border-bottom: 1px solid var(--line); background: var(--bg); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 16px; padding-bottom: 16px; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; }
.brand:hover { text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: var(--accent); color: #fff; font-size: 14px; letter-spacing: .02em; }
.nav { display: flex; gap: 18px; font-size: 15px; }
.nav a { color: var(--muted); }
.nav a[aria-current="page"], .nav a:hover { color: var(--text); text-decoration: none; }

/* Hero */
.hero { padding: 56px 0 24px; }
.hero h1 { font-family: var(--font-head); font-size: clamp(2rem, 6vw, 3rem); line-height: 1.15; margin: 0 0 12px; letter-spacing: -0.01em; }
.lede { font-size: 1.15rem; color: var(--muted); margin: 0 0 8px; }
.eyebrow { margin: 0 0 8px; font-size: 12.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); display: flex; flex-wrap: wrap; gap: 8px; }
.tag { background: var(--accent-soft); color: var(--accent); padding: 2px 10px; border-radius: 999px; letter-spacing: .04em; }

/* Post list */
.post-list { display: grid; gap: 16px; padding-bottom: 56px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; transition: border-color .15s ease, transform .15s ease; }
.card:hover { border-color: var(--accent); transform: translateY(-1px); }
.card h2 { font-family: var(--font-head); font-size: 1.45rem; line-height: 1.25; margin: 4px 0 8px; }
.card h2 a { color: var(--text); }
.card h2 a:hover { color: var(--accent); text-decoration: none; }
.summary { margin: 0 0 14px; color: var(--muted); }

/* Byline */
.byline { display: flex; align-items: center; gap: 12px; font-size: 15px; line-height: 1.35; }
.byline.small { font-size: 14px; gap: 10px; }
.avatar { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: 13px; flex: none; }
.byline.small .avatar { width: 28px; height: 28px; font-size: 11px; }

/* Post page */
.post { padding: 48px 0 32px; }
.post-header h1 { font-family: var(--font-head); font-size: clamp(2rem, 6vw, 2.8rem); line-height: 1.15; margin: 4px 0 12px; letter-spacing: -0.01em; }
.post-header .byline { margin: 20px 0 8px; }
.prose { margin-top: 28px; }
.prose p, .prose ul, .prose ol, .prose blockquote, .prose pre { margin: 0 0 1.2em; }
.prose h2 { font-family: var(--font-head); font-size: 1.5rem; line-height: 1.25; margin: 1.8em 0 .5em; }
.prose h3 { font-size: 1.15rem; margin: 1.5em 0 .4em; }
.prose img { max-width: 100%; height: auto; border-radius: 10px; }
.prose blockquote { border-left: 3px solid var(--accent); padding: 2px 0 2px 16px; color: var(--muted); }
.prose code { background: var(--accent-soft); padding: 1px 6px; border-radius: 6px; font-size: .92em; }
.prose pre { background: var(--surface); border: 1px solid var(--line); padding: 14px 16px; border-radius: 10px; overflow-x: auto; }
.prose pre code { background: none; padding: 0; }
.back { margin-top: 40px; }

/* Archive */
.archive { list-style: none; padding: 0 0 56px; margin: 0; }
.archive li { padding: 12px 0; border-bottom: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; }
.archive .date { min-width: 96px; font-size: 14px; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); margin-top: 24px; font-size: 14px; }
.footer-inner { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-top: 24px; padding-bottom: 32px; }

@media (max-width: 520px) {
  body { font-size: 16px; }
  .card { padding: 18px; }
}
