/* =========================================================================
   Académie — vues : accueil, domaine, cours (héros + carte), vocabulaire, révision
   ========================================================================= */

.evitement {
  position: fixed;
  z-index: 100;
  top: -80px;
  left: 16px;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--texte);
  color: var(--bg);
  font-size: 14px;
  font-weight: 600;
  transition: top .3s var(--courbe);
}
.evitement:focus-visible { top: 8px; }

.page-vide {
  padding-top: clamp(120px, 20vh, 220px);
  padding-bottom: 120px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 22px;
}
.page-vide .chapeau { max-width: 620px; }

/* ---------- Scène (visuel en fond, contenu par-dessus) ---------- */
.scene {
  position: sticky;
  top: 0;
  z-index: 0;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
  padding-top: var(--entete-h);
  padding-bottom: calc(9vh + 28px);
}
.scene-fond { position: absolute; inset: 0; transition: opacity .2s linear; }
/* Le réseau s'efface derrière le texte (à gauche) et reste net à droite */
.scene--accueil .scene-fond, .scene--domaine .scene-fond, .scene--parcours .scene-fond {
  -webkit-mask-image: linear-gradient(100deg, rgba(0, 0, 0, .28) 0%, rgba(0, 0, 0, .45) 38%, #000 72%);
  mask-image: linear-gradient(100deg, rgba(0, 0, 0, .28) 0%, rgba(0, 0, 0, .45) 38%, #000 72%);
}
@media (max-width: 720px) {
  .scene--accueil .scene-fond, .scene--domaine .scene-fond, .scene--parcours .scene-fond {
    -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 30%, rgba(0, 0, 0, .3) 70%);
    mask-image: linear-gradient(to bottom, #000 0%, #000 30%, rgba(0, 0, 0, .3) 70%);
  }
}
.scene-canvas { width: 100%; height: 100%; }
.scene-voile {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(to bottom, rgba(var(--bg-rgb), .0) 30%, rgba(var(--bg-rgb), .55) 70%, rgba(var(--bg-rgb), .92) 100%);
}
.scene-contenu {
  position: relative;
  z-index: 1;
  will-change: transform, opacity;
}
.scene-contenu .surtitre { margin-bottom: 20px; }
.scene-chapeau { margin-top: 26px; max-width: 640px; }
.scene-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }
.titre-gris { color: var(--texte-2); }

.scene-stats {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 18px 56px;
  margin-top: 56px;
  margin-bottom: 0;
}
.stat { display: flex; flex-direction: column-reverse; }
.stat-val {
  margin: 0;
  font-size: clamp(30px, 3.4vw, 46px);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1;
}
.stat-lib { margin-top: 8px; font-size: 13.5px; color: var(--texte-2); }

/* Titre qui monte ligne par ligne */
.titre-revele .ligne {
  display: block;
  overflow: hidden;
  padding-bottom: .14em;
  margin-bottom: -.14em;
}
.titre-revele .ligne > span {
  display: inline-block;
  transform: translateY(108%);
  animation: ligne-monte 1.05s var(--courbe) forwards;
  animation-delay: calc(.1s + var(--l, 0) * .11s);
}
.titre-revele .ligne:nth-child(2) > span { --l: 1; }
.titre-revele .ligne:nth-child(3) > span { --l: 2; }
@keyframes ligne-monte { to { transform: none; } }

/* Feuille qui passe par-dessus la scène */
.feuille {
  position: relative;
  z-index: 2;
  margin-top: -9vh;
  padding-top: clamp(56px, 7vw, 96px);
  background: var(--bg);
  border-radius: 34px 34px 0 0;
  box-shadow: 0 -1px 0 var(--filet);
}
.feuille-tete-section { margin-bottom: clamp(32px, 4vw, 48px); }
.feuille-tete-section .surtitre { margin-bottom: 12px; }

@media (max-width: 720px) {
  .feuille {
    background: var(--verre-fort);
    -webkit-backdrop-filter: saturate(180%) blur(30px);
    backdrop-filter: saturate(180%) blur(30px);
    border-radius: 28px 28px 0 0;
  }
  .scene-stats { gap: 16px 32px; margin-top: 40px; }
  .scene-actions .bouton { flex: 1 1 auto; }
}

/* ---------- Accueil : cartes de domaine ---------- */
.domaines { display: grid; gap: 20px; }
.domaine-carte {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: clamp(28px, 5vw, 72px);
  padding: clamp(28px, 4.4vw, 60px);
  border-radius: 34px;
  background: var(--surface);
  overflow: hidden;
  isolation: isolate;
}
.domaine-carte:hover { transform: translateY(-4px); box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb), .45); }
.dc-num {
  position: absolute;
  z-index: -1;
  right: clamp(-8px, 1vw, 24px);
  bottom: -0.16em;
  font-size: clamp(140px, 22vw, 300px);
  font-weight: 700;
  letter-spacing: -0.06em;
  line-height: 1;
  color: rgba(var(--texte-rgb), .045);
  pointer-events: none;
  transition: transform 1s var(--courbe);
}
.domaine-carte:hover .dc-num { transform: translateX(-12px); }
.dc-titre {
  font-size: clamp(46px, 6.4vw, 84px);
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: .98;
}
.dc-lien::after { content: ""; position: absolute; inset: 0; z-index: 1; border-radius: inherit; }
.dc-lien:focus-visible { outline: none; }
.dc-lien:focus-visible::after { box-shadow: inset 0 0 0 2px var(--accent); }
.dc-accroche { margin-top: 16px; font-size: clamp(18px, 1.6vw, 21px); line-height: 1.45; color: var(--texte-2); max-width: 460px; }
.dc-stats { display: flex; gap: 36px; margin: 34px 0 0; }
.dc-stats > div { display: flex; flex-direction: column-reverse; }
.dc-stats dd { margin: 0; font-size: 32px; font-weight: 700; letter-spacing: -0.035em; line-height: 1; }
.dc-stats dt { font-size: 13px; color: var(--texte-2); margin-top: 6px; }
.dc-prog { margin-top: 26px; height: 3px; border-radius: 2px; background: var(--filet-2); overflow: hidden; max-width: 360px; }
.dc-prog span {
  display: block; height: 100%; width: calc(var(--p) * 100%); min-width: 0;
  background: var(--accent); border-radius: inherit;
  transform-origin: left; transform: scaleX(0); transition: transform 1.4s var(--courbe) .4s;
}
.domaine-carte.vu .dc-prog span { transform: none; }
/* La colonne de droite laisse passer le clic jusqu'au lien de toute la carte (le domaine) ;
   seuls les liens de cours le gardent pour eux */
