/* 1. Reset Básico y Tipografía */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box; /* Fundamental para layouts responsivos */
}

body {
    font-family: 'Roboto', sans-serif; /* Fuente moderna y legible */
    line-height: 1.6;
    background-color: #f4f7f6; /* Fondo suave */
    color: #333;
    scroll-behavior: smooth; /* Desplazamiento suave al hacer clic en el menú */
}

/* 2. Estilos del Encabezado y Menú de Navegación */
header {
    background-color: #2c3e50; /* Color oscuro profesional */
    color: white;
    padding: 15px 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky; /* Menú pegajoso en la parte superior */
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.logo {
    font-size: 1.5em;
    font-weight: 700;
}

nav ul {
    list-style: none;
    display: flex;
}

nav ul li {
    margin-left: 25px;
}

nav ul li a {
    text-decoration: none;
    color: white;
    font-weight: 400;
    transition: color 0.3s ease;
}

nav ul li a:hover {
    color: #3498db; /* Color de realce al pasar el ratón */
}

/* 3. Estilos de la Sección Principal (Proyectos) */
main {
    padding: 20px 5%;
    max-width: 1200px;
    margin: 0 auto; /* Centra el contenido */
}

h1 {
    text-align: center;
    margin-bottom: 40px;
    color: #2c3e50;
    font-size: 2.2em;
}

.proyectos-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); /* Layout responsivo de cuadrícula */
    gap: 30px;
}

.proyecto-card {
    background-color: white;
    border-radius: 8px;
    padding: 25px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-left: 5px solid #3498db; /* Borde de color para destacar */
}

.proyecto-card:hover {
    transform: translateY(-5px); /* Efecto sutil al pasar el ratón */
    box-shadow: 0 8px 12px rgba(0, 0, 0, 0.15);
}

.proyecto-card h2 {
    color: #3498db;
    margin-bottom: 10px;
}

.proyecto-card p {
    margin-bottom: 20px;
}

.enlace-proyecto, .enlace-codigo {
    display: inline-block;
    padding: 8px 15px;
    margin-right: 10px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.9em;
    font-weight: 700;
    transition: background-color 0.3s ease;
}

.enlace-proyecto {
    background-color: #3498db;
    color: white;
}

.enlace-proyecto:hover {
    background-color: #2980b9;
}

.enlace-codigo {
    background-color: #ecf0f1;
    color: #2c3e50;
    border: 1px solid #bdc3c7;
}

.enlace-codigo:hover {
    background-color: #bdc3c7;
}

/* 4. Estilos de Secciones Adicionales (Sobre Mí, Contacto) */
.info-section {
    padding: 60px 0;
    border-top: 1px solid #ddd;
    margin-top: 40px;
}

.info-section h2 {
    font-size: 1.8em;
    color: #2c3e50;
    margin-bottom: 15px;
}

/* 5. Pie de Página */
footer {
    text-align: center;
    padding: 20px 5%;
    background-color: #2c3e50;
    color: #bdc3c7;
    margin-top: 40px;
    font-size: 0.9em;
}

/* 6. Media Queries para Responsividad (Móviles) */
@media (max-width: 768px) {
    header {
        flex-direction: column;
        text-align: center;
        padding: 15px 5%;
    }

    .logo {
        margin-bottom: 10px;
    }

    nav ul {
        justify-content: center;
        flex-wrap: wrap;
    }

    nav ul li {
        margin: 5px 10px;
    }

    .proyectos-container {
        grid-template-columns: 1fr; /* Una columna en dispositivos pequeños */
    }
}