/* --- VARIABLES --- */
:root {
    --bg-main: #121212;
    --bg-secondary: #1E1E1E;
    --accent: #D32F2F;       /* Rojo */
    --text-main: #F3EDED;
    --text-muted: #A0A0A0;
    
    --font-head: 'Varela Round', sans-serif;
    --font-body: 'Clear Sans', sans-serif;
}

/* --- RESET & BASE --- */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { 
    scroll-behavior: smooth;
    scroll-padding-top: 100px; /* La altura de tu navbar + un poquito de aire */
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    font-family: var(--font-body);
    line-height: 1.6;
    overflow-x: hidden;
}

a { text-decoration: none; color: inherit; transition: 0.3s; }
ul { list-style: none; }

/* --- EFECTOS ESPECIALES --- */

/* Fondo de Partículas */
#particles-js {
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    background-color: var(--bg-main);
    z-index: -1; 
}

/* Cursor Typewriter */
.typewriter {
    border-right: 3px solid var(--accent);
    padding-right: 5px;
    animation: blink 0.75s step-end infinite;
    color: var(--text-main);
}

@keyframes blink {
    from, to { border-color: transparent }
    50% { border-color: var(--accent) }
}

/* --- UTILIDADES --- */
.container {
    width: 90%;
    max-width: 1100px;
    margin: 0 auto;
}
.accent { color: var(--accent); }
.section { padding: 100px 0; }
.section-bg-secondary { background-color: var(--bg-secondary); padding: 100px 0; }
.text-left { text-align: left; }
.center { text-align: center; }

/* --- NAVBAR --- */
.navbar {
    padding: 10px 0;
    height: 90px;
    display: flex;
    align-items: center;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    background: rgba(18, 18, 18, 0.85);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    height: 75px;
    width: auto;
    transition: transform 0.3s ease;
}

.nav-logo:hover { transform: scale(1.05); }

.nav-links { display: flex; gap: 30px; align-items: center; }
.nav-links a { font-size: 0.95rem; font-weight: 500; color: var(--text-main); }
.nav-links a:hover { color: var(--accent); }

/* Botón Contactar del Menú */
.btn-nav {
    border: 1px solid var(--accent);
    padding: 8px 20px; /* Un poquito más ancho */
    border-radius: 4px;
    color: var(--accent) !important;
    font-weight: 600;
    transition: all 0.3s ease; /* Para que el cambio de color sea suave */
    background-color: transparent;
}

/* Efecto Hover: Relleno sólido + Brillo */
.btn-nav:hover {
    background-color: var(--accent); /* Se pinta rojo */
    color: #ffffff !important;       /* Texto blanco */
    box-shadow: 0 0 15px rgba(211, 47, 47, 0.5); /* Resplandor estilo neón */
    transform: translateY(-2px);     /* Se levanta sutilmente */
    border-color: var(--accent);
}

/* Clase para dejar el link "prendido" cuando estás en esa sección */
.nav-links a.active-link {
    color: var(--accent);
    position: relative;
}

/* Un puntito rojo debajo del link activo */
.nav-links a.active-link::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 2px;
    background-color: var(--accent);
    bottom: -5px;
    left: 0;
}

/* --- HERO --- */
.hero-section {
    height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    padding-top: 60px;
    background: transparent;
}

.hero-title {
    font-family: var(--font-head);
    font-size: 3.5rem;
    line-height: 1.1;
    margin-bottom: 15px;
}

.hero-subtitle {
    font-size: 1.8rem;
    color: var(--text-muted);
    font-weight: 400;
    margin-bottom: 25px;
    min-height: 40px;
}

.hero-text {
    max-width: 550px;
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-bottom: 40px;
}

.hero-btns { display: flex; gap: 15px; }

/* Botones */
.btn {
    padding: 12px 28px;
    border-radius: 4px;
    font-weight: bold;
    font-size: 1rem;
    cursor: pointer;
    border: none;
    font-family: var(--font-body);
}
.btn-primary {
    background-color: var(--accent);
    color: #fff;
    border: 2px solid var(--accent);
}
.btn-primary:hover {
    background-color: transparent; 
    color: var(--accent);
}
.btn-outline {
    border: 2px solid var(--text-main);
    background: transparent;
    color: var(--text-main);
}
.btn-outline:hover {
    border-color: var(--accent);
    color: var(--accent);
}
.btn-block { width: 100%; margin-top: 10px; }

/* --- ABOUT & SKILLS (MODIFICADO PARA CAJITA CON HOVER) --- */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    align-items: start;
}

.section-title {
    font-family: var(--font-head);
    font-size: 2rem;
    margin-bottom: 20px;
    color: var(--text-main);
}

.about-text p { color: var(--text-muted); font-size: 1.1rem; }

