.email-showcase {
    --email-showcase-frame-width: 750px;
    --email-showcase-frame-height: 1100px;
    --email-showcase-frame-height-mobile: 600px;
    --email-showcase-gap: clamp(28px, 4vw, 64px);
    --email-showcase-copy-width: 500px;
    --email-showcase-locale-font-size: 1.5rem;
    --email-showcase-mobile-preview-width: 390px;
    --email-showcase-version-icon-height: 1.2em;
    --email-showcase-version-desktop-scale: 0.82;
    --email-showcase-version-mobile-scale: 0.86;
    --email-showcase-switch-height: 50px;
    --email-showcase-text-to-first-switch-gap: 50px;
    --email-showcase-hint-scroll-distance: 260px;
    --email-showcase-hint-scroll-duration: 700ms;
    --email-showcase-hint-hover-delay: 300ms;
    --email-showcase-mobile-shell-padding: 12px;
    --email-showcase-mobile-shell-radius: 44px;
    --email-showcase-mobile-screen-radius: 32px;
}

.email-showcase-layout {
    display: grid;
    grid-template-columns: var(--email-showcase-frame-width) var(--email-showcase-copy-width);
    gap: var(--email-showcase-gap);
    align-items: center;
    width: fit-content;
    margin: 0 auto;
}

.email-showcase-preview {
    min-width: 0;
    position: relative;
    width: var(--email-showcase-frame-width);
    height: var(--email-showcase-frame-height);
    border-radius: 0;
    background: var(--bg-light);
    overflow: hidden;
    margin-left: auto;
    margin-right: auto;
    transition: width 260ms ease, height 260ms ease, border-radius 260ms ease, box-shadow 260ms ease;
}

.email-showcase-preview.is-frame-ready {
    background: #25262C;
}

.email-showcase-preview.is-mobile {
    width: min(100%, var(--email-showcase-mobile-preview-width));
}

.email-showcase-locale-switch {
    margin: var(--title-text-space) 0 0;
    height: var(--email-showcase-switch-height);
    box-sizing: border-box;
    width: fit-content;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px 30px;
    border-radius: 999px;
    background: var(--bg-dark);
}

.email-showcase-locale-label {
    color: var(--text-on-dark);
    font-size: var(--email-showcase-locale-font-size);
    line-height: 1;
    text-transform: uppercase;
    white-space: nowrap;
}

.email-showcase-locale-label::after {
    content: ':';
    margin-left: 2px;
}

.email-showcase-locale-option {
    border: 0;
    background: transparent;
    color: var(--text-grey);
    font: inherit;
    font-size: var(--email-showcase-locale-font-size);
    line-height: 1;
    text-transform: uppercase;
    opacity: 1;
    cursor: pointer;
    padding: 0;
    transition: color 160ms ease-out;
}

.email-showcase-locale-option.is-active {
    color: var(--text-on-dark);
    cursor: default;
}

.email-showcase-locale-option:hover {
    color: var(--text-on-dark);
    opacity: 1;
}

.email-showcase-locale-option.is-active:hover {
    color: var(--text-on-dark);
    opacity: 1;
}

.email-showcase-locale-option:focus-visible {
    outline: 2px solid var(--text-on-dark);
    outline-offset: 4px;
    border-radius: 4px;
}

.email-showcase-version-switch {
    margin-top: var(--title-text-space);
}

.email-showcase-version-option {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
    color: var(--text-grey);
    transition: color 160ms ease-out;
}

.email-showcase-version-option.is-active,
.email-showcase-version-option:hover {
    color: var(--text-on-dark);
}

.email-showcase-version-icon {
    width: auto;
    height: var(--email-showcase-version-icon-height);
    display: block;
    filter: brightness(0) saturate(100%) invert(68%) sepia(0%) saturate(0%) hue-rotate(164deg) brightness(95%) contrast(88%);
    transition: filter 220ms ease-out;
}

.email-showcase-version-option.is-active .email-showcase-version-icon,
.email-showcase-version-option:hover .email-showcase-version-icon {
    filter: brightness(0) saturate(100%) invert(100%) sepia(0%) saturate(0%) hue-rotate(0deg) brightness(110%) contrast(100%);
}

.email-showcase-version-option[data-preview-mode="mobile"] .email-showcase-version-icon {
    transform: scale(var(--email-showcase-version-mobile-scale));
    transform-origin: center;
}

.email-showcase-version-option[data-preview-mode="desktop"] .email-showcase-version-icon {
    transform: scale(var(--email-showcase-version-desktop-scale));
    transform-origin: center;
}

