/* Variables de Color y Fuentes */
:root {
    --primary-bg: #121212; /* Negro profundo */
    --secondary-bg: #1E1E1E; /* Un gris oscuro para elementos como cards */
    --accent-guinda: #9F1010; /* Guinda principal */
    --accent-guinda-hover: #BF2A2A; /* Guinda para hover */
    --text-primary: #F5F5F5; /* Blanco/Gris muy claro */
    --text-secondary: #B0B0B0; /* Gris claro para subtítulos */
    --text-logo: #FFFFFF;
    --border-color: #333333; /* Bordes sutiles */

    --font-primary: 'Montserrat', sans-serif;
    --font-secondary: 'Open Sans', sans-serif;
    --box-shadow-light: rgba(159, 16, 16, 0.2); /* Sombra guinda sutil */
    --box-shadow-strong: rgba(159, 16, 16, 0.5);
}

/* Reseteo Básico */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-secondary);
    line-height: 1.7;
    color: var(--text-primary);
    background-color: var(--primary-bg);
    overflow-x: hidden;
}

/* Hero Section */
.hero {
    height: 100vh;
    color: var(--text-primary);
    display: flex;
    flex-direction: column;
    position: relative;
}

#particles-js {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: 1;
    background-color: var(--primary-bg); /* Fondo para particles */
}

/* Navbar */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 5%;
    background-color: transparent;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    transition: background-color 0.4s ease, box-shadow 0.4s ease;
}

.navbar.scrolled {
    background-color: rgba(18, 18, 18, 0.85); /* Negro semi-transparente */
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 15px rgba(0,0,0,0.3);
}

.logo {
    font-family: var(--font-primary);
    font-size: 2rem;
    font-weight: 900; /* Más grueso */
    color: var(--text-logo);
    letter-spacing: 1px;
}

.nav-links {
    list-style: none;
    display: flex;
}

.nav-links li {
    margin-left: 2.5rem; /* Más espaciado */
}

.nav-links a {
    text-decoration: none;
    color: var(--text-primary);
    font-family: var(--font-primary);
    font-weight: 600;
    font-size: 0.95rem;
    letter-spacing: 0.5px;
    transition: color 0.3s ease;
    position: relative; /* Para el efecto underline */
}

.nav-links a::after { /* Efecto underline sutil */
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    display: block;
    margin-top: 5px;
    right: 0;
    background: var(--accent-guinda);
    transition: width 0.3s ease;
    -webkit-transition: width 0.3s ease;
}

.nav-links a:hover {
    color: var(--accent-guinda);
}

.nav-links a:hover::after {
    width: 100%;
    left: 0;
    background: var(--accent-guinda-hover);
}

.burger {
    display: none;
    cursor: pointer;
}

.burger div {
    width: 28px; /* Ligeramente más grande */
    height: 3px;
    background-color: var(--text-primary);
    margin: 5px;
    transition: all 0.3s ease;
    border-radius: 2px;
}


/* Hero Content */
.hero-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    flex-grow: 1;
    padding: 0 2rem;
    z-index: 2;
}

.hero-content h1 {
    font-family: var(--font-primary);
    font-size: clamp(2.5rem, 6vw, 4.0rem); /* Ligeramente ajustado para nombre largo */
    margin-bottom: 0.8rem;
    font-weight: 700;
    letter-spacing: 1px;
    animation: fadeInDown 1s ease-out;
    color: var(--text-primary);
}

.hero-content p#subtitle {
    font-family: var(--font-secondary);
    font-size: clamp(1.1rem, 3vw, 1.5rem);
    margin-bottom: 2.5rem;
    font-weight: 400;
    color: var(--text-secondary);
    animation: fadeInUp 1s ease-out 0.5s;
    animation-fill-mode: backwards;
    min-height: 50px; /* Espacio para el typed.js */
}

.highlight-ai {
    color: var(--accent-guinda);
    font-weight: 700;
}

.cta-button {
    background-color: var(--accent-guinda);
    color: white;
    padding: 0.9rem 2.2rem;
    text-decoration: none;
    border-radius: 50px;
    font-family: var(--font-primary);
    font-weight: 700;
    font-size: 1rem;
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
    box-shadow: 0 5px 20px var(--box-shadow-light);
    animation: pulse 2s infinite 1s;
    border: 2px solid var(--accent-guinda); /* Borde del mismo color */
}

.cta-button i {
    margin-left: 0.7rem;
    transition: transform 0.3s ease;
}

.cta-button:hover {
    background-color: var(--accent-guinda-hover);
    border-color: var(--accent-guinda-hover);
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 8px 25px var(--box-shadow-strong);
}

