/* ------------------------------------------------------------------
   Mouhamadou Lamine NDAO — personal academic page
   Blue background, white content card, navy + near-black text
------------------------------------------------------------------- */

:root {
  --navy: #003189;          /* CNAM navy */
  --blue: #1452c8;          /* links, accents */
  --blue-soft: #e8eefb;     /* tags, hover backgrounds */
  --ink: #1a1a1a;           /* body text */
  --muted: #5a6275;         /* secondary text */
  --line: #dde3ef;
  --card: #ffffff;
  --bg-1: #0a2a6b;
  --bg-2: #003189;
  --bg-3: #2f6fd6;
  --radius: 14px;
  --maxw: 1040px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 76px; }

body {
  margin: 0;
  font-family: "Source Sans 3", "Source Sans Pro", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink);
  background-color: var(--bg-2);
  background-image:
    radial-gradient(1200px 600px at 85% -10%, rgba(120, 170, 255, .35), transparent 60%),
    linear-gradient(160deg, var(--bg-1) 0%, var(--bg-2) 45%, var(--bg-3) 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Header ---------- */
.site-header {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 72px 20px 44px;
  text-align: center;
  color: #fff;
}
.site-header .photo {
  width: 148px; height: 148px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center 20%;
  border: 4px solid rgba(255,255,255,.85);
  box-shadow: 0 10px 30px rgba(0,0,0,.25);
}
.site-header h1 {
  font-family: "Source Serif 4", Georgia, serif;
  font-weight: 600;
  font-size: clamp(1.9rem, 4.5vw, 2.7rem);
  letter-spacing: .01em;
  margin: 22px 0 4px;
}
.site-header .role { font-size: 1.15rem; margin: 0; opacity: .95; }
.site-header .affil { margin: 2px 0 0; opacity: .8; }
.site-header .themes {
  margin: 18px auto 0;
  display: flex; flex-wrap: wrap; justify-content: center; gap: 8px;
  padding: 0; list-style: none;
}
.site-header .themes li {
  font-size: .9rem;
  padding: 4px 12px;
  border: 1px solid rgba(255,255,255,.45);
  border-radius: 999px;
}

.icons {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 10px;
  list-style: none; padding: 0; margin: 26px 0 0;
}
.icons a {
  display: inline-flex; align-items: center; gap: 8px;
  color: #fff;
  font-size: .92rem;
  padding: 7px 14px;
  border-radius: 999px;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.25);
  transition: background .2s;
}
.icons a:hover { background: rgba(255,255,255,.24); text-decoration: none; }
.icons a.cv { background: #fff; color: var(--navy); font-weight: 600; }
.icons a.cv:hover { background: #eaf0ff; }

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 10;
  padding: 10px 16px;
  background: rgba(0, 38, 120, .82);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.nav ul {
  max-width: max-content;
  margin: 0 auto;
  padding: 6px;
  list-style: none;
  display: flex; flex-wrap: wrap; justify-content: center; gap: 2px;
  background: rgba(255,255,255,.96);
  border-radius: 999px;
  box-shadow: 0 6px 24px rgba(0, 20, 70, .25);
}
.nav a {
  display: block;
  padding: 6px 16px;
  border-radius: 999px;
  color: var(--ink);
  font-size: .95rem;
  font-weight: 500;
}
.nav a:hover { background: var(--blue-soft); text-decoration: none; }
.nav a.active { background: var(--navy); color: #fff; }

/* ---------- Main card ---------- */
main {
  max-width: var(--maxw);
  margin: 22px auto 0;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(0, 15, 60, .35);
  overflow: hidden;
}
section {
  padding: 56px 64px;
  border-top: 1px solid var(--line);
}
section:first-child { border-top: 0; }

h2 {
  font-family: "Source Serif 4", Georgia, serif;
  color: var(--navy);
  font-size: 1.9rem;
  font-weight: 600;
  margin: 0 0 6px;
}
h2::after {
  content: "";
  display: block;
  width: 56px; height: 3px;
  margin-top: 10px;
  background: var(--blue);
  border-radius: 2px;
}
h3 {
  color: var(--navy);
  font-size: 1.15rem;
  margin: 34px 0 12px;
  text-transform: uppercase;
  letter-spacing: .06em;
  font-weight: 700;
}
.lead { color: var(--muted); margin: 14px 0 0; }

/* Bio */
.bio { display: grid; grid-template-columns: 1.6fr 1fr; gap: 44px; margin-top: 24px; }
.bio p { margin: 0 0 14px; text-align: justify; hyphens: auto; }
.facts {
  background: var(--blue-soft);
  border-radius: 12px;
  padding: 22px 24px;
  font-size: .95rem;
  align-self: start;
}
.facts dl { margin: 0; }
.facts dt { color: var(--navy); font-weight: 700; margin-top: 12px; }
.facts dt:first-child { margin-top: 0; }
.facts dd { margin: 2px 0 0; }
.bio p.keywords { margin-top: 6px; text-align: left; }
.keywords b { color: var(--navy); }

/* Research cards */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; margin-top: 26px; }
.card {
  border: 1px solid var(--line);
  border-top: 3px solid var(--blue);
  border-radius: 10px;
  padding: 18px 20px;
}
.card h4 { margin: 0 0 6px; color: var(--navy); font-size: 1.05rem; }
.card p { margin: 0; font-size: .95rem; color: var(--ink); }

/* Publications */
.pubs { list-style: none; padding: 0; margin: 0; counter-reset: none; }
.pubs li {
  display: grid; grid-template-columns: 64px 1fr; gap: 12px;
  padding: 12px 0;
  border-bottom: 1px dashed var(--line);
}
.pubs li:last-child { border-bottom: 0; }
.pubs .year { color: var(--navy); font-weight: 700; }
.pubs .title { font-weight: 600; color: var(--ink); }
.pubs .authors { color: var(--muted); }
.pubs .authors b { color: var(--ink); font-weight: 600; }
.pubs .venue { font-style: italic; }
.pubs .links a {
  display: inline-block;
  font-size: .8rem; font-weight: 600;
  padding: 1px 9px; margin: 4px 6px 0 0;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--navy);
}
.pubs .links a:hover { background: var(--navy); color: #fff; text-decoration: none; }
.badge {
  font-size: .72rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: #fff; background: var(--blue);
  padding: 1px 8px; border-radius: 4px; margin-left: 6px; vertical-align: 2px;
}
.note { color: var(--muted); font-size: .95rem; margin-top: 20px; }

/* Timeline (teaching, experience) */
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline > li {
  display: grid; grid-template-columns: 150px 1fr; gap: 20px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
.timeline > li:last-child { border-bottom: 0; }
.timeline .when { color: var(--navy); font-weight: 700; font-size: .95rem; }
.timeline .what h4 { margin: 0; font-size: 1.05rem; color: var(--ink); }
.timeline .what .where { color: var(--blue); font-weight: 500; }
.timeline .what p { margin: 6px 0 0; }
.timeline .what ul { margin: 8px 0 0; padding-left: 20px; }
.timeline .what li { margin: 3px 0; }
.code { font-weight: 700; color: var(--navy); }

/* Contact */
.contact { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; margin-top: 24px; }
.contact div { background: var(--blue-soft); border-radius: 10px; padding: 18px 20px; }
.contact b { display: block; color: var(--navy); }

/* Footer */
footer {
  text-align: center;
  color: rgba(255,255,255,.8);
  font-size: .9rem;
  padding: 34px 16px 44px;
}
footer a { color: #fff; }

/* ---------- Responsive ---------- */
@media (max-width: 820px) {
  section { padding: 40px 22px; }
  .bio { grid-template-columns: 1fr; gap: 24px; }
  .timeline > li { grid-template-columns: 1fr; gap: 4px; }
  .pubs li { grid-template-columns: 1fr; gap: 2px; }
  main { margin: 8px 12px 0; }
  .site-header { padding-top: 48px; }
  .nav a { padding: 5px 11px; font-size: .88rem; }
}
sup { line-height: 0; }

/* ---------- Langue FR / EN ---------- */
html[data-lang="fr"] .en,
html[data-lang="en"] .fr { display: none !important; }

.lang-toggle {
  margin-left: 6px;
  padding: 6px 14px;
  border: 0;
  border-radius: 999px;
  background: var(--navy);
  color: #fff;
  font: inherit;
  font-size: .9rem;
  font-weight: 700;
  letter-spacing: .05em;
  cursor: pointer;
}
.lang-toggle:hover { background: var(--blue); }

.timeline .what .tools { color: var(--muted); font-size: .92rem; }
.timeline .what ul li { margin: 8px 0; }

/* ---------- Publications repliables ---------- */
.pub-group { margin-top: 26px; }
.pub-group > summary {
  list-style: none;
  cursor: pointer;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 0;
  border-bottom: 2px solid var(--blue-soft);
}
.pub-group > summary::-webkit-details-marker { display: none; }
.pub-group > summary h3 { margin: 0; }
.pub-group > summary .count {
  font-size: .8rem; font-weight: 700;
  color: var(--navy); background: var(--blue-soft);
  padding: 1px 9px; border-radius: 999px;
}
.pub-group > summary::after {
  content: "";
  margin-left: auto;
  width: 9px; height: 9px;
  border-right: 2px solid var(--navy); border-bottom: 2px solid var(--navy);
  transform: rotate(45deg); transition: transform .2s;
}
.pub-group[open] > summary::after { transform: rotate(-135deg); }
.pub-group > summary:hover h3 { color: var(--blue); }
.pub-group .pubs { margin-top: 6px; }

/* ---------- Outils en pastilles ---------- */
.timeline .what .tools { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; align-items: center; }
.tools-label { font-size: .82rem; color: var(--muted); margin-right: 2px; }
.chip {
  font-size: .8rem; font-weight: 500;
  color: var(--navy); background: var(--blue-soft);
  padding: 2px 10px; border-radius: 999px;
  max-width: 100%;
}

/* ---------- Mobile : en-tête compact, menu sur une ligne ---------- */
@media (max-width: 820px) {
  .site-header { padding: 32px 16px 24px; }
  .site-header .photo { width: 96px; height: 96px; border-width: 3px; }
  .site-header h1 { margin-top: 14px; font-size: 1.7rem; }
  .site-header .role { font-size: 1rem; }
  .site-header .affil { font-size: .9rem; }
  .site-header .themes { display: none; }
  .icons { gap: 6px; margin-top: 18px; }
  .icons a { padding: 5px 11px; font-size: .85rem; }

  .nav { padding: 8px 0; }
  .nav ul {
    max-width: none;
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    scrollbar-width: none;
    margin: 0 12px;
    border-radius: 999px;
  }
  .nav ul::-webkit-scrollbar { display: none; }
  .nav li { flex: 0 0 auto; }
  .nav li:last-child { position: sticky; right: 0; background: rgba(255,255,255,.96); padding-left: 4px; border-radius: 999px; }
  html { scroll-padding-top: 64px; }
}
