/* ---------- Bandeau logos ---------- */
.hp-logos {
  padding: 26px 32px;
  border-block: 1px solid var(--color-border);
  background-color: var(--color-beige);
}

.hp-logos-inner {
  display: flex;
  align-items: center;
  gap: 40px;
}

.hp-logos-label {
  flex-shrink: 0;
  max-width: 120px;
  color: var(--color-muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  line-height: 1.4;
  text-transform: uppercase;
}

.hp-marquee {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}

/* Le JS (initMarquee) duplique le contenu une fois pour une boucle continue.
   Sans JS : liste statique, qui passe à la ligne si besoin. */
.hp-marquee-track {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 56px;
  width: max-content;
  max-width: 100%;
}

/* mask-image isole .hp-marquee dans son propre groupe de composition : le
   multiply des logos ne se fond alors que dans ce groupe, et les fonds blancs
   des JPEG restent visibles. Le multiply du groupe entier le fond dans la page. */
.hp-marquee.is-running {
  mix-blend-mode: multiply;
}

.hp-marquee.is-running .hp-marquee-track {
  flex-wrap: nowrap;
  max-width: none;
  animation: hp-marquee 38s linear infinite;
}

.hp-marquee:hover .hp-marquee-track {
  animation-play-state: paused;
}

.hp-marquee img {
  height: var(--h, 34px);
  width: auto;
  mix-blend-mode: multiply;
  filter: grayscale(1);
  opacity: 0.7;
  transition: filter 0.3s ease, opacity 0.3s ease;
}

.hp-marquee img:hover {
  filter: none;
  opacity: 1;
}

@keyframes hp-marquee {
  to {
    transform: translateX(calc(-50% - 28px));
  }
}

@media (prefers-reduced-motion: reduce) {
  .hp-marquee.is-running .hp-marquee-track {
    animation: none;
  }
}

/* ---------- Stades ---------- */
/* Courbe de croissance au-dessus des cartes : même grille à 3 colonnes,
   un repère centré sur chaque carte. Le point est posé sur la courbe (--y :
   hauteur de la courbe au centre de la colonne, dans le repère 120px du
   SVG), le libellé juste en dessous. */
.hp-stades-curve {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  height: 196px;
  margin-top: 44px;
}

.hp-stades-curve-svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 120px;
  overflow: visible;
  /* Courbe et aire s'effacent aux deux extrémités au lieu d'être coupées net. */
  mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}

/* L'aire se découvre de gauche à droite en même temps que la courbe se
   trace (même durée, même courbe d'accélération). Elle couvre toute la
   largeur du viewBox : inset en % = progression horizontale. */