.dc-droite { position: relative; z-index: 2; display: flex; flex-direction: column; justify-content: center; pointer-events: none; }
.dc-droite .dc-cours { pointer-events: auto; }
.dc-cours {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 20px;
  grid-template-areas: "titre anneau fleche" "nom anneau fleche";
  align-items: center;
  column-gap: 16px;
  padding: 18px 4px;
  border-top: 1px solid var(--filet-2);
  transition: padding .4s var(--courbe);
}
.dc-cours:last-of-type { border-bottom: 1px solid var(--filet-2); }
.dc-cours:hover { padding-left: 10px; }
.dc-cours-titre { grid-area: titre; font-size: clamp(30px, 3vw, 40px); font-weight: 700; letter-spacing: -0.04em; line-height: 1.05; }
.dc-cours-nom { grid-area: nom; font-size: 14.5px; color: var(--texte-2); margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dc-cours .anneau { grid-area: anneau; }
.dc-fleche { grid-area: fleche; color: var(--accent-texte); font-size: 18px; }
.dc-cours:hover .dc-fleche { transform: translateX(4px); }
.dc-cours--absent { opacity: .6; }
.dc-bientot { margin-top: 26px; }
.dc-bientot .surtitre { margin-bottom: 10px; }
.domaine-carte--bientot .dc-bientot { margin-top: 0; }
/* repère du domaine : sa couleur, en petit */
.dc-pastille {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 14px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--accent-texte);
}
.dc-point { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: none; }
.dc-prevus { margin-top: 28px; font-size: 14.5px; color: var(--texte-2); }
@media (max-width: 860px) {
  .domaine-carte { grid-template-columns: 1fr; }
}

/* Anneau de progression */
.anneau { position: relative; display: inline-grid; place-items: center; flex: none; }
.anneau svg { position: absolute; inset: 0; }
.anneau-fond { stroke: var(--filet-2); }
.anneau-trait { stroke: var(--accent); transition: stroke-dashoffset 1.6s var(--courbe) .25s; }
.anneau-val { position: relative; font-weight: 600; letter-spacing: -0.02em; }

/* ---------- Domaine : liste des cours ---------- */
.cours-liste { border-top: 1px solid var(--filet); }
.cours-bloc {
  position: relative;
  display: grid;
  grid-template-columns: 44px minmax(0, 1.15fr) minmax(0, 1fr) auto;
  gap: 24px clamp(20px, 3vw, 44px);
  align-items: center;
  padding: clamp(32px, 4vw, 52px) 0;
  border-bottom: 1px solid var(--filet);
}
.cours-bloc::before {
  content: "";
  position: absolute;
  left: -18px; top: 28%; bottom: 28%;
  width: 2px;
  border-radius: 1px;
  background: var(--accent);
  transform: scaleY(0);
  transition: transform .5s var(--courbe);
}
.cours-bloc:hover::before { transform: scaleY(1); }
.cb-num { align-self: start; padding-top: 1.1em; font-size: 13px; color: var(--texte-2); }
.cb-titre {
  display: block;
  font-size: clamp(64px, 10vw, 132px);
  font-weight: 700;
  letter-spacing: -0.055em;
  line-height: .88;
  transition: transform .6s var(--courbe), color .4s;
}
.cours-bloc:hover .cb-titre { transform: translateX(6px); }
.cb-nom { display: block; margin-top: 14px; font-size: 17px; color: var(--texte-2); }
.cb-corps { display: flex; flex-direction: column; }
.cb-accroche { font-size: clamp(19px, 1.7vw, 22px); font-weight: 500; letter-spacing: -0.016em; line-height: 1.4; }
.cb-stats { display: flex; flex-wrap: wrap; gap: 4px 18px; margin-top: 14px; font-size: 14px; color: var(--texte-2); }
.cb-stats b { color: var(--texte); font-weight: 600; }
.cb-cta { margin-top: 18px; font-weight: 600; color: var(--accent-texte); }
.cb-anneau { align-self: center; }
@media (max-width: 860px) {
  .cours-bloc { grid-template-columns: minmax(0, 1fr) auto; }
  .cb-num { display: none; }
  .cb-corps { grid-column: 1 / -1; grid-row: 2; }
  .cb-anneau { grid-column: 2; grid-row: 1; }
  .cours-bloc::before { left: -10px; }
}

