/* ==========================================================================
   Fabrice Maurel — charte graphique du site personnel
   Registre : editorial academique. Titres serif, texte sans-serif,
   un seul accent (terre cuite), large blanc tournant.
   Aucune dependance externe : ni Bootstrap, ni jQuery, ni webfont.
   ========================================================================== */

/* --- 1. Jetons ---------------------------------------------------------- */
:root {
  color-scheme: light dark;

  --paper:        #fdfdfc;
  --paper-2:      #f6f4f0;
  --paper-3:      #efece6;
  --ink:          #1a1a1a;
  --muted:        #5a5550;
  --line:         #e2ddd5;
  --line-strong:  #cec7bc;
  --accent:       #8a3324;
  --accent-hover: #6d271b;
  --accent-soft:  #f5ece9;

  --topic-nlp:    #a3282a;
  --topic-access: #2f6d4f;
  --topic-speech: #8a6210;
  --topic-xr:     #2f5d8a;

  --serif: "Iowan Old Style", Charter, "Bitstream Charter", "Sitka Text",
           Cambria, Georgia, "Times New Roman", serif;
  --sans:  system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
           "Helvetica Neue", Arial, sans-serif;
  --mono:  ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  --wrap:      46rem;
  --wrap-wide: 60rem;
  --radius:    4px;
  --shadow:    0 1px 2px rgba(26, 26, 26, .04), 0 8px 24px rgba(26, 26, 26, .06);
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper:        #14120f;
    --paper-2:      #1c1a16;
    --paper-3:      #24211c;
    --ink:          #f2ede6;
    --muted:        #b0a99f;
    --line:         #322e28;
    --line-strong:  #48423a;
    --accent:       #e8a08d;
    --accent-hover: #f4bcac;
    --accent-soft:  #2a201c;

    --topic-nlp:    #e8807f;
    --topic-access: #78c39f;
    --topic-speech: #d9b25a;
    --topic-xr:     #85b4de;

    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .35);
  }
}

/* --- 2. Base ------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: .18em;
}
a:hover { color: var(--accent-hover); }

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 2.5rem 0;
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

/* --- 3. Lien d'evitement ------------------------------------------------ */
.skip-link {
  position: absolute;
  left: .75rem; top: -4rem;
  z-index: 100;
  padding: .7rem 1.1rem;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--radius);
  transition: top .15s ease;
}
.skip-link:focus { top: .75rem; color: #fff; }

/* --- 4. En-tete et navigation ------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  border-bottom: 1px solid var(--line);
}
@supports (backdrop-filter: blur(8px)) {
  .site-header { backdrop-filter: blur(10px); }
}

.header-inner {
  max-width: var(--wrap-wide);
  margin: 0 auto;
  padding: .85rem clamp(1rem, 4vw, 2.5rem);
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .4rem 1.75rem;
}

.brand {
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: .01em;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}
.brand:hover { color: var(--accent); }

.site-nav ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: .1rem 1.15rem;
  margin: 0; padding: 0;
}
.site-nav a {
  display: inline-block;
  padding: .25rem 0;
  color: var(--muted);
  font-size: .935rem;
  text-decoration: none;
  border-bottom: 2px solid transparent;
}
.site-nav a:hover {
  color: var(--ink);
  border-bottom-color: var(--line-strong);
}
.site-nav a[aria-current="page"] {
  color: var(--ink);
  font-weight: 600;
  border-bottom-color: var(--accent);
}

/* --- 5. Mise en page ---------------------------------------------------- */
.page {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: clamp(2rem, 6vw, 4rem) clamp(1rem, 4vw, 2.5rem) 4rem;
}
.page--wide { max-width: var(--wrap-wide); }

.page-title {
  font-family: var(--serif);
  font-size: clamp(2rem, 5vw, 2.9rem);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -.015em;
  margin: 0 0 .6rem;
}
.page-lede {
  color: var(--muted);
  font-size: 1.075rem;
  margin: 0 0 2.25rem;
  max-width: 40rem;
}
.page-title + .page-hero,
.page-lede  + .page-hero { margin-top: 2rem; }

.page-hero { margin: 0 0 2.75rem; }
.page-hero img {
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--paper-2);
}
.page-hero figcaption {
  margin-top: .55rem;
  font-size: .8rem;
  color: var(--muted);
  letter-spacing: .04em;
  text-transform: uppercase;
}

