/* =========================================
   1. GLOBAL ATMOSPHERE & CURSOR
   ========================================= */
body {
    /* Changes cursor to a 'precision' crosshair for a technical feel */
    cursor: crosshair; 
}

/* CRT Scanline Effect (The "Monitor" Look) */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    /* Creates faint horizontal lines */
    background: linear-gradient(
        to bottom,
        rgba(255, 255, 255, 0),
        rgba(255, 255, 255, 0) 50%,
        rgba(0, 0, 0, 0.2) 50%,
        rgba(0, 0, 0, 0.2)
    );
    background-size: 100% 4px;
    z-index: 9999;
    pointer-events: none; /* Allows clicking through it */
    opacity: 0.6;
}

/* =========================================
   2. CUSTOM SCROLLBAR (Neon Style)
   ========================================= */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #030014; /* Deep Black */
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #00d4ff, #6d28d9); /* Cyan to Purple */
    border-radius: 4px;
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.7); /* Glowing effect */
}

::-webkit-scrollbar-thumb:hover {
    background: #00d4ff;
}

/* =========================================
   3. TYPING & TEXT ANIMATIONS
   ========================================= */

/* The blinking terminal cursor */
@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.typing-effect::after {
    content: '_';
    display: inline-block;
    color: #00d4ff;
    font-weight: bold;
    animation: blink 1s step-end infinite;
    margin-left: 5px;
}

/* Slow Pulse for the Main Title */
@keyframes neon-pulse {
    0%, 100% {
        text-shadow: 0 0 20px rgba(0, 212, 255, 0.1);
    }
    50% {
        text-shadow: 0 0 40px rgba(109, 40, 217, 0.5), 0 0 10px rgba(0, 212, 255, 0.5);
    }
}

h1 {
    animation: neon-pulse 5s infinite alternate;
}

/* =========================================
   4. GLITCH HOVER EFFECT
   ========================================= */
/* Applies a jittery "glitch" to text when hovered */
@keyframes glitch-skew {
    0% { transform: skew(0deg); }
    20% { transform: skew(-2deg); }
    40% { transform: skew(2deg); }
    60% { transform: skew(-1deg); }
    80% { transform: skew(1deg); }
    100% { transform: skew(0deg); }
}

a:hover, .group:hover h3 {
    animation: glitch-skew 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) both infinite;
}

/* =========================================
   5. UTILITIES & CLEANUP
   ========================================= */

/* Remove Up/Down arrows from the Algebra Input */
input[type=number]::-webkit-inner-spin-button, 
input[type=number]::-webkit-outer-spin-button { 
  -webkit-appearance: none; 
  margin: 0; 
}

input[type=number] {
  -moz-appearance: textfield; /* Firefox */
}

/* Smooth anchor scrolling offset */
html {
    scroll-padding-top: 100px;
}

/* Selection Color (When highlighting text) */
::selection {
    background: #00d4ff;
    color: #000;
}