:root {
  /* -- Colors -------------------------------------------------------- */
  --bg: #ffffff;
  --text: #1c1c1a;
  --text-muted: #5c5c57;
  --text-faint: #8a8a83;
  --rule: #e3e2dc;
  --rule-strong: #c9c8c0;
  --accent: #33506f;       /* bleu ardoise sobre, utilise pour les liens/tabs actifs */
  --accent-soft: #eef2f5;  /* fond tres leger derriere les tags/venues */

  /* -- Typo ------------------------------------------------------ */
  --font-serif: Georgia, 'Iowan Old Style', 'Palatino Linotype', 'Book Antiqua', serif;
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* -- Scale -------------------------------------------------- */
  --content-width: 720px;
  --space-1: 0.4rem;
  --space-2: 0.8rem;
  --space-3: 1.4rem;
  --space-4: 2.4rem;
  --space-5: 4rem;
}

* {
  box-sizing: border-box;
}

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

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

/* Respecte les gens qui desactivent les animations */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* Focus clavier visible partout (accessibilite) */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}
a:hover {
  border-bottom-color: currentColor;
}

.wrap {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0 var(--space-3);
}

/* ==========================================================================
   Header and navigation
   ========================================================================== */

.site-header {
  border-bottom: 1px solid var(--rule);
  padding: var(--space-4) 0 0 0;
}

.identity {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.identity img.avatar {
  width: 140px;
  height: 140px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
}

.identity h1 {
  font-family: var(--font-serif);
  font-size: 1.7rem;
  font-weight: 600;
  margin: 0 0 0.2rem 0;
  letter-spacing: 0.01em;
}

.identity .tagline {
  color: var(--text-muted);
  font-size: 0.98rem;
  margin: 0;
}

nav.tabs {
  display: flex;
  gap: var(--space-4);
  flex-wrap: wrap;
}

nav.tabs a {
  display: inline-block;
  padding: var(--space-2) 0;
  color: var(--text-muted);
  font-size: 0.95rem;
  border-bottom: 2px solid transparent;
}

nav.tabs a:hover {
  color: var(--text);
  border-bottom-color: var(--rule-strong);
}

nav.tabs a[aria-current="page"] {
  color: var(--text);
  font-weight: 600;
  border-bottom-color: var(--accent);
}

/* ==========================================================================
   Main Content
   ========================================================================== */

main {
  padding: var(--space-5) 0;
  min-height: 50vh;
}

main h2 {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 600;
  margin: var(--space-5) 0 var(--space-3) 0;
}
main section:first-of-type h2 {
  margin-top: 0;
}

main p {
  margin: 0 0 var(--space-3) 0;
}

.lede {
  font-size: 1.05rem;
  color: var(--text);
}

ul.plain {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* ==========================================================================
   Items
   ========================================================================== */

.quick-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-3);
  margin: var(--space-3) 0;
  padding: 0;
  list-style: none;
  font-size: 0.95rem;
}
.quick-links li::after {
  content: "";
}

/* ==========================================================================
   News
   ========================================================================== */

.news-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--rule);
}

.news-item {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: var(--space-3);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--rule);
}

.news-item time {
  color: var(--text-faint);
  font-size: 0.85rem;
  font-family: var(--font-mono);
  white-space: nowrap;
  padding-top: 0.15rem;
}

.news-item p {
  margin: 0;
}

/* ==========================================================================
   Infos
   ========================================================================== */

.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
}

.timeline li {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: var(--space-3);
  padding: var(--space-1) 0;
  font-size: 0.95rem;
}

.timeline .when {
  color: var(--text-faint);
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

/* ==========================================================================
   Publications
   ========================================================================== */

.pub-year {
  color: var(--text-faint);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  margin: 0;
  letter-spacing: 0.04em;
}

.pub-entry {
  display: grid;
  grid-template-columns: 56px 144px 1fr;
  align-items: start;
  gap: var(--space-3);
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--rule);
}

.pub-entry .thumb {
  width: 144px;
  height: 108px;
  object-fit: cover;
  border-radius: 3px;
  background: var(--accent-soft);
  border: 1px solid var(--rule);
}

.pub-entry h3 {
  font-size: 1.02rem;
  font-weight: 600;
  margin: 0 0 0.3rem 0;
  line-height: 1.35;
}

.pub-entry .authors {
  font-size: 0.92rem;
  color: var(--text-muted);
  margin: 0 0 0.25rem 0;
}

.pub-entry .authors .me {
  color: var(--text);
  font-weight: 600;
}

.pub-entry .venue {
  display: inline-block;
  font-size: 0.8rem;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 0.1rem 0.5rem;
  border-radius: 3px;
  margin: 0 0 0.4rem 0;
}

.pub-entry .summary {
  font-size: 0.92rem;
  color: var(--text-muted);
  margin: 0.3rem 0;
}

.pub-entry .links {
  font-size: 0.88rem;
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  margin-top: 0.3rem;
}

.bibtex-btn {
  font: inherit;
  color: var(--accent);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  border-bottom: 1px solid transparent;
}
.bibtex-btn:hover { border-bottom-color: currentColor; }

/* ==========================================================================
   Talks
   ========================================================================== */

.talk-entry {
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--rule);
}

.talk-entry h3 {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 0.25rem 0;
}

.talk-entry .meta {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin: 0 0 0.3rem 0;
}

.talk-entry .meta .place {
  color: var(--text-faint);
}

/* ==========================================================================
   Contact
   ========================================================================== */

.contact-grid {
  display: grid;
  grid-template-columns: 140px 1fr;
  row-gap: var(--space-2);
  font-size: 0.98rem;
  max-width: 480px;
}

.contact-grid dt {
  color: var(--text-faint);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding-top: 0.15rem;
}

.contact-grid dd {
  margin: 0;
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
  border-top: 1px solid var(--rule);
  padding: var(--space-3) 0 var(--space-5) 0;
  color: var(--text-faint);
  font-size: 0.85rem;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 560px) {
  body { font-size: 16px; }

  .identity {
    flex-direction: column;
    align-items: flex-start;
  }

  nav.tabs {
    gap: var(--space-3);
  }

  .news-item,
  .timeline li {
    grid-template-columns: 1fr;
    gap: 0.2rem;
  }

  .pub-entry {
    grid-template-columns: 1fr;
  }
  .pub-entry .pub-year {
    order: -1;
  }
  .pub-entry .thumb {
    width: 100%;
    height: 140px;
  }

  .contact-grid {
    grid-template-columns: 1fr;
    row-gap: var(--space-1);
  }
  .contact-grid dt {
    margin-top: var(--space-2);
  }
}