/* --- Data-Themed Dark Professional Style v4.1 (Fix) --- */

/* Estilos Generales */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    background-color: #1a1a2e;
    color: #e0e0e0;
    overflow-x: hidden;
}

main {
    max-width: 800px;
    margin: 20px auto;
    padding: 0 20px;
    animation: fadeIn 1s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Encabezado */
header {
    background-color: transparent;
    padding: 3rem 1rem;
    text-align: center;
    border-bottom: 1px solid #0d3d56;
}

header h1 { margin: 0; font-size: 2.8rem; color: #ffffff; }
header h2 {
    margin: 10px auto 0 auto;
    font-weight: 300;
    font-size: 1.2rem;
    color: #4dd0e1;
    display: inline-block;
    overflow: hidden;
    white-space: nowrap;
    border-right: .15em solid #4dd0e1;
    width: 100%;
    animation: blink-caret .75s step-end infinite;
}

@keyframes blink-caret {
  from, to { border-color: transparent }
  50% { border-color: #4dd0e1; }
}

.foto-perfil {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    border: 4px solid #4dd0e1;
    object-fit: cover;
    margin-bottom: 20px;
    box-shadow: 0 0 15px rgba(77, 208, 225, 0.4);
}

/* Secciones Generales */
section {
    background-color: #1f2833;
    margin-bottom: 25px;
    padding: 25px;
    border-radius: 8px;
    border: 1px solid #2c3e50;
    transition: all 0.3s ease-in-out;
}

section:not(#proyectos):hover {
    border-color: #4dd0e1;
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(77, 208, 225, 0.25);
}

section h3 {
    border-bottom: 2px solid #4dd0e1;
    padding-bottom: 10px;
    margin-top: 0;
    color: #ffffff;
    font-size: 1.5rem;
}

/* --- Estilos para la Rejilla de Proyectos --- */
#proyectos {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around;
    gap: 20px;
}

#proyectos h3 {
    width: 100%;
    margin-bottom: 15px;
}

.proyecto-flip-container {
    background-color: transparent;
    width: 230px;
    height: 230px;
    perspective: 1000px;
}

.proyecto-flipper {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.proyecto-flip-container:hover .proyecto-flipper {
    transform: rotateY(180deg);
}

.proyecto-front, .proyecto-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 15px;
    box-sizing: border-box;
    border-radius: 8px;
    border: 1px solid #2c3e50;
    background-color: #1f2833;
}

.proyecto-back {
    transform: rotateY(180deg);
}

.proyecto-front h4, .proyecto-back h4 {
    margin-top: 0;
    margin-bottom: 8px; /* Reducido para dar espacio */
    color: #4dd0e1;
    font-size: 1.1rem;
}

.proyecto-front p {
    font-size: 0.85rem;
    margin: 4px 0; /* Añadido para controlar el espacio vertical */
}

.github-link {
    display: inline-block;
    padding: 10px 20px;
    background-color: #4dd0e1;
    color: #1a1a2e;
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
    transition: background-color 0.3s, transform 0.3s;
}

.github-link:hover {
    background-color: #ffffff;
    transform: scale(1.05);
}
/* --- Fin Estilos de Rejilla --- */

/* Habilidades */
#habilidades ul { list-style-type: none; padding: 0; }
#habilidades li {
    display: inline-block;
    background-color: #0d3d56;
    color: #cdeaf1;
    padding: 8px 15px;
    margin: 5px 5px 5px 0;
    border-radius: 5px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.95rem;
    transition: background-color 0.3s ease;
}
#habilidades li:hover { background-color: #4dd0e1; color: #1a1a2e; }

/* Contacto */
#contacto a { color: #4dd0e1; text-decoration: none; font-weight: bold; transition: color 0.3s ease; }
#contacto a:hover { color: #ffffff; text-decoration: underline; }

/* Pie de página */
footer { text-align: center; padding: 20px; margin-top: 40px; font-size: 0.9rem; color: #8892b0; }