:root {
  --bg: #fbfaf7;
  --fg: #1d2330;
  --muted: #5d6675;
  --rule: #e2ded5;
  --accent: #1f4e79;
  --tag: #efece4;
  --gold: #b8975a;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14171c;
    --fg: #e6e3dc;
    --muted: #9aa2af;
    --rule: #2b3038;
    --accent: #8fbbe6;
    --tag: #1f242c;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 4.5rem; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 17px/1.65 var(--serif);
  -webkit-text-size-adjust: 100%;
}

/* Bilingue : on masque la langue inactive. */
html[data-lang="fr"] .en,
html[data-lang="en"] .fr { display: none !important; }

.wrap { max-width: 54rem; margin: 0 auto; padding: 0 1.25rem; }

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }

/* En-tête */
.top {
  position: sticky; top: 0; z-index: 10;
  background: var(--bg);
  border-bottom: 1px solid var(--rule);
}
.top-in {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap;
  padding-top: .7rem; padding-bottom: .7rem;
}
.brand { font-weight: 700; font-size: 1.1rem; color: var(--fg); text-decoration: none; }
nav { display: flex; align-items: center; gap: 1.1rem; flex-wrap: wrap; font: 500 .9rem var(--sans); }
nav a { color: var(--muted); text-decoration: none; }
nav a:hover { color: var(--accent); }
#lang {
  font: 600 .8rem var(--sans);
  color: var(--accent); background: none;
  border: 1px solid var(--rule); border-radius: 4px;
  padding: .2rem .55rem; cursor: pointer;
}
#lang:hover { border-color: var(--accent); }

/* Accueil */
.hero {
  display: grid; grid-template-columns: 13rem 1fr; gap: 2.5rem;
  align-items: start;
  padding-top: 3.5rem;
}
/* Cadre carré ; l'image est recadrée et zoomée sur le visage.
   Pour ajuster : scale = zoom, transform-origin = point visé (x y). */
.photo { width: 100%; aspect-ratio: 1; border-radius: 6px; overflow: hidden; }
.photo img {
  width: 100%; height: 100%; display: block;
  object-fit: cover; object-position: 50% 45%;
  transform: scale(1.35); transform-origin: 47% 52%;
}
h1 { font-size: 2.3rem; line-height: 1.15; margin: 0 0 .5rem; letter-spacing: -.01em; }
.role { font: .95rem/1.5 var(--sans); color: var(--muted); margin: 0 0 1.4rem; }
.links { display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; font: 500 .92rem var(--sans); margin-top: 1.4rem; }

/* Sections */
section { padding-bottom: 1rem; }
h2 {
  font-size: 1.5rem; margin: 3.2rem 0 1rem;
  /* double filet doré, comme sur un dos de Pléiade */
  padding-bottom: .45rem; border-bottom: 3px double var(--gold);
}
h3 {
  font: 600 .8rem var(--sans); letter-spacing: .07em; text-transform: uppercase;
  color: var(--muted); margin: 2rem 0 .8rem;
}
p { margin: 0 0 1rem; }

ul.plain, ul.courses, ol.pubs, ul.tags { list-style: none; padding: 0; margin: 0; }
ul.plain li { margin-bottom: .35rem; }

.tags { display: flex; flex-wrap: wrap; gap: .5rem; }
.tags li {
  font: .88rem var(--sans); background: var(--tag);
  border-radius: 4px; padding: .3rem .65rem;
}

/* Publications */
.pubs li { margin-bottom: 1.15rem; padding-left: 1rem; border-left: 2px solid var(--rule); }
.pubs span.t, .pubs span.a, .pubs span.v, .pubs span.l { display: block; }
.pubs .t { font-weight: 700; line-height: 1.35; }
.pubs .a { color: var(--muted); font-size: .95rem; }
.pubs .v { font-size: .95rem; }
.pubs .l { font: 500 .82rem var(--sans); margin-top: .15rem; }
.pubs .l a { margin-right: .9rem; }

