/* ============================================
   MAPPIN LANDING — ANIMATIONS LIBRARY
   ============================================ */

/* ---------- KEYFRAMES ---------- */

/* Gradient text/border shift */
@keyframes gradient {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* Gentle float */
@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-15px) rotate(1deg); }
}

/* Reverse float */
@keyframes float-reverse {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(15px) rotate(-1deg); }
}

/* Shimmer effect */
@keyframes shimmer {
    0% { background-position: -1000px 0; }
    100% { background-position: 1000px 0; }
}

/* Pulse ring (for live indicators) */
@keyframes pulse-ring {
    0% { transform: scale(0.8); opacity: 0.5; }
    100% { transform: scale(2); opacity: 0; }
}

/* Slow pulse */
@keyframes pulse-glow {
    0%, 100% { opacity: 0.3; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(1.05); }
}

/* Fade up */
@keyframes fade-up {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Fade in */
@keyframes fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Scale in */
@keyframes scale-in {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

/* Slide from left */
@keyframes slide-from-left {
    from { opacity: 0; transform: translateX(-30px); }
    to { opacity: 1; transform: translateX(0); }
}

/* Slide from right */
@keyframes slide-from-right {
    from { opacity: 0; transform: translateX(30px); }
    to { opacity: 1; transform: translateX(0); }
}

/* Rotate 360 */
@keyframes spin-slow {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Blink cursor (typing effect) */
@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* Gradient border rotation */
@keyframes border-rotate {
    0% { --angle: 0deg; }
    100% { --angle: 360deg; }
}

@property --angle {
    syntax: '<angle>';
    initial-value: 0deg;
    inherits: false;
}

/* Number counter shift */
@keyframes count-shift {
    0% { transform: translateY(100%); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
}

/* Bounce arrow */
@keyframes bounce-x {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(4px); }
}

/* Scroll indicator */
@keyframes scroll-indicator {
    0%, 100% { transform: translateY(0); opacity: 0.4; }
    50% { transform: translateY(10px); opacity: 1; }
}

/* Blob morphing */
@keyframes blob-morph {
    0%, 100% { border-radius: 50% 50% 50% 50%; transform: translate(0, 0) rotate(0deg); }
    33% { border-radius: 60% 40% 30% 70%; transform: translate(30px, -20px) rotate(120deg); }
    66% { border-radius: 40% 60% 70% 30%; transform: translate(-20px, 30px) rotate(240deg); }
}

/* ---------- UTILITY ANIMATION CLASSES ---------- */
.animate-float {
    animation: float 6s ease-in-out infinite;
}

.animate-float-slow {
    animation: float 10s ease-in-out infinite;
}

.animate-float-reverse {
    animation: float-reverse 8s ease-in-out infinite;
}

.animate-shimmer {
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.06), transparent);
    background-size: 1000px 100%;
    animation: shimmer 3s linear infinite;
}

.animate-gradient {
    background-size: 200% 200%;
    animation: gradient 8s ease infinite;
}

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

.animate-spin-slow {
    animation: spin-slow 20s linear infinite;
}

.animate-blob {
    animation: blob-morph 20s ease-in-out infinite;
}

.animate-blink {
    animation: blink 1s step-end infinite;
}

.animate-bounce-x {
    animation: bounce-x 1s ease-in-out infinite;
}

/* Staggered delays */
.delay-100 { animation-delay: 100ms; }
.delay-200 { animation-delay: 200ms; }
.delay-300 { animation-delay: 300ms; }
.delay-400 { animation-delay: 400ms; }
.delay-500 { animation-delay: 500ms; }
.delay-700 { animation-delay: 700ms; }
.delay-1000 { animation-delay: 1000ms; }

/* ---------- SHINE EFFECT (Hover) ---------- */
.shine-hover {
    position: relative;
    overflow: hidden;
}

.shine-hover::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    transition: left 0.7s ease;
    pointer-events: none;
}

.shine-hover:hover::after {
    left: 100%;
}

/* ---------- MAGNETIC HOVER ---------- */
.magnetic {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---------- CARD LIFT ---------- */
.card-lift {
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-lift:hover {
    transform: translateY(-4px);
}

/* ---------- ROTATING GRADIENT BORDER ---------- */
.rotating-border {
    position: relative;
    background: rgba(15, 15, 35, 0.8);
    border-radius: 1rem;
    padding: 1px;
}

.rotating-border::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: conic-gradient(from var(--angle),
        rgba(124, 92, 255, 0.5),
        rgba(168, 85, 247, 0.5),
        rgba(6, 182, 212, 0.5),
        rgba(124, 92, 255, 0.5));
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    animation: border-rotate 6s linear infinite;
}

/* ---------- BLOB SHAPES ---------- */
.blob {
    position: absolute;
    filter: blur(80px);
    opacity: 0.5;
    z-index: 0;
    pointer-events: none;
    will-change: transform;
}

.blob-brand {
    background: radial-gradient(circle, rgba(124, 92, 255, 0.6), transparent);
}

.blob-violet {
    background: radial-gradient(circle, rgba(168, 85, 247, 0.5), transparent);
}

.blob-cyan {
    background: radial-gradient(circle, rgba(6, 182, 212, 0.4), transparent);
}

/* ---------- SCROLL PERFORMANCE OVERRIDES ---------- */

/* Pause expensive animations while scrolling */
body.is-scrolling .animate-blob,
body.is-scrolling .animate-float,
body.is-scrolling .animate-float-slow,
body.is-scrolling .animate-float-reverse,
body.is-scrolling .animate-pulse-glow,
body.is-scrolling .animate-spin-slow,
body.is-scrolling .animate-shimmer,
body.is-scrolling .animate-gradient {
    animation-play-state: paused !important;
}

/* GPU promote all animated elements */
.animate-blob,
.animate-float,
.animate-float-slow,
.animate-float-reverse,
.hero-float-card,
.hero-blob,
.features-blob-1,
.features-blob-2,
.showcase-blob-1,
.showcase-blob-2 {
    will-change: transform;
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* Reduce blur intensity on lower-end devices */
@media (max-width: 1024px) {
    .hero-blob,
    .features-blob-1,
    .features-blob-2,
    .showcase-blob-1,
    .showcase-blob-2 {
        filter: blur(60px);
        opacity: 0.5;
    }
}