
@keyframes chip-float {
    0% {
    transform: translateY(0) rotate(0deg);
    }
    35% {
        transform: translateY(-9px) rotate(.5deg);
    }
    65% {
        transform: translateY(-16px) rotate(-1deg);
    }
    100% {
        transform: translateY(0) rotate(0);
    }
}

.hero_visual{
    opacity: 0;

    padding: 15% 5%;

    grid-area: visual;
    width: 100%;
    height: fit-content;

    display: flex;
    align-items: center;
    justify-content: center;
}

.hero_mascot{
    width: 100%;
    max-width: 200px;
    aspect-ratio: 3/4;
    z-index: -1;

    position: relative;

    background-image: url("/file/pages/landing/img/pereco_hero.png");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;

    & .hero_style:nth-child(1) {
        z-index: 101;
        animation: chip-float 7600ms ease-in-out 0ms infinite;

        /* Chip position relative to mascot */
        top: 0px;
        right: 80%;

        /* POPUP position relative to chip */
        & .hero_style_wrapper{
            top: 100%;
            left: 0px;
        }

        & .hero_style_popup{
            transform-origin: top left;
        }
    }

    & .hero_style:nth-child(2) {
        z-index: 101;
        animation: chip-float 4000ms ease-in-out 800ms infinite;

        /* Chip position relative to mascot */
        top: 5%;
        left: 90%;

        & .hero_style_wrapper{
            /* POPUP position relative to chip */
            top: 100%;
            left: -100%;
        }

        & .hero_style_popup{
            transform-origin: top right;
        }
    }

    & .hero_style:nth-child(3) {
        animation: chip-float 9000ms ease-in-out 200ms infinite;

        /* Chip position relative to mascot */
        top: 40%;
        right: 90%;

        & .hero_style_wrapper{
            /* POPUP position relative to chip */
            top: 50%;
            left: 100%;

            transform: translateY(-50%);
        }

        & .hero_style_popup{
            transform-origin: center left;
        }
    }

    & .hero_style:nth-child(4) {
        z-index: 99;
        animation: chip-float 4000ms ease-in-out 500ms infinite;

        /* Chip position relative to mascot */
        top: 70%;
        left: 85%;

        & .hero_style_wrapper{
            /* POPUP position relative to chip */
            top: 50%;
            right: 100%;

            transform: translateY(-50%);
        }

        & .hero_style_popup{
            transform-origin: center right;
        }
    }

    & .hero_style:nth-child(5) {
        z-index: 98;
        animation: chip-float 4000ms ease-in-out 500ms infinite;

        /* Chip position relative to mascot */
        top: 100%;
        left: 20%;

        & .hero_style_wrapper{
            /* POPUP position relative to chip */
            bottom: 100%;
            left: 50%;
            transform: translateX(-50%);
        }

        & .hero_style_popup{
            transform-origin: center bottom;
        }
    }
}

.hero_style{
    z-index: 100;
    position: absolute;
    width: max-content;
    cursor: pointer;
    border-radius: var(--default-border-radius);
    background-color: var(--cream);

    &:hover{
        animation-play-state: paused !important;

        & .hero_style_wrapper{
            pointer-events: auto;
        }

        & .hero_style_popup{
            opacity: 1;
            transform: scale(1);
            pointer-events: auto;
        }

        & .hero_style_chip{
            border: 1px solid var(--cherry);

            &::after{
                animation: pulse-border 1.3s cubic-bezier(0.165, 0.84, 0.44, 1) infinite;
            }
        }
    }
}

.hero_style--selected{
    animation-play-state: paused !important;

    & .hero_style_wrapper{
        pointer-events: auto;
    }

    & .hero_style_popup{
        opacity: 1;
        transform: scale(1);
        pointer-events: auto;
    }

    & .hero_style_chip{
        border: 1px solid var(--cherry);

        &::after{
            animation: pulse-border 1.3s cubic-bezier(0.165, 0.84, 0.44, 1) infinite;
        }
    }
}

.hero_style_wrapper{
    position: absolute;
    pointer-events: none;

    padding: 7px;
}

.hero_style_popup {
    opacity: 0;
    transform: scale(.7);
    pointer-events: none;
    border-radius: var(--default-border-radius);
    background-color: var(--cream);
    transition: opacity .3s ease, transform .2s cubic-bezier(0.165, 0.84, 0.44, 1);

    border: 1px solid var(--border);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15), 0 4px 12px rgba(139, 26, 43, 0.1);

    overflow: hidden;

    & img {
        width: 100%;
        height: 100px;

        background-color: gray;
    }
}

.hero_style_popup__description{
    font-size: 0.6rem;
    font-weight: 400;
    letter-spacing: .2em;
    
    padding: .5rem 1rem .7rem 1rem;
    
    & span{
        white-space: nowrap;
        display: inline-block;
        color: var(--muted);
    }
}

.hero_style_chip{
    position: relative;

    font-size: 0.6rem;
    letter-spacing: 0.04em;
    padding: .5rem 1rem;
    text-transform: uppercase;

    border: 1px solid var(--border);
    border-radius: 100px;

    box-shadow: 0 8px 24px rgba(139, 26, 43, 0.11), 0 1px 4px rgba(0, 0, 0, 0.06);

    display: flex;
    align-items: center;

    &::before{
        content: "";
        display: block;
        width: 4px;
        aspect-ratio: 1/1;
        background-color: var(--cherry);
        border-radius: 100px;
        margin-right: .5rem;
    }

    &::after{
        content: "";
        display: block;

        width: 100%;
        height: 100%;
        border-radius: 100px;

        position: absolute;
        inset: 0;
        opacity: 0;

        border: 1px solid var(--cherry);

        pointer-events: none;
    }
}

.hero_spinning_disc{
    z-index: 97;
    width: fit-content;
    text-align: center;
    aspect-ratio: 1/1;
    border-radius: 100%;
    padding: 1.5rem;
    background-color: var(--cherry);
    font-size: .6rem;
    line-height: 1.4;
    text-transform: uppercase;
    color: var(--cream);
    letter-spacing: 0.08em;

    box-shadow: 0 8px 28px rgba(139, 26, 43, 0.35);

    position: absolute;
    right: -20px;
    bottom: -20px;

    animation: spin-slow 14s linear infinite;
}

@media (width > 670px) {
    .hero_mascot{
        max-width: 430px;
    }
}

@keyframes spin-slow {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

@keyframes pulse-border {
    0%{
        opacity: 0;
    }

    20%{
        opacity: 1;
    }
   
    35%{
        opacity: 0;
    }
    
    100%{
        transform: scale(1.8);
        opacity: 0;
    }
}