/* ========================================
   ANIMATION KEYFRAMES & UTILITIES
======================================== */

/* ========================================
   GLITCH EFFECT
======================================== */
.glitch-wrapper {
    display: inline-block;
    position: relative;
    overflow: hidden;
}

.glitch {
    position: relative;
    color: var(--text-primary);
    font-size: 4rem;
    font-weight: 800;
    font-weight: 800;
    /* text-transform: uppercase; Removed for mixed case */
    letter-spacing: 0.05em;
    z-index: 1;
}

.glitch::before,
.glitch::after {
    display: block;
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0.8;
}

.glitch::before {
    animation: glitch-it 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) both infinite;
    color: #00ffff;
    z-index: -1;
}

.glitch::after {
    animation: glitch-it 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) reverse both infinite;
    color: #ff00ff;
    z-index: -2;
}

@keyframes glitch-it {
    0% {
        transform: translate(0);
    }

    20% {
        transform: translate(-2px, 2px);
    }

    40% {
        transform: translate(-2px, -2px);
    }

    60% {
        transform: translate(2px, 2px);
    }

    80% {
        transform: translate(2px, -2px);
    }

    100% {
        transform: translate(0);
    }
}

/* ========================================
   CYBER GRID BACKGROUND
======================================== */
.cyber-grid {
    position: absolute;
    width: 200%;
    height: 200%;
    bottom: -50%;
    left: -50%;
    background-image:
        linear-gradient(rgba(100, 244, 172, 0.3) 1px, transparent 1px),
        linear-gradient(90deg, rgba(100, 244, 172, 0.3) 1px, transparent 1px);
    background-size: 40px 40px;
    transform: perspective(500px) rotateX(60deg);
    animation: grid-move 20s linear infinite;
    z-index: 0;
    opacity: 0.15;
    pointer-events: none;
}

