/* =========================================
   1. IMPORTACIÓN DE FUENTES & VARIABLES
   ========================================= */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&family=Poppins:wght@500;600;700;800&display=swap');

:root {
    --bg-dark: #0f172a;       /* Fondo Principal */
    --bg-card: #1e293b;       /* Fondo Tarjetas */
    --primary: #3b82f6;       /* Azul Principal */
    --accent: #06b6d4;        /* Turquesa (Degradados) */
    --text-white: #f8fafc;    /* Texto Blanco */
    --text-gray: #94a3b8;     /* Texto Secundario */
    
    --font-heading: 'Poppins', sans-serif;
    --font-body: 'Inter', sans-serif;
    
    --gradient-primary: linear-gradient(90deg, #4facfe 0%, #00f2fe 100%);
}

/* =========================================
   2. RESET & ESTILOS GLOBALES
   ========================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-white);
    font-family: var(--font-body);
    line-height: 1.6;
    overflow-x: hidden; /* Evita scroll lateral */
}

a { text-decoration: none; color: inherit; transition: 0.3s; }
ul { list-style: none; }
img { max-width: 100%; display: block; }

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Títulos de Sección */
.section-title {
    text-align: center;
    margin-bottom: 60px;
    padding-top: 20px;
}

.section-title h2 {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    margin-bottom: 15px;
    background: -webkit-linear-gradient(45deg, var(--text-white), var(--primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.section-title p {
    color: var(--text-gray);
    max-width: 600px;
    margin: 0 auto;
    font-size: 1.1rem;
}

/* =========================================
   3. NAVBAR
   ========================================= */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(10px);
    padding: 15px 0;
    z-index: 1000;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-white);
}

.logo span { color: var(--primary); }

.nav-links { display: flex; gap: 30px; align-items: center; }

.nav-links a {
    font-weight: 500;
    font-size: 0.95rem;
    color: var(--text-gray);
    position: relative;
}

.nav-links a:hover, .nav-links a.active { color: var(--text-white); }

/* Línea animada bajo el link */
.nav-links a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -5px;
    left: 0;
    background-color: var(--primary);
    transition: width 0.3s;
}
.nav-links a:hover::after { width: 100%; }

.btn-nav {
    border: 1px solid var(--primary);
    padding: 8px 25px;
    border-radius: 50px;
    color: var(--primary) !important;
}

.btn-nav:hover {
    background: var(--primary);
    color: white !important;
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.4);
}
.btn-nav::after { display: none; } /* Quitar línea del botón */

.menu-toggle { display: none; cursor: pointer; font-size: 1.5rem; color: white;}

/* =========================================
   4. HERO SECTION & TERMINAL ANIMATION
   ========================================= */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: 80px;
    background: radial-gradient(circle at 90% 10%, rgba(59, 130, 246, 0.08) 0%, transparent 40%);
    position: relative;
}

.hero-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    gap: 50px;
}

.hero-content h1 {
    font-family: var(--font-heading);
    font-size: 3.5rem;
    line-height: 1.2;
    margin-bottom: 20px;
}

.hero-content h1 span { color: var(--primary); }

.hero-content p {
    color: var(--text-gray);
    font-size: 1.1rem;
    margin-bottom: 30px;
    max-width: 500px;
}

.hero-btns { display: flex; gap: 15px; }

.btn {
    padding: 12px 30px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 5px 20px rgba(59, 130, 246, 0.3);
}

.btn-primary:hover { transform: translateY(-3px); box-shadow: 0 8px 25px rgba(59, 130, 246, 0.5); }

.btn-outline {
    border: 1px solid rgba(255,255,255,0.2);
    color: var(--text-white);
}

.btn-outline:hover { border-color: var(--text-white); background: rgba(255,255,255,0.05); }

/* Ventana de Código (Terminal) */
.hero-visual { display: flex; justify-content: center; }

.code-window {
    background: #1e1e1e; /* Fondo oscuro editor */
    width: 100%;
    max-width: 550px;
    border-radius: 10px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-family: 'Courier New', Courier, monospace;
    overflow: hidden;
}

