/* Countervail Research — one hand-written stylesheet, no framework.
   Body: Iowan Old Style serif. Headers: self-hosted Geo (OFL) sans. */
:root {
  --text: #111;
  --bg: #fdfdfd;
  --muted: #555;
  --link: #0645ad;
  --rule: #ddd;
}

@media (prefers-color-scheme: dark) {
  :root {
    --text: #e8e8e8;
    --bg: #111;
    --muted: #9a9a9a;
    --link: #9db9ff;
    --rule: #333;
  }
}

/* Header typeface, self-hosted from our own domain (never the Google CDN). */
@font-face {
  font-family: "Geo";
  src: url(/fonts/geo-regular.woff2) format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

html {
  /* Iowan Old Style is Apple-only; kinship-ordered serif fallbacks follow. */
  font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia,
    "Times New Roman", serif;
  font-size: 18px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
}

body {
  max-width: 38em;
  margin: 0 auto;
  padding: clamp(48px, 15vh, 140px) 1.1rem 4rem; /* generous fixed top anchor */
}

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

/* Muted secondary text, used in several places. */
header nav,
.post-meta,
.post-date,
.meta,
footer {
  color: var(--muted);
}

header nav { margin-bottom: 44px; }

/* Headers use Geo (sans) to contrast the serif body; roomy top margins bind a
   heading to the section below it, which is what makes the page breathe. */
.wordmark, h1, h2 {
  font-family: "Geo", system-ui, -apple-system, "Segoe UI", "Helvetica Neue",
    Arial, sans-serif;
  font-weight: 400;
  line-height: 1.2;
}
.wordmark { font-size: 2.25rem; letter-spacing: -0.02em; margin: 0 0 22px; }
h1 { font-size: 1.75rem; letter-spacing: -0.015em; margin: 0 0 22px; }
h2 { font-size: 1.15rem; letter-spacing: -0.01em; margin: 58px 0 22px; }

p, ul { margin: 0 0 29px; }
.post-meta { margin-top: -0.2rem; }
img { max-width: 100%; height: auto; }

/* Writing index: short date on the left, headline link on the right. */
.post-list { list-style: none; padding: 0; }
.post-list li {
  display: grid;
  grid-template-columns: 3.2em 1fr;
  gap: 0.6em;
  margin-bottom: 0.4rem;
}
.post-date { font-variant-numeric: tabular-nums; }
/* Publications / Code: a plain single-column list of outbound links. */
.link-list { list-style: none; padding: 0; }
.link-list li { margin-bottom: 0.6rem; }
footer {
  margin-top: 4rem;
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
  font-size: 0.9rem;
}