.email-showcase-frame {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    border: 0;
    border-radius: 0;
    background: #25262C;
    overflow: auto;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 180ms ease-out;
    z-index: 0;
}

body[data-project-slug="aubade-email"] .email-showcase-preview,
body[data-project-slug="aubade-email"] .email-showcase-preview.is-frame-ready,
body[data-project-slug="aubade-email"] .email-showcase-frame {
    background: #fff;
}

body[data-project-slug="aubade-email"] .email-showcase-layout {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: clamp(24px, 3vw, 42px);
    width: 100%;
}

body[data-project-slug="aubade-email"] .email-showcase-controls {
    margin-top: 0;
}

body[data-project-slug="aubade-email"] .email-showcase-controls-stack {
    display: flex;
    flex-direction: column;
    align-items: center;
}

body[data-project-slug="aubade-email"] .email-showcase-preview.is-mobile {
    flex: 0 0 auto;
    width: min(var(--email-showcase-mobile-preview-width), calc(100vw - 48px));
}

body[data-project-slug="dxo-email"] .email-showcase-layout {
    align-items: start;
}

body[data-project-slug="dxo-email"] .email-showcase-preview {
    align-self: start;
}

body[data-project-slug="dxo-email"] .email-showcase-copy {
    align-self: start;
    margin-top: 100px;
}

.email-showcase-frame.is-ready {
    visibility: visible;
}

.email-showcase-frame.is-active {
    opacity: 1;
    pointer-events: auto;
    z-index: 1;
}

.email-showcase-copy {
    margin: 0;
    max-width: var(--email-showcase-copy-width);
    padding-left: 0;
    padding-right: 0;
}

.email-showcase-hint {
    display: inline-block;
    width: fit-content;
    margin: var(--title-text-space) 0 0;
    color: var(--text-grey);
    font-size: var(--text-hint-size);
    font-weight: var(--canvas-showcase-hint-weight, 400);
    line-height: var(--body-leading);
}

@media (min-width: 769px) {
    .email-showcase-hint {
        cursor: pointer;
        transition: color 180ms ease-out;
    }

    .email-showcase-hint:hover {
        color: var(--text-on-light);
    }

    .email-showcase-preview.is-mobile {
        padding: var(--email-showcase-mobile-shell-padding);
        border-radius: var(--email-showcase-mobile-shell-radius);
        background: var(--bg-dark);
        box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--text-on-dark) 24%, transparent);
    }

    .email-showcase-preview.is-mobile .email-showcase-frame {
        inset: var(--email-showcase-mobile-shell-padding);
        width: calc(100% - (var(--email-showcase-mobile-shell-padding) * 2));
        height: calc(100% - (var(--email-showcase-mobile-shell-padding) * 2));
        border-radius: var(--email-showcase-mobile-screen-radius);
        overflow: hidden;
    }

    .email-showcase-preview.is-mobile::after {
        content: "";
        position: absolute;
        right: -2px;
        top: 28%;
        width: 3px;
        height: 72px;
        border-radius: 999px;
        background: color-mix(in srgb, var(--bg-dark) 82%, var(--text-on-dark));
        pointer-events: none;
    }

    body[data-project-slug="aubade-email"] .email-showcase-preview.is-mobile {
        background: #fff;
        box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--bg-dark) 12%, transparent);
    }

    body[data-project-slug="aubade-email"] .email-showcase-preview.is-mobile::after {
        background: color-mix(in srgb, var(--bg-dark) 20%, transparent);
    }
}

@media (max-width: 1024px) {
    .email-showcase-layout {
        grid-template-columns: 1fr;
        gap: 28px;
        width: 100%;
        margin: 0;
    }

    .email-showcase-preview {
        justify-self: center;
        width: min(100%, var(--email-showcase-frame-width));
    }

    .email-showcase-preview.is-mobile {
        width: min(100%, var(--email-showcase-mobile-preview-width));
    }

    .email-showcase-frame {
        width: 100%;
    }

    .email-showcase-copy {
        max-width: 100%;
    }
}

@media (max-width: 768px) {
    .email-showcase-copy {
        order: 1;
    }

    .email-showcase-preview {
        order: 2;
        height: var(--email-showcase-frame-height-mobile);
    }

    .email-showcase-version-switch {
        display: none;
    }

    /* iOS: ensure only the active iframe handles touch scrolling. */
    .email-showcase-frame:not(.is-active) {
        display: none;
    }

    .email-showcase-frame.is-active {
        display: block;
        touch-action: pan-y;
        -webkit-overflow-scrolling: touch;
    }
}

