/*
=====================================================
1. Variables y Reset Básico
=====================================================
*/
:root {
    /* Paleta de Colores */
    --color-primary: #007BFF; /* Azul Brillante - Accent */
    --color-secondary: #0056b3; /* Azul Oscuro - Hover */
    --color-dark: #212529; /* Casi Negro - Texto y Fondo Footer */
    --color-light: #f8f9fa; /* Blanco Roto - Fondo principal */
    --color-text: #495057; /* Gris Oscuro - Texto General */
    --color-shadow: rgba(0, 0, 0, 0.1);

    /* Tipografía */
    --font-heading: 'Montserrat', sans-serif;
    --font-body: 'Roboto', sans-serif;
}

/* Importa Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@600;700&family=Roboto:wght@300;400;500&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px; /* Base para rem */
}

body {
    font-family: var(--font-body);
    color: var(--color-text);
    background-color: var(--color-light);
    line-height: 1.6;
}

/*
=====================================================
2. Tipografía y Encabezados
=====================================================
*/
h1, h2, h3 {
    font-family: var(--font-heading);
    color: var(--color-dark);
    margin-bottom: 0.5em;
}

h2 {
    font-size: 2.2rem;
    text-align: center;
    margin-bottom: 1.5em;
    position: relative;
}

/* Línea de énfasis bajo los títulos de sección */
h2::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background-color: var(--color-primary);
    margin: 8px auto 0;
    border-radius: 2px;
}

/*
=====================================================
3. Navegación (Header y Navbar)
=====================================================
*/
header {
    background-color: #ffffff; /* Fondo blanco para contraste */
    box-shadow: 0 2px 10px var(--color-shadow);
    position: sticky; /* Fija la barra en la parte superior */
    top: 0;
    z-index: 1000;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 1.5rem;
}

.logo a {
    font-size: 1.8rem;
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 700;
}

.nav-links {
    list-style: none;
    display: none; /* Oculto por defecto en móviles */
}

.nav-links a {
    text-decoration: none;
    color: var(--color-dark);
    font-weight: 500;
    padding: 0.5rem 1rem;
    transition: color 0.3s;
}

.nav-links a:hover {
    color: var(--color-primary);
}


/*
=====================================================
4. Botones y Llamadas a la Acción (CTA)
=====================================================
*/
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 600;
    margin: 0.5rem 0;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
    border: 2px solid transparent;
}

.primary-btn {
    background-color: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
}

.primary-btn:hover {
    background-color: var(--color-secondary);
    border-color: var(--color-secondary);
    transform: translateY(-2px);
}

.secondary-btn {
    background-color: transparent;
    color: var(--color-primary);
    border-color: var(--color-primary);
}

.secondary-btn:hover {
    background-color: var(--color-primary);
    color: white;
    transform: translateY(-2px);
}

.outline-btn {
    background-color: transparent;
    color: var(--color-text);
    border-color: var(--color-text);
}

.outline-btn:hover {
    background-color: var(--color-text);
    color: white;
}

/*
=====================================================
5. Disposición General
=====================================================
*/
main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

section {
    padding: 4rem 0;
}

/*
=====================================================
6. Sección HERO (Inicio)
=====================================================
*/
.hero {
    display: flex;
    flex-direction: column-reverse; /* Imagen abajo en móvil */
    align-items: center;
    text-align: center;
    gap: 2rem;
    padding-top: 2rem;
}

.hero-content h1 {
    font-size: 3rem;
    line-height: 1.1;
    margin-bottom: 0.2em;
}

.hero-content h2 {
    font-size: 1.5rem;
    color: var(--color-primary);
    margin-bottom: 1rem;
}

.hero-image img {
    width: 250px;
    height: 250px;
    object-fit: cover;
    border-radius: 50%; /* Imagen circular */
    border: 5px solid var(--color-primary);
    box-shadow: 0 4px 15px var(--color-shadow);
}

/*
=====================================================
7. Sección Sobre Mí
=====================================================
*/
.about {
    background-color: white; /* Fondo blanco sutil */
    border-radius: 8px;
    padding: 4rem 1.5rem;
    box-shadow: 0 0 20px var(--color-shadow);
    margin: 2rem 0;
}

