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

body {
    font-family: 'Space Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(135deg, #E33725 0%, #DFB72D 50%, #B249C7 100%);
    min-height: 200vh;
    color: #fff;
    overflow-x: hidden;
}

/* Back Button */
.back-button {
    position: fixed;
    top: 2rem;
    left: 2rem;
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.2rem;
    z-index: 1000;
    padding: 1rem 1.5rem;
    border: 2px solid #fff;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    transition: all 0.3s;
}

.back-button:hover {
    background: #fff;
    color: #000;
    transform: translateX(-5px);
}

/* Gallery Container - Organized Chaos */
.gallery-container {
    width: 100%;
    min-height: 200vh;
    position: relative;
    z-index: 1;
}

/* Chaos Grid - Absolute positioned organized mess */
.chaos-grid {
    width: 100%;
    height: 200vh;
    position: relative;
}

/* Gallery Items - Scattered randomly but organized */
.gallery-item {
    position: absolute;
    overflow: hidden;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), z-index 0s;
    cursor: pointer;
    box-shadow: 
        0 10px 40px rgba(0, 0, 0, 0.5),
        0 0 2px rgba(255, 255, 255, 0.1);
}

.gallery-item:hover {
    transform: scale(1.1) rotate(0deg) !important;
    z-index: 50 !important;
}

.gallery-item img {
    width: 100%;
    height: auto;
    display: block;
    filter: brightness(0.85) contrast(1.1);
    transition: filter 0.3s;
}

.gallery-item:hover img {
    filter: brightness(1) contrast(1);
}

/* Floating Description Box */
.description-box {
    position: fixed;
    top: 25%;
    left: 50%;
    transform: translate(-50%, 0);
    max-width: 600px;
    width: 90%;
    max-height: 50vh;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border: 3px solid #000;
    padding: 3rem;
    z-index: 100;
    box-shadow: 
        0 0 100px rgba(100, 255, 150, 0.2),
        20px 20px 0 rgba(0, 0, 0, 0.3);
    overflow-y: auto;
    color: #000;
}

.description-box h1 {
    font-size: 3rem;
    font-weight: 900;
    margin-bottom: 2rem;
    line-height: 1;
    border-bottom: 4px solid #000;
    padding-bottom: 1rem;
}

.description-content {
    margin-bottom: 2rem;
}

.description-content p {
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 1.5rem;
}

.project-details {
    display: flex;
    gap: 2rem;
    padding-top: 2rem;
    border-top: 2px solid #000;
    flex-wrap: wrap;
}

.project-details span {
    font-weight: 700;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
}

/* Video Box - Below description */
.video-box {
    position: fixed;
    top: 58%;
    left: 50%;
    transform: translate(-50%, 0);
    width: 90%;
    max-width: 800px;
    aspect-ratio: 16/9;
    background: rgba(0, 0, 0, 0.9);
    border: 3px solid #000;
    box-shadow: 
        0 0 80px rgba(100, 255, 150, 0.15),
        15px 15px 0 rgba(0, 0, 0, 0.3);
    z-index: 99;
    overflow: hidden;
}

.video-box iframe {
    width: 100%;
    height: 100%;
    display: block;
}

/* Scrollbar Styling */
.description-box::-webkit-scrollbar {
    width: 8px;
}

.description-box::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.description-box::-webkit-scrollbar-thumb {
    background: #000;
}

/* Grain texture overlay */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    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%3CfeTurbulance type='fractalNoise' baseFrequency='2' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    opacity: 0.03;
    pointer-events: none;
    z-index: 9999;
}

/* Animated gradient overlay - dark green vibes */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 30%, rgba(20, 120, 50, 0.2) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(50, 120, 20, 0.15) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
    animation: shift 25s ease-in-out infinite;
}

@keyframes shift {
    0%, 100% { 
        opacity: 0.4;
        transform: scale(1);
    }
    50% { 
        opacity: 0.7;
        transform: scale(1.15);
    }
}
/* Image Lightbox */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    z-index: 99999 !important;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 3rem;
}

.lightbox.active {
    display: flex !important;
}

.lightbox img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    border: none !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
    transform: none !important;
}

.lightbox-close {
    position: fixed;
    top: 2rem;
    right: 2rem;
    color: #fff;
    font-size: 3rem;
    font-weight: 300;
    cursor: pointer;
    z-index: 100000 !important;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
}

.lightbox-close:hover {
    transform: scale(1.2);
    background: rgba(0, 0, 0, 0.8);
}

/* Make gallery images clickable */
.gallery-item,
.cloud-item {
    cursor: pointer;
}

.gallery-item img,
.cloud-item img {
    cursor: pointer;
}


/* Responsive Design */
@media (max-width: 1200px) {
    /* Scale down images on medium screens */
    .gallery-item {
        width: 250px !important;
    }
}

@media (max-width: 768px) {
    /* Mobile - stack everything vertically */
    .chaos-grid {
        position: relative;
        height: auto;
        padding: 2rem 1rem;
        display: flex;
        flex-direction: column;
        gap: 2rem;
    }
    
    .gallery-item {
        position: relative !important;
        width: 100% !important;
        left: 0 !important;
        right: 0 !important;
        top: 0 !important;
        transform: rotate(0deg) !important;
        margin: 0 auto;
    }
    
    .back-button {
        top: 1rem;
        left: 1rem;
        font-size: 1rem;
        padding: 0.75rem 1rem;
    }
    
    .description-box {
        position: relative;
        top: 0;
        left: 0;
        transform: none;
        margin: 2rem auto;
        padding: 2rem;
        max-height: none;
    }
    
    .description-box h1 {
        font-size: 2rem;
    }
    
    .video-box {
        position: relative;
        top: 0;
        left: 0;
        transform: none;
        margin: 2rem auto;
    }
    
    body {
        min-height: 100vh;
    }
    
    .gallery-container {
        min-height: auto;
    }
}