/* Garage BA Mécanique — version dynamique : vidéo d'ouverture, slogan animé, bandeau défilant,
   cartes vidéo, compteurs, apparitions au défilement.
   Mouvement (emil-design-eng) : sorties en ease-out fortes, 150 à 300 ms pour l'interface, un peu plus pour
   l'entrée du slogan (vue une fois) ; survols réservés aux souris ; tout se pose sous « réduire les animations ». */

:root {
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --ease-impact: cubic-bezier(0.2, 0.9, 0.25, 1);
  --line-soft: rgb(255 255 255 / 0.08);
  --line-mid: rgb(255 255 255 / 0.16);
}

/* ---------- sections at their natural height (the kit sizes main > section to whole screens) ---------- */
main > section.section-dyn:not(#_), main > section.ouverture:not(#_), footer.closing.pied:not(#_) {
  height: auto; min-height: 0; display: block;
}
main > section.section-dyn:not(#_) { padding: clamp(88px, 10vw, 136px) 0 clamp(72px, 8vw, 112px); }
main > section.section-dyn:not(#_) > .wrap, footer.closing.pied:not(#_) > .wrap { height: auto; display: block; }
.tete { margin-bottom: clamp(32px, 4vw, 56px); display: grid; gap: var(--s-4); }
.tete > * { margin: 0; }
.tete__ligne { color: var(--p-muted); font-size: var(--t-lead); max-width: 52ch; }

/* ---------- apparition au défilement : une fois, petite montée + fondu ---------- */
.js [data-reveal] { opacity: 0; transform: translateY(24px); }
.js [data-reveal].est-visible {
  opacity: 1; transform: none;
  transition: opacity 600ms var(--ease-out), transform 700ms var(--ease-out);
  transition-delay: calc(var(--i, 0) * 70ms);
}

/* =====================================================================
   OUVERTURE : la vidéo en plein écran, le voile, le slogan
   ===================================================================== */
.ouverture { position: relative; isolation: isolate; min-height: 100svh !important; display: flex !important; flex-direction: column; justify-content: flex-end; padding: calc(var(--nav) + 48px) 0 clamp(40px, 7vh, 88px) !important; overflow: hidden; background: #0b0a0a; }
.ouverture__media { position: absolute; inset: 0; z-index: -1; }
.ouverture__media picture, .ouverture__apercu, .ouverture__video { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; display: block; }
.ouverture__video { opacity: 0; transition: opacity 800ms ease; }
.ouverture__video.joue { opacity: 1; }
/* le voile : sombre à gauche et en bas, là où sont les mots ; la vidéo reste visible à droite */
.ouverture__voile {
  position: absolute; inset: 0;
  background:
    linear-gradient(90deg, rgb(10 9 9 / 0.92) 0%, rgb(10 9 9 / 0.78) 38%, rgb(10 9 9 / 0.35) 72%, rgb(10 9 9 / 0.25) 100%),
    linear-gradient(0deg, rgb(10 9 9 / 0.85) 0%, rgb(10 9 9 / 0) 45%);
}
@media (max-width: 767px) {
  .ouverture__voile { background: linear-gradient(0deg, rgb(10 9 9 / 0.96) 0%, rgb(10 9 9 / 0.86) 48%, rgb(10 9 9 / 0.45) 100%); }
}
.ouverture__contenu { position: relative; display: grid; gap: var(--s-5); justify-items: start; }
.ouverture__contenu > * { margin: 0; }

.ouverture__etat { display: inline-flex; align-items: center; gap: 10px; font-size: var(--t-small); font-weight: 500; color: var(--p-muted); }
.pastille { width: 8px; height: 8px; border-radius: 50%; background: var(--p-muted); flex: none; }
.ouverture__etat[data-etat="ouvert"] { color: var(--ok); }
.ouverture__etat[data-etat="ouvert"] .pastille { background: var(--ok); box-shadow: 0 0 0 4px rgb(90 209 127 / 0.18); }
.ouverture__etat[data-etat="ferme"] .pastille { background: var(--p-action); }

/* le slogan : « Pas de panique, » puis « il y a BA Mécanique ! » qui arrive avec impact */
.slogan {
  font-family: var(--font-display); font-weight: 400; text-transform: uppercase;
  font-size: clamp(52px, 8.6vw, 136px); line-height: 0.94; letter-spacing: 0.004em;
  margin: 0; max-width: none; text-wrap: balance;
}
.slogan__l1, .slogan__l2 { display: block; }
.slogan__in { display: inline-block; }
.slogan em { font-style: normal; color: var(--p-action); position: relative; white-space: nowrap; }
.slogan em::after {
  content: ""; position: absolute; left: 0; right: 0.12em; bottom: -0.04em; height: 0.07em;
  background: currentColor; transform-origin: left center;
}
.ouverture__sous {
  font-family: var(--font-display); text-transform: uppercase; letter-spacing: 0.02em;
  font-size: clamp(20px, 2.1vw, 30px); line-height: 1.15; color: var(--p-ink);
}
.ouverture__lead { font-size: var(--t-lead); line-height: 1.5; max-width: 46ch; color: rgb(242 240 235 / 0.88); }
.ouverture__actions { margin-top: var(--s-2); }
.ouverture__avis { display: inline-flex; align-items: center; gap: 10px; color: var(--p-ink); text-decoration: none; font-size: var(--t-small); min-height: 44px; }
.ouverture__avis .stars { color: var(--star); display: inline-flex; }
.ouverture__avis .stars svg { width: 90px; height: 18px; fill: currentColor; display: block; }
.ouverture__avis strong { font-weight: 600; }
@media (hover: hover) and (pointer: fine) { .ouverture__avis:hover span:last-child { text-decoration: underline; text-underline-offset: 0.2em; } }

.ouverture__pause, .bandeau__pause {
  position: absolute; z-index: 2; width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center; padding: 0; cursor: pointer;
  border: 1px solid var(--line-mid); background: rgb(10 9 9 / 0.6); color: #fff;
  transition: background-color 160ms ease, transform 160ms var(--ease-out);
}
.ouverture__pause { right: max(24px, env(safe-area-inset-right)); bottom: 24px; }
.ouverture__pause svg, .bandeau__pause svg { width: 18px; height: 18px; fill: currentColor; }
.ouverture__pause .i-lecture, .bandeau__pause .i-lecture { display: none; }
[aria-pressed="true"] > .i-pause { display: none; }
[aria-pressed="true"] > .i-lecture { display: block; }
.ouverture__pause:active, .bandeau__pause:active { transform: scale(0.94); }
@media (hover: hover) and (pointer: fine) { .ouverture__pause:hover, .bandeau__pause:hover { background: rgb(10 9 9 / 0.85); } }
@media (max-width: 639px) { .ouverture__pause { bottom: auto; top: calc(var(--nav) + 16px); } }

/* l'entrée : jouée une fois au chargement (pas au défilement) */
@media (prefers-reduced-motion: no-preference) {
  .js .slogan__l1 .slogan__in { animation: slogan-monte 700ms var(--ease-out) 150ms both; }
  .js .slogan__l2 .slogan__in { transform-origin: 0% 70%; animation: slogan-impact 620ms var(--ease-impact) 720ms both; }
  .js .slogan em::after { animation: slogan-trait 420ms var(--ease-out) 1180ms both; }
  .js .ouverture__etat, .js .ouverture__sous, .js .ouverture__lead, .js .ouverture__actions, .js .ouverture__avis {
    animation: entre-doux 560ms var(--ease-out) both;
  }
  .js .ouverture__etat { animation-delay: 60ms; }
  .js .ouverture__sous { animation-delay: 1050ms; }
  .js .ouverture__lead { animation-delay: 1130ms; }
  .js .ouverture__actions { animation-delay: 1210ms; }
  .js .ouverture__avis { animation-delay: 1290ms; }
}
@keyframes slogan-monte {
  from { opacity: 0; transform: translateY(0.35em); filter: blur(8px); }
  to { opacity: 1; transform: none; filter: blur(0); }
}
@keyframes slogan-impact {
  0% { opacity: 0; transform: scale(1.32) translateY(0.08em); filter: blur(10px); }
  55% { opacity: 1; transform: scale(0.97); filter: blur(0); }
  78% { transform: scale(1.012); }
  100% { opacity: 1; transform: none; filter: blur(0); }
}
@keyframes slogan-trait { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes entre-doux { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* =====================================================================
   BANDEAU DÉFILANT
   ===================================================================== */
.bandeau { position: relative; overflow: hidden; background: var(--p-action); color: #fff; border-block: 1px solid rgb(0 0 0 / 0.25); }
.bandeau__defile { display: flex; width: max-content; }
.bandeau__piste { display: flex; align-items: center; flex: none; padding-block: 18px; }
.bandeau__item { font-family: var(--font-display); text-transform: uppercase; font-size: clamp(22px, 2.4vw, 34px); line-height: 1; letter-spacing: 0.02em; white-space: nowrap; padding-inline: 28px; }
.bandeau__item--slogan { color: #fff; text-decoration: underline; text-decoration-thickness: 0.08em; text-underline-offset: 0.14em; }
.bandeau__sep { width: 22px; height: 22px; fill: rgb(18 15 14 / 0.55); flex: none; }
.bandeau__pause { right: 12px; top: 50%; margin-top: -22px; background: rgb(18 15 14 / 0.55); border-color: rgb(255 255 255 / 0.25); }
@media (prefers-reduced-motion: no-preference) {
  .bandeau__defile { animation: defile 42s linear infinite; }
  .bandeau.en-pause .bandeau__defile { animation-play-state: paused; }
  @media (hover: hover) and (pointer: fine) { .bandeau:hover .bandeau__defile { animation-play-state: paused; } }
}
@media (prefers-reduced-motion: reduce) { .bandeau__pause { display: none; } }
@keyframes defile { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* =====================================================================
   SERVICES EN CARTES VIDÉO
   ===================================================================== */
.cartes { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
@media (max-width: 1099px) { .cartes { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 599px) { .cartes { grid-template-columns: minmax(0, 1fr); gap: 16px; } }

.carte {
  position: relative; display: flex; flex-direction: column; overflow: hidden;
  border-radius: 16px; background: var(--p-surface); border: 1px solid var(--line-soft);
  transition: transform 260ms var(--ease-out), border-color 200ms ease, box-shadow 260ms var(--ease-out);
}
.js .carte[data-reveal].est-visible {
  transition: opacity 600ms var(--ease-out) calc(var(--i, 0) * 70ms), transform 700ms var(--ease-out) calc(var(--i, 0) * 70ms), border-color 200ms ease, box-shadow 260ms var(--ease-out);
}
.carte__media { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: #000; }
.carte__video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 500ms var(--ease-out); }
.carte__media::after { /* un léger dégradé sous l'image pour lier la vidéo au corps de la carte */
  content: ""; position: absolute; inset: auto 0 0 0; height: 40%;
  background: linear-gradient(0deg, rgb(29 28 26 / 0.7), transparent); pointer-events: none;
}
.carte__corps { padding: 20px 22px 24px; display: grid; gap: 8px; }
.carte__corps > * { margin: 0; }
.carte__titre { font-family: var(--font-display); font-weight: 400; text-transform: uppercase; font-size: 22px; line-height: 1.1; letter-spacing: 0.01em; }
.carte__corps p { color: var(--p-muted); font-size: 16px; line-height: 1.5; }
@media (hover: hover) and (pointer: fine) {
  .carte:hover { transform: translateY(-4px); border-color: rgb(201 42 34 / 0.55); box-shadow: 0 18px 40px -18px rgb(0 0 0 / 0.8); }
  .carte:hover .carte__video { transform: scale(1.04); }
}

.carte--appel {
  background: var(--p-action); border-color: transparent; color: #fff; text-decoration: none;
  padding: 28px 26px; justify-content: space-between; gap: 24px; min-height: 260px;
}
.carte__appel-haut { font-size: var(--t-small); font-weight: 500; color: rgb(255 255 255 / 0.85); }
.carte__appel-titre { font-family: var(--font-display); text-transform: uppercase; font-size: clamp(30px, 2.6vw, 40px); line-height: 1; }
.carte__appel-tel { display: inline-flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; }
.carte__appel-tel .m-arrow { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.6; transition: transform 200ms var(--ease-out); }
.carte--appel:active { transform: scale(0.98); }
@media (hover: hover) and (pointer: fine) {
  .carte--appel:hover { background: #b0241d; border-color: transparent; }
  .carte--appel:hover .m-arrow { transform: translateX(3px); }
}

/* l'encart inspection pré-achat sous les cartes */
.services__inspection {
  margin-top: 20px; display: grid; grid-template-columns: minmax(0, 1fr) 240px; gap: 32px; align-items: center;
  padding: 32px; border-radius: 16px; background: var(--p-surface); border: 1px solid var(--line-soft);
}
.services__inspection-texte { display: grid; gap: 12px; }
.services__inspection-texte > * { margin: 0; }
.services__inspection h3 { font-family: var(--font-display); font-weight: 400; text-transform: uppercase; font-size: clamp(28px, 3vw, 44px); line-height: 1.02; }
.services__inspection p { font-size: var(--t-lead); color: rgb(242 240 235 / 0.85); max-width: 46ch; }
#services .services__inspection .services__clip { width: 240px; height: auto; aspect-ratio: 9 / 16; margin: 0; min-height: 0; }
@media (max-width: 767px) {
  .services__inspection { grid-template-columns: minmax(0, 1fr); padding: 24px; }
  #services .services__inspection .services__clip { width: min(100%, 260px); }
}

/* =====================================================================
   POURQUOI NOUS CHOISIR : quatre raisons, les chiffres comptent une fois
   ===================================================================== */
.pourquoi { background: #0d0c0b; border-block: 1px solid var(--line-soft); }
.pourquoi:not(#_) { position: relative; isolation: isolate; }
.pourquoi::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: url("../images/eclaboussures-blanc.svg") 0 0 / 520px auto repeat; opacity: 0.04;
}
.raisons { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; }
@media (max-width: 1023px) { .raisons { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 40px; } }
@media (max-width: 479px) { .raisons { grid-template-columns: minmax(0, 1fr); } }
.raison { border-top: 2px solid var(--p-action); padding-top: 24px; display: grid; gap: 10px; align-content: start; }
.raison > * { margin: 0; }
.raison__chiffre {
  font-family: var(--font-display); text-transform: uppercase; color: var(--p-ink);
  font-size: clamp(64px, 7vw, 104px); line-height: 0.9; letter-spacing: 0.005em;
  display: flex; align-items: baseline; font-variant-numeric: tabular-nums; min-height: 0.95em;
}
.raison__chiffre [data-compte] { color: var(--p-action); display: inline-block; min-width: 1.05ch; }
.raison__unite { font-size: 0.36em; letter-spacing: 0.02em; }
.raison__etoile { width: 0.42em; height: 0.42em; fill: var(--star); margin-left: 0.12em; align-self: center; }
.raison__chiffre--mot { font-size: clamp(40px, 4.2vw, 60px); color: var(--p-action); line-height: 1; padding-top: 0.32em; }
.raison h3 { font-family: var(--font-display); font-weight: 400; text-transform: uppercase; font-size: 22px; line-height: 1.1; letter-spacing: 0.01em; }
.raison p:last-child { color: var(--p-muted); font-size: 16px; line-height: 1.55; }
.raison p [data-compte] { color: var(--p-ink); font-weight: 600; }

/* =====================================================================
   À PROPOS
   ===================================================================== */
.apropos__intro { font-family: var(--font-display); text-transform: uppercase; font-size: clamp(32px, 3.6vw, 52px); line-height: 1.02; letter-spacing: 0.005em; max-width: 16ch; }
.apropos__intro em { font-style: normal; color: var(--p-action); }
#apropos .apropos__clip { height: min(640px, 78svh); }
@media (max-width: 1023px) { #apropos .apropos__clip { height: auto; } }

/* =====================================================================
   ADRESSE ET HEURES (section-dyn)
   ===================================================================== */
#visite .visite__grid:not(#_) { min-height: 520px; }
@media (max-width: 1023px) { #visite .visite__grid:not(#_) { min-height: 0; } }

/* =====================================================================
   PIED DE PAGE : le slogan une dernière fois
   ===================================================================== */
footer.closing.pied:not(#_) { padding: clamp(88px, 10vw, 136px) 0 32px; }
.pied__appel { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 40px; align-items: end; padding-bottom: clamp(56px, 7vw, 96px); margin-bottom: 48px; border-bottom: 1px solid var(--line-soft); }
@media (max-width: 899px) { .pied__appel { grid-template-columns: minmax(0, 1fr); } }
.pied__slogan { margin: 0; font-family: var(--font-display); text-transform: uppercase; font-size: clamp(44px, 6.4vw, 100px); line-height: 0.95; letter-spacing: 0.004em; }
.pied__slogan em { font-style: normal; color: var(--p-action); }
.pied__actions { display: grid; gap: 20px; justify-items: start; }
.pied__actions > * { margin: 0; }
.btn--grand { height: 56px; padding-inline: 28px; font-size: 18px; }
@media (max-width: 639px) { .btn--grand { width: 100%; } }

/* ---------- réduire les animations : tout est visible et immobile ---------- */
@media (prefers-reduced-motion: reduce) {
  .js [data-reveal] { opacity: 1; transform: none; }
  .carte, .carte__video, .ouverture__video { transition: none; }
}

/* ---------- ajustements après rendu ---------- */
.slogan { line-height: 1.02; padding-bottom: 0.08em; }
.slogan em::after { bottom: 0.02em; height: 0.06em; }
.raison__chiffre { height: clamp(60px, 6.6vw, 96px); align-items: flex-end; }
.raison__chiffre--mot { font-size: clamp(30px, 2.9vw, 44px); padding-top: 0; line-height: 0.95; }
.apropos__intro { font-size: clamp(28px, 2.9vw, 42px); max-width: 22ch; }
.pied__slogan { line-height: 1.0; }
.slogan { line-height: 1.1; }

/* ---------- le nom complet dans le menu et le pied de page ---------- */
.logo__texte {
  font-family: var(--font-display); font-weight: 400; text-transform: uppercase;
  font-size: 21px; line-height: 1; letter-spacing: 0.02em; white-space: nowrap; color: var(--p-ink);
}
.nav__logo.logo { min-width: 0; flex-shrink: 0; }
@media (max-width: 1099px) { .nav .logo__texte { font-size: 19px; } }
@media (max-width: 639px) { .nav .logo__texte { font-size: 18px; } .nav .logo { gap: 8px; } }
@media (max-width: 359px) { .nav .logo__texte { font-size: 16px; letter-spacing: 0.01em; } .nav .logo__art { height: 30px; } }

/* ---------- accessibilité (contrôle final) ---------- */
.carte__appel-haut { color: #fff; }
.bandeau__pause:focus-visible, .ouverture__pause:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
