@font-face {
  font-family: "IBM Plex Sans";
  src: url("fonts/ibm-plex-sans-variable.ttf") format("truetype");
  font-style: normal;
  font-weight: 100 700;
  font-display: swap;
}

/* Chalk & blue. Shared tokens keep every page on the same visual scale. */
:root {
  --canvas: #f4f6f7;
  --surface: #fff;
  --ink: #233445;
  --muted: #586979;
  --accent: #365f86;
  --soft: #e4ebf2;
  --line: #d7dfe7;
  --sans: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --width: 1120px;
  --gutter: clamp(20px, 4vw, 48px);
}
* { box-sizing: border-box; }
body, h1, h2, h3, p, figure { margin: 0; }
img { max-width: 100%; display: block; }
button { font: inherit; }
html { scroll-behavior: smooth; scroll-padding-top: 96px; }
body { background: var(--canvas); color: var(--ink); font: 17px/1.65 var(--sans); -webkit-font-smoothing: antialiased; }
::selection { background: var(--soft); color: var(--ink); }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: .22em; text-decoration-color: #9aaec0; }
a:hover { color: var(--ink); text-decoration-color: currentColor; }
a, button, summary { -webkit-tap-highlight-color: transparent; }
a:focus-visible, button:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 2px; }
h1, h2, h3 { color: var(--ink); font-weight: 600; line-height: 1.25; }
h1 { font-size: clamp(32px, 3.3vw, 40px); letter-spacing: -.025em; }
h2 { font-size: 26px; letter-spacing: -.015em; }
h3 { font-size: 19px; }
p { color: var(--muted); }
p + p { margin-top: 16px; }
strong { font-weight: 600; }
.page-width, .nav-shell { width: min(var(--width), calc(100% - var(--gutter) * 2)); margin-inline: auto; }
.section { padding-block: 48px 64px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.skip-link { position: fixed; top: -100px; left: 20px; padding: 10px 16px; background: var(--ink); color: white; z-index: 100; }
.skip-link:focus { top: 16px; }
.text-link { display: inline-flex; gap: 8px; align-items: center; font-size: 15px; font-weight: 500; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 16px; min-height: 44px; padding: 9px 16px; border: 1px solid var(--accent); border-radius: 4px; background: var(--accent); color: white; font-size: 15px; font-weight: 500; text-decoration: none; cursor: pointer; transition: background-color .15s; }
.button:hover { background: var(--ink); border-color: var(--ink); color: white; }
.button.secondary { color: var(--accent); background: var(--surface); border-color: var(--line); }
.button.secondary:hover { border-color: var(--accent); background: var(--soft); }
.actions, .hero-actions, .contact-row, .page-end-link { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: center; font-size: 15px; }

/* Shared navigation and footer. */
.site-header { position: sticky; top: 0; z-index: 20; background: var(--surface); border-bottom: 1px solid var(--line); }
.nav-shell { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 72px; }
.wordmark { color: var(--ink); font-size: 19px; font-weight: 600; text-decoration: none; white-space: nowrap; }
#primary-nav { display: flex; align-items: center; gap: 24px; font-size: 15px; }
#primary-nav > a { color: var(--ink); text-decoration: none; padding: 10px 0; border-bottom: 2px solid transparent; }
#primary-nav > a:hover, #primary-nav > [aria-current="page"] { color: var(--accent); border-color: var(--accent); }
#primary-nav .contact-link { color: var(--accent); }
.menu-toggle { display: none; align-items: center; gap: 12px; padding: 10px 0 10px 12px; color: var(--ink); background: transparent; border: 0; cursor: pointer; font-size: 15px; }
.site-footer { background: var(--surface); border-top: 1px solid var(--line); }
.footer-inner { display: grid; grid-template-columns: 1fr auto; gap: 16px 32px; align-items: center; padding-block: 24px; }
.footer-name { color: var(--ink); text-decoration: none; font-size: 16px; font-weight: 500; }
.site-footer p { font-size: 14px; margin-top: 2px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 12px 24px; font-size: 14px; }
.site-footer .footer-bottom { grid-column: 1 / -1; font-size: 13px; margin: 0; }

/* Home: identity, research introduction, current work, then recent papers. */
.home-page { padding-bottom: 56px; }
.hero { display: grid; grid-template-columns: minmax(0, 1fr) 260px; grid-template-areas: "identity photo" "intro photo" "actions photo"; column-gap: 64px; row-gap: 24px; padding-block: 48px 40px; align-items: start; }
.hero-identity { grid-area: identity; }
.hero h1 { font-size: clamp(36px, 4.1vw, 50px); }
.affiliation { margin-top: 12px; font-size: 16px; line-height: 1.5; }
.hero-intro { grid-area: intro; max-width: 68ch; font-size: 18px; line-height: 1.65; }
.hero-actions { grid-area: actions; }
.hero-image { grid-area: photo; align-self: center; overflow: hidden; border-radius: 5px; background: var(--soft); }
.hero-image img { width: 260px; height: 280px; object-fit: cover; object-position: center; }
.home-section { padding-top: 32px; margin-top: 32px; border-top: 1px solid var(--line); }
.hero + .home-section { margin-top: 0; }
.section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px 24px; margin-bottom: 20px; }
.section-heading > a { font-size: 15px; white-space: nowrap; }
.current-project { padding: 24px; border-left: 3px solid var(--accent); background: var(--soft); border-radius: 0 4px 4px 0; }
.project-heading { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 8px 16px; margin-bottom: 12px; }
.project-heading h3 { font-size: 21px; }
.project-heading h3 a { color: var(--ink); text-decoration: none; }
.project-heading h3 a:hover { text-decoration: underline; }
.current-project p { max-width: 86ch; color: var(--ink); }
.current-project .text-link { margin-top: 12px; }
.research-status { display: inline-block; flex-shrink: 0; font-size: 14px; line-height: 1.5; font-weight: 500; color: var(--accent); }
.biography { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 32px; }
.biography p { max-width: 73ch; }
.biography .text-link { margin-top: 12px; }