/* Cours */
.courses li { margin-bottom: .8rem; }
.courses b { font-weight: 700; }
.courses i {
  font: normal 600 .75rem var(--sans); color: var(--muted);
  border: 1px solid var(--rule); border-radius: 3px;
  padding: .05rem .4rem; margin: 0 .5rem 0 .3rem; white-space: nowrap;
}

/* Courbes de niveau très pâles derrière la photo et la bio */
html, body { overflow-x: clip; }
.hero { position: relative; isolation: isolate; }
/* Carte centrée sur Massevaques, placée sous la photo : --cx / --cy = position du hameau */
.hero { --carte: 34rem; --cx: 6.5rem; --cy: 22rem; }
.topo {
  position: absolute; z-index: -1; pointer-events: none;
  left: calc(var(--cx) - var(--carte) / 2); top: calc(var(--cy) - var(--carte) / 2);
  width: var(--carte); height: var(--carte);
  opacity: .38;
  /* le relief s'efface avant le texte, à droite, et avant la rubrique suivante, en bas */
  -webkit-mask-image: linear-gradient(to left, transparent 30%, rgba(0,0,0,.3) 42%, #000 56%), linear-gradient(to bottom, #000 68%, transparent 92%);
          mask-image: linear-gradient(to left, transparent 30%, rgba(0,0,0,.3) 42%, #000 56%), linear-gradient(to bottom, #000 68%, transparent 92%);
  -webkit-mask-composite: source-in; mask-composite: intersect;
}
/* Massevaques : une petite maison au centre de la carte */
.maison {
  position: absolute; z-index: -1; pointer-events: none;
  width: 16px; height: 16px;
  left: calc(var(--cx) - 8px); top: calc(var(--cy) - 8px);
  fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; opacity: .6;
}
/* Sur téléphone : la carte passe à droite de la photo, au-dessus du texte */
@media (max-width: 640px) {
  .hero { --carte: 22rem; --cx: 16rem; --cy: 7rem; }
  .topo {
    -webkit-mask-image: linear-gradient(to bottom, #000 50%, transparent 72%);
            mask-image: linear-gradient(to bottom, #000 50%, transparent 72%);
  }
}

/* Petit dos de Pléiade devant chaque grand titre : un cuir par rubrique */
h2::before {
  content: ""; display: inline-block;
  width: .65rem; height: 1.3em; margin-right: .65rem; vertical-align: -.22em;
  border-radius: 1px;
  background:
    linear-gradient(var(--gold), var(--gold)) 0 16% / 100% 1.5px no-repeat,
    linear-gradient(var(--gold), var(--gold)) 0 27% / 100% 1px no-repeat,
    linear-gradient(var(--gold), var(--gold)) 0 80% / 100% 1.5px no-repeat,
    var(--cuir, var(--muted));
}
#recherche       { --cuir: #8a5a33; }  /* havane */
#enseignement    { --cuir: #1f6b52; }  /* vert émeraude */
#responsabilites { --cuir: #2b4a8a; }  /* bleu */
#contact         { --cuir: #9e3a30; }  /* rouge vénitien */

/* Clins d'œil disséminés dans les titres, volontairement sans légende */
.clin {
  float: right; width: 32px; height: 32px;
  color: var(--accent); opacity: .85;
  fill: none; stroke: currentColor;
  stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round;
}
.clin.plein { fill: currentColor; stroke: none; }
h2 .clin { margin-top: -4px; }
h3 .clin { margin-top: -10px; }
h3 .clin.plein { color: var(--gold); opacity: 1; }   /* étoiles dorées de la Pléiade */
/* variante posée dans le texte, juste après le mot concerné */
.clin.mot {
  float: none; display: inline-block; width: 1.15em; height: 1.15em;
  vertical-align: -.2em; margin-left: .25em;
}

footer {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: .5rem;
  margin-top: 3rem; padding-top: 1.2rem; padding-bottom: 2.5rem;
  border-top: 1px solid var(--rule);
  font: .82rem var(--sans); color: var(--muted);
}

@media (max-width: 640px) {
  body { font-size: 16px; }
  .hero { grid-template-columns: 1fr; gap: 1.5rem; padding-top: 2rem; }
  .photo { max-width: 10rem; }
  h1 { font-size: 1.9rem; }
  nav { gap: .8rem; }
}
