/* Set per-hero overrides here or on the component root in Pinegrow. */
.hero.hero-motion,
.hero-motion {
    --hero-motion-duration: 20s;           /* Time for one leg of the loop. */
    --hero-motion-max-zoom: 1.15;          /* Unitless scale. Allowed range: 1.10–1.25. */
    --hero-motion-pan-x: 5%;               /* Maximum travel each side of center. */
    --hero-motion-pan-y: 2%;
    --hero-motion-easing: ease-in-out;
    --hero-motion-direction: alternate;   /* Use alternate-reverse to start at the other end. */
    --hero-motion-overlay-color: var(--hero-ink, #101d30);
    --hero-motion-overlay-opacity: .35;   /* Base tint beneath the directional scrim. */
    --hero-motion-focal-point: 50% 53%;
    --hero-motion-parallax: .65;           /* 0–1, applied to the secondary layer. */
    --hero-motion-height: auto;           /* Optional minimum height. Content can grow. */

    --hero-motion-x: clamp(0%, var(--hero-motion-pan-x), 5%);
    --hero-motion-y: clamp(0%, var(--hero-motion-pan-y), 5%);
    --hero-motion-zoom: clamp(1.1, var(--hero-motion-max-zoom), 1.25);
    --hero-motion-depth: clamp(0, var(--hero-motion-parallax), 1);
    position: relative;
    isolation: isolate;
    min-block-size: var(--hero-motion-height);
    background: var(--hero-motion-overlay-color);
}
.hero-motion .hero-motion-media,
.hero-motion .hero-motion-scene,
.hero-motion .hero-motion-image,
.hero-motion .hero-motion-foreground,
.hero-motion .hero-motion-light,
.hero-motion .hero-motion-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
}
.hero-motion .hero-motion-media {
    z-index: -1;
    overflow: hidden;
}
.hero-motion .hero-motion-image,
.hero-motion .hero-motion-foreground {
    display: block;
    width: 100%;
    height: 100%;
    max-width: none;
    object-fit: cover;
    object-position: var(--hero-motion-focal-point);
}
.hero-motion .hero-motion-foreground,
.hero-motion .hero-motion-light {
    display: none;
}
.hero-motion .hero-motion-light {
    background: radial-gradient(ellipse at 78% 29%, var(--hero-motion-glow, #e8efff), transparent 62%);
    opacity: .04;
}
.hero-motion .hero-motion-overlay {
    /* Use a separate tint so the scrim keeps its own contrast floor. */
    background: linear-gradient(95deg, rgb(6 12 22 / 75%), rgb(6 12 22 / 62%) 54%, rgb(6 12 22 / 42%));
}
.hero-motion .hero-motion-overlay::before {
    position: absolute;
    inset: 0;
    content: "";
    background: var(--hero-motion-overlay-color);
    opacity: var(--hero-motion-overlay-opacity);
}
.hero-motion .hero-motion-toggle {
    display: none;
    position: absolute;
    inset-block-start: clamp(.75rem, 2vw, 1.5rem);
    inset-inline-end: clamp(.75rem, 3vw, 2rem);
    z-index: 1;
    min-width: 44px;
    min-height: 44px;
    padding: .25rem .65rem;
    border: 1px solid rgb(255 255 255 / 40%);
    border-radius: .5rem;
    background: rgb(6 12 22 / 80%);
    color: #fff;
    font-size: .75rem;
}
.hero-motion .hero-motion-toggle:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 3px;
}
@media (max-width: 680px) {
    .hero.hero-motion,
    .hero-motion {
        --hero-motion-focal-point: 63% center;
    }

    .hero-motion .hero-motion-overlay {
        background: linear-gradient(90deg, rgb(6 12 22 / 72%), rgb(6 12 22 / 57%));
    }
}
/* A centered scale of 1.10 covers a translation of up to 5% in either direction.
   The camera keyframes keep translate before scale so travel is not magnified. */
@media (prefers-reduced-motion: no-preference) {
    .hero-motion[data-hero-motion-ready]:not([data-hero-motion~="static"]) {
        --hero-motion-camera: xl-hero-pan;
        --hero-motion-play: running;
    }

    .hero-motion[data-hero-motion-ready][data-hero-motion~="ken-burns"] {
        --hero-motion-camera: xl-hero-ken-burns;
    }

    .hero-motion[data-hero-motion-ready][data-hero-motion~="cinematic-drift"] {
        --hero-motion-camera: xl-hero-drift;
    }

    .hero-motion[data-hero-motion-ready][data-hero-motion~="depth-motion"] {
        --hero-motion-camera: xl-hero-depth;
    }

    .hero-motion[data-hero-motion-ready][data-hero-motion~="cinematic-reveal"] {
        --hero-motion-camera: xl-hero-reveal;
    }

    .hero-motion[data-hero-motion-ready]:not([data-hero-motion~="static"]) .hero-motion-image {
        animation-name: var(--hero-motion-camera);
    }

    .hero-motion[data-hero-motion-ready]:not([data-hero-motion~="static"])[data-hero-motion~="depth-motion"] .hero-motion-foreground {
        display: block;
        animation-name: xl-hero-parallax;
    }

    .hero-motion[data-hero-motion-ready]:not([data-hero-motion~="static"])[data-hero-motion~="focus-shift"] .hero-motion-scene {
        animation-name: xl-hero-focus;
    }

    .hero-motion[data-hero-motion-ready]:not([data-hero-motion~="static"])[data-hero-motion~="ambient-light"] .hero-motion-light {
        display: block;
        animation-name: xl-hero-light;
    }

    .hero-motion[data-hero-motion-ready]:not([data-hero-motion~="static"]) .hero-motion-toggle {
        display: block;
    }

    .hero-motion :is(.hero-motion-image, .hero-motion-foreground, .hero-motion-scene, .hero-motion-light) {
        animation-duration: var(--hero-motion-duration);
        animation-timing-function: var(--hero-motion-easing);
        animation-direction: var(--hero-motion-direction);
        animation-iteration-count: infinite;
        animation-play-state: var(--hero-motion-play, paused);
    }

    .hero-motion[data-hero-motion-ready]:is([data-hero-motion-paused], [data-hero-motion-offscreen]) {
        --hero-motion-play: paused;
    }
}
@media (max-width: 680px) {
    .hero-motion:not([data-hero-motion-mobile="on"]) :is(.hero-motion-image, .hero-motion-foreground, .hero-motion-scene, .hero-motion-light) {
        animation-name: none !important;
    }

    .hero-motion:not([data-hero-motion-mobile="on"]) :is(.hero-motion-toggle, .hero-motion-light, .hero-motion-foreground) {
        display: none !important;
    }
}
@keyframes xl-hero-pan {
    from { transform: translate3d(calc(-1 * var(--hero-motion-x)), 0, 0) scale(1.1); }
    to { transform: translate3d(var(--hero-motion-x), 0, 0) scale(var(--hero-motion-zoom)); }
}
@keyframes xl-hero-ken-burns {
    from { transform: translate3d(0, 0, 0) scale(1.1); }
    to { transform: translate3d(calc(var(--hero-motion-x) * -.65), var(--hero-motion-y), 0) scale(var(--hero-motion-zoom)); }
}
@keyframes xl-hero-drift {
    from { transform: translate3d(calc(-1 * var(--hero-motion-x)), var(--hero-motion-y), 0) scale(1.1); }
    to { transform: translate3d(var(--hero-motion-x), calc(-1 * var(--hero-motion-y)), 0) scale(var(--hero-motion-zoom)); }
}
@keyframes xl-hero-depth {
    from { transform: translate3d(calc(var(--hero-motion-x) * -.45), 0, 0) scale(1.1); }
    to { transform: translate3d(calc(var(--hero-motion-x) * .45), calc(-1 * var(--hero-motion-y)), 0) scale(var(--hero-motion-zoom)); }
}
@keyframes xl-hero-parallax {
    from { transform: translate3d(calc(var(--hero-motion-x) * var(--hero-motion-depth)), 0, 0) scale(1.1); }
    to { transform: translate3d(calc(var(--hero-motion-x) * var(--hero-motion-depth) * -1), var(--hero-motion-y), 0) scale(var(--hero-motion-zoom)); }
}
@keyframes xl-hero-reveal {
    0% { transform: translate3d(calc(-1 * var(--hero-motion-x)), 0, 0) scale(1.1); }
    45% { transform: translate3d(0, var(--hero-motion-y), 0) scale(var(--hero-motion-zoom)); }
    100% { transform: translate3d(var(--hero-motion-x), 0, 0) scale(1.1); }
}
@keyframes xl-hero-light {
    from { opacity: .025; }
    to { opacity: .14; }
}
@keyframes xl-hero-focus {
    from { filter: blur(0); }
    to { filter: blur(1.5px); }
}
.hero-motion[data-hero-motion-once] :is(.hero-motion-image, .hero-motion-foreground, .hero-motion-scene, .hero-motion-light) {
    animation-iteration-count: 1;
    animation-fill-mode: forwards;
}
