/* ---------- Design tokens ---------- */
:root {
  --bg: #faf9f7;
  --text: #1c1b1a;
  --muted: #6f6a63;
  --accent: #b4550a;
  --rule: #e4e0da;
  --max: 40rem;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161513;
    --text: #e8e5e0;
    --muted: #98928a;
    --accent: #e8863c;
    --rule: #2c2a26;
  }
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
html { font-size: 17px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Charter, Georgia, "Times New Roman", serif;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
main {
  max-width: var(--max);
  margin: 0 auto;
  padding: 1.5rem 1.25rem 5rem;
}

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

h1, h2, h3 {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  line-height: 1.25;
  letter-spacing: -0.015em;
}
h1 { font-size: 1.75rem; margin: 0 0 0.5rem; }
h2 { font-size: 1.05rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin: 3rem 0 1rem; }
h3 { font-size: 1.15rem; margin: 2rem 0 0.5rem; }

hr { border: none; border-top: 1px solid var(--rule); margin: 3rem 0; }

blockquote {
  margin: 1.5rem 0;
  padding-left: 1rem;
  border-left: 3px solid var(--rule);
  color: var(--muted);
  font-style: italic;
}

code {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.85em;
  background: var(--rule);
  padding: 0.1em 0.35em;
  border-radius: 4px;
}

img { max-width: 100%; height: auto; border-radius: 6px; }

/* ---------- Nav ---------- */
nav {
  max-width: var(--max);
  margin: 0 auto;
  padding: 1.5rem 1.25rem 0;
  display: flex;
  gap: 1.25rem;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 0.9rem;
}
nav a { color: var(--muted); }
nav a[aria-current="page"] { color: var(--text); font-weight: 600; }

/* ---------- Home ---------- */
.lede { font-size: 1.1rem; color: var(--muted); margin: 0 0 2.5rem; }

.post-list { list-style: none; padding: 0; margin: 0; }
.post-list li {
  display: flex;
  gap: 1rem;
  align-items: baseline;
  padding: 0.45rem 0;
}
.post-list time {
  flex: 0 0 5.5rem;
  color: var(--muted);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
}
.post-list .tag {
  margin-left: auto;
  color: var(--muted);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 0.75rem;
  white-space: nowrap;
}

.highlights { list-style: none; padding: 0; margin: 0; }
.highlights li { padding: 0.35rem 0; }
.highlights .when { color: var(--muted); font-size: 0.9rem; }

/* ---------- Post pages ---------- */
.post-meta {
  color: var(--muted);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 0.85rem;
  margin: 0 0 2.5rem;
}
article p { margin: 1.1rem 0; }
article table { width: 100%; border-collapse: collapse; margin: 1.5rem 0; font-size: 0.92rem; }
article th {
  text-align: left;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  padding: 0 0.75rem 0.4rem 0;
  border-bottom: 1px solid var(--rule);
}
article td {
  padding: 0.55rem 0.75rem 0.55rem 0;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
  line-height: 1.5;
}
article td:first-child { white-space: nowrap; font-weight: 600; }

/* ---------- Footer ---------- */
footer {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 1.25rem 3rem;
  color: var(--muted);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 0.85rem;
  display: flex;
  gap: 1.25rem;
}

/* ---------- Logo lists ---------- */
.logos li { display: flex; align-items: center; gap: 0.6rem; }
.logos .when { margin-left: auto; }
.logo {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  border-radius: 3px;
}

/* ---------- Lived map ---------- */
.map { width: 100%; height: auto; margin: 0.25rem 0 0; }
.map-caption {
  color: var(--muted);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 0.8rem;
  margin: 0.25rem 0 0;
}

.h2-note {
  text-transform: none;
  letter-spacing: normal;
  font-weight: normal;
  font-size: 0.8rem;
  color: var(--muted);
  opacity: 0.8;
}
