:root {
  --paper: #fbfaf7;
  --ink: #1b1b1a;
  --ink-soft: #55534e;
  --ink-faint: #8a877f;
  --rule: #e4e1da;
  --accent: #24476b;
  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans: "Instrument Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --wide: 1000px;
  --narrow: 680px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 24px; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16.5px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }

a { color: inherit; text-decoration: underline; text-decoration-color: var(--rule); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--accent); text-decoration-color: currentColor; }

.wrap { max-width: var(--wide); margin: 0 auto; padding: 0 32px; }
.wrap.narrow { max-width: var(--narrow); }

/* ---------- Header ---------- */
.site-header { padding: 28px 0; }
.site-header .wrap { display: flex; justify-content: space-between; align-items: baseline; gap: 24px; flex-wrap: wrap; }
.site-name { font-family: var(--serif); font-size: 1.2rem; text-decoration: none; }
.site-nav { display: flex; gap: 22px; flex-wrap: wrap; font-size: 0.92rem; }
.site-nav a { text-decoration: none; color: var(--ink-soft); }
.site-nav a:hover { color: var(--ink); }
.site-nav a[aria-current="page"] { color: var(--ink); text-decoration: underline; text-decoration-color: var(--ink-faint); text-underline-offset: 6px; }

/* ---------- Page headers (section pages) ---------- */
.page-head { padding: 40px 0 36px; }
.page-head .page-title { margin: 0 0 10px; }
.page-head .lede { margin: 0; max-width: 620px; }
.section .wrap.single { display: block; }

/* ---------- Explore list (home) ---------- */
.explore { list-style: none; margin: 0; padding: 0; }
.explore li { border-bottom: 1px solid var(--rule); }
.explore li:first-child a { padding-top: 0; }
.explore li:last-child { border-bottom: none; }
.explore a { display: grid; grid-template-columns: 210px 1fr auto; gap: 20px; align-items: baseline; padding: 14px 0; text-decoration: none; }
.explore-title { font-family: var(--serif); font-size: 1.15rem; }
.explore-desc { color: var(--ink-soft); font-size: 0.95rem; }
.explore .arrow { color: var(--ink-faint); transition: transform 0.15s ease, color 0.15s ease; }
.explore a:hover .arrow { transform: translateX(4px); color: var(--accent); }
.explore a:hover .explore-title { color: var(--accent); }

/* ---------- Skills ---------- */
.skill-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.skill-card { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--rule); border-radius: 14px; padding: 22px 24px 20px; }
.skill-card h3 { font-family: var(--serif); font-weight: 400; font-size: 1.3rem; margin: 0 0 2px; }
.skill-blurb { color: var(--ink-faint); font-size: 0.9rem; margin: 0 0 16px; }
.chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.chips li { font-size: 0.88rem; padding: 4px 11px; border: 1px solid var(--rule); border-radius: 8px; background: var(--paper); }
.certs { margin-top: 40px; }
.certs h3 { font-family: var(--serif); font-weight: 400; font-size: 1.3rem; margin: 0 0 12px; }
.cert-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.cert-list li { display: flex; flex-direction: column; gap: 2px; background: #fff; border: 1px solid var(--rule); border-radius: 14px; padding: 18px 24px; }
.cert-name { font-weight: 600; }
.cert-name a { text-decoration: none; color: var(--accent); }
.cert-name a:hover { text-decoration: underline; }
.cert-issuer { font-size: 0.9rem; color: var(--ink-faint); }

/* ---------- Awards ---------- */
.awards { list-style: none; margin: 0; padding: 0; }
.award { padding: 18px 0; border-bottom: 1px solid var(--rule); }
.award:first-child { padding-top: 0; }
.award:last-child { border-bottom: none; }
.award-head { display: flex; justify-content: space-between; align-items: baseline; gap: 20px; }
.award-name { font-weight: 600; }
.award-name .sub { font-weight: 400; color: var(--ink-soft); }
.award-desc { margin: 4px 0 0; color: var(--ink-soft); font-size: 0.95rem; max-width: 640px; }

/* ---------- Intro ---------- */
.intro { padding: 56px 0 72px; }
.intro .wrap { display: grid; grid-template-columns: 1fr 240px; gap: 64px; align-items: end; }
.intro h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 3.6rem;
  line-height: 1.05;
  letter-spacing: -0.015em;
  margin: 0 0 20px;
}
.intro .role { font-size: 1.05rem; color: var(--ink-soft); margin: 0 0 28px; }
.intro p { max-width: 560px; margin: 0 0 16px; }
.intro .contact { display: flex; gap: 24px; margin-top: 28px; font-size: 0.95rem; }
.portrait-frame {
  margin: 0;
  width: 240px;
  padding: 8px;
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: 22px;
  box-shadow: 0 1px 2px rgba(27, 27, 26, 0.04), 0 12px 32px -12px rgba(27, 27, 26, 0.18);
}
.portrait { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 15px; }

/* ---------- Sections (index layout) ---------- */
.section { border-top: 1px solid var(--rule); padding: 44px 0 52px; }
.section .wrap { display: grid; grid-template-columns: 200px 1fr; gap: 40px; }
.section-label {
  font-family: var(--serif);
  font-size: 1.35rem;
  font-weight: 400;
  margin: 0;
  line-height: 1.3;
}
.section-note { font-size: 0.88rem; color: var(--ink-faint); margin: 6px 0 0; }

