/* ============================================================
   COVERING AUTOMOBILE — styles spécifiques à la page
   Chargé uniquement par /covering-automobile/index.html
   Reprend les tokens de style.css, n'en redéfinit aucun.
   ============================================================ */

/* ------------------------------------------------------------
   1. HERO CENTRÉ PLEIN ÉCRAN
   ------------------------------------------------------------ */
.hero--center {
  min-height: 100svh;
  display: flex;
  align-items: center;
}

.hero--center .hero__content {
  display: flex;
  justify-content: center;
  text-align: center;
}

.hero--center .hero__copy {
  max-width: 62ch;
  margin: 0 auto;
  align-items: center;
}

.hero--center .hero__eyebrow {
  justify-content: center;
}

/* Le contenu du hero interne est décalé par un padding-left : on le neutralise
   pour que titre, sous-titre et boutons soient centrés sur l'axe réel. */
.hero--center .hero__content {
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

/* Titre — calé sur les métriques de référence : 60px à 1280px de large,
   interligne 1, interlettrage serré. Le plancher reprend le plafond mobile
   du site pour rester cohérent avec les autres pages. */
.hero--center .hero__title {
  font-size: clamp(2.25rem, 4.8vw, 4.1rem);
  line-height: 1;
  letter-spacing: -0.035em;
  /* Contour noir : paint-order place le trait DERRIÈRE le remplissage,
     les lettres gardent donc leur dessin au lieu d'être rongées. */
  paint-order: stroke fill;
  -webkit-text-stroke: 3px var(--color-night, #0a0908);
  text-shadow: 0 2px 18px rgba(10, 11, 12, 0.45);
}

@media (max-width: 640px) {
  .hero--center .hero__title {
    -webkit-text-stroke-width: 3px;
  }
}

/* Mobile : même plafond que le reste du site (cf. style.css).
   Cette feuille étant chargée après style.css, l'override doit être répété
   ici, sinon .hero--center reprend le dessus sur mobile. */
@media (max-width: 899px) {
  .hero--center .hero__title { font-size: clamp(2.25rem, 10vw, 3.5rem); }
}

/* Sous-titre — 20px à 1280px, comme la référence. L'interligne reste à 1.4 :
   leur sous-titre tient sur une ligne, le nôtre en fait trois. */
.hero--center .hero__lede {
  margin-left: auto;
  margin-right: auto;
  max-width: 54ch;
  font-size: clamp(1rem, 1.6vw, 1.25rem);
  line-height: 1.4;
}

.hero--center .hero__cta {
  justify-content: center;
}

/* Boutons de largeur égale, comme la référence */
.hero--center .hero__cta .btn {
  min-width: 250px;
  justify-content: center;
}

@media (max-width: 480px) {
  .hero--center .hero__cta .btn {
    min-width: 0;
    width: 100%;
  }
}

/* Hero covering : photo affichée sans voile sombre.
   Ne concerne que cette page, les autres heros gardent leur overlay. */
.hero--center .hero__bg-overlay {
  background: none;
}

/* ------------------------------------------------------------
   2. NOS SERVICES — 2 cartes principales (Covering / PPF)
   ------------------------------------------------------------ */
.services {
  background: var(--color-paper);
}

.services__head {
  text-align: center;
  max-width: 64ch;
  margin: 0 auto clamp(48px, 6vw, 80px);
}

.services__head .display {
  margin: var(--s-4) 0 var(--s-6);
}

.services__head .lede {
  margin: 0 auto;
}

/* Cartes centrées, fond gris clair, sans bordure — le véhicule flotte
   dans la carte plutôt que de la remplir. */
.services__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(14px, 1.8vw, 26px);
  max-width: 1240px;
  margin: 0 auto;
  align-items: stretch;
}

/* Trois cartes à l'étroit sous 900px : on repasse en colonne unique
   plutôt que de laisser une carte orpheline sur une deuxième rangée. */
@media (max-width: 900px) {
  .services__grid {
    grid-template-columns: 1fr;
    max-width: 520px;
  }
}

.service-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  background: var(--color-paper);
  border-radius: 10px;
  padding: clamp(28px, 3.5vw, 48px) clamp(20px, 2.5vw, 36px) clamp(32px, 4vw, 52px);
  text-decoration: none;
  color: inherit;
  transition: background 0.4s var(--ease-out), transform 0.4s var(--ease-out);
}

