/* Digital Gallery Styles - Minimalist with Bright Color Accents */
body {
    background: #ffffff;
    color: #1a1a1a;
    font-family: 'Montserrat', sans-serif;
    position: relative;
    overflow-x: hidden;
    transition: background-color 0.8s ease;
}

/* Animated background canvas */
#digital-gallery-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    transition: opacity 0.8s ease;
}

/* Subtle texture overlay */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="200" height="200"><filter id="noise"><feTurbulence type="fractalNoise" baseFrequency="0.85" numOctaves="3" stitchTiles="stitch"/></filter><rect width="100%" height="100%" filter="url(%23noise)" opacity="0.03"/></svg>');
    pointer-events: none;
    z-index: 1;
    opacity: 0.5;
    transition: opacity 0.8s ease;
}

/* Gallery frame effect */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    box-shadow: inset 0 0 200px rgba(0,0,0,0.03);
    pointer-events: none;
    z-index: 1;
    transition: box-shadow 0.8s ease;
}

/* Smooth scroll */
html {
    scroll-behavior: smooth;
}

/* Back button */
.back-button {
    position: fixed;
    top: 40px;
    left: 40px;
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 24px;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(0, 0, 0, 0.1);
    color: #2d2d2d;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 400;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    opacity: 0;
    transform: translateX(-20px);
    animation: slideInBack 0.6s ease forwards;
    animation-delay: 0.8s;
}

