/* ==========================================================================
   animations.css — l'animation d'ouverture de la page d'accueil N15.
   Portée le 05/11/2026 depuis la maquette validée (maquettes/accueil/) :
   la variante Mosaïque au rythme calme seule. Elle lit les jetons de la
   page (public/vitrine/vitrine.css). Le rouge est PLEIN ou il n'est pas :
   il marque le choix du client, le scénario mis en avant et « 15 ans ».
   ========================================================================== */

.scene { padding: 44px 0 32px; }
.anim-scene { position: relative; min-height: 470px; transition: opacity .4s ease; }
.anim-scene.sortie { opacity: 0; }
/* La mosaïque a une hauteur fixe (cadre commun, texte réservé) : pas de
   hauteur minimale, la signature se pose juste dessous. */
.anim-scene.anim-mosaique { min-height: 0; }

/* Le rythme (02/11) : les durées des transitions suivent le réglage. */
.anim-scene { --t-opt: 140ms; --t-ecartee: 0s; --t-passe: .8s; --t-scen: 1.2s; --t-scen-pas: 90ms; --t-case: .35s; }
/* --t-opt : l'écart entre deux options ; il vaut `p_pas` d'animations.js. */
.anim-scene[data-rythme="calme"] { --t-opt: 400ms; --t-ecartee: 0s; --t-passe: 1.1s; --t-scen: 1.6s; --t-scen-pas: 130ms; --t-case: .5s; }

.anim-signature {
  margin: 10px 0 0; text-align: center; min-height: 1.3em; text-wrap: balance;
  font-family: var(--police-titre); font-weight: var(--graisse-titre);
  font-size: clamp(1.45rem, 1rem + 2vw, 2.3rem); letter-spacing: -.01em;
  opacity: 0; transform: translateY(6px); transition: opacity .6s ease, transform .6s ease;
}
.anim-signature.vu { opacity: 1; transform: none; }
.anim-signature .n15 { color: var(--marque); }

/* Les points : ceux des carrousels du site (10 px, gris, l'actif en rouge). */
.anim-pied { display: flex; justify-content: center; align-items: center; gap: 22px; margin-top: 18px; }
.anim-points { display: flex; gap: 9px; }
/* Sans fondu : le point actif passe au rouge d'un coup (audit, 02/11). */
.anim-point { width: 10px; height: 10px; padding: 0; border: 0; border-radius: 50%; background: var(--case-b); cursor: pointer; }
.anim-point:hover { background: var(--case-d); }
.anim-point[aria-current="true"] { background: var(--action); }

/* ── Ce qui apparaît ──────────────────────────────────────────────────── */
.a-precision, .a-statut {
  opacity: 0; transform: translateY(6px); transition: opacity .45s ease, transform .45s ease;
}
.a-precision.vu, .a-statut.vu { opacity: 1; transform: none; }
.a-statut.vu.fini { opacity: 0; }

/* ── La question, la précision, le travail ───────────────────────────── */
.a-tape::after {
  content: ""; display: inline-block; width: 2px; height: 1.1em; margin-left: 2px; vertical-align: -3px;
  background: var(--encre); animation: a-clignote 1s steps(1) infinite;
}
.envoyee .a-tape::after { display: none; }
@keyframes a-clignote { 50% { opacity: 0; } }

.a-precision { padding: 13px 16px; border: .8px solid var(--filet); border-radius: var(--rayon-bloc); background: var(--fond); }
/* L'introduction reste après le choix : la cacher faisait rétrécir le bloc,
   et tout ce qui est dessous sautait (24 px mesurés sur téléphone). */
.a-precision-intro { font-size: .85rem; color: var(--encre-3); }
.a-precision-q { margin-top: 3px; font-family: var(--police-titre); font-weight: 600; font-size: 1.02rem; transition: opacity .4s ease; }
/* Dans l'ordre de lecture (02/11) : le bloc et son introduction (.vu),
   puis la question (.q-vu), puis les options une à une (.options-vu). En
   rythme « actuel », les trois arrivent ensemble, comme le 22/10. */
