:root {
  --page: #eef0f3;
  --sheet: #ffffff;
  --ink: #1c1f24;
  --ink-2: #444a55;
  --muted: #7b8290;
  --rule: #e1e4ea;
  --link: #3f4bb0;
  --link-hover: #2c3690;
  --shadow: 0 1px 2px rgba(20, 24, 40, 0.05), 0 8px 32px rgba(20, 24, 40, 0.06);
  --serif: "Crimson Pro", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --page: #0f1114; --sheet: #17191e; --ink: #e9eaee; --ink-2: #b9bec8; --muted: #838a97;
    --rule: #2a2e36; --link: #9da7ff; --link-hover: #c0c6ff;
    --shadow: 0 1px 2px rgba(0,0,0,0.4), 0 8px 32px rgba(0,0,0,0.35);
  }
}
:root[data-theme="dark"] {
  --page: #0f1114; --sheet: #17191e; --ink: #e9eaee; --ink-2: #b9bec8; --muted: #838a97;
  --rule: #2a2e36; --link: #9da7ff; --link-hover: #c0c6ff;
  --shadow: 0 1px 2px rgba(0,0,0,0.4), 0 8px 32px rgba(0,0,0,0.35);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  font-family: var(--serif);
  font-size: 20px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--page);
  text-rendering: optimizeLegibility;
  padding: 0 16px 48px;
}

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

/* Top bar spans the page; its contents align with the sheet. */
.topbar {
  margin: 0 -16px;
  padding: 16px 16px;
  background: var(--sheet);
  border-bottom: 1px solid var(--rule);
  box-shadow: 0 1px 12px rgba(20, 24, 40, 0.06);
}
.topbar-inner {
  max-width: 62em;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 24px;
  flex-wrap: wrap;
}
.brand, .nav a {
  font-variant: small-caps;
  letter-spacing: 0.06em;
}
.brand { font-size: 26px; font-weight: 500; color: var(--ink); }
.brand:hover { text-decoration: none; color: var(--link); }
.nav { display: flex; gap: 22px; flex-wrap: wrap; }
.nav a { font-size: 20px; }

/* The sheet */
.sheet {
  max-width: 62em;
  margin: 36px auto 0;
  padding: 44px 48px 40px;
  background: var(--sheet);
  border: 1px solid var(--rule);
  border-radius: 4px;
  box-shadow: var(--shadow);
}

p {
  text-align: justify;
  hyphens: auto;
  -webkit-hyphens: auto;
  text-wrap: pretty;
  margin-bottom: 1em;
}
p:last-child { margin-bottom: 0; }

/* Intro: prose beside the photo card */
.intro {
  display: grid;
  grid-template-columns: 1fr 272px;
  gap: 44px;
  align-items: start;
}
.card {
  padding: 14px 14px 16px;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: var(--sheet);
  box-shadow: 0 1px 6px rgba(20, 24, 40, 0.06);
  text-align: center;
}
.portrait {
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 4px;
  display: block;
  margin-bottom: 12px;
}
.card p { text-align: center; margin: 0; line-height: 1.45; hyphens: none; }
.card-name { font-size: 22px; font-weight: 600; }
.card-role { color: var(--ink-2); font-size: 17px; margin-top: 2px; }
.card-email { color: var(--ink-2); font-size: 16px; margin-top: 8px; }
.card-links { font-size: 17px; margin-top: 4px; }
.card-links span { color: var(--muted); margin: 0 4px; }

/* Sections */
section { margin-top: 44px; scroll-margin-top: 20px; }
h2 {
  font-size: 30px;
  font-weight: 500;
  line-height: 1.2;
  margin-bottom: 18px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--rule);
}
h3 {
  font-size: 23px;
  font-weight: 600;
  line-height: 1.3;
  text-wrap: balance;
  margin-bottom: 4px;
}
h3 a { color: var(--ink); }
h3 a:hover { color: var(--link); }
.meta { color: var(--muted); font-size: 17px; margin-bottom: 0.6em; }
.links { display: flex; gap: 6px 22px; flex-wrap: wrap; text-align: left; }
.links a { font-variant: small-caps; letter-spacing: 0.06em; font-size: 19px; }

/* Media rows: illustration beside text; the text wraps beneath on narrow screens */
.media { display: flex; gap: 32px; align-items: flex-start; }
.media-reverse { flex-direction: row-reverse; }
.media-figure { flex: 0 0 300px; width: 300px; height: auto; margin-top: 6px; }
.media-text { flex: 1 1 auto; min-width: 0; }

/* Code list */
.repos { display: grid; gap: 18px; }
.repo dt { font-size: 22px; font-weight: 600; margin-bottom: 2px; }
.repo dd { color: var(--ink-2); text-align: justify; hyphens: auto; }

/* Footer */
.footer {
  max-width: 62em;
  margin: 20px auto 0;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 16px;
  color: var(--muted);
}

@media (max-width: 860px) {
  .intro { grid-template-columns: 1fr; }
  .card { max-width: 300px; margin: 0 auto; }
  .intro-text { order: 2; }
  .card { order: 1; }
}
@media (max-width: 700px) {
  body { font-size: 18px; }
  .sheet { padding: 28px 22px; margin-top: 20px; }
  .media, .media-reverse { flex-direction: column; }
  .media-figure { width: 100%; max-width: 300px; flex-basis: auto; margin: 0 auto 6px; }
  h2 { font-size: 26px; }
  .brand { font-size: 22px; }
  .nav { gap: 16px; }
  .nav a { font-size: 18px; }
  p { text-align: left; }
}

/* Sub-pages */
.nav a[aria-current="page"] { color: var(--ink); }
.page-head { padding-bottom: 20px; margin-bottom: 8px; border-bottom: 1px solid var(--rule); }
.page-head h1 { font-size: 38px; font-weight: 500; line-height: 1.15; margin-bottom: 10px; }
.page-head .lede { font-size: 21px; color: var(--ink-2); margin-bottom: 0; }
.page-head + section { margin-top: 28px; }
