/* ============================================
   O+A ARCHITECTS - ANIMAÇÕES OTIMIZADAS
   ============================================ */

/* ANIMAÇÃO PRINCIPAL DE CONSTRUÇÃO DO SITE */
.site-build-wrapper {
    opacity: 0;
    animation: siteConstruct 1.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes siteConstruct {
    0% {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }

    60% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }

    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Animação por camadas - como um prédio sendo construído */
.build-layer-1 {
    animation: buildLayer1 0.8s ease-out 0.1s forwards;
    opacity: 0;
}

.build-layer-2 {
    animation: buildLayer2 0.8s ease-out 0.3s forwards;
    opacity: 0;
}

.build-layer-3 {
    animation: buildLayer3 0.8s ease-out 0.5s forwards;
    opacity: 0;
}

.build-layer-4 {
    animation: buildLayer4 0.8s ease-out 0.7s forwards;
    opacity: 0;
}

@keyframes buildLayer1 {
    to {
        opacity: 1;
        transform: translateY(0);
    }

    from {
        opacity: 0;
        transform: translateY(20px);
    }
}

@keyframes buildLayer2 {
    to {
        opacity: 1;
        transform: translateY(0);
    }

    from {
        opacity: 0;
        transform: translateY(25px);
    }
}

@keyframes buildLayer3 {
    to {
        opacity: 1;
        transform: translateY(0);
    }

    from {
        opacity: 0;
        transform: translateY(30px);
    }
}

@keyframes buildLayer4 {
    to {
        opacity: 1;
        transform: translateY(0);
    }

    from {
        opacity: 0;
        transform: translateY(35px);
    }
}

/* Animações otimizadas para performance */
@keyframes gentleAppear {
    from {
        opacity: 0;
        transform: translateY(15px);
    }

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

@keyframes subtleScale {
    from {
        opacity: 0;
        transform: scale(0.98);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Classes de animação otimizadas */
.animate-gentle {
    opacity: 0;
    animation: gentleAppear 0.6s ease-out forwards;
}

.animate-scale {
    opacity: 0;
    animation: subtleScale 0.5s ease-out forwards;
}

/* Delays para animações em sequência */
.delay-1 {
    animation-delay: 0.1s;
}

.delay-2 {
    animation-delay: 0.2s;
}

.delay-3 {
    animation-delay: 0.3s;
}

.delay-4 {
    animation-delay: 0.4s;
}

.delay-5 {
    animation-delay: 0.5s;
}

/* Animações específicas para elementos do hero */
.hero-build-in {
    opacity: 0;
    animation: heroBuildIn 1s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes heroBuildIn {
    0% {
        opacity: 0;
        transform: translateY(40px) scale(0.96);
    }

    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Animações para cards (leves) */
.card-appear {
    opacity: 0;
    transform: translateY(20px);
    animation: cardAppear 0.5s ease-out forwards;
}

@keyframes cardAppear {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Animações de hover otimizadas */
.hover-lift {
    transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

.hover-lift:hover {
    transform: translateY(-3px);
}

/* Loading spinner otimizado */
@keyframes smoothSpin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.loading-spinner {
    animation: smoothSpin 0.8s linear infinite;
}

/* Reduce motion support */
@media (prefers-reduced-motion: reduce) {

    .site-build-wrapper,
    .build-layer-1,
    .build-layer-2,
    .build-layer-3,
    .build-layer-4,
    .animate-gentle,
    .animate-scale,
    .hero-build-in,
    .card-appear {
        animation: none !important;
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }

    .hover-lift {
        transition: none !important;
    }

    .hover-lift:hover {
        transform: none !important;
    }
}

/* Staggered animation para grid items */
.stagger-grid>* {
    opacity: 0;
    animation: gentleAppear 0.5s ease-out forwards;
}

.stagger-grid>*:nth-child(1) {
    animation-delay: 0.05s;
}

.stagger-grid>*:nth-child(2) {
    animation-delay: 0.1s;
}

.stagger-grid>*:nth-child(3) {
    animation-delay: 0.15s;
}

.stagger-grid>*:nth-child(4) {
    animation-delay: 0.2s;
}

.stagger-grid>*:nth-child(5) {
    animation-delay: 0.25s;
}

.stagger-grid>*:nth-child(6) {
    animation-delay: 0.3s;
}

/* Animação para imagens com lazy loading */
.project-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    background-color: var(--black-900);
}

.project-image.fade-in {
    opacity: 1;
}