/* --- PALETA DE COLORES PREMIUM --- */
:root {
    --bg-main: #0f172a;
    --bg-secondary: #1e293b;
    --text-light: #ffffff;
    --text-muted: #cbd5e1;
    --gradient-primary: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    --gradient-hover: linear-gradient(135deg, #4f46e5 0%, #9333ea 100%);
    --card-glass: rgba(30, 41, 59, 0.7);
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Inter', sans-serif; scroll-behavior: smooth; }

/* 🔥 EL TRUCO PARA ELIMINAR EL ESPACIO FANTASMA ABAJO 🔥 */
html, body { min-height: 100vh; }
body { 
    background-color: var(--bg-main); 
    color: var(--text-light); 
    line-height: 1.7; 
    overflow-x: hidden; 
    /* Convertimos el body en una columna flexible */
    display: flex; 
    flex-direction: column; 
}

/* MENÚ SUPERIOR */
.main-header { position: fixed; top: 0; left: 0; width: 100%; display: flex; justify-content: space-between; align-items: center; padding: 20px 5%; background: rgba(15, 23, 42, 0.85); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); z-index: 1000; border-bottom: 1px solid rgba(255, 255, 255, 0.05); }
.main-header .logo { font-size: 1.5rem; font-weight: 800; color: var(--text-light); text-decoration: none; letter-spacing: -0.5px; }
.main-header .logo span { color: #a855f7; }
.nav-links { display: flex; list-style: none; gap: 35px; }
.nav-links a { color: var(--text-muted); text-decoration: none; font-weight: 600; font-size: 0.95rem; transition: color 0.3s ease; }
.nav-links a:hover { color: var(--text-light); }

/* HERO SECTION */
.hero { position: relative; min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 100px 20px 20px 20px; overflow: hidden; }
.hero::before { content: ''; position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: linear-gradient(to bottom, rgba(15, 23, 42, 0.9), var(--bg-main)), url('https://images.unsplash.com/photo-1550751827-4bd374c3f58b?auto=format&fit=crop&w=1920&q=80'); background-size: cover; background-position: center; z-index: -1; }
.tag-hero { display: inline-block; padding: 8px 20px; background: rgba(99, 102, 241, 0.15); border: 1px solid rgba(99, 102, 241, 0.3); border-radius: 30px; color: #a855f7; font-weight: 600; font-size: 0.9rem; margin-bottom: 25px; backdrop-filter: blur(10px); }

.hero h1 { font-size: 4rem; font-weight: 800; max-width: 1000px; margin-bottom: 25px; line-height: 1.1; color: white; }
#typewriter-text { background: linear-gradient(to right, #ffffff, #a855f7); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.cursor { display: inline-block; width: 4px; background-color: #a855f7; margin-left: 5px; animation: blink 0.8s step-end infinite; vertical-align: text-bottom; height: 1em; }
@keyframes blink { 50% { opacity: 0; } }

.hero p { font-size: 1.3rem; color: var(--text-muted); max-width: 750px; margin-bottom: 50px; }
.btn-glow { background: var(--gradient-primary); color: white; padding: 18px 45px; font-size: 1.1rem; font-weight: 700; border: none; border-radius: 50px; cursor: pointer; text-decoration: none; transition: all 0.3s ease; box-shadow: 0 10px 30px -10px rgba(168, 85, 247, 0.6); display: inline-block; }
.btn-glow:hover { transform: translateY(-3px); box-shadow: 0 20px 40px -10px rgba(168, 85, 247, 0.8); background: var(--gradient-hover); }

/* SERVICIOS */
.container { max-width: 1200px; margin: 0 auto; padding: 100px 20px; }
.scroll-offset { scroll-margin-top: 80px; } 
.section-header { text-align: center; margin-bottom: 70px; }
.section-header h2 { font-size: 2.8rem; margin-bottom: 15px; }
.section-header h2 span { color: #a855f7; }
.section-header p { color: var(--text-muted); font-size: 1.2rem; }
.grid-services { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 40px; }
.card-service { background: var(--card-glass); backdrop-filter: blur(10px); padding: 50px 35px; border-radius: 24px; border: 1px solid rgba(255, 255, 255, 0.05); transition: all 0.4s ease; position: relative; overflow: hidden; }
.card-service:hover { transform: translateY(-10px); border-color: rgba(168, 85, 247, 0.5); box-shadow: 0 20px 40px -20px rgba(0, 0, 0, 0.5); }
.icon-box { width: 70px; height: 70px; display: flex; align-items: center; justify-content: center; border-radius: 20px; background: rgba(99, 102, 241, 0.1); font-size: 2.5rem; margin-bottom: 30px; background: var(--gradient-primary); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.card-service h3 { font-size: 1.5rem; margin-bottom: 15px; }

/* CASOS DE USO Y RESULTADOS */
.use-cases-section { background-color: var(--bg-secondary); padding: 100px 0; position: relative; }
.use-cases-section::before { content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: radial-gradient(circle at top right, rgba(168, 85, 247, 0.1), transparent 50%); pointer-events: none; }
.espacio-top { padding-top: 150px; } 

.case-study-row { display: flex; align-items: center; gap: 60px; margin-bottom: 120px; }
.case-study-row.reverse { flex-direction: row-reverse; }
.case-text { flex: 1; padding: 0 20px; }
.case-text h3 { font-size: 2rem; margin-bottom: 20px; display: flex; align-items: center; gap: 15px; }
.case-text p { color: var(--text-muted); font-size: 1.1rem; margin-bottom: 30px; }
.case-feature { display: flex; align-items: center; gap: 15px; margin-bottom: 15px; font-weight: 600; }
.check-icon { color: #a855f7; font-size: 1.2rem; }
.case-image-container { flex: 1.4; position: relative; min-width: 0; }
.case-image { width: 100%; height: auto; border-radius: 24px; box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.8); border: 1px solid rgba(255, 255, 255, 0.1); transition: transform 0.3s ease; display: block;}
.case-image:hover { transform: scale(1.02); }

/* MOCKUPS MAC */
.mockup-window { background: #ffffff; border-radius: 12px; overflow: hidden; box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7); border: 1px solid rgba(255,255,255,0.1); transition: transform 0.4s ease, box-shadow 0.4s ease; }
.mockup-window:hover { transform: translateY(-8px) scale(1.02); box-shadow: 0 35px 60px -10px rgba(168, 85, 247, 0.3); }
.mockup-header { background: #1e293b; padding: 12px 16px; display: flex; gap: 8px; border-bottom: 1px solid rgba(255,255,255,0.05); }
.mockup-header .dot { width: 12px; height: 12px; border-radius: 50%; }
.mockup-header .dot:nth-child(1) { background: #ff5f56; }
.mockup-header .dot:nth-child(2) { background: #ffbd2e; }
.mockup-header .dot:nth-child(3) { background: #27c93f; }
.mockup-img { width: 100%; display: block; }
.web-img { height: auto; }
.excel-img { height: auto; object-fit: contain; }

/* ========================================= */
/* 🔥 NUEVO CTA FINAL (BOTÓN RADAR Y BRILLO) 🔥 */
/* ========================================= */
.cta-final { position: relative; text-align: center; padding: 150px 20px; background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%); overflow: hidden; border-top: 1px solid rgba(255, 255, 255, 0.05); }
.cta-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background-image: radial-gradient(circle at 20% 30%, rgba(99, 102, 241, 0.08) 0%, transparent 60%), radial-gradient(circle at 80% 70%, rgba(168, 85, 247, 0.08) 0%, transparent 60%); pointer-events: none; z-index: 1; }
.cta-content { position: relative; z-index: 2; max-width: 900px; margin: 0 auto; }
.cta-final h2 { font-size: 3.8rem; font-weight: 800; margin-bottom: 30px; line-height: 1.15; color: var(--text-light); }

/* Animación de Brillo en el Texto */
.text-shine {
    background: linear-gradient(90deg, #a855f7 0%, #ffffff 50%, #a855f7 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shine 3s linear infinite;
}
@keyframes shine { to { background-position: 200% center; } }

.cta-final p { font-size: 1.4rem; color: var(--text-muted); max-width: 700px; margin: 0 auto 50px auto; }
.cta-action-container { display: flex; flex-direction: column; align-items: center; gap: 15px; }

/* Botón Radar Pulsante */
.btn-cta-pulse {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: var(--gradient-primary);
    color: white;
    padding: 22px 50px;
    font-size: 1.3rem;
    font-weight: 800;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s ease;
    z-index: 10;
    box-shadow: 0 10px 25px rgba(168, 85, 247, 0.5);
}
.btn-cta-pulse:hover {
    transform: translateY(-5px) scale(1.05);
    background: var(--gradient-hover);
    box-shadow: 0 20px 40px -10px rgba(168, 85, 247, 0.9);
}

/* Efecto de ondas (radar) */
.btn-cta-pulse::before, .btn-cta-pulse::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    border-radius: 50px;
    background: rgba(168, 85, 247, 0.5);
    z-index: -1;
    animation: pulse-radar 2s cubic-bezier(0.25, 0.8, 0.25, 1) infinite;
}
.btn-cta-pulse::after { animation-delay: 1s; }

@keyframes pulse-radar {
    0% { transform: scale(1); opacity: 1; }
    100% { transform: scale(1.4); opacity: 0; }
}

/* 🔥 EL FOOTER AHORA EMPUJA HACIA ABAJO 🔥 */
footer { 
    background-color: var(--bg-secondary); 
    color: #94a3b8; 
    text-align: center; 
    padding: 30px 20px; 
    font-size: 0.9rem; 
    border-top: 1px solid rgba(255,255,255,0.05); 
    margin-top: auto; /* Empuja el footer al fondo absoluto */
}

/* SCROLL Y FADE (ANIMACIONES GLOBALES) */
/* SCROLL Y FADE (ANIMACIONES GLOBALES) - FIX DEFINITIVO */
/* NUNCA le pongas 'transform' al body o romperás los position: fixed del bot y del menú */
body { opacity: 0; animation: fadeInPage 0.4s ease-out forwards; }
body.fade-out { animation: fadeOutPage 0.3s ease-in forwards; }

@keyframes fadeInPage { 
    from { opacity: 0; } 
    to { opacity: 1; } 
}
@keyframes fadeOutPage { 
    from { opacity: 1; } 
    to { opacity: 0; } 
}

/* Las animaciones de revelado de las tarjetas se quedan igual porque NO están en el body */
.reveal { opacity: 0; transform: translateY(40px); transition: all 0.8s cubic-bezier(0.5, 0, 0, 1); }
.reveal.active { opacity: 1; transform: translateY(0); }
.card-service:nth-child(1).reveal { transition-delay: 0.1s; }
.card-service:nth-child(2).reveal { transition-delay: 0.2s; }
.card-service:nth-child(3).reveal { transition-delay: 0.3s; }

/* Responsive */
@media (max-width: 968px) {
    .nav-links { gap: 15px; }
    .nav-links a { font-size: 0.85rem; }
    .hero h1 { font-size: 3rem; }
    .case-study-row, .case-study-row.reverse { flex-direction: column; text-align: left; gap: 40px; }
    .case-image-container { flex: 1; width: 100%; }
    .cta-final h2 { font-size: 2.5rem; }
    .btn-cta-pulse { font-size: 1.1rem; padding: 18px 30px; }
}

/* ========================================= */
/* ✨ ANIMACIONES PREMIUM PARA SERVICIOS ✨ */
/* ========================================= */

/* 1. Línea decorativa que se dibuja sola bajo los títulos H3 */
.case-text h3 {
    position: relative;
    display: inline-block;
    padding-bottom: 8px;
}
.case-text h3::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    height: 3px;
    width: 0; /* Empieza oculta (0 ancho) */
    background: var(--gradient-primary);
    transition: width 0.8s cubic-bezier(0.25, 1, 0.5, 1);
    transition-delay: 0.4s; /* Espera a que la tarjeta termine de subir */
    border-radius: 5px;
}
/* Cuando el JS le pone la clase .active, la línea crece */
.reveal.active .case-text h3::after {
    width: 100%; /* Magia pura: ahora calcula el tamaño exacto del texto y lo subraya entero */
}
/* 2. Efecto de entrada en cascada para las listas con check (✓) */
.case-feature {
    opacity: 0;
    transform: translateX(-20px); /* Empiezan desplazadas a la izquierda */
    transition: all 0.5s ease-out;
}
/* El primer check entra al instante tras aparecer la sección */
.reveal.active .case-feature:nth-of-type(1) {
    opacity: 1;
    transform: translateX(0);
    transition-delay: 0.5s;
}
/* El segundo check espera un poquito más para hacer el efecto escalera */
.reveal.active .case-feature:nth-of-type(2) {
    opacity: 1;
    transform: translateX(0);
    transition-delay: 0.7s;
}

/* ========================================= */
/* ✨ TABLA OSCURA - SOBRE NOSOTROS ✨ */
/* ========================================= */
.filosofia-grid {
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); 
    gap: 40px; 
}

.filosofia-card {
    background: #0b1120; /* Color súper oscuro y premium para la tabla */
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 50px 35px;
    border-radius: 24px;
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
}

.filosofia-card h3 {
    font-size: 1.5rem; 
    margin-bottom: 15px;
    color: var(--text-light);
}

/* Efecto al pasar el ratón: se levanta y brilla en morado */
.filosofia-card:hover {
    transform: translateY(-10px);
    border-color: rgba(168, 85, 247, 0.5);
    box-shadow: 0 20px 40px -20px rgba(0, 0, 0, 0.5);
}

/* ========================================= */
/* ✨ ANIMACIONES PREMIUM (INICIO Y SERVICIOS) ✨ */
/* ========================================= */

.card-service {
    background: var(--card-glass);
    backdrop-filter: blur(10px);
    padding: 50px 35px;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    /* Transición suave y rebotona para el hover */
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); 
    position: relative;
    overflow: hidden; /* Para contener el brillo interior */
    z-index: 1;
}

/* El brillo interior morado, invisible por defecto */
.card-service::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.15) 0%, transparent 100%);
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: -1;
}

/* EFECTO HOVER: Se levanta, brilla y muestra sombra */
.card-service:hover {
    transform: translateY(-15px); /* Se levanta más alto */
    border-color: rgba(168, 85, 247, 0.5); /* Borde morado */
    /* Doble sombra: una oscura profunda, una morada brillante */
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.5), 0 0 20px rgba(168, 85, 247, 0.2);
}

/* Aparece el fondo morado sutil */
.card-service:hover::before {
    opacity: 1;
}

/* Animación del Icono dentro de la tarjeta */
.icon-box {
    width: 70px; height: 70px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 20px;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-size: 2.5rem;
    margin-bottom: 30px;
    /* Transición para el icono */
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Al hacer hover en la tarjeta, el icono rota y crece un poco */
.card-service:hover .icon-box {
    transform: scale(1.15) rotate(5deg);
}

.card-service h3 { font-size: 1.5rem; margin-bottom: 15px; }

