/* ============================================================
   Animation keyframes & scroll-triggered animation system
   ============================================================ */

/* ── Keyframes ───────────────────────────────────────────── */

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(32px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInLeft {
    from { opacity: 0; transform: translateX(-32px); }
    to   { opacity: 1; transform: translateX(0); }
}

@keyframes fadeInRight {
    from { opacity: 0; transform: translateX(32px); }
    to   { opacity: 1; transform: translateX(0); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

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

@keyframes pulseGlow {
    0%, 100% { box-shadow: 0 0 20px rgba(108, 99, 255, 0.3); }
    50%      { box-shadow: 0 0 45px rgba(108, 99, 255, 0.65), 0 0 70px rgba(0, 212, 255, 0.2); }
}

@keyframes pulseOpacity {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.55; }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes blink {
    from, to { opacity: 1; }
    50%      { opacity: 0; }
}

@keyframes gradientShift {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes shimmer {
    0%   { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

@keyframes heroNameReveal {
    from { opacity: 0; transform: translateY(24px) skewY(1deg); filter: blur(8px); }
    to   { opacity: 1; transform: translateY(0)    skewY(0deg); filter: blur(0); }
}

@keyframes borderGlow {
    0%, 100% { box-shadow: 0 0 20px rgba(108, 99, 255, 0.2); }
    50%       { box-shadow: 0 0 40px rgba(108, 99, 255, 0.45), 0 0 70px rgba(0, 212, 255, 0.15); }
}

@keyframes pulseLive {
    0%, 100% { box-shadow: 0 0 0 0 rgba(35, 209, 139, 0.5); }
    50%       { box-shadow: 0 0 0 5px rgba(35, 209, 139, 0); }
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.92); }
    to   { opacity: 1; transform: scale(1); }
}

/* ── Scroll-triggered animation base ────────────────────── */

.animate-on-scroll {
    transform: translateY(22px);
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform;
}

.animate-on-scroll.from-left {
    transform: translateX(-22px);
}

.animate-on-scroll.from-right {
    transform: translateX(22px);
}

@media (max-width: 900px) {
    .animate-on-scroll.from-left,
    .animate-on-scroll.from-right {
        transform: translateY(22px);
    }
}

.animate-on-scroll.visible {
    transform: translate(0, 0);
}

/* ── Stagger delay utilities ─────────────────────────────── */
.delay-100 { transition-delay: 0.1s; }
.delay-200 { transition-delay: 0.2s; }
.delay-300 { transition-delay: 0.3s; }
.delay-400 { transition-delay: 0.4s; }
.delay-500 { transition-delay: 0.5s; }
.delay-600 { transition-delay: 0.6s; }
.delay-700 { transition-delay: 0.7s; }
.delay-800 { transition-delay: 0.8s; }

/* ── Direct animation utility classes ───────────────────── */
.anim-fade-in-up    { animation: fadeInUp  0.65s ease both; }
.anim-fade-in-left  { animation: fadeInLeft  0.65s ease both; }
.anim-fade-in-right { animation: fadeInRight 0.65s ease both; }
.anim-float         { animation: floatY 4s ease-in-out infinite; }
.anim-pulse-glow    { animation: pulseGlow 3s ease-in-out infinite; }
.anim-spin          { animation: spin 4s linear infinite; }

/* ── Page entry animation ────────────────────────────────── */

@keyframes pageEnter {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

.v2-root {
    animation: pageEnter 0.55s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

/* ── Route transition progress bar ──────────────────────── */

@keyframes routeBarSlide {
    0%   { transform: scaleX(0);   opacity: 1; }
    80%  { transform: scaleX(0.9); opacity: 1; }
    100% { transform: scaleX(1);   opacity: 0; }
}

.route-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #FFB454 0%, #FF9A1F 50%, #FFD68A 100%);
    transform-origin: left center;
    transform: scaleX(0);
    z-index: 10000;
    pointer-events: none;
    animation: routeBarSlide 1.1s cubic-bezier(0.4, 0, 0.2, 1) 0.05s both;
}
