/**************************************************************************/
/**************************************************************************/

.scene {/*
    --tile-w: min(22vw, 324px);
    */
    --tile-w: 25vw;
    --tile-h: calc(var(--tile-w) * .82);
    --duration: 1150ms;
    --ease: cubic-bezier(.22, .75, .18, 1);
    --paper: #f2f0eb;
    --ink: #24272a;

    h3 {
        font-size: clamp(1.5rem, 2.2vw, 2rem);
        font-family: "Poppins", Arial, sans-serif;
        font-weight: 700;
        line-height: 1;
        margin-bottom: .5rem;
    }
}

.custom-plan-arrow {
    position: absolute;
    z-index: 500;
    right: 24px;
    bottom: 24px;
    height: max-content;

    &.ci-cyan {
        fill: #58cae7;
    }

    &.ci-blue {
        fill: #0072CE;
    }

    &.up {
        top:24px;
        rotate: 180deg;
    }
}

.custom-plan-arrow svg {
    /* Shrinks smoothly towards tablet/mobile while capping desktop size. */
    width: clamp(40px, 5.5vw, 80px);
    height: auto;
    display: block;
}

.intro, .outro {
    min-height: 72vh;
    display: grid;
    place-items: center;
    padding: 48px 24px;
    text-align: center;
}

.intro h1 {
    margin: 0;
    max-width: 900px;
    font-size: clamp(2.4rem, 6vw, 6rem);
    line-height: .95;
    letter-spacing: -.055em;
}

.scene {
    position: relative;
    background: #fff9f5;
}

.desktop-trigger {
    position: absolute;
    top: 34vh;
    left: 0;
    width: 1px;
    height: 1px;
    pointer-events: none;
}

.stage {
    /*
    min-height: 100vh;
     */
    display: grid;
    place-items: center;
    overflow: hidden;

}

.board {
    display: grid;
    grid-template-columns: repeat(4, var(--tile-w));
    width: max-content;
    height: calc(var(--tile-h) * 2);
}

.pair {
    position: relative;
    width: var(--tile-w);
    height: calc(var(--tile-h) * 2);
}



.tile {
    position: absolute;
    left: 0;
    top: 50%;
    width: 100%;
    height: var(--tile-h);
    transform: translate3d(0, -50%, 0);
    will-change: transform;
    transition: transform var(--duration) var(--ease);
}

.font-wrapper {
    place-self: center;
}

.text {
    z-index: 1;
    display: flex;
    flex-direction: row;
    padding: clamp(16px, 2vw, 30px);
    background: var(--bg);


    &.font-color-white {
        color: #fff;
    }
    &.font-color-darkblue {
        color: #243c4b;
    }
}

.text strong {
    font-size: clamp(.68rem, .8vw, .84rem);
    letter-spacing: .08em;
    text-transform: uppercase;
}

.text p {
    margin: 0;
    max-width: 75%;
    font-size: clamp(1rem, 1.1vw, 1.5rem);
    line-height: 1.42;
    font-family: Arial, sans-serif;
    font-weight: 400;
}

.image {
    z-index: 2;
    margin: 0;
    overflow: hidden;
    background: #bbb;
}

.image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Desktop: Scroll setzt nur .is-open. CSS führt die Bewegung selbstständig zu Ende. */
.scene.is-open .pair[data-image-direction="down"] .image {
    transform: translate3d(0, 0, 0);
}

.scene.is-open .pair[data-image-direction="down"] .text {
    transform: translate3d(0, -100%, 0);
}

.scene.is-open .pair[data-image-direction="up"] .image {
    transform: translate3d(0, -100%, 0);
}

.scene.is-open .pair[data-image-direction="up"] .text {
    transform: translate3d(0, 0, 0);
}

.status {
    position: absolute;
    left: 50%;
    top: 32px;
    transform: translateX(-50%);
    margin: 0;
    font-size: 11px;
    letter-spacing: .08em;
    text-transform: uppercase;
    opacity: .55;
    white-space: nowrap;
}

@media (min-width: 768px) and (max-width: 1024px) {
    .scene {
        --tile-w: min(calc((100vw - 64px) / 2), 420px);
    }

    .stage {
        padding: 72px 20px;
    }

    .board {
        grid-template-columns: repeat(2, var(--tile-w));
        gap: 18px;
        width: max-content;
        height: auto;
        margin: auto;
    }
}

@media (max-width: 767px) {
    .scene {
        --tile-w: min(calc(100vw - 32px), 420px);
        --tile-h: min(72vw, 340px);
        --duration: 900ms;
    }

    .stage {
        min-height: 0;
        display: block;
        padding: 80px 16px;
        overflow: visible;
    }

    .status {
        position: static;
        transform: none;
        margin: 0 auto 42px;
        text-align: center;
        white-space: normal;
    }

    .board {
        display: grid;
        grid-template-columns: var(--tile-w);
        gap: 16px;
        width: var(--tile-w);
        height: auto;
        margin: auto;
    }

    .pair {
        width: var(--tile-w);
        height: calc(var(--tile-h) * 2);
    }

    .text {
        padding: clamp(22px, 7vw, 34px);
    }

    .text strong {
        font-size: .76rem;
    }

    .text p {
        font-size: clamp(1rem, 4.3vw, 1.16rem);
    }

    .custom-plan-arrow svg {
        width: clamp(32px, 13vw, 56px);
    }

    /* Desktop-Sammelzustand neutralisieren; mobil öffnet jedes Paar einzeln. */
    .scene.is-open .pair .tile {
        transform: translate3d(0, -50%, 0);
    }

    .pair.is-open[data-image-direction="down"] .image {
        transform: translate3d(0, 0, 0);
    }

    .pair.is-open[data-image-direction="down"] .text {
        transform: translate3d(0, -100%, 0);
    }

    .pair.is-open[data-image-direction="up"] .image {
        transform: translate3d(0, -100%, 0);
    }

    .pair.is-open[data-image-direction="up"] .text {
        transform: translate3d(0, 0, 0);
    }
}
/**************************************************************************/
/**************************************************************************/