/* Login (Eclipse): the art films own the right of the page, feathered into the ground; the form column sits left.
   Art cycle (login-art.js): the films loop, each crossfading over the one before; the first fades in. */
body {
    overflow-x: hidden;
}
.ec {
    /* the films' content lives in x 48-100% of the frame: size it so that half lands right of the form */
    --film: min(
        1920px,
        max(100vw, 177.78dvh),
        calc((100vw - var(--pad) - var(--form) - 48px) / 0.52)
    );
    position: relative;
    isolation: isolate;
    min-height: 100dvh;
}
.ec-art {
    position: fixed;
    z-index: -1;
    top: 50%;
    right: 0;
    width: var(--film);
    aspect-ratio: 16 / 9;
    translate: 0 -50%;
    pointer-events: none;
    -webkit-mask-image: linear-gradient(to right, transparent, var(--mask) 40%),
        linear-gradient(
            to bottom,
            transparent,
            var(--mask) 9%,
            var(--mask) 91%,
            transparent
        );
    mask-image: linear-gradient(to right, transparent, var(--mask) 40%),
        linear-gradient(
            to bottom,
            transparent,
            var(--mask) 9%,
            var(--mask) 91%,
            transparent
        );
    -webkit-mask-composite: source-in;
    mask-composite: intersect;
}
.ec-art video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    max-width: none;
    object-fit: cover;
    opacity: 0;
    /* a leaving film holds under the incoming one for the fade, then drops */
    transition: opacity 0s 1.2s;
}
.ec-art video[data-on] {
    z-index: 1;
    opacity: 1;
    transition: opacity 1.2s var(--ease);
}
.ec-col {
    width: calc(var(--pad) * 2 + var(--form));
    max-width: 100%;
}
.ec-stage {
    justify-self: start;
}

/* phone: the art turns into a full-screen layer behind the form under the ground veil (keeps --fg-mute text AA on
   the darkest frame); the kit shell centres the form */
@media (max-width: 760px) {
    .ec-art {
        inset: 0;
        width: auto;
        aspect-ratio: auto;
        translate: none;
        -webkit-mask-image: none;
        mask-image: none;
    }
    .ec-art::after {
        content: '';
        position: absolute;
        z-index: 2;
        inset: 0;
        background: var(--veil);
    }
    /* keep the films' content (x 48-100%) in view */
    .ec-art video {
        object-position: 80% 50%;
    }
    .ec-col {
        width: auto;
    }
    .ec-stage {
        justify-self: center;
    }
    /* the kit's --accent hover is under 4.5:1 on the veiled dark frame */
    :where(a:hover) {
        color: var(--fg);
    }
}
