
body {
    min-height: 100vh;
    background: linear-gradient(to bottom, #0B0B1F, #1F1F3F);
    padding: 2rem;
    perspective: 1000px;
    overflow-x: hidden;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: radial-gradient(white, rgba(255,255,255,.2) 2px, transparent 4px),
        radial-gradient(white, rgba(255,255,255,.15) 1px, transparent 3px),
        radial-gradient(white, rgba(255,255,255,.1) 2px, transparent 4px);
    background-size: 550px 550px, 350px 350px, 250px 250px;
    background-position: 0 0, 40px 60px, 130px 270px;
    z-index: 0;
}

.scene {
    width: 100%;
    min-height: 300vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    position: relative;
    z-index: 1;
    padding-top: 5vh;
}

.gallery {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    padding: 2rem;
    transform-style: preserve-3d;
    transition: transform 0.5s ease-out;
    width: 100%;
    max-width: 1400px;
}

@media (min-width: 768px) {
    .gallery {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1024px) {
    .gallery {
        grid-template-columns: repeat(3, 1fr);
        display: grid;
        gap: 40px;
    }
}

.polaroid {
    background: #fff;
    padding: 1rem;
    padding-bottom: 2rem;
    box-shadow: 0 0.2rem 1.2rem rgba(255,255,255,0.1);
    width: 100%;
    transition: all 0.35s ease;
    position: relative;
    cursor: pointer;
    transform-style: preserve-3d;
}

.polaroid img {
    max-width: 100%;
    height: auto;
    filter: saturate(0.8) contrast(1.1);
    transition: all 0.35s ease;
}

.polaroid:hover {
    transform: scale(1.1) !important;
    z-index: 10;
    box-shadow: 0 0.5rem 2rem rgba(255,255,255,0.2);
}

.polaroid:hover img {
    filter: saturate(1.1) contrast(1.2);
}

.caption {
    font-family: 'Indie Flower', cursive;
    font-size: 1.2rem;
    text-align: center;
    margin: 1rem 0 0;
    color: #333;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    z-index: 1000;
    opacity: 0;
}

.modal-frame {
    position: relative;
    background: #fff;
    padding: 1rem;
    padding-bottom: 2rem;
    max-width: 90%;
    width: auto;
    margin: 50px auto;
    box-shadow: 0 0 30px rgba(255,255,255,0.2);
}

.modal-content {
    display: block;
    max-width: 100%;
    max-height: 80vh;
    width: auto;
}

.close-btn {
    position: absolute;
    top: -40px;
    right: -40px;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s;
    z-index: 1001;
}

.close-btn:hover {
    color: #ccc;
}

.modal-caption {
    font-family: 'Indie Flower', cursive;
    font-size: 1.5rem;
    text-align: center;
    color: #333;
    padding: 20px;
    margin: 0;
}
