/* ═══════════════════════════════════════════════════════════════
   LES ACACIAS — motion.css
   Couche d'animation partagée (chargée après style.css).
   Principe : tout est visible par défaut ; le JS ajoute .mo sur <html>
   puis déclenche les entrées. Aucune couleur / police modifiée.
═══════════════════════════════════════════════════════════════ */

:root {
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-io:  cubic-bezier(0.65, 0, 0.35, 1);
}

html { scroll-padding-top: calc(var(--nav-h, 72px) + 20px); }

/* ── Navigation entre pages (View Transitions, progressif) ── */
@view-transition { navigation: auto; }
.site-header { view-transition-name: site-header; }
::view-transition-old(root) { animation: mo-vt-out .22s var(--ease-io) both; }
::view-transition-new(root) { animation: mo-vt-in  .5s  var(--ease-out) both; }
@keyframes mo-vt-out { to   { opacity: 0; } }
@keyframes mo-vt-in  { from { opacity: 0; } }

/* ── Surfaces du navigateur ── */
::selection { background: rgba(74,144,164,.28); color: var(--text, #2C3E50); }
:focus-visible { outline: 2px solid var(--primary, #4A90A4); outline-offset: 3px; border-radius: 6px; }
html { scrollbar-color: rgba(74,144,164,.55) var(--bg, #F7F4EF); scrollbar-width: thin; }
.stat-number, .stat-res-number, .hero-float-number, .price-val { font-variant-numeric: tabular-nums; }

/* ── Barre de progression de lecture ── */
.mo-progress {
  position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 1000;
  transform: scaleX(0); transform-origin: 0 50%;
  background: linear-gradient(90deg, var(--primary-lt, #7BBFB5), var(--primary, #4A90A4) 60%, var(--accent, #F2A65A));
  pointer-events: none;
}

/* ── Header : se range en descendant, revient en remontant ── */
.mo .site-header {
  transition: background .25s, box-shadow .25s, backdrop-filter .25s, transform .5s var(--ease-out);
}
.mo .site-header.is-hidden { transform: translateY(-110%); }
.mo .site-header.is-hidden:focus-within { transform: none; }

/* Soulignement animé des liens de navigation */
.cms-nav-links > li > a { position: relative; }
@media (min-width: 769px) {
  .cms-nav-links > li > a::after {
    content: ''; position: absolute; left: 12px; right: 12px; bottom: 3px; height: 2px;
    border-radius: 2px; background: currentColor;
    transform: scaleX(0); transform-origin: 0 50%;
    transition: transform .45s var(--ease-out);
  }
  .cms-nav-links > li > a:hover::after,
  .cms-nav-links > li > a.active::after { transform: scaleX(1); }
}
.nav-dropdown { transform-origin: 20% 0; transform: translateY(-8px) scale(.97); transition: opacity .25s var(--ease-out), transform .35s var(--ease-out); }
.nav-has-dropdown.open .nav-dropdown { transform: none; }
.nav-dropdown-arrow { transition: transform .35s var(--ease-out); }

/* Menu mobile : ouverture fluide */
@media (max-width: 768px) {
  .mo .cms-nav-links.is-open { animation: mo-menu .45s var(--ease-out) both; }
  .mo .cms-nav-links.is-open > li { animation: mo-rise .55s var(--ease-out) both; }
  .mo .cms-nav-links.is-open > li:nth-child(2) { animation-delay: .04s; }
  .mo .cms-nav-links.is-open > li:nth-child(3) { animation-delay: .08s; }
  .mo .cms-nav-links.is-open > li:nth-child(4) { animation-delay: .12s; }
  .mo .cms-nav-links.is-open > li:nth-child(5) { animation-delay: .16s; }
  .mo .cms-nav-links.is-open > li:nth-child(6) { animation-delay: .20s; }
}
@keyframes mo-menu { from { opacity: 0; clip-path: inset(0 0 100% 0); } to { opacity: 1; clip-path: inset(0 0 0 0); } }
@keyframes mo-rise { from { opacity: 0; translate: 0 14px; } to { opacity: 1; translate: 0 0; } }

/* ── Apparitions au scroll ── */
.mo [data-mo]:not(.is-in):not(.mo-done) { opacity: 0; translate: 0 30px; }
.mo [data-mo].is-in:not(.mo-done) {
  animation: mo-in 1s var(--ease-out) var(--d, 0ms) both;
}
.mo [data-mo="left"]:not(.is-in):not(.mo-done)  { translate: -36px 0; }
.mo [data-mo="right"]:not(.is-in):not(.mo-done) { translate: 36px 0; }
.mo [data-mo="media"]:not(.is-in):not(.mo-done) { translate: 0 0; clip-path: inset(0 0 100% 0 round 28px); opacity: 1; }
.mo [data-mo="media"].is-in:not(.mo-done) { animation: mo-media 1.25s var(--ease-out) var(--d, 0ms) both; }
.mo [data-mo].mo-done { animation: none; opacity: 1; translate: none; clip-path: none; }
@keyframes mo-in {
  from { opacity: 0; translate: var(--fx, 0) var(--fy, 30px); filter: blur(5px); }
  to   { opacity: 1; translate: 0 0; filter: blur(0); }
}
@keyframes mo-media {
  from { clip-path: inset(0 0 100% 0 round 28px); }
  to   { clip-path: inset(0 0 0 0 round 28px); }
}
.mo [data-mo="left"]  { --fx: -36px; --fy: 0px; }
.mo [data-mo="right"] { --fx: 36px;  --fy: 0px; }

/* ── Titres : montée mot à mot ── */
.mo-w { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: .16em; margin-bottom: -.16em; }
.mo-w > span { display: inline-block; }
.mo [data-split]:not(.is-in) .mo-w > span { translate: 0 108%; }
.mo [data-split].is-in .mo-w > span {
  animation: mo-word 1.05s var(--ease-out) calc(var(--i, 0) * 65ms + var(--base, 0ms)) both;
}
.mo [data-split].mo-done .mo-w > span { animation: none; translate: none; }
@keyframes mo-word { from { translate: 0 108%; } to { translate: 0 0; } }

/* ── Hero : séquence d'entrée ── */
.mo .section-hero::before {
  inset: -12% -8%;
  animation: mo-drift 22s ease-in-out infinite alternate;
}
@keyframes mo-drift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(-2.5%, 3%, 0) scale(1.07); }
}
.mo .cms-hero-inner, .mo .page-hero-inner {
  translate: 0 calc(var(--hp, 0) * 70px);
  opacity: calc(1 - var(--hp, 0) * .7);
}
.mo .cms-hero-img-wrap { translate: 0 calc(var(--hp, 0) * -40px); }
.mo .cms-hero-img-wrap .clay-zone--hero { animation: mo-media 1.5s var(--ease-out) .35s both; }
.mo .cms-hero-img-wrap .cms-hero-img { animation: mo-settle 2s var(--ease-out) .35s both; }
@keyframes mo-settle { from { scale: 1.18; } to { scale: 1; } }
.mo .hero-float-card { animation: mo-pop .9s var(--ease-out) 1.05s both, mo-float 7s ease-in-out 2s infinite; }
.mo .presentation-float-badge.mo-done,
.mo .presentation-float-badge.is-in { animation: mo-float 8s ease-in-out infinite; }
@keyframes mo-pop   { from { opacity: 0; scale: .82; translate: -12px 20px; } to { opacity: 1; scale: 1; translate: 0 0; } }
@keyframes mo-float { 0%, 100% { translate: 0 0; } 50% { translate: 0 -9px; } }

/* ── Images : échelle de base + zoom doux au survol ── */
.mo .img-zone-img { scale: 1.12; transition: scale 1.1s var(--ease-out); will-change: translate; }
.mo .service-card:hover .img-zone-img,
.mo .anim-card:hover .img-zone-img,
.mo .galerie-item:hover .img-zone-img,
.mo .img-zone:hover .img-zone-img { scale: 1.2; }
.mo .service-card .clay-zone img { transition: scale 1s var(--ease-out); }
.mo .service-card:hover .clay-zone img { scale: 1.06; }

/* ── Cartes : survol plus riche (les transitions existantes sont conservées) ── */
.service-card, .anim-card, .pricing-card, .cms-testi-card, .unite-card, .espace-card, .equip-item,
.acti-card, .offre-card, .categorie-card, .tarif-card, .zone-card, .quickinfo-card, .valeur-item {
  transition-property: transform, box-shadow, border-color, background-color;
  transition-duration: .55s;
  transition-timing-function: var(--ease-out);
}
.pricing-card:hover, .cms-testi-card:hover, .unite-card:hover, .espace-card:hover, .equip-item:hover,
.acti-card:hover, .offre-card:hover, .categorie-card:hover, .tarif-card:hover, .zone-card:hover,
.quickinfo-card:hover, .valeur-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 18px 48px rgba(74,144,164,.18);
}
.service-card:hover, .anim-card:hover { transform: translateY(-6px); }

/* ── Boutons : reflet + retour tactile ── */
.cms-btn, .nav-btn-primary, .nav-btn-ghost, .service-card-btn { position: relative; overflow: hidden; isolation: isolate; }
.cms-btn-primary::after, .nav-btn-primary::after, .service-card-btn--white::after {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(105deg, transparent 30%, rgba(255,255,255,.35) 50%, transparent 70%);
  transform: translateX(-120%); transition: transform .8s var(--ease-out);
}
.cms-btn-primary:hover::after, .nav-btn-primary:hover::after, .service-card-btn--white:hover::after { transform: translateX(120%); }
.cms-btn:active, .nav-btn-primary:active, .nav-btn-ghost:active, .service-card-btn:active { transform: scale(.97); transition-duration: .1s; }
.service-card-link, .cms-blog-read { background: linear-gradient(currentColor, currentColor) 0 100% / 0 1.5px no-repeat; transition: background-size .5s var(--ease-out), color .2s; padding-bottom: 2px; }
.service-card-link:hover, .cms-blog-read:hover { background-size: 100% 1.5px; }

/* ── Formulaires : champs vivants ── */
input, textarea, select { transition: border-color .25s, box-shadow .35s var(--ease-out), background-color .25s; }
input:focus, textarea:focus, select:focus { box-shadow: 0 0 0 4px rgba(74,144,164,.16); }

/* ── Accessibilité : mouvement réduit ── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  ::view-transition-old(root), ::view-transition-new(root) { animation-duration: .01s; }
  .mo [data-mo]:not(.is-in):not(.mo-done) { translate: 0 0; }
  .mo [data-mo].is-in:not(.mo-done) { animation: mo-fade .5s ease var(--d, 0ms) both; }
  .mo [data-mo="media"]:not(.is-in):not(.mo-done) { clip-path: none; opacity: 0; }
  .mo [data-mo="media"].is-in:not(.mo-done) { animation: mo-fade .5s ease both; }
  .mo [data-split]:not(.is-in) .mo-w > span { translate: none; }
  .mo [data-split].is-in .mo-w > span { animation: none; }
  .mo .section-hero::before, .mo .hero-float-card, .mo .presentation-float-badge,
  .mo .cms-hero-img-wrap .clay-zone--hero, .mo .cms-hero-img-wrap .cms-hero-img { animation: none; }
  .mo .cms-hero-inner, .mo .page-hero-inner, .mo .cms-hero-img-wrap { translate: none; opacity: 1; }
  .mo .img-zone-img { scale: 1; transition: none; }
  .mo .site-header.is-hidden { transform: none; }
  .mo .cms-nav-links.is-open, .mo .cms-nav-links.is-open > li { animation: none; }
  .mo-progress { display: none; }
}
@keyframes mo-fade { from { opacity: 0; } to { opacity: 1; } }