.cta-button:hover i {
    transform: translateX(6px);
}

/* Secciones Generales */
.section {
    padding: 80px 5%;
    text-align: center;
}
.section:nth-child(even) { /* Alternar color de fondo sutilmente */
    background-color: var(--primary-bg);
}
.section:nth-child(odd) {
    background-color: var(--secondary-bg);
}

.section h2 {
    font-family: var(--font-primary);
    font-size: clamp(2rem, 5vw, 2.8rem);
    margin-bottom: 1.5rem;
    color: var(--text-primary);
    position: relative;
    display: inline-block;
    font-weight: 700;
}

.section h2::after {
    content: '';
    display: block;
    width: 70px;
    height: 4px;
    background-color: var(--accent-guinda);
    margin: 0.8rem auto 3rem;
    border-radius: 2px;
}

.section-subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 700px;
    margin: -3rem auto 3rem;
}

/* Sobre Mí (NUEVO) */
.sobre-mi-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    align-items: center;
    max-width: 900px;
    margin: 0 auto;
    text-align: left;
}

/* --- INICIO DE LA MODIFICACIÓN --- */

/* Ajuste para el grid en pantallas grandes para compensar el tamaño de la foto */
@media (min-width: 768px) {
    .sobre-mi-container {
        grid-template-columns: 300px 1fr; /* Ajusta el ancho de la columna de la imagen */
        gap: 3.5rem; /* Aumenta el espacio entre la foto y el texto */
    }
}

.profile-pic {
    width: 280px; /* Incrementado el tamaño de la imagen */
    height: 280px; /* Incrementado el tamaño de la imagen */
    border-radius: 50%;
    object-fit: cover;
    border: 6px solid var(--accent-guinda); /* Borde ligeramente más grueso */
    box-shadow: 0 0 35px var(--box-shadow-light); /* Sombra un poco más prominente */
    margin: 0 auto; /* Centrar en móvil */
}

/* --- FIN DE LA MODIFICACIÓN --- */


.sobre-mi-texto h3 {
    font-family: var(--font-primary);
    color: var(--text-primary);
    font-size: 1.7rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.sobre-mi-texto p {
    font-size: 1.05rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.sobre-mi-texto strong, .sobre-mi-texto b {
    color: var(--text-primary);
    font-weight: 600;
}

/* --- Proyectos (NUEVO ACORDEÓN) --- */
.project-accordion {
    max-width: 900px;
    margin: 2rem auto 0;
    text-align: left;
}

.project-item {
    background: var(--secondary-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 1rem;
    overflow: hidden; /* Clave para el acordeón */
}

.project-header {
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--border-color); /* Separador sutil */
    color: var(--text-primary);
    padding: 1.5rem;
    width: 100%;
    text-align: left;
    cursor: pointer;
    font-family: var(--font-primary);
    
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.3s ease;
}
.project-item:last-child .project-header {
    border-bottom: none;
}

.project-header:hover {
    background-color: rgba(255, 255, 255, 0.03);
}

.project-header-title {
    display: flex;
    flex-direction: column;
}

.project-header h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    color: var(--text-primary);
}

.project-summary {
    font-family: var(--font-secondary);
    font-size: 1rem;
    color: var(--text-secondary);
    font-weight: 400;
    margin-top: 0.25rem;
}

.project-header i {
    font-size: 1.2rem;
    color: var(--accent-guinda);
    transition: transform 0.4s ease;
}

.project-header.active i {
    transform: rotate(180deg);
}

.project-content {
    background: #161616; /* Ligeramente más oscuro que el fondo de la card */
    padding: 0 1.5rem;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s ease-out, padding 0.5s ease-out;
}

.project-content.active {
    max-height: 1000px; /* Valor grande para permitir que se expanda */
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.project-content p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.project-content p strong {
    color: var(--text-primary);
    font-weight: 700;
}

.project-content ul {
    list-style-type: disc;
    list-style-position: inside;
    margin-bottom: 1rem;
    margin-left: 1rem;
    color: var(--text-secondary);
}

.project-content ul li {
    margin-bottom: 0.5rem;
}

.project-content ul li strong {
    color: var(--text-primary);
}


/* Tecnologías */
.tech-icons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2rem;
    margin-top: 2rem;
}

.tech-icon {
    font-size: 3.5rem; /* Iconos más grandes */
    color: var(--text-secondary);
    transition: color 0.3s ease, transform 0.3s ease;
    position: relative; /* Para el tooltip */
}

.tech-icon:hover {
    color: var(--accent-guinda);
    transform: scale(1.2);
}

/* Tooltip para iconos de tecnología */
.tech-icon::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-5px); /* Ajustar posicionamiento */
    background-color: var(--accent-guinda);
    color: white;
    padding: 0.4rem 0.8rem;
    border-radius: 5px;
    font-size: 0.8rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 10;
}

