:root {
  --black: #111;
  --gray-dark: #444;
  --gray: #6b6b6b;
  --gray-light: #8a8a8a;
  --border: #ddd;
  --bg: #fafaf8;
  --white: #fff;
  --accent: #1a4a8a;
}

html.dark-mode {
  --black: #f0f0ee;
  --gray-dark: #ccc;
  --gray: #999;
  --gray-light: #8a8a8a;
  --border: #3a3a3a;
  --bg: #121212;
  --white: #1e1e1e;
  --accent: #66a1ff;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  background: var(--bg);
  color: var(--black);
  font-family: 'IBM Plex Sans', Helvetica, Arial, sans-serif;
  font-weight: 300;
  font-size: 15px;
  line-height: 1.7;
  transition: background 0.3s, color 0.3s;
  /* Le pied de page reste en bas même si une section est courte */
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── NAVBAR ── */
header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 0 3rem;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background 0.3s, border-color 0.3s;
}

.nav-name {
  font-family: 'EB Garamond', Georgia, serif;
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--black);
  text-decoration: none;
  white-space: nowrap;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

nav ul {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.1rem;
}

nav ul a {
  display: block;
  color: var(--gray);
  text-decoration: none;
  font-size: 0.8rem;
  padding: 0.35rem 0.75rem;
  border-radius: 3px;
  transition: color 0.15s, background 0.15s;
  white-space: nowrap;
  font-weight: 300;
}
nav ul a:hover { color: var(--black); background: var(--border); }
nav ul a.active { color: var(--black); font-weight: 500; background: var(--border); }

.burger-btn {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--black);
  padding: 0.5rem;
}

.controls {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.btn-toggle {
  background: var(--bg);
  color: var(--black);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.2rem 0.6rem;
  font-size: 0.75rem;
  cursor: pointer;
  font-family: 'IBM Plex Mono', monospace;
  transition: all 0.2s;
}
.btn-toggle:hover {
  background: var(--border);
}

.goog-te-banner-frame { display: none !important; }
body { top: 0px !important; }
.skiptranslate > iframe { display: none !important; }
#google_translate_element { display: none !important; }
.goog-tooltip { display: none !important; }
.goog-tooltip:hover { display: none !important; }
.VIpgJd-ZVi9od-ORHb-OEVmcd, .VIpgJd-ZVi9od-aZ2wEe-wOHMyf, .VIpgJd-yAWNEb-L7lbkb { display: none !important; }
.goog-text-highlight { background-color: transparent !important; border: none !important; box-shadow: none !important; }

/* ── MAIN ── */
main {
  flex: 1;
  width: 100%;
  max-width: 780px;
  margin: 0 auto;
  padding: 5rem 2rem 4rem;
}

/* ── SECTIONS (une seule visible à la fois) ── */
section {
  display: none;
  padding: 3rem 0;
}
section.visible {
  display: block;
  animation: fadeIn 0.3s ease;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}

.section-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--gray-light);
  margin-bottom: 1.8rem;
}

h2 {
  font-family: 'EB Garamond', Georgia, serif;
  font-size: 1.6rem;
  font-weight: 500;
  color: var(--black);
  margin-bottom: 1.5rem;
  line-height: 1.2;
}

p {
  color: var(--gray-dark);
  margin-bottom: 1rem;
}
p:last-child { margin-bottom: 0; }

/* ── HERO ── */
.hero-title {
  font-family: 'EB Garamond', Georgia, serif;
  font-size: 2.8rem;
  font-weight: 400;
  line-height: 1.15;
  margin-bottom: 0.8rem;
}
.hero-title em { font-style: italic; color: var(--gray-dark); }

.hero-meta {
  font-size: 0.82rem;
  color: var(--gray);
  margin: 1.4rem 0 1.6rem;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.8rem;
}
.tag {
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 0.25rem 0.7rem;
  font-size: 0.77rem;
  color: var(--gray-dark);
  background: var(--white);
}

