/* andywhite.org: one plain stylesheet, system fonts only. */

:root {
  --text: #3b3b3b;
  --muted: #767676;
  --background: #f9f9f9;
  --accent: #24536b;
  --light-accent: #8ab9d1;
  --rule: #d9d9d9;
  --code-background: #eeeeee;
  --serif: Charter, "Iowan Old Style", "Hoefler Text", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

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

body, h1, h2, h3, h4, p, ul, ol, figure, blockquote, pre { margin: 0; }

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

body {
  max-width: 70ch;
  margin: 0 auto;
  padding: 0 1rem;
  background: var(--background);
  color: var(--text);
  font: 1.1875rem/1.6 var(--serif);
  overflow-wrap: break-word;
}

/* Vertical rhythm: space between blocks, not around them. */
main > * + *, article > * + *, .content > * + * { margin-top: 1.25rem; }

h1, h2, h3, h4 {
  color: var(--accent);
  font-family: var(--sans);
  line-height: 1.25;
}
h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.0625rem; }
.content > :is(h2, h3, h4) { margin-top: 2rem; }

a { color: var(--accent); text-underline-offset: 0.15em; }
a:hover { text-decoration-thickness: 2px; }

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

ul, ol { padding-left: 1.5rem; }
li + li { margin-top: 0.25rem; }

blockquote {
  padding-left: 1rem;
  border-left: 4px solid var(--light-accent);
  color: var(--muted);
  font-style: italic;
}

code, pre { font-family: var(--mono); font-size: 0.85em; }
code { padding: 0.1em 0.3em; border-radius: 3px; background: var(--code-background); }
pre { padding: 1rem; overflow-x: auto; border-radius: 4px; background: var(--code-background); }
pre code { padding: 0; background: none; }

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

/* Header and nav */

.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  margin-bottom: 2.5rem;
  padding: 1.5rem 0 1rem;
  border-bottom: 1px solid var(--rule);
  font-family: var(--sans);
}
.site-title { color: var(--accent); font-size: 1.25rem; font-weight: 700; text-decoration: none; }
.site-header nav { display: flex; gap: 1.25rem; }
.site-header nav a { color: var(--text); text-decoration: none; }
.site-header nav a:hover, .site-header nav a[aria-current] { color: var(--accent); text-decoration: underline; }

/* Dates and descriptions */

time, .meta { color: var(--muted); font-family: var(--sans); font-size: 0.875rem; }
.intro { color: var(--muted); font-style: italic; }

/* Post list */

.post-list { padding: 0; list-style: none; }
.post-list li + li { margin-top: 2rem; }
.post-list h2 { font-size: 1.375rem; }
.post-list h2 a { text-decoration: none; }
.post-list h2 a:hover { text-decoration: underline; }
.post-list p { margin-top: 0.25rem; }

/* Single post */

.post-header { margin-bottom: 2rem; }
.post-header > * + * { margin-top: 0.5rem; }

/* 404 */

.not-found { padding: 3rem 0; text-align: center; }
.not-found h1 { font-size: 3rem; }

/* Footer */

.site-footer {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 1.5rem 2rem;
  margin-top: 4rem;
  padding: 2rem 0;
  border-top: 1px solid var(--rule);
  font-family: var(--sans);
  font-size: 0.9375rem;
}
.site-footer h2 { margin-bottom: 0.5rem; color: var(--text); font-size: 0.875rem; text-transform: uppercase; letter-spacing: 0.05em; }
.site-footer ul { padding: 0; list-style: none; }
.site-footer time { display: block; font-size: 0.8125rem; }
.site-footer small { grid-column: 1 / -1; color: var(--muted); }
