/* ==========================================
   MANARE5 - OPTIMIZED SMOOTH ANIMATIONS
   GPU-accelerated, 60fps performance
   ========================================== */

/* ==========================================
   PERFORMANCE OPTIMIZATIONS
   Force GPU acceleration for smooth animations
   ========================================== */
.scroll-reveal,
.fade-in,
.slide-in-left,
.slide-in-right,
.scale-in,
.team-card,
.project-card,
.service-card,
.stat-card,
.client-card {
    /* GPU acceleration */
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000px;
    -webkit-font-smoothing: subpixel-antialiased;
}

/* ==========================================
   SCROLL REVEAL - Main Animation
   ========================================== */
.scroll-reveal {
    opacity: 0;
    transform: translateY(30px) translateZ(0);
    transition: opacity 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: opacity, transform;
}

.scroll-reveal.revealed {
    opacity: 1;
    transform: translateY(0) translateZ(0);
    will-change: auto;
}

/* Staggered delays for grid items */
.scroll-reveal:nth-child(1) { transition-delay: 0s; }
.scroll-reveal:nth-child(2) { transition-delay: 0.08s; }
.scroll-reveal:nth-child(3) { transition-delay: 0.15s; }
.scroll-reveal:nth-child(4) { transition-delay: 0.22s; }
.scroll-reveal:nth-child(5) { transition-delay: 0.28s; }
.scroll-reveal:nth-child(6) { transition-delay: 0.35s; }

/* ==========================================
   FADE IN ANIMATIONS
   ========================================== */