/* ── CV ── */
.cv-block { margin-bottom: 2.5rem; }
.cv-block:last-child { margin-bottom: 0; }

.block-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--gray-light);
  margin-bottom: 1rem;
}

.entry {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 0 1.5rem;
  margin-bottom: 1.4rem;
}
.entry:last-child { margin-bottom: 0; }

.entry-date {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.72rem;
  color: var(--gray-light);
  padding-top: 0.15rem;
}
.entry-title { font-size: 0.9rem; font-weight: 400; margin-bottom: 0.15rem; }
.entry-sub { font-size: 0.82rem; color: var(--gray); line-height: 1.55; }

.icon {
  vertical-align: -3px;
  margin-right: 4px;
  stroke-width: 2;
}

.dl-link {
  display: inline-block;
  margin-top: 0.35rem;
  font-size: 0.78rem;
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s;
}
.dl-link:hover { border-color: var(--accent); }

.link-small {
  display: inline-block;
  margin-top: 2rem;
  font-size: 0.8rem;
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s;
}
.link-small:hover { border-color: var(--accent); }

/* ── ACCORDEONS (Abstracts) ── */
details.abstract-accordion {
  margin-top: 0.8rem;
  font-size: 0.85rem;
  color: var(--gray-dark);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
}
details.abstract-accordion summary {
  cursor: pointer;
  padding: 0.5rem 0.8rem;
  font-weight: 500;
  color: var(--black);
  list-style: none;
  user-select: none;
  transition: background 0.2s;
}
details.abstract-accordion summary:hover {
  background: var(--border);
}
details.abstract-accordion summary::-webkit-details-marker {
  display: none;
}
details.abstract-accordion summary::before {
  content: '▸';
  display: inline-block;
  margin-right: 0.5rem;
  transition: transform 0.2s ease;
}
details.abstract-accordion[open] summary::before {
  transform: rotate(90deg);
}
.abstract-content {
  padding: 0.8rem;
  border-top: 1px dashed var(--border);
  line-height: 1.6;
}

/* ── RESEARCH ── */
.theme {
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}
.theme:last-of-type { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.theme h3 {
  font-family: 'EB Garamond', Georgia, serif;
  font-size: 1.1rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
}

/* ── PUBLICATIONS ── */
.pub-item {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px dashed var(--border);
}
.pub-item:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}
.pub-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 0.2rem;
}
.pub-title {
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--black);
  line-height: 1.4;
}
.pub-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: var(--gray);
  margin-bottom: 0.8rem;
}
.pub-journal {
  font-style: italic;
}
.pub-links {
  display: flex;
  gap: 1.2rem;
}
.pub-links a {
  color: var(--gray);
  text-decoration: none;
  display: flex;
  align-items: center;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.75rem;
  text-transform: uppercase;
  gap: 0.3rem;
  transition: color 0.15s;
}
.pub-links a:hover {
  color: var(--accent);
}

@media (max-width: 600px) {
  .pub-header, .pub-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.4rem;
  }
  .pub-meta { margin-bottom: 1rem; gap: 0.8rem; }
  .pub-header .dl-link { margin-top: 0; }
}

/* ── ANNONCES ── */
.annonces {
  background: var(--white);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 4px;
  padding: 1.1rem 1.3rem;
  margin-bottom: 2.5rem;
}
.annonces-titre {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  margin-bottom: 0.9rem;
}
.annonce {
  padding: 0.7rem 0;
  border-top: 1px dashed var(--border);
}
.annonces-titre + .annonce { border-top: none; padding-top: 0; }
.annonce:last-child { padding-bottom: 0; }
.annonce-meta {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 0.25rem;
}
.annonce-cours {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.7rem;
  font-weight: 400;
  color: var(--black);
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 0.05rem 0.45rem;
}
.annonce-date {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.7rem;
  color: var(--gray-light);
}
.annonce-texte {
  font-size: 0.9rem;
  color: var(--black);
}

