/* Bloc Animation - Acrostiche CHAUMONT */

.bloc-animation {
    position: relative;
    padding: 2rem 1rem;
    background: #ffffff;
    color: #546126;
    overflow-x: hidden;

    .container {
        @media (min-width: 1280px) {
            width: 50% !important;
        }
    }
}

.bloc-animation__inner {
    position: relative;
}

.bloc-animation__word-line {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 3rem;
    height: 80px;
    position: relative;
    transition: height 0.8s ease, margin-bottom 0.8s ease, opacity 0.6s ease;
}

.bloc-animation__word-line.collapse {
    height: 0;
    margin-bottom: 0;
    opacity: 0;
    overflow: hidden;
}

.bloc-animation__letter-wrapper {
    position: relative;
    width: 40px;
    height: 80px;
}

.bloc-animation__letter {
    font-family: 'Outfit', sans-serif;
    font-size: 8vw;
    font-weight: 900;
    color: #dcdc01;
    text-shadow: 0 0 20px rgba(220, 220, 1, 0.3);
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
}

.bloc-animation__letter.appear {
    animation: letterAppear 0.6s ease forwards;
}

.bloc-animation__letter.moving {
    animation: letterMoving 1.2s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
}

.bloc-animation__phrases {
    display: flex;
    flex-direction: column;
}

.bloc-animation__phrase-line {
    display: flex;
    align-items: center;
    opacity: 0;
}

.bloc-animation__phrase-line.show {
    animation: slideInPhrase 0.8s ease forwards;
}

.bloc-animation__phrase-letter {
    font-family: 'Outfit', sans-serif;
    font-size: 6vw;
    font-weight: 900;
    color: #dcdc01;
    text-shadow: 0 0 15px rgba(220, 220, 1, 0.2);
    flex-shrink: 0;
    min-width: 40px;
    opacity: 0;
}

.bloc-animation__phrase-letter.show {
    animation: letterFadeIn 0.5s ease forwards;
}

.bloc-animation__phrase-text {
    font-size: 14px;
    line-height: 1.4;
    color: #546126;
    flex: 1;
    padding-top: 0.5rem;
    opacity: 0;
}

.bloc-animation__phrase-text.show {
    animation: textFadeIn 0.6s ease forwards;
}

/* Animations */
@keyframes letterAppear {
    0% {
        opacity: 0;
        transform: translateX(-50%) scale(0) rotate(-180deg);
    }

    60% {
        transform: translateX(-50%) scale(1.2) rotate(10deg);
    }

    100% {
        opacity: 1;
        transform: translateX(-50%) scale(1) rotate(0deg);
    }
}

@keyframes letterMoving {
    0% {
        opacity: 1;
        transform: translateX(-50%) scale(1);
    }

    50% {
        opacity: 0.5;
    }

    100% {
        opacity: 0;
        transform: translateX(-50%) scale(0.6) translateY(400px);
    }
}

@keyframes slideInPhrase {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes letterFadeIn {
    to {
        opacity: 1;
    }
}

@keyframes textFadeIn {
    from {
        opacity: 0;
        transform: translateX(10px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Responsive Tablette */
@media (max-width: 991px) {
    .bloc-animation__letter {
        font-size: 7vw;
    }

    .bloc-animation__phrase-letter {
        font-size: 5vw;
    }

    .bloc-animation__phrase-text {
        font-size: 14px;
    }
}

/* Responsive Mobile */
@media (max-width: 768px) {
    .bloc-animation {
        padding: 1.5rem 1rem;
    }

    .bloc-animation__word-line {
        gap: 0.8rem;
        height: 60px;
    }

    .bloc-animation__letter-wrapper {
        width: 30px;
        height: 60px;
    }

    .bloc-animation__letter {
        font-size: 10vw;
    }

    .bloc-animation__phrase-letter {
        font-size: 8vw;
        min-width: 35px;
    }

    .bloc-animation__phrase-text {
        font-size: 14px;
    }

    .bloc-animation__phrases {
        gap: 1.2rem;
        margin-top: 3rem;
    }

    .bloc-animation__phrase-line {
        gap: 0.8rem;
    }
}

/* Desktop */
@media (min-width: 992px) {
    .bloc-animation {
        padding: 3rem 2rem;
    }



    .bloc-animation__letter-wrapper {
        width: 60px;
    }

    .bloc-animation__letter {
        font-size: 4rem;
    }

    .bloc-animation__phrase-letter {
        font-size: 2.5rem;
        min-width: 50px;
    }

    .bloc-animation__phrase-text {
        font-size: 1.1rem;
    }
}