/* --- 1. CONFIGURACIÓN BASE Y VARIABLES --- */
:root {
    /* Paleta 'ParDos' (Coffee & Cream) */
    --bg-color: #FDFBF7;       /* Crema muy suave */
    --text-main: #3E2723;      /* Café Espresso profundo */
    --text-secondary: #5D4037; /* Café suave para párrafos */
    --accent: #8D6E63;         /* Mocha (Acento principal) */
    --accent-light: #D7CCC8;   /* Latte (Fondos sutiles) */
    --card-bg: #FFFFFF;        /* Blanco puro para tarjetas */
    --nav-bg: rgba(253, 251, 247, 0.85); /* Vidrio esmerilado */
    
    /* Tipografía Moderna */
    --font-main: 'Outfit', 'Segoe UI', sans-serif;
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: 85px; /* IMPORTANTE: Para que la navbar no tape los títulos */
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: var(--font-main);
    line-height: 1.7; /* Mayor legibilidad */
    overflow-x: hidden;
}

/* --- 2. FONDO ANIMADO 'PARDOS' (Las fichas flotantes) --- */
.pardos-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1; /* Detrás de todo */
    overflow: hidden;
    pointer-events: none;
}

.floating-tile {
    position: absolute;
    background-color: rgba(141, 110, 99, 0.08); /* Mocha muy transparente */
    border-radius: 12px;
    color: rgba(62, 39, 35, 0.1);
    font-weight: 800;
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: monospace; /* Fuente tipo código para los números */
    animation: floatUp linear infinite;
    backdrop-filter: blur(1px);
}

@keyframes floatUp {
    0% { transform: translateY(110vh) rotate(0deg); opacity: 0; }
    15% { opacity: 1; }
    85% { opacity: 1; }
    100% { transform: translateY(-10vh) rotate(360deg); opacity: 0; }
}

/* --- 3. NAVBAR 'GLASSMORPHISM' --- */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 70px;
    background: var(--nav-bg);
    backdrop-filter: blur(12px); /* El efecto de cristal */
    -webkit-backdrop-filter: blur(12px); /* Soporte Safari */
    border-bottom: 1px solid rgba(0,0,0,0.05);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0 40px;
    transition: all 0.3s ease;
}

.nav-container {
    width: 100%;
    max-width: 1200px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text-main);
    text-decoration: none;
    letter-spacing: -1px;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 35px;
}

.nav-menu a {
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.95rem;
    position: relative;
    transition: color 0.3s;
}

/* Efecto subrayado animado en menú */
.nav-menu a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -4px;
    left: 0;
    background-color: var(--accent);
    transition: width 0.3s ease;
}

.nav-menu a:hover { color: var(--accent); }
.nav-menu a:hover::after { width: 100%; }

/* Buscador */
.search-box {
    display: flex;
    align-items: center;
    background: #fff;
    border: 1px solid var(--accent-light);
    border-radius: 20px;
    padding: 6px 15px;
    transition: box-shadow 0.3s;
}

.search-box:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(141, 110, 99, 0.15);
}

#search-input {
    border: none;
    outline: none;
    font-family: var(--font-main);
    color: var(--text-secondary);
    width: 140px;
    font-size: 0.9rem;
}

.search-btn {
    background: none;
    border: none;
    color: var(--accent);
    cursor: pointer;
    font-size: 1rem;
}

/* --- 4. HERO SECTION (Layout Pro) --- */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 60px; /* Compensar Navbar */
    position: relative;
}

.hero-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 1100px;
    gap: 40px;
    padding: 20px;
}

.hero-text { flex: 1; }

.greeting {
    font-size: 1.1rem;
    color: var(--accent);
    letter-spacing: 3px;
    text-transform: uppercase;
    font-weight: 700;
    margin-bottom: 5px;
}