.a-precision:not(.q-vu) .a-precision-q { opacity: 0; }
.anim-scene[data-rythme="calme"] .a-precision { transition-duration: .6s; }
.a-options { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }
.a-option {
  padding: 5px 11px; border: .8px solid var(--case-b); border-radius: var(--rayon); font-size: .88rem; background: var(--fond);
  opacity: 0; transform: translateY(4px);
  transition: opacity .35s ease calc(var(--i) * var(--t-opt)), transform .35s ease calc(var(--i) * var(--t-opt)),
              background-color .2s, color .2s, border-color .2s, box-shadow .2s;
}
.a-precision.options-vu .a-option { opacity: 1; transform: none; }
/* Visée : l'option est entourée avant d'être choisie (rythme calme). */
.a-option.visee { border-color: var(--encre); box-shadow: inset 0 0 0 .7px var(--encre); transition-delay: 0s; }
.a-precision.vu .a-option.ecartee { opacity: .35; transition-delay: var(--t-ecartee); }
/* Audit des rouges (02/11) : dans l'animation, tout ce que dit N15 est en
   bordeaux (--marque), le choix du client compris ; le rouge Paxter
   (--action) reste à la page. Et un aplat rouge apparaît d'un coup : un
   fondu le faisait passer par le rose pâle. */