/* ── TABLE ── */
.teach-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1.5rem;
  margin-bottom: 2.5rem;
}
.teach-table th {
  text-align: left;
  padding: 0.5rem 2rem 0.8rem 0;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--gray-light);
  border-bottom: 1px solid var(--border);
  font-weight: 400;
}
.teach-table td {
  padding: 1.1rem 2rem 1.1rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.88rem;
  color: var(--gray-dark);
}
.teach-table td:first-child { color: var(--black); }
.teach-table tr:last-child td { border-bottom: none; }
.teach-table .mono {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.72rem;
  color: var(--gray);
}
.teach-table a {
  color: var(--accent);
  text-decoration: none;
  font-size: 0.78rem;
}
.teach-table a:hover { text-decoration: underline; }

/* ── TALKS ── */
.talk {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 0 1.5rem;
  margin-bottom: 1.4rem;
}
.talk:last-child { margin-bottom: 0; }
.talk-date {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.72rem;
  color: var(--gray-light);
  padding-top: 0.15rem;
}
.talk-title { font-size: 0.9rem; margin-bottom: 0.15rem; }
.talk-where { font-size: 0.8rem; color: var(--gray); }
.badge {
  display: inline-block;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.67rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--gray);
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 0.1rem 0.4rem;
  margin-left: 0.4rem;
  vertical-align: middle;
}
.badge-upcoming {
  color: var(--accent);
  border-color: var(--accent);
}

/* ── CONTACT ── */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 3rem;
  margin-top: 1.5rem;
}
.contact-item { margin-bottom: 1.4rem; }
.contact-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--gray-light);
  margin-bottom: 0.25rem;
}
.contact-value { font-size: 0.88rem; color: var(--gray-dark); }
.contact-value a { color: var(--accent); text-decoration: none; }
.contact-value a:hover { text-decoration: underline; }

/* ── PLACEHOLDER ── */
.placeholder {
  display: inline-block;
  font-style: italic;
  color: var(--gray-light);
  font-size: 0.85rem;
  border: 1px dashed var(--border);
  border-radius: 3px;
  padding: 0.6rem 1rem;
  margin-top: 0.5rem;
}

/* ── FOOTER ── */
footer {
  text-align: center;
  padding: 2rem;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.72rem;
  color: var(--gray-light);
  border-top: 1px solid var(--border);
}

