:root {
  --ink: #1a1a1a;
  --muted: #666;
  --rule: #d8d3c8;
  --bg: #f7f3ea;
  --chip-bg: #ece6d6;
  --chip-ink: #3a3833;
  --accent: #1f4e8a;
  --link: #1d3557;
  --max: 720px;
}

[data-theme="dark"] {
  --ink: #e8e6e0;
  --muted: #9a968b;
  --rule: #3a3833;
  --bg: #15171a;
  --chip-bg: #25282d;
  --chip-ink: #cfcdc7;
  --accent: #8fb6e0;
  --link: #8fb6e0;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 18px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
}

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

main, .site-header, .site-footer { max-width: var(--max); margin: 0 auto; padding: 0 20px; }

.site-header {
  padding-top: 32px;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--ink);
  margin-bottom: 32px;
}
.site-header-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}
.site-title {
  font-family: 'Helvetica Neue', Arial, sans-serif;
  font-weight: 900;
  font-size: 26px;
  text-decoration: none;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.theme-toggle {
  font-family: 'Helvetica Neue', Arial, sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--rule);
  border-radius: 2px;
  padding: 4px 10px;
  cursor: pointer;
}
.theme-toggle:hover { color: var(--ink); border-color: var(--ink); }
.tagline {
  font-size: 14px;
  color: var(--muted);
  margin-top: 4px;
  font-style: italic;
}

.page-title {
  font-size: 22px;
  font-weight: 700;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 8px;
  margin-bottom: 16px;
  font-family: 'Helvetica Neue', Arial, sans-serif;
}

.tag-subhead { margin: -8px 0 20px 0; font-size: 13px; }

.tag-nav {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 24px 0;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--rule);
}
.tag-nav-label {
  font-family: 'Helvetica Neue', Arial, sans-serif;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.tag-chips {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.tag-chips.inline { display: inline-flex; vertical-align: middle; margin-left: 8px; }
.tag-chip {
  display: inline-block;
  font-family: 'Helvetica Neue', Arial, sans-serif;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.02em;
  background: var(--chip-bg);
  color: var(--chip-ink);
  border: 1px solid var(--rule);
  border-radius: 12px;
  padding: 2px 10px;
  text-decoration: none;
  line-height: 1.5;
}
.tag-chip:hover { color: var(--ink); border-color: var(--ink); }
.tag-count {
  color: var(--muted);
  font-weight: 400;
  margin-left: 4px;
}

.post-list { list-style: none; padding: 0; margin: 0; }
.post-list-item {
  padding: 16px 0;
  border-bottom: 1px solid var(--rule);
}
.post-list-item:last-child { border-bottom: none; }
.post-list-headline {
  font-size: 20px;
  font-weight: 700;
  text-decoration: none;
  color: var(--ink);
  display: block;
  margin-bottom: 6px;
  line-height: 1.3;
}
.post-list-headline:hover { color: var(--accent); }
.post-list-meta { font-size: 13px; color: var(--muted); }

.post h1 {
  font-size: 30px;
  line-height: 1.2;
  margin: 0 0 8px 0;
  font-weight: 700;
}
.post .byline {
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 12px 0;
}
.post .tag-chips { margin: 0 0 20px 0; padding-bottom: 16px; border-bottom: 1px solid var(--rule); }
.post-body p { margin: 0 0 16px 0; }
.post-body hr {
  border: none;
  border-top: 1px solid var(--rule);
  margin: 24px 0;
}
.post-body ul { padding-left: 20px; list-style: disc; }
.post-body li { margin-bottom: 4px; }
.post-body strong { font-weight: 700; }
.post-body em { font-style: italic; }

.post-source {
  margin-top: 32px;
  padding-top: 12px;
  border-top: 1px solid var(--rule);
  font-size: 14px;
}

.back { margin-top: 40px; font-size: 14px; }

.site-footer {
  margin-top: 60px;
  padding-top: 20px;
  padding-bottom: 32px;
  border-top: 1px solid var(--rule);
  font-size: 13px;
  color: var(--muted);
}
.site-footer p { margin: 0 0 8px 0; }
.muted { color: var(--muted); }
