/* === CONFIGURACIÓN BASE === */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;800&display=swap');

:root {
    --bg-body: #0a0a0a;
    --bg-card: #171717;
    --primary: #3b82f6;
    --accent: #8b5cf6;
    --text-main: #ededed;
    --text-dim: #a1a1aa;
    --border: rgba(255, 255, 255, 0.1);
    --glow: rgba(59, 130, 246, 0.5);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    overflow-x: hidden;
    /* Fondo oscuro con luz sutil arriba */
    background-image: radial-gradient(circle at 50% 0%, #1e293b 0%, var(--bg-body) 70%);
}

/* === NAVEGACIÓN (Corrección de z-index y posición) === */
nav {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(10, 10, 10, 0.85); /* Un poco más oscuro para legibilidad */
    backdrop-filter: blur(16px);
    padding: 10px 30px;
    border-radius: 100px;
    border: 1px solid var(--border);
    z-index: 9999; /* Asegura que esté siempre encima */
    width: 90%;
    max-width: 550px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.6);
}

nav ul {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    list-style: none;
    flex-wrap: wrap;
    margin: 0;
    padding: 0;
}

nav ul li a {
    color: var(--text-dim);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
}

nav ul li a:hover {
    color: var(--text-main);
    text-shadow: 0 0 10px rgba(255,255,255,0.5);
}

/* === SECCIONES GENERALES === */
section {
    max-width: 1000px;
    margin: 0 auto;
    padding: 100px 20px;
    /* Opacidad inicial para la animación JS */
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease-out;
}

section.visible {
    opacity: 1;
    transform: translateY(0);
}

/* === HERO (HOME) - CORREGIDO === */
#home {
    /* Quitamos flex para evitar que los iconos se apilen verticalmente */
    display: block; 
    text-align: center;
    height: 100vh; /* Ocupa toda la pantalla */
    min-height: 600px;
    
    /* ESTA LÍNEA BAJA EL CONTENIDO PARA QUE NO LO TAPE EL MENU */
    padding-top: 180px; 
}

#home h1 {
    font-size: 3.5rem; /* Ajustado para que quepa mejor */
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 10px;
    background: linear-gradient(to bottom right, #ffffff, #94a3b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

#home h2 {
    font-size: 1.2rem;
    color: var(--primary);
    font-weight: 600;
    margin-bottom: 40px;
    text-transform: uppercase;
    letter-spacing: 3px;
}

/* Estilos para los enlaces de iconos (Github, Discord, etc) */
#home a {
    display: inline-block; /* Esto los pone en fila horizontal */
    margin: 0 15px; /* Espacio entre iconos */
    text-decoration: none;
}

#home img {
    width: 40px;
    height: 40px;
    transition: transform 0.3s, filter 0.3s;
    filter: grayscale(100%) brightness(0.7);
    opacity: 0.7;
}

#home img:hover {
    transform: translateY(-5px) scale(1.1);
    filter: grayscale(0%) brightness(1.2);
    opacity: 1;
    box-shadow: 0 10px 20px rgba(0,0,0,0.5); /* Sombra sutil */
    border-radius: 50%; /* Opcional: hace el brillo redondo */
}

/* === ABOUT === */
#about {
    text-align: center;
}

#about h1 {
    font-size: 2.5rem;
    color: var(--text-main);
    margin-bottom: 20px;
}

#about p {
    color: var(--text-dim);
    font-size: 1.1rem;
    line-height: 1.8;
    max-width: 700px;
    margin: 0 auto 30px auto;
}

.about-proyects {
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 20px 40px;
    border-radius: 12px;
    display: inline-block;
    box-shadow: 0 10px 30px -10px rgba(0,0,0,0.5);
}

.about-proyects h3 {
    font-size: 0.8rem;
    text-transform: uppercase;
    color: var(--text-dim);
    letter-spacing: 1px;
}

.about-proyects p {
    font-size: 3rem;
    font-weight: 800;
    color: var(--text-main);
    margin: 0; /* Override del p general */
}

/* === SKILLS === */
#Skills {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
}

.Front-end, .backend, .tools {
    background: var(--bg-card);
    padding: 30px;
    border-radius: 16px;
    border: 1px solid var(--border);
    transition: transform 0.3s, border-color 0.3s;
}

.Front-end:hover, .backend:hover, .tools:hover {
    border-color: var(--primary);
    transform: translateY(-5px);
}

#skills h1 {
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: var(--text-main);
    text-align: left;
}

#skills p {
    font-size: 0.9rem;
    color: var(--text-dim);
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
}

/* Barras de progreso */
div[class$="bar"] {
    background: #27272a;
    height: 6px;
    width: 100%;
    border-radius: 10px;
    position: relative;
    overflow: hidden;
    margin-bottom: 20px;
}

div[class$="bar"]::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    box-shadow: 0 0 12px var(--glow);
    width: 0%; /* JS lo animará */
    transition: width 1.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Fix para el error HTML en Tools (Git englobando a VSCode) */
.tools .gitbar {
    background: transparent; 
    height: auto; 
    overflow: visible; 
    margin: 0;
}
.tools .gitbar::after { display: none; } /* Ocultamos la barra fantasma */

/* Anchos definidos */
.htmlbar::after { width: 100%; }
.cssbar::after { width: 60%; }
.jsbar::after { width: 10%; }
.pythonbar::after { width: 30%; }
.nodejsbar::after { width: 10%; }
.luabar::after { width: 40%; }
/* Barras dentro de tools */
.vscodebar::after { width: 100%; }
.vs2026bar::after { width: 30%; }

/* === PROJECTS === */
#Projects {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.codiumst, .ShadowSQ {
    background: var(--bg-card);
    padding: 35px;
    border-radius: 16px;
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.codiumst::before, .ShadowSQ::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    opacity: 0;
    transition: opacity 0.3s;
}

.codiumst:hover, .ShadowSQ:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px -10px rgba(0,0,0,0.5);
}

.codiumst:hover::before, .ShadowSQ:hover::before {
    opacity: 1;
}

.codiumst h1, .ShadowSQ h1 {
    font-size: 1.8rem;
    margin-bottom: 15px;
    text-align: left;
    color: var(--text-main);
}

.codiumst p, .ShadowSQ p {
    color: var(--text-dim);
    margin-bottom: 25px;
    font-size: 0.95rem;
    text-align: left;
}

button {
    align-self: flex-start;
    background: transparent;
    color: var(--text-main);
    border: 1px solid var(--border);
    padding: 10px 24px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

button:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
    box-shadow: 0 0 15px var(--glow);
}

/* === FOOTER === */
footer {
    text-align: center;
    padding: 60px 20px;
    border-top: 1px solid var(--border);
    margin-top: 80px;
    background: #050505;
}

footer h1 {
    font-size: 2rem;
    color: var(--text-main);
    margin-bottom: 20px;
}

footer p {
    color: var(--text-dim);
    margin: 5px 0;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    #home { padding-top: 160px; }
    #home h1 { font-size: 2.5rem; }
    #home img { width: 35px; height: 35px; margin: 10px; }
    nav { width: 95%; padding: 10px; }
    nav ul { gap: 15px; }
    nav ul li a { font-size: 0.75rem; }
}