.a-option.choisie { background: var(--marque); color: #fff; border-color: transparent; transition: none; }
/* Le champ libre « Autre… » (04/11) : le client y tape sa précision. Son
   texte final, invisible, fixe sa largeur ; l'indication et la frappe se
   posent par-dessus. */
.a-libre { position: relative; border-style: dashed; }
.a-libre-fantome { visibility: hidden; white-space: nowrap; }
.a-libre-place, .a-libre-texte { position: absolute; inset: 0; padding: inherit; white-space: nowrap; }
.a-libre-place { color: var(--encre-3); }
.a-libre.ecrit .a-libre-place { visibility: hidden; }
.a-libre-texte::after {
  content: ""; display: none; width: 1.5px; height: 1em; margin-left: 1px; vertical-align: -2px;
  background: currentColor; animation: a-clignote 1s steps(1) infinite;
}
.a-libre.ecrit:not(.choisie) .a-libre-texte::after { display: inline-block; }
.a-libre.choisie { border-style: solid; }

.a-statut { display: flex; align-items: center; gap: 10px; min-height: 1.6em; font-size: .95rem; color: var(--encre-2); }
/* Une phrase de travail laisse la place à la suivante en fondu. */
.a-statut-texte { transition: opacity .2s ease; }
.a-statut.change .a-statut-texte { opacity: 0; }
.a-sablier { display: inline-flex; gap: 3px; }
.a-sablier i { width: 7px; height: 7px; border-radius: 1.5px; background: var(--case-b); animation: a-pouls 1.2s steps(1) infinite; }
.a-sablier i:nth-child(2) { animation-delay: .4s; }
.a-sablier i:nth-child(3) { animation-delay: .8s; }
@keyframes a-pouls { 0% { background: var(--marque); } 33% { background: var(--case-b); } }

/* ── La projection à 15 ans ───────────────────────────────────────────── */
/* Joël, 02/11 : les titres au-dessus de la mosaïque, plus grands, plus
   lisibles (« Projections N15 » passe de .78 à 1 rem ; les textes du
   dessin, de 11-14 à 13-17 unités). */
.a-projection-titre { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin: 0 0 8px; font-family: var(--police-titre); font-weight: 700; font-size: 1.1rem; line-height: 1.25; }
/* En encre, plus en rouge (audit du 02/11) : le rouge reste au choix du
   client, au scénario retenu, à « 15 ans » et à la marque. */
.a-projection-marque { font-family: var(--police-corps); font-weight: 700; font-size: 1rem; letter-spacing: .01em; color: var(--encre); }
.a-eventail-svg { display: block; width: 100%; height: auto; overflow: visible; }
.e-axe { stroke: var(--case-b); stroke-width: 1; }
.e-annees text { font: 600 13px var(--police-corps); fill: var(--encre-3); }
.e-annees .e-annee-forte { fill: var(--encre); font-weight: 700; }
.e-annees { opacity: 0; transition: opacity .4s ease; }
.passe .e-annees { opacity: 1; }
.e-passe {
  fill: none; stroke: var(--encre); stroke-width: 3.5; stroke-linecap: round;
  stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset var(--t-passe) cubic-bezier(.45, 0, .2, 1);
}
.passe .e-passe { stroke-dashoffset: 0; }
.e-aujourdhui { stroke: var(--case-c); stroke-width: 1; stroke-dasharray: 3 4; opacity: 0; transition: opacity .3s ease; }
.present .e-aujourdhui { opacity: 1; }
.e-scenario {
  fill: none; stroke: var(--case-c); stroke-width: 2.4; stroke-linecap: round;
  stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset var(--t-scen) cubic-bezier(.45, 0, .2, 1) calc(var(--i) * var(--t-scen-pas));
}
.e-scenario.e-cible { stroke: var(--marque); stroke-width: 4; }
.projete .e-scenario { stroke-dashoffset: 0; }
.e-bande { fill: var(--case-a); opacity: 0; transition: opacity .9s ease .7s; }
.projete .e-bande { opacity: .75; }
.e-accolade path { fill: none; stroke: var(--encre-2); stroke-width: 1.2; }
.e-accolade text { font: 700 17px var(--police-titre); fill: var(--marque); }
.e-accolade { opacity: 0; transition: opacity .5s ease .2s; }
.projete .e-accolade { opacity: 1; }
.e-noms text { font: 600 14px var(--police-corps); fill: var(--encre-2); }
.e-noms .e-cible { fill: var(--marque); font-weight: 700; }
.e-valeurs text { font: 700 13px var(--police-titre); fill: var(--encre); }
.e-noms, .e-valeurs { opacity: 0; transition: opacity .5s ease; }
.nomme .e-noms { opacity: 1; }
.nomme .e-valeurs { opacity: .85; }

/* ── Les barres comparatives : aujourd'hui et 2040 ────────────────────
   Des rectangles pleins mis à l'échelle depuis leur pied : la poussée et
   la bascule de scénario sont des transitions. Aujourd'hui en gris clair,
   2040 en gris foncé, l'élément mis en avant en rouge plein. */
.b-cle { display: inline-flex; align-items: center; gap: 6px; }
.b-pastille { width: 10px; height: 10px; border-radius: 2px; }
.b-pastille-auj { background: var(--case-b); }
.b-pastille-fut { background: var(--case-d); }
/* « 15 ans » entre aujourd'hui et 2040, sans les traits (Joël, 02/11). */
.b-quinze { display: inline-flex; align-items: center; font-family: var(--police-titre); font-weight: 700; color: var(--marque); }
.m-barres-svg { display: block; width: 100%; height: auto; overflow: visible; }
.b-noms text { font: 600 13px var(--police-corps); fill: var(--encre-2); }
/* La valeur (floue) suit le haut de la barre de 2040. */
.b-valeurs text {
  font: 700 13px var(--police-titre); fill: var(--encre);
  transform: translateY(calc((1 - var(--s1)) * var(--h) * 1px)); transition: transform .9s cubic-bezier(.45, 0, .2, 1);
}
.alt .b-valeurs text { transform: translateY(calc((1 - var(--s2)) * var(--h) * 1px)); }
.b-noms, .b-valeurs { opacity: 0; transition: opacity .5s ease; }
.present .b-noms { opacity: 1; }
.nomme .b-valeurs { opacity: .85; }


/* ── 2. La mosaïque ───────────────────────────────────────────────────── */
.a-mosaique { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); gap: 48px; align-items: center; }
.m-texte { display: flex; flex-direction: column; gap: 14px; }
.m-q { min-height: 2.7em; font-family: var(--police-titre); font-weight: 600; font-size: clamp(1.25rem, 1rem + 1vw, 1.65rem); line-height: 1.3; }
/* La question entière, invisible, tient sa place ; la frappe s'écrit
   par-dessus : rien ne bouge quand elle passe à la ligne. */
