/* ==========================================================================
   ANIMAÇÕES
   Movimento lento e discreto. Tudo é desativado com prefers-reduced-motion,
   e o conteúdo nunca depende de animação para aparecer.
   ========================================================================== */

@keyframes nav-item-in {
    from {
        opacity: 0;
        transform: translateY(0.75rem);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

@keyframes dialog-in {
    from {
        opacity: 0;
        transform: translateY(0.75rem);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

/* Leve aproximação da fotografia do hero ao carregar */
@keyframes hero-settle {
    from {
        transform: scale(1.06);
    }
    to {
        transform: scale(1);
    }
}

@keyframes draw-path {
    to {
        stroke-dashoffset: 0;
    }
}

@media (prefers-reduced-motion: no-preference) {
    .hero__image {
        animation: hero-settle 2.4s var(--ease-out) both;
    }

    /* ---- Revelação na rolagem (reveal.js adiciona .is-visible) -------- */
    .js [data-reveal] {
        opacity: 0;
        transform: translateY(1.25rem);
        transition:
            opacity var(--duration-slow) var(--ease-out),
            transform var(--duration-slow) var(--ease-out);
        transition-delay: var(--reveal-delay, 0ms);
    }

    .js [data-reveal="fade"] {
        transform: none;
    }

    .js [data-reveal].is-visible {
        opacity: 1;
        transform: none;
    }

    /* Hero: entrada em cascata */
    .js .hero__content [data-reveal]:nth-child(2) { --reveal-delay: 120ms; }
    .js .hero__content [data-reveal]:nth-child(3) { --reveal-delay: 220ms; }
    .js .hero__content [data-reveal]:nth-child(4) { --reveal-delay: 340ms; }
    .js .hero__content [data-reveal]:nth-child(5) { --reveal-delay: 460ms; }

    /* Retrato: desvela de baixo para cima */
    .js .about__portrait[data-reveal] .about__frame {
        clip-path: inset(100% 0 0 0);
        transition: clip-path 1.4s var(--ease-out);
    }

    .js .about__portrait.is-visible .about__frame {
        clip-path: inset(0 0 0 0);
    }

    /* Percurso dos diferenciais: a linha se desenha ao entrar na tela */
    .js .features__path path {
        stroke-dasharray: 1400;
        stroke-dashoffset: 1400;
    }

    .js .features__track.is-visible .features__path path {
        animation: draw-path 2.4s var(--ease-in-out) forwards;
    }

    /* Diferenciais em sequência */
    .js .feature:nth-child(2) { --reveal-delay: 150ms; }
    .js .feature:nth-child(3) { --reveal-delay: 300ms; }
    .js .feature:nth-child(4) { --reveal-delay: 450ms; }
}
