/* ============================================
   SCROLL ANIMATION ENGINE
   ============================================ */

/* Base State: Elements are hidden initially */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s cubic-bezier(0.2, 0.8, 0.2, 1), 
                transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
    will-change: opacity, transform;
}

/* Active State: Elements are visible */
.animate-on-scroll.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered Delays for Children */
.animate-on-scroll:nth-child(1) { transition-delay: 0.1s; }
.animate-on-scroll:nth-child(2) { transition-delay: 0.2s; }
.animate-on-scroll:nth-child(3) { transition-delay: 0.3s; }
.animate-on-scroll:nth-child(4) { transition-delay: 0.4s; }

/* Specific Animation Types */
.fade-up {
    /* Default behavior */
}

.fade-in {
    transform: translateY(0); /* Just opacity */
}

.scale-up {
    transform: scale(0.9);
}
.scale-up.is-visible {
    transform: scale(1);
}

/* ============================================
   FLOATING PILL NAVIGATION (Auto-Hide)
   ============================================ */
.floating-nav {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(0);
    background: rgba(26, 31, 36, 0.85); /* Glass Dark */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 0.8rem 2rem;
    border-radius: 50px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 2rem;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.4s ease;
}

.floating-nav.nav-hidden {
    transform: translateX(-50%) translateY(-100px); /* Hide Up */
    opacity: 0;
    pointer-events: none;
}

.nav-logo img {
    height: 30px;
}

