/* =========================================================
   Platform Switcher Section
   ========================================================= */

.platform-section {
    background-color: var(--color-ink-50);
}

.platform-section .platform-section-wrapper {
    gap: 14px;
    padding-block: var(--section-padding);
}

.platform-section .platform-section-wrapper .platform-section-subline {
    max-width: 996px;
    text-align: center;
}



.platform-section-mobile-tab-name {
    display: none;
}

.platform-section .platform-section-wrapper .platform-section-subline p:not(:last-child) {
    margin-bottom: 8px;
}

.platform-section .platform-section-wrapper .platform-section-card {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
}

/* ---------- Tabs ---------- */

.platform-section .platform-section-card .platform-section-tabs {
    gap: var(--space-xs);
    background-color: var(--color-white);
    border-bottom: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
}

.platform-section .platform-section-card .platform-section-tabs .platform-section-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1 1 0;
    min-width: 0;
    gap: 12px;
    padding-top: 12px;
    /* matches the 20px card gap below the tab bar */
    background-color: var(--color-white);
    text-align: center;
    cursor: pointer;
    overflow: hidden;
}

.platform-section .platform-section-card .platform-section-tabs .platform-section-tab:first-child {
    border-radius: var(--radius-lg) 0 0 var(--radius-lg);
}

.platform-section .platform-section-card .platform-section-tabs .platform-section-tab:last-child {
    border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
}

.platform-section .platform-section-card .platform-section-tabs .platform-section-tab .platform-section-tab-tile {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 46px;
    height: 46px;
    border-radius: var(--radius-sm);
    background-color: var(--color-ink-25);
    transition: background-color 0.3s ease;
}

.platform-section .platform-section-card .platform-section-tabs .platform-section-tab .platform-section-tab-tile img {
    width: 23px;
    height: 23px;
    filter: brightness(0) saturate(100%) invert(28%) sepia(76%) saturate(2288%) hue-rotate(172deg) brightness(79%) contrast(90%);
}

.platform-section .platform-section-card .platform-section-tabs .platform-section-tab .platform-section-tab-name {
    font-family: var(--font-display);
    font-size: var(--font-size-h6);
    font-weight: var(--font-weight-semibold);
    line-height: var(--line-height-h6);
    color: var(--color-slate-500);
    transition: color 0.3s ease;
}

.platform-section .platform-section-card .platform-section-tabs .platform-section-tab.is-active .platform-section-tab-tile,
.platform-section .platform-section-card .platform-section-tabs .platform-section-tab:hover .platform-section-tab-tile {
    background-color: var(--color-signal-500);
}

.platform-section .platform-section-card .platform-section-tabs .platform-section-tab.is-active .platform-section-tab-tile img,
.platform-section .platform-section-card .platform-section-tabs .platform-section-tab:hover .platform-section-tab-tile img {
    filter: brightness(0) saturate(100%) invert(99%) sepia(70%) saturate(50%) hue-rotate(18deg) brightness(121%) contrast(100%);
}

.platform-section .platform-section-card .platform-section-tabs .platform-section-tab.is-active .platform-section-tab-name,
.platform-section .platform-section-card .platform-section-tabs .platform-section-tab:hover .platform-section-tab-name {
    color: var(--color-teal-700);
}

/* the 3px underline Figma draws under the active tab */
.platform-section .platform-section-card .platform-section-tabs .platform-section-tab::after {
    content: "";
    width: 100%;
    height: 3px;
    border-radius: 2px;
    background-color: transparent;
    transform: scaleX(0);
    transform-origin: left center;
}

.platform-section .platform-section-card .platform-section-tabs .platform-section-tab.is-active::after {
    background-color: var(--color-signal-500);
}

/* fills left to right across the 5s the tab stays active */
.platform-section .platform-section-card .platform-section-tabs .platform-section-tab.is-filling::after {
    animation: platform-tab-fill var(--tab-duration, 5s) linear forwards;
}

@keyframes platform-tab-fill {

    from {
        transform: scaleX(0);
    }

    to {
        transform: scaleX(1);
    }

}

/* ---------- Panels ---------- */

@media (min-width: 992px) {
    .platform-section .platform-section-card .platform-section-panels-wrapper {
        overflow: visible !important;
    }
}

.platform-section .platform-section-card .platform-section-panels {
    display: grid;
    width: 100%;
}

.platform-section .platform-section-card .platform-section-panels .platform-section-panel {
    grid-area: 1 / 1;
    align-items: flex-start;
    gap: 50px;
    padding: 30px;
    background-color: var(--color-white);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.45s ease, visibility 0s linear 0.45s;
    border-radius: var(--radius-lg);
}

.platform-section .platform-section-card .platform-section-panels .platform-section-panel.is-active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition: opacity 0.45s ease, visibility 0s linear 0s;
}

.platform-section .platform-section-card .platform-section-panels .platform-section-panel .platform-section-panel-content {
    flex-shrink: 0;
    width: 380px;
    gap: 12px;
}

