/* ========= Variables y Estilos Globales ========= */

:root {
    --bg-dark: #111827;
    --bg-medium: #1F2937;
    --bg-light: #374151;
    --text-light: #F9FAFB;
    --text-gray: #D1D5DB;
    --accent-green: #10b981;
    /* Verde esmeralda */
    --accent-green-dark: #059669;
    /* Verde más oscuro */
    --glow-color: rgba(16, 185, 129, 0.4);
    /* Resplandor verde */

    /* CAMBIO: Añadimos los colores de fondo como variables RGBA para la transparencia */
    --bg-medium-rgba: rgba(31, 41, 55, 0.6);
    --bg-light-rgba: rgba(55, 65, 81, 0.1);
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-light);
    font-family: 'Poppins', sans-serif;
    overflow-x: hidden;
    position: relative;
}


/* ========= Fondo de Estrellas Animado ========= */

@keyframes move-stars {
    from {
        transform: translateY(0px);
    }
    to {
        transform: translateY(-2000px);
    }
}

.stars-bg,
.stars-bg-2 {
    position: fixed; /* CAMBIO: de 'absolute' a 'fixed' para que las estrellas no se desplacen con el scroll */
    top: 0;
    left: 0;
    right: 0;
    height: 2000px;
    background-repeat: repeat;
    background-size: cover;
    z-index: -1;
    animation: move-stars 150s linear infinite;
}

.stars-bg {
    background-image: url('https://www.transparenttextures.com/patterns/stardust.png');
    /* CAMBIO: Opacidad ajustada para mejor legibilidad del texto */
    opacity: 0.2; /* Más sutil para un look minimalista */
}

.stars-bg-2 {
    background-image: url('https://www.transparenttextures.com/patterns/stardust.png');
    /* CAMBIO: Opacidad ajustada para mejor legibilidad del texto */
    opacity: 0.1; /* Más sutil para un look minimalista */
    animation-duration: 100s;
    animation-delay: -25s;
}


/* ========= Componentes Reutilizables ========= */

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

.section {
    padding: 100px 0;
    position: relative; /* CAMBIO: Necesario para que el z-index de los hijos funcione correctamente */
}

.section-header {
    text-align: center;
    margin-bottom: 50px;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.section-subtitle {
    font-size: 1.1rem;
    color: var(--text-gray);
}

.highlight {
    color: var(--accent-green);
}


/* ========= Header / Navegación ========= */

.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: rgba(17, 24, 39, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--bg-light);
    z-index: 1000;
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px;
}

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

.navbar {
    display: flex;
    gap: 30px;
}

.nav-link {
    color: var(--text-light);
    text-decoration: none;
    font-size: 1rem;
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-link:hover {
    color: var(--accent-green);
}


/* ========= Sección "Sobre Mí" (Hero) ========= */

#sobre-mi {
    padding-top: 150px;
}

.hero-content {
    display: flex;
    align-items: center;
    gap: 60px;
}

.hero-image-wrapper {
    flex-shrink: 0;
    position: relative;
}

.hero-image {
    width: 250px;
    height: 250px;
    border-radius: 50%;
    object-fit: cover;
    /* Eliminado: Estos estilos son manejados por las clases de Tailwind en hero-image-wrapper */
    /* border: 3px solid var(--accent-green); */
    /* box-shadow: 0 0 40px var(--glow-color); */
}

.hero-text {
    flex-grow: 1;
}

.hero-title {
    font-size: 3rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 20px;
}

.hero-description {
    font-size: 1.1rem;
    color: var(--text-gray);
    line-height: 1.7; /* Good for readability */
    margin-bottom: 35px; /* Slightly more space before social links */
}

.social-links {
    display: flex;
    flex-wrap: wrap; /* Para que se ajusten en pantallas pequeñas */
    gap: 15px;
}

.social-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background-color: transparent;
    border: 1px solid var(--bg-light);
    color: var(--text-gray);
    border-radius: 50px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.social-btn:hover {
    background-color: var(--bg-medium);
    border-color: var(--accent-green);
    color: var(--text-light);
}

.social-btn i {
    font-size: 20px;
    width: 24px;
    text-align: center;
}

/* ========= Grid para Proyectos y Experiencias ========= */

.content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
}


/* ========= ESTILO UNIFICADO PARA TODAS LAS TARJETAS (Glassmorphism) ========= */