.tech-icon:hover::before {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-10px); /* Efecto de subida */
}


/* Contacto y Social Icons */
#contacto p {
    max-width: 600px;
    margin: 0 auto;
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.social-icons {
    margin-top: 2.5rem;
}

.social-icons a {
    color: var(--text-secondary);
    font-size: 2.5rem;
    margin: 0 1.2rem;
    transition: color 0.3s ease, transform 0.3s ease;
    position: relative; /* Para tooltip */
}

.social-icons a:hover {
    color: var(--accent-guinda);
    transform: translateY(-5px);
}
/* Tooltip para iconos sociales (similar a tech-icon) */
.social-icons a::before {
    content: attr(data-tooltip);
    position: absolute;
    top: -35px; /* Ajuste para que aparezca arriba */
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--accent-guinda);
    color: white;
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}
.social-icons a:hover::before {
    opacity: 1;
    visibility: visible;
}


/* Footer */
footer {
    background-color: #0A0A0A; /* Un negro aún más oscuro para el footer */
    color: var(--text-secondary);
    text-align: center;
    padding: 2.5rem 0;
    font-size: 0.9rem;
    border-top: 1px solid var(--border-color);
}
footer p {
    letter-spacing: 0.5px;
}

/* Animaciones */
@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-30px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 var(--box-shadow-light); }
    70% { box-shadow: 0 0 0 20px rgba(159, 16, 16, 0); } /* Guinda transparente */
    100% { box-shadow: 0 0 0 0 rgba(159, 16, 16, 0); }
}


/* Responsive (Menú Hamburguesa) */
@media screen and (max-width: 768px) {
    .nav-links {
        position: fixed; /* Cambiado a fixed para cubrir toda la pantalla */
        right: 0px;
        height: 100vh;
        top: 0;
        background-color: rgba(18, 18, 18, 0.98); /* Fondo oscuro para el menú móvil */
        backdrop-filter: blur(5px);
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center; /* Centrar verticalmente los links */
        width: 100%; /* Ocupa toda la pantalla */
        transform: translateX(100%);
        transition: transform 0.5s ease-in-out;
        padding-top: 0;
    }

    .nav-links li {
        opacity: 0;
        margin-left: 0;
        margin-bottom: 2.5rem; /* Más espaciado */
    }

    .nav-links a {
        font-size: 1.3rem; /* Links más grandes en móvil */
        color: var(--text-primary); /* Asegurar que sean visibles */
    }
    .nav-links a:hover {
        color: var(--accent-guinda);
    }
    .nav-links a::after { /* Deshabilitar underline en móvil si se desea o ajustar */
        display: none;
    }

    .burger {
        display: block;
        z-index: 1001; /* Encima del nav-links */
        position: fixed; /* Para que no se mueva con el scroll del hero */
        top: 1.7rem;
        right: 5%;
    }
    .burger div {
      background-color: var(--text-primary); /* Siempre visibles */
    }

    .navbar.scrolled .burger div { /* Mantiene el color de las líneas del burger */
        background-color: var(--text-primary);
    }


    .hero-content h1 {
        font-size: clamp(2rem, 10vw, 2.5rem); /* Ajustado para nombre largo */
    }
    .hero-content p#subtitle {
        font-size: clamp(1rem, 5vw, 1.2rem);
    }

    .project-header h3 {
        font-size: 1.2rem;
    }
    .project-summary {
        font-size: 0.9rem;
    }

    .nav-active {
        transform: translateX(0%);
    }

    @keyframes navLinkFade {
        from {
            opacity: 0;
            transform: translateX(50px);
        }
        to {
            opacity: 1;
            transform: translateX(0px);
        }
    }

    .toggle .line1 {
        transform: rotate(-45deg) translate(-6px, 7px);
    }
    .toggle .line2 {
        opacity: 0;
    }
    .toggle .line3 {
        transform: rotate(45deg) translate(-6px, -7px);
    }
}
/* --- ESTILOS PARA LAS NUEVAS ETIQUETAS DE PROYECTO --- */
.project-content .project-tags {
    margin-top: 1.5rem; /* Espacio antes de las etiquetas */
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    display: flex; /* Para que las etiquetas se alineen */
    flex-wrap: wrap; /* Para que se ajusten si son muchas */
}

.project-content .project-tags span {
    display: inline-block;
    background-color: rgba(159, 16, 16, 0.15); /* Guinda muy transparente */
    color: var(--accent-guinda);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
    font-family: var(--font-primary);
}