:root {
  --text: #1b1f23;
  --muted: #616b74;
  --accent: #1d3557;
  --rule: #e2e4e8;
  --bg: #fbfbfa;
  --sans: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* Type scale — five sizes, used everywhere, nothing in between */
  --fs-xs: 13px;   /* nav, meta, footer, small UI labels */
  --fs-base: 17px; /* body copy, list items, entry titles */
  --fs-md: 18px;   /* h3, blog list titles — one step up from body */
  --fs-lede: 19px; /* intro paragraph only */
  --fs-h1: 24px;   /* page title */
}

* { 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: var(--fs-base);
  line-height: 1.65;
}

.page {
  max-width: 700px;
  margin: 0 auto;
  padding: 0 24px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 20px;
  padding: 36px 0 18px;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 40px;
}

.site-logos {
  display: flex;
  align-items: center;
  gap: 22px;
}

.site-logos > span { border-bottom: none; line-height: 0; }
.site-logos img { display: block; width: auto; }
.site-logos .logo-fair { height: 16px; }
.site-logos .logo-enpc { height: 50px; }
.site-logos > span + span { padding-left: 22px; border-left: 1px solid var(--rule); }

.site-nav {
  font-family: var(--mono);
  font-size: var(--fs-xs);
  display: flex;
  gap: 20px;
}

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

.site-nav a:hover,
.site-nav a.active {
  color: var(--text);
  border-bottom-color: var(--accent);
}

/* Main content */
.content {
  flex: 1;
}

h1, h2, h3 {
  font-family: var(--mono);
  font-weight: 600;
  line-height: 1.3;
  color: var(--text);
  letter-spacing: -0.01em;
}

h1 { font-size: var(--fs-h1); margin: 0 0 6px; }
h1.home-name { font-family: var(--sans); font-size: 32px; letter-spacing: -0.02em; margin: -14px 0 18px; }
h2 { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: 0.06em; margin: 40px 0 14px; padding-bottom: 6px; border-bottom: 1px solid var(--rule); }
h3 { font-size: var(--fs-md); margin: 24px 0 6px; }

p { margin: 0 0 16px; }

a { color: var(--accent); text-decoration: none; border-bottom: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); }
a:hover { border-bottom-color: var(--accent); }

ul, ol { padding-left: 1.2em; margin: 0 0 16px; }
li { margin-bottom: 6px; }

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

/* Travel photo grid (Outside of Research) */
.photo-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin: 20px 0 4px;
}
.photo-grid figure, .photo-solo {
  margin: 0;
}
.photo-grid img, .photo-solo img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--rule);
}
.photo-grid figcaption, .photo-solo figcaption {
  font-family: var(--mono);
  font-size: var(--fs-xs);
  color: var(--muted);
  margin-top: 6px;
}
.photo-solo {
  width: calc(50% - 10px);
  margin: 16px 0 4px;
}
@media (max-width: 520px) {
  .photo-grid { grid-template-columns: 1fr; }
  .photo-solo { width: 100%; }
}

/* Home / intro */
.intro {
  display: flex;
  gap: 28px;
  align-items: flex-start;
  margin-bottom: 8px;
}

.intro-photo {
  width: 168px;
  text-align: center;
}

.intro-photo img {
  width: 168px;
  height: 168px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--rule);
}

.intro-photo .tagline {
  font-family: var(--mono);
  font-size: var(--fs-xs);
  color: var(--accent);
  margin: 10px 0 0;
}

.intro-text { flex: 1; min-width: 0; }

.links-row {
  font-family: var(--mono);
  font-size: var(--fs-xs);
  margin: 10px 0 0;
  color: var(--muted);
}

.links-row a { margin-right: 14px; }

/* Lists: publications, experience, education */
.entry {
  margin-bottom: 20px;
}

.entry-title {
  font-size: var(--fs-base);
  font-weight: 600;
  margin: 0 0 2px;
}