.hp-stades-curve-area {
  fill: url(#hp-stades-curve-fade);
  clip-path: inset(0 100% 0 0);
}

.hp-stades-curve.is-visible .hp-stades-curve-area {
  clip-path: inset(0 0 0 0);
  transition: clip-path 1.6s cubic-bezier(0.45, 0, 0.2, 1) 0.2s;
}

@media (prefers-reduced-motion: reduce) {
  .hp-stades-curve .hp-stades-curve-area,
  .hp-stades-curve .hp-stades-curve-line {
    clip-path: none;
    stroke-dashoffset: 0;
    transition: none !important;
  }
}

.hp-stades-curve-line {
  fill: none;
  stroke: var(--color-teal);
  stroke-width: 2.5;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  vector-effect: non-scaling-stroke;
}

.hp-stades-curve.is-visible .hp-stades-curve-line {
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 1.6s cubic-bezier(0.45, 0, 0.2, 1) 0.2s;
}

.hp-stades-mark {
  /* Colonne pleine hauteur : le libellé est calé en bas (même niveau pour
     les trois), le point reste posé sur la courbe (--y) et un pointillé le
     relie au libellé. */
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  color: var(--color-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1.3;
  text-align: center;
  text-transform: uppercase;
}

.hp-stades-mark::after {
  content: "";
  position: absolute;
  top: calc(var(--y) + 7px);
  bottom: 56px;
  left: 50%;
  border-left: 1.5px dashed rgb(8 127 131 / 0.35);
}

.hp-stades-mark::before {
  content: "";
  position: absolute;
  z-index: 1;
  top: calc(var(--y) - 8px);
  left: calc(50% - 7px); /* centré optiquement sur le pointillé (::after, 1.5px) */
  width: 16px;
  height: 16px;
  box-sizing: border-box;
  border: 2px solid #fff;
  border-radius: 50%;
  background-color: var(--color-teal);
}

.hp-stades-mark b {
  color: var(--color-teal);
  font-family: var(--font-serif);
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.4px;
  text-transform: none;
}

/* Mini-visuels animés des cartes masqués pour l'instant (attribut hidden
   dans index.html, à retirer pour les réafficher) : le display: flex de
   .hp-sv l'emporterait sinon */
.hp-sv[hidden] {
  display: none;
}

.hp-stades-cta {
  margin-top: 48px;
}

.hp-stades {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin-top: 36px;
}

.hp-stade {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  /* Pas d'overflow: hidden : l'en-tête déborde à cheval sur le bord haut. */
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: 34px 14px 36px;
  background-color: var(--color-white);
}

/* Tout sauf le mini-visuel et l'en-tête reprend le retrait de 36px de la
   carte (--stade-in, réduit sur mobile). */
.hp-stade {
  --stade-in: 22px;
}

.hp-stade > :not(.hp-sv, .hp-stade-offer) {
  margin-inline: var(--stade-in);
}

.hp-stades > :nth-child(2) {
  --reveal-delay: 100ms;
}

.hp-stades > :nth-child(3) {
  --reveal-delay: 200ms;
}

/* En-tête de carte : nom de l'offre dans une pill teal, centrée, à cheval
   sur le bord haut de la carte. Le stade du réseau est porté par les
   repères de la courbe. */
.hp-stade > .hp-stade-offer {
  position: absolute;
  top: 0;
  left: 50%;
  z-index: 1;
  margin: 0;
  transform: translate(-50%, -50%);
  white-space: nowrap;
  border-radius: var(--radius-pill);
  padding: 4px 10px;
  background-color: var(--color-teal);
  color: var(--color-white);
  font-size: 10px;
  font-weight: 800;
  line-height: 1.4;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* Montée en gamme des offres : Essentiel (teal) → Growth (teal profond) →
   Corporate (noir), pas encore disponible : mention « À venir » dans la
   pill, sur fond cyan clair. */
.hp-stade > .hp-stade-offer--growth {
  background-color: var(--color-teal-deep);
}

.hp-stade > .hp-stade-offer--custom {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding-right: 4px;
  background-color: var(--color-black);
}

.hp-stade-soon {
  border-radius: var(--radius-pill);
  padding: 1px 7px;
  color: #000;
  background-color: #a1f0f0;
  font-size: 9px;
  letter-spacing: 0.04em;
}

/* Même mention dans une puce : en capitales comme dans la pill de l'offre */
.hp-checks .hp-stade-soon {
  display: inline-block;
  margin-left: 4px;
  vertical-align: 1px;
  font-weight: 800;
  line-height: 1.5;
  text-transform: uppercase;
}

/* Growth : bandeau Leo au-dessus des puces, puis l'amorce « Tout
   l'Essentiel, plus : ». */
.hp-stade-leo {
  --leo-pad: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 18px;
  border-radius: var(--radius-md);
  padding: 12px var(--leo-pad);
  background-color: var(--color-teal-bg);
  color: var(--color-black);
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.35;
  text-wrap: pretty;
}

/* Le fond déborde de la marge intérieure : le badge et le texte restent
   calés sur le reste du contenu de la carte */
.hp-stade > .hp-stade-leo {
  margin-inline: calc(var(--stade-in) - var(--leo-pad));
}

.hp-stade-leo strong {
  color: var(--color-teal-text);
  font-weight: 800;
}

.hp-stade-lead {
  margin-top: 18px;
  color: var(--color-muted);
  font-size: 14px;
  font-weight: 700;
}

.hp-stade-lead + .hp-checks {
  margin-top: 10px;
}

/* Tranche de franchisés : portée par la courbe sur grand écran, rappelée
   sous la pill quand la courbe disparaît. */
.hp-stade-range {
  display: none;
  margin-bottom: 14px;
  color: var(--color-muted);
  font-size: 13.5px;
  font-weight: 600;
  text-align: center;
}

/* Seulement si le mini-visuel est affiché (masqué : attribut hidden) */
.hp-sv:not([hidden]) + .hp-h3 {
  margin-top: 30px;
}

/* Pas de mot seul en dernière ligne des puces */
.hp-stade .hp-checks li {
  text-wrap: pretty;
}

.hp-stade .hp-checks {
  margin-bottom: 28px;
}

.hp-stade-stat {
  /* Chiffre toujours au-dessus du texte, et place réservée pour deux lignes
     de texte : les trois cartes ont la même hauteur de stat, leurs filets
     s'alignent. */
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: calc(20px + 38px + 6px + 3em);
  margin-top: auto;
  padding-top: 20px;
  border-top: 1px solid var(--color-border);
  /* Même poids que les puces .hp-checks : le texte porte la stat autant
     que le chiffre. */
  color: var(--color-black);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.5;
  text-wrap: balance;
}

.hp-stade-stat strong {
  color: var(--color-teal);
  font-family: var(--font-serif);
  font-size: 38px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.8px;
}

/* ---------- Mini-visuels des stades ---------- */
.hp-sv {
  /* Ombre des cartes des mini-visuels : centrée (pas de décalage), large et
     très légère. */
  --sv-shadow: 0 0 28px rgb(31 18 14 / 0.08);
  position: relative;
  display: flex;
  align-items: center;
  gap: 18px;
  height: 212px;
  overflow: hidden;
  /* Concentrique avec la carte (--radius-xl, 14px de retrait). */
  border-radius: 10px;
  padding: 22px;
  font-size: 11.5px;
  line-height: 1.35;
}

.hp-sv-meta {
  display: block;
  color: var(--color-muted);
  font-size: 10.5px;
  font-weight: 600;
}

/* Lancement : un DIP se rédige, le compteur file vers 48 h */
/* Même fond que les deux autres mini-visuels (.hp-sv--network, --fleet) */
.hp-sv--launch {
  background:
    radial-gradient(rgb(8 127 131 / 0.12) 1px, transparent 1.5px) 0 0 / 18px 18px,
    linear-gradient(160deg, #eefaf9, #dff3f2);
}

.hp-sv-doc {
  --line-t: 0.42s; /* durée d'écriture d'une ligne */
  --line-gap: 0.26s; /* décalage entre deux lignes (stagger) */
  position: relative;
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  border: 1px solid rgb(31 18 14 / 0.06);
  border-radius: 14px;
  padding: 14px 16px 18px;
  background-color: var(--color-white);
  box-shadow: var(--sv-shadow);
}

.hp-sv-doc-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}

.hp-sv-doc-ico {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--color-teal-bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23087f83' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z'/%3E%3Cpath d='M14 3v5h5M9 13h6M9 17h4'/%3E%3C/svg%3E") center / 17px no-repeat;
}

.hp-sv-doc-t {
  min-width: 0;
}

.hp-sv-doc-t strong {
  display: block;
  font-size: 12px;
}

/* Écriture du contrat, ligne par ligne : chaque ligne se trace de gauche à
   droite (curseur en bout de ligne), la suivante démarre un peu avant que
   la précédente finisse (--line-gap < --line-t). ≈ 1,5 s au total.
   Page blanche au départ : les lignes n'ont pas de fond « à remplir ». */
.hp-sv-line {
  position: relative;
  display: block;
  width: 0;
  height: 6px;
  border-radius: var(--radius-pill);
  background-color: #eef0f0;
}

.hp-sv-line--para {
  margin-top: 5px;
}

.hp-sv.is-writing .hp-sv-line {
  width: var(--w);
  animation: hp-sv-write var(--line-t) cubic-bezier(0.3, 0, 0.6, 1) calc(var(--i) * var(--line-gap)) backwards;
}

/* Curseur : visible seulement pendant l'écriture de sa ligne */
.hp-sv-line::after {
  content: "";
  position: absolute;
  top: -4px;
  right: -4px;
  width: 2px;
  height: 14px;
  border-radius: 1px;
  background-color: var(--color-teal-deep);
  opacity: 0;
}

.hp-sv.is-writing .hp-sv-line::after {
  /* Le curseur passe à la ligne suivante dès qu'elle démarre : un seul à la fois. */
  animation: hp-sv-caret var(--line-gap) steps(1) calc(var(--i) * var(--line-gap));
}

@keyframes hp-sv-write {
  from { width: 0; }
}

@keyframes hp-sv-caret {
  from, to { opacity: 1; }
}

/* Tampon à cheval sur le bord haut du document (translate, séparé du
   transform de l'animation), pour ne pas recouvrir l'en-tête et les lignes. */
.hp-sv-stamp {
  position: absolute;
  top: 0;
  right: 12px;
  translate: 0 calc(-50% - 3px);
  border: 1.5px solid currentColor;
  border-radius: var(--radius-pill);
  padding: 4px 10px 4px 24px;
  color: var(--color-green-text);
  background: var(--color-green-bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%233c7a2d' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") 8px 50% / 11px no-repeat;
  font-weight: 700;
  opacity: 0;
  transform: scale(1.6);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.hp-sv.is-ready .hp-sv-stamp {
  opacity: 1;
  transform: none;
  transition: opacity 0.25s ease, transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Réseau qui grandit : les contrats signés arrivent, les échéances et le
   litige tombent */
.hp-sv--network,
.hp-sv--fleet {
  align-items: stretch;
  gap: 12px;
  padding: 16px;
  background:
    radial-gradient(rgb(8 127 131 / 0.12) 1px, transparent 1.5px) 0 0 / 18px 18px,
    linear-gradient(160deg, #eefaf9, #dff3f2);
}

.hp-sv-col {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.hp-sv-col-l {
  margin-bottom: 2px;
  color: var(--color-muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hp-sv-file,
.hp-sv-alert {
  display: flex;
  align-items: center;
  gap: 9px;
  border-radius: 11px;
  padding: 7px 9px;
  color: var(--color-black);
  background-color: var(--color-white);
  box-shadow: var(--sv-shadow);
  opacity: 0;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.hp-sv-file {
  transform: translate(-24px, -6px) rotate(-4deg);
}

.hp-sv-alert {
  transform: translateY(10px) scale(0.94);
}

.hp-sv.is-importing .hp-sv-file,
.hp-sv.is-alerting .hp-sv-alert {
  opacity: 1;
  transform: none;
  transition:
    opacity 0.35s ease calc(var(--i) * 0.28s),
    transform 0.6s cubic-bezier(0.34, 1.4, 0.64, 1) calc(var(--i) * 0.28s);
}

.hp-sv.is-alerting .hp-sv-alert {
  transition-delay: calc(var(--i) * 0.5s);
}

.hp-sv-file-ico {
  flex-shrink: 0;
  width: 22px;
  height: 26px;
  border-radius: 4px;
  background: var(--color-purple-bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238c3ddb' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M7 9h10M7 13h10M7 17h6'/%3E%3C/svg%3E") center / 15px no-repeat;
}

.hp-sv-file-t {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  font-weight: 700;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.hp-sv-ok {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--color-green-text) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 9px no-repeat;
  transform: scale(0);
  transition: transform 0.2s ease;
}

.hp-sv.is-importing .hp-sv-ok {
  transform: none;
  transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) calc(var(--i) * 0.28s + 0.45s);
}

.hp-sv-alert-t {
  min-width: 0;
}

.hp-sv-alert-t strong {
  display: block;
}

.hp-sv-alert-t {
  flex: 1;
}

.hp-sv-file-t .hp-sv-meta {
  font-weight: 500;
}

/* Échéance / statut à droite de la ligne */
.hp-sv-due {
  flex-shrink: 0;
  border-radius: var(--radius-pill);
  padding: 2px 7px;
  color: var(--color-orange-text);
  background-color: var(--color-orange-bg);
  font-size: 10px;
  font-weight: 800;
}

.hp-sv-alert--case .hp-sv-due,
.hp-sv-due--ok {
  color: var(--color-green-text);
  background-color: var(--color-green-bg);
}

/* Grand réseau : tableau du parc contractuel */
.hp-sv-fleet {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.hp-sv-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.hp-sv-kpi,
.hp-sv-brand,
.hp-sv-team {
  border-radius: 11px;
  background-color: var(--color-white);
  box-shadow: var(--sv-shadow);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.hp-sv.is-shown .hp-sv-kpi,
.hp-sv.is-shown .hp-sv-brand,
.hp-sv.is-shown .hp-sv-team {
  opacity: 1;
  transform: none;
  transition:
    opacity 0.35s ease calc(var(--i) * 0.18s),
    transform 0.6s cubic-bezier(0.34, 1.4, 0.64, 1) calc(var(--i) * 0.18s);
}

.hp-sv-kpi {
  display: flex;
  flex-direction: column;
  padding: 8px 10px;
  color: var(--color-muted);
  font-size: 10px;
  font-weight: 600;
}

.hp-sv-kpi b {
  color: var(--color-teal);
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 600;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.hp-sv-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
}

.hp-sv-team {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  color: var(--color-muted);
  font-size: 10.5px;
  font-weight: 600;
  background-color: transparent;
  box-shadow: none;
}

.hp-sv-avs {
  display: flex;
}

.hp-sv-avs i {
  width: 20px;
  height: 20px;
  margin-right: -6px;
  border: 2px solid #eefaf9;
  border-radius: 50%;
  background-color: var(--color-cyan);
}

.hp-sv-avs i:nth-child(2) { background-color: var(--color-teal); }
.hp-sv-avs i:nth-child(3) { background-color: var(--color-teal-deep); }
.hp-sv-avs i:nth-child(4) { margin-right: 0; background-color: var(--color-black); }

@media (prefers-reduced-motion: reduce) {
  .hp-sv * {
    transition: none !important;
    animation: none !important;
  }
}

@media (max-width: 1100px) {
  .hp-stades-curve {
    display: none;
  }

  .hp-stades {
    grid-template-columns: minmax(0, 1fr);
    max-width: 600px;
    margin-inline: auto;
    margin-top: 64px;
    /* Place pour la pill à cheval de la carte suivante. */
    row-gap: 40px;
  }

  .hp-stade-range {
    display: block;
  }
}

@media (max-width: 640px) {
  .hp-logos {
    padding: 22px 20px;
  }

  .hp-logos-inner {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
  }

  .hp-logos-label {
    max-width: none;
    text-align: center;
  }

  .hp-stade {
    padding: 30px 10px 26px;
  }

  .hp-stade {
    --stade-in: 12px;
  }


  .hp-sv {
    height: 196px;
    gap: 12px;
    padding: 16px;
  }

  /* Colonnes étroites : les contrats perdent leur année. */
  .hp-sv-file-y {
    display: none;
  }

  .hp-sv-file,
  .hp-sv-alert {
    padding: 7px 8px;
  }
}
