/* ===================================================================
   EFFETS 3D - Artisan Couvreur
   Objets détourés (tuiles, zinguerie, outils) posés en couches de
   profondeur. Le mouvement est piloté par assets/js/effets-3d.js :
     - flottement permanent (CSS, sur l'image)
     - parallax au scroll + réaction à la souris (JS, sur .fx-obj)
   data-depth : 0.2 = très loin (lent, flou) ... 1.4 = premier plan.
   =================================================================== */

.fx-host{ position:relative; overflow:hidden; overflow:clip; }
.fx-host > .container{ position:relative; z-index:1; }

.fx-layer{
  position:absolute; inset:0; pointer-events:none; z-index:0;
  perspective:1200px; perspective-origin:50% 40%;
}
.fx-hero{ z-index:2; }
.home-hero-split .hero-content{ z-index:3; }

.fx-obj{
  position:absolute; left:var(--x); top:var(--y); width:var(--w);
  will-change:transform, opacity; transform-style:preserve-3d;
  opacity:0; transition:opacity .9s ease;
}
.fx-ready .fx-obj{ opacity:var(--o, 1); }
.fx-obj img{
  display:block; width:100%; height:auto; user-select:none; -webkit-user-drag:none;
  transform:rotate(var(--r0, 0deg));
  filter:drop-shadow(0 28px 32px rgba(6,13,22,.42)) drop-shadow(0 6px 8px rgba(6,13,22,.25));
  animation:fx-float var(--dur, 9s) ease-in-out infinite;
  animation-delay:var(--delay, 0s);
}
/* Profondeur de champ : les objets lointains sont plus flous et plus
   clairs, ceux du premier plan légèrement flous (effet objectif photo). */
.fx-far img{ filter:blur(2.4px) drop-shadow(0 16px 18px rgba(6,13,22,.3)); }
.fx-mid img{ filter:blur(.6px) drop-shadow(0 22px 26px rgba(6,13,22,.38)); }
.fx-near img{ filter:blur(3px) drop-shadow(0 40px 40px rgba(6,13,22,.35)); }
/* Dans le hero, les objets passent au-dessus du voile sombre : on baisse
   un peu leur luminosité pour qu'ils prennent la lumière de la photo. */
.fx-hero .fx-obj img{ filter:brightness(.9) saturate(.88) drop-shadow(0 30px 34px rgba(0,0,0,.5)) drop-shadow(0 6px 8px rgba(0,0,0,.3)); }
.fx-hero .fx-far img{ filter:brightness(.8) saturate(.8) blur(2.4px); }
.fx-hero .fx-mid img{ filter:brightness(.86) saturate(.85) blur(.6px) drop-shadow(0 22px 26px rgba(0,0,0,.45)); }
.fx-hero .fx-near img{ filter:brightness(.85) saturate(.85) blur(3px) drop-shadow(0 40px 40px rgba(0,0,0,.4)); }

@keyframes fx-float{
  0%,100%{ transform:translate3d(0,0,0) rotate(var(--r0, 0deg)); }
  50%    { transform:translate3d(0,-16px,0) rotate(calc(var(--r0, 0deg) + 4deg)); }
}

/* Décors des sections claires : visibles seulement quand il y a de
   la marge de chaque côté du contenu. */
.fx-side{ display:none; }
@media (min-width:1280px){ .fx-side{ display:block; } }

/* ---------- Cartes inclinables en 3D au survol ---------- */
.fx-tilt{ transform-style:preserve-3d; position:relative; }
.fx-tilt.fx-tilting{ transition:transform .14s ease-out, box-shadow .45s ease !important; }
.fx-glare{
  position:absolute; inset:0; border-radius:inherit; pointer-events:none; z-index:4;
  background:radial-gradient(420px circle at var(--gx,50%) var(--gy,50%), rgba(255,255,255,.30), rgba(255,255,255,0) 50%);
  opacity:0; transition:opacity .35s ease;
}
.fx-tilting .fx-glare{ opacity:1; }

/* ---------- Boutons magnétiques ---------- */
.fx-magnet{ transition:transform .35s cubic-bezier(.2,.9,.3,1.3); }
.fx-magnet.fx-pulling{ transition:transform .12s ease-out; }

/* ---------- Mobile / tablette : version allégée ---------- */
@media (max-width:980px){
  .fx-hero .fx-extra{ display:none; }
}
@media (max-width:600px){
  .fx-hero .fx-main{ --x:66% !important; --y:60% !important; --w:28vw !important; }
  .fx-hero .fx-mid{ display:none; }
}

/* ---------- Accessibilité : animations réduites ---------- */
@media (prefers-reduced-motion: reduce){
  .fx-obj img{ animation:none; }
  .fx-obj{ opacity:var(--o, 1); transition:none; }
}