.rows { list-style: none; margin: 0; padding: 0; }
.row { padding: 0 0 26px; margin: 0 0 26px; border-bottom: 1px solid var(--rule); }
.row:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.row-head { display: flex; justify-content: space-between; align-items: baseline; gap: 20px; }
.row h3 { font-size: 1.05rem; font-weight: 600; margin: 0; line-height: 1.4; }
.row h3 a { text-decoration: none; }
.row h3 a:hover { text-decoration: underline; }
.row .when { font-size: 0.88rem; color: var(--ink-faint); white-space: nowrap; font-variant-numeric: tabular-nums; }
.row .where { color: var(--ink-soft); font-size: 0.95rem; margin: 2px 0 8px; }
.row p { margin: 0; }
.row .more { display: inline-block; margin-top: 8px; font-size: 0.9rem; color: var(--accent); text-decoration: none; }
.row .more:hover { text-decoration: underline; }

/* Awards list */
.plain { list-style: none; margin: 0; padding: 0; }
.plain li { display: flex; justify-content: space-between; gap: 20px; padding: 10px 0; border-bottom: 1px solid var(--rule); }
.plain li:first-child { padding-top: 0; }
.plain li:last-child { border-bottom: none; }
.plain .when { font-size: 0.88rem; color: var(--ink-faint); white-space: nowrap; }
.plain .sub { color: var(--ink-soft); }

/* Education */
.school { margin: 0 0 4px; font-weight: 600; }
.school-sub { color: var(--ink-soft); margin: 0 0 24px; }
.years { display: grid; grid-template-columns: 1fr 1fr; gap: 28px 40px; }
.years h3 { font-family: var(--serif); font-weight: 400; font-size: 1.2rem; margin: 0 0 8px; }
.year-note { font-family: var(--sans); font-size: 0.85rem; color: var(--ink-faint); margin-left: 4px; }
.years ul { list-style: none; margin: 0; padding: 0; font-size: 0.94rem; color: var(--ink-soft); }
.years li { padding: 2px 0; }
.fineprint { font-size: 0.86rem; color: var(--ink-faint); margin: 24px 0 0; }

/* Skills */
.skills { display: grid; grid-template-columns: 170px 1fr; gap: 10px 24px; margin: 0; }
.skills dt { color: var(--ink-soft); }
.skills dd { margin: 0; }

/* ---------- Activity pages ---------- */
.page-top { padding: 40px 0 8px; }
.back { font-size: 0.9rem; color: var(--ink-soft); text-decoration: none; }
.back:hover { color: var(--ink); }
.page-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 2.6rem;
  line-height: 1.12;
  letter-spacing: -0.01em;
  margin: 28px 0 16px;
}
.lede { font-size: 1.15rem; color: var(--ink-soft); margin: 0 0 32px; }
.facts { margin: 0 0 8px; padding: 18px 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); display: grid; grid-template-columns: 140px 1fr; gap: 6px 20px; font-size: 0.95rem; }
.facts dt { color: var(--ink-faint); }
.facts dd { margin: 0; }

.prose { padding: 16px 0 24px; }
.prose h2 { font-family: var(--serif); font-weight: 400; font-size: 1.5rem; margin: 40px 0 12px; }
.prose p { margin: 0 0 16px; }
.prose ul, .prose ol { margin: 0 0 16px; padding-left: 20px; }
.prose li { margin-bottom: 8px; }
.prose li::marker { color: var(--ink-faint); }
.prose strong { font-weight: 600; }
.prose a { text-decoration-color: var(--ink-faint); }
.figure { margin: 32px 0; }
.figure img { width: 100%; border-radius: 3px; }
.figure figcaption { font-size: 0.86rem; color: var(--ink-faint); margin-top: 10px; }
.page-links { display: flex; flex-wrap: wrap; gap: 24px; margin: 8px 0 0; font-size: 0.95rem; }
.page-links a { color: var(--accent); }

.pager { display: flex; justify-content: space-between; gap: 24px; padding: 32px 0 72px; margin-top: 32px; border-top: 1px solid var(--rule); font-size: 0.95rem; }
.pager a { text-decoration: none; }
.pager a:hover span { text-decoration: underline; }
.pager small { display: block; color: var(--ink-faint); font-size: 0.82rem; }
.pager .next { text-align: right; margin-left: auto; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--rule); padding: 32px 0 48px; font-size: 0.9rem; color: var(--ink-soft); }
.site-footer .wrap { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.site-footer .links { display: flex; gap: 22px; flex-wrap: wrap; }

/* ---------- Responsive ---------- */
@media (max-width: 820px) {
  .intro .wrap { grid-template-columns: 1fr; gap: 32px; }
  .portrait-frame { width: 180px; order: -1; }
  .skill-grid, .cert-list { grid-template-columns: 1fr; }
  .explore a { grid-template-columns: 1fr auto; }
  .explore-desc { grid-column: 1; grid-row: 2; }
  .explore .arrow { grid-row: 1 / span 2; align-self: center; }
  .intro h1 { font-size: 2.7rem; }
  .section .wrap { grid-template-columns: 1fr; gap: 20px; }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  .wrap { padding: 0 18px; }
  .site-nav { gap: 14px; }
  .intro { padding: 24px 0 48px; }
  .row-head, .plain li, .award-head { flex-direction: column; gap: 0; }
  .years { grid-template-columns: 1fr; }
  .skills, .facts { grid-template-columns: 1fr; gap: 2px; }
  .skills dd, .facts dd { margin-bottom: 10px; }
  .page-title { font-size: 2rem; }
  .pager { flex-direction: column; }
  .pager .next { text-align: left; margin-left: 0; }
}

/* Keep the footer at the bottom of the window on short pages */
body > main { flex: 1 0 auto; }
