:root {
  --bg: #fbfbfb;
  --fg: #1a1a1a;
  --muted: #6a6a6a;
  --rule: #d2d2d2;
  --rule-strong: #9c9c9c;
  --link: #333333;
  --band: #f0f0f0;
  --band-alt: #f6f6f6;
  --serif: Charter, "Bitstream Charter", Georgia, "Times New Roman", serif;
  --sans: "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif;
}

:root[data-theme="dark"] {
  --bg: #161616;
  --fg: #e4e4e4;
  --muted: #9a9a9a;
  --rule: #333333;
  --rule-strong: #5a5a5a;
  --link: #cfcfcf;
  --band: #1f1f1f;
  --band-alt: #1b1b1b;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0 auto;
  padding: 2.5rem 1.25rem 5rem;
  max-width: 62rem;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: var(--band);
}

a {
  color: var(--link);
  text-decoration-color: var(--rule-strong);
  text-underline-offset: 2px;
}

a:hover {
  text-decoration-color: currentColor;
}

a:focus-visible,
img:focus-visible {
  outline: 2px solid var(--rule-strong);
  outline-offset: 2px;
}

img {
  max-width: 100%;
  height: auto;
}

.site-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
  border-bottom: 3px double var(--rule-strong);
  padding-bottom: 0.9rem;
  margin-bottom: 0;
}

.theme-toggle {
  flex: 0 0 auto;
  background: none;
  color: var(--muted);
  border: 1px solid var(--rule-strong);
  border-radius: 2px;
  padding: 0.3rem 0.7rem;
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
}

.theme-toggle:hover {
  color: var(--fg);
  border-color: var(--fg);
}

.site-header h1 {
  margin: 0;
  font-size: 2.2rem;
  font-weight: 600;
  letter-spacing: -0.015em;
}

.site-header .subtitle {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h2 {
  margin: 3rem 0 1rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid var(--rule-strong);
  font-size: 1.4rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  scroll-margin-top: 1rem;
}

h3 {
  margin: 2rem 0 0.5rem;
  font-family: var(--sans);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  scroll-margin-top: 1rem;
}

p,
li {
  max-width: 46rem;
}

ul {
  padding-left: 1.15rem;
}

li {
  margin-bottom: 0.35rem;
}

nav.toc {
  margin-bottom: 1.75rem;
  padding: 0.75rem 0;
  background: var(--bg);
  border-bottom: 1px solid var(--rule);
  font-family: var(--sans);
  font-size: 0.85rem;
}

nav.toc ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  margin: 0;
  padding: 0;
}

nav.toc li {
  margin: 0;
}

nav.toc li:not(:last-child)::after {
  content: "/";
  color: var(--rule-strong);
  margin: 0 0.55rem;
}

nav.toc a {
  text-decoration: none;
  color: var(--muted);
  border-bottom: 1px solid transparent;
}

nav.toc a:hover {
  color: var(--fg);
  border-bottom-color: var(--rule-strong);
}

.person {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.75rem;
  margin: 0.75rem 0 0.5rem;
  padding: 0.9rem 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}

.person-text {
  flex: 1 1 auto;
}

/* Kramdown wraps the img in a paragraph, which is the flex item here. */
.person > p {
  flex: 0 0 auto;
  margin: 0;
}

.person-text p {
  margin: 0;
}

.person-photo {
  flex: 0 0 auto;
  width: 108px;
  border: 1px solid var(--rule-strong);
}

.table-wrap {
  overflow-x: auto;
  margin: 1.25rem 0 1.5rem;
  border-top: 1px solid var(--rule-strong);
  border-bottom: 1px solid var(--rule-strong);
}

table {
  border-collapse: collapse;
  width: 100%;
  font-family: var(--sans);
  font-size: 0.88rem;
  line-height: 1.45;
}

th,
td {
  text-align: left;
  vertical-align: top;
  padding: 0.55rem 0.8rem;
}

th {
  background: var(--band);
  border-bottom: 1px solid var(--rule-strong);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}

tbody tr:nth-child(even) {
  background: var(--band-alt);
}

tbody tr:hover {
  background: var(--band);
}

td {
  border-bottom: 1px solid var(--rule);
}

tbody tr:last-child td {
  border-bottom: 0;
}

.schedule tr:has(.exam) td {
  background: var(--band);
  font-weight: 600;
  letter-spacing: 0.04em;
}

.schedule td:nth-child(1) {
  width: 2.5rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.schedule td:nth-child(2) {
  width: 4.5rem;
  white-space: nowrap;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.schedule td:nth-child(3) {
  width: 10rem;
  font-weight: 600;
}

.schedule td:nth-child(5) {
  width: 22rem;
  color: var(--muted);
}

.schedule td a {
  color: var(--fg);
  text-decoration-color: var(--rule);
}

ul.refs {
  list-style: none;
  padding-left: 0;
  font-size: 0.96rem;
}

ul.refs li {
  max-width: 48rem;
  margin-bottom: 0.65rem;
  padding-left: 1.4rem;
  text-indent: -1.4rem;
}

ul.refs li::before {
  content: "";
  display: inline-block;
  width: 0.55rem;
  height: 1px;
  margin-right: 0.55rem;
  vertical-align: middle;
  background: var(--rule-strong);
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.86em;
  background: var(--band);
  padding: 0.1em 0.32em;
  border-radius: 2px;
}

.note {
  color: var(--muted);
  font-size: 0.92rem;
}

@media (max-width: 46rem) {
  body {
    font-size: 16px;
    padding-top: 1.75rem;
  }

  .site-header h1 {
    font-size: 1.7rem;
  }

  .person {
    flex-direction: column-reverse;
    align-items: flex-start;
    gap: 0.9rem;
  }

  table {
    font-size: 0.82rem;
  }

  .schedule td:nth-child(3),
  .schedule td:nth-child(4),
  .schedule td:nth-child(5) {
    min-width: 12rem;
    width: auto;
  }
}

@media print {
  body {
    max-width: none;
    font-size: 10pt;
  }

  nav.toc {
    display: none;
  }

  .table-wrap {
    overflow: visible;
  }

  tbody tr {
    break-inside: avoid;
  }

  .person-photo {
    width: 80px;
  }
}