.service-card:hover,
.service-card:focus-visible {
  background: var(--color-cream);
  transform: translateY(-4px);
}

/* Les véhicules sont dessinés en profil (640×200) : on cadre large et bas
   plutôt qu'en 16/10, sinon la voiture flotte au milieu du vide. */
.service-card__media {
  width: 100%;
  aspect-ratio: 16 / 7;
  display: grid;
  place-items: center;
  margin-bottom: clamp(16px, 2.4vw, 28px);
}

.service-card__media img {
  width: 100%;
  max-width: 100%;
  height: auto;
  object-fit: contain;
  transition: transform 0.6s var(--ease-out);
}

.service-card:hover .service-card__media img {
  transform: scale(1.05);
}

.service-card__body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--s-3);
  width: 100%;
}

.service-card__title {
  font-family: var(--font-serif);
  font-style: normal;
  font-weight: 500;
  font-size: clamp(1.6rem, 2.4vw, 2.15rem);
  line-height: 1.05;
}

.service-card__text {
  font-size: 0.9rem;
  color: var(--color-gray-700);
  line-height: 1.55;
  max-width: 38ch;
}

/* « Découvrir » souligné, centré */
.service-card__link {
  margin-top: var(--s-3);
  font-size: 1rem;
  letter-spacing: 0;
  text-transform: none;
  color: var(--color-gray-700);
  text-decoration: underline;
  text-underline-offset: 5px;
  text-decoration-thickness: 1px;
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  transition: color 0.3s var(--ease-out);
}

.service-card:hover .service-card__link {
  color: var(--color-red);
}

.service-card__link .arrow {
  transition: transform 0.35s var(--ease-out);
}

.service-card:hover .service-card__link .arrow {
  transform: translateX(4px);
}

.services__foot {
  margin-top: clamp(36px, 5vw, 56px);
  text-align: center;
}

/* ------------------------------------------------------------
   2bis. MARQUES — bande blanche défilant à l'infini
   Deux rangées identiques se suivent ; la piste glisse d'exactement
   une rangée puis repart, ce qui rend la boucle invisible.
   ------------------------------------------------------------ */
.brands {
  background: var(--color-white);
  padding: clamp(28px, 3.5vw, 44px) 0;
  overflow: hidden;
  /* Fondu sur les bords : les logos entrent et sortent sans coupure nette */
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}

.brands__track {
  display: flex;
  width: max-content;
  animation: brands-scroll 102s linear infinite;
}

.brands:hover .brands__track,
.brands:focus-within .brands__track {
  animation-play-state: paused;
}

.brands__row {
  display: flex;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
}

.brands__item {
  display: grid;
  place-items: center;
  padding: 0 clamp(28px, 4vw, 64px);
  border-left: 1px solid var(--color-line);
  min-height: 62px;
}

.brands__item img {
  max-height: 34px;
  width: auto;
  max-width: 190px;
  object-fit: contain;
}

/* Repère textuel en attendant les logos officiels des fournisseurs */
.brands__name {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: clamp(0.95rem, 1.5vw, 1.2rem);
  letter-spacing: 0.02em;
  color: var(--color-anthracite);
  white-space: nowrap;
}

@keyframes brands-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

@media (prefers-reduced-motion: reduce) {
  .brands__track {
    animation: none;
  }
  /* Sans défilement, on centre ce qui tient à l'écran */
  .brands {
    -webkit-mask-image: none;
    mask-image: none;
  }
  .brands__track {
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
  }
  .brands__row + .brands__row {
    display: none;
  }
}

/* ------------------------------------------------------------
   3. AVANT / APRÈS — slider comparatif
   Le handle est un <input type="range"> : drag ET clavier natifs
   (WCAG 2.2 — pas de drag-only).
   ------------------------------------------------------------ */
.compare {
  background: var(--color-night, #0a0908);
  color: var(--color-cream);
  padding: clamp(72px, 10vw, 140px) 0;
}

.compare__head {
  text-align: center;
  max-width: 60ch;
  margin: 0 auto clamp(40px, 5vw, 64px);
}

.compare__head h2 {
  color: var(--color-cream);
  font-style: normal;
  font-weight: 500;
  font-size: clamp(2rem, 5vw, 3.5rem);
  line-height: 1;
  letter-spacing: -0.02em;
  margin: var(--s-4) 0 var(--s-5);
}

.compare__head h2 .acc {
  color: var(--color-red);
}

.compare__head p {
  color: rgba(237, 237, 234, 0.78);
  margin: 0 auto;
  font-size: 1rem;
}

.compare__frame {
  position: relative;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: var(--radius-image, 4px);
  background: var(--color-anthracite);
  /* --pos est piloté par le JS, valeur en % */
  --pos: 50%;
}

@media (max-width: 640px) {
  /* On garde le 16/9 des photos avant/après : passer en 4/3 gagnerait de la
     hauteur mais rognerait les côtés, et donc une partie du véhicule. */
  .compare__frame {
    aspect-ratio: 16 / 9;
  }
}

.compare__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
}

