* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {

    min-height: 100vh;

    background:
        url('../assets/img/fairy-bg.png');

    background-size: cover;

    background-position: center;

    font-family: 'Poppins', sans-serif;

    padding: 30px 15px;
}

/* Overlay */

body::before {

    content: "";

    position: fixed;

    inset: 0;

    background:
        rgba(10, 10, 25, .55);

    z-index: -1;
}

/* Title */

.gallery-title {

    text-align: center;

    font-family: 'Allura', cursive;

    font-size: 62px;

    color: #f4ddd1;

    margin-top: -5px;

    margin-bottom: 5px;

    text-shadow:
        0 0 10px rgba(255, 230, 210, .5),
        0 0 25px rgba(255, 230, 210, .2);

    animation:
        titleFade 1.5s ease;
}

/* Grid */

.photo-grid {

    display: grid;

    grid-template-columns:
        repeat(2, 1fr);

    gap: 12px;

    max-width: 450px;

    margin: auto;
}

/* Photo */

.photo-grid img {

    width: 100%;

    aspect-ratio: 1/1;

    object-fit: cover;

    border-radius: 18px;

    cursor: pointer;

    transition: .3s;

    border: 1px solid rgba(255, 255, 255, .15);

    box-shadow: 0 8px 25px rgba(0, 0, 0, .2);

    opacity: 0;

    animation:
        photoAppear .8s ease forwards,
        floatPhoto 4s ease-in-out infinite;
}

.photo-grid img:nth-child(1) {
    animation-delay: 0s, 0s;
}

.photo-grid img:nth-child(2) {
    animation-delay: .2s, .5s;
}

.photo-grid img:nth-child(3) {
    animation-delay: .4s, 1s;
}

.photo-grid img:nth-child(4) {
    animation-delay: .6s, 1.5s;
}


.photo-grid img:hover {

    transform:
        scale(1.04) translateY(-3px);

    box-shadow:
        0 0 20px rgba(255, 230, 180, .4),
        0 0 40px rgba(255, 230, 180, .2),
        0 12px 30px rgba(0, 0, 0, .3);
}

/* Popup */

.popup {

    position: fixed;

    inset: 0;

    background:
        rgba(0, 0, 0, .85);

    display: none;

    justify-content: center;

    align-items: center;

    z-index: 999;
}

.popup img {

    width: 90%;

    max-width: 500px;

    border-radius: 20px;

    box-shadow:
        0 0 40px rgba(255, 255, 255, .15);
}

/* Mobile */

@media(max-width:480px) {

    .gallery-title {

        font-size: 46px;
    }

}

/* =========================
   BACK BUTTON
========================= */

.back-btn {

    position: fixed;

    top: 20px;

    left: 20px;

    z-index: 100;

    text-decoration: none;

    padding: 12px 22px;

    border-radius: 50px;

    background:
        rgba(255, 255, 255, .12);

    backdrop-filter: blur(10px);

    border:
        1px solid rgba(255, 255, 255, .2);

    color: #fff;

    font-size: 15px;

    transition: .3s;
}

.back-btn:hover {

    transform:
        translateY(-2px);

    background:
        rgba(255, 255, 255, .18);
}

/* =========================
   NAVIGATION
========================= */

.gallery-navigation {

    max-width: 450px;

    margin: 35px auto 0;

    display: flex;

    justify-content: space-between;

    align-items: center;
}

.nav-btn {

    text-decoration: none;

    color: #f4ddd1;

    font-size: 18px;

    font-family: 'Cormorant Garamond', serif;

    letter-spacing: 1px;

    transition: .3s;

    text-shadow:
        0 0 10px rgba(255, 230, 210, .2);
}

.nav-btn:hover {

    transform: translateY(-2px);

    color: #fff;
}

@keyframes titleFade {

    from {

        opacity: 0;

        transform:
            translateY(-20px);
    }

    to {

        opacity: 1;

        transform:
            translateY(0);
    }
}

@keyframes photoAppear {

    from {

        opacity: 0;

        transform:
            scale(.6);
    }

    to {

        opacity: 1;

        transform:
            scale(1);
    }
}

@keyframes floatPhoto {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-8px);
    }
}

to {

    opacity: 1;

    transform:
        scale(1);
}

/* =========================
   FAIRY CROWN
========================= */

.gallery-crown {

    width: 100%;

    display: flex;

    justify-content: center;

    align-items: center;

    text-align: center;

    font-size: 42px;

    color: #fffdf8;

    margin-bottom: -5px;

    text-shadow:
        0 0 10px rgba(255, 255, 255, .8),
        0 0 20px rgba(255, 230, 180, .8),
        0 0 40px rgba(255, 230, 180, .6);
}

/* =========================
   GALLERY DIVIDER
========================= */

.gallery-divider {

    width: 100%;

    display: flex;

    justify-content: center;

    align-items: center;

    text-align: center;

    font-size: 24px;

    color: #fffdf8;

    margin-top: -15px;

    margin-bottom: 35px;
}

@keyframes fairyGlow {

    0% {

        opacity: .7;

        filter: brightness(1);
    }

    50% {

        opacity: 1;

        filter: brightness(1.5);
    }

    100% {

        opacity: .7;

        filter: brightness(1);
    }
}