.platform-section .platform-section-card .platform-section-panels .platform-section-panel .platform-section-panel-content .text-emphasis p {
    font-family: var(--font-body);
    font-size: var(--font-size-body-sm);
    line-height: var(--line-height-meta);
    color: var(--color-ink-900);
}


.platform-section .platform-section-card .platform-section-panels .platform-section-panel .platform-section-panel-image {
    flex: 1 1 0;
    min-width: 0;
    /* height: 410px; */
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-dropdown);
}

.platform-section .platform-section-card .platform-section-panels .platform-section-panel .platform-section-panel-image img {
    height: 100%;
    /* object-fit: cover; */
}

/* live animation panels bring their own card, shadow and glow */
.platform-section .platform-section-card .platform-section-panels .platform-section-panel .platform-section-panel-live {
    height: auto;
    overflow: visible;
    border-radius: 0;
    box-shadow: none;
}

/* ---------- Reduced motion: no sweep, no cross-fade ---------- */
@media (prefers-reduced-motion: reduce) {

    .platform-section .platform-section-card .platform-section-tabs .platform-section-tab.is-filling::after {
        animation: none;
        transform: scaleX(1);
    }

    .platform-section .platform-section-card .platform-section-panels .platform-section-panel {
        transition: none;
    }

}

/* ---------- Large Desktop / Laptop ---------- */
@media (max-width: 1199px) {

    .platform-section .platform-section-card .platform-section-panels .platform-section-panel {
        gap: var(--space-xl);
    }

    .platform-section .platform-section-card .platform-section-panels .platform-section-panel .platform-section-panel-content {
        width: 340px;
    }

    .platform-section .platform-section-card .platform-section-panels .platform-section-panel .platform-section-panel-image {
        /* height: 360px; */
    }

}

/* ---------- Tablet ---------- */
@media (max-width: 991px) {

    .platform-section .platform-section-card .platform-section-tabs {
        gap: 4px;
    }

    .platform-section .platform-section-card .platform-section-tabs .platform-section-tab {
        gap: var(--space-xs);
    }

    .platform-section .platform-section-card .platform-section-panels .platform-section-panel {
        flex-direction: column;
        gap: var(--space-md);
    }

    .platform-section .platform-section-card .platform-section-panels .platform-section-panel .platform-section-panel-content {
        width: 100%;
    }

    /* reset the row flex: stacked, flex-basis 0 would collapse the height to nothing */
    .platform-section .platform-section-card .platform-section-panels .platform-section-panel .platform-section-panel-image {
        flex: 0 0 auto;
        width: 100%;
        height: auto;
        aspect-ratio: 774 / 410;
    }

    .platform-section .platform-section-card .platform-section-panels .platform-section-panel .platform-section-panel-image img {
        height: 100%;
    }

    /* The live widgets are authored for a wide canvas, so stacking them would
       leave them 378px tall while the four artwork panels are only 143px --
       and since every panel shares one grid cell, the tallest one sets the
       height for all of them. Lay the widget out at the desktop width and
       scale the whole thing down instead, so all six panels keep the same
       774:410 media box. */
    @supports (transform: scale(calc(100cqw / 100px))) {

        .platform-section .platform-section-card .platform-section-panels .platform-section-panel .platform-section-panel-live {
            position: relative;
            container-type: inline-size;
        }

        .platform-section .platform-section-card .platform-section-panels .platform-section-panel .platform-section-panel-live .dbm-anim {
            position: absolute;
            top: 0;
            left: 0;
            width: 714px;
            transform: scale(calc(100cqw / 714px));
            transform-origin: top left;
        }

    }


    .platform-section .platform-section-wrapper {
        align-items: flex-start;
    }

    .platform-section .platform-section-wrapper .platform-section-subline {
        text-align: left;
    }

    .platform-section .platform-section-card .platform-section-tabs {
        display: none !important;
    }

    .platform-section .platform-section-card .platform-section-panels-wrapper {
        width: 100%;
        overflow: hidden;
    }

    .platform-section .platform-section-card .platform-section-panels {
        display: flex !important;
    }

    .platform-section .platform-section-card .platform-section-panels .platform-section-panel {
        border-radius: var(--radius-lg);
        opacity: 1 !important;
        visibility: visible !important;
        pointer-events: auto !important;
        flex-direction: column;
        background-color: var(--color-white);
        padding: 18px 16px 35px;
    }

    .platform-section .platform-section-card .platform-section-panels .platform-section-panel .platform-section-panel-image {
        display: none !important;
    }

    .platform-section-mobile-tab-name {
        display: block !important;
        font-family: var(--font-mono);
        font-size: 10px;
        font-weight: 500;
        text-transform: uppercase;
        color: var(--color-teal-700);
        margin-bottom: 10px;
    }

    .platform-section .swiper-pagination {
        position: relative;
        margin-top: 14px;
        text-align: center;
    }



    .platform-section .platform-section-card .platform-section-tabs .platform-section-tab {
        flex: 0 0 84px;
    }

    .platform-section .platform-section-card .platform-section-tabs .platform-section-tab .platform-section-tab-tile {
        width: 40px;
        height: 40px;
    }

}