/* Aquí está la magia de la caja de Skills */
.skills-wrapper { 
    background-color: #171717; /* Fondo de tarjeta */
    padding: 30px;             /* Espacio interno */
    border-radius: 8px;        /* Bordes redondos */
    border: 1px solid transparent;
    transition: 0.3s ease;     /* Animación suave */
}

/* Efecto Hover en la caja de Skills */
.skills-wrapper:hover {
    transform: translateY(-7px); /* Se levanta */
    border-color: var(--accent); /* Borde rojo */
    box-shadow: 0 10px 30px -15px rgba(0,0,0,0.5); /* Sombra */
}

.skills-container {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.skill-badge {
    background: rgba(255,255,255,0.05);
    padding: 8px 16px;
    border-radius: 5px;
    font-size: 0.9rem;
    color: var(--text-main);
    border: 1px solid transparent;
    transition: 0.3s;
    font-family: 'Fira Code', monospace;
}

.skill-badge:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(211, 47, 47, 0.05);
    transform: translateY(-2px);
}

.skill-category-title {
    font-size: 1rem;
    color: var(--text-muted);
    margin: 20px 0 10px 0;
    font-family: var(--font-head);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Iconos Sociales (Cajitas pequeñas) */
.social-links-hero {
    display: flex;
    gap: 15px;
    margin-top: 25px;
}

.social-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: var(--text-muted);
    font-size: 1.2rem;
    transition: all 0.3s ease;
    cursor: pointer;
}

.social-icon:hover {
    background: transparent;
    border-color: var(--accent);
    color: var(--accent);
    transform: translateY(-4px);
    box-shadow: 0 5px 15px rgba(211, 47, 47, 0.2);
}

/* --- PORTFOLIO CARDS --- */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin-top: 40px;
}

.project-card {
    background-color: #171717;
    padding: 30px;
    border-radius: 8px;
    transition: 0.3s;
    border: 1px solid transparent;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.project-card:hover {
    transform: translateY(-7px);
    border-color: var(--accent);
    box-shadow: 0 10px 30px -15px rgba(0,0,0,0.5);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
}

.card-links a { font-size: 0.9rem; color: var(--text-muted); }
.card-links a:hover { color: var(--accent); text-decoration: underline; }

.project-title {
    font-family: var(--font-head);
    font-size: 1.4rem;
    margin-bottom: 10px;
    color: var(--text-main);
}

.project-desc {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 25px;
}

.project-tags {
    display: flex;
    gap: 15px;
    font-size: 0.85rem;
    font-family: monospace;
    color: var(--text-muted);
}

/* --- TIMELINE --- */
.timeline {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    padding: 20px 0;
}
.timeline::before {
    content: '';
    position: absolute;
    left: 20px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #333;
}
.timeline-item {
    padding: 20px 0 40px 50px;
    position: relative;
}
.timeline-dot {
    position: absolute;
    left: 11px;
    top: 25px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--accent);
    border: 4px solid var(--bg-secondary);
    box-shadow: 0 0 0 4px rgba(211, 47, 47, 0.2);
}
.timeline-content {
    background: #171717;
    padding: 25px;
    border-radius: 8px;
    border: 1px solid transparent;
    transition: 0.3s;
}
.timeline-content:hover {
    border-color: var(--accent);
    transform: translateX(5px);
}
.timeline-date {
    display: inline-block;
    font-family: 'Fira Code', monospace;
    font-size: 0.85rem;
    color: var(--accent);
    margin-bottom: 8px;
}
.timeline-content h3 { font-size: 1.3rem; margin-bottom: 5px; color: var(--text-main); }
.timeline-content h4 { font-size: 1rem; color: var(--text-muted); margin-bottom: 15px; font-weight: 400; }
.cert-list { list-style: none; color: var(--text-muted); font-size: 0.95rem; }
.cert-list li { margin-bottom: 5px; }

/* --- CONTACT SECTION & FORM --- */
.contact-wrapper {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 60px;
    align-items: start;
}

.contact-text {
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-bottom: 30px;
}

.contact-details {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 1.05rem;
    color: var(--text-main);
}
.contact-item i { font-size: 1.2rem; }

/* Estilos Formulario */
.contact-form {
    background: #171717;
    padding: 40px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.form-group { margin-bottom: 20px; }

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.9rem;
    color: var(--text-muted);
    font-family: 'Fira Code', monospace;
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    background: #0a0a0a;
    border: 1px solid #333;
    padding: 12px 15px;
    border-radius: 5px;
    color: #fff;
    font-family: var(--font-body);
    font-size: 1rem;
    transition: 0.3s ease;
    outline: none;
}

.contact-form input:focus,
.contact-form textarea:focus {
    border-color: var(--accent);
    background: #121212;
    box-shadow: 0 0 10px rgba(211, 47, 47, 0.1);
}

