/* ===========================
   QUANTAXY ANIMATION SYSTEM
   "Quantum Precision Motion"
   =========================== */

/* ===========================
   CUSTOM EASING FUNCTIONS
   =========================== */
:root {
    /* Premium Easing Curves */
    --ease-smooth: cubic-bezier(0.25, 0.1, 0.25, 1);
    --ease-snap: cubic-bezier(0.5, 0, 0.1, 1);
    --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
    --ease-elastic: cubic-bezier(0.68, -0.55, 0.265, 1.55);
    --ease-luxury: cubic-bezier(0.19, 1, 0.22, 1);

    /* Animation Durations */
    --duration-instant: 100ms;
    --duration-fast: 200ms;
    --duration-normal: 400ms;
    --duration-slow: 600ms;
    --duration-slower: 800ms;
    --duration-slowest: 1200ms;
}

/* ===========================
   CUSTOM AOS ANIMATIONS
   Premium scroll-triggered reveals
   =========================== */

/* Precision Fade Up - Like data points appearing */
[data-aos="precision-up"] {
    opacity: 0;
    transform: translate3d(0, 60px, 0);
    transition-property: opacity, transform;
}
[data-aos="precision-up"].aos-animate {
    opacity: 1;
    transform: translate3d(0, 0, 0);
}

/* Quantum Reveal - Scale with glow */
[data-aos="quantum-reveal"] {
    opacity: 0;
    transform: scale(0.92) translate3d(0, 30px, 0);
    filter: blur(8px);
    transition-property: opacity, transform, filter;
}
[data-aos="quantum-reveal"].aos-animate {
    opacity: 1;
    transform: scale(1) translate3d(0, 0, 0);
    filter: blur(0);
}

/* Slide from Left with Clip */
[data-aos="slide-clip-left"] {
    opacity: 0;
    clip-path: inset(0 100% 0 0);
    transform: translate3d(-30px, 0, 0);
    transition-property: opacity, clip-path, transform;
}
[data-aos="slide-clip-left"].aos-animate {
    opacity: 1;
    clip-path: inset(0 0 0 0);
    transform: translate3d(0, 0, 0);
}

/* Slide from Right with Clip */
[data-aos="slide-clip-right"] {
    opacity: 0;
    clip-path: inset(0 0 0 100%);
    transform: translate3d(30px, 0, 0);
    transition-property: opacity, clip-path, transform;
}
[data-aos="slide-clip-right"].aos-animate {
    opacity: 1;
    clip-path: inset(0 0 0 0);
    transform: translate3d(0, 0, 0);
}

/* Golden Entrance - With subtle glow */
[data-aos="golden-entrance"] {
    opacity: 0;
    transform: translate3d(0, 40px, 0) scale(0.98);
    transition-property: opacity, transform, box-shadow;
}
[data-aos="golden-entrance"].aos-animate {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
}

/* Data Grid Reveal - For cards/grid items */
[data-aos="grid-reveal"] {
    opacity: 0;
    transform: translate3d(0, 30px, -50px) rotateX(10deg);
    transform-origin: center top;
    transition-property: opacity, transform;
}
[data-aos="grid-reveal"].aos-animate {
    opacity: 1;
    transform: translate3d(0, 0, 0) rotateX(0);
}

/* Zoom Soft - Subtle scale */
[data-aos="zoom-soft"] {
    opacity: 0;
    transform: scale(0.85);
    transition-property: opacity, transform;
}
[data-aos="zoom-soft"].aos-animate {
    opacity: 1;
    transform: scale(1);
}

/* Text Reveal - For headings */
[data-aos="text-reveal"] {
    opacity: 0;
    transform: translate3d(0, 100%, 0);
    transition-property: opacity, transform;
}
[data-aos="text-reveal"].aos-animate {
    opacity: 1;
    transform: translate3d(0, 0, 0);
}

/* Blur In */
[data-aos="blur-in"] {
    opacity: 0;
    filter: blur(20px);
    transform: scale(1.1);
    transition-property: opacity, filter, transform;
}
[data-aos="blur-in"].aos-animate {
    opacity: 1;
    filter: blur(0);
    transform: scale(1);
}