.bientot { margin-top: 72px; }
.bientot--seul { margin-top: 0; }
.bientot-liste { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; margin-top: 16px; }
.bientot-nom { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.3; }
.bientot-accroche { font-size: 14.5px; line-height: 1.45; color: var(--texte-2); }
.domaine-vide-texte { margin-top: 14px; max-width: 560px; font-size: 18px; line-height: 1.5; color: var(--texte-2); }
.bientot-item {
  display: flex; flex-direction: column; gap: 8px;
  padding: 26px 24px;
  border-radius: 26px;
  box-shadow: inset 0 0 0 1px var(--filet-2);
}
.bientot-titre { font-size: clamp(34px, 3.6vw, 44px); font-weight: 700; letter-spacing: -0.045em; line-height: 1; color: var(--texte-2); }
.bientot-etat { margin-top: auto; padding-top: 6px; font-size: 13px; color: var(--texte-2); }

/* ---------- Cours : héros signature ---------- */
.scene--cours { justify-content: flex-end; }
.scene-fond--cours { left: 46%; }
.scene-voile--cours {
  background:
    linear-gradient(to right, rgba(var(--bg-rgb), .9) 0%, rgba(var(--bg-rgb), .0) 46%),
    linear-gradient(to bottom, rgba(var(--bg-rgb), 0) 55%, rgba(var(--bg-rgb), .9) 100%);
}
.scene-contenu--cours { max-width: calc(var(--largeur) + 2 * var(--gouttiere)); }
.scene-contenu--cours > * { max-width: 620px; }
.titre-cours { font-size: clamp(76px, 14vw, 150px); letter-spacing: -0.055em; }
.titre-cours-vt { display: inline-block; view-transition-name: titre-cours; }
.cours-nom { margin-top: 16px; font-size: clamp(20px, 2vw, 26px); font-weight: 600; letter-spacing: -0.022em; line-height: 1.25; }
.cours-intro { margin-top: 16px; font-size: 18px; line-height: 1.55; color: var(--texte-2); }
.scene-stats--cours { margin-top: 44px; }
@media (max-width: 1100px) {
  /* bande du haut réservée à l'échange animé, le texte passe dessous */
  .scene--cours { padding-top: calc(var(--entete-h) + clamp(220px, 34vw, 320px)); }
  .scene-fond--cours { left: 0; }
  .scene-voile--cours {
    background: linear-gradient(to bottom, rgba(var(--bg-rgb), 0) 26%, rgba(var(--bg-rgb), .82) 40%, rgba(var(--bg-rgb), .96) 100%);
  }
}
@media (max-width: 760px) {
  /* Mobile : l'échange animé passe EN FOND, derrière le surtitre et le titre.
     Le texte part d'une hauteur fixe pour que l'échange (joué en haut de la scène,
     voir sequence.js) tombe toujours derrière le titre, quelle que soit la longueur de l'intro. */
  .scene--cours {
    justify-content: flex-start;
    min-height: 0; /* pas de vide sous les chiffres : la feuille du parcours suit le texte */
    padding-top: calc(var(--entete-h) + 56px);
  }
  .scene-fond--cours .heros-seq { opacity: .5; }
  .scene-voile--cours {
    background: linear-gradient(to bottom,
      rgba(var(--bg-rgb), .2) 0%,
      rgba(var(--bg-rgb), .35) 32%,
      rgba(var(--bg-rgb), .86) 52%,
      rgba(var(--bg-rgb), .96) 100%);
  }
}