/* --- FOOTER PRO --- */
.footer-pro {
    background-color: #0a0a0a;
    border-top: 1px solid #333;
    padding: 80px 0 30px 0;
    margin-top: 50px;
    font-size: 0.95rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr;
    gap: 60px;
    margin-bottom: 60px;
}

.footer-logo {
    font-size: 2.2rem;
    font-family: var(--font-head);
    color: var(--text-main);
    margin-bottom: 15px;
    display: inline-block;
}

.footer-tagline {
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 20px;
    max-width: 300px;
}

.footer-location {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-main);
    font-size: 0.9rem;
}

.footer-col h3 {
    font-size: 1.2rem;
    color: var(--text-main);
    margin-bottom: 25px;
    border-bottom: 2px solid var(--accent);
    display: inline-block;
    padding-bottom: 5px;
}

.footer-menu li { margin-bottom: 12px; }

.footer-menu a {
    color: var(--text-muted);
    transition: 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.footer-menu a:hover {
    color: var(--accent);
    transform: translateX(5px);
}

.social-vertical {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.social-link-item {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-muted);
    padding: 10px;
    border-radius: 6px;
    background: rgba(255,255,255,0.03);
    transition: 0.3s;
    cursor: pointer;
}

.social-link-item i {
    font-size: 1.2rem;
    color: var(--text-main);
    transition: 0.3s;
}

.social-link-item:hover {
    background: rgba(211, 47, 47, 0.1);
    color: var(--text-main);
    transform: translateY(-2px);
}
.social-link-item:hover i { color: var(--accent); }

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #666;
    font-size: 0.85rem;
}

/* --- ESTILOS DEL MODAL (POP-UP) --- */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    display: flex;
    opacity: 1;
}

.modal-content {
    background-color: #121212;
    padding: 40px;
    border-radius: 10px;
    border: 1px solid var(--accent);
    width: 90%;
    max-width: 500px;
    position: relative;
    box-shadow: 0 0 30px rgba(211, 47, 47, 0.2);
    transform: scale(0.8);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 2rem;
    cursor: pointer;
    transition: 0.3s;
}

.modal-close:hover { color: var(--accent); }

.email-trigger {
    cursor: pointer;
    text-decoration: none;
    text-decoration-color: var(--accent);
    text-underline-offset: 4px;
}

/* --- SCROLL REVEAL ANIMATION --- */
.reveal {
    opacity: 0;
    transform: translateY(30px); /* Empieza un poco más abajo */
    transition: all 0.8s ease-out;
}

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

/* --- AJUSTES DE SEPARACIÓN ABOUT / SKILLS --- */
.section-bg-secondary.pb-0 { padding-bottom: 20px; }
.section-bg-secondary.pt-small { padding-top: 20px; }
.about-text-full { max-width: 800px; }
#skills { min-height: 400px; }

/* --- FIX PARA EL BOTÓN CONTACTAR ACTIVO --- */

/* 1. Quitamos la rayita de abajo (underline) solo para el botón */
.nav-links a.btn-nav.active-link::after {
    display: none;
}

/* 2. Definimos cómo se ve el botón cuando estás en la sección de Contacto */
/* Lo dejamos relleno (sólido) para que se note que estás ahí */
.nav-links a.btn-nav.active-link {
    background-color: var(--accent);
    color: #ffffff !important;
    box-shadow: 0 0 15px rgba(211, 47, 47, 0.3); /* Un brillo suave fijo */
    border-color: var(--accent);
}

/* --- RESPONSIVE --- */
@media (max-width: 768px) {
    .nav-links { display: none; }
    .hero-title { font-size: 2.5rem; }
    .about-grid { grid-template-columns: 1fr; }
    .hero-section { text-align: center; justify-content: center; }
    .hero-btns { justify-content: center; }
    
    .contact-wrapper { grid-template-columns: 1fr; gap: 40px; }
    .contact-form { padding: 25px; }
    
    .footer-grid { grid-template-columns: 1fr; gap: 40px; text-align: center; }
    .footer-location, .footer-menu a, .social-link-item { justify-content: center; }
    .footer-bottom { flex-direction: column; gap: 15px; }
}

@media (min-width: 768px) {
    .timeline::before { left: 50%; }
    .timeline-item { width: 50%; padding: 0 40px; }
    .timeline-item:nth-child(odd) { left: 0; text-align: right; padding-right: 40px; padding-left: 0; }
    .timeline-item:nth-child(even) { left: 50%; text-align: left; padding-left: 40px; }
    .timeline-dot { left: 50%; transform: translateX(-50%); }
    .timeline-item:nth-child(odd) .timeline-content:hover { transform: translateX(-5px); }
}