/* ── RESPONSIVE & MENU BURGER ── */
@media (max-width: 900px) {
  header { padding: 0 1.5rem; }
  .burger-btn { display: block; }
  .header-right {
    display: none;
    position: absolute;
    top: 56px;
    left: 0;
    right: 0;
    background: var(--white);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    align-items: flex-start;
    padding: 1rem 1.5rem;
    gap: 1.5rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
  }
  .header-right.open {
    display: flex;
  }
  nav { width: 100%; }
  nav ul { flex-direction: column; align-items: flex-start; gap: 0; }
  nav ul li { width: 100%; }
  nav ul a {
    padding: 0.8rem 0;
    border-bottom: 1px solid var(--border);
    border-radius: 0;
    font-size: 0.9rem;
  }
  nav ul a.active { background: none; }
  nav ul li:last-child a { border-bottom: none; }
  .controls { width: 100%; justify-content: flex-start; }
}
@media (max-width: 700px) {
  main { padding: 5rem 1.2rem 3rem; }
  .entry, .talk { grid-template-columns: 90px 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
}

/* ── CERCLE TRIGONOMÉTRIQUE ── */
:root { --trig-cos: #1a4a8a; --trig-sin: #c2410c; --trig-tan: #2f7d4f; }
html.dark-mode { --trig-cos: #66a1ff; --trig-sin: #ff9b5e; --trig-tan: #5cc98a; }

.trigo {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1.2rem 1.3rem;
  margin: 1.5rem 0 2.5rem;
}
.trigo-intro { font-size: 0.85rem; color: var(--gray-dark); margin-bottom: 1rem; }
.trigo-intro strong { color: var(--black); font-weight: 500; }
.trigo-body { display: grid; grid-template-columns: minmax(0, 1fr) 15rem; gap: 1.5rem; align-items: center; }
.trigo svg { width: 100%; max-width: 380px; touch-action: none; user-select: none; -webkit-user-select: none; cursor: pointer; display: block; margin: 0 auto; }
.trigo svg:focus { outline: none; }
.trigo svg:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 4px; }

.trigo-axis { stroke: var(--gray-light); stroke-width: 0.8; }
.trigo-axis-label { fill: var(--gray); font: italic 9px 'EB Garamond', Georgia, serif; }
.trigo-circle { fill: none; stroke: var(--gray-dark); stroke-width: 1.2; }
.trigo-mark { fill: var(--gray-light); }
.trigo-mark-label { fill: var(--gray); font: 7px 'IBM Plex Mono', monospace; text-anchor: middle; }
.trigo-dash { stroke: var(--gray-light); stroke-width: 0.8; stroke-dasharray: 3 3; }
.trigo-cos { stroke: var(--trig-cos); stroke-width: 3; stroke-linecap: round; }
.trigo-sin { stroke: var(--trig-sin); stroke-width: 3; stroke-linecap: round; }
.trigo-tan-line { stroke: var(--trig-tan); stroke-width: 0.8; stroke-dasharray: 2 3; opacity: 0.7; }
.trigo-tan-ray { stroke: var(--trig-tan); stroke-width: 0.8; opacity: 0.7; }
.trigo-tan { stroke: var(--trig-tan); stroke-width: 3; stroke-linecap: round; }
.trigo-arc { fill: none; stroke: var(--black); stroke-width: 1; }
.trigo-angle-label { fill: var(--black); font: italic 10px 'EB Garamond', Georgia, serif; text-anchor: middle; }
.trigo-radius { stroke: var(--black); stroke-width: 1.5; }
.trigo-point { fill: var(--accent); stroke: var(--white); stroke-width: 2; cursor: grab; }

.trigo-values { display: grid; grid-template-columns: 3.6rem 1fr; gap: 0.35rem 0.6rem; margin-bottom: 1rem; }
.trigo-values dt { font-family: 'IBM Plex Mono', monospace; font-size: 0.78rem; color: var(--gray); padding-top: 0.1rem; }
.trigo-values dd { font-family: 'IBM Plex Mono', monospace; font-size: 0.85rem; color: var(--black); }
.trigo-k-cos { color: var(--trig-cos) !important; font-weight: 500; }
.trigo-k-sin { color: var(--trig-sin) !important; font-weight: 500; }
.trigo-k-tan { color: var(--trig-tan) !important; font-weight: 500; }

.trigo-buttons { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-bottom: 1rem; }
.trigo-buttons button {
  font-family: 'IBM Plex Mono', monospace; font-size: 0.72rem;
  background: var(--bg); color: var(--black);
  border: 1px solid var(--border); border-radius: 3px;
  padding: 0.2rem 0.5rem; cursor: pointer;
}
.trigo-buttons button:hover { border-color: var(--accent); color: var(--accent); }
.trigo-options { display: flex; flex-direction: column; gap: 0.3rem; font-size: 0.78rem; color: var(--gray-dark); }
.trigo-options input { accent-color: var(--accent); margin-right: 0.35rem; vertical-align: -1px; }

@media (max-width: 700px) {
  .trigo-body { grid-template-columns: 1fr; }
}

/* ── ENSEIGNEMENT : PARTIES ET RESSOURCES ── */
.part-head { margin-top: 2.5rem; }
.part-head h2 { margin-bottom: 0.3rem; }
.part-sub { font-size: 0.85rem; color: var(--gray); margin-bottom: 0; }
.part-head-sep { border-top: 1px solid var(--border); padding-top: 2.5rem; margin-top: 1rem; }
.teach-table-first { margin-top: 1rem; }

.res-cat {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.68rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--gray-light);
  margin: 2rem 0 0.9rem;
}
.res-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }
.res-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1rem 1.1rem;
  display: flex; flex-direction: column; gap: 0.5rem;
}
.res-top { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.3rem 0.6rem; }
.res-title { font-size: 0.95rem; color: var(--black); font-weight: 500; }
.res-levels .badge { margin-left: 0; margin-right: 0.25rem; }
.res-levels .badge:last-child { margin-right: 0; }
.res-desc { font-size: 0.8rem; color: var(--gray); margin: 0; flex: 1; }
.res-card .dl-link, .res-link { color: var(--accent); text-decoration: none; font-size: 0.78rem; }
.res-card .dl-link:hover, .res-link:hover { text-decoration: underline; }
.res-soon { font-family: 'IBM Plex Mono', monospace; font-size: 0.7rem; color: var(--gray-light); font-style: italic; }
.res-cat + .trigo { margin-top: 0; }
.teach-table-first { margin-bottom: 1.5rem; }
#trigo { scroll-margin-top: 5rem; }
.teach-history { margin-bottom: 1rem; }
.teach-history .entry-title .badge { font-size: 0.6rem; margin-left: 0.3rem; margin-right: 0; }

