.motion-showcase {
    /* The frame grows from its center; reserve that growth to keep the visible inset canonical. */
    --motion-showcase-scale-overscan: min(3.5vw, 52px);
    position: relative;
    z-index: 2;
    display: grid;
    width: 100%;
    padding-block: calc(
        var(--section-space-block)
        + var(--motion-showcase-scale-overscan)
    );
    padding-inline: clamp(20px, 5vw, 84px);
    align-items: center;
}

.motion-showcase__frame {
    position: relative;
    width: min(100%, 1320px);
    aspect-ratio: 16 / 9;
    margin-inline: auto;
    overflow: clip;
    border-radius: var(--surface-radius-large);
    background: #dfdfdf;
    transform-origin: center;
}

.motion-showcase__poster,
.motion-showcase__poster img,
.motion-showcase__video,
.motion-showcase__wash,
.motion-showcase__content {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.motion-showcase__poster {
    z-index: 0;
    opacity: 0;
}

.motion-showcase__poster img,
.motion-showcase__video,
.motion-showcase__wash img {
    object-fit: cover;
}

.motion-showcase__wash img {
    width: 100%;
    height: 100%;
}

.motion-showcase__video {
    z-index: 1;
    display: block;
    opacity: 0;
    transform-origin: center;
}

.motion-showcase__wash {
    z-index: 2;
    display: block;
    background: #dfdfdf;
}

.motion-showcase__content {
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: clamp(2rem, 5vw, 5rem);
    text-align: center;
}

.motion-showcase__title {
    overflow: hidden;
    max-width: 100%;
    padding-block-end: 0.14em;
    margin-block-end: -0.14em;
}

.motion-showcase__title-line {
    display: block;
    will-change: transform;
}

.motion-showcase__description {
    max-width: var(--section-copy-wide-max);
    margin-block-start: 1.625rem;
}

.motion-showcase__action {
    margin-block-start: var(--space-lg);
}

.motion-showcase__replay-control {
    position: absolute;
    z-index: 4;
    bottom: var(--space-lg);
    left: var(--space-lg);
    transform-origin: center;
}

.motion-showcase__replay-control[hidden] {
    display: none;
}

.motion-showcase__replay {
    display: grid;
    width: var(--primary-action-height);
    height: var(--primary-action-height);
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: var(--color-card);
    box-shadow: var(--surface-shadow);
    cursor: pointer;
    place-items: center;
}

.motion-showcase__replay-icon {
    width: var(--primary-action-icon-size);
    height: var(--primary-action-icon-size);
}

.motion-showcase__replay-tooltip {
    position: absolute;
    bottom: calc(100% + var(--space-xs));
    left: 0;
    padding: 0.5rem var(--space-xs);
    border-radius: var(--primary-action-radius);
    background: var(--color-heading);
    color: var(--color-stage-text);
    opacity: 0;
    pointer-events: none;
    transform: translate3d(0, 0.25rem, 0);
    transition:
        opacity var(--action-swoosh-color-duration) ease-out,
        transform var(--action-swoosh-color-duration) ease-out;
    white-space: nowrap;
}

.motion-showcase__replay:focus-visible {
    outline: 0.125rem solid var(--color-heading);
    outline-offset: 0.1875rem;
}

.motion-showcase__replay:is(:hover, :focus-visible) + .motion-showcase__replay-tooltip {
    opacity: 1;
    transform: translate3d(0, 0, 0);
}

.motion-showcase.is-enhanced .motion-showcase__poster {
    opacity: 1;
}

.motion-showcase.is-enhanced .motion-showcase__video {
    opacity: 1;
}

.motion-showcase.is-enhanced .motion-showcase__wash {
    opacity: 0;
}

.motion-showcase.is-enhanced .motion-showcase__title-line {
    transform: translate3d(0, 110%, 0);
}

.motion-showcase.is-enhanced .motion-showcase__description,
.motion-showcase.is-enhanced .motion-showcase__action {
    opacity: 0;
    transform: translate3d(0, 2.5rem, 0);
}

.motion-showcase.is-enhanced .motion-showcase__content {
    pointer-events: none;
}

.motion-showcase.is-enhanced .motion-showcase__replay-control {
    opacity: 0;
    pointer-events: none;
    transform: scale(0.84);
}

.motion-showcase.is-playing .motion-showcase__poster {
    opacity: 0;
    transition: opacity 0.25s ease-out;
}

.motion-showcase.is-complete .motion-showcase__content {
    pointer-events: auto;
}

.motion-showcase.is-complete .motion-showcase__replay-control {
    pointer-events: auto;
}

.motion-showcase.is-revealed .motion-showcase__title-line {
    transform: translate3d(0, 0, 0);
    will-change: auto;
}

@media (max-width: 47.9375rem) {
    .motion-showcase {
        --motion-showcase-scale-overscan: 7vw;
    }

    .motion-showcase__frame {
        aspect-ratio: 1;
    }

    .motion-showcase__content {
        padding: clamp(1rem, 5vw, 1.5rem);
    }

    .motion-showcase__title {
        font-size: var(--text-section-title);
    }

    .motion-showcase__description {
        max-width: 100%;
        margin-block-start: var(--space-xs);
        font-size: var(--text-card-copy);
        line-height: var(--card-copy-line-height);
    }

    .motion-showcase__action {
        margin-block-start: var(--space-sm);
    }

    .motion-showcase__replay-control {
        bottom: var(--space-sm);
        left: var(--space-sm);
    }
}

@media (prefers-reduced-motion: reduce) {
    .motion-showcase__title-line {
        will-change: auto;
    }

    .motion-showcase__replay-tooltip {
        transition: none;
    }
}