/* Animation d'échange (SVG) */
.heros-seq { width: 100%; height: 100%; overflow: visible; }
.hs-lien { stroke: var(--filet-2); stroke-width: 1; stroke-dasharray: 2 7; }
.hs-anneau { fill: var(--bg); stroke: var(--filet-2); stroke-width: 1; transition: stroke .4s; }
.hs-coeur { fill: var(--texte); transition: fill .4s; }
.hs-noeud.actif .hs-coeur { fill: var(--accent); }
.hs-noeud.actif .hs-anneau { stroke: var(--accent); }
.hs-nom { font: 600 11.5px var(--police); letter-spacing: .14em; fill: var(--texte-2); }
.hs-trace { fill: none; stroke: var(--accent); stroke-width: 1.5; stroke-linecap: round; }
.hs-paquet-fond { fill: var(--accent); }
.hs-paquet-texte { font: 600 12.5px var(--mono); fill: #fff; letter-spacing: .02em; }
.hs-paquet--broadcast .hs-paquet-fond,
.hs-paquet--multicast .hs-paquet-fond { fill: var(--bg); stroke: var(--accent); stroke-width: 1.5; stroke-dasharray: 4 3; }
.hs-paquet--broadcast .hs-paquet-texte,
.hs-paquet--multicast .hs-paquet-texte { fill: var(--accent-texte); }
.hs-onde { fill: none; stroke: var(--accent); stroke-width: 1; }
.hs-compteur { font: 500 12px var(--mono); fill: var(--texte-2); }

/* ---------- Onglets du cours : bande collante pleine largeur sous l'en-tête ----------
   Une vraie barre (comme une barre d'outils iOS) : quand elle est calée sous l'en-tête,
   le contenu passe DESSOUS, derrière un verre dépoli et un filet. Elle ne flotte jamais
   par-dessus le texte. La classe « collee » est posée par Ac.motion.bandeOnglets. */
.onglets-barre {
  position: sticky;
  top: var(--entete-h);
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  height: var(--onglets-h);
  padding: 0 max(var(--gouttiere), env(safe-area-inset-right)) 0 max(var(--gouttiere), env(safe-area-inset-left));
  margin-bottom: clamp(36px, 5vw, 56px);
}
.onglets-barre::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  background: var(--verre);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  box-shadow: 0 1px 0 var(--filet);
  opacity: 0;
  transition: opacity .2s linear;
  pointer-events: none;
}
.onglets-barre.collee::before { opacity: 1; }
/* bande calée : l'en-tête et la bande forment un seul bloc de verre, un seul filet en bas */
.entete { transition: border-color .2s linear; }
body:has(.onglets-barre.collee) .entete { border-bottom-color: transparent; }
.segmente--onglets { border-radius: 12px; }
.segmente--onglets > a { min-width: 112px; font-size: 15px; }
@media (max-width: 420px) { .segmente--onglets > a { min-width: 0; } }
[data-vt="onglets"] .onglets-barre { view-transition-name: onglets; }
[data-vt="onglets"] .onglets-barre .segmente-curseur { view-transition-name: onglet-curseur; }
.feuille--cours { padding-top: 22px; }

/* ---------- Carte du parcours ---------- */
.parcours-tete {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 24px 40px;
  margin-bottom: clamp(36px, 5vw, 64px);
}
.parcours-tete .surtitre { margin-bottom: 10px; }
.parcours-prog { min-width: 260px; font-size: 15px; color: var(--texte-2); }
.parcours-prog b { color: var(--texte); font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }
.barre-prog { height: 4px; border-radius: 2px; background: var(--filet-2); overflow: hidden; margin: 10px 0 12px; }
.barre-prog span {
  display: block; height: 100%; width: calc(var(--p) * 100%);
  background: var(--accent); border-radius: inherit;
  transform-origin: left; transform: scaleX(0);
  transition: transform 1.4s var(--courbe) .3s;
}
.vu .barre-prog span, .barre-prog.vu span { transform: none; }
.legende { display: flex; align-items: center; gap: 10px; font-size: 12.5px; }
.legende-barres, .mini-scores { display: inline-flex; gap: 3px; }
.legende-barres i, .mini-scores i {
  position: relative;
  display: block;
  width: 16px; height: 4px;
  border-radius: 2px;
  background: var(--filet-2);
  overflow: hidden;
}
.legende-barres i { background: var(--accent); }
.legende-barres i:nth-child(2) { opacity: .7; }
.legende-barres i:nth-child(3) { opacity: .45; }
.mini-scores i::after {
  content: "";
  position: absolute; inset: 0;
  background: var(--accent);
  transform-origin: left;
  transform: scaleX(var(--p, 0));
  transition: transform 1s var(--courbe) .3s;
}

.carte {
  display: grid;
  grid-template-columns: repeat(var(--n, 3), minmax(0, 1fr));
  gap: clamp(24px, 3vw, 40px);
  align-items: start;
}
@media (max-width: 1040px) { .carte { grid-template-columns: minmax(0, 1fr); gap: 56px; } }
.groupe-tete { padding: 0 0 22px; margin-bottom: 10px; border-bottom: 1px solid var(--filet); }
.groupe-num { display: block; font-family: var(--mono); font-size: 12.5px; font-weight: 600; color: var(--accent-texte); margin-bottom: 8px; }
.groupe-titre { font-size: clamp(28px, 2.8vw, 36px); font-weight: 700; letter-spacing: -0.035em; line-height: 1.05; }
.groupe-texte { margin-top: 8px; font-size: 15.5px; line-height: 1.5; color: var(--texte-2); }
.groupe-meta { margin-top: 12px; font-size: 13px; color: var(--texte-2); }
.groupe-liste { position: relative; }
.groupe-trace { position: absolute; top: 0; left: 0; width: 2px; overflow: visible; pointer-events: none; z-index: 0; }
.gt-fond { stroke: var(--filet-2); stroke-width: 1.5; fill: none; }
.gt-trait { stroke: var(--accent); stroke-width: 2; fill: none; stroke-dasharray: 1; stroke-dashoffset: 1; stroke-linecap: round; }

