:root {
  --bg: #fcfaf6;
  --paper: #ffffff;
  --fg: #1f1d1a;
  --muted: #6f6a63;
  --faint: #aaa49a;
  --accent: #8a4d2b;
  --accent-soft: #f1e6dd;
  --rule: #e9e3d8;
  --code-bg: #f4efe6;
  --max: 660px;
  --radius: 4px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  font-size: 18px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid var(--accent-soft);
  transition: border-color 0.15s, color 0.15s;
}
a:hover { border-bottom-color: var(--accent); }

main, .masthead, .footer {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 24px;
}

/* Masthead --------------------------------------------------------- */

.masthead {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-top: 36px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 36px;
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.masthead .brand {
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--fg);
  border: none;
}
.masthead .brand .dot { color: var(--accent); }

.masthead nav a {
  margin-left: 18px;
  color: var(--muted);
  font-size: 0.92rem;
  border: none;
}
.masthead nav a:hover { color: var(--accent); }

/* Headings --------------------------------------------------------- */

h1, h2, h3 {
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.25;
  color: var(--fg);
}
h1 { font-size: 1.95rem; margin: 0.4em 0 0.2em; }
h2 { font-size: 1.4rem; margin: 1.6em 0 0.4em; }
h3 { font-size: 1.1rem; margin: 1.4em 0 0.4em; }

.kicker {
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--faint);
  margin: 0 0 8px;
}

/* Index page ------------------------------------------------------- */

.intro {
  margin-bottom: 56px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--rule);
}
.intro p { color: var(--muted); margin: 0; }

.post-list { list-style: none; padding: 0; margin: 0; }
.post-list li {
  padding: 28px 0;
  border-bottom: 1px solid var(--rule);
}
.post-list li:last-child { border-bottom: none; }
.post-list h2 {
  margin: 0 0 6px;
  font-size: 1.3rem;
}
.post-list h2 a {
  color: var(--fg);
  border: none;
}
.post-list h2 a:hover { color: var(--accent); }
.post-list .meta {
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 0.82rem;
  color: var(--faint);
  margin: 0 0 10px;
  letter-spacing: 0.02em;
}
.post-list .excerpt {
  color: var(--muted);
  margin: 0;
}

/* Article ---------------------------------------------------------- */

article header { margin-bottom: 32px; padding-bottom: 24px; border-bottom: 1px solid var(--rule); }
article header h1 { margin: 0 0 8px; }
article header .meta {
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 0.85rem;
  color: var(--muted);
  letter-spacing: 0.02em;
}

article p { margin: 1em 0; }
article ul, article ol { padding-left: 1.4em; }
article li { margin: 0.3em 0; }
article blockquote {
  margin: 1.4em 0;
  padding: 0.4em 1em;
  border-left: 3px solid var(--accent-soft);
  color: var(--muted);
  font-style: italic;
}

article pre, article code {
  font-family: "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  font-size: 0.92rem;
}
article code {
  background: var(--code-bg);
  padding: 2px 6px;
  border-radius: 4px;
}
article pre {
  background: var(--code-bg);
  padding: 14px 18px;
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--rule);
  margin: 1.4em 0;
  line-height: 1.5;
}
article pre code { background: none; padding: 0; }

article hr {
  border: none;
  border-top: 1px solid var(--rule);
  margin: 2.4em 0;
}

.byline {
  margin-top: 56px;
  padding-top: 24px;
  border-top: 1px solid var(--rule);
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 0.9rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 14px;
}
.byline .avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--accent-soft);
  display: inline-grid;
  place-items: center;
  color: var(--accent);
  font-weight: 600;
  letter-spacing: 0.03em;
}
.byline strong { color: var(--fg); font-weight: 600; }

/* About page ------------------------------------------------------- */

.bio { display: flex; gap: 24px; align-items: flex-start; margin-bottom: 28px; }
.bio .portrait {
  width: 96px; height: 96px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-soft), #d8c0ad);
  flex-shrink: 0;
  display: grid;
  place-items: center;
  color: var(--accent);
  font-weight: 600;
  font-size: 2rem;
  letter-spacing: 0.04em;
}
.bio h1 { margin-top: 0; }
.bio .tagline { color: var(--muted); margin: 0; font-style: italic; }

.facts { padding: 0; list-style: none; margin: 36px 0; }
.facts li {
  padding: 10px 0;
  display: flex;
  gap: 16px;
  border-bottom: 1px solid var(--rule);
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 0.95rem;
}
.facts li b {
  width: 130px;
  color: var(--muted);
  font-weight: 500;
  flex-shrink: 0;
}

/* Footer ----------------------------------------------------------- */

.footer {
  margin-top: 64px;
  padding: 24px 0 36px;
  border-top: 1px solid var(--rule);
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 0.82rem;
  color: var(--faint);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}
.footer a { color: var(--muted); border-bottom-color: transparent; }
.footer a:hover { color: var(--accent); border-bottom-color: var(--accent-soft); }
.footer code {
  background: var(--code-bg);
  padding: 1px 5px;
  border-radius: 3px;
  font-family: "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.85em;
}

@media (max-width: 600px) {
  body { font-size: 17px; }
  h1 { font-size: 1.7rem; }
  .masthead { flex-direction: column; align-items: flex-start; gap: 6px; }
  .masthead nav a { margin-left: 0; margin-right: 14px; }
  .bio { flex-direction: column; }
  .footer { flex-direction: column; align-items: flex-start; }
}
