/* --- VARIABLES & RESET --- */
:root {
    --bg-color: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.7);
    --accent-primary: #38bdf8;
    --accent-secondary: #818cf8;
    --accent-tertiary: #2dd4bf;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --glass-border: 1px solid rgba(255, 255, 255, 0.1);
    --gradient-text: linear-gradient(135deg, #38bdf8 0%, #818cf8 100%);
    --nav-height: 70px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scroll-behavior: smooth;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    overflow-x: hidden;
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(56, 189, 248, 0.1) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(129, 140, 248, 0.1) 0%, transparent 40%);
}

/* --- UTILIDADES --- */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
}

.highlight {
    background: var(--gradient-text);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 800;
}

section {
    padding: 100px 0;
    position: relative;
}

/* Glassmorphism Card */
.glass-card {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: var(--glass-border);
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 100%; /* Asegura altura igual en grids */
    display: flex;
    flex-direction: column;
}

.glass-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(56, 189, 248, 0.15);
    border-color: rgba(56, 189, 248, 0.3);
}

/* --- NAVEGACIÓN --- */
nav {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: var(--glass-border);
    height: var(--nav-height);
    display: flex;
    align-items: center;
}

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

.logo {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    font-size: 1.3rem;
    color: var(--text-main);
    z-index: 1002;
}

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

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.95rem;
    transition: color 0.3s;
    font-weight: 500;
}

.nav-links a:hover {
    color: var(--accent-primary);
}

/* Botón Menú Móvil (Hamburguesa) */
.menu-toggle {
    display: none;
    cursor: pointer;
    z-index: 1002;
    color: var(--text-main);
}

/* --- HERO --- */
#hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: var(--nav-height);
}

.hero-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 40px;
    align-items: center;
}

.hero-content {
    max-width: 100%;
}

/* Perfil con animación */
.profile-container {
    position: relative;
    width: 300px;
    height: 300px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
}

.profile-blob {
    position: absolute;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.2), rgba(129, 140, 248, 0.2));
    border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
    animation: blob-bounce 8s infinite ease-in-out;
    z-index: 1;
}

.profile-img {
    width: 260px;
    height: 260px;
    object-fit: cover;
    border-radius: 50%;
    border: 4px solid rgba(255, 255, 255, 0.1);
    position: relative;
    z-index: 2;
    box-shadow: 0 20px 40px rgba(0,0,0,0.4);
}

@keyframes blob-bounce {
    0% { border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%; }
    50% { border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%; }
    100% { border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%; }
}

.badge {
    display: inline-block;
    padding: 8px 16px;
    background: rgba(56, 189, 248, 0.1);
    color: var(--accent-primary);
    border-radius: 50px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    margin-bottom: 24px;
    border: 1px solid rgba(56, 189, 248, 0.2);
}

h1 {
    font-size: clamp(2.2rem, 5vw, 4.5rem);
    line-height: 1.1;
    margin-bottom: 24px;
    font-weight: 800;
}

.hero-desc {
    font-size: 1.1rem;
    color: var(--text-muted);
    max-width: 600px;
    margin-bottom: 40px;
    line-height: 1.6;
}

/* Botones */
.cta-buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.btn {
    padding: 12px 28px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
}

.btn-primary {
    background: var(--gradient-text);
    color: white;
    border: none;
}

.btn-primary:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

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

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

/* Skills */
.skills-group {
    margin-bottom: 20px;
}

.skills-label {
    font-family: 'JetBrains Mono'; 
    font-size: 0.8rem; 
    color: var(--text-muted); 
    margin-bottom: 10px;
    display: block;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.skills-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.skill-tag {
    background: rgba(255, 255, 255, 0.05);
    padding: 6px 14px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    transition: 0.3s;
}

.skill-tag.tech:hover { border-color: var(--accent-primary); background: rgba(56, 189, 248, 0.1); }
.skill-tag.data:hover { border-color: var(--accent-tertiary); background: rgba(45, 212, 191, 0.1); }
.skill-tag.soft:hover { border-color: var(--accent-secondary); background: rgba(129, 140, 248, 0.1); }

/* --- TIMELINE --- */
.timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 2px;
    background: rgba(255, 255, 255, 0.1);
}

