:root {
  --text: #1a1a1a;
  --muted: #5a5a5a;
  --link: #1f4ed8;
  --bg: #fafafa;
  --rule: #e3e3e3;
  --max: 720px;
}

* { box-sizing: border-box; }

html { font-size: 17px; }

body {
  margin: 0;
  font-family: ui-serif, Georgia, "Iowan Old Style", "Times New Roman", serif;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
}

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

main {
  max-width: var(--max);
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
}

.site-header {
  max-width: var(--max);
  margin: 0 auto;
  padding: 1.25rem 1.25rem 0;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 1rem;
}

.site-header .brand {
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
  text-decoration: none;
  color: var(--text);
}

.site-header nav {
  display: flex;
  gap: 1rem;
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 0.95rem;
}

.site-header nav a { color: var(--muted); text-decoration: none; }
.site-header nav a:hover { color: var(--text); }

.site-footer {
  max-width: var(--max);
  margin: 2rem auto 1.5rem;
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--rule);
  font-size: 0.85rem;
  color: var(--muted);
}

h1, h2, h3 {
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

h1 { font-size: 2rem; margin: 1.5rem 0 0.75rem; }
h2 { font-size: 1.35rem; margin: 2rem 0 0.5rem; }
h3 { font-size: 1.1rem; margin: 1.5rem 0 0.5rem; }

p, ul, ol { margin: 0.75rem 0; }

ul, ol { padding-left: 1.25rem; }

.lede {
  font-size: 1.1rem;
  color: var(--muted);
}

.hero {
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 1.5rem;
}

.letter-card {
  border: 1px solid var(--rule);
  padding: 1rem 1.25rem;
  border-radius: 4px;
  background: #fff;
}

.letter-card h3 { margin-top: 0; }

.archive-list { list-style: none; padding: 0; }

.archive-list li {
  border-bottom: 1px solid var(--rule);
  padding: 1rem 0;
}

.archive-list li time {
  display: block;
  color: var(--muted);
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 0.85rem;
  margin-bottom: 0.25rem;
}

.archive-list li a {
  font-weight: 600;
  font-size: 1.05rem;
}

.meta {
  color: var(--muted);
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
}

.letter-header { margin-bottom: 1.5rem; }

.letter-body p { margin: 0.9rem 0; }

.letter-body table {
  border-collapse: collapse;
  width: 100%;
  margin: 1rem 0;
  font-size: 0.95rem;
}

.letter-body th, .letter-body td {
  border: 1px solid var(--rule);
  padding: 0.5rem 0.75rem;
  text-align: left;
}

.letter-body code, .page-body code {
  background: #f0f0f0;
  padding: 0.1rem 0.3rem;
  border-radius: 3px;
  font-size: 0.9em;
}

.letter-footer {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
  font-size: 0.9rem;
}

@media (max-width: 540px) {
  html { font-size: 16px; }
  h1 { font-size: 1.6rem; }
  .site-header { flex-direction: column; align-items: flex-start; }
}
