/* ===== MECHATRONICS ANIMATED BACKGROUND ===== */
/* Container */
.mecha-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: #0f172a;
    /* Deep Engineering Blue */
    background-image:
        radial-gradient(#1e293b 1px, transparent 1px),
        radial-gradient(#1e293b 1px, transparent 1px);
    background-size: 40px 40px;
    background-position: 0 0, 20px 20px;
    z-index: -1;
    overflow: hidden;
}

/* The Animated Grid Moving Slowly */
.grid-overlay {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background:
        linear-gradient(rgba(56, 189, 248, 0.15) 1px, transparent 1px),
        linear-gradient(90deg, rgba(56, 189, 248, 0.15) 1px, transparent 1px);
    background-size: 100px 100px;
    transform: perspective(500px) rotateX(60deg);
    animation: moveGrid 20s linear infinite;
}

/* A subtle "Scanner" line often seen in Mechatronics software */
.scan-line {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, transparent, rgba(56, 189, 248, 0.25) 50%, transparent);
    animation: scan 8s ease-in-out infinite;
}

/* Animations */
@keyframes moveGrid {
    0% {
        transform: perspective(500px) rotateX(60deg) translateY(0);
    }

    100% {
        transform: perspective(500px) rotateX(60deg) translateY(100px);
    }
}

@keyframes scan {
    0% {
        transform: translateY(-100%);
    }

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

/* ===== CUSTOM CURSOR ===== */
body {
    cursor: none;
    /* Hide default cursor for custom effect */
}

/* Custom Cursor */
.custom-cursor {
    position: fixed;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(56, 189, 248, 0.6);
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
    transition: width 0.2s, height 0.2s;
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.8);
}

.custom-cursor.clicking {
    width: 20px;
    height: 20px;
    background: rgba(56, 189, 248, 0.8);
}

/* Cursor Trail Effect */
.cursor-trail {
    position: fixed;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(56, 189, 248, 0.4);
    pointer-events: none;
    z-index: 9998;
    animation: fadeCursor 0.8s ease-out forwards;
}

@keyframes fadeCursor {
    0% {
        opacity: 1;
        transform: scale(1);
    }

    100% {
        opacity: 0;
        transform: scale(0.5);
    }
}