/* ============================================
   CIPHER DIGITAL - Animations
   ============================================ */

/* ============================================
   Keyframe Animations
   ============================================ */

/* Fade Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Scale Animations */
@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes scaleUp {
    from {
        transform: scale(1);
    }

    to {
        transform: scale(1.05);
    }
}

/* Float Animation */
@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-20px);
    }
}

@keyframes floatRotate {

    0%,
    100% {
        transform: translateY(0) rotate(0deg);
    }

    50% {
        transform: translateY(-15px) rotate(5deg);
    }
}

/* Pulse Animations */
@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

@keyframes pulseGlow {

    0%,
    100% {
        box-shadow: 0 0 20px var(--primary-glow);
    }

    50% {
        box-shadow: 0 0 40px var(--primary-glow), 0 0 60px var(--secondary-glow);
    }
}

@keyframes pulseScale {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

/* Glow Animation */
@keyframes glow {

    0%,
    100% {
        filter: drop-shadow(0 0 10px var(--primary-glow));
    }

    50% {
        filter: drop-shadow(0 0 30px var(--primary-glow)) drop-shadow(0 0 50px var(--secondary-glow));
    }
}

/* Rotate Animations */
@keyframes rotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

@keyframes rotateSlow {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* Gradient Animation */
@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* Shimmer Animation */
@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}

/* Typewriter Cursor */
@keyframes blink {

    0%,
    50% {
        opacity: 1;
    }

    51%,
    100% {
        opacity: 0;
    }
}

/* Bounce */
@keyframes bounce {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateY(0);
    }

    40% {
        transform: translateY(-20px);
    }

    60% {
        transform: translateY(-10px);
    }
}

/* Shake */
@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    10%,
    30%,
    50%,
    70%,
    90% {
        transform: translateX(-5px);
    }

    20%,
    40%,
    60%,
    80% {
        transform: translateX(5px);
    }
}

