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

body {
    font-family: "meno-display-condensed", serif;
    font-weight: 400;
    font-style: normal;
    position: relative;
    min-height: 100vh;
    padding: 2rem;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('./TEXTURE.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    opacity: 0.5;
    z-index: -1;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

.project-title {
    display: block;
    width: 50%;
    margin: 0 auto 0 auto;
    text-align: center;
}

.project-description {
    font-family: "meno-display-condensed", serif;
    font-weight: 400;
    font-size: clamp(0.875rem, 1.5vw, 1.125rem);
    text-align: center;
    margin: 0 auto 3rem auto;
    max-width: 800px;
    color: #1a1a1a;
    line-height: 1.6;
}

.image-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    width: 100%;
}

.grid-item {
    position: relative;
    width: 100%;
    padding-bottom: 100%; /* Creates square aspect ratio */
    overflow: hidden;
    cursor: pointer;
}

.grid-item img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: filter 0.4s ease, transform 0.4s ease;
    filter: brightness(1) contrast(1);
}

.grid-item:hover img {
    filter: brightness(0.4) contrast(1.2); /* Darkens image with exposure effect */
    transform: scale(1.05);
}

.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(0, 0, 0, 0);
    transition: background-color 0.4s ease;
    z-index: 1;
}

.grid-item:hover .overlay {
    background-color: rgba(0, 0, 0, 0.2);
}

.overlay-text {
    font-family: "meno-display-condensed", serif;
    font-weight: 400;
    font-size: clamp(1rem, 2vw, 1.5rem);
    color: white;
    text-align: center;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.4s ease, transform 0.4s ease;
    padding: 1rem;
    letter-spacing: -1px;
}

.grid-item:hover .overlay-text {
    opacity: 1;
    transform: translateY(0);
}

/* Responsive design */
@media (max-width: 1024px) {
    .image-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.75rem;
    }
    
    body {
        padding: 1.5rem;
    }
}

@media (max-width: 768px) {
    .image-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }
    
    body {
        padding: 1rem;
    }
    
    .project-title {
        width: 100%;
        margin-bottom: none;
    }
}

@media (max-width: 480px) {
    .image-grid {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    
    .grid-item {
        padding-bottom: 75%; /* Slightly taller on mobile */
    }
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    cursor: pointer;
}

.modal-content {
    position: relative;
    max-width: 90%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1001;
    animation: modalFadeIn 0.3s ease;
}

.modal-image {
    max-width: 100%;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.modal-text {
    font-family: "meno-display-condensed", serif;
    font-weight: 400;
    font-size: clamp(1rem, 2vw, 1.25rem);
    color: white;
    text-align: center;
    margin-top: 1.5rem;
    padding: 0 1rem;
    max-width: 800px;
    letter-spacing: -1px;
}

.modal-text a {
    color: white;
    text-decoration: underline;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@media (max-width: 768px) {
    .modal-content {
        max-width: 95%;
    }
    
    .modal-text {
        margin-top: 1rem;
        font-size: 0.9rem;
    }
}

