* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --recursos: #FEFEFC;
    --bg-color: #5ec280;
    --titulos: #8d7412;
    --izq-bg-start: #27ab8a5d;
    --izq-bg-end: #00928db2;
    --texto: #333333;
    --subtexto: #666666;
    --hover-color: #dc801d;
    --sombra-fuerte: #00000040;
    --sombra-suave: #00000026;
    --caja-bg: #bae6c782;
    --deco-caja: #00928d5e;
    --sombra-barra: #857c612b;
    --barra-skills: linear-gradient(90deg, #8d7412 0%, #ffe081 100%);
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--bg-color);
    background-image: 
        linear-gradient(var(--deco-caja) 2px, transparent 1px),
        linear-gradient(90deg, var(--deco-caja) 2px, transparent 1px);
    background-size: 40px 40px;
    background-attachment: fixed;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    min-height: 100vh;
    padding: 40px 20px;
    color: var(--texto);
}

.contenedorPrincipal {
    background-color: var(--recursos);
    width: 100%;
    max-width: 1000px; 
    border-radius: 20px;
    box-shadow: 0 20px 50px var(--sombra-fuerte), 0 5px 15px var(--sombra-suave);
    display: flex; 
    flex-wrap: nowrap;
    overflow: hidden;
}

header {
    flex: 0 0 300px; 
    background: linear-gradient(180deg, var(--izq-bg-start) 0%, var(--izq-bg-end) 100%);
    display: flex;
}

.zonaIzquierda {
    width: 100%;
    padding: 40px 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.contImgPerfil {
    width: 150px;
    height: 150px;
    background-color: white;
    border-radius: 50%;
    box-shadow: 0 4px 10px var(--sombra-suave);
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.imgPerfil {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 5px;
}

.subtitulo {
    font-size: 0.9rem;
    color: var(--subtexto);
    margin-bottom: 40px;
}

.botonesContacto {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.boton {
    text-decoration: none;
    background-color: var(--recursos);
    color: var(--titulos);
    padding: 12px;
    border-radius: 30px;
    font-weight: 500;
    box-shadow: 0 2px 5px var(--sombra-suave);
    transition: transform 0.2s, box-shadow 0.2s;
    font-size: 0.9rem;
}

.boton:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px var(--sombra-suave);
    color: var(--hover-color);
}

.contenido {
    flex: 1;
    padding: 40px 50px;
    background-color: var(--recursos);
}

.secciones {
    margin-bottom: 40px;
}

.tituloSeccion {
    font-size: 1.3rem;
    color: var(--titulos);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
}

.tituloSeccion::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 20px;
    background-color: var(--titulos);
    margin-right: 10px;
    border-radius: 2px;
}

.textoSeccion {
    font-size: 0.91rem;
    color: var(--texto);
    line-height: 1.5;
}

.contenedorCaja {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.caja {
    background-color: var(--caja-bg);
    border-radius: 12px;
    padding: 20px;
    flex: 1 1 calc(50% - 20px);
    min-width: 250px;
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.caja:hover {
    transform: translate(-6px, -6px); 
    box-shadow: 6px 6px 0px var(--titulos);
}

.caja h3 {
    font-size: 1rem;
    margin-bottom: 8px;
    color: var(--texto);
}

.fechaCaja, .subtCaja {
    font-size: 0.9rem;
    color: var(--subtexto);
}

.decoCaja {
    position: absolute;
    bottom: -20px;
    right: -20px;
    width: 55px;
    height: 55px;
    border: 6px solid var(--deco-caja); 
    border-radius: 50%;
    z-index: 0;
    transition: all 0.4s ease;
}

.caja:hover .decoCaja {
    transform: scale(1.2) translate(-4px, -4px);
    border-color: var(--hover-color);
}

.contenedorSkills {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 20px;
}

.filaSkills {
    display: contents;
}

.itemSkill {
    flex: 1 1 calc(50% - 20px);
    min-width: 250px;
}

.nombreSkill {
    display: block;
    font-size: 0.90rem;
    font-weight: 600;
    margin-bottom: 5px;
    color: var(--texto);
}

.barraProgreso {
    width: 100%;
    height: 8px;
    background-color: var(--sombra-barra);
    border-radius: 4px;
    overflow: hidden;
}

.progreso {
    height: 100%;
    background: var(--barra-skills);
    border-radius: 4px;
    animation: llenarBarra 1.5s ease-out forwards;
    animation-delay: 0.5s; 
    width: 0;
}

@keyframes llenarBarra {
    from {
        width: 0;
    }
}

.progreso.html { width: 75%; }
.progreso.java { width: 50%; }
.progreso.photoshop { width: 95%; }
.progreso.sql { width: 60%; }
.progreso.premier { width: 85%; }
.progreso.office { width: 80%; }

.contenedorHabilidades {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}

.habilidades {
    background: linear-gradient(90deg, var(--izq-bg-start) 60%, var(--izq-bg-end) 100%);
    color: var(--texto);
    padding: 10px 25px;
    border-radius: 30px;
    font-size: 0.9rem;
    text-align: center;
    flex: 1 1 auto;
    box-shadow: 0 2px 5px var(--sombra-suave);
}

footer {
    background-color: var(--recursos);
    width: 100%;
    max-width: 1000px;
    margin-top: 30px;
    padding: 25px 40px;
    border-radius: 20px;
    box-shadow: 0 20px 50px var(--sombra-fuerte), 0 5px 15px var(--sombra-suave);
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

footer p {
    font-size: 1rem;
    color: var(--subtexto);
    margin: 0;
}

.enlacesFooter {
    display: flex;
    gap: 15px;
}

.enlacesFooter a {
    text-decoration: none;
    color: var(--texto);
    font-size: 1rem;
    transition: color 0.2s ease;
}

.enlacesFooter a:hover {
    color: var(--hover-color);
}

/* =========================================
   ESTILOS PARA MÓVIL (Media Query)
   ========================================= */
@media (max-width: 768px) {
    
    .contenedorPrincipal {
        flex-direction: column; /* Apila el header arriba y el contenido abajo */
    }

    header {
        flex: none;
        width: 100%; /* El header ocupa todo el ancho */
    }

    .zonaIzquierda {
        padding: 30px 20px; /* Menos padding en móvil para que no sea eterno */
    }

    .contenido {
        padding: 30px 20px; /* Reducimos el espacio lateral en móvil */
    }

    /* Las cajas ocupan el 100% en móvil */
    .caja {
        flex: 1 1 100%;
    }

    /* Las skills se ponen una debajo de otra */
    .filaSkills {
        flex-direction: column;
        gap: 20px;
    }
    
    /* El footer se vuelve vertical y centrado */
    footer {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
}