/* ============================================================
   style.css — the entire look of the site lives in this file.
   Change a value here and every page updates at once.
   ============================================================ */

:root {
  /* Colours — edit these six lines to re-skin the whole site */
  --bg:        #fcfcfb;
  --ink:       #1b1b1b;
  --muted:     #767570;
  --rule:      #e5e4e0;
  --link:      #1b1b1b;
  --link-hover:#1f4b8f;

  /* Typography */
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua",
           Georgia, "Times New Roman", serif;
  --sans:  -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;

  --measure: 38rem;   /* width of the text column */
}

/* Dark mode, automatic — follows the reader's system setting */
@media (prefers-color-scheme: dark) {
  :root {
    --bg:        #15161a;
    --ink:       #e7e5e0;
    --muted:     #96948d;
    --rule:      #2c2e35;
    --link:      #e7e5e0;
    --link-hover:#8fb6f0;
  }
}

/* ---------- base ---------- */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

.page {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 3.5rem 1.5rem 6rem;
}

/* ---------- links ---------- */

a {
  color: var(--link);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  text-decoration-color: var(--rule);
  transition: color 0.15s ease, text-decoration-color 0.15s ease;
}

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

a:focus-visible {
  outline: 2px solid var(--link-hover);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ---------- masthead (top of every page) ---------- */

.masthead {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 3rem;
}

.masthead h1,
.masthead .name {
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  margin: 0;
}

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

.masthead nav {
  font-family: var(--sans);
  font-size: 0.8125rem;
  color: var(--muted);
}

/* ---------- home page ---------- */

.bio { margin-bottom: 3rem; }
.bio p { margin: 0 0 1rem; }
.bio p:last-child { margin-bottom: 0; }

/* The "… More" fold, using <details> — no JavaScript needed */
details.more > summary {
  display: inline;
  cursor: pointer;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 0.875rem;
  list-style: none;
}
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary:hover { color: var(--link-hover); }
details.more[open] > summary { display: none; }

section.list { margin-bottom: 2.75rem; }

section.list h2 {
  font-family: var(--sans);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 0.9rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--rule);
}

section.list ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

section.list li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1.25rem;
  padding: 0.4rem 0;
}

section.list .date {
  flex: none;
  font-family: var(--sans);
  font-size: 0.8125rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* ---------- essay page ---------- */

article header { margin-bottom: 2.5rem; }

article h1 {
  font-size: 2rem;
  line-height: 1.2;
  font-weight: 600;
  letter-spacing: -0.015em;
  margin: 0 0 0.5rem;
  text-wrap: balance;
}

article .subtitle {
  font-size: 1.1875rem;
  color: var(--muted);
  font-style: italic;
  margin: 0 0 0.9rem;
}

article .date {
  font-family: var(--sans);
  font-size: 0.8125rem;
  color: var(--muted);
  margin: 0;
}

article h2 {
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.005em;
  margin: 2.75rem 0 0.75rem;
}

article h3 {
  font-size: 1.0625rem;
  font-weight: 600;
  margin: 2rem 0 0.5rem;
}

article p { margin: 0 0 1.25rem; }

article ul, article ol { margin: 0 0 1.25rem; padding-left: 1.35rem; }
article li { margin-bottom: 0.5rem; }

article blockquote {
  margin: 1.75rem 0;
  padding-left: 1.25rem;
  border-left: 2px solid var(--rule);
  color: var(--muted);
  font-style: italic;
}

article img,
article figure img {
  max-width: 100%;
  height: auto;
  display: block;
}

article figure { margin: 2rem 0; }

article figcaption {
  font-family: var(--sans);
  font-size: 0.8125rem;
  color: var(--muted);
  margin-top: 0.5rem;
}

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

/* Footnotes */
sup a {
  font-family: var(--sans);
  font-size: 0.7rem;
  text-decoration: none;
  padding: 0 0.1em;
}

.footnotes {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
  font-size: 0.9375rem;
  color: var(--muted);
}

.footnotes h2 {
  font-family: var(--sans);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin: 0 0 0.75rem;
}

.footnotes li { margin-bottom: 0.6rem; }

/* Target highlight when jumping to a footnote */
.footnotes li:target { color: var(--ink); }

/* ---------- footer ---------- */

.site-footer {
  margin-top: 4rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
  font-family: var(--sans);
  font-size: 0.8125rem;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

/* ---------- small screens ---------- */

@media (max-width: 34rem) {
  .page { padding: 2.5rem 1.25rem 4rem; }
  body { font-size: 1.0625rem; }
  article h1 { font-size: 1.625rem; }
  section.list li { flex-direction: column; gap: 0.1rem; }
}

/* ---------- printing ---------- */

@media print {
  :root { --bg: #fff; --ink: #000; --muted: #444; --rule: #ccc; }
  .masthead nav, .site-footer { display: none; }
  .page { max-width: none; }
  a { text-decoration: none; }
}

/* ---------- respect reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}