.fade-in {
    opacity: 0;
    animation: fadeIn 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

/* Staggered fade in */
.fade-in:nth-child(1) { animation-delay: 0.1s; }
.fade-in:nth-child(2) { animation-delay: 0.2s; }
.fade-in:nth-child(3) { animation-delay: 0.3s; }
.fade-in:nth-child(4) { animation-delay: 0.4s; }
.fade-in:nth-child(5) { animation-delay: 0.5s; }

/* ==========================================
   SLIDE ANIMATIONS
   ========================================== */
.slide-in-left {
    opacity: 0;
    transform: translateX(-50px) translateZ(0);
    transition: opacity 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: opacity, transform;
}

.slide-in-left.revealed {
    opacity: 1;
    transform: translateX(0) translateZ(0);
    will-change: auto;
}

.slide-in-right {
    opacity: 0;
    transform: translateX(50px) translateZ(0);
    transition: opacity 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: opacity, transform;
}

.slide-in-right.revealed {
    opacity: 1;
    transform: translateX(0) translateZ(0);
    will-change: auto;
}

/* ==========================================
   SCALE ANIMATION
   ========================================== */
.scale-in {
    opacity: 0;
    transform: scale(0.95) translateZ(0);
    transition: opacity 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: opacity, transform;
}

.scale-in.revealed {
    opacity: 1;
    transform: scale(1) translateZ(0);
    will-change: auto;
}

/* ==========================================
   LOGO FLOAT ANIMATION - Optimized
   ========================================== */
@keyframes logoFloat {
    0%, 100% {
        transform: translateY(0) translateZ(0);
    }
    50% {
        transform: translateY(-15px) translateZ(0);
    }
}

.hero-logo {
    animation: logoFloat 3s cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite;
    will-change: transform;
}

/* ==========================================
   HOVER EFFECTS - Smooth & Performant
   ========================================== */
.hover-lift {
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                box-shadow 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.hover-lift:hover {
    transform: translateY(-8px) translateZ(0);
}

.hover-scale {
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.hover-scale:hover {
    transform: scale(1.05) translateZ(0);
}

/* ==========================================
   CARD ANIMATIONS - Optimized for grids
   ========================================== */
.stat-card,
.service-card,
.team-card,
.project-card,
.client-card,
.division-card,
.cert-card {
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                box-shadow 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                border-color 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* ==========================================
   PULSE ANIMATION
   ========================================== */
.pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

/* ==========================================
   NAVIGATION ANIMATIONS
   ========================================== */
.nav-link::after {
    transform: translateX(-50%) scaleX(0) translateZ(0);
    transform-origin: center;
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.nav-link:hover::after,
.nav-link.active::after {
    transform: translateX(-50%) scaleX(1) translateZ(0);
}

/* ==========================================
   PAGE TRANSITIONS
   ========================================== */
body {
    opacity: 0;
    animation: pageLoad 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

@keyframes pageLoad {
    to {
        opacity: 1;
    }
}

/* ==========================================
   FORM ANIMATIONS
   ========================================== */
.form-message {
    animation: slideInDown 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-20px) translateZ(0);
    }
    to {
        opacity: 1;
        transform: translateY(0) translateZ(0);
    }
}

/* ==========================================
   BUTTON ANIMATIONS
   ========================================== */
.btn {
    transition: transform 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                box-shadow 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                background 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.btn:active {
    transform: translateY(-1px) translateZ(0);
}

/* ==========================================
   SMOOTH SCROLL BEHAVIOR
   ========================================== */
html {
    scroll-behavior: smooth;
}

/* Smooth scroll for specific sections */
section {
    scroll-margin-top: 100px;
}

/* ==========================================
   LOADING SKELETON (Optional)
   ========================================== */
.skeleton {
    background: linear-gradient(
        90deg,
        rgba(155, 127, 76, 0.12) 25%,
        rgba(176, 112, 95, 0.18) 50%,
        rgba(155, 127, 76, 0.12) 75%
    );
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* ==========================================
   ACCESSIBILITY - REDUCED MOTION
   Respects user preferences for motion sensitivity
   ========================================== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    
    .scroll-reveal,
    .fade-in,
    .slide-in-left,
    .slide-in-right,
    .scale-in {
        opacity: 1 !important;
        transform: none !important;
    }
    
    .hero-logo {
        animation: none !important;
    }
    
    html {
        scroll-behavior: auto !important;
    }
}

/* ==========================================
   PERFORMANCE: Remove will-change after animation
   ========================================== */
.scroll-reveal.revealed,
.slide-in-left.revealed,
.slide-in-right.revealed,
.scale-in.revealed {
    will-change: auto;
}

/* ==========================================
   ANTI-FLICKER: Prevent animation flicker on page load
   ========================================== */
.no-js .scroll-reveal,
.no-js .fade-in,
.no-js .slide-in-left,
.no-js .slide-in-right,
.no-js .scale-in {
    opacity: 1;
    transform: none;
}

/* ==========================================
   MOBILE OPTIMIZATIONS
   Reduce animation complexity on mobile for better performance
   ========================================== */
@media (max-width: 768px) {
    .scroll-reveal {
        transform: translateY(20px) translateZ(0);
    }
    
    .slide-in-left,
    .slide-in-right {
        transform: translateY(20px) translateZ(0);
    }
    
    /* Faster animations on mobile */
    .scroll-reveal,
    .slide-in-left,
    .slide-in-right,
    .scale-in {
        transition-duration: 0.4s;
    }
}

/* ==========================================
   PROFESSIONAL HOVER ANIMATIONS
   ========================================== */
@keyframes subtleGlow {
    0% { box-shadow: 0 4px 16px rgba(201, 155, 92, 0.15); }
    50% { box-shadow: 0 6px 24px rgba(201, 155, 92, 0.25); }
    100% { box-shadow: 0 4px 16px rgba(201, 155, 92, 0.15); }
}

.btn:hover,
.service-card:hover,
.portfolio-card:hover,
.client-logo-card:hover {
    animation: subtleGlow 0.4s ease-in-out;
}

/* Button entrance animation */
@keyframes buttonPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

.btn:focus-visible {
    animation: buttonPulse 0.3s ease-out;
}

/* Subtle text fade */
@keyframes textFade {
    from { opacity: 0.8; }
    to { opacity: 1; }
}

.hero-title,
.section-title {
    animation: textFade 0.8s ease-out 0.2s forwards;
}

/* ==========================================
   SCROLL DOWN INDICATOR
   ========================================== */
@keyframes scrollDown {
    0% {
        opacity: 1;
        transform: translateY(0);
    }
    50% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: translateY(12px);
    }
}

.scroll-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    animation: scrollDown 2s ease-in-out infinite;
}

.scroll-indicator svg {
    width: 24px;
    height: 24px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
}
