/* Le grand worker du haut de l'accueil (09/11), index.html et en/index.html. ÉCRITE PAR
   outils/illustrations/accueil_heros.py : ne pas la modifier à la main. À droite du texte, à partir de 1 100 px : un grand
   personnage de l'équipe (le socle, les jambes, le buste à la couleur du poste, la tête = la tuile du poste), sur un
   plateau de nuit au liseré de sa couleur ; les neuf postes l'un après l'autre (3,5 s chacun, heros.js), son nom, sa
   mission quand elle est courte, « Voir sa fiche », les neuf têtes. Les couleurs de poste ne vont qu'au dessin : le lien
   reste iris, le focus iris, la tête choisie cerclée de nuit. Sous 1 100 px : sous le texte, en compact. Sans JavaScript et
   en mouvement réduit : Recherche en scène, rien ne bouge. */
.h-p--recherche { --h-fonce: #12396D; --h-clair: #E2F2FF; --h-vive: #8EBAF7; }
.h-p--web { --h-fonce: #3F4752; --h-clair: #EDEFF2; --h-vive: #C3CAD3; }
.h-p--courrier { --h-fonce: #5E6C7A; --h-clair: #ECF1F6; --h-vive: #92A4B2; }
.h-p--rangement { --h-fonce: #0B5248; --h-clair: #DAF5EF; --h-vive: #5FC4B0; }
.h-p--facturation { --h-fonce: #044730; --h-clair: #DDF8EA; --h-vive: #58B78E; }
.h-p--factures-recues { --h-fonce: #496222; --h-clair: #EAF5DD; --h-vive: #B3C976; }
.h-p--controle-avant-paiement { --h-fonce: #76293A; --h-clair: #FFE7EB; --h-vive: #E796A8; }
.h-p--suivi-de-chantier { --h-fonce: #88641C; --h-clair: #FCEED7; --h-vive: #D4A552; }
.h-p--seo { --h-fonce: #005F66; --h-clair: #D7F7FA; --h-vive: #68CDD3; }
/* 09/11, Yann : « marrant, sur mobile je ne vois pas les workers en page d'accueil » : sous 1 100 px, le carrousel
   passe sous le texte, en compact (le personnage à gauche, son nom et sa mission à droite, les neuf têtes dessous) */
.heros { position: relative; display: grid; grid-template-columns: 128px minmax(0, 1fr); column-gap: 18px; align-items: center;
  margin-top: 32px; }
.heros > .heros__scene { grid-column: 1; grid-row: 1; --perso-h: 156px; --perso-l: calc(156px * 0.6102); height: 176px; }
.heros > .heros__legendes { grid-column: 2; grid-row: 1; margin-top: 0; padding-top: 30px; }
.heros > .heros__tetes { grid-column: 1 / -1; grid-row: 2; }
.heros > .heros__pause { top: 0; right: 0; }
@media (min-width: 640px) { .heros { grid-template-columns: 160px minmax(0, 32rem); }
  .heros > .heros__scene { --perso-h: 190px; --perso-l: calc(190px * 0.6102); height: 212px; } }
/* la grille du haut de page : la première colonne garde chaque moitié du titre sur sa ligne (la plus longue, mesurée,
   fait 15,1 fois --taille-xl), la seconde (au plus 320 px) porte le bloc, en position absolue, hors du calcul des hauteurs */
@media (min-width: 1100px) {
  .accroche .wrap { position: relative; display: grid; align-items: start; column-gap: 32px;
    grid-template-columns: minmax(0, 1fr) min(320px, calc(100% - var(--taille-xl) * 15.45 - 32px)); grid-template-rows: repeat(5, auto); }
  .accroche .wrap > * { grid-column: 1; }
  .accroche .wrap > .accroche__suite { justify-self: start; }
  .accroche .wrap > .heros { display: block; position: absolute; grid-column: 2; grid-row: 1 / 6; top: 4px; left: 0; right: 0; margin: 0; }
  .accroche .wrap > .heros > .heros__scene { --perso-h: 240px; --perso-l: 146.4px; height: 276px; }
  .accroche .wrap > .heros > .heros__legendes { margin-top: 14px; padding-top: 0; }
  .accroche .wrap > .heros > .heros__pause { top: 10px; right: 10px; }
}

/* 09/11, Yann : « sans le fond noir, directement sur le fond blanc » : le worker se tient sur le papier de l'accueil, sans
   plateau ; color porte la vive du poste en scène (le trait du socle, une lueur douce au sol) et passe d'un poste à
   l'autre en douceur */
.heros__scene { --perso-h: 240px; --perso-l: 146.4px; position: relative; height: 276px; border-radius: 16px;
  overflow: hidden; color: var(--h-fonce); transition: color .8s ease;
  background: radial-gradient(46% 14% at 50% 93%, color-mix(in srgb, var(--h-vive) 26%, transparent), transparent 75%); }
.heros__piste { position: absolute; inset: 0;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 16%, #000 84%, transparent); mask-image: linear-gradient(90deg, transparent, #000 16%, #000 84%, transparent); }
.heros__socle, .heros__perso { position: absolute; bottom: 10px; left: calc(50% - var(--perso-l) / 2); display: block;
  width: var(--perso-l); height: var(--perso-h); max-width: none; overflow: visible; }
.heros__socle-fond { fill: color-mix(in srgb, var(--h-vive) 14%, transparent); }
.heros__socle-trait { fill: none; stroke: currentColor; stroke-width: 1.4; }
.heros__perso { visibility: hidden; }
.heros__perso.est-courant, .heros__perso.est-sortant { visibility: visible; }
.hp__ombre { fill: rgba(16, 16, 20, .16); }
.hp__jambe { fill: #2E2E38; transform-box: fill-box; transform-origin: 50% 0; }
.hp__buste { fill: color-mix(in srgb, var(--h-vive) 78%, var(--h-fonce)); }
.hp__tete { fill: var(--h-fonce); stroke: var(--h-vive); stroke-width: .9; }
.hp__picto { color: var(--h-clair); fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.heros__perso.est-courant:not(.est-entrant) { filter: drop-shadow(0 10px 14px rgba(16, 16, 20, .12)); }

/* Pause, Reprendre : sur le papier, à l'encre */
.heros__pause { position: absolute; z-index: 2; top: 10px; right: 10px; min-height: 28px; padding: 2px 10px;
  border: 1px solid var(--gris-2, #8A8A93); border-radius: 7px; background: var(--papier-chaud, #F5F4EF); color: var(--nuit, #101014);
  font: 500 12px/1.2 var(--texte); cursor: pointer; }
.heros__pause:hover { border-color: var(--nuit, #101014); }
.heros__pause:focus-visible { outline: 2px solid var(--iris, #6D5BD0); outline-offset: 2px; }
.heros__pause[hidden] { display: none; }

/* sous le plateau : les neuf légendes empilées dans la même case (la plus haute donne la hauteur : rien ne saute) */
.heros__legendes { display: grid; margin-top: 14px; }
.heros__legende { grid-area: 1 / 1; display: flex; flex-direction: column; align-items: flex-start; min-width: 0;
  opacity: 0; visibility: hidden; transition: opacity .3s ease, visibility 0s .3s; }
.heros__legende.est-courant { opacity: 1; visibility: visible; transition: opacity .45s ease .3s, visibility 0s; }
.heros__nom { font-family: var(--display); font-weight: 600; font-size: var(--taille-s); line-height: var(--interligne-s);
  letter-spacing: var(--approche-s); color: var(--nuit); }
.heros__mission { margin-top: 4px; font-size: 15px; line-height: 1.45; color: var(--gris-3); }
.heros__lien { display: inline-flex; align-items: center; gap: 6px; margin-top: auto; padding-top: 8px; font-size: 16px; line-height: 1.5; }
.heros__lien .picto { width: 16px; height: 16px; transition: transform .2s ease; }
.heros__lien:hover .picto { transform: translateX(3px); }

/* les neuf têtes : des liens vers les fiches sans JavaScript, des boutons avec ; celle en scène est cerclée de nuit */
.heros__tetes { display: grid; grid-template-columns: repeat(9, minmax(0, 32px)); justify-content: space-between; gap: 4px; margin-top: 14px; }
.heros__tete { display: block; aspect-ratio: 1; padding: 0; border: 0; border-radius: 7px; background: none; cursor: pointer; }
.heros__tuile { display: block; width: 100%; height: 100%; transition: transform .2s ease; }
.heros__tete:hover .heros__tuile { transform: translateY(-2px); }
.heros__tete.est-courant { box-shadow: 0 0 0 2px var(--papier-chaud), 0 0 0 3.5px var(--nuit); }
.ht__fond { fill: var(--h-fonce); stroke: var(--h-vive); stroke-width: .9; }
.ht__picto { color: var(--h-clair); fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

/* le mouvement (heros.js pose est-entrant et est-sortant ; jamais en mouvement réduit) : il sort à droite en marchant, le
   suivant arrive de la gauche en marchant ; debout, un souffle léger. est-en-pause fige le souffle. */
@media (prefers-reduced-motion: no-preference) {
  .heros__perso.est-sortant { animation: heros-sortie 900ms cubic-bezier(.45, 0, .8, .6) forwards; }
  .heros__perso.est-entrant { animation: heros-entree 1100ms cubic-bezier(.2, .6, .35, 1) 350ms both; }
  .heros__perso.est-entrant .hp__jambe--g, .heros__perso.est-sortant .hp__jambe--g { animation: heros-pas .3s ease-in-out infinite alternate; }
  .heros__perso.est-entrant .hp__jambe--d, .heros__perso.est-sortant .hp__jambe--d { animation: heros-pas .3s ease-in-out -.3s infinite alternate; }
  .heros__perso.est-entrant .hp__haut, .heros__perso.est-sortant .hp__haut { animation: heros-trot .15s ease-in-out infinite alternate; }
  .heros__perso.est-courant:not(.est-entrant) .hp__haut { animation: heros-souffle 2.6s ease-in-out infinite; }
  .heros__perso.est-courant:not(.est-entrant) .hp__picto { animation: heros-lueur 2.6s ease-in-out infinite; }
  .heros.est-en-pause .heros__perso:not(.est-entrant):not(.est-sortant) * { animation-play-state: paused; }
}
@media (prefers-reduced-motion: reduce) {
  .heros__scene, .heros__legende, .heros__legende.est-courant, .heros__tuile, .heros__lien .picto { transition: none; }
}
@keyframes heros-entree { from { transform: translateX(-175%); } to { transform: translateX(0); } }
@keyframes heros-sortie { from { transform: translateX(0); } to { transform: translateX(175%); } }
@keyframes heros-pas { from { transform: rotate(-18deg); } to { transform: rotate(18deg); } }
@keyframes heros-trot { from { transform: translateY(0); } to { transform: translateY(-.9px); } }
@keyframes heros-souffle { 50% { transform: translateY(-.8px); } }
@keyframes heros-lueur { 50% { opacity: .65; } }
