:root {
  --font-family: -apple-system, BlinkMacSystemFont, Aptos, Roboto, "Segoe UI", Helvetica, Arial, sans-serif;

  --rgb-background: 251, 250, 249;
  --rgb-ink: 35, 28, 51;
  --rgb-accent: 0, 116, 228;

  --color-background: rgb(var(--rgb-background));
  --color-text: rgb(var(--rgb-ink));
  --color-text-subtle: rgba(var(--rgb-ink), 0.66);
  --color-accent: rgb(var(--rgb-accent));
  --color-border: rgba(var(--rgb-ink), 0.15);

  --content-width: 40rem;

  --space-small: 0.5rem;
  --space-medium: 1rem;
  --space-neutral: 1.5rem;
  --space-large: 2rem;
  --space-x-large: 3rem;
  --space-xx-large: 4.5rem;

  --transition: 0.15s cubic-bezier(0.33, 1, 0.68, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --rgb-background: 27, 39, 51;
    --rgb-ink: 236, 233, 230;
    --rgb-accent: 80, 162, 255;
  }
}

html {
  color-scheme: light dark;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  padding: var(--space-xx-large) var(--space-large);
  background-color: var(--color-background);
  color: var(--color-text);
  font-family: var(--font-family);
  font-size: 18px;
  line-height: 1.65;
}

header {
  max-width: var(--content-width);
  margin: 0 auto var(--space-x-large);
  text-align: center;
}

header p {
  margin: 0 0 var(--space-medium);
  color: var(--color-text-subtle);
  text-align: left;
  text-wrap: pretty;
}

/* Intro links act as a table of contents, so they stay quieter than body links */
header a,
header a:visited {
  color: var(--color-text-subtle);
  text-decoration-color: var(--color-border);
  white-space: normal;
}

@media (hover: hover) {
  header a:hover {
    color: var(--color-accent);
  }
}

article {
  max-width: var(--content-width);
  margin-inline: auto;
}

img.avatar {
  display: block;
  width: 147px;
  height: 147px;
  margin: 0 auto var(--space-neutral);
  border-radius: 50%;
  object-fit: cover;
}

h1 {
  margin: 0 0 var(--space-medium);
  font-size: clamp(1.5rem, 4.5vw, 1.9rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.015em;
}

h2 {
  margin: var(--space-x-large) 0 var(--space-small);
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

p {
  margin: 0 0 var(--space-medium);
}

a,
a:visited {
  color: var(--color-accent);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.15em;
  white-space: nowrap;
  transition: color var(--transition);
}

@media (hover: hover) {
  a:hover {
    color: var(--color-text);
  }
}

ul.publications {
  max-height: 28rem;
  overflow-y: auto;
  margin: 0 0 var(--space-medium);
  padding: var(--space-medium);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  list-style: none;
  font-size: 0.85rem;
  line-height: 1.45;
}

ul.publications li {
  margin-bottom: var(--space-small);
}

ul.publications li + li {
  padding-top: var(--space-small);
  border-top: 1px solid var(--color-border);
}

ul.publications a {
  white-space: normal;
}

ul.publications .label {
  color: var(--color-text-subtle);
}

table.races {
  width: 100%;
  margin: 0 0 var(--space-medium);
  border-collapse: collapse;
  font-size: 0.75rem;
  line-height: 1.45;
  font-variant-numeric: tabular-nums;
}

table.races th,
table.races td {
  padding: var(--space-small) var(--space-medium) var(--space-small) 0;
  border-bottom: 1px solid var(--color-border);
  text-align: left;
  vertical-align: top;
}

table.races th {
  color: var(--color-text-subtle);
  font-weight: 600;
}

table.races th:last-child,
table.races td:last-child {
  padding-right: 0;
  text-align: right;
  white-space: nowrap;
}

table.races td:first-child {
  white-space: nowrap;
}

@media screen and (max-width: 40rem) {
  body {
    padding: var(--space-large) var(--space-neutral);
    font-size: 17px;
  }

  a,
  a:visited {
    white-space: normal;
  }

  h2 {
    margin-top: var(--space-large);
  }

  img.avatar {
    width: 120px;
    height: 120px;
  }
}
