:root {
  --bg: #fbfaf7;
  --surface: #ffffff;
  --text: #1c2430;
  --muted: #5b6573;
  --line: #e4e1da;
  --accent: #1f3a5f;
  --accent-soft: #e8eef6;
  --accent-text: #ffffff;
  --ok: #2f6b45;
  --ok-soft: #e5f1e9;
  --warn: #8a5a12;
  --warn-soft: #f7eedd;
  --serif: 'Source Serif 4', Georgia, 'Times New Roman', serif;
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --max: 1040px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12161c;
    --surface: #1a2029;
    --text: #e6e9ee;
    --muted: #9aa4b2;
    --line: #2a313c;
    --accent: #8fb3e0;
    --accent-soft: #1f2a3a;
    --accent-text: #0f1620;
    --ok: #8fd1a6;
    --ok-soft: #1c2d23;
    --warn: #e5c07b;
    --warn-soft: #2e2618;
    color-scheme: dark;
  }
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
}

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
}
h1 { font-size: clamp(2.1rem, 4.5vw, 3rem); margin: 0 0 0.6rem; }
h2 { font-size: 1.45rem; margin: 2.2rem 0 0.8rem; }

a { color: var(--accent); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }

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

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 20px; }

.skip {
  position: absolute; left: -9999px; top: 0;
  background: var(--accent); color: var(--accent-text); padding: 8px 12px;
}
.skip:focus { left: 8px; top: 8px; z-index: 10; }

.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

.muted { color: var(--muted); }
.small { font-size: 0.88rem; }

/* Header */
.site-header {
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  position: sticky; top: 0; z-index: 5;
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; min-height: 64px; flex-wrap: wrap;
}
.brand { text-decoration: none; color: var(--text); display: flex; flex-direction: column; line-height: 1.15; padding: 10px 0; }
.brand-name { font-family: var(--serif); font-weight: 700; font-size: 1.2rem; }
.brand-role { font-size: 0.75rem; color: var(--muted); letter-spacing: 0.06em; text-transform: uppercase; }
.site-header nav ul { list-style: none; display: flex; flex-wrap: wrap; gap: 4px 20px; margin: 0; padding: 0; }
.site-header nav a {
  color: var(--muted); text-decoration: none; font-size: 0.95rem; font-weight: 500;
  padding: 6px 0; border-bottom: 2px solid transparent;
}
.site-header nav a:hover { color: var(--text); }
.site-header nav a[aria-current="page"] { color: var(--text); border-bottom-color: var(--accent); }

/* Hero */
.hero { padding: 56px 0 24px; }
.hero-inner { display: grid; grid-template-columns: 1fr 300px; gap: 48px; align-items: center; }
.eyebrow { color: var(--accent); font-weight: 600; font-size: 0.85rem; letter-spacing: 0.05em; text-transform: uppercase; margin: 0 0 0.6rem; }
.lede { font-size: 1.15rem; color: var(--muted); max-width: 40em; margin: 0 0 1.2rem; }
.affil { list-style: none; padding: 0; margin: 0 0 1.6rem; font-size: 0.95rem; }
.affil li { padding-left: 14px; position: relative; }
.affil li::before { content: ''; position: absolute; left: 0; top: 0.7em; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.portrait { margin: 0; }
.portrait img {
  border-radius: 6px; aspect-ratio: 4 / 5; object-fit: cover; width: 100%;
  box-shadow: 0 1px 2px rgba(0,0,0,0.06), 0 12px 32px rgba(20, 30, 50, 0.12);
}

.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin: 0; }
.btn {
  display: inline-block; background: var(--accent); color: var(--accent-text);
  border: 1px solid var(--accent); border-radius: 4px;
  padding: 9px 18px; font: 500 0.95rem var(--sans); text-decoration: none; cursor: pointer;
}
.btn:hover { filter: brightness(1.1); }
.btn-ghost { background: transparent; color: var(--accent); }

