.mwe-cinematic-scroll {
    --mwe-cinematic-height: 520vh;
    --mwe-cinematic-mobile-height: 380vh;
    --mwe-cinematic-object-position: 50% 50%;
    --mwe-cinematic-admin-offset: var(--wp-admin--admin-bar--height, 0px);
    position: relative;
    height: var(--mwe-cinematic-height);
    background: #050505;
    color: #fff;
    isolation: isolate;
}

.mwe-cinematic-scroll__sticky {
    position: sticky;
    top: var(--mwe-cinematic-admin-offset);
    height: calc(100svh - var(--mwe-cinematic-admin-offset));
    min-height: 560px;
    overflow: hidden;
    background: #050505;
}

.mwe-cinematic-scroll__media,
.mwe-cinematic-scroll__video,
.mwe-cinematic-scroll__shade {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.mwe-cinematic-scroll__video {
    display: block;
    object-fit: cover;
    object-position: var(--mwe-cinematic-object-position);
    background: #050505;
    transform: translateZ(0) scale(1.001);
    backface-visibility: hidden;
    will-change: contents;
}

.mwe-cinematic-scroll__shade {
    pointer-events: none;
    background:
        linear-gradient(180deg, rgba(0, 0, 0, .18) 0%, transparent 28%, transparent 62%, rgba(0, 0, 0, .55) 100%),
        linear-gradient(90deg, rgba(0, 0, 0, .44) 0%, transparent 38%, transparent 100%);
}

.mwe-cinematic-scroll--caption-left .mwe-cinematic-scroll__shade {
    background:
        linear-gradient(180deg, rgba(0, 0, 0, .18) 0%, transparent 28%, transparent 62%, rgba(0, 0, 0, .55) 100%),
        linear-gradient(270deg, rgba(0, 0, 0, .44) 0%, transparent 38%, transparent 100%);
}

.mwe-cinematic-scroll--caption-center .mwe-cinematic-scroll__shade {
    background: linear-gradient(180deg, rgba(0, 0, 0, .18) 0%, transparent 34%, transparent 60%, rgba(0, 0, 0, .62) 100%);
}

.mwe-cinematic-scroll__captions {
    position: absolute;
    z-index: 3;
    inset-inline-end: clamp(24px, 7vw, 120px);
    bottom: clamp(62px, 10vh, 120px);
    width: min(520px, calc(100vw - 48px));
    min-height: 96px;
    pointer-events: none;
}

.mwe-cinematic-scroll--caption-left .mwe-cinematic-scroll__captions {
    inset-inline-end: auto;
    inset-inline-start: clamp(24px, 7vw, 120px);
}

.mwe-cinematic-scroll--caption-center .mwe-cinematic-scroll__captions {
    inset-inline: 50% auto;
    transform: translateX(50%);
    text-align: center;
}

[dir="ltr"] .mwe-cinematic-scroll--caption-center .mwe-cinematic-scroll__captions {
    transform: translateX(-50%);
}

.mwe-cinematic-scroll__caption {
    position: absolute;
    inset: auto 0 0;
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: start;
    gap: 14px;
    margin: 0;
    opacity: 0;
    transform: translateY(22px);
    transition: opacity .34s ease, transform .5s cubic-bezier(.22, 1, .36, 1);
}

.mwe-cinematic-scroll__caption.is-active {
    opacity: 1;
    transform: translateY(0);
}

.mwe-cinematic-scroll__caption-index {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 28px;
    margin-top: 4px;
    border: 1px solid rgba(255, 255, 255, .38);
    border-radius: 999px;
    font-size: 10px;
    line-height: 1;
    letter-spacing: .12em;
    color: rgba(255, 255, 255, .76);
}

.mwe-cinematic-scroll__caption-text {
    max-width: 18ch;
    font-size: clamp(28px, 4vw, 62px);
    font-weight: 500;
    line-height: 1.16;
    letter-spacing: -.035em;
    text-wrap: balance;
    text-shadow: 0 10px 36px rgba(0, 0, 0, .42);
}

.mwe-cinematic-scroll--caption-center .mwe-cinematic-scroll__caption {
    grid-template-columns: 1fr;
    justify-items: center;
}

.mwe-cinematic-scroll__progress {
    position: absolute;
    z-index: 4;
    inset-inline-end: clamp(18px, 2.4vw, 42px);
    top: 50%;
    width: 2px;
    height: min(180px, 26vh);
    overflow: hidden;
    border-radius: 999px;
    background: rgba(255, 255, 255, .22);
    transform: translateY(-50%);
}

.mwe-cinematic-scroll__progress-fill {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: inherit;
    background: #fff;
    transform: scaleY(0);
    transform-origin: top;
    will-change: transform;
}

.mwe-cinematic-scroll__loading {
    position: absolute;
    z-index: 5;
    inset: 0;
    display: grid;
    place-items: center;
    pointer-events: none;
    background: #050505;
    transition: opacity .5s ease, visibility .5s ease;
}

.mwe-cinematic-scroll__loading span {
    width: 44px;
    height: 44px;
    border: 1px solid rgba(255, 255, 255, .24);
    border-top-color: #fff;
    border-radius: 50%;
    animation: mwe-cinematic-spin .8s linear infinite;
}

.mwe-cinematic-scroll.is-ready .mwe-cinematic-scroll__loading,
.mwe-cinematic-scroll.is-error .mwe-cinematic-scroll__loading {
    opacity: 0;
    visibility: hidden;
}

.mwe-cinematic-scroll.is-error .mwe-cinematic-scroll__video {
    opacity: .35;
}

.mwe-cinematic-scroll__notice {
    padding: 16px;
    border: 1px dashed #c3c4c7;
    background: #fff;
    color: #1d2327;
    text-align: center;
}

@keyframes mwe-cinematic-spin {
    to { transform: rotate(360deg); }
}

@media (max-width: 767px) {
    .mwe-cinematic-scroll {
        height: var(--mwe-cinematic-mobile-height);
    }

    .mwe-cinematic-scroll__sticky {
        min-height: 520px;
    }

    .mwe-cinematic-scroll__captions,
    .mwe-cinematic-scroll--caption-left .mwe-cinematic-scroll__captions,
    .mwe-cinematic-scroll--caption-center .mwe-cinematic-scroll__captions {
        inset-inline: 22px;
        bottom: 58px;
        width: auto;
        transform: none;
        text-align: start;
    }

    .mwe-cinematic-scroll__caption-text {
        max-width: 15ch;
        font-size: clamp(26px, 9vw, 44px);
    }

    .mwe-cinematic-scroll__progress {
        inset-inline-end: 12px;
        height: 118px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .mwe-cinematic-scroll {
        height: 100svh !important;
    }

    .mwe-cinematic-scroll__sticky {
        position: relative;
        top: 0;
    }

    .mwe-cinematic-scroll__caption {
        transition: none;
    }

    .mwe-cinematic-scroll__progress {
        display: none;
    }
}
