/* ============================================================
   90 — INTERACTIONS & ANIMATIONS (repasse design, hors maquette)
   États hover/focus/active, reveal au scroll, parallaxe (via
   js/interactions.js), accordéon FAQ. Tout est désactivable via
   prefers-reduced-motion.
   ============================================================ */

/* ------------------------------------------------------------
   1. Boutons pilule (header, hero, offre, conviction, footer)
   Recette commune : micro-lift + ombre creusée + flèche qui glisse.
   ------------------------------------------------------------ */

.site-header__cta,
.hero__cta,
.offre__cta,
.conviction__cta,
.faq__whatsapp,
.faq__contact {
  transition:
    transform 180ms cubic-bezier(0.2, 0.6, 0.3, 1),
    box-shadow 180ms ease,
    background-color 180ms ease,
    border-color 180ms ease;
  will-change: transform;
}

.site-header__cta:hover,
.hero__cta:hover,
.offre__cta:hover,
.conviction__cta:hover,
.faq__whatsapp:hover {
  transform: translateY(-2px);
}

.site-header__cta:active,
.hero__cta:active,
.offre__cta:active,
.conviction__cta:active,
.faq__whatsapp:active {
  transform: translateY(0) scale(0.98);
  transition-duration: 80ms;
}

/* Variante sombre : ombre plus profonde au survol */
.site-header__cta:hover,
.hero__cta--primary:hover,
.offre__cta--primary:hover,
.conviction__cta:hover {
  box-shadow:
    0px 12px 6px -8px rgba(88, 88, 88, 0.28),
    0px 12px 24px -16px rgba(51, 51, 51, 0.34),
    0px 6px 16px 0px rgba(126, 126, 126, 0.2),
    0px 12px 24px 0px rgba(134, 134, 134, 0.2),
    inset 0px 2px 0px 0px rgba(255, 255, 255, 0.16);
}

/* Variante ghost : fond qui se teinte + bordure qui se renforce */
.hero__cta--ghost:hover,
.offre__cta--ghost:hover {
  background-color: var(--color-surface);
  border-color: var(--color-border-strong);
}

/* Flèche des CTA : glisse vers la droite au survol du bouton */
.site-header__cta img,
.hero__cta img,
.offre__cta img,
.conviction__cta-icon,
.faq__whatsapp-arrow {
  transition: transform 180ms cubic-bezier(0.2, 0.6, 0.3, 1);
}

/* (fallback sans JS uniquement — quand le swap .has-arrow-swap est posé,
   c'est la section 10 v2 qui pilote la flèche) */
.site-header__cta:not(.has-arrow-swap):hover img,
.hero__cta:not(.has-arrow-swap):hover img,
.offre__cta:not(.has-arrow-swap):hover img,
.conviction__cta:not(.has-arrow-swap):hover .conviction__cta-icon,
.faq__whatsapp:not(.has-arrow-swap):hover .faq__whatsapp-arrow {
  transform: translateX(3px);
}

/* Focus clavier : anneau visible, cohérent partout */
.site-header__cta:focus-visible,
.hero__cta:focus-visible,
.offre__cta:focus-visible,
.conviction__cta:focus-visible,
.faq__whatsapp:focus-visible,
.site-header__link:focus-visible,
.site-footer__nav-link:focus-visible,
.site-footer__social:focus-visible,
.faq__question:focus-visible {
  outline: 2px solid var(--color-primary-vivid);
  outline-offset: 3px;
  border-radius: var(--radius-pill);
}

/* ------------------------------------------------------------
   2. Liens de navigation (header + footer)
   Soulignement animé de gauche à droite.
   ------------------------------------------------------------ */

.site-header__link,
.site-footer__nav-link {
  background-image: linear-gradient(currentColor, currentColor);
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 0% 1px;
  transition: background-size 220ms cubic-bezier(0.2, 0.6, 0.3, 1), color 180ms ease;
  padding-bottom: 2px;
}

.site-header__link:hover,
.site-footer__nav-link:hover {
  background-size: 100% 1px;
}

.site-footer__social {
  transition: transform 180ms ease, opacity 180ms ease;
}

.site-footer__social:hover {
  transform: translateY(-2px);
  opacity: 0.85;
}

/* ------------------------------------------------------------
   3. Cards (préoccupations, pourquoi, intérieur, demo, offre)
   Lift discret + ombre. Les fonds sombres gardent un lift seul.
   ------------------------------------------------------------ */

