/* ===== Reset y base ===== */
* { box-sizing: border-box; margin: 0; padding: 0; }
html,body { height: 100%; }
body {
    font-family: 'Poppins', 'Segoe UI', sans-serif;
    background: linear-gradient(180deg,#070a12,#0b1220);
    color: #e6eefc;
    line-height: 1.5;
}

/* ===== Header ===== */
.header { text-align: center; padding: 36px 16px 8px; }
.title { color: #4c7bff; font-size: 2.6rem; letter-spacing: -0.5px; }

/* ===== Hero (foto + nombre) ===== */
.hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding: 10px 16px 22px;
}
.profile {
    width: 150px; height: 150px; border-radius: 50%;
    object-fit: cover;
    border: 4px solid #4c7bff;
    box-shadow: 0 6px 30px rgba(75,123,255,0.18);
}
.hero-info h2 { color: #4c7bff; font-size: 1.9rem; margin-bottom: 4px; }
.hero-info p { color: #b8c6ff; font-size: 1rem; }
/* =====================================================
   GRID PRINCIPAL — MEJORADO PARA QUE NO SE AMONTONE
   ===================================================== */
.cv-layout {
    width: 94%;
    max-width: 1350px;
    margin: 26px auto 40px;

    display: grid;
    grid-template-columns: 340px 1fr;    /* MÁS ESPACIO */
    gap: 34px;                           /* MÁS SEPARACIÓN */

    align-items: start;
    min-height: 0;                       /* FIX OVERFLOW */
}

/* ===== Sidebar ===== */
.sidebar {
    background: rgba(16,22,38,0.76);
    padding: 24px;
    border-radius: 14px;
    width: 100%;                        /* EVITA QUE SE ACHIQUE */
    box-shadow: 0 8px 30px rgba(3,8,23,0.6);
}
.profile-pic-container { text-align: center; margin-bottom: 10px; }
.sidebar h3 { color: #7ea6ff; margin-bottom: 8px; font-size: 0.95rem; }
.sidebar p, .sidebar li { color: #cdd9ff; font-size: 0.92rem; }

.sidebar-section {
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(76,123,255,0.06);
    margin-bottom: 14px;
}
.sidebar-section:last-child { border-bottom: none; margin-bottom: 0; }

/* ===== Main content ===== */
.main-content {
    display: flex;
    flex-direction: column;
    gap: 26px;
    width: 100%;
    min-width: 0;                       /* CRUCIAL PARA EVITAR AMONTONAMIENTO */
}

/* ===== Tarjetas derecha ===== */
.cv-section {
    background: linear-gradient(180deg, rgba(18,26,46,0.82), rgba(15,22,38,0.82));
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(2,6,20,0.6);
    transition: .22s ease;
}
.cv-section:hover {
    transform: translateY(-4px);
    box-shadow: 0 18px 40px rgba(75,123,255,0.12);
}

.section-title {
    color: #4c7bff;
    font-size: 1.3rem;
    margin-bottom: 12px;
    border-bottom: 1px solid rgba(76,123,255,0.06);
    padding-bottom: 8px;
}

/* =====================================================
   CARD GRID — OPTIMIZADO PARA NUNCA AMONTONARSE
   ===================================================== */
.card-grid {
    display: grid;
    width: 100%;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); /* MÁS AMPLIO */
    gap: 18px;                                                    /* MÁS ESPACIO */
    margin-top: 10px;
}

.card {
    background: rgba(10,16,30,0.45);
    padding: 16px;
    border-radius: 10px;
    border: 1px solid rgba(76,123,255,0.04);
    color: #d8e6ff;
}
.card h3 { color: #cfe0ff; margin-bottom: 6px; font-size: 1rem; }
.card p { color: #c7d6ff; font-size: 0.95rem; }

/* ===== Skill chips ===== */
.skill-card {
    text-align: center;
    padding: 12px 10px;
    border-radius: 10px;
    background: rgba(18,28,48,0.6);
    border: 1px solid rgba(76,123,255,0.08);
    font-weight: 600;
    color: #dbe8ff;
    transition: .16s ease;
}
.skill-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 10px 26px rgba(75,123,255,0.09);
}

/* ===== Footer ===== */
.footer { text-align: center; color: #9fb0ff; margin: 30px 0 60px; }

/* ===== Fade-in animation ===== */
.fade-in { opacity: 0; transform: translateY(18px); animation: fadeInUp .8s forwards; }
@keyframes fadeInUp { to { opacity: 1; transform: translateY(0); } }

/* =====================================================
   RESPONSIVE FINAL — FIJANDO QUE TODO SE ACOMODE BIEN
   ===================================================== */
@media (max-width: 1100px) {
    .cv-layout {
        grid-template-columns: 280px 1fr;
        gap: 28px;
    }
}

@media (max-width: 900px) {
    .cv-layout {
        grid-template-columns: 1fr;
    }
    .sidebar {
        max-width: 600px;
        margin: 0 auto;
    }
}

@media (max-width: 500px) {
    .profile { width: 120px; height: 120px; }
    .card-grid { grid-template-columns: 1fr; }
}

.cv-button {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 26px;
    border-radius: 10px;
    background: #4c7bff;
    color: #ffffff;
    font-weight: 600;
    text-decoration: none;
    letter-spacing: 0.3px;

    box-shadow: 0 6px 18px rgba(76,123,255,0.25);
    transition: background .25s ease, transform .25s ease, box-shadow .25s ease;
}

.cv-button:hover {
    background: #6c8fff;
    transform: translateY(-3px);
    box-shadow: 0 10px 26px rgba(76,123,255,0.35);
}

.cv-button:active {
    transform: translateY(0);
    box-shadow: 0 4px 12px rgba(76,123,255,0.18);
}