/* --- 6. Typographie de contenu ------------------------------------------ */
.prose h2 {
  font-family: var(--serif);
  font-size: 1.42rem;
  font-weight: 600;
  line-height: 1.25;
  margin: 3rem 0 1.1rem;
  padding-bottom: .45rem;
  border-bottom: 1px solid var(--line);
}
.prose h2:first-child { margin-top: 0; }

.prose h3 {
  font-family: var(--serif);
  font-size: 1.13rem;
  font-weight: 600;
  margin: 2rem 0 .6rem;
}

.prose p { margin: 0 0 1.15rem; }
.prose > p:last-child { margin-bottom: 0; }

.prose ul, .prose ol { margin: 0 0 1.4rem; padding: 0; list-style: none; }

.prose li {
  position: relative;
  margin: 0 0 1.05rem;
  padding-left: 1.15rem;
}
.prose li::before {
  content: "";
  position: absolute;
  left: 0; top: .72em;
  width: .38rem; height: 1px;
  background: var(--line-strong);
}
.prose li:last-child { margin-bottom: 0; }

.prose strong, .prose b { font-weight: 600; }

/* Annee en tete d'entree */
.year {
  display: inline-block;
  margin-right: .5rem;
  font-family: var(--mono);
  font-size: .82rem;
  font-weight: 600;
  letter-spacing: .02em;
  color: var(--muted);
  white-space: nowrap;
}

/* Rang de conference / quartile de revue */
.rank {
  display: inline-block;
  margin-right: .5rem;
  padding: .05rem .38rem;
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  background: var(--paper-2);
  font-family: var(--mono);
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .03em;
  color: var(--muted);
  white-space: nowrap;
}

/* Role tenu dans un jury */
.tag {
  display: inline-block;
  margin-left: .45rem;
  padding: .06rem .42rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: .74rem;
  font-weight: 600;
  letter-spacing: .02em;
  white-space: nowrap;
  vertical-align: .06em;
}

/* Pastille thematique */
.topic {
  display: inline-block;
  width: .6rem; height: .6rem;
  margin-right: .45rem;
  border-radius: 50%;
  vertical-align: .04em;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--ink) 18%, transparent);
}
.topic--nlp    { background: var(--topic-nlp); }
.topic--access { background: var(--topic-access); }
.topic--speech { background: var(--topic-speech); }
.topic--xr     { background: var(--topic-xr); }

/* Legende des pastilles */
.legend {
  margin: 0 0 2.5rem;
  padding: 1rem 1.2rem;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  list-style: none;
}
.legend ul {
  margin: 0; padding: 0; list-style: none;
  display: grid;
  gap: .45rem 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
}
.legend li {
  margin: 0; padding: 0;
  font-size: .88rem;
  line-height: 1.45;
  color: var(--muted);
  text-indent: -1.05rem;
  padding-left: 1.05rem;
}
.legend li::before { display: none; }

/* Liens documentaires en fin d'entree */
.doclink {
  display: inline-block;
  margin-left: .35rem;
  font-size: .85rem;
  font-family: var(--mono);
  white-space: nowrap;
}

/* --- 7. Boutons --------------------------------------------------------- */
.doclinks {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
  margin: 2.5rem 0 0;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}
.btn {
  display: inline-block;
  padding: .45rem .85rem;
  background: var(--paper-2);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  color: var(--ink);
  font-size: .875rem;
  font-weight: 500;
  text-decoration: none;
}
.btn:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent-hover);
}
.btn--primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.btn--primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; }