/* Counter Reveal - For statistics */
[data-aos="counter-reveal"] {
    opacity: 0;
    transform: translate3d(0, 20px, 0) scale(0.9);
    transition-property: opacity, transform;
}
[data-aos="counter-reveal"].aos-animate {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
}

/* ===========================
   HERO ANIMATIONS
   Dramatic entrance sequences
   =========================== */

@keyframes heroTitleReveal {
    0% {
        opacity: 0;
        transform: translate3d(0, 80px, 0);
        filter: blur(10px);
    }
    60% {
        filter: blur(0);
    }
    100% {
        opacity: 1;
        transform: translate3d(0, 0, 0);
        filter: blur(0);
    }
}

@keyframes heroSubtitleReveal {
    0% {
        opacity: 0;
        transform: translate3d(0, 40px, 0);
    }
    100% {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

@keyframes heroCTAReveal {
    0% {
        opacity: 0;
        transform: translate3d(0, 30px, 0) scale(0.95);
    }
    100% {
        opacity: 1;
        transform: translate3d(0, 0, 0) scale(1);
    }
}

@keyframes heroGlowPulse {
    0%, 100% {
        opacity: 0.5;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.05);
    }
}

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

/* Hero Animation Classes */
.hero-title-animated {
    animation: heroTitleReveal 1.2s var(--ease-luxury) forwards;
    animation-delay: 0.2s;
    opacity: 0;
}

.hero-subtitle-animated {
    animation: heroSubtitleReveal 1s var(--ease-luxury) forwards;
    animation-delay: 0.6s;
    opacity: 0;
}

.hero-cta-animated {
    animation: heroCTAReveal 0.8s var(--ease-luxury) forwards;
    animation-delay: 1s;
    opacity: 0;
}

/* Animated gradient text */
.text-gradient-animated {
    background-size: 200% auto;
    animation: gradientShift 8s ease infinite;
}

/* ===========================
   FLOATING ELEMENTS
   Ambient motion
   =========================== */

@keyframes floatGentle {
    0%, 100% {
        transform: translate3d(0, 0, 0) rotate(0deg);
    }
    25% {
        transform: translate3d(5px, -10px, 0) rotate(1deg);
    }
    50% {
        transform: translate3d(0, -15px, 0) rotate(0deg);
    }
    75% {
        transform: translate3d(-5px, -8px, 0) rotate(-1deg);
    }
}

@keyframes floatSlow {
    0%, 100% {
        transform: translate3d(0, 0, 0);
    }
    50% {
        transform: translate3d(0, -20px, 0);
    }
}

@keyframes floatRotate {
    0% {
        transform: translate3d(0, 0, 0) rotate(0deg);
    }
    50% {
        transform: translate3d(10px, -15px, 0) rotate(180deg);
    }
    100% {
        transform: translate3d(0, 0, 0) rotate(360deg);
    }
}

@keyframes orbitSlow {
    0% {
        transform: rotate(0deg) translateX(30px) rotate(0deg);
    }
    100% {
        transform: rotate(360deg) translateX(30px) rotate(-360deg);
    }
}

.float-gentle {
    animation: floatGentle 8s ease-in-out infinite;
}

.float-slow {
    animation: floatSlow 6s ease-in-out infinite;
}

.float-rotate {
    animation: floatRotate 20s linear infinite;
}

.orbit-slow {
    animation: orbitSlow 30s linear infinite;
}

/* Staggered floating delays */
.float-delay-1 { animation-delay: 0s; }
.float-delay-2 { animation-delay: -2s; }
.float-delay-3 { animation-delay: -4s; }
.float-delay-4 { animation-delay: -6s; }

/* ===========================
   MICRO-INTERACTIONS
   Hover & active states
   =========================== */

/* Premium Button Hover */
.btn-animated {
    position: relative;
    overflow: hidden;
    transition:
        transform var(--duration-fast) var(--ease-snap),
        box-shadow var(--duration-normal) var(--ease-smooth);
}

.btn-animated::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        120deg,
        transparent 0%,
        rgba(255, 255, 255, 0.1) 50%,
        transparent 100%
    );
    transform: translateX(-100%);
    transition: transform 0.6s var(--ease-smooth);
}

