body {
    margin: 0;
    font-family: 'Lato', sans-serif;
    background: linear-gradient(120deg, #f8fafc 60%, #e0e7ff 100%);
    min-height: 100vh;
}

.gallery-header {
    text-align: center;
    padding: 40px 10px 20px 10px;
    background: linear-gradient(90deg, #6366f1 60%, #fd841f 100%);
    color: #fff;
    border-bottom-left-radius: 30px;
    border-bottom-right-radius: 30px;
    box-shadow: 0 4px 24px rgba(99,102,241,0.12);
    animation: fadeDown 1s cubic-bezier(.77,0,.18,1) forwards;
}

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

.gallery-header h1 {
    font-family: 'Caudex', serif;
    font-size: 2.8rem;
    margin: 0;
    letter-spacing: 2px;
    text-shadow: 2px 2px 8px #2222;
}

.gallery-subtitle {
    font-size: 1.3rem;
    margin-top: 10px;
    font-weight: 500;
    letter-spacing: 1px;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 28px;
    padding: 40px 5vw;
    margin-top: 20px;
    animation: fadeIn 1.2s cubic-bezier(.77,0,.18,1) forwards;
}

@keyframes fadeIn {
    0% { opacity: 0; transform: scale(0.95);}
    100% { opacity: 1; transform: scale(1);}
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 18px;
    box-shadow: 0 4px 24px rgba(99,102,241,0.12);
    background: #fff;
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
    animation: popIn 0.7s cubic-bezier(.77,0,.18,1);
}

@keyframes popIn {
    0% { opacity: 0; transform: scale(0.8);}
    100% { opacity: 1; transform: scale(1);}
}

.gallery-item:hover {
    transform: scale(1.04) rotate(-1deg);
    box-shadow: 0 8px 32px rgba(99,102,241,0.18);
}

.gallery-img {
    width: 100%;
    height: 260px;
    object-fit: cover;
    display: block;
    transition: filter 0.3s;
    filter: grayscale(0.1) brightness(0.98);
}

.gallery-item:hover .gallery-img {
    filter: grayscale(0) brightness(1.08);
}

.gallery-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(0deg, #6366f1cc 80%, transparent 100%);
    color: #fff;
    padding: 16px 12px 10px 18px;
    font-size: 1.08em;
    font-family: 'Caudex', serif;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

.gallery-item:hover .gallery-caption {
    opacity: 1;
}

@media (max-width: 600px) {
    .gallery-header h1 {
        font-size: 2rem;
    }
    .gallery-img {
        height: 160px;
    }
    .gallery-grid {
        padding: 20px 2vw;
        gap: 16px;
    }
}