.nav-links {
    display: flex;
    gap: 1.5rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-links a {
    color: var(--white);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.nav-links a:hover {
    opacity: 1;
    color: var(--laranja-principal);
}

/* Hamburger for Mobile (Simplified) */
.mobile-menu-btn {
    display: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
}

@media (max-width: 768px) {
    .floating-nav {
        width: 90%;
        justify-content: space-between;
        padding: 0.8rem 1.5rem;
    }
    .nav-links { display: none; } /* Hide links on mobile for now */
    .mobile-menu-btn { display: block; }
}

/* ============================================
   HERO TRANSITION ANIMATIONS
   ============================================ */

/* Stage 1: Initial State (Centered) */
.hero-wrapper {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: 1fr;
    height: 100%;
    width: 100%;
    transition: all 1s cubic-bezier(0.6, 0, 0.4, 1);
}

.hero-content-left {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: all 1s cubic-bezier(0.6, 0, 0.4, 1);
    z-index: 20;
    position: relative;
}

/* Stage 2: Triggered by .hero-stage-2 class */
.hero-stage-2 .hero-content-left {
    /* No manual padding/transform needed if we rely on flex expansion */
}

/* Map & Logo Scaling/Moving */
.hero-visual-group {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 1s cubic-bezier(0.6, 0, 0.4, 1);
}

.hero-stage-2 .hero-visual-group {
    transform: scale(0.9) translateX(-20px); /* Adjust size/pos */
}

/* Info Group (Line + Text) */
.hero-info-group {
    width: 0; /* Animate width for the slide effect */
    opacity: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border-left: 2px solid rgba(255, 255, 255, 0.3);
    padding-left: 0; /* Start with 0 padding */
    margin-left: 0;
    overflow: hidden;
    white-space: nowrap; /* Prevent text wrap during expansion if desired, or let it reflow */
    transition: 
        width 1s cubic-bezier(0.6, 0, 0.4, 1) 0.5s, 
        opacity 0.5s ease 0.8s,
        padding 1s cubic-bezier(0.6, 0, 0.4, 1) 0.5s;
}

.hero-stage-2 .hero-info-group {
    width: 550px; /* Target width */
    opacity: 1;
    padding-left: 3rem;
}

/* Ensure text doesn't break layout during animation */
.hero-info-group h1, .hero-info-group div {
    min-width: 500px;
}

/* Floating Cards Container */
.hero-cards-container {
    position: absolute;
    bottom: 20%;
    left: 0;
    width: 100%;
    height: 80px;
    opacity: 0;
    pointer-events: none; /* Let clicks pass through if needed, but buttons need pointer-events auto */
    transition: opacity 1s ease 1.2s;
    overflow: hidden;
    z-index: 30;
}

.hero-stage-2 .hero-cards-container {
    opacity: 1;
    pointer-events: auto;
}

/* Moving Cards Animation */
.floating-text-track {
    display: flex;
    gap: 0;
    position: absolute;
    white-space: nowrap;
    animation: marquee-float 24s linear infinite;
    left: 0;
    width: max-content;
    will-change: transform;
}

.floating-text-group {
    display: inline-flex;
    align-items: center;
}

.floating-text {
    color: var(--petroleo);
    font-size: 1rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    padding: 0 2.25rem;
}

.floating-text-divider {
    width: 22px;
    height: 1px;
    background: rgba(42, 67, 89, 0.5);
}

.dark .floating-text {
    color: #ffffff;
}

.dark .floating-text-divider {
    background: rgba(255, 255, 255, 0.5);
}

@keyframes marquee-float {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

/* Flex layout helper */
.hero-flex-layout {
    display: flex;
    align-items: center;
    justify-content: center; /* Start centered */
    width: 100%;
    height: 100%;
    max-width: 1600px;
    margin: 0 auto;
    transition: all 1s ease;
}

/* Removed padding-left modification for stage-2 to let flexbox handle the "push" naturally via width expansion */
.hero-stage-2 .hero-flex-layout {
    /* Optional: can add a small shift if strictly needed, but width expansion usually suffices */
}

/* ============================================
   HERO RESPONSIVE STYLES
   ============================================ */

/* Tablets and Mobile: Stack elements vertically */
@media (max-width: 1079px) {
    .hero-flex-layout {
        flex-direction: column;
        gap: 2rem;
        padding: 1rem;
        justify-content: center;
        align-items: center;
    }
    
    /* Visual Group: Logo + Map - 95% for tablets */
    .hero-visual-group {
        width: 100%;
        max-width: 90vw;
        transform: scale(0.95) !important;
        order: 1;
        margin-bottom: 1rem;
    }
    
    .hero-stage-2 .hero-visual-group {
        transform: scale(0.95) translateX(0) !important;
    }
    
    /* Info Group: Text content */
    .hero-info-group {
        width: 100% !important;
        max-width: 90vw;
        white-space: normal;
        min-width: auto;
        border-left: none !important;
        border-top: none !important;
        padding-left: 0 !important;
        padding-top: 0 !important;
        text-align: center;
        margin-left: 0;
        order: 2;
        opacity: 1 !important;
    }
    
    .hero-stage-2 .hero-info-group {
        padding-top: 0 !important;
        padding-left: 0 !important;
    }
    
    .hero-info-group h1,
    .hero-info-group div {
        min-width: auto;
    }
    
    .hero-info-group h1 {
        font-size: 2rem !important;
        line-height: 1.3;
        text-align: center;
    }
    
    /* Hide decorative line on mobile */
    .hero-info-group .h-px {
        display: none;
    }
    
    /* Floating cards: Hide on mobile to reduce clutter */
    .hero-cards-container {
        display: none;
    }
    
    /* Hide tech grid on mobile */
    .hero-tech-grid {
        display: none;
    }
    
    /* Scroll indicator: Move up */
    .hero-identity .absolute.bottom-10 {
        bottom: 2rem;
    }
}

/* Mobile: 90% scale */
@media (max-width: 767px) {
    .hero-visual-group {
        transform: scale(0.90) !important;
    }
    
    .hero-stage-2 .hero-visual-group {
        transform: scale(0.90) translateX(0) !important;
    }
    
    .hero-info-group h1 {
        font-size: 1.5rem !important;
    }
}

/* Small Mobile: 85% scale */
@media (max-width: 480px) {
    .hero-flex-layout {
        gap: 1.5rem;
        padding: 1rem 0.5rem;
    }
    
    .hero-visual-group {
        transform: scale(0.85) !important;
        margin-bottom: 0;
    }
    
    .hero-stage-2 .hero-visual-group {
        transform: scale(0.85) translateX(0) !important;
    }
    
    .hero-info-group h1 {
        font-size: 1.25rem !important;
        line-height: 1.4;
        padding: 0 1rem;
    }
    
    /* Further reduce map size on very small screens */
    .hero-map_layer {
        width: 280px !important;
        height: 360px !important;
    }
    
    /* Reduce logo size */
    .hero-visual-group img {
        max-width: 280px !important;
    }
}