@keyframes grid-move {
    0% {
        transform: perspective(500px) rotateX(60deg) translateY(0);
    }

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

/* ========================================
   TYPING ANIMATION
======================================== */
.role-dynamic {
    color: var(--primary);
    font-weight: 700;
    position: relative;
}

.typing-wrapper {
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
}

.cursor-blink {
    display: inline-block;
    margin-left: 1px;
    animation: blink 1s step-end infinite;
    color: var(--primary);
    font-weight: 700;
    line-height: 1;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

/* ========================================
   NEON BUTTONS
======================================== */
.btn-neon {
    position: relative;
    box-shadow: 0 0 10px rgba(100, 244, 172, 0.5), inset 0 0 5px rgba(100, 244, 172, 0.2);
    transition: all 0.3s ease;
    border: 1px solid var(--primary);
}

.btn-neon:hover {
    box-shadow: 0 0 20px rgba(100, 244, 172, 0.8), inset 0 0 10px rgba(100, 244, 172, 0.4);
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.8);
    transform: translateY(-2px);
}

/* Re-include original fade/slide keyframes from previous file below if needed, 
   but since this file is usually appended or linked, ensure no overwrite issues if overwriting.
   Given the instruction was to "Add", I will replace the file with the NEW content + Original content if I can, 
   but the tool 'write_to_file' overwrites. 
   I should use 'replace_file_content' or 'append' logic if possible.
   However, since I have the full content of the previous file in the context, I will combine them.
*/

/* ========================================
   FADE ANIMATIONS (Retained/Updated)
======================================== */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ... (Optimizing by keeping only used animations if needed, but for safety I will include the critical ones used in JS) */
/* ========================================
   FLOATING SHAPES BACKGROUND
======================================== */
.hero-shapes {
    position: absolute;
    inset: 0;
    overflow: hidden;
    z-index: 0;
    pointer-events: none;
}

.shape {
    position: absolute;
    opacity: 0.1;
    border: 2px solid var(--primary);
}

.shape-1 {
    top: 20%;
    left: 10%;
    width: 50px;
    height: 50px;
    animation: float-rotate 20s linear infinite;
}

.shape-2 {
    bottom: 30%;
    right: 15%;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    animation: float-rotate 25s linear infinite reverse;
}

.shape-3 {
    top: 60%;
    left: 50%;
    width: 40px;
    height: 40px;
    transform: rotate(45deg);
    animation: float-rotate 30s linear infinite;
}

@keyframes float-rotate {
    0% {
        transform: translate(0, 0) rotate(0deg);
    }
    33% {
        transform: translate(30px, -50px) rotate(120deg);
    }
    66% {
        transform: translate(-20px, 20px) rotate(240deg);
    }
    100% {
        transform: translate(0, 0) rotate(360deg);
    }
}


/* ========================================
   CODING SYMBOLS BACKGROUND
   (Overrides previous shape styles)
======================================== */
.shape {
    border: none !important; /* Remove previous border */
    color: var(--primary);
    font-family: 'Courier New', monospace;
    font-weight: bold;
    font-size: 4rem; /* Large text */
    opacity: 0.15;
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}

.shape-1 {
    font-size: 5rem;
    animation: float-code 20s ease-in-out infinite !important;
}

.shape-2 {
    font-size: 6rem;
    animation: float-code 25s ease-in-out infinite reverse !important;
}

.shape-3 {
    font-size: 4rem;
    animation: float-code 22s ease-in-out infinite !important;
}

@keyframes float-code {
    0% { transform: translate(0, 0) rotate(0deg); }
    33% { transform: translate(40px, -60px) rotate(10deg); }
    66% { transform: translate(-30px, 30px) rotate(-10deg); }
    100% { transform: translate(0, 0) rotate(0deg); }
}


/* Additional Shapes Positions */
.shape-3 {
    top: 15%;
    left: 80%;
    font-size: 3.5rem;
    animation: float-code 28s ease-in-out infinite !important;
}

.shape-4 {
    bottom: 25%;
    left: 5%;
    font-size: 4rem;
    animation: float-code 22s ease-in-out infinite reverse !important;
    animation-delay: 2s;
}

.shape-5 {
    top: 45%;
    left: 40%;
    font-size: 3rem;
    opacity: 0.1;
    animation: float-code 30s ease-in-out infinite !important;
    animation-delay: 5s;
}

.shape-6 {
    top: 70%;
    left: 85%;
    font-size: 5rem;
    animation: float-code 24s ease-in-out infinite reverse !important;
    animation-delay: 1s;
}

.shape-7 {
    top: 10%;
    left: 45%;
    font-size: 2.5rem;
    animation: float-code 26s ease-in-out infinite !important;
    animation-delay: 3s;
}

.shape-8 {
    bottom: 15%;
    left: 55%;
    font-size: 4.5rem;
    animation: float-code 20s ease-in-out infinite reverse !important;
    animation-delay: 4s;
}


/* ========================================
   UPDATED RANDOM FLOAT ANIMATION
======================================== */
@keyframes float-random {
    0% { transform: translate(0, 0) rotate(0deg); }
    20% { transform: translate(40px, -40px) rotate(20deg); }
    40% { transform: translate(-30px, 50px) rotate(-10deg); }
    60% { transform: translate(50px, 20px) rotate(10deg); }
    80% { transform: translate(-20px, -30px) rotate(-20deg); }
    100% { transform: translate(0, 0) rotate(0deg); }
}

.shape {
    /* Use the new wandering animation */
    animation-name: float-random !important;
    animation-timing-function: ease-in-out !important;
    animation-iteration-count: infinite !important;
    /* Duration and Delay will be set by JS for randomness */
}


/* ========================================
   DYNAMIC VARIABLE-DRIVEN FLOATING
======================================== */
@keyframes float-dynamic {
    0% { transform: translate(0, 0) rotate(0deg); }
    33% { transform: translate(var(--tx), var(--ty)) rotate(var(--rot)); }
    66% { transform: translate(calc(var(--tx) * -1), calc(var(--ty) * -1)) rotate(calc(var(--rot) * -1)); }
    100% { transform: translate(0, 0) rotate(0deg); }
}

.shape {
    animation-name: float-dynamic !important;
    animation-timing-function: ease-in-out !important;
    animation-iteration-count: infinite !important;
    /* Duration, Delay, and Transform Variables set by JS */
}


/* ========================================
   OVERRIDE FOR JS WANDERING
   Disable CSS animations so JS 'wander()' can control transform
======================================== */
.shape {
    animation: none !important;
    transition: transform 1s ease-in-out; /* Base transition, overridden by JS */
}

