/* ===== REFINED CYBER EFFECTS ===== */

/* Scroll Reveal Base */
.reveal {
    opacity: 0;
    will-change: transform, opacity;
    transition: all 0.8s cubic-bezier(0.23, 1, 0.32, 1);
}

.reveal-up {
    transform: translateY(40px);
}

.reveal-left {
    transform: translateX(40px);
}

.reveal-right {
    transform: translateX(-40px);
}

.reveal.active {
    opacity: 1;
    transform: translate(0, 0);
}

/* Stable Glitch (Restrained) */
.glitch-stable {
    position: relative;
    display: inline-block;
}

.glitch-stable::before,
.glitch-stable::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    clip-path: inset(0 0 0 0);
    opacity: 0;
    pointer-events: none;
}

.glitch-stable:hover::before {
    opacity: 1;
    text-shadow: 2px 0 var(--accent-primary);
    animation: glitch-anim-1 2s infinite linear alternate-reverse;
}

.glitch-stable:hover::after {
    opacity: 1;
    text-shadow: -2px 0 var(--accent-secondary);
    animation: glitch-anim-2 3s infinite linear alternate-reverse;
}

@keyframes glitch-anim-1 {
    0% {
        clip-path: inset(10% 0 80% 0);
    }

    20% {
        clip-path: inset(40% 0 10% 0);
    }

    40% {
        clip-path: inset(60% 0 30% 0);
    }

    100% {
        clip-path: inset(30% 0 40% 0);
    }
}

@keyframes glitch-anim-2 {
    0% {
        clip-path: inset(40% 0 10% 0);
    }

    60% {
        clip-path: inset(10% 0 70% 0);
    }

    100% {
        clip-path: inset(70% 0 10% 0);
    }
}

/* Performant Hover Glow */
.course-card {
    --glow-opacity: 0;
    --mouse-x: 50%;
    --mouse-y: 50%;
}

.course-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(600px circle at var(--mouse-x) var(--mouse-y),
            rgba(0, 217, 255, 0.08),
            transparent 40%);
    opacity: var(--glow-opacity);
    transition: opacity 0.5s;
    pointer-events: none;
    z-index: 0;
}

.course-card:hover {
    --glow-opacity: 1;
}

/* Custom Cyber Cursor (Safe & Smooth) */
.cyber-cursor {
    width: 12px;
    height: 12px;
    background: var(--accent-primary);
    border-radius: 50%;
    position: fixed;
    pointer-events: none;
    z-index: 10000;
    mix-blend-mode: difference;
    transform: translate(-50%, -50%);
    transition: transform 0.1s ease-out, width 0.3s, height 0.3s, background 0.3s;
    will-change: transform;
    opacity: 0;
}

.cyber-cursor.active {
    opacity: 1;
}

.cyber-cursor.hover {
    width: 40px;
    height: 40px;
    background: transparent;
    border: 2px solid var(--accent-primary);
    box-shadow: 0 0 20px var(--accent-primary);
}

@media (max-width: 768px) {
    .cyber-cursor {
        display: none !important;
    }
}

/* hardware accelerated animations override */
.btn,
.card,
.cyber-badge {
    will-change: transform, box-shadow;
}

/* Body Background Refinement (Hardware accelerated) */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
        radial-gradient(circle at 20% 30%, rgba(0, 217, 255, 0.03), transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(168, 85, 247, 0.03), transparent 50%),
        linear-gradient(rgba(0, 217, 255, 0.01) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 217, 255, 0.01) 1px, transparent 1px);
    background-size: 100% 100%, 100% 100%, 50px 50px, 50px 50px;
    z-index: -1;
    pointer-events: none;
    opacity: 0.5;
}

/* Scan line effect refinement (performant) */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%,
            rgba(0, 0, 0, 0.05) 50%);
    background-size: 100% 4px;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.1;
}