.project-card,
.experience-card {
    /* CAMBIO: Aplicamos el fondo de cristal semi-transparente */
    background: var(--bg-medium-rgba);
    backdrop-filter: blur(8px);
    border: 1px solid var(--bg-light-rgba);
    
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
    text-decoration: none; /* Para experience-card que es un <a> */
    color: var(--text-light); /* Para experience-card que es un <a> */
}

.project-card:hover,
.experience-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent-green);
    box-shadow: 0 0 20px var(--glow-color);
}

.project-image-wrapper img,
.experience-image {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

.project-content,
.experience-content {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.project-title,
.experience-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 10px;
}

.project-description,
.experience-description {
    color: var(--text-gray);
    font-size: 0.95rem; /* Slightly larger for better readability */
    margin-bottom: 20px;
    flex-grow: 1; /* Empuja el link hacia abajo */
}

.project-link {
    display: inline-block;
    background-color: var(--accent-green);
    color: var(--bg-dark);
    padding: 8px 16px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    transition: background-color 0.3s ease;
    align-self: flex-start; /* Para que no ocupe todo el ancho */
}

.project-link:hover {
    background-color: var(--accent-green-dark);
}

.experience-link {
    font-weight: 600;
    color: var(--accent-green);
    align-self: flex-start;
}


/* ========= Footer ========= */

.footer {
    text-align: center;
    padding: 20px;
    font-size: 0.9rem;
    color: var(--text-gray);
    position: relative;
    
    /* CAMBIO: Aplicamos el fondo de cristal también al footer */
    background: var(--bg-medium-rgba);
    backdrop-filter: blur(8px);
    border-top: 1px solid var(--bg-light-rgba);
}


/* ========= Media Queries para Responsividad ========= */

@media (max-width: 768px) {
    .hero-content {
        flex-direction: column;
        text-align: center;
    }
    .hero-image {
        width: 200px;
        height: 200px;
    }
    .hero-title {
        font-size: 2.5rem;
    }
    .social-links {
        justify-content: center;
    }
    .navbar {
        display: none;
    }
}


/* --- TARJETAS DE TRABAJO --- */

.trabajos-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 30px;
    padding: 20px 0;
}

.studio-card {
    /* CAMBIO: Unificamos este estilo con el de las otras tarjetas */
    background: var(--bg-medium-rgba);
    backdrop-filter: blur(8px);
    border: 1px solid var(--bg-light-rgba);

    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    width: 380px;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.studio-card a {
    display: flex;
    flex-direction: row;
    align-items: center;
    padding: 20px;
    text-decoration: none;
    color: inherit;
}

.studio-card img {
    max-width: 100px;
    height: auto;
    border-radius: 8px;
    margin-right: 20px;
}

.studio-card .card-content {
    text-align: left;
}

.studio-card h4 {
    font-size: 1.3rem;
    color: var(--text-light);
    margin: 0;
    font-weight: 600;
}

.studio-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    border-color: var(--accent-green); /* CAMBIO: Añadimos el borde verde en hover */
}


/* --- AJUSTES RESPONSIVOS PARA TARJETAS DE TRABAJO --- */

@media (max-width: 768px) {
    .trabajos-grid {
        flex-direction: column;
        align-items: center;
        gap: 25px;
    }
    .studio-card {
        width: 90%;
        max-width: 350px;
    }
    .studio-card a {
        flex-direction: column;
        text-align: center;
    }
    .studio-card img {
        margin-right: 0;
        margin-bottom: 15px;
    }
    .studio-card .card-content {
        text-align: center;
    }
}
/* --- ESTILOS PARA EL SELECTOR DE IDIOMA --- */
.lang-switcher {
    display: flex;
    align-items: center;
    margin-left: 20px; /* Espacio para separarlo del resto de links */
}

.lang-link {
    color: var(--text-gray);
    text-decoration: none;
    font-weight: 500;
    padding: 5px 8px;
    border-radius: 5px;
    transition: all 0.3s ease;
}

.lang-link:hover {
    color: var(--text-light);
    background-color: var(--bg-light);
}

.lang-link.active {
    color: var(--accent-green);
    font-weight: 700;
}

.lang-separator {
    color: var(--bg-light);
    margin: 0 5px;
}
.nav-link {
    display: flex;
    align-items: center;
    gap: 8px;
}