/* --- CONFIGURACIÓN GENERAL --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body { 
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; 
    line-height: 1.7; 
    color: #334155; 
    background-color: #f4f6f8; 
    padding-top: 70px;
}

/* --- BARRA DE NAVEGACIÓN CON ANIMACIÓN FLUIDA --- */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 70px;
    background-color: #ffffff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.04);
    z-index: 1000;
}

.nav-container {
    max-width: 1100px;
    height: 100%;
    margin: 0 auto;
    display: flex;
    align-items: center;
    padding: 0 2rem;
}

/* Perfil miniatura colapsado e invisible inicialmente */
.nav-profile-mini {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    max-width: 0;
    opacity: 0;
    overflow: hidden;
    white-space: nowrap;
    transition: max-width 0.5s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.4s ease;
}

.mini-profile-img {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid #e2e8f0;
}

.mini-profile-name {
    font-weight: 700;
    color: #1e293b;
    font-size: 1rem;
    letter-spacing: -0.2px;
}

/* Espaciadores dinámicos que controlan el centrado inicial */
.nav-spacer {
    max-width: 50%; /* Inicialmente empuja un 50% simulando centrado a la izquierda */
    flex-grow: 1;
    transition: max-width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- ESTADO SCROLLED (CUANDO SE ACTIVA EL TRIGGER DEL NOMBRE) --- */
/* 1. Muestra la miniatura dándole espacio */
.nav-container.scrolled .nav-profile-mini {
    opacity: 1;
    max-width: 250px; /* Ancho suficiente para la foto y nombre */
}

/* 2. El espaciador dinámico colapsa a su tamaño mínimo para empujar el menú suavemente a la derecha */
.nav-container.scrolled .nav-spacer {
    max-width: 100%; 
}

/* Menú de navegación */
.nav-menu {
    display: flex;
    list-style: none;
    align-items: center;
    gap: 1.8rem;
    white-space: nowrap;
}

.nav-menu a {
    color: #64748b;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    transition: color 0.2s ease;
}

.nav-menu a:hover {
    color: #2563eb; 
}

.nav-menu .nav-lang-btn {
    background-color: #2563eb;
    color: #ffffff;
    padding: 0.45rem 0.9rem;
    border-radius: 6px;
    font-weight: bold;
    letter-spacing: 0.5px;
}

/* --- ENCABEZADO PRINCIPAL (Hero) --- */
.hero-section { 
    background: #ffffff; 
    border-bottom: 1px solid #e2e8f0;
    padding: 4.5rem 2rem; 
}

.hero-container {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 3.5rem;
}

.hero-info-side {
    text-align: left;
}

.hero-container h1 {
    font-size: 3.2rem;
    font-weight: 800;
    color: #1e293b;
    letter-spacing: -1px;
    margin-bottom: 0.2rem;
    line-height: 1.1;
}

.subtitle {
    color: #2563eb; 
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin-bottom: 1.2rem;
}

.contact-links {
    font-size: 0.95rem;
    color: #475569;
}

.contact-item {
    margin-bottom: 0.4rem;
}

.contact-item span {
    font-weight: 600;
    color: #64748b;
}

.contact-links a {
    color: #334155;
    text-decoration: none;
    border-bottom: 1px solid #cbd5e1;
    transition: all 0.2s ease;
}

.contact-links a:hover {
    color: #2563eb;
    border-bottom-color: #2563eb;
}

.profile-img {
    width: 160px;
    height: 160px;
    border-radius: 50%; 
    object-fit: cover;  
    border: 4px solid #f1f5f9; 
    box-shadow: 0 10px 25px rgba(0,0,0,0.08);
    display: block;
}

/* --- CONTENIDO --- */
.content-wrapper {
    max-width: 900px;
    margin: 3.5rem auto;
    padding: 0 2rem;
}

.cv-card { 
    background: #ffffff;
    padding: 3rem; 
    margin-bottom: 2.5rem;
    border: 1px solid #e2e8f0;
    border-radius: 12px; 
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02), 0 2px 4px -1px rgba(0, 0, 0, 0.02);
}

h2 { 
    font-size: 1.3rem;
    color: #1e293b; 
    text-transform: uppercase;
    letter-spacing: 2px;
    border-bottom: 2px solid #2563eb; 
    padding-bottom: 0.6rem;
    margin-bottom: 2.2rem;
    font-weight: 800;
}

.objective-text {
    font-size: 1.05rem;
    color: #334155;
    text-align: justify;
}

/* --- EXPERIENCIA --- */
.job-block {
    margin-bottom: 2.5rem;
}

.job-meta {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    flex-wrap: wrap;
    margin-bottom: 0.8rem;
}

.job-block h3 {
    color: #1e293b;
    font-size: 1.2rem;
    font-weight: 700;
}

.date {
    color: #2563eb;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background-color: #eff6ff;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
}

.job-block p {
    color: #475569;
    text-align: justify;
}

/* --- ACADÉMICA --- */
.academic-timeline {
    list-style: none;
}

.academic-timeline li {
    margin-bottom: 1.8rem;
    padding-left: 1.2rem;
    border-left: 3px solid #2563eb; 
}

.academic-title {
    display: block;
    font-weight: 700;
    color: #1e293b;
    font-size: 1.05rem;
}

.academic-institution {
    display: block;
    font-size: 0.95rem;
    color: #64748b;
    margin-top: 0.2rem;
}

/* --- BADGES --- */
.badge-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-bottom: 2.2rem;
}

.badge {
    padding: 0.45rem 0.9rem;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 6px;
}

.badge.soft { background-color: #f1f5f9; color: #475569; }
.badge.tech { background-color: #1e293b; color: #ffffff; }
.badge.lang { background-color: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }

footer { 
    text-align: center; 
    padding: 3rem; 
    background: #ffffff; 
    color: #94a3b8; 
    border-top: 1px solid #e2e8f0;
    font-size: 0.85rem;
}

/* --- RESPONSIVO --- */
@media (max-width: 768px) {
    body { padding-top: 0; }
    .navbar { position: static; height: auto; padding: 1.2rem 0; }
    .nav-container { flex-direction: column; gap: 1.2rem; }
    .nav-menu { flex-wrap: wrap; justify-content: center; gap: 1.2rem; }
    .nav-spacer, .nav-profile-mini { display: none !important; } 
    .hero-container { flex-direction: column; text-align: center; gap: 2rem; }
    .hero-info-side { text-align: center; }
    .cv-card { padding: 2rem 1.5rem; }
    .job-meta { flex-direction: column; gap: 0.4rem; }
}