/* ==========================================================================
   MÓDULO: SECCIÓN HERO (INICIO) - DISEÑO PREMIUM, VIEWPORT Y PARALLAX CÚBICO
   ========================================================================== */

.hero-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    background-color: var(--color-bg-light); 
    
    /* --- FONDO CUADRICULADO INGENIERIL (Papel Milimetrado / CAD) --- */
    background-image: 
        linear-gradient(rgba(0, 0, 0, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 0, 0, 0.04) 1px, transparent 1px);
    background-size: 40px 40px;
    background-position: center center;
    
    position: relative;
    overflow: hidden;
    /* OJO: el scroll-snap global ya reserva 100px (scroll-padding-top) para el
       header en CADA snap de scroll, no solo al hacer clic en "Inicio". Este
       padding-top solo debe cubrir lo ADICIONAL que sobresale el logo agrandado,
       para no sumar el offset del header dos veces (85 + 100 = 185 efectivos). */
    padding-top: 85px;
}

.hero-bg-analytics {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
    z-index: 1;
}

/* --- CORRECCIÓN: RESTAURACIÓN DEL MOTOR DE ESCRITURA DINÁMICA DE FÓRMULAS --- */
.engineering-metric {
    position: absolute;
    font-family: 'Courier New', Courier, monospace !important;
    font-weight: 800 !important; 
    color: rgba(33, 79, 80, 0.15) !important; /* Transparencia exacta adaptada al nuevo verde oscuro corporativo */
    white-space: nowrap;
    border-right: 2px solid transparent;
    transition: opacity 1.5s ease;
    z-index: 1;
}

.engineering-metric.typing {
    border-right: 2px solid var(--color-primary) !important;
    animation: blinkCursor 0.8s step-end infinite !important;
}

@keyframes blinkCursor {
    50% { border-color: transparent; }
}

.hero-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 60px;
    width: 100%;
    position: relative;
    z-index: 2;
}

/* --- BLOQUE IZQUIERDO: TEXTOS --- */
.hero-content {
    flex: 1;
    max-width: 620px;
}

.hero-brand-badge {
    display: inline-block;
    font-family: var(--font-primary);
    background-color: rgba(48, 122, 109, 0.08); 
    color: var(--color-primary);
    padding: 6px 16px;
    border-radius: 30px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 25px;
    border: 1px solid rgba(48, 122, 109, 0.15);
}

.hero-title {
    font-family: var(--font-primary);
    font-size: 2.85rem;
    font-weight: 500; /* Fijado en 500 para máxima finura lineal */
    font-variation-settings: 'wght' 500;
    color: var(--color-primary-dark);
    line-height: 1.15;
    margin-bottom: 20px;
    letter-spacing: -1px;
}

.hero-description {
    font-size: 1.05rem;
    color: var(--color-text);
    line-height: 1.65;
    margin-bottom: 35px;
    text-align: justify;
    text-justify: inter-word;
}

.hero-buttons {
    display: flex;
    gap: 20px;
}

/* --- BLOQUE DERECHO: CONTENEDOR DEL CARRUSEL --- */
.hero-carousel-container {
    flex: 1;
    max-width: 540px;
    height: 580px;
    position: relative;
    border-radius: 20px;
    box-shadow: 0 30px 70px rgba(33, 79, 80, 0.16);
    border: 1px solid rgba(0, 0, 0, 0.04);
    background-color: var(--color-white);
    overflow: hidden !important; 
    isolation: isolate; 
}

.hero-carousel {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden !important;
    border-radius: 20px;
}

.carousel-item {
    position: absolute;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
    opacity: 0;
    transform: translateX(100%); 
    transition: transform 1.2s cubic-bezier(0.76, 0, 0.24, 1), opacity 0.6s ease;
    overflow: hidden !important;
    border-radius: 20px;
    z-index: 1;
}

.carousel-item.active {
    opacity: 1;
    transform: translateX(0) !important;
    z-index: 2;
}

.carousel-item.exit {
    opacity: 0;
    transform: translateX(-100%) !important;
    z-index: 1;
}

/* Ajuste Fino: Contención estricta al 100% en su cuadro sin desbordes */
.carousel-item img {
    width: 100% !important;
    height: 100% !important;
    object-fit: fill !important; 
    border-radius: 20px;
    transform: none !important; 
    transition: none !important;
}

/* --- INDICADORES --- */
.carousel-indicators {
    position: absolute;
    bottom: 25px; 
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 10;
    background: rgba(255, 255, 255, 0.4);
    padding: 6px 12px;
    border-radius: 20px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.carousel-indicators .dot {
    width: 8px;
    height: 8px;
    background-color: rgba(33, 79, 80, 0.3);
    border-radius: 50%;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

.carousel-indicators .dot.active {
    background-color: var(--color-primary);
    transform: scale(1.2);
}

/* --- ANIMACIÓN SISTÉMICA DE ENTRADA --- */
.hero-section .animate-item {
    opacity: 0;
    transform: translateY(30px);
    animation: heroFadeUp 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.hero-section .delay-1 { animation-delay: 0.1s; }
.hero-section .delay-2 { animation-delay: 0.25s; }
.hero-section .delay-3 { animation-delay: 0.4s; }
.hero-section .delay-4 { animation-delay: 0.55s; }
.hero-section .delay-5 { animation-delay: 0.7s; }

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

/* ==========================================================================
   DISPOSITIVOS MÓVILES Y ADAPTACIÓN DE PANTALLA
   ========================================================================== */
@media (max-width: 1200px) {
    .hero-title { font-size: 2.4rem; }
    .hero-carousel-container { height: 480px; }
}

@media (max-width: 992px) {
    .hero-section {
        padding-top: 35px; /* Igual criterio: sin duplicar el offset del header */
        padding-bottom: 60px;
        height: auto;
        min-height: auto;
    }
    
    .hero-container {
        flex-direction: column;
        gap: 45px;
        text-align: center;
    }
    
    .hero-content {
        max-width: 100%;
    }
    
    .hero-description {
        text-align: center;
    }
    
    .hero-buttons {
        justify-content: center;
    }
    
    .hero-carousel-container {
        width: 100%;
        max-width: 480px;
        height: 400px;
    }
}

@media (max-width: 576px) {
    .hero-title { font-size: 2rem; }
    .hero-carousel-container { height: 320px; }
}