.btn-animated:hover {
    transform: translateY(-2px);
}

.btn-animated:hover::before {
    transform: translateX(100%);
}

.btn-animated:active {
    transform: translateY(0) scale(0.98);
}

/* Magnetic Button Effect */
.btn-magnetic {
    transition: transform var(--duration-fast) var(--ease-snap);
}

/* Card 3D Tilt */
.card-tilt {
    transition: transform var(--duration-normal) var(--ease-smooth);
    transform-style: preserve-3d;
    will-change: transform;
}

.card-tilt:hover {
    transform: perspective(1000px) rotateX(2deg) rotateY(-2deg) translateY(-8px);
}

/* Card Glow on Hover */
.card-glow {
    position: relative;
    transition:
        transform var(--duration-normal) var(--ease-smooth),
        box-shadow var(--duration-slow) var(--ease-smooth);
}

.card-glow::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    opacity: 0;
    transition: opacity var(--duration-slow) var(--ease-smooth);
    box-shadow:
        0 0 40px rgba(212, 175, 55, 0.15),
        0 0 80px rgba(212, 175, 55, 0.08),
        inset 0 0 60px rgba(212, 175, 55, 0.03);
    pointer-events: none;
}

.card-glow:hover {
    transform: translateY(-6px);
}

.card-glow:hover::after {
    opacity: 1;
}

/* Border Trace Animation */
@keyframes borderTrace {
    0% {
        background-position: 0% 0%;
    }
    100% {
        background-position: 400% 0%;
    }
}

.border-trace {
    position: relative;
}

.border-trace::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: inherit;
    padding: 2px;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(212, 175, 55, 0.5),
        rgba(0, 212, 255, 0.5),
        transparent
    );
    background-size: 400% 100%;
    -webkit-mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    animation: borderTrace 3s linear infinite;
    animation-play-state: paused;
    transition: opacity var(--duration-normal) var(--ease-smooth);
}

.border-trace:hover::before {
    opacity: 1;
    animation-play-state: running;
}

/* Link Underline Animation */
.link-animated {
    position: relative;
    text-decoration: none;
}

.link-animated::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--gradient-gold);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform var(--duration-normal) var(--ease-snap);
}

.link-animated:hover::after {
    transform: scaleX(1);
    transform-origin: left;
}

/* ===========================
   STAT COUNTER ANIMATIONS
   =========================== */

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

@keyframes statPulse {
    0%, 100% {
        transform: scale(1);
        text-shadow: 0 0 0 transparent;
    }
    50% {
        transform: scale(1.02);
        text-shadow: 0 0 30px rgba(212, 175, 55, 0.3);
    }
}

.stat-animated {
    animation: countUp 0.8s var(--ease-luxury) forwards;
}

.stat-pulse {
    animation: statPulse 3s ease-in-out infinite;
}

/* ===========================
   BACKGROUND EFFECTS
   Ambient visual elements
   =========================== */

@keyframes gridPulse {
    0%, 100% {
        opacity: 0.03;
    }
    50% {
        opacity: 0.08;
    }
}

@keyframes particleFloat {
    0%, 100% {
        transform: translate(0, 0) scale(1);
        opacity: 0.5;
    }
    50% {
        transform: translate(20px, -30px) scale(1.2);
        opacity: 0.8;
    }
}

@keyframes glowOrb {
    0%, 100% {
        transform: translate(0, 0) scale(1);
        opacity: 0.4;
    }
    33% {
        transform: translate(30px, -20px) scale(1.1);
        opacity: 0.6;
    }
    66% {
        transform: translate(-20px, 10px) scale(0.9);
        opacity: 0.3;
    }
}

/* Animated Grid Background */
.bg-grid-animated {
    position: relative;
}