/* Slide In */
@keyframes slideInFromTop {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideInFromBottom {
    from {
        transform: translateY(100%);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Particle Float */
@keyframes particleFloat {
    0% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }

    10% {
        opacity: 1;
    }

    90% {
        opacity: 1;
    }

    100% {
        transform: translateY(-100vh) rotate(720deg);
        opacity: 0;
    }
}

/* Orbit */
@keyframes orbit {
    from {
        transform: rotate(0deg) translateX(100px) rotate(0deg);
    }

    to {
        transform: rotate(360deg) translateX(100px) rotate(-360deg);
    }
}

/* Morph */
@keyframes morph {

    0%,
    100% {
        border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
    }

    50% {
        border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%;
    }
}

/* Wave */
@keyframes wave {
    0% {
        transform: translateX(0) translateZ(0) scaleY(1);
    }

    50% {
        transform: translateX(-25%) translateZ(0) scaleY(0.55);
    }

    100% {
        transform: translateX(-50%) translateZ(0) scaleY(1);
    }
}

/* Counter Flip */
@keyframes flipIn {
    from {
        transform: rotateX(-90deg);
        opacity: 0;
    }

    to {
        transform: rotateX(0);
        opacity: 1;
    }
}

/* ============================================
   Animation Utility Classes
   ============================================ */

/* Base */
.animate {
    animation-duration: 1s;
    animation-fill-mode: both;
}

.animate-fast {
    animation-duration: 0.5s;
}

.animate-slow {
    animation-duration: 1.5s;
}

.animate-slower {
    animation-duration: 2s;
}

/* Infinite */
.animate-infinite {
    animation-iteration-count: infinite;
}

/* Delays */
.delay-100 {
    animation-delay: 0.1s;
}

.delay-200 {
    animation-delay: 0.2s;
}

.delay-300 {
    animation-delay: 0.3s;
}

.delay-400 {
    animation-delay: 0.4s;
}

.delay-500 {
    animation-delay: 0.5s;
}

.delay-700 {
    animation-delay: 0.7s;
}

.delay-1000 {
    animation-delay: 1s;
}

/* Animation Types */
.animate-fadeIn {
    animation-name: fadeIn;
}

.animate-fadeInUp {
    animation-name: fadeInUp;
}

.animate-fadeInDown {
    animation-name: fadeInDown;
}

.animate-fadeInLeft {
    animation-name: fadeInLeft;
}

.animate-fadeInRight {
    animation-name: fadeInRight;
}

.animate-scaleIn {
    animation-name: scaleIn;
}

.animate-float {
    animation-name: float;
    animation-duration: 3s;
}

.animate-pulse {
    animation-name: pulse;
}

.animate-pulseGlow {
    animation-name: pulseGlow;
}

.animate-rotate {
    animation-name: rotate;
    animation-duration: 20s;
    animation-timing-function: linear;
}

.animate-bounce {
    animation-name: bounce;
}

.animate-glow {
    animation-name: glow;
    animation-duration: 2s;
}

.animate-morph {
    animation-name: morph;
    animation-duration: 8s;
}

/* ============================================
   Scroll Reveal Classes
   ============================================ */

[data-aos] {
    opacity: 0;
    transition-property: transform, opacity;
    transition-duration: 0.8s;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

[data-aos="fade-up"] {
    transform: translateY(40px);
}

[data-aos="fade-down"] {
    transform: translateY(-40px);
}

[data-aos="fade-left"] {
    transform: translateX(40px);
}

[data-aos="fade-right"] {
    transform: translateX(-40px);
}

[data-aos="zoom-in"] {
    transform: scale(0.8);
}

[data-aos="flip-up"] {
    transform: perspective(2500px) rotateX(-100deg);
}

[data-aos].aos-animate {
    opacity: 1;
    transform: translateY(0) translateX(0) scale(1) rotateX(0);
}

/* ============================================
   Hover Animations
   ============================================ */

.hover-lift {
    transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.hover-lift:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-glow);
}

.hover-scale {
    transition: transform var(--transition-base);
}

.hover-scale:hover {
    transform: scale(1.05);
}

.hover-glow {
    transition: box-shadow var(--transition-base);
}

.hover-glow:hover {
    box-shadow: var(--shadow-glow-lg);
}

.hover-rotate {
    transition: transform var(--transition-base);
}

.hover-rotate:hover {
    transform: rotate(5deg);
}

.hover-tilt {
    transition: transform var(--transition-base);
    transform-style: preserve-3d;
}

.hover-tilt:hover {
    transform: perspective(1000px) rotateX(5deg) rotateY(-5deg);
}

/* ============================================
   Loading Animations
   ============================================ */

.loader {
    width: 60px;
    height: 60px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: rotate 1s linear infinite;
}

.loader-dots {
    display: flex;
    gap: var(--space-2);
}

.loader-dots span {
    width: 12px;
    height: 12px;
    background: var(--primary);
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out;
}

.loader-dots span:nth-child(1) {
    animation-delay: -0.32s;
}

.loader-dots span:nth-child(2) {
    animation-delay: -0.16s;
}

.loader-pulse {
    width: 60px;
    height: 60px;
    background: var(--gradient-primary);
    border-radius: 50%;
    animation: pulseScale 1s infinite;
}

/* ============================================
   Scroll Progress Bar
   ============================================ */

.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: var(--gradient-primary);
    z-index: var(--z-fixed);
    transition: width 0.1s linear;
}

/* ============================================
   Page Transition
   ============================================ */

.page-transition {
    position: fixed;
    inset: 0;
    background: var(--primary-dark);
    z-index: 9999;
    transform: scaleY(0);
    transform-origin: bottom;
    transition: transform 0.6s cubic-bezier(0.65, 0, 0.35, 1);
}

.page-transition.active {
    transform: scaleY(1);
    transform-origin: top;
}

/* ============================================
   Custom Cursor
   ============================================ */

.cursor {
    position: fixed;
    width: 20px;
    height: 20px;
    border: 2px solid var(--primary);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    transition: transform 0.15s ease, background 0.15s ease;
    transform: translate(-50%, -50%);
}

.cursor-dot {
    position: fixed;
    width: 6px;
    height: 6px;
    background: var(--primary);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
}

.cursor.active {
    transform: translate(-50%, -50%) scale(1.5);
    background: var(--primary-glow);
}

/* ============================================
   Parallax
   ============================================ */

.parallax-container {
    perspective: 1000px;
    overflow: hidden;
}

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

.parallax-slow {
    transform: translateZ(-100px) scale(1.1);
}

.parallax-medium {
    transform: translateZ(-50px) scale(1.05);
}

.parallax-fast {
    transform: translateZ(0);
}

/* ============================================
   Stagger Children
   ============================================ */

.stagger-children>*:nth-child(1) {
    animation-delay: 0.1s;
}

.stagger-children>*:nth-child(2) {
    animation-delay: 0.2s;
}

.stagger-children>*:nth-child(3) {
    animation-delay: 0.3s;
}

.stagger-children>*:nth-child(4) {
    animation-delay: 0.4s;
}

.stagger-children>*:nth-child(5) {
    animation-delay: 0.5s;
}

.stagger-children>*:nth-child(6) {
    animation-delay: 0.6s;
}

.stagger-children>*:nth-child(7) {
    animation-delay: 0.7s;
}

.stagger-children>*:nth-child(8) {
    animation-delay: 0.8s;
}

/* ============================================
   Text Animations
   ============================================ */

.text-reveal {
    overflow: hidden;
}

.text-reveal span {
    display: inline-block;
    transform: translateY(100%);
    animation: fadeInUp 0.8s forwards;
}

.typewriter {
    overflow: hidden;
    border-right: 3px solid var(--primary);
    white-space: nowrap;
    animation: blink 0.75s step-end infinite;
}

/* Gradient Text Animation */
.gradient-text-animated {
    background: linear-gradient(90deg, var(--primary), var(--secondary), var(--accent), var(--primary));
    background-size: 300% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 5s ease infinite;
}

/* ============================================
   3D Card Effect
   ============================================ */

.card-3d {
    transform-style: preserve-3d;
    transition: transform var(--transition-base);
}

.card-3d:hover {
    transform: perspective(1000px) rotateY(10deg) rotateX(5deg);
}

.card-3d-inner {
    transform: translateZ(50px);
}

/* Flip Card */
.flip-card {
    perspective: 1000px;
    height: 300px;
}

.flip-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.8s;
    transform-style: preserve-3d;
}

