:root {
  --paper: #fafafa;
  --ink: #0a0a0a;
  --muted: #6b7280;
  --rule: #e5e5e5;
  --ok: #16a34a;
  --warn: #d97706;
  --hot: #dc2626;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.6;
}
main { max-width: 760px; margin: 0 auto; padding: 4rem 1.5rem 6rem; }
h1 {
  font-family: "Instrument Serif", Georgia, serif;
  font-size: clamp(2rem, 5vw, 3rem);
  margin: 0 0 1rem 0;
  letter-spacing: -0.02em;
}
h2 {
  font-family: "Instrument Serif", Georgia, serif;
  font-size: 1.4rem;
  margin: 2.5rem 0 0.75rem 0;
}
p { color: #4b5563; margin: 0 0 1rem 0; }
a { color: var(--ink); }
code, pre {
  font-family: "JetBrains Mono", Menlo, monospace;
  background: #f3f4f6;
  font-size: 0.9em;
}
code { padding: 0.1rem 0.3rem; }
pre { padding: 1rem; overflow-x: auto; border: 1px solid var(--rule); }
ul { color: #4b5563; padding-left: 1.25rem; }
li { margin-bottom: 0.4rem; }
table { width: 100%; border-collapse: collapse; margin: 1rem 0; }
th, td { padding: 0.5rem; border-bottom: 1px solid var(--rule); text-align: left; font-size: 0.95rem; color: #4b5563; }
th { font-weight: 600; color: var(--ink); }
.nav { margin-bottom: 2rem; font-size: 0.95rem; }
.nav a { margin-right: 1rem; color: var(--muted); text-decoration: none; }
.nav a:hover { color: var(--ink); }

/* Unified site header: logo left, links right. Present on every
   page so navigation feels continuous instead of context-switching
   each time the user follows a link. Positioned above <main>;
   border-bottom separates it from page content. */
.site-nav {
  max-width: 900px;
  margin: 0 auto;
  padding: 1.5rem 1.5rem 1rem;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--rule);
}
.site-logo {
  font-family: "Instrument Serif", Georgia, serif;
  font-size: 1.6rem;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration: none;
  line-height: 1;
}
.site-logo:hover { color: var(--ink); }
.site-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.1rem;
  font-size: 0.9rem;
}
.site-links a {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s ease;
}
.site-links a:hover { color: var(--ink); }
.site-links a.reference { color: var(--muted); }
/* Main pages anchor below the nav rather than 4rem of empty space. */
body > main { padding-top: 2.5rem; }
@media (max-width: 560px) {
  .site-nav { padding: 1rem 1.25rem 0.75rem; }
  .site-links { gap: 0.8rem; font-size: 0.85rem; }
}
footer { max-width: 760px; margin: 0 auto; padding: 2rem 1.5rem 4rem; border-top: 1px solid var(--rule); color: var(--muted); font-size: 0.85rem; }
footer a { color: var(--muted); margin-right: 1rem; text-decoration: none; }
footer a:hover { color: var(--ink); }
