/* ==========================================================================
   TIDITSSIA Motion Graphics & Keyframe Animations
   Optimized for Performance & Accessible Reduced Motion
   ========================================================================== */

/* Rotating Industrial Gear Animation */
@keyframes spinClockwise {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

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

.spin-slow {
    animation: spinClockwise 25s linear infinite;
}

.spin-counter-slow {
    animation: spinCounterClockwise 30s linear infinite;
}

/* Pulsing Status Beacon */
@keyframes beaconPulse {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(2, 132, 199, 0.7);
    }
    70% {
        transform: scale(1);
        box-shadow: 0 0 0 10px rgba(2, 132, 199, 0);
    }
    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(2, 132, 199, 0);
    }
}

.beacon {
    width: 10px;
    height: 10px;
    background: #0284c7;
    border-radius: 50%;
    display: inline-block;
    animation: beaconPulse 2s infinite;
}

/* Shimmer Gradient Highlight */
@keyframes shimmerPass {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

.shimmer-text {
    background: linear-gradient(
        90deg,
        #ffffff 0%,
        #38bdf8 25%,
        #ffffff 50%,
        #38bdf8 75%,
        #ffffff 100%
    );
    background-size: 200% auto;
    color: #fff;
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shimmerPass 6s linear infinite;
}

/* Subtle Floating Animation */
@keyframes gentleFloat {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
    }
    50% {
        transform: translateY(-8px) rotate(1deg);
    }
}

.float-item {
    animation: gentleFloat 5s ease-in-out infinite;
}

/* Motion Reveal Classes */
.reveal-fade-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-fade-up.is-inview {
    opacity: 1;
    transform: translateY(0);
}

.reveal-fade-in {
    opacity: 0;
    transition: opacity 0.8s ease;
}

.reveal-fade-in.is-inview {
    opacity: 1;
}

/* Hover Shimmer Line on Cards */
.hover-glow {
    position: relative;
    overflow: hidden;
}

.hover-glow::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent 45%,
        rgba(255, 255, 255, 0.15) 50%,
        transparent 55%
    );
    transform: rotate(25deg) translateY(-100%);
    transition: transform 0.75s ease-in-out;
    pointer-events: none;
}

.hover-glow:hover::after {
    transform: rotate(25deg) translateY(100%);
}

/* Magnetic Button Ripple */
.btn-ripple {
    position: relative;
    overflow: hidden;
}

.btn-ripple span.ripple-circle {
    position: absolute;
    border-radius: 50%;
    transform: scale(0);
    animation: rippleEffect 0.6s linear;
    background-color: rgba(255, 255, 255, 0.4);
    pointer-events: none;
}

@keyframes rippleEffect {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* Custom Cursor & Mouse Movement Graphics */
.cursor-dot {
    position: fixed;
    top: 0;
    left: 0;
    width: 8px;
    height: 8px;
    background: #0284c7;
    border-radius: 50%;
    pointer-events: none;
    z-index: 10000;
    margin-top: -4px;
    margin-left: -4px;
    transition: width 0.2s ease, height 0.2s ease, opacity 0.2s ease;
    box-shadow: 0 0 10px rgba(2, 132, 199, 0.85);
}

.cursor-dot.cursor-dot-hover {
    opacity: 0.5;
}

.cursor-ring {
    position: fixed;
    top: 0;
    left: 0;
    width: 36px;
    height: 36px;
    border: 2px solid rgba(2, 132, 199, 0.55);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    margin-top: -18px;
    margin-left: -18px;
    transition: width 0.28s cubic-bezier(0.16, 1, 0.3, 1), 
                height 0.28s cubic-bezier(0.16, 1, 0.3, 1), 
                margin 0.28s cubic-bezier(0.16, 1, 0.3, 1), 
                border-color 0.25s ease, 
                background-color 0.25s ease, 
                box-shadow 0.25s ease;
}

.cursor-ring.cursor-hover {
    width: 60px;
    height: 60px;
    margin-top: -30px;
    margin-left: -30px;
    border-color: #0284c7;
    background-color: rgba(2, 132, 199, 0.12);
    box-shadow: 0 0 24px rgba(2, 132, 199, 0.4);
}

.cursor-ring.cursor-active {
    border-color: #b91c1c;
    background-color: rgba(185, 28, 28, 0.18);
}

#cursor-trail-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9998;
}

@media (hover: none) and (pointer: coarse) {
    .cursor-dot, .cursor-ring, #cursor-trail-canvas {
        display: none !important;
    }
}

/* Accessible prefers-reduced-motion for WCAG / Lighthouse compliance */
@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;
    }
    
    .spin-slow, .spin-counter-slow, .beacon, .shimmer-text, .float-item, .cursor-dot, .cursor-ring, #cursor-trail-canvas {
        animation: none !important;
        display: none !important;
    }
    
    .reveal-fade-up, .reveal-fade-in {
        opacity: 1 !important;
        transform: none !important;
    }
}
