.af-home {
    --af-motion-duration: 700ms;
    --af-motion-stagger: 150ms;
    --af-motion-distance: 32px;
    --af-motion-easing: cubic-bezier(.22,.61,.36,1);
}

/* Last-line protection for legacy Elementor entrance states. Homepage content
   must never remain dimmed after an interrupted animation or cached restore. */
body.home #content .af-home,
body.home #content .af-home * { opacity:1!important; }

.af-home .af-hero-grid { overflow:hidden; }
.af-home .af-hero-photo { will-change:transform; }

/* Motion is additive. The resting state stays fully visible if JavaScript,
   scrolling or cached-page restoration does not complete. */
body.af-motion-ready .af-home [data-af-hero-reveal],
body.af-motion-ready .af-home [data-af-service-card],
body.af-motion-ready .af-home [data-af-price-card] { opacity:1!important; will-change:transform; }

html.af-home-motion-pending,
body.af-motion-ready { overflow-x:clip; }

/* The dynamic discount banner sits outside .af-home, so its values remain self-contained. */
.af-offer-banner {
    transition:opacity 800ms cubic-bezier(.16,1,.3,1),transform 800ms cubic-bezier(.16,1,.3,1);
    will-change:opacity,transform;
}

html.af-home-motion-pending .af-offer-banner {
    opacity:0;
    transform:translate3d(calc(-100% - 2rem),0,0);
}

@keyframes af-reveal-up { from { transform:translate3d(0,18px,0); } to { transform:translate3d(0,0,0); } }
@keyframes af-reveal-left { from { transform:translate3d(calc(var(--af-motion-distance) * -1),0,0); } to { transform:translate3d(0,0,0); } }
@keyframes af-reveal-right { from { transform:translate3d(var(--af-motion-distance),0,0); } to { transform:translate3d(0,0,0); } }
@keyframes af-reveal-below { from { transform:translate3d(0,var(--af-motion-distance),0); } to { transform:translate3d(0,0,0); } }
@keyframes af-price-reveal-left { from { transform:translate3d(-120vw,0,0); } to { transform:translate3d(0,0,0); } }
@keyframes af-price-reveal-right { from { transform:translate3d(120vw,0,0); } to { transform:translate3d(0,0,0); } }

body.af-motion-ready .af-offer-banner.af-motion-visible { opacity:1; transform:translate3d(0,0,0); }
body.af-motion-ready .af-home [data-af-hero-reveal].af-motion-visible { animation:af-reveal-up var(--af-motion-duration) var(--af-motion-easing) both; }
body.af-motion-ready .af-home [data-af-hero-reveal="button"].af-motion-visible { animation-delay:180ms; }
body.af-motion-ready .af-home [data-af-service-card="left"].af-motion-visible { animation:af-reveal-left var(--af-motion-duration) var(--af-motion-easing) both; }
body.af-motion-ready .af-home [data-af-service-card="below"].af-motion-visible { animation:af-reveal-below var(--af-motion-duration) var(--af-motion-easing) both; animation-delay:var(--af-motion-stagger); }
body.af-motion-ready .af-home [data-af-service-card="right"].af-motion-visible { animation:af-reveal-right var(--af-motion-duration) var(--af-motion-easing) both; animation-delay:calc(var(--af-motion-stagger) * 2); }
body.af-motion-ready .af-home [data-af-price-card="left"]:not(.af-motion-visible) { transform:translate3d(-120vw,0,0); }
body.af-motion-ready .af-home [data-af-price-card="right"]:not(.af-motion-visible) { transform:translate3d(120vw,0,0); }
body.af-motion-ready .af-home [data-af-price-card="left"].af-motion-visible { animation:af-price-reveal-left var(--af-motion-duration) var(--af-motion-easing) both; }
body.af-motion-ready .af-home [data-af-price-card="right"].af-motion-visible { animation:af-price-reveal-right var(--af-motion-duration) var(--af-motion-easing) both; animation-delay:var(--af-motion-stagger); }
.af-home .af-card,.af-home .af-price { transition:transform 250ms ease,box-shadow 250ms ease,border-color 250ms ease; }
.af-home .af-card:hover,.af-home .af-price:hover { transform:translate3d(0,-5px,0); box-shadow:0 14px 28px rgba(18,48,71,.16); border-color:#08777a; }
.af-home .af-card:focus-within,.af-home .af-price:focus-within { transform:translate3d(0,-3px,0); border-color:#08777a; }

@media (max-width:700px) {
    .af-home { --af-motion-distance:20px; }
    .af-home .af-hero-photo { transform:none!important; }
}

@media (prefers-reduced-motion:reduce) {
    .af-home .af-hero-photo,
    html.af-home-motion-pending .af-offer-banner,
    .af-offer-banner,
    body.af-motion-ready .af-home [data-af-hero-reveal],
    body.af-motion-ready .af-home [data-af-service-card],
    body.af-motion-ready .af-home [data-af-price-card],
    .af-home .af-card { transition:none!important; transform:none!important; opacity:1!important; }
}
