/* Custom Animations & Styles for KittlyCraft */

/* Page Fade-in */
body {
    transition: opacity ease-in 0.2s;
    animation: pageFadeIn 0.8s ease-out;
    background: radial-gradient(circle at top, #261b3b 0, #050714 50%, #020308 100%);
}

body[unresolved] {
    opacity: 0;
    display: block;
    overflow: hidden;
    position: relative;
}

@keyframes pageFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Aurora Background Animation */
@keyframes aurora {

    0%,
    100% {
        opacity: 0.2;
        transform: translate(0, 0) scale(1) translateZ(0);
    }

    50% {
        opacity: 0.3;
        transform: translate(20px, -20px) scale(1.05) translateZ(0);
    }
}

/* Shimmer Animation */
@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

html {
    scroll-behavior: smooth;
}

/* Lightbox Animations */
.lightbox-zoom-in {
    animation: lightboxZoomIn 0.3s ease-out;
}

@keyframes lightboxZoomIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.lightbox-zoom-out {
    animation: lightboxZoomOut 0.25s ease-in;
}

@keyframes lightboxZoomOut {
    from {
        opacity: 1;
        transform: scale(1);
    }

    to {
        opacity: 0;
        transform: scale(0.8);
    }
}

/* Pixel Stars Background */
.pixel-stars {
    position: fixed;
    inset: 0;
    background-image:
        radial-gradient(2px 2px at 10px 20px, rgba(255, 255, 255, 0.8) 50%, transparent 50%),
        radial-gradient(2px 2px at 130px 80px, rgba(255, 192, 203, 0.7) 50%, transparent 50%),
        radial-gradient(2px 2px at 230px 40px, rgba(255, 255, 255, 0.6) 50%, transparent 50%);
    background-size: 200px 200px;
    opacity: 0.5;
    pointer-events: none;
    z-index: -1;
    will-change: transform;
    animation: starDrift 40s linear infinite alternate;
    transform: translateZ(0);
}

@keyframes starDrift {
    0% {
        transform: translate3d(0, 0, 0) translateZ(0);
    }

    100% {
        transform: translate3d(-10px, 8px, 0) scale(1.02) translateZ(0);
    }
}

/* Fade Up Animations */
@keyframes fadeUp {
    0% {
        opacity: 0;
        transform: translateY(20px) scale(0.98);
    }

    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes fadeInBlur {
    0% {
        opacity: 0;
        filter: blur(8px);
        transform: scale(0.97);
    }

    100% {
        opacity: 1;
        filter: blur(0);
        transform: scale(1);
    }
}

.anim-fade-up {
    animation: fadeUp .7s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.anim-fade-delay-1 {
    animation-delay: .15s;
}

.anim-fade-delay-2 {
    animation-delay: .3s;
}

.anim-fade-delay-3 {
    animation-delay: .45s;
}

.anim-fade-blur {
    animation: fadeInBlur .9s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Top SCroll Loader */
#top-loader {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    width: 0;
    background: linear-gradient(90deg, #ff69b4, #ffb7e2);
    z-index: 9999;
    transition: width .25s ease-out, opacity .4s ease-out;
}

/* Pixel Button */
.pixel-btn {
    box-shadow: 0 0 0 2px #fff4fa, 0 10px 0 #b5447e, 0 18px 30px rgba(0, 0, 0, 0.45);
    transform: translateY(0);
    transition: transform .15s ease-out, box-shadow .15s ease-out, filter .15s ease-out;
}

.pixel-btn:hover {
    transform: translateY(2px);
    box-shadow: 0 0 0 2px #fff4fa, 0 5px 0 #8d315f, 0 10px 20px rgba(0, 0, 0, 0.55);
    filter: brightness(1.03);
}

.pixel-btn:active {
    transform: translateY(6px);
    box-shadow: 0 0 0 2px #fff4fa, 0 0 0 #8d315f, 0 3px 10px rgba(0, 0, 0, 0.7);
}

/* FAQ Items */
.faq-item button[aria-expanded="true"] .faq-icon {
    transform: rotate(90deg);
}

.faq-content {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out, opacity 0.25s ease-out, transform 0.25s ease-out;
    transform: translateY(-4px);
}

.faq-content.open {
    max-height: 200px;
    opacity: 1;
    transform: translateY(0);
}

/* Hover Effects */
.wiggle-hover {
    transition: transform .2s ease-out, box-shadow .2s ease-out, border-color .2s ease-out;
    will-change: transform, box-shadow;
    transform: translateZ(0);
}

.wiggle-hover:hover {
    transform: translateY(-3px) rotate(-0.3deg) scale(1.005) translateZ(0);
    box-shadow: 0 16px 35px rgba(0, 0, 0, 0.6);
    border-color: rgba(255, 255, 255, 0.2);
}

/* Notification Toast */
.notification {
    position: fixed;
    top: 90px;
    right: 20px;
    background: linear-gradient(135deg, #ff69b4, #ffb7e2);
    color: #fff;
    padding: 12px 18px;
    border-radius: 999px;
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.35);
    z-index: 100;
    display: flex;
    gap: 8px;
    align-items: center;
    font-size: 0.75rem;
    animation: slideIn .2s ease-out, fadeOut .3s ease-in 2.4s forwards;
}

@keyframes slideIn {
    from {
        transform: translateX(200px);
        opacity: 0;
    }

    to {
        transform: none;
        opacity: 1;
    }
}

@keyframes fadeOut {
    to {
        opacity: 0;
        transform: translateX(200px);
    }
}

/* Float Animation */
.float-soft {
    animation: floatSoft 6s ease-in-out infinite alternate;
}

@keyframes floatSoft {
    0% {
        transform: translate3d(0, 0, 0);
    }

    100% {
        transform: translate3d(0, -10px, 0);
    }
}

/* Gallery Card */
.gallery-card {
    transition: transform .2s ease-out, box-shadow .2s ease-out, border-color .2s ease-out;
    will-change: transform, box-shadow;
    transform: translateZ(0);
}

.gallery-card:hover {
    transform: translateY(-3px) scale(1.005) translateZ(0);
    box-shadow: 0 16px 35px rgba(0, 0, 0, 0.6);
    border-color: rgba(255, 255, 255, 0.2);
}

/* Modal States */
.backdrop-hidden {
    opacity: 0;
    pointer-events: none;
}

.backdrop-visible {
    opacity: 1;
    pointer-events: auto;
}

.modal-scale-in {
    transform: translateY(10px) scale(0.97);
    opacity: 0;
}

.modal-scale-in.modal-open {
    transform: translateY(0) scale(1);
    opacity: 1;
}

/* Clouds */
@keyframes cloudDrift {
    0% {
        background-position-x: 0;
    }

    100% {
        background-position-x: -800px;
    }
}