/*
    PROJETO ATLAS — QSMS ALLIANCE V2.0
    ARQUIVO: css/animations.css
    FUNÇÃO: movimentos, revelações e transições não estruturais.

    MAPA SINCRONIZADO:
    [QSMS-02] HERO
    [QSMS-03] NOSSA ORIGEM
    [QSMS-04] SOLUÇÕES
    [QSMS-05] DIFERENCIAIS
    [QSMS-06] SETORES ESTRATÉGICOS
    [QSMS-08] CONTATO
*/

/* ==========================================================================
   [QSMS-00] KEYFRAMES GLOBAIS
   ========================================================================= */
@keyframes reveal-up {
    from {
        opacity: 0;
        transform: translate3d(0, 28px, 0);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

@keyframes hex-float {
    0%, 100% { transform: translate3d(0, 0, 0) rotate(0deg); }
    50% { transform: translate3d(10px, 10px, 0) rotate(1deg); }
}

@keyframes hex-watermark-drift {
    0%, 100% { transform: translate3d(0, 0, 0) scale(1); opacity: var(--hex-opacity-start, 0.08); }
    50% { transform: translate3d(18px, 12px, 0) scale(1.03); opacity: var(--hex-opacity-end, 0.12); }
}

@keyframes hex-watermark-float {
    0%, 100% { transform: translate3d(0, 0, 0) rotate(0deg); opacity: var(--hex-cluster-opacity-start, 0.10); }
    50% { transform: translate3d(-14px, 16px, 0) rotate(1.2deg); opacity: var(--hex-cluster-opacity-end, 0.18); }
}

@keyframes button-shine {
    from { transform: translateX(-180%) skewX(-20deg); }
    to { transform: translateX(420%) skewX(-20deg); }
}

@keyframes mouse-wheel {
    0% { opacity: 0; transform: translateY(0); }
    25% { opacity: 1; }
    100% { opacity: 0; transform: translateY(12px); }
}

/* ==========================================================================
   [QSMS-02] HERO — HEXÁGONOS, BOTÕES E INDICADOR DE ROLAGEM
   HTML: index.html > [QSMS-02] | JS: app.js > [QSMS-02]
   ========================================================================= */
.pattern-hexagons {
    animation: hex-float 25s ease-in-out infinite;
    will-change: transform;
}

.btn-primary::before,
.btn-secondary::before,
.btn-cta-nav::before {
    content: '';
    position: absolute;
    inset: 0 auto 0 -35%;
    width: 24%;
    pointer-events: none;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.32), transparent);
    transform: translateX(-180%) skewX(-20deg);
}

.btn-primary:hover::before,
.btn-secondary:hover::before,
.btn-cta-nav:hover::before {
    animation: button-shine 700ms ease-out 1;
}

.wheel {
    animation: mouse-wheel 1.8s ease-in-out infinite;
}

/* ==========================================================================
   [QSMS-03/04/05/06/08] REVELAÇÃO PROGRESSIVA
   O JavaScript adiciona .reveal-active somente quando o elemento entra na tela.
   ========================================================================= */
.js .reveal-item:not(.reveal-active) {
    opacity: 0;
    transform: translate3d(0, 28px, 0);
}

.reveal-item.reveal-active {
    /*
       BACKWARDS mantém o estado inicial durante o atraso, mas libera o transform
       ao final da entrada. Assim, o hover dos cards volta a funcionar normalmente.
    */
    animation: reveal-up 760ms cubic-bezier(0.165, 0.84, 0.44, 1) backwards;
    animation-delay: var(--reveal-delay, 0ms);
}

/* ==========================================================================
   [QSMS-04/06] MARCA-D'ÁGUA HEXAGONAL NAS SEÇÕES-CHAVE
   HTML: index.html > [QSMS-04] e [QSMS-06]
   CSS estrutural: style.css > [QSMS-04] e [QSMS-06]
   ========================================================================= */
.brand-hex-bg::before {
    animation: hex-watermark-drift 22s ease-in-out infinite;
    will-change: transform, opacity;
}

.brand-hex-bg::after {
    animation: hex-watermark-float 28s ease-in-out infinite;
    will-change: transform, opacity;
}

/* ==========================================================================
   ACESSIBILIDADE: respeita a preferência do usuário por menos movimento.
   ========================================================================= */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .js .reveal-item,
    .reveal-item.reveal-active {
        opacity: 1 !important;
        transform: none !important;
    }
}