.timeline-item {
    margin-left: 30px;
    margin-bottom: 50px;
    position: relative;
}

.timeline-dot {
    position: absolute;
    left: -36px;
    top: 5px;
    width: 14px;
    height: 14px;
    background: var(--accent-primary);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--accent-primary);
}

.job-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 10px;
    flex-wrap: wrap;
    gap: 10px;
}

.job-title {
    font-size: 1.3rem;
    color: var(--text-main);
    font-weight: 700;
}

.job-company {
    color: var(--accent-secondary);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
}

.job-date {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* --- GRID SYSTEMS (Certificaciones y Proyectos) --- */
.cert-grid, .projects-grid {
    display: grid;
    /* CAMBIO CRÍTICO: minmax ajustado a 280px para móviles */
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

.cert-header {
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    margin-bottom: 20px;
}

.cert-icon {
    background: rgba(45, 212, 191, 0.1); 
    padding: 10px; 
    border-radius: 10px; 
    border: 1px solid rgba(45, 212, 191, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
}

.cert-date {
    font-family: 'JetBrains Mono'; 
    font-size: 0.75rem; 
    color: var(--text-muted); 
    border: 1px solid var(--glass-border); 
    padding: 4px 8px; 
    border-radius: 20px;
    white-space: nowrap;
}

.cert-content {
    display: flex; 
    gap: 20px; 
    align-items: start; 
    margin-bottom: 25px;
    flex-wrap: wrap; /* Importante para móviles */
}

.cert-img-container {
    flex: 0 0 120px; /* Tamaño fijo para la imagen en desktop */
}

/* --- PROYECTOS --- */
.project-tags {
    margin-top: auto; /* Empuja tags al fondo */
    padding-top: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    color: var(--accent-primary);
}

.featured-card {
    border-color: var(--accent-primary);
    background: linear-gradient(160deg, rgba(30, 41, 59, 0.9), rgba(15, 23, 42, 0.95));
    grid-column: 1 / -1;
}

/* Grilla interna del proyecto destacado */
.project-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
    text-align: left;
    margin-bottom: 30px;
}

.contact-box {
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
}

footer {
    text-align: center;
    padding: 40px 0;
    color: var(--text-muted);
    border-top: var(--glass-border);
    margin-top: 80px;
}

/* --- RESPONSIVE DESIGN (Media Queries) --- */

/* Tablets y Laptops pequeños */
@media (max-width: 900px) {
    .hero-grid { 
        grid-template-columns: 1fr; 
        text-align: center; 
        gap: 50px;
    }
    .hero-content { margin: 0 auto; }
    .cta-buttons { justify-content: center; }
    .skills-container { justify-content: center; }
    
    /* Ajuste de perfil en móvil */
    .profile-column { order: -1; } /* Sube la foto arriba del texto */
    .profile-container { width: 220px; height: 220px; margin-bottom: 20px; }
    .profile-img { width: 190px; height: 190px; }
}

/* Móviles */
@media (max-width: 768px) {
    :root { --nav-height: 60px; }

    /* Menú Móvil */
    .menu-toggle { display: block; }
    
    .nav-links {
        position: fixed;
        top: var(--nav-height);
        left: 0;
        width: 100%;
        background: var(--bg-color);
        flex-direction: column;
        align-items: center;
        padding: 40px 0;
        gap: 25px;
        border-bottom: var(--glass-border);
        transform: translateY(-150%); /* Oculto por defecto */
        transition: transform 0.4s ease;
        z-index: 1000;
    }

    .nav-links.active {
        transform: translateY(0);
        box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    }

    h1 { font-size: 2rem; }
    h2 { font-size: 2rem !important; }
    
    /* Ajuste Timeline Móvil */
    .timeline::before { left: -10px; }
    .timeline-item { margin-left: 15px; padding-right: 0; }
    .timeline-dot { left: -27px; }
    
    /* Ajuste Certificaciones Móvil */
    .cert-img-container { flex: 100%; text-align: center; }
    .cert-img-container img { max-width: 200px; }
    
    section { padding: 60px 0; }
}
