:root {
    --primary: #58a6ff;
    --primary-variant: #1f6feb;
    --bg-dark: #0d1117;
    --bg-card: #161b22;
    --text-main: #f0f6fc;
    --text-dim: #8b949e;
    --border: #30363d;
    --accent-green: #3fb950;
}

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

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
}

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

/* Navegación */
nav {
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--border);
    background: rgba(13, 17, 23, 0.8);
    backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-flex { display: flex; justify-content: space-between; align-items: center; }
.logo { font-weight: 800; font-size: 1.2rem; letter-spacing: -0.5px; color: var(--primary); }
.nav-links a { color: var(--text-dim); text-decoration: none; margin-left: 2rem; font-size: 0.9rem; font-weight: 500; transition: 0.3s; }
.nav-links a:hover { color: var(--primary); }

/* Hero */
.hero { padding: 100px 0; background: radial-gradient(circle at 90% 10%, #1c2128 0%, #0d1117 100%); }
.hero-badge { 
    display: inline-block; padding: 4px 12px; border-radius: 20px; 
    background: rgba(88, 166, 255, 0.1); color: var(--primary); 
    font-size: 0.75rem; font-weight: 700; margin-bottom: 1rem; border: 1px solid var(--primary);
}
h1 { font-size: 3.5rem; line-height: 1.1; margin-bottom: 1.5rem; font-weight: 800; }
.hero-desc { font-size: 1.25rem; color: var(--text-dim); max-width: 750px; margin-bottom: 2rem; }

/* Stats */
.stats-grid { 
    display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); 
    gap: 1rem; margin-top: 3rem; padding: 2rem; background: var(--bg-card); 
    border-radius: 12px; border: 1px solid var(--border);
}
.stat-item h3 { color: var(--primary); font-size: 2rem; }
.stat-item p { color: var(--text-dim); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 1px; }

/* Secciones Generales */
section { padding: 80px 0; }
.section-title { margin-bottom: 3rem; }
.section-title h2 { font-size: 2rem; color: #fff; margin-bottom: 0.5rem; }
.section-title p { color: var(--primary); font-weight: 600; font-size: 0.9rem; text-transform: uppercase; }

/* Proyectos */
.project-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 2rem; }
.project-card { 
    background: var(--bg-card); border: 1px solid var(--border); border-radius: 16px; 
    overflow: hidden; transition: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.project-card:hover { transform: translateY(-10px); border-color: var(--primary); box-shadow: 0 20px 40px rgba(0,0,0,0.4); }

.project-img {
    width: 100%;
    height: 160px; 
    overflow: hidden;
    border-bottom: 1px solid var(--border);
    background-color: #1c2128; 
}

.project-img img {
    width: 100%;
    height: 100%;
    object-fit: contain; 
    padding: 10px;
    transition: 0.5s;
}

.project-content { padding: 1.5rem; }
.tag-group { margin-bottom: 1rem; }
.tag { font-size: 0.7rem; background: #21262d; color: var(--primary); padding: 4px 10px; border-radius: 6px; margin-right: 5px; }

/* Academia e Investigación */
.academic-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(400px, 1fr)); gap: 2rem; }
.academic-card { background: var(--bg-card); border: 1px solid var(--border); padding: 2rem; border-radius: 12px; }
.academic-card.full-width { grid-column: 1 / -1; }
.academic-card h3 { color: var(--primary); margin-bottom: 1.5rem; font-size: 1.25rem; }

.pub-item { margin-bottom: 1.2rem; padding-bottom: 1.2rem; border-bottom: 1px solid var(--border); }
.pub-item:last-child { border-bottom: none; }
.badge-q { background: var(--accent-green); color: #fff; padding: 2px 8px; border-radius: 4px; font-size: 0.75rem; font-weight: bold; margin-bottom: 5px; display: inline-block; }

.course-list { display: flex; flex-wrap: wrap; gap: 10px; }
.course-tag { background: rgba(88, 166, 255, 0.1); border: 1px solid var(--primary); padding: 5px 12px; border-radius: 20px; font-size: 0.85rem; color: #fff; }

.extra-info p { margin-bottom: 10px; color: var(--text-dim); font-size: 0.95rem; }

/* Timeline */
.timeline-item { padding: 1.5rem; border-left: 2px solid var(--border); position: relative; margin-left: 1rem; }
.timeline-item::before { 
    content: ''; position: absolute; left: -9px; top: 2rem; 
    width: 16px; height: 16px; background: var(--bg-dark); 
    border: 2px solid var(--primary); border-radius: 50%; 
}
.timeline-date { color: var(--primary); font-weight: 700; font-size: 0.9rem; }

footer { padding: 60px 0; border-top: 1px solid var(--border); text-align: center; color: var(--text-dim); font-size: 0.9rem; }

.doi-link {
    display: inline-block;
    margin-top: 10px;
    padding: 6px 15px;
    border: 1px solid var(--primary);
    color: var(--primary);
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    transition: 0.3s;
}
.doi-link:hover {
    background: var(--primary);
    color: var(--bg-dark);
}