.window-header {
    background: #252526;
    padding: 10px 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.dot { width: 12px; height: 12px; border-radius: 50%; }
.red { background: #ff5f56; }
.yellow { background: #ffbd2e; }
.green { background: #27c93f; }

.window-body { padding: 25px; font-size: 0.9rem; line-height: 1.6; min-height: 200px; }

/* Colores para Syntax Highlight JS */
.keyword { color: #c678dd; } /* Morado */
.string { color: #98c379; }  /* Verde */
.variable { color: #e5c07b; } /* Amarillo */
.function { color: #61afef; } /* Azul */
.comment { color: #7f848e; font-style: italic; }

.typing { border-right: 2px solid var(--primary); animation: blink 0.7s infinite; }
@keyframes blink { 50% { border-color: transparent; } }

/* =========================================
   5. SECCIÓN HABILIDADES (Updated Styles)
   ========================================= */
.skills-section {
    padding: 80px 0;
    background-color: #131c2e; /* Fondo ligeramente distinto */
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
}

/* Tarjeta de Grupo Tecnológico */
.tech-group {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 2rem;
    transition: 0.3s ease;
}

.tech-group:hover {
    transform: translateY(-5px);
    border-color: rgba(59, 130, 246, 0.4);
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
}

.group-header {
    display: flex;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.group-header i { font-size: 1.8rem; color: var(--primary); margin-right: 15px; }
.group-header h3 { margin: 0; font-size: 1.3rem; color: var(--text-white); }

/* Items y Barras */
.skill-row { margin-bottom: 1.5rem; }
.skill-info { display: flex; flex-direction: column; margin-bottom: 8px; }
.skill-name { font-size: 1rem; color: #e2e8f0; font-weight: 500; display: flex; align-items: center; gap: 10px; }
.skill-tags { font-size: 0.8rem; color: var(--text-gray); margin-left: 26px; font-style: italic; }

.skill-bar-wrap {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
}

.bar {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: 3px;
    position: relative;
    /* Animación de carga */
    width: 0; 
    animation: fillBar 1.5s ease-out forwards; 
}
@keyframes fillBar { from { width: 0; } }

/* =========================================
   6. SECCIÓN PROYECTOS (Updated Styles)
   ========================================= */
.projects-section { padding: 80px 0; }

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2.5rem;
}

.project-card {
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    overflow: hidden;
    transition: 0.3s ease;
    display: flex;
    flex-direction: column;
}

.project-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.4);
    border-color: rgba(59, 130, 246, 0.3);
}

.card-image-wrapper {
    position: relative;
    height: 200px;
    overflow: hidden;
}

.card-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.project-card:hover .card-image-wrapper img { transform: scale(1.05); }

/* Etiquetas de Estado */
.card-status {
    position: absolute;
    top: 15px; right: 15px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    color: white;
    z-index: 2;
    box-shadow: 0 2px 5px rgba(0,0,0,0.5);
}
.status-production { background: #10b981; }
.status-delivered { background: #3b82f6; }
.status-archived { background: #64748b; }

.card-body {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.card-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--text-gray);
    margin-bottom: 10px;
}
.card-meta i { color: var(--primary); margin-right: 5px; }

.project-card h3 { font-size: 1.25rem; color: var(--text-white); margin-bottom: 10px; }
.project-desc { color: #b0b0b0; font-size: 0.9rem; margin-bottom: 15px; line-height: 1.5; }

/* Features List */
.project-features { margin-bottom: 15px; }
.project-features li { color: #cbd5e1; font-size: 0.85rem; display: flex; align-items: center; margin-bottom: 4px; }
.project-features li i { color: #10b981; margin-right: 8px; font-size: 0.75rem; }

/* Tech Tags */
.tech-stack { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; margin-bottom: 20px; }
.tech-tag {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    color: var(--primary);
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.card-actions {
    display: flex; gap: 10px; border-top: 1px solid rgba(255,255,255,0.1); padding-top: 15px;
}
.btn-project {
    flex: 1; text-align: center; padding: 8px 0; border-radius: 6px; font-size: 0.9rem; font-weight: 600;
    background: var(--gradient-primary); color: white;
}
.btn-project.outline { background: transparent; border: 1px solid rgba(255,255,255,0.2); }
.btn-project:hover { opacity: 0.9; }
.btn-project.outline:hover { background: rgba(255,255,255,0.05); }


/* =========================================
   7. CONTACTO & FOOTER
   ========================================= */
.contact-section { padding: 80px 0; background: #0b1120; }

.contact-container { display: grid; grid-template-columns: 1fr 1.5fr; gap: 50px; margin-top: 20px; }

.info-item { display: flex; align-items: center; gap: 20px; margin-bottom: 25px; }
.icon-box {
    width: 50px; height: 50px; background: rgba(59, 130, 246, 0.1);
    color: var(--primary); border-radius: 12px;
    display: flex; justify-content: center; align-items: center; font-size: 1.2rem;
}

.contact-form-wrapper {
    background: var(--bg-card); padding: 40px; border-radius: 15px; border: 1px solid rgba(255,255,255,0.05);
}

.input-group label { display: block; margin-bottom: 8px; color: var(--text-white); font-size: 0.9rem; }
.contact-form input, .contact-form textarea {
    width: 100%; padding: 12px; background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 8px; color: white;
    font-family: var(--font-body); margin-bottom: 20px;
}
.contact-form input:focus, .contact-form textarea:focus {
    border-color: var(--primary); outline: none;
}

.btn-block { width: 100%; justify-content: center; }

/* Footer */
.footer { padding: 30px 0; border-top: 1px solid rgba(255,255,255,0.05); text-align: center; font-size: 0.9rem; color: var(--text-gray); }

/* =========================================
   8. RESPONSIVE DESIGN CORREGIDO
   ========================================= */

@media (max-width: 992px) {
    .hero-container {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 30px;
        padding-top: 40px;
    }
    
    .hero-content {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .hero-content p { margin: 0 auto 30px; }
    .hero-btns { justify-content: center; }

    .hero-visual {
        width: 100%;
        margin-top: 20px;
    }
}

@media (max-width: 768px) {
    /* Navbar Móvil: Forzamos visibilidad */
    .menu-toggle {
        display: block !important;
        position: relative;
        z-index: 2000; /* Por encima de todo */
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: -100%; /* Oculto */
        width: 80%;
        height: 100vh;
        background: #0f172a; /* Fondo sólido para que no transparente el terminal */
        flex-direction: column;
        justify-content: center;
        align-items: center;
        transition: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 1500;
        box-shadow: -10px 0 30px rgba(0,0,0,0.8);
        gap: 30px;
    }

    /* Clase activa para el menú */
    .nav-links.active {
        right: 0;
    }

    /* Ajuste de Hero y Terminal */
    .hero {
        padding-top: 100px;
        min-height: auto;
        padding-bottom: 50px;
    }

    .hero-content h1 {
        font-size: 2.2rem;
    }

    /* TERMINAL RESPONSIVO: Vital para que no se pierda */
    .code-window {
        width: 100%;
        max-width: 100%;
        font-size: 0.75rem; /* Letra más pequeña para que quepa el código */
        box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    }

    .window-body {
        padding: 15px;
        min-height: auto; /* Que se adapte al contenido */
        overflow-x: hidden; /* Evita que el texto rompa el diseño */
    }

    .hero-btns {
        flex-direction: column;
        width: 100%;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }

    /* Secciones */
    .services-section { top: 0; margin-bottom: 20px; }
    .stats-container { flex-direction: column; gap: 30px; }
    .stat-item h2 { font-size: 2.5rem; }
    .skills-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
    .hero-content h1 { font-size: 1.8rem; }
    .code-window { font-size: 0.65rem; } /* Más pequeño aún en mini-celulares */
}

/* =========================================
   9. SECCIONES DEL INDEX (RECUPERADAS)
   ========================================= */

/* --- SECCIÓN SERVICIOS --- */
.services-section {
    padding: 60px 0;
    position: relative;
    top: -50px; /* Sube un poco para solaparse con el hero */
    z-index: 10;
    margin-bottom: -50px; /* Compensa el espacio */
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.service-card {
    background: var(--bg-card);
    padding: 30px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.05);
    transition: 0.3s;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.service-card:hover {
    transform: translateY(-10px);
    border-color: var(--primary);
    box-shadow: 0 20px 40px rgba(0,0,0,0.4);
}

.service-card i {
    font-size: 2rem;
    color: var(--primary);
    margin-bottom: 20px;
    display: inline-block;
}

.service-card h3 {
    margin-bottom: 15px;
    font-family: var(--font-heading);
    font-size: 1.3rem;
    color: var(--text-white);
}

.service-card p {
    color: var(--text-gray);
    font-size: 0.95rem;
    line-height: 1.6;
}

/* --- SECCIÓN ESTADÍSTICAS (STATS) --- */
.stats-section {
    padding: 80px 0;
    background: #131c2e; /* Fondo un poco diferente para separar */
    border-top: 1px solid rgba(255,255,255,0.05);
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.stats-container {
    display: flex;
    justify-content: space-around;
    text-align: center;
    flex-wrap: wrap;
    gap: 40px;
}

.stat-item h2 {
    font-size: 3.5rem;
    font-weight: 700;
    color: var(--primary); /* O un gradiente si prefieres */
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 5px;
}

.stat-item p {
    color: var(--text-white);
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    font-size: 0.9rem;
}

/* --- LLAMADO A LA ACCIÓN (CTA) --- */
.cta-section {
    padding: 100px 0;
    text-align: center;
    background: radial-gradient(circle at center, rgba(59, 130, 246, 0.15) 0%, transparent 70%);
}

.cta-content h2 {
    font-size: 2.5rem;
    margin-bottom: 15px;
    color: var(--text-white);
    font-family: var(--font-heading);
}

.cta-content p {
    color: var(--text-gray);
    margin-bottom: 30px;
    font-size: 1.1rem;
}

/* =========================================
   10. SECCIÓN CONTACTO (RESTAURADA)
   ========================================= */

/* Contenedor de la columna izquierda (Texto e info) */
.contact-info {
    display: flex;
    flex-direction: column;
    gap: 30px; /* Espacio entre los bloques de info */
}

.contact-info h3 {
    font-size: 1.5rem;
    font-family: var(--font-heading);
    margin-bottom: 10px;
    color: var(--text-white);
}

.contact-info > p { /* El párrafo debajo del título */
    color: var(--text-gray);
    margin-bottom: 20px;
}

/* Estilos de los ítems individuales (Icono + Texto) */
.info-item h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-white);
    margin-bottom: 2px;
}

.info-item p {
    color: var(--text-gray);
    font-size: 0.95rem;
    margin: 0;
}

/* Espaciado de los inputs del formulario */
.input-group {
    margin-bottom: 20px;
}


