/* AeroFolio — couche d'animations signature (style Apple + identité aérienne)
   Tout mouvement est désactivé si l'utilisateur préfère réduire les animations. */

@media (prefers-reduced-motion: no-preference) {

  html { scroll-behavior: smooth; }

  /* Révélation glissée (titres, textes, boutons) */
  .af-js .af-reveal {
    opacity: 0;
    transform: translateY(34px);
    transition: opacity 0.9s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.9s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: opacity, transform;
  }
  .af-js .af-reveal.af-left  { transform: translateX(-44px); }
  .af-js .af-reveal.af-right { transform: translateX(44px); }
  .af-js .af-reveal.af-in    { opacity: 1; transform: none; }

  /* Fondu simple (cartes qui s'inclinent : le mouvement est géré par l'inclinaison) */
  .af-js .af-fade    { opacity: 0; transition: opacity 1s ease; }
  .af-js .af-fade.af-in { opacity: 1; }

  /* Ouverture façon objectif (diaphragme qui s'ouvre) */
  .af-js .af-aperture {
    clip-path: circle(0% at 50% 55%);
    transition: clip-path 1.15s cubic-bezier(0.16, 1, 0.3, 1);
  }
  .af-js .af-aperture.af-in { clip-path: circle(150% at 50% 55%); }

  .af-hero .wp-block-cover__inner-container { will-change: transform, opacity; }
}

/* En-tête collant qui se givre au défilement */
.af-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: transparent;
  transition: background-color 0.45s ease, padding 0.45s ease,
              box-shadow 0.45s ease, backdrop-filter 0.45s ease;
}
.af-header.af-scrolled {
  background-color: rgba(13, 15, 18, 0.72);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  backdrop-filter: saturate(180%) blur(16px);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.07);
  padding-top: 0.7rem !important;
  padding-bottom: 0.7rem !important;
}

/* Inclinaison 3D des cartes */
.af-tilt-group { perspective: 1000px; }
.af-tilt-group > .wp-block-column {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  transform-style: preserve-3d;
  will-change: transform;
}
.af-glare {
  position: absolute;
  inset: 0;
  z-index: 3;
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
  background: radial-gradient(circle at var(--gx, 50%) var(--gy, 50%),
              rgba(255, 255, 255, 0.20), rgba(255, 255, 255, 0) 55%);
}

/* Coins arrondis conservés sur toutes les images à ouverture */
.wp-block-column:has(.wp-block-cover.af-aperture) {
  border-radius: 12px;
  overflow: hidden;
}

/* Grain cinéma + vignette (ambiance globale, très discrète) */
.af-grain-overlay {
  position: fixed;
  inset: 0;
  z-index: 9998;
  pointer-events: none;
  opacity: 0.05;
  mix-blend-mode: overlay;
  background-repeat: repeat;
  background-size: 140px 140px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 9997;
  pointer-events: none;
  box-shadow: inset 0 0 160px 40px rgba(0, 0, 0, 0.45);
}
@media (prefers-reduced-motion: no-preference) {
  .af-grain-overlay { animation: af-grain 0.6s steps(2) infinite; }
}
@keyframes af-grain {
  0%   { background-position: 0 0; }
  100% { background-position: 8% 5%; }
}
