/* Union Beynoise Handball — héros animé de la page d’accueil (static/index.html).
   Le film est piloté par js/hero-motion.js (Web Animations : transform, opacity, clip-path).
   Sans JavaScript, ou avec « réduire les animations », rien de ce fichier ne s’applique : héros approuvé. */

/* Film en cours ou terminé : les entrées CSS du héros statique laissent la main au film.
   Leur état final est l’état de repos du héros approuvé, donc rien ne bouge à la fin. */
.hm .hs1,.hm .hs2,.hm .hs3,.hm .hb1,.hm .hb2,.hm .ln>span,.hm .hero-foot,.hm .next{animation:none}
.hm .hero h1{transform-origin:0 100%}
.hm .ln{position:relative}
/* Trait cyan qui suit chaque ligne du titre (garé hors du masque de la ligne au repos). */
.hm .ln::after{content:"";position:absolute;top:0;bottom:0;left:0;width:calc(var(--hm-t,.16em) + var(--hm-kh,.4em));background:var(--cyan);clip-path:polygon(0 0,var(--hm-t,.16em) 0,calc(var(--hm-t,.16em) + var(--hm-kh,.4em)) 100%,var(--hm-kh,.4em) 100%);transform:translateX(-110%);pointer-events:none;z-index:-1}

/* Première image, avant que le script prenne la main (quelques millisecondes) : champ bleu nuit. */
.hm-pre .hs,.hm-pre .hb,.hm-pre .hero h1,.hm-pre .hero-foot,.hm-pre .next{opacity:0}

/* Couches du film */
.hm-film,.hm-fx{position:absolute;inset:0;z-index:1;overflow:hidden;pointer-events:none}
.hm-layer{position:absolute;inset:0}
.hm-p{position:absolute;inset:0;overflow:hidden;isolation:isolate;clip-path:polygon(0 0,0 0,0 0,0 0)}
.hm-p>img,.hm-p>video{position:absolute;max-width:none;display:block;filter:grayscale(1) contrast(1.08) brightness(1.55)}
.hm-p>video{object-fit:cover}
.hm-p::after{content:"";position:absolute;inset:0;background:var(--duo);mix-blend-mode:multiply}
/* Voile local derrière le titre (placé par le script) : le titre reste lisible, la photo reste claire. */
.hm-scrim{position:absolute;background:radial-gradient(closest-side,rgba(11,21,58,.78),rgba(11,21,58,.62) 55%,rgba(11,21,58,0))}
/* Traits diagonaux (même angle que les tranches : 24 % de la largeur sur la hauteur du cadre).
   Ancrés à gauche ; le script les déplace en translateX (pourcentage de la largeur du cadre). */
.hm-st{position:absolute;inset:0;background:var(--cyan);clip-path:polygon(0 0,.9% 0,24.9% 100%,24% 100%)}
.hm-st.is-w{background:var(--blanc)}
/* Traîne lumineuse derrière un bord de coupe (filé de mouvement). */
.hm-smear{position:absolute;inset:0;background:linear-gradient(90deg,rgba(196,236,246,0),rgba(196,236,246,.2));clip-path:polygon(0 0,7% 0,31% 100%,24% 100%)}
.hm-smear.is-r{background:linear-gradient(270deg,rgba(196,236,246,0),rgba(196,236,246,.2))}
.hm-crest{position:absolute;left:50%;top:44%;width:clamp(150px,19vw,280px);height:auto;margin:calc(clamp(150px,19vw,280px) / -2) 0 0 calc(clamp(150px,19vw,280px) / -2)}


/* Tranches finales avec un clip (emplacements tranche1–3) : mêmes cadrage et bichromie que les photos. */
.hs video{position:absolute;top:-6%;height:112%;width:auto;max-width:none;filter:grayscale(1) contrast(1.2) brightness(1.15);animation:breathe 16s ease-in-out infinite alternate}
.hs1 video{left:14%;top:3%;height:106%}
.hs2 video{left:0;top:0;width:100%;height:100%;object-fit:cover;animation-delay:-6s}
.hs3 video{left:58%;animation-delay:-11s;filter:grayscale(1) contrast(1.05) brightness(2)}

/* Reflet qui parcourt le trait cyan au repos (couche d’ambiance, toutes les 9 s). */
.hm-glint{position:absolute;inset:0;overflow:hidden;pointer-events:none;clip-path:polygon(46.6% 0,47.4% 0,71.4% 100%,70.6% 100%)}
.hm-glint i{position:absolute;left:0;right:0;top:0;height:34%;background:linear-gradient(180deg,rgba(255,255,255,0),rgba(255,255,255,.95) 50%,rgba(255,255,255,0));transform:translateY(-110%)}
.hm-glint.is-w{clip-path:polygon(68.6% 0,69.4% 0,93.4% 100%,92.6% 100%)}
.hm-glint.is-w i{background:linear-gradient(180deg,rgba(43,190,222,0),rgba(43,190,222,.95) 50%,rgba(43,190,222,0))}

/* Commande pause / lecture / revoir : discrète, au clavier, dans la charte. */
.hm-ctl{position:absolute;z-index:3;right:max(24px,calc((100% - 1232px) / 2));top:138px;display:flex;align-items:center;gap:6px}
.hm-b{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-width:44px;height:44px;padding:0 12px;border:0;border-radius:3px;background:rgba(11,21,58,.78);color:var(--blanc);font:600 14px var(--ui);cursor:pointer;transition:background-color .25s cubic-bezier(.16,1,.3,1),color .25s cubic-bezier(.16,1,.3,1)}
.hm-b:hover{background:var(--nuit);color:var(--cyan)}
.hm-b svg{width:18px;height:18px;flex:none}
.hm-b[data-hm="toggle"]{width:44px;padding:0}
.hm-prog{position:absolute;left:0;right:0;bottom:-6px;height:2px;background:rgba(197,204,232,.25);overflow:hidden}
.hm-prog i{position:absolute;inset:0;background:var(--cyan);transform-origin:0 50%;transform:scaleX(0)}
.hm-ctl:not(.is-film) .hm-prog{display:none}
/* Pause demandée : l’ambiance s’arrête aussi (dérive des photos, reflets). */
.hm-hold .hs img,.hm-hold .hs video{animation-play-state:paused!important}

@media (max-width:900px){
.hm-ctl{top:78px}
}
@media (max-width:520px){
.hm-film,.hm-fx{inset:0 0 auto 0;height:400px}
.hm-st{clip-path:polygon(0 0,2.4% 0,26.4% 100%,24% 100%)}
.hm-crest{top:52%;width:150px;margin:-75px 0 0 -75px}
.hm-glint{inset:0 0 auto 0;height:400px;clip-path:polygon(50.8% 0,53.2% 0,77.2% 100%,74.8% 100%)}
.hm-glint.is-w{display:none}
.hm-ctl{top:76px;right:12px}
}
@media (prefers-reduced-motion:reduce){.hm-film,.hm-fx,.hm-glint,.hm-ctl{display:none!important}}