.partie {
  position: relative;
  display: grid;
  grid-template-columns: 20px 62px minmax(0, 1fr);
  column-gap: 12px;
  padding: 18px 14px 18px 6px;
  margin: 2px -14px 2px -6px;
  border-radius: 20px;
  transition: background-color .35s, transform .5s var(--courbe), box-shadow .35s;
}
.partie:hover {
  background: var(--surface);
  transform: translateX(4px);
  box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb), .35);
}
.partie:focus-visible { outline-offset: 0; }
.partie-noeud {
  position: relative;
  z-index: 1;
  justify-self: center;
  margin-top: 16px;
  width: 11px; height: 11px;
  border-radius: 50%;
  background: var(--bg);
  box-shadow: inset 0 0 0 1.5px var(--filet-2);
  transition: box-shadow .4s, background-color .4s, transform .4s var(--courbe);
}
.partie:hover .partie-noeud { background: var(--surface); }
.partie.atteinte .partie-noeud { box-shadow: inset 0 0 0 2px var(--accent); }
.partie.lue .partie-noeud { background: var(--accent); box-shadow: none; }
.partie-num {
  font-size: 44px;
  font-weight: 600;
  letter-spacing: -0.05em;
  line-height: 1;
  color: var(--texte-2);
  transition: color .35s;
}
.partie:hover .partie-num { color: var(--accent-texte); }
.partie-corps { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.partie-titre { font-size: 18.5px; font-weight: 650; letter-spacing: -0.02em; line-height: 1.25; }
.partie-resume { font-size: 14.5px; line-height: 1.45; color: var(--texte-2); }
.partie-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 14px; margin-top: 6px; font-size: 12.5px; color: var(--texte-2); }
.partie.lue .partie-etat { color: var(--accent-texte); font-weight: 600; }
.partie.absente .partie-num, .partie.absente .partie-titre { color: var(--texte-2); }

/* ---------- Pages outils (vocabulaire, révision) ---------- */
.outil-tete { padding-top: clamp(56px, 9vw, 110px); padding-bottom: clamp(32px, 4vw, 48px); }
.outil-retour { display: inline-block; margin-bottom: 18px; transition: color .2s; }
.outil-retour:hover { color: var(--texte); }
.outil-titre {
  display: flex;
  flex-direction: column;
  font-size: clamp(54px, 9vw, 108px);
  font-weight: 700;
  letter-spacing: -0.05em;
  line-height: .95;
}
.outil-titre-2 { color: var(--texte-2); }
/* le titre partagé épouse son texte (sinon, étiré sur toute la largeur, il se déforme
   pendant la transition depuis le héros du cours) */
.outil-titre .titre-cours-vt { align-self: flex-start; }
.outil-chapeau { margin-top: 22px; max-width: 640px; }

