/* ========================================================
   PLICA Premium Animation System
   ======================================================== */

/* -------------------------------------------------------------
   1. SPLASH SCREENS (Home & Internal)
------------------------------------------------------------- */
#plica-splash {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background-color: #0a0a0a;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: opacity, transform;
}

#plica-splash.splash-hiding {
    opacity: 0;
    pointer-events: none;
    transform: scale(1.02);
}

/* Home Logo Fill Animation */
.splash-logo-container {
    position: relative;
    width: 200px;
    height: 80px;
}

.splash-logo-base {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    opacity: 0.15;
    filter: grayscale(100%);
}

.splash-logo-fill {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    clip-path: inset(100% 0 0 0); /* Starts hidden from bottom up */
    animation: fill-up 1.6s cubic-bezier(0.65, 0, 0.35, 1) forwards;
}

@keyframes fill-up {
    0% { clip-path: inset(100% 0 0 0); }
    100% { clip-path: inset(0 0 0 0); }
}

/* Coffee Bean Falling Animation (Internal HTMLs) */
.splash-bean-container {
    position: relative;
    width: 280px;
    height: 280px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.bean-flake {
    position: absolute;
    width: 160px;
    height: 160px;
    object-fit: contain;
    animation: bean-fall 2.5s infinite cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
}

.bean-bg-1 {
    width: 90px;
    height: 90px;
    filter: blur(2px) brightness(80%);
    animation-delay: 0.2s;
    left: 20%;
    animation-duration: 3s;
}

.bean-bg-2 {
    width: 110px;
    height: 110px;
    filter: blur(1px) brightness(60%);
    animation-delay: 0.8s;
    right: 15%;
    animation-duration: 2.7s;
}

.bean-fg {
    z-index: 10;
}

@keyframes bean-fall {
    0% {
        transform: translateY(-160px) rotate(-15deg);
        opacity: 0;
    }
    15% { opacity: 0.8; }
    85% { opacity: 0.8; }
    100% {
        transform: translateY(160px) rotate(15deg);
        opacity: 0;
    }
}

/* -------------------------------------------------------------
   2. SCROLL REVEAL ANIMATIONS
------------------------------------------------------------- */
.reveal-up,
.reveal-scale,
.reveal-fade {
    opacity: 0;
    will-change: transform, opacity;
}

.reveal-up {
    transform: translateY(30px);
}

.reveal-scale {
    transform: scale(0.92);
}

.reveal-fade {
    transform: none;
}

/* Revealed State - uses premium bounce */
.is-revealed {
    opacity: 1 !important;
    transform: translate(0) scale(1) !important;
    transition: opacity 1s cubic-bezier(0.16, 1, 0.3, 1), transform 1s cubic-bezier(0.2, 0.8, 0.2, 1.05) !important;
}

/* Stagger Delays */
.delay-100.is-revealed { transition-delay: 0.1s !important; }
.delay-200.is-revealed { transition-delay: 0.2s !important; }
.delay-300.is-revealed { transition-delay: 0.3s !important; }
.delay-400.is-revealed { transition-delay: 0.4s !important; }
.delay-500.is-revealed { transition-delay: 0.5s !important; }

/* -------------------------------------------------------------
   4. CONSTANT AMBIENT ANIMATIONS (SECTIONS)
------------------------------------------------------------- */
.animate-breathe-slow {
    animation: breathe 8s ease-in-out infinite alternate;
}

@keyframes breathe {
    0% { transform: translate(-50%, -50%) scale(0.95); opacity: 0.3; }
    100% { transform: translate(-50%, -50%) scale(1.05); opacity: 0.7; }
}

.animate-pulse-core {
    animation: corePulse 4s ease-in-out infinite;
}

@keyframes corePulse {
    0%, 100% { transform: scale(1); opacity: 0; }
    50% { transform: scale(1.4); opacity: 0.8; }
}

.animate-energy-flow {
    animation: energyFlow 4s linear infinite;
    background-size: 200% 100%;
}

@keyframes energyFlow {
    0% { transform: translateX(-100%); opacity: 0; }
    20% { opacity: 1; }
    80% { opacity: 1; }
    100% { transform: translateX(100%); opacity: 0; }
}

.animate-float-delay-1 { animation: organicFloat 6s ease-in-out infinite; }
.animate-float-delay-2 { animation: organicFloat 6s ease-in-out infinite 1.5s; }
.animate-float-delay-3 { animation: organicFloat 6s ease-in-out infinite 3s; }

@keyframes organicFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

/* -------------------------------------------------------------
   5. REDUCED MOTION FALLBACK
------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    .reveal-up, .reveal-scale, .reveal-fade {
        opacity: 1;
        transform: none;
    }
}

/* PLICA Map Marker Glow */
.plica-map-pin {
    filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.95)) drop-shadow(0 6px 14px rgba(0, 0, 0, 0.8)) !important;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.plica-map-pin:hover {
    transform: scale(1.15);
}

/* Image Protection Security */
img {
    -webkit-user-select: none !important;
    -khtml-user-select: none !important;
    -moz-user-select: none !important;
    -o-user-select: none !important;
    user-select: none !important;
    -webkit-user-drag: none !important;
    -khtml-user-drag: none !important;
    -moz-user-drag: none !important;
    -o-user-drag: none !important;
    user-drag: none !important;
    -webkit-touch-callout: none !important;
}
