/* ========================================
   ANIMATIONS
   Dot animations, transitions, scroll effects
   ======================================== */

/* ========== KEYFRAME ANIMATIONS ========== */

/* Fade up animation for hero content */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Fade in animation */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Loader dot pulse */
@keyframes loaderPulse {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1.2);
        opacity: 1;
    }
}

/* Dot ring construction (for logo animation) */
@keyframes dotAppear {
    from {
        transform: scale(0);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Spiral unraveling animation */
@keyframes spiralOut {
    from {
        transform: scale(0) rotate(-360deg);
        opacity: 0;
    }
    to {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

/* Orbital rotation (subtle background element) */
@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Pulse animation for dot icons */
@keyframes dotPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.8;
    }
}

/* Shimmer effect (for loading states) */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

/* Slide in from left (for underline effects) */
@keyframes slideInLeft {
    from {
        transform: translateX(-100%);
    }
    to {
        transform: translateX(0);
    }
}

/* Float animation (subtle movement) */
@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* ========== SCROLL-TRIGGERED ANIMATIONS ========== */

/* Elements that fade in on scroll */
.fade-in-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger animation for lists/grids */
.stagger-animation > * {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

.stagger-animation.visible > *:nth-child(1) { transition-delay: 0.1s; }
.stagger-animation.visible > *:nth-child(2) { transition-delay: 0.2s; }
.stagger-animation.visible > *:nth-child(3) { transition-delay: 0.3s; }
.stagger-animation.visible > *:nth-child(4) { transition-delay: 0.4s; }
.stagger-animation.visible > *:nth-child(5) { transition-delay: 0.5s; }
.stagger-animation.visible > *:nth-child(6) { transition-delay: 0.6s; }

.stagger-animation.visible > * {
    opacity: 1;
    transform: translateY(0);
}

/* ========== DOT-SPECIFIC ANIMATIONS ========== */

/* Animated dot ring (hero background) */
.hero-dots-canvas {
    animation: fadeIn 1s ease-out 1.2s both;
}

/* Dot icon hover effect */
.feature-card:hover .dot-icon,
.use-case-card:hover .dot-icon,
.problem-item:hover .dot-icon {
    animation: dotPulse 0.6s ease-in-out;
}

/* Colorful card entrance */
.feature-card,
.use-case-card {
    opacity: 0;
    transform: translateY(20px);
}

.feature-card.visible,
.use-case-card.visible {
    opacity: 1;
    transform: translateY(0);
    transition: all 0.5s ease-out;
}

/* Orbital dots (background decoration) */
.orbital-dots {
    animation: rotate 20s linear infinite;
}

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

/* Skeleton loader */
.skeleton {
    background: linear-gradient(
        90deg,
        var(--background-card) 0%,
        var(--background-card-hover) 50%,
        var(--background-card) 100%
    );
    background-size: 1000px 100%;
    animation: shimmer 2s infinite;
}

/* Spinner (alternative loader) */
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--accent-orange);
    border-radius: 50%;
    animation: rotate 0.8s linear infinite;
}

/* ========== HOVER TRANSITIONS ========== */

/* Smooth transitions for interactive elements */
.nav-link,
.footer-link,
.btn,
.feature-card,
.use-case-card {
    transition: all 0.3s ease;
}

/* Link underline slide effect */
.link-underline {
    position: relative;
}

.link-underline::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent-orange);
    transition: width 0.3s ease;
}

.link-underline:hover::after {
    width: 100%;
}

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

/* Fade in page on load */
body {
    animation: fadeIn 0.3s ease-out;
}

/* Section reveal on scroll */
.section {
    opacity: 0;
    animation: fadeIn 0.6s ease-out forwards;
}

.section:nth-of-type(1) { animation-delay: 0s; }
.section:nth-of-type(2) { animation-delay: 0.1s; }
.section:nth-of-type(3) { animation-delay: 0.2s; }
.section:nth-of-type(4) { animation-delay: 0.3s; }

/* ========== MOBILE MENU ANIMATIONS ========== */

/* Mobile menu slide in */
.mobile-menu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.mobile-menu.active {
    max-height: 500px;
}

/* Hamburger animation */
.mobile-menu-toggle.active .hamburger-line:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.mobile-menu-toggle.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active .hamburger-line:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ========== THEME TRANSITION ========== */

/* Smooth color transitions when switching themes */
* {
    transition: background-color 0.3s ease, 
                color 0.3s ease, 
                border-color 0.3s ease;
}

/* Exclude elements that need instant transitions */
.nav,
.btn,
input,
textarea {
    transition: all 0.2s ease;
}

/* ========== SCROLL SNAP (Optional) ========== */

/* Uncomment for full-page scroll snap effect */
/*
.scroll-snap-container {
    scroll-snap-type: y mandatory;
    overflow-y: scroll;
    height: 100vh;
}

.section {
    scroll-snap-align: start;
    min-height: 100vh;
}
*/

/* ========== PARALLAX EFFECTS ========== */

/* Subtle parallax for background elements */
.parallax-slow {
    transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* ========== CUSTOM CURSOR EFFECTS (Optional) ========== */

/* Dot follows cursor on hover over interactive elements */
.cursor-dot {
    width: 8px;
    height: 8px;
    background: var(--accent-orange);
    border-radius: 50%;
    position: fixed;
    pointer-events: none;
    z-index: 9999;
    transition: transform 0.2s ease, opacity 0.2s ease;
    opacity: 0;
}

.cursor-dot.active {
    opacity: 1;
    transform: scale(1.5);
}

/* ========== FOCUS ANIMATIONS ========== */

/* Animated focus ring */
*:focus-visible {
    outline: 2px solid var(--accent-orange);
    outline-offset: 2px;
    animation: focusPulse 0.3s ease-out;
}

@keyframes focusPulse {
    0% {
        outline-width: 0px;
        outline-offset: 0px;
    }
    100% {
        outline-width: 2px;
        outline-offset: 2px;
    }
}

/* ========== REDUCED MOTION OVERRIDES ========== */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .fade-in-on-scroll,
    .stagger-animation > * {
        opacity: 1 !important;
        transform: none !important;
    }
}

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

/* Use GPU acceleration for animated elements */
.hero-dots-canvas,
.feature-card,
.use-case-card,
.btn {
    will-change: transform;
}

/* Prevent layout shift during animations */
.fade-in-on-scroll {
    contain: layout;
}

/* ========== DOWN ARROW BOUNCE ========== */
@keyframes bounceDown {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(5px);
    }
    60% {
        transform: translateY(3px);
    }
}

/* Apply bounce animation to hero CTA with down arrow */
.hero-cta .btn {
    animation: bounceDown 2s ease-in-out infinite;
}

.hero-cta .btn:hover {
    animation: none;
}