.my-name {
    font-size: 4.5rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 10px;
    /* Degradado sutil */
    background: linear-gradient(45deg, var(--text-main), var(--accent));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.role-wrapper {
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 30px;
    min-height: 45px;
}

/* Cursor parpadeante */
.cursor {
    display: inline-block;
    width: 3px;
    background-color: var(--accent);
    animation: blink 1s infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* Info de contacto */
.contact-info-block {
    margin-bottom: 30px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 15px;
    color: var(--text-secondary);
    font-size: 1rem;
}

.info-item i { color: var(--accent); width: 20px; text-align: center; }
.info-item a { color: var(--text-secondary); text-decoration: none; transition: 0.3s; }
.info-item a:hover { color: var(--accent); text-decoration: underline; }

/* Redes Sociales */
.social-links { display: flex; gap: 20px; }
.social-icon { font-size: 1.8rem; color: var(--text-main); transition: 0.3s; }
.social-icon:hover { color: var(--accent); transform: translateY(-4px); }

/* Imagen de Perfil (Animación Flotante) */
.hero-image-container {
    flex: 1;
    display: flex;
    justify-content: center;
    position: relative;
}

.profile-pic {
    width: 380px;
    height: 380px;
    object-fit: cover;
    border-radius: 50%;
    
    /* MODIFICACIÓN PARA FOTO DE NOCHE: Borde difuminado y sombra para mezclar con el fondo crema */
    border: 8px solid rgba(62, 39, 35, 0.4); 
    box-shadow: 0 0 30px rgba(141, 110, 99, 0.4), 0 20px 40px rgba(62, 39, 35, 0.25);
    
    position: relative;
    z-index: 2;
    animation: float 6s ease-in-out infinite;
}

.blob-bg {
    position: absolute;
    width: 390px;
    height: 390px;
    background-color: var(--accent-light);
    border-radius: 50%;
    opacity: 0.6;
    z-index: 1;
    transform: translate(20px, 20px);
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}

.scroll-down {
    position: absolute;
    bottom: 30px;
    font-size: 2rem;
    color: var(--accent);
    animation: bounce 2s infinite;
}
@keyframes bounce { 
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

/* --- 5. SECCIONES Y TARJETAS --- */
section {
    padding: 80px 20px;
    max-width: 1200px;
    margin: 0 auto;
}

h2.section-title {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 60px;
    position: relative;
}
h2.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: var(--accent);
    margin: 15px auto 0;
    border-radius: 2px;
}

.about-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
    font-size: 1.15rem;
    color: var(--text-secondary);
}

.projects-grid, .skills-grid, .soft-skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
}

/* Diseño de Tarjetas (Unificado) */
.project-card, .soft-card {
    background: var(--card-bg);
    border: 1px solid var(--accent-light);
    border-radius: 16px;
    padding: 30px;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s;
    box-shadow: 0 4px 6px rgba(0,0,0,0.02);
}

.project-card:hover, .soft-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 30px rgba(62, 39, 35, 0.08);
    border-color: var(--accent);
}

.project-title, .soft-card h3 {
    font-size: 1.4rem;
    margin-bottom: 10px;
    color: var(--text-main);
}

