.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: white;
    z-index: 9999;
    display: none;
    justify-content: center;
    align-items: center;
}

.modal.visible {
    display: flex;
    animation: modalEnter 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.modal.closing {
    animation: modalExit 0.15s ease-out forwards;
}

@keyframes modalEnter {
    0% {
        opacity: 0;
        transform: translateY(-10%) scale(0.9);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes modalExit {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

.modal-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    padding: 40px 20px;
    position: relative;
    background: #F7F7F7;
    border: 1px solid #DEDEDE;
    width: 85%;
    height: 85%;
    max-width: 1400px;
    border-radius: 15px;
    overflow-y: auto;
    z-index: 1;
    margin-top: 0;
    opacity: 0;
    transform: translateY(-40px) scale(0.95);
    animation: contentEnter 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) 0.1s forwards;
}

@keyframes contentEnter {
    0% {
        opacity: 0;
        transform: translateY(-40px) scale(0.95);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes contentExit {
    0% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateY(-40px) scale(0.95);
    }
}

/* Noise overlay for modal content */
.modal-content::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.05;
    pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    border-radius: 15px;
}

.projects-grid {
    display: grid;
    grid-gap: 40px;
    padding: 20px 0;
    position: relative;
    z-index: 2;
    opacity: 0;
    transform: translateY(-30px);
    animation: gridEnter 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) 0.2s forwards;
}

@keyframes gridEnter {
    0% {
        opacity: 0;
        transform: translateY(-30px) scale(0.97);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes gridExit {
    0% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateY(-30px) scale(0.97);
    }
}

/* Mobile Adjustments */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        height: 95%;
        padding: 20px;
    }
    
    .projects-grid {
        grid-gap: 20px;
    }
}

.nav-hidden {
    transform: translateY(-100%);
}

.text-section {
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
} 