/* ═══════════════════════════════════════════════════════════
   EDMOND'S & COMPANY — Mouvement (avec motion.js)
   Chargé sur toutes les pages. Tout est neutralisé si le
   visiteur a demandé à réduire les animations, et à l'impression.
   ═══════════════════════════════════════════════════════════ */

/* Arrivée sur la page */
@media (prefers-reduced-motion: no-preference) {
  body { animation: ecPageIn .5s ease both; }
}
@keyframes ecPageIn { from { opacity: 0; } to { opacity: 1; } }
html.ec-leaving body { opacity: 0; transition: opacity .18s ease; }

/* Révélations au défilement */
.motion .rv { opacity: 0; transform: translateY(22px); transition: opacity .8s cubic-bezier(.2,.7,.2,1), transform .8s cubic-bezier(.2,.7,.2,1); }
.motion .rv.rv-in { opacity: 1; transform: none; }
/* Titres : simple fondu (pas de masque : un élément entièrement masqué n'est jamais détecté à l'écran) */
/* Filet doré sous les surtitres */
.motion .section-eyebrow.rv::after { content: ''; display: block; height: 1px; width: 0; background: var(--gold, #b89a6a); margin-top: .7rem; transition: width 1.1s ease .3s; }
.section-header.center .section-eyebrow::after { margin-left: auto; margin-right: auto; }
.motion .section-eyebrow.rv-in::after { width: 44px; }
/* Photos : rideau qui s'ouvre */
.motion .rv-img { clip-path: inset(-40px -40px 100% -40px); transition: clip-path 1.3s cubic-bezier(.7,0,.2,1); }
.motion .rv-img.rv-in { clip-path: inset(-40px); }

/* Accueil : titre ligne par ligne */
.motion #hero h1, .motion .hero-content h1 { animation: none; }
.ec-ln { display: block; overflow: hidden; padding-bottom: .06em; }
.ec-ln > span { display: block; animation: ecLineUp 1.1s cubic-bezier(.2,.7,.2,1) both; }
.ec-ln:nth-child(2) > span { animation-delay: .18s; }
@keyframes ecLineUp { from { transform: translateY(105%); } to { transform: none; } }
@media (prefers-reduced-motion: no-preference) {
.hero-eyebrow::after { content: ''; display: block; width: 0; height: 1px; margin-top: .8rem; background: var(--gold, #b89a6a); animation: ecRule 1.2s ease .5s forwards; }
@keyframes ecRule { to { width: 56px; } }
.hero-sub { animation: ecUp 1s cubic-bezier(.2,.7,.2,1) .45s both; }
.hero-actions { animation: ecUp 1s cubic-bezier(.2,.7,.2,1) .6s both; }
.hero-stats .hs-item { animation: ecUp .9s cubic-bezier(.2,.7,.2,1) both; }
.hero-stats .hs-item:nth-of-type(1) { animation-delay: .8s; }
.hero-stats .hs-item:nth-of-type(2) { animation-delay: .95s; }
.hero-stats .hs-item:nth-of-type(3) { animation-delay: 1.1s; }
.hero-stats { border-top-color: transparent; position: relative; }
.hero-stats::before { content: ''; position: absolute; top: -1px; left: 0; height: 1px; width: 100%; background: rgba(184,154,106,.35); transform: scaleX(0); transform-origin: left; animation: ecScale 1.4s cubic-bezier(.2,.7,.2,1) .7s forwards; }
@keyframes ecScale { to { transform: scaleX(1); } }
@keyframes ecUp { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
}
#hero .hero-bg-img { will-change: transform; }

/* En-têtes des pages intérieures et des articles */
@media (prefers-reduced-motion: no-preference) {
.page-hero .container > *, .art-hero-inner > * { animation: ecUp .9s cubic-bezier(.2,.7,.2,1) both; }
.page-hero .container > :nth-child(2), .art-hero-inner > :nth-child(2) { animation-delay: .12s; }
.page-hero .container > :nth-child(3), .art-hero-inner > :nth-child(3) { animation-delay: .24s; }
.page-hero .container > :nth-child(n+4), .art-hero-inner > :nth-child(n+4) { animation-delay: .36s; }

}

/* Survols */
.btn-primary { position: relative; overflow: hidden; }
.btn-primary::after { content: ''; position: absolute; top: 0; bottom: 0; left: -60%; width: 40%; background: linear-gradient(100deg, transparent, rgba(255,255,255,.45), transparent); transform: skewX(-18deg); pointer-events: none; }
.btn-primary:hover::after { left: 130%; transition: left .75s ease; }
.tool-card, .pub-card-link, .etude, .mx-value, .sv-others a { transition: transform .45s cubic-bezier(.2,.7,.2,1), box-shadow .45s; }
.tool-card:hover, .pub-card-link:hover, .etude:hover, .mx-value:hover { transform: translateY(-5px); box-shadow: 0 20px 44px rgba(26,20,16,.12); }

/* Barre de navigation : s'efface à la descente, revient à la remontée */
#navbar { transition: background .5s, box-shadow .5s, transform .45s cubic-bezier(.2,.7,.2,1); }
#navbar.ec-hide { transform: translateY(-100%); }

/* Fil de lecture (accueil et articles) */
.page-progress { position: fixed; top: 0; left: 0; right: 0; height: 2px; background: linear-gradient(90deg, var(--gold-d, #8a6e44), var(--gold-l, #d4b98a)); transform: scaleX(0); transform-origin: left; z-index: 1001; pointer-events: none; }

@media (prefers-reduced-motion: reduce) {
  body, .ec-ln > span { animation: none !important; }
  .page-progress { display: none; }
  #navbar.ec-hide { transform: none; }
}
@media print {
  .motion .rv, .motion .rv-img { opacity: 1 !important; transform: none !important; clip-path: none !important; }
  .page-progress { display: none; }
}