.flip-card:hover .flip-card-inner {
    transform: rotateY(180deg);
}

.flip-card-front,
.flip-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: var(--radius-xl);
}

.flip-card-back {
    transform: rotateY(180deg);
}

/* ============================================
   Counter Animation
   ============================================ */

.counter {
    font-family: var(--font-mono);
    font-size: var(--text-5xl);
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ============================================
   Glitch Effect
   ============================================ */

.glitch {
    position: relative;
}

.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.glitch::before {
    animation: glitch-1 0.3s infinite linear alternate-reverse;
    color: var(--primary);
    z-index: -1;
}

.glitch::after {
    animation: glitch-2 0.3s infinite linear alternate-reverse;
    color: var(--accent);
    z-index: -2;
}

@keyframes glitch-1 {
    0% {
        clip-path: inset(20% 0 30% 0);
        transform: translate(-3px, 3px);
    }

    20% {
        clip-path: inset(60% 0 10% 0);
        transform: translate(3px, -3px);
    }

    40% {
        clip-path: inset(10% 0 50% 0);
        transform: translate(-3px, 3px);
    }

    60% {
        clip-path: inset(40% 0 20% 0);
        transform: translate(3px, -3px);
    }

    80% {
        clip-path: inset(80% 0 5% 0);
        transform: translate(-3px, 3px);
    }

    100% {
        clip-path: inset(5% 0 60% 0);
        transform: translate(3px, -3px);
    }
}

@keyframes glitch-2 {
    0% {
        clip-path: inset(65% 0 5% 0);
        transform: translate(3px, -3px);
    }

    20% {
        clip-path: inset(10% 0 70% 0);
        transform: translate(-3px, 3px);
    }

    40% {
        clip-path: inset(50% 0 15% 0);
        transform: translate(3px, -3px);
    }

    60% {
        clip-path: inset(20% 0 55% 0);
        transform: translate(-3px, 3px);
    }

    80% {
        clip-path: inset(5% 0 85% 0);
        transform: translate(3px, -3px);
    }

    100% {
        clip-path: inset(45% 0 25% 0);
        transform: translate(-3px, 3px);
    }
}