:root {
  --bg: #ffffff;
  --text: #222222;
  --muted: #666666;
  --accent: #2a6496;
  --pill-bg: #e4f0fa;
  --pill-text: #2a5f8f;
  --rule: #e5e5e5;
  --p1-blue: #1e3a8a;
  --p1-gold: #c9a227;
  color-scheme: light;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", -apple-system, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.75;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--accent); text-underline-offset: 3px; }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Bande du haut (blanche) avec logo à gauche */
.topbar {
  background: var(--bg);
  border-bottom: 1px solid var(--rule);
}
.topnav {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
}
.brand {
  flex: 0 0 calc(240px + 3.5rem);
  display: flex;
  align-items: center;
  min-height: 48px;
}
.logo { display: block; height: 48px; width: auto; max-width: 220px; }
.navlinks a {
  font-size: 0.85rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  margin-right: 2rem;
  padding-bottom: 0.25rem;
  border-bottom: 2px solid transparent;
}
.navlinks a:hover { color: var(--text); }
.navlinks a[aria-current="page"] { color: var(--text); font-weight: 600; border-bottom-color: var(--p1-gold); }

/* Mise en page : colonne de gauche + contenu */
.layout {
  flex: 1;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 3.5rem;
  align-items: start;
}

/* Colonne de gauche */
.sidebar { text-align: center; position: sticky; top: 1.5rem; }
.avatar {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid #fff;
  box-shadow: 0 0 0 1px var(--rule), 0 2px 8px rgba(0, 0, 0, 0.12);
  display: block;
  margin: 0 auto 1rem;
}
.sidebar .who { font-size: 1.15rem; font-weight: 700; margin: 0; }
.sidebar .role { font-size: 0.9rem; color: var(--muted); margin: 0.15rem 0 0.6rem; }
.sidebar .aff { font-size: 0.75rem; color: var(--muted); line-height: 1.6; margin: 0 0 1rem; white-space: nowrap; }
.pills { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem; }
.pill {
  display: inline-block;
  background: var(--pill-bg);
  color: var(--pill-text);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
}
.pill:hover { background: #d3e6f6; }

.mail { font-size: 0.8rem; margin: 0 0 0.75rem; }
.social { display: inline-block; font-size: 0.85rem; }
.social-icon { display: block; height: 28px; width: auto; margin: 0 auto; }

/* Contenu */
main { min-width: 0; max-width: 52rem; }
main p { margin: 0 0 1.25rem; }
h1, h2 {
  font-weight: 600;
  font-size: 1.35rem;
  margin: 2.5rem 0 1.25rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--rule);
  position: relative;
}
h1:first-child, h2:first-child { margin-top: 0; }
h1::after, h2::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 48px;
  height: 2px;
  background: var(--accent);
}
h3 { font-size: 1.05rem; font-weight: 600; margin: 0 0 0.25rem; line-height: 1.5; }

h2.small { font-size: 1.05rem; margin-top: 2rem; }
.contact { font-size: 0.85rem; line-height: 1.6; color: var(--muted); }

.paper { margin-bottom: 2rem; }
.paper .meta { color: var(--muted); margin: 0 0 0.4rem; }
.paper .journal { margin: 0 0 0.4rem; }
.paper .authors { font-weight: 400; }
.paper .request { color: var(--muted); font-size: 0.95rem; margin: 0 0 0.4rem; }
.paper .links a { margin-right: 1rem; }
details summary { cursor: pointer; color: var(--text); }
details p { margin-top: 0.75rem; font-size: 0.9rem; line-height: 1.7; text-align: justify; hyphens: auto; }

.cv-frame {
  width: 100%;
  height: 85vh;
  border: none;
  background: #777;
  border-radius: 4px;
}

/* Bande du bas (blanche) */
.bottombar {
  background: var(--bg);
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 0.8rem;
  text-align: center;
  padding: 1rem 1.5rem;
}

/* Téléphone */
@media (max-width: 760px) {
  .topnav { flex-direction: column; gap: 0.75rem; padding: 0.75rem 1.25rem; }
  .brand { flex: none; justify-content: center; }
  .navlinks a { margin: 0 0.75rem; }
  .layout { grid-template-columns: 1fr; gap: 2rem; padding-top: 1.5rem; }
  .sidebar { position: static; }
  .pills { flex-direction: row; flex-wrap: wrap; justify-content: center; }
}