/* L'image « après » est masquée jusqu'à la position du curseur */
.compare__img--after {
  clip-path: inset(0 0 0 var(--pos));
}

/* Étiquettes Avant / Après */
.compare__tag {
  position: absolute;
  top: var(--s-4);
  z-index: 3;
  font-size: 0.68rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  padding: 7px 14px;
  background: rgba(10, 11, 12, 0.72);
  color: var(--color-cream);
  border: 1px solid rgba(237, 237, 234, 0.22);
  border-radius: 2px;
  pointer-events: none;
  backdrop-filter: blur(6px);
}

.compare__tag--before {
  left: var(--s-4);
}

.compare__tag--after {
  right: var(--s-4);
}

/* Ligne de séparation verticale */
.compare__line {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--pos);
  width: 2px;
  background: var(--color-cream);
  transform: translateX(-1px);
  z-index: 4;
  pointer-events: none;
}

/* Pastille ronde au centre de la ligne */
.compare__knob {
  position: absolute;
  top: 50%;
  left: var(--pos);
  width: 52px;
  height: 52px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: var(--color-cream);
  color: var(--color-anthracite);
  display: grid;
  place-items: center;
  z-index: 5;
  pointer-events: none;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.45);
}

.compare__knob svg {
  width: 22px;
  height: 22px;
}

/* Le range invisible couvre toute la zone : drag souris/tactile + flèches clavier */
.compare__range {
  position: absolute;
  inset: 0;
  z-index: 6;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: ew-resize;
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
}

.compare__range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 52px;
  height: 52px;
  cursor: ew-resize;
}

.compare__range::-moz-range-thumb {
  width: 52px;
  height: 52px;
  border: 0;
  cursor: ew-resize;
}

/* Focus clavier visible : c'est la pastille qui s'allume */
.compare__range:focus-visible ~ .compare__knob {
  outline: 3px solid var(--color-red);
  outline-offset: 4px;
}

.compare__hint {
  text-align: center;
  margin-top: clamp(12px, 2vw, 20px);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(237, 237, 234, 0.55);
}

/* ------------------------------------------------------------
   4. PROCESSUS — 3 étapes avec icône
   ------------------------------------------------------------ */
.steps3 {
  background: var(--color-cream);
  padding: clamp(72px, 10vw, 140px) 0;
}

.steps3__head {
  text-align: center;
  max-width: 62ch;
  margin: 0 auto clamp(48px, 6vw, 76px);
}

.steps3__head h2 {
  font-style: normal;
  font-weight: 500;
  font-size: clamp(2rem, 5vw, 3.5rem);
  line-height: 1;
  letter-spacing: -0.02em;
  margin: var(--s-4) 0 var(--s-5);
}

.steps3__head h2 .acc {
  color: var(--color-red);
}

.steps3__head p {
  margin: 0 auto;
  font-size: 1rem;
}

.steps3__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(24px, 4vw, 56px);
}

@media (max-width: 860px) {
  .steps3__grid {
    grid-template-columns: 1fr;
    gap: var(--s-8);
  }
}

.step3 {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--s-4);
}

.step3__icon {
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  border: 1px solid var(--color-line);
  border-radius: 50%;
  color: var(--color-red);
  transition: background 0.4s var(--ease-out), color 0.4s var(--ease-out),
    border-color 0.4s var(--ease-out);
}

.step3:hover .step3__icon {
  background: var(--color-red);
  border-color: var(--color-red);
  color: var(--color-white);
}

.step3__icon svg {
  width: 30px;
  height: 30px;
}

.step3__num {
  font-family: var(--font-serif);
  font-style: normal;
  font-size: 0.9rem;
  color: var(--color-gray-500);
}

.step3__title {
  font-family: var(--font-serif);
  font-style: normal;
  font-weight: 500;
  font-size: 1.5rem;
  line-height: 1.15;
}

