/* === Reset & base === */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  padding: 0;
  font-family: 'EB Garamond', 'Iowan Old Style', Georgia, serif;
  font-size: 19px;
  line-height: 1.55;
  color: #1a1a1a;
  background: #ffffff;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* === Colors === */
:root {
  --accent: #e15554;
  --ink: #1a1a1a;
  --muted: rgba(26,26,26,0.55);
  --rule: rgba(26,26,26,0.10);
  --paper: #ffffff;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* === Layout === */
.container {
  max-width: 680px;
  margin: 0 auto;
  padding: 48px 28px 64px;
}

@media (min-width: 720px) {
  .container { padding: 64px 32px 96px; }
}

/* === Top nav === */
.topNav {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 56px;
  font-size: 17px;
  flex-wrap: wrap;
  gap: 16px;
}
.topNav .brand {
  font-weight: 500;
  text-decoration: none;
  color: var(--ink);
}
.topNav .brand:hover { color: var(--accent); }
.topNav .links { display: flex; gap: 22px; }
.topNav .links a {
  color: var(--ink);
  text-decoration: none;
  transition: color .2s ease;
}
.topNav .links a:hover { color: var(--accent); }
.topNav .links a.active {
  color: var(--accent);
}

/* === Headings === */
h1, h2, h3, h4 {
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.2;
  margin: 0;
}
h1 { font-size: 42px; margin-bottom: 12px; }
h2 { font-size: 28px; margin: 48px 0 16px; }
h3 { font-size: 22px; margin: 36px 0 12px; }
h4 { font-size: 19px; margin: 24px 0 8px; }

/* === Body text === */
p {
  margin: 0 0 24px;
}
p:last-child { margin-bottom: 0; }

a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: opacity .15s ease;
}
a:hover { opacity: 0.7; }
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

strong { font-weight: 600; }
em { font-style: italic; }

/* === Quotes === */
blockquote {
  border-left: 3px solid var(--accent);
  padding-left: 20px;
  margin: 28px 0;
  font-style: italic;
  color: var(--ink);
}
blockquote p:last-child { margin-bottom: 0; }

/* === Code === */
code {
  font-family: 'JetBrains Mono', SFMono-Regular, Menlo, monospace;
  font-size: 0.88em;
  background: rgba(26,26,26,0.06);
  padding: 2px 6px;
  border-radius: 3px;
}
pre {
  background: #f7f5f0;
  padding: 18px;
  border-radius: 4px;
  overflow-x: auto;
  font-size: 14px;
  line-height: 1.5;
}
pre code {
  background: transparent;
  padding: 0;
}

/* === Lists === */
ul, ol { padding-left: 24px; margin: 0 0 24px; }
li { margin-bottom: 8px; }

/* === Images === */
img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
  margin: 28px 0;
  display: block;
}

/* === Horizontal rule === */
hr {
  border: none;
  border-top: 1px solid var(--rule);
  margin: 56px 0;
}

/* === Hero (homepage) === */
.hero .heroPhoto {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  margin: 0 0 28px;
  object-fit: cover;
  display: block;
}
.hero h1 {
  font-size: 48px;
  margin-bottom: 8px;
}
.hero .tagline {
  font-style: italic;
  font-size: 21px;
  color: var(--muted);
  margin: 0 0 40px;
}
.hero .intro {
  font-size: 20px;
  line-height: 1.55;
  margin-bottom: 48px;
}
.hero .intro p { margin-bottom: 20px; }

/* === Section headings === */
.sectionHeading {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 56px 0 16px;
}

/* === Post list === */
.postList {
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
}
.postList li {
  padding: 14px 0;
  border-bottom: 1px solid var(--rule);
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: baseline;
  margin: 0;
}
.postList li:last-child { border-bottom: none; }
.postList .postTitle {
  font-size: 20px;
  text-decoration: none;
  color: var(--ink);
  flex: 1;
  line-height: 1.3;
}
.postList .postTitle:hover {
  color: var(--accent);
  opacity: 1;
}
.postList .postDate {
  font-family: var(--sans);
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
}
.moreLink {
  margin: 16px 0 0;
  font-family: var(--sans);
  font-size: 14px;
}

/* === Elsewhere block === */
.elsewhereLinks {
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
  font-size: 17px;
}

/* === Post page === */
.post .postHeader { margin-bottom: 36px; }
.post h1 { font-size: 38px; }
.post .postMeta {
  font-family: var(--sans);
  font-size: 13px;
  color: var(--muted);
  margin: 12px 0 0;
}
.post .postMeta a {
  color: var(--muted);
  text-decoration: underline;
  text-decoration-thickness: 1px;
}
.post .postMeta a:hover { color: var(--accent); }
.post .postBody {
  font-size: 19px;
  line-height: 1.65;
}
.post .postBody h2,
.post .postBody h3 {
  margin-top: 48px;
}
.post .postFooter {
  margin-top: 64px;
  padding-top: 24px;
  border-top: 1px solid var(--rule);
  font-family: var(--sans);
  font-size: 14px;
  color: var(--muted);
}

/* === List page (writing index) === */
.listSection .listHeader { margin-bottom: 36px; }
.listSection h1 { font-size: 36px; margin-bottom: 12px; }
.listSection .listIntro {
  font-size: 18px;
  color: var(--muted);
  margin-bottom: 24px;
}
.listSection .listIntro p { margin-bottom: 12px; }

/* === Page (About, Now, Elsewhere) === */
.page .pageHeader { margin-bottom: 32px; }
.page h1 { font-size: 36px; margin-bottom: 8px; }
.page .pageBody {
  font-size: 19px;
  line-height: 1.65;
}
.page .pageBody h2 { margin-top: 48px; }
.page .pageBody h3 { margin-top: 32px; }

/* === Site footer === */
.siteFooter {
  margin-top: 96px;
  padding-top: 24px;
  border-top: 1px solid var(--rule);
  font-family: var(--sans);
  font-size: 13px;
  color: var(--muted);
}
.siteFooter p { margin: 0; }
.siteFooter a {
  color: var(--muted);
  text-decoration: underline;
  text-decoration-thickness: 1px;
}
.siteFooter a:hover { color: var(--accent); }

/* === Mobile === */
@media (max-width: 520px) {
  body { font-size: 17px; }
  .hero h1 { font-size: 36px; }
  .hero .tagline { font-size: 18px; }
  .hero .intro { font-size: 18px; }
  .topNav { font-size: 15px; margin-bottom: 40px; }
  .topNav .links { gap: 16px; }
  .post h1 { font-size: 30px; }
  .post .postBody { font-size: 17px; }
  .listSection h1, .page h1 { font-size: 28px; }
  .postList .postTitle { font-size: 18px; }
}