.about-content p {
    margin-bottom: 1rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.details {
    list-style: none;
    padding-top: 1rem;
    max-width: 600px;
    margin: 0 auto;
    text-align: left;
}

.details li {
    padding: 0.3rem 0;
}

/*
=====================================================
8. Sección Habilidades
=====================================================
*/
.skills-container {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: 1fr; /* Una columna en móvil */
    text-align: center;
}

.skill-category {
    background-color: white;
    padding: 2rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 10px var(--color-shadow);
    transition: transform 0.3s;
}

.skill-category:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px var(--color-shadow);
}

.skill-category h3 {
    color: var(--color-primary);
    font-size: 1.4rem;
    margin-bottom: 1rem;
}

.skill-list {
    list-style: none;
    font-size: 1rem;
}

.skill-list li {
    padding: 0.3rem 0;
    border-bottom: 1px dashed #eee;
}

.skill-list li:last-child {
    border-bottom: none;
}

/*
=====================================================
9. Sección Proyectos
=====================================================
*/
.projects {
    background-color: var(--color-light);
}

.projects-grid {
    display: grid;
    grid-template-columns: 1fr; /* Una columna en móvil */
    gap: 2rem;
}

.project-card {
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 15px var(--color-shadow);
    transition: box-shadow 0.3s;
}

.project-card:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.project-card img {
    width: 100%;
    height: auto;
    object-fit: cover;
    aspect-ratio: 16 / 9; /* Relación de aspecto común para miniaturas */
}

.project-card h3 {
    font-size: 1.5rem;
    padding: 1rem 1rem 0;
}

.project-description, .project-tech {
    padding: 0 1rem;
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
}

.project-tech {
    color: var(--color-primary);
    font-weight: 500;
}

.project-links {
    padding: 1rem;
    display: flex;
    gap: 10px;
}

.small-btn {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

/*
=====================================================
10. Sección Contacto
=====================================================
*/
.contact {
    text-align: center;
}

.contact-form {
    max-width: 600px;
    margin: 2rem auto;
    background-color: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 0 15px var(--color-shadow);
}

.form-group {
    text-align: left;
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-family: var(--font-body);
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--color-primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
}

.submit-btn {
    width: 100%;
    margin-top: 1rem;
}

.contact-social {
    margin-top: 2rem;
}

.contact-social a {
    color: var(--color-dark);
    margin: 0 1rem;
    transition: color 0.3s;
}

.contact-social a:hover {
    color: var(--color-primary);
}

/*
=====================================================
11. Footer
=====================================================
*/
footer {
    background-color: var(--color-dark);
    color: var(--color-light);
    padding: 1.5rem 0;
    text-align: center;
}

.footer-content a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color 0.3s;
}

.footer-content a:hover {
    color: white;
}

/*
=====================================================
12. MEDIA QUERIES (Responsividad)
=====================================================
*/

/* Tablet y Escritorio Pequeño (min-width: 768px) */
@media (min-width: 768px) {
    
    /* Navbar: Mostrar links */
    .nav-links {
        display: flex;
        gap: 1.5rem;
    }

    /* Hero: Disposición en fila */
    .hero {
        flex-direction: row;
        text-align: left;
        padding-top: 6rem; /* Más espacio para que no choque con la barra fija */
    }
    
    .hero-content {
        flex: 1;
    }

    .hero-image {
        flex: 1;
        text-align: right;
    }

    .hero-content h1 {
        font-size: 4rem;
    }

    .hero-content h2 {
        font-size: 1.8rem;
    }
    
    /* Habilidades: Dos columnas */
    .skills-container {
        grid-template-columns: repeat(3, 1fr);
    }
    
    /* Proyectos: Dos columnas */
    .projects-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Escritorio Grande (min-width: 1024px) */
@media (min-width: 1024px) {
    
    .hero-content h1 {
        font-size: 4.5rem;
    }

    /* Proyectos: Tres columnas */
    .projects-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}