.project-desc, .soft-card p {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

/* Soft Skills Iconos */
.soft-card i {
    font-size: 2rem;
    color: var(--accent);
    margin-bottom: 15px;
    display: block;
}

/* Tags y Botones */
.skill-list { display: flex; flex-wrap: wrap; gap: 8px; }

.skill-tag {
    background-color: var(--accent-light);
    color: var(--text-main);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.project-link-btn {
    display: inline-block;
    margin-top: 15px;
    padding: 10px 24px;
    background-color: var(--text-main);
    color: #fff;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: background 0.3s;
}
.project-link-btn:hover { background-color: var(--accent); }

/* --- 6. BARRA DE INTERESES --- */
.interests-bar {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    margin-top: 50px;
}

.interests-bar span {
    background: var(--bg-color);
    border: 1px solid var(--accent-light);
    padding: 10px 20px;
    border-radius: 30px;
    color: var(--text-secondary);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: 0.3s;
}

.interests-bar span:hover {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
    transform: scale(1.05);
}

/* Footer */
footer {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 40px;
    border-top: 1px solid var(--accent-light);
}

/* --- 7. ANIMACIONES DE ENTRADA (Reveal) --- */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: all 0.8s cubic-bezier(0.5, 0, 0, 1);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* --- 8. RESPONSIVE --- */
@media (max-width: 900px) {
    .nav-menu { display: none; } /* Ocultar menú en móvil para simplificar */
    .hero-container { flex-direction: column-reverse; text-align: center; padding-top: 40px; }
    .hero-text { text-align: center; }
    .contact-info-block { align-items: center; }
    .social-links { justify-content: center; }
    
    .profile-pic, .blob-bg { width: 260px; height: 260px; }
    .my-name { font-size: 3rem; }
    .navbar { padding: 0 20px; }
}

/* --- EFECTO TILT (3D al mover mouse) --- */
.tilt-card {
    transition: transform 0.1s ease-out; /* Muy rápido para seguir al mouse */
    transform-style: preserve-3d;
    perspective: 1000px;
}

/* --- ANIMACIONES DE SCROLL MEJORADAS --- */
/* Entrada desde la izquierda */
.slide-left {
    opacity: 0;
    transform: translateX(-100px);
    transition: all 0.8s ease-out;
}
/* Entrada desde la derecha */
.slide-right {
    opacity: 0;
    transform: translateX(100px);
    transition: all 0.8s ease-out;
}
/* Escalado (Pop up) */
.scale-up {
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.active {
    opacity: 1;
    transform: translate(0) scale(1);
}

/* --- SECCIÓN GITHUB PREMIUM --- */
.github-section {
    background: #24292e; /* Color GitHub */
    color: white;
    padding: 60px;
    border-radius: 20px;
    text-align: center;
    position: relative;
    overflow: hidden;
    margin-top: 60px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.3);
}

.github-bg-icon {
    position: absolute;
    top: -20px;
    right: -20px;
    font-size: 15rem;
    color: rgba(255,255,255,0.05);
    transform: rotate(15deg);
}

.github-content {
    position: relative;
    z-index: 2;
}

.github-stats {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin: 30px 0;
    flex-wrap: wrap;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 800;
    color: #FFC107; /* Amarillo contraste */
}

.stat-label {
    font-size: 0.9rem;
    color: #aaa;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.github-btn-large {
    display: inline-block;
    background: white;
    color: #24292e;
    padding: 15px 40px;
    border-radius: 30px;
    font-weight: 800;
    text-decoration: none;
    transition: transform 0.2s, box-shadow 0.2s;
    font-size: 1.1rem;
}

.github-btn-large:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(255,255,255,0.2);
}

/* --- TEXTO GLITCH (Efecto visual) --- */
.my-name:hover {
    animation: shake 0.5s;
    cursor: default;
}

@keyframes shake {
    0% { transform: translate(1px, 1px) rotate(0deg); }
    10% { transform: translate(-1px, -2px) rotate(-1deg); }
    20% { transform: translate(-3px, 0px) rotate(1deg); }
    30% { transform: translate(3px, 2px) rotate(0deg); }
    40% { transform: translate(1px, -1px) rotate(1deg); }
    50% { transform: translate(-1px, 2px) rotate(-1deg); }
    60% { transform: translate(-3px, 1px) rotate(0deg); }
    70% { transform: translate(3px, 1px) rotate(-1deg); }
    80% { transform: translate(-1px, -1px) rotate(1deg); }
    90% { transform: translate(1px, 2px) rotate(0deg); }
    100% { transform: translate(1px, -2px) rotate(-1deg); }
}

/* --- BOTÓN MUNDO INTERNO (EN PERFIL) --- */
.btn-internal {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background-color: transparent;
    color: #3E2723;
    border: 2px solid #3E2723;
    padding: 12px 30px;
    border-radius: 50px; /* Bordes muy redondos */
    font-weight: 800;
    text-decoration: none;
    font-size: 1rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-internal i {
    font-size: 1.2rem;
}

.btn-internal:hover {
    background-color: #3E2723;
    color: #fff;
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(62, 39, 35, 0.15);
}

/* Efecto pulsante sutil para llamar la atención */
.btn-internal:hover i {
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* Nuevo botón secundario para "Ver Sitio" */
.details-btn {
    display: flex; 
    justify-content: center; 
    align-items: center; 
    gap: 8px;
    width: 100%; 
    text-align: center;
    background: transparent; 
    border: 2px solid #8D6E63; /* Borde café claro */
    color: #8D6E63;
    padding: 10px; 
    border-radius: 8px;
    text-decoration: none; 
    font-weight: 700; 
    margin-bottom: 15px; /* Espacio antes del formulario */
    transition: 0.3s;
}
.details-btn:hover { 
    background: #8D6E63; 
    color: white; 
}

/* --- ESTILOS DE IDIOMAS Y BARRA --- */
.languages-container {
    margin-top: 40px;
    background: #FFFBF9; /* Crema suave */
    padding: 25px;
    border-radius: 15px;
    border: 1px solid #EFEBE9;
}

.language-item {
    max-width: 500px;
    margin: 0 auto;
}

.lang-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-weight: 600;
    color: #3E2723; /* Café oscuro */
}

.progress-bar-bg {
    width: 100%;
    height: 12px;
    background: #D7CCC8; /* Beige / Café claro */
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.progress-bar-fill {
    width: 75%; /* Nivel B2 aproximadamente 75% */
    height: 100%;
    background: #8D6E63; /* Café intermedio */
    border-radius: 10px;
    position: relative;
    transition: width 1.5s ease-in-out;
}

/* Efecto de brillo sutil en la barra */
.progress-bar-fill::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
}