/* Tokens ---------------------------------------------------------------- */
:root {
  --paper: #ffffff;
  --panel: #f2f3f6;
  --ink: #1f2430;
  --muted: #4b5263;
  --faint: #5a6170;
  --rule: #d6d9e0;
  --accent: #2f4b7c;

  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: "Source Sans 3", "Segoe UI", system-ui, sans-serif;
  --sidebar: 21.25rem;
  --measure: 44rem;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #16191f;
    --panel: #1d2129;
    --ink: #e4e6eb;
    --muted: #b0b6c2;
    --faint: #98a0ad;
    --rule: #2f3440;
    --accent: #9db7e3;
  }
}

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

html {
  font-size: 100%;
  -webkit-text-size-adjust: 100%;
  background: var(--paper);
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--serif);
}

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

/* Sidebar --------------------------------------------------------------- */
.sidebar {
  width: var(--sidebar);
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  padding: 4.5rem 2.5rem 2.5rem;
  background: var(--panel);
  font-family: var(--sans);
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}
.sidebar p { margin: 0; }

.portrait {
  width: 8.75rem;
  height: 8.75rem;
  border-radius: 50%;
  object-fit: cover;
}

.identity { display: flex; flex-direction: column; gap: 0.5rem; }
.name {
  font-family: var(--serif);
  font-size: 1.875rem;
  font-weight: 600;
  line-height: 1.15;
  color: var(--ink);
  text-decoration: none;
}
.position { font-size: 0.95rem; line-height: 1.5; color: var(--muted); }

.affiliations {
  display: flex; flex-direction: column; gap: 0.9rem;
  font-size: 0.875rem; line-height: 1.55; color: var(--muted);
}

.sidebar nav,
.profiles {
  display: flex; flex-direction: column;
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
}
.sidebar nav { gap: 0.6rem; font-size: 1rem; font-weight: 600; }
.sidebar nav a { color: var(--muted); text-decoration: none; }
.sidebar nav a:hover { color: var(--ink); }
.sidebar nav a[aria-current="page"] { color: var(--accent); }
.profiles { gap: 0.35rem; font-size: 0.875rem; overflow-wrap: anywhere; }

/* Main column ----------------------------------------------------------- */
main {
  flex-grow: 1;
  min-width: 0;
  max-width: calc(var(--measure) + 12rem);
  padding: 4.5rem 6rem 3rem;
  font-size: 1.125rem;
  line-height: 1.7;
}

main p, main ul, main ol, main dl { margin: 0 0 1rem; }
main ul { padding-left: 1.2rem; }
main li + li { margin-top: 0.2rem; }

h1, h2 { font-weight: 600; line-height: 1.25; }
h1 { font-size: 1.75rem; margin: 0 0 1.5rem; }
h2 { font-size: 1.375rem; margin: 2.75rem 0 0.9rem; }
h1 + h2 { margin-top: 0; }

.lede { color: var(--muted); }

main > footer {
  margin-top: 4rem;
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
  font-family: var(--sans);
  font-size: 0.85rem;
  color: var(--faint);
}

/* News ------------------------------------------------------------------ */
.news {
  display: grid;
  grid-template-columns: 8.5rem 1fr;
  gap: 0.6rem 1.25rem;
  line-height: 1.55;
}
.news dt {
  font-family: var(--sans);
  font-size: 0.95rem;
  color: var(--faint);
  padding-top: 0.1rem;
}
.news dd { margin: 0; }

/* Publications ---------------------------------------------------------- */
.pubs { list-style: none; padding: 0; margin: 0; }
.pub { margin: 0 0 1.25rem; font-size: 1.0625rem; line-height: 1.55; }
.pub > span { display: block; }
.pub-title a { color: var(--ink); text-decoration-color: var(--rule); }
.pub-title a:hover { text-decoration-color: currentColor; }
.pub-meta { color: var(--muted); }
.pub-meta strong { color: var(--ink); font-weight: 600; }
.pub-links { font-family: var(--sans); font-size: 0.875rem; }
.pub-links a + a { margin-left: 0.9rem; }
.pub-links:empty { display: none; }

/* People ---------------------------------------------------------------- */
.people { list-style: none; padding: 0; margin: 0 0 1rem; }
.person { margin: 0 0 1.1rem; line-height: 1.5; }
.person > span { display: block; }
.person-name { font-weight: 600; }
.person-name a { color: var(--ink); text-decoration-color: var(--rule); }
.person-name a:hover { text-decoration-color: currentColor; }
.person-meta { color: var(--muted); font-size: 1rem; }
.person-topic { font-size: 1rem; font-style: italic; color: var(--muted); }
.people-compact { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 2rem; }
.people-compact .person { margin-bottom: 0.9rem; }

/* CV -------------------------------------------------------------------- */
.cv {
  display: grid;
  grid-template-columns: 7rem 1fr;
  gap: 0.6rem 1.25rem;
  line-height: 1.55;
}
.cv dt { font-family: var(--sans); font-size: 0.95rem; color: var(--faint); padding-top: 0.1rem; }
.cv dd { margin: 0; }

/* Narrow screens: sidebar becomes a header ------------------------------ */
@media (max-width: 56rem) {
  body { display: block; }
  .sidebar {
    width: auto; height: auto; position: static;
    padding: 2rem 1.25rem 1.5rem;
    gap: 1.25rem;
  }
  .portrait { width: 6.5rem; height: 6.5rem; }
  .name { font-size: 1.6rem; }
  .affiliations { display: none; }
  .sidebar nav, .profiles { flex-direction: row; flex-wrap: wrap; gap: 0.4rem 1.25rem; padding-top: 1rem; }
  main { padding: 2rem 1.25rem 2rem; font-size: 1.0625rem; }
  .news, .cv { grid-template-columns: 1fr; gap: 0.1rem; }
  .people-compact { grid-template-columns: 1fr; }
  .news dd, .cv dd { margin-bottom: 0.8rem; }
}

@media print {
  body { display: block; }
  .sidebar { position: static; height: auto; background: none; padding: 0 0 1rem; }
  .sidebar nav, .profiles { display: none; }
  main { padding: 0; max-width: none; }
  a { color: inherit; text-decoration: none; }
}
