/* ==========================================================================
   Animations - Keyframes, Utility Classes, Scroll-Triggered States
   ========================================================================== */

/* ---------- Keyframe Animations ---------- */
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-12px); }
}

@keyframes float-slow {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-8px) rotate(2deg); }
}

@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(var(--color-primary-rgb), 0.2); }
    50% { box-shadow: 0 0 20px 5px rgba(var(--color-primary-rgb), 0.15); }
}

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

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

@keyframes slide-marquee {
    from { transform: translateX(0); }
    to { transform: translateX(-33.33%); }
}

@keyframes dash {
    to { stroke-dashoffset: 0; }
}

@keyframes blob {
    0%, 100% { border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%; }
    25% { border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%; }
    50% { border-radius: 50% 60% 30% 60% / 30% 60% 70% 40%; }
    75% { border-radius: 60% 40% 60% 30% / 60% 40% 30% 70%; }
}

/* ---------- Animation Utility Classes ---------- */
.animate-float {
    animation: float 3s ease-in-out infinite;
}

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

.animate-float-delay-1 {
    animation: float 3s ease-in-out 0.5s infinite;
}

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

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

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

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

/* ---------- Scroll-Triggered Animation States ---------- */
/*
 * IMPORTANT: No CSS opacity:0 or transform here.
 * GSAP's fromTo() sets initial state inline right before animating.
 * CSS pre-hiding causes blank sections when GSAP has loading delays.
 */

/* ---------- 3D Perspective ---------- */
.perspective-container {
    perspective: 1200px;
}

.tilt-card {
    transition: transform 0.4s cubic-bezier(0.03, 0.98, 0.52, 0.99), box-shadow 0.4s ease;
    transform-style: preserve-3d;
}

.tilt-card:hover {
    box-shadow: var(--shadow-xl);
}

/* Glowing border effect */
.glow-border {
    position: relative;
}

.glow-border::after {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: inherit;
    background: conic-gradient(
        from 0deg,
        var(--color-primary),
        var(--color-accent),
        var(--color-primary-light),
        var(--color-primary)
    );
    z-index: -1;
    opacity: 0;
    transition: opacity var(--transition-base);
    filter: blur(8px);
}

.glow-border:hover::after {
    opacity: 0.5;
}

/* ---------- Decorative Shapes ---------- */
.deco-shape {
    position: absolute;
    pointer-events: none;
    z-index: 0;
}

.deco-circle {
    border-radius: 50%;
    background: rgba(var(--color-primary-rgb), 0.08);
}

.deco-circle--accent {
    background: rgba(var(--color-accent-rgb), 0.08);
}

.deco-dot-grid {
    width: 120px;
    height: 120px;
    background-image: radial-gradient(circle, rgba(var(--color-primary-rgb), 0.15) 1.5px, transparent 1.5px);
    background-size: 16px 16px;
}

/* ---------- Reduced Motion ---------- */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
