/* Accueil · les medias qui representent le contenu · 2026-10-02
 *
 * Charge par index.html SEUL : sa version vit a un seul endroit.
 * Deux schemas, et chacun dit ce que le texte d'a cote dit deja :
 *  1. le trajet d'une demande, sous « Ou s'arrete la demande ? » : trois
 *     passages s'arretent chacun a un des trois points de la liste, le
 *     quatrieme va jusqu'au devis. AUCUN pourcentage : on montre ou une
 *     demande se perd, on n'invente pas combien ;
 *  2. le devis qui se coche, dans « Un projet defini avant de commencer » :
 *     ses cinq lignes sont celles du paragraphe voisin.
 *
 * Sans mouvement demande (ou sans animation possible), les deux schemas
 * sont IMMOBILES ET COMPLETS : les trois arrets numerotes, et le devis coche.
 */

/* ── 1 · Le trajet d'une demande ───────────────────────────────────────── */
@property --hm-p { syntax: '<number>'; inherits: false; initial-value: 0; }

.hm-flux { margin: 8px 0 28px; padding: 28px 28px 22px; background: var(--gray-bg, #F2F2F2); border-top: 3px solid var(--red); }
body.dark-mode .hm-flux { background: #1b1b1b; }
.hm-flux-piste { position: relative; height: 112px; margin: 0 70px; }
.hm-flux-ligne { position: absolute; left: 0; right: 0; top: 14px; height: 2px; background: var(--line, #E6E6E6); }
.hm-etape, .hm-fuite, .hm-impulsion { position: absolute; left: calc(var(--at) * 1%); top: 0; }
.hm-etape { transform: translateX(-50%); width: 130px; text-align: center; }
.hm-etape i { display: block; width: 30px; height: 30px; margin: 0 auto 10px; border: 2px solid var(--black, #111); border-radius: 50%; background: var(--white, #fff); box-sizing: border-box; }
body.dark-mode .hm-etape i { border-color: #ddd; background: #1b1b1b; }
.hm-etape b { display: block; font: 600 .82rem/1.35 var(--font-b); color: var(--black, #111); }
body.dark-mode .hm-etape b { color: #eee; }
.hm-etape--devis i { border-color: var(--red); }
/* Le point de fuite : un trait rouge en travers de la ligne, numerote. */
.hm-fuite { top: 2px; transform: translateX(-50%); width: 26px; text-align: center; }
.hm-fuite::before { content: ''; display: block; width: 2px; height: 26px; margin: 0 auto; background: var(--red); transform: rotate(35deg); }
.hm-fuite span { display: block; margin-top: 30px; font: 700 .72rem var(--font-h); color: var(--red-ink, var(--red)); letter-spacing: .04em; }
/* Mode sombre : la ligne reste un filet discret, et le rouge des fuites est
 * eclairci comme les kickers d'AI Studio (#AE0000 sur fond sombre : 2,5:1). */
body.dark-mode .hm-flux-ligne { background: #3a3a3a; }
body.dark-mode .hm-fuite::before { background: #FF6B6B; }
body.dark-mode .hm-fuite span { color: #FF6B6B; }
.hm-impulsion { top: 7px; width: 16px; height: 16px; margin-left: -8px; border-radius: 50%; background: var(--red); opacity: 0; }
.hm-flux-legende { position: relative; min-height: 2.8em; margin: 14px 0 0; }
.hm-flux-legende p { margin: 0; font: 500 .92rem/1.45 var(--font-b); color: var(--gray-txt, #555); }
.hm-flux-legende p strong { color: var(--black, #111); font-weight: 700; }
body.dark-mode .hm-flux-legende p strong { color: #eee; }
.hm-flux-legende .hm-l { display: none; }

/* Telephone : la piste devient verticale, les libelles passent a droite. */
@media (max-width: 760px) {
  .hm-flux { padding: 22px 18px 18px; }
  .hm-flux-piste { height: 330px; margin: 8px 0 34px 6px; }
  .hm-flux-ligne { left: 14px; right: auto; top: 0; bottom: 0; width: 2px; height: auto; }
  .hm-etape, .hm-fuite, .hm-impulsion { left: 0; top: calc(var(--at) * 1%); }
  .hm-etape { transform: translateY(-15px); width: auto; display: flex; align-items: center; gap: 14px; text-align: left; }
  .hm-etape i { margin: 0; flex: none; }
  .hm-fuite { left: 2px; transform: translateY(-13px); width: auto; display: flex; align-items: center; gap: 12px; }
  .hm-fuite::before { transform: rotate(-55deg); margin: 0; }
  .hm-fuite span { margin: 0 0 0 10px; }
  .hm-impulsion { left: 15px; top: calc(var(--hm-p) * 1%); margin: -8px 0 0 -8px; }
}

@media (prefers-reduced-motion: no-preference) {
  /* Longhands, pas le raccourci : « animation » sur une regle plus specifique
   * remettrait animation-name a none, et aucun passage ne se verrait. */
  .hm-flux .hm-impulsion { animation-duration: 16s; animation-timing-function: linear; animation-iteration-count: infinite; }
  .hm-impulsion--1 { animation-name: hm-passe-1; }
  .hm-impulsion--2 { animation-name: hm-passe-2; }
  .hm-impulsion--3 { animation-name: hm-passe-3; }
  .hm-impulsion--4 { animation-name: hm-passe-4; }
  .hm-impulsion { left: calc(var(--hm-p) * 1%); }
  @media (max-width: 760px) { .hm-impulsion { left: 15px; } }
  .hm-fuite--1 { animation: hm-eclat-1 16s linear infinite; }
  .hm-fuite--2 { animation: hm-eclat-2 16s linear infinite; }
  .hm-fuite--3 { animation: hm-eclat-3 16s linear infinite; }
  .hm-etape--devis i { animation: hm-devis 16s linear infinite; }
  /* La legende suit le passage en cours : une phrase a la fois. */
  .hm-flux-legende .hm-l { display: block; position: absolute; inset: 0 0 auto; opacity: 0; animation: 16s linear infinite; }
  .hm-flux-legende .hm-l--1 { animation-name: hm-quart-1; }
  .hm-flux-legende .hm-l--2 { animation-name: hm-quart-2; }
  .hm-flux-legende .hm-l--3 { animation-name: hm-quart-3; }
  .hm-flux-legende .hm-l--4 { animation-name: hm-quart-4; }
  .hm-flux-legende .hm-fixe { visibility: hidden; }
  .hm-flux.hm-hors-champ * { animation-play-state: paused !important; }
}
/* Chaque passage tient un quart du cycle : il part, avance, et tombe a son arret. */
@keyframes hm-passe-1 { 0% { --hm-p: 0; opacity: 1; transform: none; } 9% { --hm-p: 12.5; opacity: 1; transform: none; } 13%, 100% { --hm-p: 12.5; opacity: 0; transform: translate(var(--hm-cx, 0), var(--hm-cy, 26px)); } }
@keyframes hm-passe-2 { 0%, 24.9% { --hm-p: 0; opacity: 0; transform: none; } 25% { --hm-p: 0; opacity: 1; } 36% { --hm-p: 37.5; opacity: 1; transform: none; } 40%, 100% { --hm-p: 37.5; opacity: 0; transform: translate(var(--hm-cx, 0), var(--hm-cy, 26px)); } }
@keyframes hm-passe-3 { 0%, 49.9% { --hm-p: 0; opacity: 0; transform: none; } 50% { --hm-p: 0; opacity: 1; } 66% { --hm-p: 87.5; opacity: 1; transform: none; } 70%, 100% { --hm-p: 87.5; opacity: 0; transform: translate(var(--hm-cx, 0), var(--hm-cy, 26px)); } }
@keyframes hm-passe-4 { 0%, 74.9% { --hm-p: 0; opacity: 0; } 75% { --hm-p: 0; opacity: 1; } 94%, 99% { --hm-p: 100; opacity: 1; } 100% { --hm-p: 100; opacity: 0; } }
@media (max-width: 760px) { .hm-impulsion { --hm-cx: 26px; --hm-cy: 0; } }
@keyframes hm-eclat-1 { 0%, 8% { opacity: .35; } 10%, 22% { opacity: 1; transform: translateX(-50%) scale(1.15); } 25%, 100% { opacity: .35; transform: translateX(-50%); } }
@keyframes hm-eclat-2 { 0%, 35% { opacity: .35; } 37%, 47% { opacity: 1; transform: translateX(-50%) scale(1.15); } 50%, 100% { opacity: .35; transform: translateX(-50%); } }
@keyframes hm-eclat-3 { 0%, 65% { opacity: .35; } 67%, 72% { opacity: 1; transform: translateX(-50%) scale(1.15); } 75%, 100% { opacity: .35; transform: translateX(-50%); } }
@media (max-width: 760px) {
  @keyframes hm-eclat-1 { 0%, 8% { opacity: .35; } 10%, 22% { opacity: 1; } 25%, 100% { opacity: .35; } }
  @keyframes hm-eclat-2 { 0%, 35% { opacity: .35; } 37%, 47% { opacity: 1; } 50%, 100% { opacity: .35; } }
  @keyframes hm-eclat-3 { 0%, 65% { opacity: .35; } 67%, 72% { opacity: 1; } 75%, 100% { opacity: .35; } }
}
@keyframes hm-devis { 0%, 93% { background: var(--white, #fff); } 95%, 100% { background: var(--red); } }
@keyframes hm-quart-1 { 0%, 24% { opacity: 1; } 25%, 100% { opacity: 0; } }
@keyframes hm-quart-2 { 0%, 24.9% { opacity: 0; } 25%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }
@keyframes hm-quart-3 { 0%, 49.9% { opacity: 0; } 50%, 74% { opacity: 1; } 75%, 100% { opacity: 0; } }
@keyframes hm-quart-4 { 0%, 74.9% { opacity: 0; } 75%, 100% { opacity: 1; } }

/* ── 2 · Le devis qui se coche ─────────────────────────────────────────── */
.hm-devis { list-style: none; margin: 4px 0 18px; padding: 14px 16px; background: var(--white, #fff); border: 1px solid var(--line, #E6E6E6); }
body.dark-mode .hm-devis { background: #161616; border-color: #2a2a2a; }
.hm-devis li { display: flex; align-items: center; gap: 12px; padding: 7px 0; font: 600 .88rem/1.3 var(--font-b); border-bottom: 1px dashed var(--line, #E6E6E6); }
.hm-devis li:last-child { border-bottom: 0; }
body.dark-mode .hm-devis li { border-color: #2a2a2a; }
.hm-devis li::before { content: ''; flex: none; width: 16px; height: 16px; box-sizing: border-box; border: 2px solid var(--red); background: var(--red) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8.2l3 3 6-6.4' fill='none' stroke='%23fff' stroke-width='2.2'/%3E%3C/svg%3E") center / 12px no-repeat; }
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .hm-devis li::before { animation: hm-coche linear both; animation-timeline: view(); }
    .hm-devis li:nth-child(1)::before { animation-range: entry 60% cover 30%; }
    .hm-devis li:nth-child(2)::before { animation-range: entry 80% cover 33%; }
    .hm-devis li:nth-child(3)::before { animation-range: entry 100% cover 36%; }
    .hm-devis li:nth-child(4)::before { animation-range: cover 22% cover 39%; }
    .hm-devis li:nth-child(5)::before { animation-range: cover 26% cover 42%; }
  }
}
@keyframes hm-coche { 0%, 70% { background-color: transparent; background-size: 0; } 100% { background-color: var(--red); background-size: 12px; } }

/* ── 3 · Le suivi, en personne ─────────────────────────────────────────── */
.hm-suivi { margin: 8px 0 36px; border-top: 4px solid var(--red); line-height: 0; }
.hm-suivi img { display: block; width: 100%; height: auto; aspect-ratio: 2 / 1; object-fit: cover; }
@media (max-width: 760px) { .hm-suivi img { aspect-ratio: 4 / 3; object-position: 22% center; } }
