:root {
  color-scheme: light;
  --bg: #fbfaf7;
  --surface: #ffffff;
  --text: #1d2420;
  --muted: #5d6862;
  --rule: #dfe3dc;
  --accent: #1c6b47;
  --accent-soft: #e4f0e9;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --measure: 42rem;
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
}

.wrap {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 1.25rem;
}

a { color: var(--accent); text-underline-offset: 0.15em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }

h1, h2, h3 { font-family: var(--serif); line-height: 1.2; text-wrap: balance; }
h1 { font-size: 2.25rem; margin: 0 0 1rem; letter-spacing: -0.01em; }
h2 {
  font-family: var(--sans);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 1.25rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--rule);
}
h3 { font-size: 1.25rem; margin: 0 0 0.25rem; }
p { margin: 0 0 1rem; }

.skip-link {
  position: absolute;
  left: -999px;
  top: 0.5rem;
  background: var(--surface);
  padding: 0.5rem 0.75rem;
  z-index: 10;
}
.skip-link:focus { left: 0.5rem; }

/* Header and footer */

.site-header { padding: 1.5rem 0; }
.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
}
.site-name {
  font-family: var(--serif);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
}
.site-header ul, .site-footer ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.site-header nav a { color: var(--muted); text-decoration: none; }
.site-header nav a:hover { color: var(--text); text-decoration: underline; }
.site-header nav a[aria-current="page"] {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 2px;
}

main { padding-top: 2rem; padding-bottom: 3rem; min-height: 60vh; }
main > section, main > div > section { margin-top: 3rem; }

.site-footer {
  border-top: 1px solid var(--rule);
  padding: 1.5rem 0 2.5rem;
  color: var(--muted);
  font-size: 0.9375rem;
}
.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
}
.site-footer p { margin: 0; }
.site-footer a { color: var(--muted); }
.site-footer .disclaimer { flex-basis: 100%; margin-top: 0.5rem; font-size: 0.875rem; }

/* Home */

.intro .portrait {
  display: block;
  width: 8rem;
  height: 8rem;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 0 1.5rem;
}
.intro h1 { font-size: 2.75rem; }
.intro p { font-size: 1.25rem; line-height: 1.55; }

.more, .section-note { color: var(--muted); }
.more { margin-top: 1.25rem; }

/* Projects */

.project-list, .post-list, .archive-grid, .skills { list-style: none; margin: 0; padding: 0; }

.project-list li + li { margin-top: 1.75rem; }
.project-list h3 a { color: var(--text); text-decoration-color: var(--rule); }
.project-list h3 a:hover { text-decoration-color: var(--accent); }
.project-list p { margin: 0 0 0.25rem; }
.project-list .link { font-size: 0.9375rem; overflow-wrap: anywhere; }
.year {
  font-family: var(--sans);
  font-size: 0.8125rem;
  font-weight: 400;
  color: var(--muted);
  margin-left: 0.35rem;
  white-space: nowrap;
}

.archive-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
  gap: 1.25rem 1rem;
}
.archive-grid a { display: block; color: var(--text); text-decoration: none; }
.archive-grid img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  object-position: top left;
  border: 1px solid var(--rule);
  border-radius: 4px;
  background: #fff;
  margin-bottom: 0.5rem;
}
.archive-grid a:hover img { border-color: var(--accent); }
.archive-grid a:hover .title { text-decoration: underline; }
.archive-grid .title { font-size: 0.9375rem; line-height: 1.35; }
.archive-grid .year { margin-left: 0.25rem; }

/* Blog */

.post-list li + li { margin-top: 1.5rem; }
.post-list time, .post .meta { display: block; color: var(--muted); font-size: 0.875rem; }
.post-list a { font-family: var(--serif); font-size: 1.25rem; font-weight: 700; }
.post-list p { margin: 0.25rem 0 0; color: var(--muted); }
.draft {
  font-family: var(--sans);
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--accent-soft);
  color: var(--accent);
  padding: 0.1rem 0.45rem;
  border-radius: 3px;
}
.post .meta { margin-bottom: 0.5rem; }
.post .back { margin-top: 3rem; }

.prose h2 {
  font-family: var(--serif);
  font-size: 1.5rem;
  letter-spacing: 0;
  text-transform: none;
  color: var(--text);
  border: 0;
  padding: 0;
  margin: 2.25rem 0 0.75rem;
}
.prose h3 { margin: 1.75rem 0 0.5rem; }
.prose img { max-width: 100%; height: auto; border-radius: 4px; }
.prose blockquote {
  margin: 1.5rem 0;
  padding-left: 1rem;
  border-left: 3px solid var(--accent);
  color: var(--muted);
}
.prose code { font-family: var(--mono); font-size: 0.9em; background: var(--accent-soft); padding: 0.1em 0.3em; border-radius: 3px; }
.prose pre {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 1rem;
  overflow-x: auto;
  font-size: 0.9rem;
}
.prose pre code { background: none; padding: 0; }
.prose table { display: block; overflow-x: auto; border-collapse: collapse; }
.prose th, .prose td { border-bottom: 1px solid var(--rule); padding: 0.4rem 0.75rem; text-align: left; }

/* Resume */

.resume-header p { margin: 0 0 0.25rem; }
.resume-header .contact { font-size: 0.9375rem; color: var(--muted); overflow-wrap: anywhere; }
.print-button {
  margin-top: 0.75rem;
  font: inherit;
  font-size: 0.9375rem;
  color: var(--accent);
  background: none;
  border: 1px solid var(--accent);
  border-radius: 4px;
  padding: 0.3rem 0.8rem;
  cursor: pointer;
}
.print-button:hover { background: var(--accent-soft); }
.print-only { display: none; }

.entry + .entry { margin-top: 1.5rem; }
.entry-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0 1rem;
}
.entry-head h3 { font-size: 1.125rem; margin: 0; }
.entry .dates { color: var(--muted); font-size: 0.9375rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
.entry .org { margin: 0.1rem 0 0; color: var(--muted); }
.entry ul { margin: 0.5rem 0 0; padding-left: 1.25rem; }

.skills { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.skills li {
  background: var(--accent-soft);
  color: var(--text);
  padding: 0.15rem 0.65rem;
  border-radius: 999px;
  font-size: 0.9375rem;
}

@media (max-width: 30rem) {
  h1 { font-size: 1.875rem; }
  .intro .portrait { width: 6.5rem; height: 6.5rem; }
  .intro h1 { font-size: 2.125rem; }
  .intro p { font-size: 1.125rem; }
}

@media print {
  :root { --bg: #fff; --surface: #fff; --text: #000; --muted: #444; --rule: #bbb; --accent: #000; --accent-soft: #fff; }
  body { font-size: 10.5pt; }
  .site-header, .site-footer, .skip-link, .screen-only { display: none; }
  .print-only { display: inline; }
  main { padding: 0; }
  main > div > section { margin-top: 1.5rem; }
  a { color: inherit; text-decoration: none; }
  .entry { break-inside: avoid; }
  .skills li { border: 1px solid var(--rule); }
}
