/* --- ANIMACIONES AL HACER SCROLL --- */
.scroll-animate {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s cubic-bezier(0.165, 0.84, 0.44, 1), transform 0.8s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.scroll-animate.visible {
    opacity: 1;
    transform: translateY(0);
}

/* --- ESTILOS DE NAVEGACIÓN CON ANIMACIÓN --- */
.nav-link {
    position: relative;
    color: #4b5563;
    text-decoration: none;
    transition: color 0.3s ease;
    padding-bottom: 4px;
}

.nav-link:hover {
    color: #0B2C4D;
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 2px;
    bottom: 0;
    left: 0;
    background-color: #007BFF;
    transform: scaleX(0);
    transform-origin: bottom right;
    transition: transform 0.3s ease-out;
}

.nav-link:hover::after {
    transform: scaleX(1);
    transform-origin: bottom left;
}

/* --- ESTILOS PARA EL MODAL DE PORTAFOLIO --- */

/* Evita el scroll del body cuando el modal está abierto */
body.modal-open {
    overflow: hidden;
}

/* Contenedor principal del modal (fondo blureado) */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(11, 44, 77, 0.8); /* Usamos el color primario con transparencia */
    backdrop-filter: blur(8px);
    z-index: 100;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* Clase para mostrar el modal con animación */
.modal-overlay.visible {
    opacity: 1;
}

/* Contenido del modal (la ventana blanca) */
.modal-content {
    background-color: white;
    padding: 2rem;
    border-radius: 0.5rem;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

.modal-overlay.visible .modal-content {
    transform: scale(1);
}

/* Botón de cierre */
.modal-close-button {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 2rem;
    line-height: 1;
    color: #9ca3af; /* gris */
    background: none;
    border: none;
    cursor: pointer;
}

.modal-close-button:hover {
    color: #1f2937; /* gris oscuro */
}

