.scroll-expand {

    display: block;
    padding: 0;
    overflow: visible;

    --media-start-w: clamp(200px, 30vw, 300px);
    --media-start-h: clamp(240px, 32vw, 340px);
    --media-end-w: 95vw;
    --media-end-h: 85vh;
    --radius-start: 24px;
    --radius-end: 8px;
    --overlay-start: 0.5;
    --overlay-end: 0.2;
    --title-shift: clamp(90px, 16vw, 260px);
    --title-lift: clamp(120px, 18vw, 240px);
}

.scroll-expand__track {
    position: relative;
    overflow: visible;
    height: 220vh;
}

.scroll-expand__sticky {
    position: sticky;
    top: 0;
    height: 100vh;
    overflow: hidden;
}

.scroll-expand__background {
    position: absolute;
    inset: 0;
    z-index: 0;
    background: radial-gradient(circle at 50% 32%, var(--verde-escuro) 0%, var(--escuro) 65%);
    opacity: calc(1 - var(--expand-progress, 0));
}

.scroll-expand__hint {
    position: absolute;
    bottom: clamp(20px, 5vh, 40px);
    left: 50%;
    z-index: 1;
    transform: translateX(-50%);
    display: inline-block;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.6);
    opacity: clamp(0, calc(1 - var(--expand-progress, 0) / 0.15), 1);
}

.scroll-expand .scroll-expand__title {
    position: absolute;
    inset: 0;
    z-index: 1;
    margin: 0;
    max-width: none;
}

.scroll-expand .scroll-expand__title-left,
.scroll-expand .scroll-expand__title-right {
    position: absolute;
    top: 50%;
    left: 50%;
    max-width: min(460px, 46vw);
    font-size: clamp(22px, 2.6vw, 32px);
    line-height: 1.2;
    text-align: center;
}

.scroll-expand .scroll-expand__title-left {
    transform: translate(
        calc(-50% - var(--title-shift, 0px) * var(--expand-progress, 0)),
        calc(-50% - var(--title-lift, 0px) * (1 - var(--expand-progress, 0)))
    );
}

.scroll-expand .scroll-expand__title-right {
    transform: translate(
        calc(-50% + var(--title-shift, 0px) * var(--expand-progress, 0)),
        calc(-50% + var(--title-lift, 0px) * (1 - var(--expand-progress, 0)))
    );
}

.scroll-expand .scroll-expand__title-left,
.scroll-expand .scroll-expand__title-right {

    opacity: clamp(0, calc((0.35 - var(--expand-progress, 0)) / 0.35), 1);
}

.scroll-expand__media {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 2;
    transform: translate(-50%, -50%);
    width: calc(var(--media-start-w) + (var(--media-end-w) - var(--media-start-w)) * var(--expand-progress, 0));
    height: calc(var(--media-start-h) + (var(--media-end-h) - var(--media-start-h)) * var(--expand-progress, 0));
    max-width: 95vw;
    max-height: 85vh;
}

.scroll-expand__media-inner {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    border-radius: calc(var(--radius-start) - (var(--radius-start) - var(--radius-end)) * var(--expand-progress, 0));
    box-shadow: 0 30px 60px rgba(0, 0, 0, calc(0.35 - 0.35 * var(--expand-progress, 0)));
}

.scroll-expand__media-el {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.scroll-expand__media-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, calc(var(--overlay-start, 0.5) - (var(--overlay-start, 0.5) - var(--overlay-end, 0.2)) * var(--expand-progress, 0)));
}

.scroll-expand .scroll-expand__content {
    padding: 110px 5%;
}

.scroll-expand .scroll-expand__content p {
    max-width: 620px;
    margin: 0 auto;
}

.scroll-expand .scroll-expand__content .scroll-expand__destaque {
    max-width: 720px;
    font-family: 'Outfit', sans-serif;
    font-size: clamp(22px, 3vw, 30px);
    line-height: 1.35;
    font-weight: 600;
    color: #ffffff;
    text-align: center;
}

.scroll-expand .scroll-expand__content .scroll-expand__destaque strong {
    color: var(--verde);
    font-weight: 700;
}

@media (max-width: 768px) {
    .scroll-expand {
        --media-start-w: 170px;
        --media-start-h: 220px;
        --media-end-w: 92vw;
        --media-end-h: 62vh;
        --title-shift: 46px;
        --title-lift: 16vh;
    }

    .scroll-expand .scroll-expand__title-left,
    .scroll-expand .scroll-expand__title-right {
        top: 50%;
        max-width: 60vw;
        font-size: clamp(17px, 4.6vw, 22px);
        line-height: 1.2;
    }

    .scroll-expand__hint {
        font-size: 10px;
    }
}

@media (max-width: 430px) {
    .scroll-expand {
        --media-start-h: 190px;
        --title-shift: 30px;
        --title-lift: 14vh;
    }

    .scroll-expand .scroll-expand__title-left,
    .scroll-expand .scroll-expand__title-right {
        top: 50%;
        max-width: 66vw;
        font-size: clamp(16px, 4.6vw, 20px);
    }
}

@media (prefers-reduced-motion: reduce) {
    .scroll-expand--static {
        height: auto;
    }

    .scroll-expand--static .scroll-expand__track {
        height: auto;
    }

    .scroll-expand--static .scroll-expand__sticky {
        position: static;
        height: auto;
        overflow: visible;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 20px;
        padding: 140px 5%;
    }

    .scroll-expand--static .scroll-expand__background {
        position: absolute;
        opacity: 1;
    }

    .scroll-expand--static .scroll-expand__title {
        position: static;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 8px;
    }

    .scroll-expand--static .scroll-expand__title-left,
    .scroll-expand--static .scroll-expand__title-right {
        position: static;
        transform: none;
        opacity: 1;
        max-width: 620px;
    }

    .scroll-expand--static .scroll-expand__media {
        position: relative;
        top: auto;
        left: auto;
        transform: none;
        width: min(90vw, 640px);
        height: min(60vh, 420px);
    }

    .scroll-expand--static .scroll-expand__media-inner {
        border-radius: var(--radius-end, 8px);
        box-shadow: none;
    }

    .scroll-expand--static .scroll-expand__media-overlay {
        background: rgba(0, 0, 0, 0.25);
    }

    .scroll-expand--static .scroll-expand__hint {
        display: none;
    }

    .scroll-expand--static .scroll-expand__content {
        padding: 40px 5% 0;
    }
}