.m-q { position: relative; }
.m-q-place { visibility: hidden; }
.m-q .a-tape { position: absolute; left: 0; top: 0; right: 0; }
.m-pile { position: relative; }
.m-grille { position: absolute; left: 0; height: auto; z-index: 0; }
.m-pile .a-eventail-svg, .m-pile .m-barres-svg { position: relative; z-index: 1; }
.m-case { fill: var(--case-vide); transition: fill var(--t-case) ease; }
.m-case.a { fill: var(--case-a); } .m-case.b { fill: var(--case-b); }
.m-case.c { fill: var(--case-c); } .m-case.d { fill: var(--case-d); }
.m-case.m { fill: var(--marque); }
/* Sur la mosaïque, la fourchette est un voile de la grille, pas un aplat. */
.a-mosaique .e-bande { fill: var(--case-b); }
.a-mosaique .projete .e-bande { opacity: .35; }
/* Les barres dans le cadre commun : la légende dans la marge du haut, les
   scénarios dans celle de droite, comme les noms des courbes de l'éventail. */
.m-cles {
  position: absolute; left: 0; top: 0; z-index: 2; margin: 0;
  display: flex; align-items: center; justify-content: center; gap: 12px;
  font-size: .95rem; color: var(--encre-2);
}
.m-scenarios {
  position: absolute; z-index: 2; margin: 0; padding: 0; list-style: none;
  display: flex; flex-direction: column; justify-content: space-around;
  font-size: .95rem; color: var(--encre-2);
}
.m-scenarios li { display: flex; align-items: center; gap: 8px; transition: color .3s ease; }
.m-scenarios i { width: 14px; height: 3px; border-radius: 2px; background: var(--case-c); transition: height .3s ease; }
.m-scenarios .actif { color: var(--marque); font-weight: 700; }
.m-scenarios .actif i { height: 4px; background: var(--marque); }
.a-mosaique .m-cles, .a-mosaique .m-scenarios, .a-mosaique .m-cote { transition: opacity .5s ease; }
.a-mosaique:not(.projette) .m-cles, .a-mosaique:not(.projette) .m-scenarios, .a-mosaique:not(.projette) .m-cote { opacity: 0; }

/* ── Les images du 04/11 : carte, classement, gâteau ─────────────────── */
.m-pile .m-calque { position: relative; z-index: 1; display: block; width: 100%; height: auto; }
.m-cote {
  position: absolute; z-index: 2; margin: 0; padding: 0; list-style: none;
  font-size: .95rem; color: var(--encre-2);
}
.m-bas { position: absolute; left: 0; z-index: 2; margin: 0; opacity: 0; transition: opacity .5s ease; }
.m-bas.vu { opacity: .85; }
.m-bas span, .m-titres span { position: absolute; top: 50%; transform: translate(-50%, -50%); white-space: nowrap; }
.m-bas span { font: 700 1rem var(--police-titre); color: var(--encre); }
.flou { filter: blur(3.5px); }
/* La carte : la frise d'aujourd'hui à 2040, son curseur rouge plein. */
.m-frise { gap: 14px; }
.m-piste { position: relative; width: 38%; height: 2px; background: var(--case-b); }
.m-curseur { position: absolute; left: 0; top: 50%; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; background: var(--marque); }
.m-frise.avance .m-curseur { left: 100%; transition: left var(--d-frise, 2.6s) linear; }
.m-quinze { position: absolute; left: 50%; bottom: 8px; transform: translateX(-50%); font-family: var(--police-titre); font-weight: 700; color: var(--marque); white-space: nowrap; }
.m-frise-a { transition: color .3s ease; }
.m-frise.arrivee .m-frise-a { color: var(--encre); font-weight: 700; }
.m-rampe { display: flex; align-items: center; gap: 4px; }
.m-rampe i, .e-rampe i { width: 14px; height: 14px; border-radius: 2px; }
.m-rampe .a, .e-rampe .a { background: var(--case-a); }
.m-rampe .b, .e-rampe .b { background: var(--case-b); }
.m-rampe .c, .e-rampe .c { background: var(--case-c); }
.m-rampe .d, .e-rampe .d { background: var(--case-d); }
/* Le classement : d'aujourd'hui à l'année visée ; les noms glissent vers
   leur nouveau rang. */