.pourquoi__card,
.interieur__card,
.preoccupations__cell,
.demo__card--elevated,
.offre__panel {
  transition: transform 220ms cubic-bezier(0.2, 0.6, 0.3, 1), box-shadow 220ms ease;
}

.pourquoi__card:hover,
.interieur__card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px -12px rgba(38, 41, 46, 0.16);
}

.offre__panel:hover {
  transform: translateY(-3px);
}

/* Logos partenaires : gris → couleur au survol de la bande */
.hero__logos img {
  transition: opacity 200ms ease, transform 200ms ease;
}

.hero__logos img:hover {
  transform: scale(1.06);
}

/* ------------------------------------------------------------
   4. Accordéon FAQ : rotation du picto + apparition de la réponse
   ------------------------------------------------------------ */

.faq__question {
  cursor: pointer;
}

.faq__question img,
.faq__question .faq__question-icon {
  transition: transform 240ms cubic-bezier(0.2, 0.6, 0.3, 1);
}

.faq__item[open] .faq__question img,
.faq__item[open] .faq__question .faq__question-icon {
  transform: rotate(45deg);
}

.faq__item[open] .faq__answer {
  animation: faq-slide 240ms cubic-bezier(0.2, 0.6, 0.3, 1) both;
}

@keyframes faq-slide {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ------------------------------------------------------------
   5. Reveal au scroll (classes posées par js/interactions.js)
   .reveal = état initial masqué ; .reveal.is-in = visible.
   --reveal-delay permet le stagger des grilles de cards.
   ------------------------------------------------------------ */

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity 600ms cubic-bezier(0.2, 0.6, 0.3, 1),
    transform 600ms cubic-bezier(0.2, 0.6, 0.3, 1);
  transition-delay: var(--reveal-delay, 0ms);
  will-change: opacity, transform;
}

.reveal.is-in {
  opacity: 1;
  transform: none;
  /* retours 13/08 : `will-change` maintient un contexte d'empilement même
     une fois l'animation finie — les badges des timelines (z-index 2) se
     retrouvaient piégés SOUS le filet continu de la grille. On le relâche
     à l'arrivée, ce qui est aussi la bonne pratique perf. */
  will-change: auto;
}

/* ------------------------------------------------------------
   6. Parallaxe & flottement des étoiles (hero + décor global)
   Le JS pilote --plx (scroll) ; le flottement idle est en CSS.
   L'élément garde son positionnement d'origine : translate only.
   ------------------------------------------------------------ */

.plx {
  transform: translateY(var(--plx, 0px));
  will-change: transform;
}

/* Flottement idle très lent, amplitudes désynchronisées */
@keyframes float-a { 0%, 100% { translate: 0 0; } 50% { translate: 0 -8px; } }
@keyframes float-b { 0%, 100% { translate: 0 0; } 50% { translate: 0 6px; } }

.hero__star--orange-lg,
.hero__star--violet-lg { animation: float-a 7s ease-in-out infinite; }

.hero__star--orange-sm,
.hero__star--violet-sm,
.hero__star--flower    { animation: float-b 9s ease-in-out infinite; }

/* Header : ombre légère une fois la page scrollée (classe posée en JS) */
.site-header {
  transition: box-shadow 220ms ease;
}

.site-header.is-scrolled {
  box-shadow: 0 8px 24px -16px rgba(38, 41, 46, 0.18);
}

/* ------------------------------------------------------------
   7. Motion réduite : tout est neutralisé
   ------------------------------------------------------------ */

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .plx { transform: none; }
  .hero__star--orange-lg,
  .hero__star--violet-lg,
  .hero__star--orange-sm,
  .hero__star--violet-sm,
  .hero__star--flower { animation: none; }
  .site-header__cta, .hero__cta, .offre__cta, .conviction__cta,
  .faq__whatsapp, .pourquoi__card, .interieur__card, .offre__panel,
  .site-header__link, .site-footer__nav-link {
    transition: none;
  }
  .faq__item[open] .faq__answer { animation: none; }
}

/* ============================================================
   V2 — grammaire d'animation type Volio SaaS kit
   ============================================================ */

/* ------------------------------------------------------------
   8. Entrée séquencée du hero au chargement (fade-up en cascade
   badge → titre → sous-titre → CTA → notes → dashboard)
   ------------------------------------------------------------ */