/* --- 8. Video ---------------------------------------------------------- */
.video { margin: 1.2rem 0 1.7rem; }

.video__frame {
  aspect-ratio: 16 / 9;
  background: var(--paper-3);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.video__frame iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.video figcaption {
  margin-top: .5rem;
  font-size: .85rem;
  color: var(--muted);
}
.video figcaption a {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
}
.video figcaption a::after {
  content: "\2197";
  font-size: .9em;
  text-decoration: none;
}

/* --- 9. Citation -------------------------------------------------------- */
.quote {
  margin: 3.5rem 0 0;
  padding: 1.5rem 0 0;
  border-top: 1px solid var(--line);
}
.quote blockquote {
  margin: 0 0 .75rem;
  font-family: var(--serif);
  font-size: 1.02rem;
  font-style: italic;
  line-height: 1.6;
  color: var(--muted);
}
.quote figcaption {
  font-size: .85rem;
  color: var(--muted);
  letter-spacing: .03em;
}
.quote figcaption::before { content: "— "; }

/* --- 10. Page d'accueil ------------------------------------------------- */
.hero {
  display: grid;
  gap: clamp(1.5rem, 5vw, 3rem);
  grid-template-columns: 1fr;
  align-items: start;
  margin-bottom: 3rem;
}
@media (min-width: 40rem) {
  .hero { grid-template-columns: 9.5rem 1fr; }
}
.hero-portrait {
  width: 100%;
  max-width: 9.5rem;
  aspect-ratio: 1;
  object-fit: cover;
  /* la photo est un cadrage circulaire sur fond blanc : on la recadre en rond
     pour que les angles blancs ne jurent pas avec le papier, en clair comme en sombre */
  border-radius: 50%;
  box-shadow: 0 0 0 1px var(--line);
}
.hero-name {
  font-family: var(--serif);
  font-size: clamp(2.1rem, 6vw, 3rem);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -.02em;
  margin: 0 0 .5rem;
}
.hero-role {
  font-size: 1.1rem;
  color: var(--muted);
  margin: 0 0 1.4rem;
  max-width: 34rem;
}

.factsheet { margin: 0; }
.factsheet > div {
  display: grid;
  gap: .1rem 1rem;
  grid-template-columns: 1fr;
  padding: .7rem 0;
  border-top: 1px solid var(--line);
}
@media (min-width: 34rem) {
  .factsheet > div { grid-template-columns: 8.5rem 1fr; }
}
.factsheet dt {
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--muted);
  padding-top: .12rem;
}
.factsheet dd { margin: 0; }
.factsheet ul { margin: 0; padding: 0; list-style: none; }
.factsheet li { margin: 0; padding: 0; }
.factsheet li::before { display: none; }

/* --- 11. Pied de page --------------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--line);
  background: var(--paper-2);
  margin-top: 4rem;
}
.footer-inner {
  max-width: var(--wrap-wide);
  margin: 0 auto;
  padding: 2.5rem clamp(1rem, 4vw, 2.5rem);
  display: grid;
  gap: 1.5rem 2.5rem;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  font-size: .9rem;
  color: var(--muted);
}
.site-footer h2 {
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--ink);
  margin: 0 0 .6rem;
}
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin: 0 0 .3rem; }
.site-footer p { margin: 0 0 .3rem; }

/* --- 12. Impression ----------------------------------------------------- */
@media print {
  .site-header, .site-footer, .skip-link, .page-hero, .video__frame { display: none; }
  body { background: #fff; color: #000; font-size: 10.5pt; }
  .page { max-width: none; padding: 0; }
  .prose h2 { page-break-after: avoid; }
  .prose li { page-break-inside: avoid; }
  a { color: #000; text-decoration: underline; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 8pt; color: #555; }
}