.entry-logo {
  height: 38px;
  width: auto;
  vertical-align: middle;
  margin-left: 8px;
  margin-top: -2px;
}

.entry-meta {
  font-family: var(--mono);
  font-size: var(--fs-xs);
  color: var(--muted);
  margin: 0 0 4px;
}

.highlight-note {
  font-style: italic;
  font-weight: 400;
  color: var(--accent);
}

.entry-venue {
  font-family: var(--mono);
  font-size: var(--fs-xs);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
}

.pub {
  margin-bottom: 24px;
  padding: 20px 24px 22px;
  border: 1px solid color-mix(in srgb, var(--text) 18%, var(--rule));
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}
.pub:last-child { margin-bottom: 0; }

/* Wide enough to fit the three animation panels at a legible size without
   wrapping or shrinking too far — a deliberate breakout past the page's
   own edge, but still a normal bordered card, not a full-viewport hero. */
.pub-wide {
  margin-left: -220px;
  margin-right: -220px;
}

.pub-figure {
  display: block;
  max-width: 100%;
  height: 260px;
  width: auto;
  margin: 14px auto 4px;
  background: var(--bg);
}

/* Live e-means animation widget */
.widget-wrap {
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: 18px;
  background: var(--bg);
  margin: 32px 0 4px;
}
.widget-wrap .anim-row {
  display: flex;
  gap: 24px;
  flex-wrap: nowrap;
  justify-content: center;
}
.widget-wrap .anim-row > div { min-width: 0; }
.widget-wrap .anim-row canvas {
  display: block;
  border-radius: 4px;
  max-width: 100%;
  height: auto;
}
.widget-wrap .panel-title {
  font-family: var(--sans);
  font-weight: 700;
  font-size: 13px;
  margin-bottom: 6px;
}
.widget-wrap .panel-title.ours { color: var(--accent); }
.widget-wrap .readout {
  font-family: var(--sans);
  font-size: 12px;
  color: var(--muted);
  margin-top: 8px;
}
.widget-wrap .controls {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  justify-content: center;
}
.widget-wrap .controls input[type=range] { flex: 0 0 320px; max-width: 70%; }

.pub-authors { color: var(--muted); font-size: var(--fs-base); }
.pub-authors .me { color: var(--text); font-weight: 600; }

/* Blog list */
.post-list { list-style: none; padding: 0; }
.post-list li {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid var(--rule);
}
.post-list a { color: var(--text); border-bottom: none; font-size: var(--fs-md); }
.post-list a:hover { color: var(--accent); }
.post-list time {
  font-family: var(--mono);
  font-size: var(--fs-xs);
  color: var(--muted);
  white-space: nowrap;
  padding-top: 3px;
}

.post-meta {
  font-family: var(--mono);
  font-size: var(--fs-xs);
  color: var(--muted);
  margin: 0 0 28px;
}

.back-link { margin-top: 40px; font-family: var(--mono); font-size: var(--fs-xs); }

/* CV page */
.cv-download {
  display: inline-block;
  font-family: var(--mono);
  font-size: var(--fs-xs);
  border: 1px solid var(--text);
  padding: 8px 16px;
  border-radius: 4px;
  margin: 8px 0 28px;
}
.cv-download:hover { background: var(--text); color: var(--bg); border-bottom: 1px solid var(--text); }

embed.cv-embed {
  width: 100%;
  height: 90vh;
  border: 1px solid var(--rule);
  border-radius: 4px;
}

/* Footer */
.site-footer {
  font-family: var(--mono);
  font-size: var(--fs-xs);
  color: var(--muted);
  padding: 40px 0 48px;
  margin-top: 40px;
}

@media (max-width: 520px) {
  body { font-size: var(--fs-base); }
  .site-header { padding-top: 32px; }
  .intro { flex-direction: column; }
  .intro-photo img { width: 128px; height: 128px; }
  .pub-figure { height: auto; width: 100%; }
  .pub-wide { margin-left: 0; margin-right: 0; }
}