@keyframes slideInBack {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.back-button:hover {
    transform: translateX(-5px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
    background: rgba(255, 255, 255, 1);
}

.back-button::before {
    content: '←';
    font-size: 1.2rem;
    transition: transform 0.3s ease;
}

.back-button:hover::before {
    transform: translateX(-3px);
}

.digital-gallery {
    padding: 120px 8% 80px 8%;
    position: relative;
    z-index: 2;
    opacity: 0;
    animation: fadeInGallery 1.2s ease forwards;
    animation-delay: 0.3s;
}

@keyframes fadeInGallery {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tech-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 4rem;
    font-weight: 300;
    color: #2d2d2d;
    text-align: left;
    margin-bottom: 0.5rem;
    letter-spacing: -1px;
    line-height: 1.1;
    opacity: 0;
    animation: fadeInTitle 0.8s ease forwards;
    animation-delay: 0.5s;
}

@keyframes fadeInTitle {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.gallery-subtitle {
    font-size: 1.2rem;
    font-weight: 300;
    color: #666;
    margin-bottom: 80px;
    text-align: left;
    font-style: italic;
    opacity: 0;
    animation: fadeInSubtitle 0.8s ease forwards;
    animation-delay: 0.7s;
}

@keyframes fadeInSubtitle {
    from {
        opacity: 0;
        transform: translateX(-15px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Grid with generous spacing - museum layout */
.digital-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
    gap: 70px 50px;
    margin-bottom: 120px;
    padding-bottom: 40px;
}

.digital-gallery-item {
    position: relative;
    overflow: visible;
    transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: pointer;
    background: #ffffff;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    padding: 20px;
    opacity: 0;
    transform: translateY(40px) scale(0.95);
}

.digital-gallery-item.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.digital-gallery-item::before {
    content: '';
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    height: 20px;
    background: radial-gradient(ellipse, rgba(255,255,255,0.9), transparent);
    opacity: 0;
    transition: opacity 0.8s ease;
    pointer-events: none;
}

.digital-gallery-item:hover::before {
    opacity: 1;
}

.digital-gallery-item:hover {
    transform: translateY(-12px) scale(1.02);
    box-shadow: 0 12px 40px rgba(0,0,0,0.15);
}

.digital-gallery-img {
    width: 100%;
    height: auto;
    aspect-ratio: 4/3;
    object-fit: cover;
    display: block;
    filter: contrast(1.08) saturate(1.05);
    transition: filter 0.8s ease, transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    border: 1px solid rgba(0,0,0,0.05);
}

.digital-gallery-item:hover .digital-gallery-img {
    filter: contrast(1.12) saturate(1.1);
    transform: scale(1.02);
}

/* Overlay info on hover - like gallery plaques */
.digital-overlay {
    position: absolute;
    bottom: 20px;
    left: 20px;
    right: 20px;
    background: rgba(255,255,255,0.95);
    opacity: 0;
    transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    padding: 15px 20px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    pointer-events: none;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    border-left: 3px solid #e0e0e0;
    transform: translateY(10px);
}

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

.digital-caption {
    color: #2d2d2d;
    font-size: 1.1rem;
    font-weight: 400;
    margin-bottom: 8px;
    letter-spacing: 0.3px;
}

.tech-details {
    font-family: 'Montserrat', sans-serif;
    color: #666;
    font-size: 0.9rem;
    font-weight: 300;
    letter-spacing: 0.5px;
}

/* Lightbox - bright and minimal with smooth animations */
.digital-lightbox {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0);
    backdrop-filter: blur(0px);
    transition: background-color 0.6s cubic-bezier(0.16, 1, 0.3, 1), 
                backdrop-filter 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.digital-lightbox.active {
    background-color: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
}

.lightbox-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    max-width: 90%;
    max-height: 85vh;
    object-fit: contain;
    filter: contrast(1.08);
    opacity: 0;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1),
                opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.digital-lightbox.active .lightbox-content {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
}

.lightbox-caption, .lightbox-tech-details {
    position: absolute;
    left: 50%;
    width: 80%;
    max-width: 600px;
    text-align: center;
    color: #2d2d2d;
    opacity: 0;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1),
                opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    transition-delay: 0.2s;
}

.lightbox-caption {
    bottom: 80px;
    font-size: 1.1rem;
    font-weight: 400;
    letter-spacing: 0.5px;
    transform: translateX(-50%) translateY(20px);
}

.lightbox-tech-details {
    bottom: 50px;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.9rem;
    font-weight: 300;
    color: #666;
    letter-spacing: 0.5px;
    transform: translateX(-50%) translateY(20px);
}

.digital-lightbox.active .lightbox-caption,
.digital-lightbox.active .lightbox-tech-details {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.close-lightbox {
    position: fixed;
    top: 40px;
    right: 40px;
    color: #2d2d2d;
    font-size: 3rem;
    font-weight: 200;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 10001;
    line-height: 1;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: translateY(-10px) rotate(-90deg);
}

.digital-lightbox.active .close-lightbox {
    opacity: 1;
    transform: translateY(0) rotate(0deg);
    transition-delay: 0.3s;
}

.close-lightbox:hover {
    color: #000;
    transform: translateY(0) rotate(90deg) scale(1.1);
}

/* Navigation arrows */
.lightbox-nav {
    position: fixed;
    top: 50%;
    transform: translateY(-50%) scale(0.8);
    font-size: 3rem;
    color: #2d2d2d;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    user-select: none;
    padding: 20px;
    z-index: 10001;
    opacity: 0;
}

.digital-lightbox.active .lightbox-nav {
    opacity: 1;
    transform: translateY(-50%) scale(1);
    transition-delay: 0.3s;
}

.lightbox-prev {
    left: 40px;
}

.lightbox-next {
    right: 40px;
}

.lightbox-nav:hover {
    color: #000;
    transform: translateY(-50%) scale(1.15);
}

.lightbox-prev:hover {
    transform: translateY(-50%) translateX(-5px) scale(1.15);
}

.lightbox-next:hover {
    transform: translateY(-50%) translateX(5px) scale(1.15);
}

/* Responsive */
@media (max-width: 1024px) {
    .digital-gallery-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
        gap: 40px;
    }
    
    .tech-title {
        font-size: 3rem;
    }
    
    .back-button {
        top: 30px;
        left: 30px;
        padding: 10px 20px;
        font-size: 0.85rem;
    }
}

@media (max-width: 768px) {
    .digital-gallery {
        padding: 100px 5% 60px 5%;
    }
    
    .digital-gallery-grid {
        grid-template-columns: 1fr;
        gap: 50px;
    }
    
    .tech-title {
        font-size: 2.5rem;
    }
    
    .back-button {
        top: 20px;
        left: 20px;
        padding: 8px 16px;
        font-size: 0.8rem;
    }
    
    .close-lightbox {
        top: 20px;
        right: 20px;
        font-size: 2.5rem;
    }
    
    .lightbox-nav {
        font-size: 2rem;
        padding: 15px;
    }
    
    .lightbox-prev {
        left: 20px;
    }
    
    .lightbox-next {
        right: 20px;
    }
    
    .lightbox-caption {
        bottom: 60px;
        font-size: 1rem;
    }
    
    .lightbox-tech-details {
        bottom: 35px;
        font-size: 0.85rem;
    }
}