/* ── PUBLICATIONS : NUMÉROS ET LOGO HAL ── */
#publications .pub-item { position: relative; padding-left: 2.6rem; }
.pub-num {
  position: absolute; left: 0; top: 0.2rem;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.8rem;
  color: var(--gray-light);
}
.logo-hal { height: 25px; width: auto; margin-right: 0.35rem; }
.logo-hal-sombre { display: none; }
html.dark-mode .logo-hal-clair { display: none; }
html.dark-mode .logo-hal-sombre { display: inline; }

/* ── ACCUEIL : THÈMES ET FIGURE ── */
.home-h2 { font-size: 1.3rem; margin: 2.2rem 0 0.8rem; }
#accueil .tags { margin-top: 1.2rem; }
.home-fig { margin: 2.2rem 0 0; }
.home-fig-panels { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.home-fig-panel svg { width: 100%; height: auto; display: block; }
.home-fig-sub { font-size: 0.78rem; color: var(--gray); margin-top: 0.4rem; line-height: 1.5; }
.fig-axis { stroke: var(--gray-light); stroke-width: 1; }
.fig-label { fill: var(--gray); font: italic 11px 'EB Garamond', Georgia, serif; }
.fig-legend { fill: var(--gray-dark); font: 9px 'IBM Plex Mono', monospace; }
.fig-grid { fill: var(--gray-light); opacity: 0.6; }
.fig-shift { stroke: var(--gray-light); stroke-width: 0.6; opacity: 0.6; }
.fig-pt { fill: var(--accent); }
.fig-c1, .fig-c2, .fig-c3 { fill: none; stroke-width: 2; }
.fig-c1 { stroke: var(--trig-cos); }
.fig-c2 { stroke: var(--trig-sin); }
.fig-c3 { stroke: var(--trig-tan); }
@media (max-width: 700px) { .home-fig-panels { grid-template-columns: 1fr; } }

/* ── PUBLICATIONS : PROFILS ── */
.profils { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: -0.5rem 0 2rem; }
.profil {
  font-family: 'IBM Plex Mono', monospace; font-size: 0.72rem;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--gray-dark); text-decoration: none;
  border: 1px solid var(--border); border-radius: 3px; padding: 0.3rem 0.7rem;
}
.profil:hover { color: var(--accent); border-color: var(--accent); }

/* ── PIED DE PAGE : MISE À JOUR ── */
.maj { font-size: 0.72rem; color: var(--gray-light); margin-top: 0.3rem; }