/* ---------- Vocabulaire ---------- */
.vocab-outils { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 16px; }
.vocab-champ { flex: 1 1 320px; }
.vocab-recherche {
  width: 100%;
  height: 52px;
  padding: 0 20px;
  border: 0;
  border-radius: 16px;
  background: var(--surface);
  font-size: 17px;
  -webkit-appearance: none;
  appearance: none;
  transition: box-shadow .25s, background-color .25s;
}
.vocab-recherche:focus { outline: none; background: var(--bg); box-shadow: inset 0 0 0 2px var(--accent); }
.vocab-recherche::placeholder { color: var(--texte-2); }
.vocab-outils-droite { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.vocab-puces {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px var(--gouttiere) 10px;
  margin: 0 calc(-1 * var(--gouttiere));
  scrollbar-width: none;
}
.vocab-puces::-webkit-scrollbar { display: none; }
.puce-lib { max-width: 240px; overflow: hidden; text-overflow: ellipsis; }
.vocab-compteur { margin: 8px 0 22px; font-size: 13.5px; color: var(--texte-2); }
.vocab-liste, .fiches { transition: opacity .35s var(--courbe), transform .45s var(--courbe); }
.vocab-liste.entree, .fiches.entree { opacity: 0; transform: translateY(10px); }
.lettre-groupe {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 16px;
  padding: 20px 0 8px;
  border-top: 1px solid var(--filet);
}
.lettre {
  position: sticky;
  top: calc(var(--entete-h) + var(--onglets-h) + 20px);
  align-self: start;
  font-size: 56px;
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--texte-2);
}
.mot { border-bottom: 1px solid var(--filet); }
.mot:last-child { border-bottom: 0; }
.mot-tete {
  width: 100%;
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) 26px;
  align-items: baseline;
  gap: 4px 14px;
  padding: 16px 4px;
  text-align: left;
  border-radius: 12px;
}
.mot-terme { font-size: 20px; font-weight: 650; letter-spacing: -0.022em; }
.mot-en { font-size: 13.5px; color: var(--texte-2); }
.mot-apercu {
  min-width: 0;
  font-size: 15px;
  color: var(--texte-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: opacity .3s;
}
.mot.ouvert .mot-apercu { opacity: 0; }
.mot-signe, .appro-signe {
  position: relative;
  flex: none;
  align-self: center;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--surface);
  transition: transform .5s var(--courbe), background-color .3s;
}
.mot-signe::before, .mot-signe::after, .appro-signe::before, .appro-signe::after {
  content: "";
  position: absolute;
  left: 50%; top: 50%;
  width: 10px; height: 1.5px;
  margin: -.75px 0 0 -5px;
  border-radius: 1px;
  background: var(--texte);
  transition: transform .5s var(--courbe);
}
.mot-signe::after, .appro-signe::after { transform: rotate(90deg); }
.mot.ouvert .mot-signe, .ouvert > .appro-tete .appro-signe { transform: rotate(180deg); }
.mot.ouvert .mot-signe::after, .ouvert > .appro-tete .appro-signe::after { transform: rotate(0deg); }
.mot-tete:hover .mot-signe { background: var(--surface-2); }
.mot-corps { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .5s var(--courbe); }
.mot.ouvert .mot-corps { grid-template-rows: 1fr; }
.mot-int { overflow: hidden; min-height: 0; padding: 0 4px; }
.mot-int::after { content: ""; display: block; height: 22px; }
.mot-def { font-size: 18px; line-height: 1.55; max-width: 680px; }
.mot-bloc { margin-top: 14px; padding: 14px 18px; border-radius: 16px; background: var(--surface); font-size: 16px; max-width: 680px; }
.mot-bloc .surtitre { margin-bottom: 4px; }
.mot-bloc--piege .surtitre { color: var(--orange); }
.mot-lien { margin-top: 16px; font-size: 15px; }
.mot.surligne { animation: surligne 1.8s var(--courbe); }
@keyframes surligne { 0%, 45% { background: rgba(var(--accent-rgb), .09); } 100% { background: transparent; } }
.vocab-aucun { margin-top: 12px; }
@media (max-width: 640px) {
  .lettre-groupe { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .lettre { position: static; font-size: 40px; }
  .mot-tete { grid-template-columns: minmax(0, 1fr) 26px; }
  .mot-terme { grid-column: 1; grid-row: 1; }
  .mot-en { grid-column: 1; grid-row: 2; }
  .mot-apercu { grid-column: 1 / -1; grid-row: 3; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .mot-signe { grid-column: 2; grid-row: 1; }
  .vocab-outils-droite { width: 100%; }
  .vocab-outils-droite .bouton { flex: 1; }
}

/* Fiches */
.fiches { max-width: 660px; margin: 8px auto 0; }
.fiches-barre { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.fiches-compteur { font-size: 15px; color: var(--texte-2); }
.fiches-compteur b { color: var(--texte); font-size: 24px; font-weight: 700; letter-spacing: -0.03em; }
.fiche-scene { position: relative; height: clamp(300px, 46vh, 400px); perspective: 1800px; }
.fiche-pile {
  position: absolute;
  inset: 0;
  border-radius: 34px;
  background: var(--surface);
  transform: translateY(14px) scale(.94);
  opacity: .6;
}
.fiche {
  position: absolute;
  inset: 0;
  border-radius: 34px;
  transform-style: preserve-3d;
  transition: transform .8s var(--courbe), opacity .24s;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.fiche:focus-visible { outline-offset: 4px; border-radius: 34px; }
.fiche.retournee { transform: rotateY(180deg); }
.fiche-face {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(26px, 5vw, 48px);
  border-radius: 34px;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--filet);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  overflow: hidden;
}
.fiche-verso { transform: rotateY(180deg); justify-content: flex-start; overflow-y: auto; }
.fiche-terme { margin-top: 10px; font-size: clamp(36px, 6vw, 58px); font-weight: 700; letter-spacing: -0.045em; line-height: 1.04; }
.fiche-en { margin-top: 10px; font-size: 17px; color: var(--texte-2); }
.fiche-indice { position: absolute; left: 0; right: 0; bottom: 24px; text-align: center; font-size: 13px; color: var(--texte-2); }
.fiche-def { margin-top: 14px; font-size: clamp(18px, 2vw, 21px); line-height: 1.5; }
.fiche-ex { margin-top: 16px; font-size: 15.5px; line-height: 1.5; color: var(--texte-2); }
.fiche-ex b { color: var(--texte); }
.fiche-vide { font-size: 20px; font-weight: 600; text-align: center; }
.fiche-marque--sait { color: var(--ok); }
.fiche-marque--revoir { color: var(--orange); }
.fiche.sort-gauche { transform: translateX(-48px) rotate(-2.5deg); opacity: 0; transition: transform .22s var(--courbe-sortie), opacity .22s; }
.fiche.sort-droite { transform: translateX(48px) rotate(2.5deg); opacity: 0; transition: transform .22s var(--courbe-sortie), opacity .22s; }
.fiche.entre-droite { transform: translateX(48px); opacity: 0; transition: none; }
.fiche.entre-gauche { transform: translateX(-48px); opacity: 0; transition: none; }
.fiches-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 30px; }
.fiches-choix { display: flex; gap: 10px; }
.fiches-nav-btn {
  width: 44px; height: 44px; flex: none;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--surface);
  font-size: 18px;
  transition: background-color .2s, transform .2s var(--courbe);
}
.fiches-nav-btn:hover { background: var(--surface-2); }
.fiches-nav-btn:active { transform: scale(.92); }
.fiches-nav-btn[disabled], .fiches-choix .bouton[disabled] { opacity: .35; pointer-events: none; }
.fiches-stats { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 20px; margin-top: 24px; font-size: 14px; color: var(--texte-2); }
.fiches-stats b { color: var(--texte); }
.fiches-aide { margin-top: 8px; text-align: center; font-size: 12.5px; color: var(--texte-2); }
@media (max-width: 520px) {
  .fiches-actions { flex-wrap: wrap; }
  .fiches-choix { order: -1; width: 100%; }
  .fiches-choix .bouton { flex: 1; }
  .fiches-actions .fiches-nav-btn:last-child { margin-left: auto; }
}
@media (prefers-reduced-motion: reduce) {
  .fiche, .fiche.retournee { transform: none; transition: none; }
  .fiche-verso { transform: none; opacity: 0; transition: opacity .2s; }
  .fiche-recto { transition: opacity .2s; }
  .fiche.retournee .fiche-recto { opacity: 0; }
  .fiche.retournee .fiche-verso { opacity: 1; }
}

/* ---------- Révision ---------- */
.rev-niveau { display: flex; flex-direction: column; gap: 10px; margin-bottom: 28px; }
.rev-niveau .segmente { width: 100%; max-width: 620px; }
.rev-grille { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
@media (max-width: 900px) { .rev-grille { grid-template-columns: minmax(0, 1fr); } }
.rev-panneau {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: clamp(24px, 3.6vw, 44px);
  border-radius: 34px;
  background: var(--surface);
  scroll-margin-top: calc(var(--entete-h) + var(--onglets-h) + 16px);
}
.rev-qcm.en-cours { grid-column: 1 / -1; }
.rev-tete .surtitre { margin-bottom: 10px; }
.rev-texte { margin-top: 12px; max-width: 520px; color: var(--texte-2); }
.rev-zone-reglages { display: flex; flex-direction: column; gap: 16px; }
.rev-reglages { display: flex; flex-direction: column; gap: 10px; }
.rev-dispo, .rev-note { font-size: 14px; color: var(--texte-2); }
.rev-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.rev-quiz-tete { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.rev-panneau .qcm { background: var(--bg); }
.bouton-texte { font-size: 14.5px; font-weight: 600; color: var(--accent-texte); padding: 6px 2px; }
.bouton-texte:hover { text-decoration: underline; text-underline-offset: 3px; }

/* =========================================================================
   Accueil : accès au Parcours ingénieur
   ========================================================================= */
.accueil-parcours {
  display: grid;
  gap: clamp(24px, 3vw, 36px);
  margin-bottom: clamp(72px, 9vw, 120px);
  padding: clamp(28px, 4.4vw, 56px);
  border-radius: 34px;
  background: var(--surface);
}
.accueil-parcours:hover { transform: translateY(-4px); box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb), .45); }
.ap-textes { display: flex; flex-direction: column; gap: 12px; max-width: 780px; }
.ap-titre { font-size: clamp(42px, 6.4vw, 80px); font-weight: 700; letter-spacing: -0.045em; line-height: .98; }
.ap-accroche { font-size: clamp(18px, 1.6vw, 21px); line-height: 1.45; color: var(--texte-2); }
.ap-pied { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 24px; font-size: 14.5px; }
.ap-meta { color: var(--texte-2); }
.accueil-parcours:hover .fleche-lien { transform: translateX(4px); }

/* Petit chemin : une pastille par étape, dans la couleur de son domaine */
.mini-chemin { position: relative; display: flex; align-items: center; justify-content: space-between; height: 22px; }
.mini-chemin-ligne { position: absolute; left: 6px; right: 6px; top: 50%; height: 1.5px; margin-top: -.75px; background: var(--filet-2); }
.mini-chemin-point {
  position: relative;
  flex: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: inset 0 0 0 1.5px var(--filet-2);
}
.mini-chemin-point.etat-dispo { box-shadow: inset 0 0 0 2px var(--accent); }
.mini-chemin-point.etat-encours { box-shadow: inset 0 0 0 2px var(--accent); }
.mini-chemin-point.etat-encours::after { content: ""; position: absolute; inset: 3.5px; border-radius: 50%; background: var(--accent); }
.mini-chemin-point.etat-termine { background: var(--accent); box-shadow: none; }
@media (max-width: 420px) { .mini-chemin-point { width: 10px; height: 10px; } .mini-chemin-point.etat-encours::after { inset: 3px; } }

/* =========================================================================
   Parcours ingénieur (#/parcours)
   ========================================================================= */
.chemin-section { margin-bottom: clamp(88px, 10vw, 140px); }
.chemin-intro { margin-top: 14px; max-width: 600px; font-size: 18px; line-height: 1.5; color: var(--texte-2); }
.chemin { position: relative; max-width: 900px; }
.chemin-trace { position: absolute; top: 0; left: 0; width: 2px; overflow: visible; pointer-events: none; z-index: 0; }
.ct-fond { stroke: var(--filet-2); stroke-width: 1.5; fill: none; stroke-dasharray: 2 6; stroke-linecap: round; }
.ct-trait { stroke: var(--texte-2); stroke-width: 2; fill: none; stroke-dasharray: 1; stroke-dashoffset: 1; stroke-linecap: round; }
.chemin-groupe + .chemin-groupe { margin-top: 30px; }
.chemin-domaine {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 4px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--accent-texte);
}
.chemin-domaine-point {
  flex: none;
  width: 10px;
  height: 10px;
  margin: 0 5px;
  border-radius: 3px;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--bg);
}
.chemin-domaine a:hover { text-decoration: underline; text-underline-offset: 3px; }
.chemin-carte {
  position: relative;
  display: grid;
  grid-template-columns: 20px 64px minmax(0, 1fr);
  column-gap: 14px;
  margin: 2px 0 2px -10px;
  padding: 18px 18px 18px 10px;
  border-radius: 22px;
  transition: background-color .35s, transform .5s var(--courbe), box-shadow .35s;
}
a.chemin-carte:hover {
  background: var(--surface);
  transform: translateX(4px);
  box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb), .35);
}
a.chemin-carte:focus-visible { outline-offset: 0; }
.chemin-noeud {
  position: relative;
  z-index: 1;
  justify-self: center;
  margin-top: 14px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--bg);
  box-shadow: inset 0 0 0 1.5px var(--filet-2);
  transition: box-shadow .4s, background-color .4s;
}
a.chemin-carte:hover .chemin-noeud { background: var(--surface); }
.etat-avenir.atteinte .chemin-noeud { box-shadow: inset 0 0 0 1.5px var(--texte-3); }
.etat-dispo .chemin-noeud, .etat-encours .chemin-noeud { box-shadow: inset 0 0 0 2px var(--accent); }
.etat-encours .chemin-noeud::after { content: ""; position: absolute; inset: 4px; border-radius: 50%; background: var(--accent); }
.etat-termine .chemin-noeud, a.chemin-carte:hover .etat-termine .chemin-noeud { background: var(--accent); box-shadow: none; }
.chemin-num { padding-top: 2px; font-size: 40px; font-weight: 600; letter-spacing: -0.05em; line-height: 1; color: var(--texte-2); }
.etat-dispo .chemin-num, .etat-encours .chemin-num, .etat-termine .chemin-num { color: var(--accent-texte); }
.chemin-corps { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.chemin-titre { font-size: clamp(24px, 2.6vw, 32px); font-weight: 700; letter-spacing: -0.035em; line-height: 1.1; }
.etat-avenir .chemin-titre { color: var(--texte-2); }
.chemin-nom { font-size: 15.5px; font-weight: 600; color: var(--texte-2); }
.chemin-accroche { max-width: 560px; font-size: 15.5px; line-height: 1.45; color: var(--texte-2); }
.chemin-etat { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 13px; font-weight: 600; color: var(--texte-2); }
.etat-dispo .chemin-etat, .etat-encours .chemin-etat, .etat-termine .chemin-etat { color: var(--accent-texte); }
@media (max-width: 560px) {
  .chemin-carte { grid-template-columns: 20px 42px minmax(0, 1fr); column-gap: 10px; padding-right: 10px; }
  .chemin-num { font-size: 28px; padding-top: 6px; }
}

/* Tous les domaines */
.pd-domaine {
  display: grid;
  grid-template-columns: minmax(0, 340px) minmax(0, 1fr);
  gap: 22px clamp(28px, 4vw, 64px);
  padding: clamp(28px, 3.6vw, 44px) 0;
  border-top: 1px solid var(--filet);
}
@media (max-width: 860px) { .pd-domaine { grid-template-columns: minmax(0, 1fr); } }
.pd-tete { display: flex; flex-direction: column; gap: 8px; }
.pd-num { font-family: var(--mono); font-size: 12.5px; font-weight: 600; color: var(--accent-texte); }
.pd-titre { font-size: clamp(30px, 3.2vw, 40px); font-weight: 700; letter-spacing: -0.04em; line-height: 1.05; }
.pd-titre a { transition: color .2s; }
.pd-titre a:hover { color: var(--accent-texte); }
.pd-accroche { font-size: 16px; line-height: 1.45; color: var(--texte-2); }
.pd-compte { font-size: 13px; color: var(--texte-2); }
.pd-cours { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; align-content: start; }
.pd-c {
  display: flex;
  flex-direction: column;
  gap: 4px;
  height: 100%;
  padding: 16px 18px;
  border-radius: 18px;
  box-shadow: inset 0 0 0 1px var(--filet);
}
a.pd-c { background: var(--surface); box-shadow: none; transition: box-shadow .3s, transform .4s var(--courbe); }
a.pd-c:hover { box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb), .45); transform: translateY(-2px); }
.pd-c-titre { font-size: 19px; font-weight: 700; letter-spacing: -0.025em; line-height: 1.2; }
.pd-c.etat-avenir .pd-c-titre { color: var(--texte-2); }
.pd-c-nom { font-size: 13.5px; line-height: 1.35; color: var(--texte-2); }
.pd-c-etat { margin-top: auto; padding-top: 8px; font-size: 12px; font-weight: 600; color: var(--texte-2); }
a.pd-c .pd-c-etat { color: var(--accent-texte); }