/* Compact page headers and section navigation. */
.page-heading { padding-block: 40px 28px; border-bottom: 1px solid var(--line); }
.page-heading .lead { max-width: 75ch; font-size: 18px; margin-top: 12px; }
.page-heading .actions, .page-heading .contact-row { margin-top: 20px; }
.jump-nav { display: flex; flex-wrap: wrap; gap: 8px 24px; margin-top: 24px; font-size: 15px; }
.jump-nav a { padding-block: 6px; }
.page-content { padding-block: 32px 0; }
.page-end-link { margin: 0 0 48px; }
.research-theme { padding-bottom: 36px; margin-bottom: 36px; border-bottom: 1px solid var(--line); }
.theme-heading { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 20px; }
.research-theme .question { max-width: 76ch; margin-top: 12px; color: var(--accent); font-size: 18px; font-weight: 500; }
.research-prose { max-width: 78ch; margin-top: 16px; }
.research-prose p { color: var(--ink); }
.refs-label { font-size: 16px; font-weight: 600; margin: 24px 0 16px; }

/* One citation component, shared across home, research, publications and CV. */
.publication-list { list-style: none; padding: 0; margin: 0; min-width: 0; }
.publication { padding: 20px 0; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.publication:first-child { border-top: 0; padding-top: 0; }
.publication:last-child { padding-bottom: 0; }
.pub-title { color: var(--ink); font-size: 18px; font-weight: 600; line-height: 1.4; text-decoration: none; }
a.pub-title:hover { color: var(--accent); text-decoration: underline; }
.pub-authors { font-size: 15px; line-height: 1.55; margin-top: 6px; }
.pub-authors strong { color: var(--ink); }
.pub-venue { font-size: 15px; line-height: 1.55; margin-top: 4px; }
.pub-note { margin-top: 4px; font-size: 14px; }
.pub-badge { display: block; color: var(--accent); font-size: 14px; font-weight: 500; margin-bottom: 8px; }
.pub-actions { display: flex; gap: 4px 20px; flex-wrap: wrap; align-items: start; margin-top: 8px; font-size: 14px; color: var(--accent); }
.pub-actions > a, .pub-actions summary { padding-block: 3px; }
.pub-actions details { max-width: 100%; }
.pub-actions details[open] { flex-basis: 100%; }
.pub-actions summary { cursor: pointer; list-style: none; width: fit-content; text-decoration: underline; text-decoration-color: #9aaec0; text-underline-offset: .22em; }
.pub-actions summary::-webkit-details-marker { display: none; }
.pub-actions summary::after { content: ' +'; margin-left: 4px; }
.pub-actions details[open] summary::after { content: ' −'; }
.pub-actions pre { white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-word; background: var(--surface); border: 1px solid var(--line); border-radius: 4px; padding: 16px; font: 13px/1.6 ui-monospace, SFMono-Regular, Consolas, monospace; max-width: 100%; color: var(--ink); margin: 12px 0 0; }
.reference-compact .publication { padding-block: 16px; }
.reference-compact .publication:first-child { padding-top: 0; }
.reference-compact .publication:last-child { padding-bottom: 0; }
.reference-compact .pub-title { font-size: 17px; }
.publications-wrap { padding-block: 32px 56px; }
.publication-section + .publication-section { margin-top: 36px; padding-top: 28px; border-top: 1px solid var(--line); }
.publication-section > h2 { margin-bottom: 24px; }
.year-group { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 24px; margin-bottom: 32px; }
.year-group:last-child { margin-bottom: 0; }
.year-label { color: var(--accent); font-size: 18px; font-weight: 500; }

/* CV and events: broad text column, dates above entries on narrow screens. */
.two-column { display: grid; grid-template-columns: 176px minmax(0, 1fr); gap: 40px; padding-block: 32px 56px; }
.side-nav { position: sticky; top: 104px; align-self: start; display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.side-nav a { padding: 5px 0 5px 12px; border-left: 1px solid var(--line); text-decoration: none; }
.side-nav a:hover { border-color: var(--accent); text-decoration: underline; }
.cv-section { margin-bottom: 36px; }
.cv-section:last-child { margin-bottom: 0; }
.cv-section h2 { margin-bottom: 24px; }
.timeline-row { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 20px; margin-bottom: 20px; }
.timeline-row:last-child { margin-bottom: 0; }
.timeline-row .date { font-size: 14px; color: var(--accent); line-height: 1.5; padding-top: 2px; }
.timeline-row h3 { font-size: 17px; line-height: 1.4; }
.timeline-row p { font-size: 15px; line-height: 1.55; margin: 4px 0 0; }
.cv-honor { color: var(--ink); font-weight: 500; }
.award-institution { font-size: 14px !important; }
.award-source { display: inline-flex; align-items: center; justify-content: center; min-width: 24px; min-height: 24px; vertical-align: middle; }
.cv-section .pub-title { font-size: 17px; }
.teaching-role { font-size: 15px; margin: -12px 0 20px; }
.talks-layout { padding-bottom: 56px; }
.talks-layout > .jump-nav { margin: 16px 0 32px; }
.talks-layout > div { max-width: 100%; }
.media-links { list-style: none; padding: 0; margin: 0; }
.media-links li + li { border-top: 1px solid var(--line); }
.media-links a { display: flex; justify-content: space-between; align-items: baseline; gap: 24px; padding-block: 16px; text-decoration: none; }
.media-links li:first-child a { padding-top: 0; }
.media-links h3 { font-size: 18px; color: var(--accent); }
.media-links a:hover h3 { text-decoration: underline; }
.media-links p { font-size: 15px; margin-top: 4px; }

@media (max-width: 1100px) {
  .two-column { display: block; }
  .side-nav { position: static; flex-direction: row; flex-wrap: wrap; gap: 6px 20px; padding-bottom: 24px; margin-bottom: 28px; border-bottom: 1px solid var(--line); }
  .side-nav a { border-left: 0; padding: 4px 0; text-decoration: underline; }
  .hero { column-gap: 40px; grid-template-columns: minmax(0, 1fr) 230px; }
  .hero-image img { width: 230px; height: 265px; }
}
@media (max-width: 880px) {
  .nav-shell { min-height: 64px; }
  .menu-toggle { display: flex; }
  #primary-nav { display: none; position: absolute; top: 100%; left: 0; right: 0; background: var(--surface); border-bottom: 1px solid var(--line); padding: 12px var(--gutter) 20px; box-shadow: 0 12px 18px #2334450a; }
  #primary-nav.is-open { display: flex; flex-direction: column; align-items: stretch; gap: 0; }
  #primary-nav > a { padding: 10px 12px; border: 0; border-radius: 3px; }
  #primary-nav > [aria-current="page"] { background: var(--soft); }
  .hero { column-gap: 28px; grid-template-columns: minmax(0, 1fr) 195px; row-gap: 20px; }
  .hero-image img { width: 195px; height: 230px; }
  .hero-intro { font-size: 17px; }
  .biography { grid-template-columns: 150px minmax(0, 1fr); gap: 24px; }
}
@media (max-width: 620px) {
  body { font-size: 16px; }
  h1 { font-size: 32px; }
  h2 { font-size: 24px; }
  .hero { grid-template-columns: minmax(0, 1fr) 88px; grid-template-areas: "identity photo" "intro intro" "actions actions"; gap: 20px 16px; padding-block: 32px; }
  .hero h1 { font-size: 34px; }
  .hero-image { align-self: start; margin-top: 4px; }
  .hero-image img { width: 88px; height: 110px; object-position: 46% center; }
  .affiliation { font-size: 15px; margin-top: 8px; }
  .hero-actions { gap: 12px 20px; }
  .home-section { margin-top: 28px; padding-top: 28px; }
  .home-page { padding-bottom: 40px; }
  .section-heading { align-items: start; flex-wrap: wrap; gap: 8px 20px; margin-bottom: 16px; }
  .current-project { padding: 20px; }
  .project-heading h3 { font-size: 20px; }
  .project-heading .research-status { order: -1; flex-basis: 100%; }
  .biography { grid-template-columns: 1fr; gap: 12px; }
  .page-heading { padding-block: 28px 24px; }
  .page-heading .lead, .research-theme .question { font-size: 17px; }
  .page-heading .actions, .page-heading .contact-row { margin-top: 16px; }
  .contact-row { gap: 4px 20px; overflow-wrap: anywhere; }
  .contact-row > a:first-child { flex-basis: 100%; }
  .page-heading .actions { gap: 12px; }
  .page-heading .button { font-size: 14px; padding-inline: 12px; }
  .jump-nav { gap: 4px 20px; margin-top: 16px; }
  .page-content, .two-column, .publications-wrap { padding-top: 28px; }
  .research-theme { padding-bottom: 28px; margin-bottom: 28px; }
  .research-prose { margin-top: 12px; }
  .pub-title { font-size: 17px; }
  .pub-authors, .pub-venue { font-size: 14px; }
  .pub-actions { gap: 4px 16px; }
  .pub-actions > a, .pub-actions summary { padding-block: 5px; }
  .year-group { grid-template-columns: 1fr; gap: 12px; }
  .publication-section > h2 { margin-bottom: 20px; }
  .cv-section { margin-bottom: 32px; }
  .cv-section h2 { margin-bottom: 20px; }
  .timeline-row { grid-template-columns: 1fr; gap: 4px; margin-bottom: 24px; }
  .timeline-row .date { padding: 0; }
  .side-nav { gap: 4px 20px; margin-bottom: 24px; padding-bottom: 20px; }
  .footer-inner { grid-template-columns: 1fr; gap: 16px; }
  .footer-links { gap: 12px 24px; }
  .site-footer .footer-bottom { grid-column: auto; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
@media print {
  @page { size: A4; margin: 16mm; }
  body { background: white; font-size: 10pt; color: #111; }
  .site-header, .site-footer, .skip-link, .side-nav, .jump-nav, .actions, .pub-actions, .page-end-link { display: none !important; }
  .page-width { width: 100%; max-width: none; }
  .page-heading { padding: 0 0 12pt; }
  .page-heading h1 { font-size: 26pt; }
  .page-heading .lead { font-size: 11pt; margin-top: 6pt; }
  .page-heading .contact-row { font-size: 9pt; margin-top: 6pt; display: block; }
  .two-column, .page-content, .publications-wrap, .talks-layout { display: block; padding: 16pt 0 0; }
  .cv-section { margin-bottom: 20pt; }
  .cv-section h2 { font-size: 16pt; margin-bottom: 12pt; break-after: avoid; }
  .refs-label, .year-label, .theme-heading { break-after: avoid; }
  .publication, .timeline-row { break-inside: avoid; }
  .timeline-row { grid-template-columns: 75pt 1fr; gap: 12pt; margin-bottom: 10pt; }
  .timeline-row h3 { font-size: 10.5pt; }
  .timeline-row p, .timeline-row .date, .award-institution { font-size: 9pt !important; }
  .pub-title { font-size: 10pt !important; }
  .pub-authors, .pub-venue { font-size: 9pt !important; }
  .pub-note, .pub-badge { font-size: 8pt; }
  .publication { padding-block: 9pt !important; }
  a, p { color: inherit !important; }
  h1, h2, h3, p { orphans: 3; widows: 3; }
}

/* Teaching grouped by institution, with the current research field first. */
.teaching-group .teaching-role { font-size: 14px; margin: 3px 0 6px; }
.teaching-courses { margin: 0; padding-left: 18px; color: var(--ink); font-size: 16px; line-height: 1.55; }
.earlier-teaching .earlier-courses { font-size: 14px; line-height: 1.65; }
.course-date { white-space: nowrap; }
@media print {
  .teaching-courses { font-size: 10pt; }
  .teaching-group .teaching-role, .earlier-teaching .earlier-courses { font-size: 9pt; }
}

.research-figure { max-width: 760px; margin: 24px 0 28px; }
.figure-image-link { display: block; background: white; border: 1px solid var(--line); border-radius: 4px; overflow: hidden; }
.research-figure img { width: 100%; height: auto; }
.research-figure figcaption { margin-top: 10px; font-size: 14px; line-height: 1.55; }
.figure-source { display: flex; flex-wrap: wrap; gap: 8px 24px; margin-top: 6px; }
.figure-credit { font-size: 13px; margin-top: 4px; }
@media print { .research-figure { break-inside: avoid; max-width: 120mm; } }