.step3__text {
  font-size: 0.9rem;
  color: var(--color-gray-700);
  max-width: 34ch;
  line-height: 1.6;
}

.steps3__foot {
  margin-top: clamp(40px, 5vw, 64px);
  text-align: center;
}

/* ------------------------------------------------------------
   4bis. PARCOURS — timeline verticale, la voiture descend et se
   couvre au fil du défilement. --progress (0→1) est piloté par
   js/journey.js à partir de la position de scroll.
   ------------------------------------------------------------ */
.journey {
  background: var(--color-cream);
  padding: clamp(72px, 10vw, 140px) 0;
  --progress: 0;
}

.journey__head {
  text-align: center;
  max-width: 62ch;
  margin: 0 auto clamp(48px, 6vw, 76px);
}

.journey__head h2 {
  font-style: normal;
  font-weight: 500;
  font-size: clamp(2rem, 5vw, 3.5rem);
  line-height: 1;
  letter-spacing: -0.02em;
  margin: var(--s-4) 0 var(--s-5);
}

.journey__head h2 .acc {
  color: var(--color-red);
}

.journey__head p {
  margin: 0 auto;
  font-size: 1rem;
}

/* Piste de défilement : sa hauteur EST la durée de l'animation.
   240vh = on parcourt un peu plus de deux écrans avant que le bloc reparte. */
.journey__driver {
  position: relative;
  height: 240vh;
}

/* Le contenu reste collé à l'écran pendant qu'on traverse la piste :
   c'est ce qui transforme un bloc qui défile en animation. */
.journey__pin {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.journey__pin > .container {
  width: 100%;
}

/* Scène : le rail (ligne + voiture) court au MILIEU, les étapes se
   répartissent de part et d'autre. --rail = largeur de la colonne centrale. */
.journey__stage {
  position: relative;
  --rail: clamp(84px, 10vw, 132px);
}

/* Rail centré, superposé à la grille des étapes */
.journey__rail {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: 0;
  bottom: 0;
  width: var(--rail);
  pointer-events: none;
}

/* Ligne verticale grise, remplie en rouge selon --progress */
.journey__line {
  position: absolute;
  left: calc(50% - 1px);
  top: 12px;
  bottom: 12px;
  width: 2px;
  background: var(--color-gray-200);
  overflow: hidden;
}

/* Étapes en quinconce : colonne 1 à gauche, colonne 3 à droite,
   la colonne 2 étant réservée au rail. */
.journey__steps {
  position: relative;
  display: grid;
  grid-template-columns: 1fr var(--rail) 1fr;
  row-gap: clamp(56px, 8vw, 112px);
  align-items: start;
}

.journey__step:nth-child(odd) {
  grid-column: 1;
  text-align: right;
  padding-right: clamp(12px, 2vw, 28px);
}

.journey__step:nth-child(even) {
  grid-column: 3;
  padding-left: clamp(12px, 2vw, 28px);
}

/* Une étape par rangée, sinon la grille place les paires côte à côte */
.journey__step:nth-child(1) { grid-row: 1; }
.journey__step:nth-child(2) { grid-row: 2; }
.journey__step:nth-child(3) { grid-row: 3; }
.journey__step:nth-child(4) { grid-row: 4; }
.journey__step:nth-child(5) { grid-row: 5; }

/* Le texte des étapes de gauche s'aligne vers le rail */
.journey__step:nth-child(odd) .journey__text {
  margin-left: auto;
}

.journey__step:nth-child(odd) .journey__dot {
  left: calc(100% + var(--rail) / 2 - 22px);
}

.journey__step:nth-child(even) .journey__dot {
  left: calc(-1 * var(--rail) / 2 - 22px);
}

.journey__line::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--color-red);
  transform-origin: top;
  transform: scaleY(var(--progress));
  transition: transform 0.12s linear;
}

.journey__step {
  position: relative;
}

/* Pastille posée sur la ligne centrale : à droite de l'étape de gauche,
   à gauche de l'étape de droite. 22px = moitié de la pastille. */
.journey__dot {
  position: absolute;
  top: 0;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--color-cream);
  border: 2px solid var(--color-gray-200);
  color: var(--color-gray-400);
  transition: background 0.4s var(--ease-out), border-color 0.4s var(--ease-out),
    color 0.4s var(--ease-out);
}

.journey__dot svg {
  width: 20px;
  height: 20px;
}