@keyframes intro-up {
  from { opacity: 0; transform: translateY(28px); }
  to   { opacity: 1; transform: none; }
}

.hero__eyebrow,
.hero__title,
.hero__subtitle,
.hero__ctas,
.hero__notes,
.hero__dashboard,
.hero__dashboard-note {
  animation: intro-up 700ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* La pill du dashboard est centrée par translateX(-50%) : le keyframe
   générique (transform: none) écrasait ce centrage et la faisait déborder
   à droite. Elle a donc son propre keyframe, qui conserve la translation. */
@keyframes intro-up-centered {
  from { opacity: 0; transform: translate(-50%, 28px); }
  to   { opacity: 1; transform: translateX(-50%); }
}

.hero__dashboard-note { animation-name: intro-up-centered; }

.hero__eyebrow        { animation-delay: 60ms; }
.hero__title          { animation-delay: 160ms; }
.hero__subtitle       { animation-delay: 260ms; }
.hero__ctas           { animation-delay: 360ms; }
.hero__notes          { animation-delay: 440ms; }
.hero__dashboard,
.hero__dashboard-note { animation-delay: 540ms; }

/* ------------------------------------------------------------
   9. Marquee de logos (bande hero) — contenu dupliqué par JS,
   défilement linéaire infini, pause au survol.
   ------------------------------------------------------------ */

.marquee {
  display: flex;
  width: max-content;
  animation: marquee-scroll var(--marquee-duration, 36s) linear infinite;
}

.marquee > * {
  flex: none;
}

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

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

/* ------------------------------------------------------------
   10. Swap de flèche des CTA (la flèche sort à droite, sa
   jumelle entre par la gauche) — wrap .cta-arrow posé par JS.
   ------------------------------------------------------------ */

.cta-arrow {
  display: inline-grid;
  overflow: hidden;
}

.cta-arrow img {
  grid-area: 1 / 1;
  transition: transform 260ms cubic-bezier(0.22, 1, 0.36, 1), opacity 200ms ease;
}

.cta-arrow img + img {
  transform: translateX(-18px);
  opacity: 0;
}

.has-arrow-swap:hover .cta-arrow img:first-child {
  transform: translateX(18px);
  opacity: 0;
}

.has-arrow-swap:hover .cta-arrow img + img {
  transform: translateX(0);
  opacity: 1;
}

/* La règle générique v1 « flèche qui glisse » ne doit plus bouger
   le wrap swappé (elle ciblerait les deux img) */
.has-arrow-swap:hover .cta-arrow img:first-child { /* garde la sortie */ }

/* ------------------------------------------------------------
   11. Tooltips équipe (bande conviction) : pop + flottement
   ------------------------------------------------------------ */

.conviction__tooltip {
  transform: translateY(6px) scale(0.96);
  transform-origin: bottom center;
  transition: opacity 220ms ease, transform 260ms cubic-bezier(0.22, 1, 0.36, 1);
}

.conviction__badge:hover .conviction__tooltip,
.conviction__badge:focus-within .conviction__tooltip {
  transform: translateY(0) scale(1);
}

.conviction__badge {
  transition: transform 180ms ease;
}

.conviction__badge:hover {
  transform: translateY(-2px);
}

/* ------------------------------------------------------------
   12. Visuels : zoom interne discret au survol
   ------------------------------------------------------------ */

.case-studies__device { overflow: hidden; }

.case-studies__device img,
.produit__visual img {
  transition: transform 600ms cubic-bezier(0.22, 1, 0.36, 1);
}

.case-studies__device:hover img,
.produit__visual:hover img {
  transform: scale(1.03);
}

/* Cards méthode (nouvelle section) : même recette que pourquoi */
.methode__card {
  transition: transform 220ms cubic-bezier(0.2, 0.6, 0.3, 1), box-shadow 220ms ease;
}

.methode__card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px -12px rgba(38, 41, 46, 0.16);
}

/* ------------------------------------------------------------
   13. Motion réduite (compléments v2)
   ------------------------------------------------------------ */

@media (prefers-reduced-motion: reduce) {
  .hero__eyebrow, .hero__title, .hero__subtitle, .hero__ctas,
  .hero__notes, .hero__dashboard, .hero__dashboard-note { animation: none; }
  .marquee { animation: none; }
  .cta-arrow img { transition: none; }
  .conviction__tooltip { transition: none; transform: none; }
  .case-studies__device img, .produit__visual img { transition: none; }
  .methode__card { transition: none; }
}
