/* ==========================================================
   Eyres - motion layer (Rubicon, 30-09-2026)
   Restrained entrance animations, played once per screen.
   Classes:
   .m-ok       - motion allowed (no prefers-reduced-motion), any width
   .motion-on  - desktop fullpage mode (min-width: 1261px)
   .m-ready    - motion.js initialised (failsafe in <head> removes .motion-on otherwise)
   ========================================================== */

:root {
    --m-ease: cubic-bezier(.16, 1, .3, 1);
    --m-dur: .9s;
    --m-dist: 24px;
}

/* ---------- Page open: slider fades in once JS is ready ---------- */
.motion-on .home__slider {
    opacity: 0;
    transition: opacity .7s ease-out;
}
.motion-on.m-ready .home__slider {
    opacity: 1;
}

/* ---------- Entrance states (desktop) ---------- */
.motion-on .m-up    { opacity: 0; translate: 0 var(--m-dist); }
.motion-on .m-from-r { opacity: 0; translate: 32px 0; }
.motion-on .m-from-l { opacity: 0; translate: -20px 0; }
.motion-on .m-fade  { opacity: 0; }
.motion-on .m-zoom  { opacity: 0; }
.motion-on .m-zoom .home__solutions-img:not(.measurement) { scale: 1.06; }
.motion-on .m-rise  { opacity: 0; translate: 0 40px; }

/* Transitions live only on the "in" state: hiding is instant (no fade-out flash on load),
   revealing is animated. */
.motion-on .m-in {
    opacity: 1;
    translate: 0 0;
    transition:
        opacity var(--m-dur) var(--m-ease) var(--d, 0ms),
        translate var(--m-dur) var(--m-ease) var(--d, 0ms);
}
.motion-on .m-zoom.m-in .home__solutions-img:not(.measurement) {
    scale: 1;
    transition: scale 1.6s var(--m-ease) var(--d, 0ms);
}

/* ---------- Line reveal ("curtain") for titles ---------- */
.m-line {
    display: block;
    overflow: hidden;
    /* room for ascenders/descenders of IvyPresto */
    padding: .08em 0 .14em;
    margin: -.08em 0 -.14em;
}
.m-line > span {
    display: inline-block;
}
.motion-on .m-line > span.m-ln {
    translate: 0 110%;
}
.motion-on .m-line > span.m-ln.m-in {
    translate: 0 0;
    transition: translate 1s var(--m-ease) var(--d, 0ms);
}

/* ---------- Section snapping easing (desktop) ----------
   Speed (1s) is set in motion.js; this gives the move a soft start and a soft landing. */
.m-snap .home__slider > .swiper-wrapper > .swiper-slide,
.m-snap .home__slider > .swiper-wrapper > .swiper-slide > .swiper-slide-shadow-creative {
    transition-timing-function: cubic-bezier(.65, 0, .35, 1);
}

/* ---------- Dimming layer for sections behind the active one ---------- */
.m-dim {
    position: absolute;
    inset: 0;
    background: #000;
    opacity: 0;
    pointer-events: none;
    z-index: 100;
}

/* ---------- Hero: slow "camera push" on the active photo (all widths) ---------- */
.m-ok .home__hero-img {
    transform-origin: 60% 40%;
}
.m-ok .home__hero-slide.m-kb .home__hero-img {
    animation: mKenBurns 6s cubic-bezier(.25, .5, .35, 1) forwards;
}
@keyframes mKenBurns {
    from { scale: 1; }
    to   { scale: 1.06; }
}

/* ---------- Map: soft pulse on the four locations (all widths) ---------- */
.m-ok .home__request-map-wrapper {
    position: relative;
}
.m-map-pins {
    position: absolute;
    pointer-events: none;
}
.m-pin {
    position: absolute;
    width: var(--s, 9px);
    height: var(--s, 9px);
    margin: calc(var(--s, 9px) / -2) 0 0 calc(var(--s, 9px) / -2);
}
.m-pin::before,
.m-pin::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 1px solid #E41E2E;
    opacity: 0;
    animation: mPulse 3.2s cubic-bezier(.2, .6, .35, 1) infinite;
    animation-delay: var(--pd, 0s);
}
.m-pin::after {
    animation-delay: calc(var(--pd, 0s) + 1.6s);
}
@keyframes mPulse {
    0%   { opacity: .75; scale: 1; }
    100% { opacity: 0;   scale: 3.4; }
}

/* ---------- Tablets & mobiles: same character as desktop ---------- */
@media (max-width: 1260px) {
    .m-ok [data-anim] {
        transition-duration: var(--m-dur);
        transition-timing-function: var(--m-ease);
    }
    .m-ok [data-anim="toTop"]:not(.anim) {
        transform: translateY(var(--m-dist));
    }
    .m-ok [data-anim="toBottom"]:not(.anim) {
        transform: translateY(calc(var(--m-dist) * -1));
    }
}

/* ---------- Reduced motion: everything visible, nothing moves ---------- */
@media (prefers-reduced-motion: reduce) {
    [data-anim],
    [data-anim="curtain"] {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }
}

/* ---------- Fix: colour plates in section 2 ----------
   The logo images were stretched by the flex layout: Safari centred a small logo,
   Chrome blew it up over the arrow. Pinned to their designed size (height 40px)
   and aligned to the left edge of the plate. */
@media (min-width: 768px) {
    .home__about-tabs-ico {
        align-self: flex-start;
        width: auto;
        height: 40px;
    }
}