/* Étape franchie : la pastille s'allume */
.journey__step.is-reached .journey__dot {
  background: var(--color-red);
  border-color: var(--color-red);
  color: var(--color-white);
}

.journey__num {
  display: block;
  font-family: var(--font-serif);
  font-style: normal;
  font-size: 0.85rem;
  color: var(--color-gray-500);
  margin-bottom: var(--s-2);
}

.journey__title {
  font-family: var(--font-serif);
  font-style: normal;
  font-weight: 500;
  font-size: clamp(1.35rem, 2.4vw, 1.85rem);
  line-height: 1.15;
  margin-bottom: var(--s-3);
}

.journey__text {
  font-size: 0.92rem;
  color: var(--color-gray-700);
  line-height: 1.6;
  max-width: 42ch;
}

/* La voiture roule sur la ligne : centrée sur le rail, elle parcourt
   toute la hauteur du rail selon --progress. --travel est mesuré en JS. */
.journey__car {
  position: absolute;
  left: 50%;
  top: 0;
  width: clamp(52px, 6.2vw, 74px);
  aspect-ratio: 200 / 560;
  z-index: 2;
  transform: translate(-50%, calc(var(--progress) * var(--travel, 0px)));
  transition: transform 0.12s linear;
  filter: drop-shadow(0 8px 18px rgba(10, 11, 12, 0.28));
}

.journey__car svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* Covering posé : bascule NETTE, pas de fondu progressif.
   La voiture reste d'origine jusqu'à l'étape 2, puis passe en rouge d'un coup
   (classe posée par journey.js). */
.journey__car-wrapped {
  opacity: 0;
}

.journey.is-wrapped .journey__car-wrapped {
  opacity: 1;
}

.journey__legend {
  margin-top: var(--s-4);
  text-align: center;
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--color-gray-500);
}

.journey__foot {
  margin-top: clamp(40px, 5vw, 64px);
  text-align: center;
}

/* Mobile : le rail repasse à gauche, toutes les étapes à droite —
   une colonne unique reste bien plus lisible sur écran étroit. */
@media (max-width: 860px) {
  /* Pas d'épinglage sur mobile : les 3 étapes empilées dépassent la hauteur
     d'écran, les figer masquerait du contenu. Le bloc défile normalement et
     le JS bascule sur son mode non épinglé. */
  .journey__driver {
    height: auto;
  }
  .journey__pin {
    position: static;
    height: auto;
    overflow: visible;
    display: block;
  }

  .journey__stage {
    --rail: 56px;
  }
  .journey__rail {
    left: calc(var(--rail) / 2);
    transform: none;
  }
  .journey__car {
    width: 38px;
  }
  .journey__steps {
    grid-template-columns: var(--rail) 1fr;
    row-gap: clamp(48px, 9vw, 72px);
  }
  .journey__step:nth-child(odd),
  .journey__step:nth-child(even) {
    grid-column: 2;
    text-align: left;
    padding-left: clamp(12px, 3vw, 20px);
    padding-right: 0;
  }
  .journey__step:nth-child(odd) .journey__text {
    margin-left: 0;
  }
  /* Le bord gauche de l'étape tombe pile sur la ligne : il suffit de
     reculer la pastille d'une demi-largeur pour la centrer dessus. */
  .journey__step:nth-child(odd) .journey__dot,
  .journey__step:nth-child(even) .journey__dot {
    left: -18px;
  }
  .journey__dot {
    width: 36px;
    height: 36px;
  }
  .journey__dot svg {
    width: 17px;
    height: 17px;
  }
}

/* ------------------------------------------------------------
   5. ACCESSIBILITÉ — mouvement réduit
   ------------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  .service-card,
  .service-card__media img,
  .service-card__link .arrow,
  .step3__icon,
  .journey__dot,
  .journey__line::after,
  .journey__car,
  .journey__car-wrapped {
    transition: none !important;
  }

  .service-card:hover,
  .service-card:focus-visible {
    transform: none;
  }

  /* Pas de trajet animé : on montre directement l'état final,
     véhicule couvert et parcours complet. */
  .journey__car {
    transform: translate(-50%, var(--travel, 0px));
  }
  .journey__car-wrapped {
    opacity: 1;
  }
  .journey__line::after {
    transform: scaleY(1);
  }
  .journey__dot {
    background: var(--color-red);
    border-color: var(--color-red);
    color: var(--color-white);
  }
}