.bg-grid-animated::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(212, 175, 55, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(212, 175, 55, 0.03) 1px, transparent 1px);
    background-size: 60px 60px;
    animation: gridPulse 8s ease-in-out infinite;
    pointer-events: none;
}

/* Floating Particles Container */
.particles-container {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--color-accent-primary);
    border-radius: 50%;
    opacity: 0.3;
    animation: particleFloat 10s ease-in-out infinite;
}

.particle:nth-child(2n) {
    background: var(--color-accent-secondary);
    animation-duration: 12s;
    animation-delay: -2s;
}

.particle:nth-child(3n) {
    animation-duration: 14s;
    animation-delay: -4s;
}

/* Glow Orbs */
.glow-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.4;
    animation: glowOrb 15s ease-in-out infinite;
    pointer-events: none;
}

.glow-orb-gold {
    background: radial-gradient(circle, rgba(212, 175, 55, 0.4) 0%, transparent 70%);
}

.glow-orb-cyan {
    background: radial-gradient(circle, rgba(0, 212, 255, 0.3) 0%, transparent 70%);
    animation-delay: -5s;
}

/* ===========================
   LOADING STATES
   =========================== */

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

@keyframes dotPulse {
    0%, 80%, 100% {
        transform: scale(0);
        opacity: 0;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

.skeleton-shimmer {
    background: linear-gradient(
        90deg,
        var(--color-surface) 25%,
        var(--color-base-tertiary) 50%,
        var(--color-surface) 75%
    );
    background-size: 200% 100%;
    animation: shimmerWave 1.5s infinite;
}

.loading-dots {
    display: inline-flex;
    gap: 4px;
}

.loading-dots span {
    width: 8px;
    height: 8px;
    background: var(--color-accent-primary);
    border-radius: 50%;
    animation: dotPulse 1.4s ease-in-out infinite;
}

.loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.loading-dots span:nth-child(3) { animation-delay: 0.4s; }

/* ===========================
   SCROLL PROGRESS
   =========================== */

.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: var(--gradient-gold);
    transform-origin: left;
    transform: scaleX(0);
    z-index: 9999;
    transition: transform 0.1s linear;
}

/* ===========================
   PAGE TRANSITIONS
   =========================== */

@keyframes pageEnter {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.page-enter {
    animation: pageEnter 0.6s var(--ease-luxury) forwards;
}

/* ===========================
   TEXT ANIMATIONS
   =========================== */

@keyframes textGlow {
    0%, 100% {
        text-shadow: 0 0 20px rgba(212, 175, 55, 0.3);
    }
    50% {
        text-shadow: 0 0 40px rgba(212, 175, 55, 0.5), 0 0 60px rgba(212, 175, 55, 0.2);
    }
}

@keyframes typewriter {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

.text-glow-animated {
    animation: textGlow 3s ease-in-out infinite;
}

.typewriter {
    overflow: hidden;
    white-space: nowrap;
    animation: typewriter 2s steps(30) forwards;
}

/* ===========================
   ICON ANIMATIONS
   =========================== */

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

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

@keyframes iconSpin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.icon-bounce:hover {
    animation: iconBounce 0.6s ease-in-out;
}

.icon-pulse {
    animation: iconPulse 2s ease-in-out infinite;
}

.icon-spin {
    animation: iconSpin 2s linear infinite;
}

/* ===========================
   ACCESSIBILITY
   Respect user preferences
   =========================== */

@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;
    }

    [data-aos] {
        opacity: 1 !important;
        transform: none !important;
        filter: none !important;
    }

    .float-gentle,
    .float-slow,
    .float-rotate,
    .orbit-slow,
    .glow-orb,
    .particle {
        animation: none !important;
    }
}

/* ===========================
   PERFORMANCE OPTIMIZATIONS
   =========================== */

.will-change-transform {
    will-change: transform;
}

.will-change-opacity {
    will-change: opacity;
}

.gpu-accelerated {
    transform: translateZ(0);
    backface-visibility: hidden;
}
