/* ============================================================
   PENTASYSAI — ANIMATIONS
   Keyframes, scroll reveals, glow pulses, hover effects.
   ============================================================ */

/* ——— SCROLL REVEAL ——— */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}

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

.reveal-left {
    opacity: 0;
    transform: translateX(-40px);
    transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}

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

.reveal-right {
    opacity: 0;
    transform: translateX(40px);
    transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}

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

.reveal-scale {
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}

.reveal-scale.visible {
    opacity: 1;
    transform: scale(1);
}

/* Stagger children */
.stagger-children .reveal:nth-child(1) { transition-delay: 0.05s; }
.stagger-children .reveal:nth-child(2) { transition-delay: 0.1s; }
.stagger-children .reveal:nth-child(3) { transition-delay: 0.15s; }
.stagger-children .reveal:nth-child(4) { transition-delay: 0.2s; }
.stagger-children .reveal:nth-child(5) { transition-delay: 0.25s; }
.stagger-children .reveal:nth-child(6) { transition-delay: 0.3s; }
.stagger-children .reveal:nth-child(7) { transition-delay: 0.35s; }
.stagger-children .reveal:nth-child(8) { transition-delay: 0.4s; }


/* ——— NEON PULSE ——— */
@keyframes neonPulse {
    0%, 100% {
        box-shadow: 0 0 5px rgba(var(--neon-cyan-rgb), 0.2), 0 0 20px rgba(var(--neon-cyan-rgb), 0.05);
    }
    50% {
        box-shadow: 0 0 15px rgba(var(--neon-cyan-rgb), 0.4), 0 0 40px rgba(var(--neon-cyan-rgb), 0.1);
    }
}

.neon-pulse {
    animation: neonPulse 3s ease-in-out infinite;
}


/* ——— TEXT GLOW PULSE ——— */
@keyframes textGlow {
    0%, 100% {
        text-shadow: 0 0 10px rgba(var(--neon-cyan-rgb), 0.2), 0 0 30px rgba(var(--neon-cyan-rgb), 0.05);
    }
    50% {
        text-shadow: 0 0 20px rgba(var(--neon-cyan-rgb), 0.5), 0 0 50px rgba(var(--neon-cyan-rgb), 0.15);
    }
}

.text-glow-pulse {
    animation: textGlow 4s ease-in-out infinite;
}


/* ——— BORDER GLOW ——— */
@keyframes borderGlow {
    0%, 100% { border-color: rgba(var(--neon-cyan-rgb), 0.15); }
    50%      { border-color: rgba(var(--neon-cyan-rgb), 0.35); }
}

.border-glow {
    animation: borderGlow 3s ease-in-out infinite;
}


/* ——— FLOATING ——— */
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-12px); }
}

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


/* ——— TYPING CURSOR ——— */
@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

.typing-cursor::after {
    content: '|';
    color: var(--neon-cyan);
    animation: blink 1s step-end infinite;
    font-weight: 300;
    margin-left: 2px;
}


/* ——— SPIN ——— */
@keyframes spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

.spin {
    animation: spin 8s linear infinite;
}

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


/* ——— GRADIENT SWEEP (holographic card effect) ——— */
@keyframes gradientSweep {
    0%   { background-position: 200% center; }
    100% { background-position: -200% center; }
}


/* ——— RADAR SWEEP ——— */
@keyframes radarSweep {
    0%   { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}


/* ——— PULSE RING ——— */
@keyframes pulseRing {
    0% {
        transform: scale(1);
        opacity: 0.6;
    }
    100% {
        transform: scale(2.5);
        opacity: 0;
    }
}

.pulse-ring {
    position: relative;
}

.pulse-ring::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 1px solid var(--neon-cyan);
    animation: pulseRing 2.5s ease-out infinite;
}


/* ——— MATRIX RAIN (CSS-only columns) ——— */
@keyframes matrixDrop {
    0% {
        transform: translateY(-100%);
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(100vh);
        opacity: 0;
    }
}

.matrix-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

.matrix-column {
    position: absolute;
    top: -20%;
    font-family: var(--font-mono);
    font-size: 14px;
    color: rgba(var(--neon-green-rgb), 0.15);
    writing-mode: vertical-rl;
    animation: matrixDrop linear infinite;
    white-space: nowrap;
}


/* ——— HERO GRADIENT SHIFT ——— */
@keyframes heroGradient {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}


/* ——— SLIDE IN FROM BOTTOM (page load) ——— */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.slide-in-up {
    animation: slideInUp 0.8s var(--ease-out) forwards;
}


/* ——— FADE IN ——— */
@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.fade-in {
    animation: fadeIn 0.6s var(--ease-out) forwards;
}

.fade-in-delay-1 { animation-delay: 0.1s; opacity: 0; }
.fade-in-delay-2 { animation-delay: 0.2s; opacity: 0; }
.fade-in-delay-3 { animation-delay: 0.3s; opacity: 0; }
.fade-in-delay-4 { animation-delay: 0.4s; opacity: 0; }
.fade-in-delay-5 { animation-delay: 0.5s; opacity: 0; }


/* ——— SCALE IN ——— */
@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.85);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.scale-in {
    animation: scaleIn 0.6s var(--ease-spring) forwards;
}


/* ——— LINE DRAW ——— */
@keyframes lineExpand {
    from { width: 0; }
    to   { width: 60px; }
}

.line-draw {
    animation: lineExpand 0.8s var(--ease-out) forwards;
}


/* ——— COUNT UP (helper class for JS) ——— */
.counter-animate {
    transition: all 0.1s linear;
}


/* ——— HOVER LIFT (generic) ——— */
.hover-lift {
    transition: transform var(--transition-base), box-shadow var(--transition-base);
}

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


/* ——— SHIMMER LOADING ——— */
@keyframes shimmer {
    0% { background-position: -1000px 0; }
    100% { background-position: 1000px 0; }
}

.shimmer {
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0),
        rgba(255, 255, 255, 0.03),
        rgba(255, 255, 255, 0)
    );
    background-size: 1000px 100%;
    animation: shimmer 3s linear infinite;
}


/* ——— ORBITAL RING (decorative) ——— */
@keyframes orbit {
    from { transform: rotate(0deg) translateX(120px) rotate(0deg); }
    to   { transform: rotate(360deg) translateX(120px) rotate(-360deg); }
}

.orbital {
    animation: orbit 15s linear infinite;
}


/* ——— GLITCH TEXT ——— */
@keyframes glitch {
    0%, 100% { transform: translate(0); }
    20%      { transform: translate(-2px, 2px); }
    40%      { transform: translate(-2px, -2px); }
    60%      { transform: translate(2px, 2px); }
    80%      { transform: translate(2px, -2px); }
}

.glitch:hover {
    animation: glitch 0.3s ease infinite;
}


/* ——— REDUCED MOTION ——— */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .reveal, .reveal-left, .reveal-right, .reveal-scale {
        opacity: 1;
        transform: none;
    }
}
