:root {
  --bg: #fbfaf7;
  --text: #1d2126;
  --muted: #5d636c;
  --accent: #1f5c86;
  --accent-hover: #123d5c;
  --rule: #e3dfd6;
  --panel: #f2efe8;
  --serif: Charter, "Bitstream Charter", "Sitka Text", Cambria, Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15171a;
    --text: #e7e4de;
    --muted: #a2a8b1;
    --accent: #8dc2ea;
    --accent-hover: #b9dbf4;
    --rule: #2c3036;
    --panel: #1d2024;
  }
}

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

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

body {
  margin: 0 auto;
  max-width: 46rem;
  padding: 3.5rem 1.25rem 3rem;
  background: var(--bg);
  color: var(--text);
  font-family: var(--serif);
  font-size: 1.0625rem;
  line-height: 1.6;
}

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

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 1rem; top: 1rem; background: var(--bg); padding: 0.25rem 0.5rem; }

/* Header */
.intro {
  display: grid;
  grid-template-columns: 9.5rem 1fr;
  gap: 1.75rem;
  align-items: center;
  margin-bottom: 2rem;
}
.portrait {
  width: 100%;
  height: auto;
  border-radius: 6px;
  display: block;
}
h1 {
  margin: 0;
  font-size: 2.25rem;
  line-height: 1.15;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.role { margin: 0.4rem 0 0.9rem; color: var(--muted); }
.contact {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.25rem;
  font-family: var(--sans);
  font-size: 0.9375rem;
}

/* Sections */
h2 {
  margin: 2.75rem 0 0.25rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--rule);
  font-size: 1.375rem;
  font-weight: 600;
}
h3 {
  margin: 1.75rem 0 0.5rem;
  font-family: var(--sans);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.bio p { margin: 0 0 0.9rem; }

/* Paper lists */
.papers { list-style: none; margin: 0; padding: 0; }
.papers > li { padding: 0.8rem 0; border-bottom: 1px solid var(--rule); }
.papers > li:last-child { border-bottom: 0; }
.papers p { margin: 0; }
.title { font-weight: 600; line-height: 1.4; }
.title a { color: var(--text); text-decoration-color: var(--rule); }
.title a:hover { color: var(--accent); text-decoration-color: currentColor; }
.with { font-weight: 400; color: var(--muted); white-space: nowrap; }
.with::before { content: "("; }
.with::after { content: ")"; }
.cite { color: var(--muted); margin-top: 0.15rem !important; }
.cite cite { font-style: italic; }
.extra { white-space: nowrap; font-family: var(--sans); font-size: 0.875rem; }
.extra a { margin-left: 0.6rem; }

details { margin-top: 0.3rem; font-size: 0.96875rem; }
summary {
  display: inline-block;
  cursor: pointer;
  list-style: none;
  font-family: var(--sans);
  font-size: 0.875rem;
  color: var(--accent);
}
summary::-webkit-details-marker { display: none; }
summary::before {
  content: "";
  display: inline-block;
  width: 0.4em;
  height: 0.4em;
  margin: 0 0.45em 0.12em 0.05em;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(-45deg);
  transition: transform 0.15s ease;
}
details[open] summary::before { transform: rotate(45deg); }
details p {
  margin: 0.5rem 0 0.25rem !important;
  padding: 0.75rem 1rem;
  background: var(--panel);
  border-radius: 4px;
  line-height: 1.55;
}

.plain { margin: 0; padding-left: 1.1rem; }
.plain li { padding: 0.15rem 0; }

#teaching p { margin-top: 0.75rem; }

footer {
  margin-top: 3.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
  font-family: var(--sans);
  font-size: 0.8125rem;
  color: var(--muted);
}
footer p { margin: 0; }

/* Phones */
@media (max-width: 34rem) {
  body { padding-top: 2rem; padding-left: 1rem; padding-right: 1rem; }
  .intro { grid-template-columns: 6.5rem 1fr; gap: 1.1rem; align-items: start; }
  h1 { font-size: 1.75rem; }
  .role { font-size: 0.96875rem; }
  .contact { gap: 0.25rem 1rem; }
  .with { white-space: normal; }
  .extra { display: block; margin-top: 0.1rem; }
  .extra a:first-child { margin-left: 0; }
}

@media print {
  details p { background: none; padding: 0; }
  summary { display: none; }
  details:not([open]) { display: none; }
}
