/* ============================================
   JAMWEB.SPACE - Animations & Effects
   ============================================ */

/* Scroll Reveal */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

.reveal-left {
    opacity: 0;
    transform: translateX(-30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal-left.visible {
    opacity: 1;
    transform: translateX(0);
}

.stagger-children>* {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

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

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

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

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

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

/* Glow Effects */
.glow-hover {
    transition: box-shadow var(--transition-base);
}

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

@keyframes pulse-glow {

    0%,
    100% {
        box-shadow: 0 0 5px var(--color-neon-glow);
    }

    50% {
        box-shadow: 0 0 20px var(--color-neon-glow);
    }
}

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

/* Icon Float */
@keyframes float {

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

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

.icon-float {
    animation: float 3s ease-in-out infinite;
}

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

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: #00e2b7;
    border-radius: 50%;
    opacity: 0.6;
    box-shadow: 0 0 10px #00e2b7, 0 0 20px rgba(0, 226, 183, 0.5);
}

@keyframes particle-float {
    0% {
        transform: translateY(100vh) scale(0);
        opacity: 0;
    }

    10% {
        opacity: 0.6;
    }

    90% {
        opacity: 0.6;
    }

    100% {
        transform: translateY(-100px) scale(1);
        opacity: 0;
    }
}

.particle:nth-child(1) {
    left: 5%;
    width: 3px;
    height: 3px;
    animation: particle-float 6s linear infinite;
}

.particle:nth-child(2) {
    left: 15%;
    width: 5px;
    height: 5px;
    animation: particle-float 8s linear infinite 0.5s;
}

.particle:nth-child(3) {
    left: 25%;
    width: 3px;
    height: 3px;
    animation: particle-float 5s linear infinite 1s;
}

.particle:nth-child(4) {
    left: 35%;
    width: 6px;
    height: 6px;
    box-shadow: 0 0 15px #00e2b7, 0 0 30px rgba(0, 226, 183, 0.6);
    animation: particle-float 9s linear infinite 0.3s;
}

.particle:nth-child(5) {
    left: 45%;
    width: 4px;
    height: 4px;
    animation: particle-float 7s linear infinite 1.5s;
}

.particle:nth-child(6) {
    left: 55%;
    width: 5px;
    height: 5px;
    animation: particle-float 6s linear infinite 2s;
}

.particle:nth-child(7) {
    left: 65%;
    width: 3px;
    height: 3px;
    animation: particle-float 5s linear infinite 0.8s;
}

.particle:nth-child(8) {
    left: 75%;
    width: 6px;
    height: 6px;
    box-shadow: 0 0 15px #00e2b7, 0 0 30px rgba(0, 226, 183, 0.6);
    animation: particle-float 8s linear infinite 1.2s;
}

.particle:nth-child(9) {
    left: 85%;
    width: 4px;
    height: 4px;
    animation: particle-float 6s linear infinite 0.7s;
}

.particle:nth-child(10) {
    left: 92%;
    width: 3px;
    height: 3px;
    animation: particle-float 7s linear infinite 1.8s;
}

.particle:nth-child(11) {
    left: 50%;
    width: 5px;
    height: 5px;
    animation: particle-float 5s linear infinite 0.2s;
}

.particle:nth-child(12) {
    left: 8%;
    width: 4px;
    height: 4px;
    box-shadow: 0 0 15px #00e2b7, 0 0 30px rgba(0, 226, 183, 0.6);
    animation: particle-float 6s linear infinite 1.3s;
}

/* Circuit Pattern */
.circuit-bg {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(to right, var(--color-border) 1px, transparent 1px),
        linear-gradient(to bottom, var(--color-border) 1px, transparent 1px);
    background-size: 60px 60px;
    opacity: 0.15;
    pointer-events: none;
}

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

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--color-border);
    border-top-color: var(--color-neon);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* Underline Animation */
.underline-animate {
    position: relative;
}

.underline-animate::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--color-neon);
    transition: width var(--transition-base);
}

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

/* Tilt Card */
.tilt-card {
    transition: transform var(--transition-base);
}

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

/* Ecosystem */
.ecosystem-node {
    transition: all var(--transition-base);
    cursor: pointer;
}

.ecosystem-node:hover {
    transform: scale(1.05);
    filter: drop-shadow(0 0 20px var(--color-neon-glow));
}

@keyframes dash-flow {
    to {
        stroke-dashoffset: -10;
    }
}

.ecosystem-connection {
    stroke-dasharray: 5, 5;
    animation: dash-flow 1s linear infinite;
}

/* Tooltip */
.tooltip {
    position: relative;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    padding: var(--space-2) var(--space-4);
    background: var(--color-bg-elevated);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-fast);
    z-index: var(--z-tooltip);
}

.tooltip:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}