.video-shape-wrapper {
    width: 395px;
    height: 226px;
}

.video-thumbnail-svg {
    display: block;
    width: 100%;
    height: 100%;
    overflow: visible;
    pointer-events: none;
}

.video-thumbnail-svg #mask path[fill="#6D1212"] {
    fill: url(#videoThumbnailPattern);
}

.video-thumbnail-svg #mask path[fill="black"] {
    fill: #6D1212;
}

.video-thumbnail-svg #mask>g {
    transform-box: fill-box;
    transform-origin: center;
}

.video-play-overlay {
    pointer-events: none;
}

.video-iframe-mask {
    width: 100%;
    height: 100%;
    overflow: hidden;

    -webkit-mask:
        url("<?= theme_asset($theme, 'img/video/mask.svg') ?>") center / contain no-repeat;

    mask:
        url("<?= theme_asset($theme, 'img/video/mask.svg') ?>") center / contain no-repeat;
}

.video-shape-wrapper:not(.is-visible) .video-thumbnail-svg #mask>g,
.video-shape-wrapper:not(.is-visible) .video-play-overlay .centerPlay {
    opacity: 0;
}

.video-shape-wrapper.is-visible .video-thumbnail-svg #left,
.video-shape-wrapper.is-visible .video-thumbnail-svg #left-top,
.video-shape-wrapper.is-visible .video-thumbnail-svg #left-bottom {
    animation: video-shape-from-left 2s 0.4s ease-out both;
}

.video-shape-wrapper.is-visible .video-thumbnail-svg #center-left-top,
.video-shape-wrapper.is-visible .video-thumbnail-svg #center-left-bottom {
    animation: video-shape-from-left 1.4s 0.3s ease-out both;
}

.video-shape-wrapper.is-visible .video-thumbnail-svg #right,
.video-shape-wrapper.is-visible .video-thumbnail-svg #right-top,
.video-shape-wrapper.is-visible .video-thumbnail-svg #right-bottom {
    animation: video-shape-from-right 2s 0.4s ease-out both;
}

.video-shape-wrapper.is-visible .video-thumbnail-svg #center-right-top,
.video-shape-wrapper.is-visible .video-thumbnail-svg #center-right-bottom {
    animation: video-shape-from-right 1.4s 0.3s ease-out both;
}

.video-shape-wrapper.is-visible .video-thumbnail-svg #center-top {
    animation: video-shape-from-top 1.4s 0.4s ease-out both;
}

.video-shape-wrapper.is-visible .video-thumbnail-svg #center-bottom {
    animation: video-shape-from-bottom 1.4s 0.4s ease-out both;
}

.video-shape-wrapper.is-visible .video-thumbnail-svg #center,
.video-shape-wrapper.is-visible .video-play-overlay .centerPlay {
    animation: video-shape-center 1.5s 0.4s ease-out both;
}

.video-shape-wrapper.is-playing {
    width: 395px;
    height: auto;
    aspect-ratio: 16 / 9;
    cursor: default;
}


@keyframes video-shape-from-left {
    from {
        opacity: 0;
        transform: translateX(-70px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes video-shape-from-right {
    from {
        opacity: 0;
        transform: translateX(70px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes video-shape-from-top {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes video-shape-from-bottom {
    from {
        opacity: 0;
        transform: translateY(50px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes video-shape-center {
    from {
        opacity: 0;
        transform: scale(0.75);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@media (prefers-reduced-motion: reduce) {
    #video .video-thumbnail-svg #mask>g {
        opacity: 1 !important;
        animation: none !important;
        transform: none !important;
    }
}