.m-annees { gap: 12px; }
.m-annee { color: var(--encre-3); transition: color .3s ease; }
.m-annee.actif { color: var(--encre); font-weight: 700; }
.m-annee-visee.actif { color: var(--marque); }
.m-fleche { position: relative; width: 34px; height: 2px; background: var(--case-c); }
.m-fleche::after { content: ""; position: absolute; right: -2px; top: -4px; border: 5px solid transparent; border-right: 0; border-left: 7px solid var(--case-c); }
.m-noms-h li { position: absolute; left: 0; display: flex; align-items: center; gap: 8px; transform: translateY(-50%); transition: top .7s cubic-bezier(.3, 0, .2, 1); }
.m-noms-h i { width: 14px; height: 3px; border-radius: 2px; background: var(--case-c); }
.m-noms-h .fort i { height: 4px; background: var(--marque); }
/* Le gâteau : les titres des deux grilles, la légende. */
.m-titres { display: block; }
.m-titres span { font-family: var(--police-titre); font-weight: 700; font-size: 1rem; color: var(--encre); }
.m-legende-cote { display: flex; flex-direction: column; justify-content: center; }
.m-legende-cote li { display: flex; align-items: center; gap: 8px; }
.m-legende-cote i { width: 14px; height: 14px; border-radius: 2px; }
.m-legende-cote i.m { background: var(--marque); }
/* La sortie douce (rythme calme) : le texte et les tracés s'effacent, la
   grille se vide (JS) ; la question suivante se pose sur la même grille. */
.anim-scene.sortie-douce .m-texte, .anim-scene.sortie-douce .a-eventail-svg, .anim-scene.sortie-douce .m-barres-svg,
.anim-scene.sortie-douce .m-cles, .anim-scene.sortie-douce .m-scenarios, .anim-scene.sortie-douce .e-legende,
.anim-scene.sortie-douce .m-cote, .anim-scene.sortie-douce .m-bas {
  opacity: 0; transition: opacity .6s ease;
}


/* La légende des scénarios n'existe que sur les écrans étroits. */
.e-legende { display: none; }

/* ── Écrans étroits ───────────────────────────────────────────────────── */
@media (max-width: 760px) {
  .anim-scene { min-height: 0; }
  .e-legende { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 10px 0 0; padding: 0; list-style: none; font-size: .82rem; color: var(--encre-2); transition: opacity .4s ease; }
  .e-legende li { display: inline-flex; align-items: center; gap: 6px; }
  .e-legende i { width: 14px; height: 3px; border-radius: 2px; background: var(--case-c); }
  .e-legende .e-cible, .e-legende .actif { color: var(--marque); font-weight: 700; }
  .e-legende .e-cible i, .e-legende .actif i { height: 4px; background: var(--marque); }
  .e-legende li { transition: color .3s ease; }
  .a-mosaique:not(.projette) .e-legende { opacity: 0; }
  /* Options compactes : sur 375 px, la plus large passait à la ligne (310 px
     pour 310 disponibles) et la place réservée pour elle laissait un vide
     sous les autres questions. Compactes, 281 px au plus (FR et EN). */
  .a-option { padding: 4px 8px; font-size: .84rem; }
  /* Sur téléphone, les scénarios des barres passent dessous, en légende ;
     les autres textes de la marge de droite disparaissent (ils sont flous
     ou redits ailleurs). Chaque image a sa légende dessous, de même
     hauteur : la page ne bouge pas d'une question à l'autre. */
  .m-scenarios, .m-cote { display: none; }
  .m-droite .e-legende { min-height: 48px; align-content: flex-start; }
  .e-rampe { gap: 4px; }
  .e-legende li.actif i { width: 14px; height: 14px; }
  .m-piste { width: 30%; }
  .m-cles { font-size: .82rem; gap: 8px; }
  /* Le graphique rapetisse : ses textes grossissent d'autant (unités du dessin). */
  .e-annees text { font-size: 20px; }
  .e-accolade text { font-size: 26px; }
  .a-mosaique { grid-template-columns: 1fr; gap: 20px; }
}