/* Stats */
.stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 0;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  margin-top: 32px; padding-top: 20px; padding-bottom: 12px;
}
.stat { display: flex; flex-direction: column; padding: 0 4px; }
.stat-num { font-family: var(--serif); font-size: 2rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.stat-label { color: var(--muted); font-size: 0.85rem; }
.stat-note { grid-column: 1 / -1; color: var(--muted); font-size: 0.78rem; margin: 12px 0 0; }

/* Layout */
.two-col { display: grid; grid-template-columns: 1.6fr 1fr; gap: 56px; }
.two-col aside h2:first-child, .two-col > div > h2:first-child { margin-top: 2.2rem; }

.page-head { padding-top: 48px; }
.page-head .lede { margin-bottom: 0.5rem; }

.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.section-head a { font-size: 0.95rem; }

.tags { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.tags li { background: var(--accent-soft); color: var(--accent); border-radius: 999px; padding: 4px 12px; font-size: 0.85rem; font-weight: 500; }
.tags--small li { font-size: 0.78rem; padding: 2px 10px; }

.plain { list-style: none; padding: 0; margin: 0; }
.plain li { padding: 6px 0; border-bottom: 1px solid var(--line); }

.edu p { margin: 0; }
.edu-head { margin-bottom: 2px !important; }
.edu .small { margin-top: 6px; }

/* Publications */
.pubs { list-style: none; padding: 0; margin: 0; }
.pub { padding: 16px 0; border-bottom: 1px solid var(--line); }
.pub p { margin: 0; }
.pub-type {
  display: inline-block; font-size: 0.7rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 4px;
}
.pub-type--journal { color: var(--accent); }
.pub-title { font-family: var(--serif); font-size: 1.08rem; font-weight: 600; line-height: 1.4; }
.pub-title a { color: var(--text); }
.pub-authors { font-size: 0.92rem; margin-top: 4px !important; }
.pub-authors strong { color: var(--text); }
.pub-venue { font-size: 0.9rem; color: var(--muted); }

.year { font-size: 1.6rem; margin-top: 2.4rem; padding-bottom: 6px; border-bottom: 2px solid var(--text); }

.pub-filter { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 24px 0 8px; }
.pub-filter input, .pub-filter select {
  font: inherit; font-size: 0.95rem; color: var(--text); background: var(--surface);
  border: 1px solid var(--line); border-radius: 4px; padding: 8px 12px;
}
.pub-filter input { flex: 1 1 260px; min-width: 0; }
.pub-filter .clear { font-size: 0.9rem; }

/* Research themes */
.themes { margin-top: 16px; }
.theme { display: grid; grid-template-columns: 56px 1fr; gap: 16px; padding: 24px 0; border-bottom: 1px solid var(--line); }
.theme h2 { margin-top: 0; }
.theme p { margin-top: 0; max-width: 46em; }
.theme-num { font-family: var(--serif); font-size: 1.6rem; color: var(--accent); line-height: 1.3; }

/* Supervision */
.theses { list-style: none; padding: 0; margin: 16px 0 0; display: grid; gap: 16px; }
.thesis { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 20px 24px; }
.thesis-meta { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.thesis-student { margin: 8px 0 4px; font-size: 1.3rem; }
.thesis-title { margin: 0; font-weight: 500; }
.thesis-title-fr { margin: 2px 0 8px; color: var(--muted); font-style: italic; font-size: 0.93rem; }
.thesis .small { margin: 0; }
.badge { font-size: 0.72rem; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; border-radius: 999px; padding: 2px 10px; }
.badge--ongoing { background: var(--warn-soft); color: var(--warn); }
.badge--defended { background: var(--ok-soft); color: var(--ok); }

/* Affiliation logos */
.logos { list-style: none; padding: 0; margin: 28px 0 0; display: flex; flex-wrap: wrap; gap: 16px; }
.logos a {
  display: flex; align-items: center; justify-content: center;
  height: 88px; padding: 14px 24px;
  background: #ffffff; border: 1px solid var(--line); border-radius: 6px;
  transition: border-color 0.15s;
}
.logos a:hover { border-color: var(--accent); }
.logos img { height: 100%; width: auto; max-width: 260px; object-fit: contain; }

/* Contact */
.email { font-family: var(--serif); font-size: 1.3rem; }
address { font-style: normal; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); margin-top: 72px; padding: 24px 0 40px; font-size: 0.85rem; color: var(--muted); }
.footer-inner { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.footer-inner p { margin: 0; }
.site-footer a { color: var(--muted); }

/* Responsive */
@media (max-width: 820px) {
  .hero { padding-top: 32px; }
  .hero-inner { grid-template-columns: 1fr; gap: 28px; }
  .portrait { order: -1; max-width: 200px; }
  .two-col { grid-template-columns: 1fr; gap: 0; }
  .stats { grid-template-columns: repeat(2, 1fr); row-gap: 16px; }
  .logos a { height: 72px; padding: 12px 16px; }
}

@media (max-width: 520px) {
  body { font-size: 16px; }
  .wrap { padding: 0 16px; }
  .site-header { position: static; }
  .header-inner { padding-bottom: 8px; }
  .site-header nav ul { gap: 2px 16px; }
  .theme { grid-template-columns: 1fr; gap: 4px; }
  .thesis { padding: 16px; }
}
