/* Text animations */
.glitch-text {
    position: relative;
    animation: glitch 1s linear infinite;
    font-family: 'Orbitron', sans-serif;
}

@keyframes glitch {
    2%, 64% {
        transform: translate(2px, 0) skew(0deg);
    }
    4%, 60% {
        transform: translate(-2px, 0) skew(0deg);
    }
    62% {
        transform: translate(0, 0) skew(5deg);
    }
}

.glitch-text:before,
.glitch-text:after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.glitch-text:before {
    left: 2px;
    text-shadow: -2px 0 var(--accent-secondary);
    clip: rect(24px, 550px, 90px, 0);
    animation: glitch-anim 2s linear infinite alternate-reverse;
}

.glitch-text:after {
    left: -2px;
    text-shadow: -2px 0 var(--accent-tertiary);
    clip: rect(85px, 550px, 140px, 0);
    animation: glitch-anim2 2s linear infinite alternate-reverse;
}

/* Typewriter effect - updated */
.typewriter {
    overflow: hidden;
    white-space: nowrap;
    margin: 0 auto;
    letter-spacing: 0.15em;
}

/* Page transitions */
.page-transition {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-primary);
    z-index: 9999;
    transform: scaleY(0);
    transform-origin: top;
}

.page-transition.enter {
    transform: scaleY(1);
    animation: pageEnter 0.7s cubic-bezier(0.76, 0, 0.24, 1) forwards;
}

.page-transition.exit {
    transform: scaleY(1);
    transform-origin: bottom;
    animation: pageExit 0.7s cubic-bezier(0.76, 0, 0.24, 1) forwards;
}

@keyframes pageEnter {
    from { transform: scaleY(0); }
    to { transform: scaleY(1); }
}

@keyframes pageExit {
    from { transform: scaleY(1); }
    to { transform: scaleY(0); }
}

/* Typing cursor animation */
.typing-cursor {
    display: inline-block;
    margin-left: 2px;
    width: 2px;
    animation: blink 0.7s infinite;
    color: inherit;
    font-weight: bold;
    font-size: 1.2em;
    vertical-align: middle;
    position: relative;
    top: -2px;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* Ensure the changing text container has proper styling */
#changing-text {
    display: inline-flex;
    align-items: center;
    min-width: 200px;
    position: relative;
    white-space: nowrap;
}

#changing-text span:first-child {
    display: inline-block;
}

/* Add smooth transitions for text changes */
#changing-text, .typing-cursor {
    transition: all 0.1s ease;
}

/* Modern Custom Mouse Cursor */
.custom-cursor {
    width: 10px;
    height: 10px;
    background-color: var(--accent-primary);
    clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
    position: fixed;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 10000;
    transform: translate(-50%, -50%) rotate(45deg);
    transition: transform 0.1s ease-out, width 0.1s ease-out, height 0.1s ease-out;
    will-change: transform;
    backface-visibility: hidden;
}

.cursor-ring {
    width: 30px;
    height: 30px;
    border: 1.5px solid var(--accent-primary);
    clip-path: polygon(0 0, 100% 0, 100% 15%, 15% 15%, 15% 100%, 0 100%);
    position: fixed;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
    transition: transform 0.15s ease-out, width 0.15s ease-out, height 0.15s ease-out;
    will-change: transform;
    backface-visibility: hidden;
}

/* Interactive states */
.cursor-hover {
    width: 20px;
    height: 20px;
    background-color: rgba(var(--accent-primary-rgb), 0.5);
    clip-path: polygon(30% 0%, 70% 0%, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0% 70%, 0% 30%);
    transform: translate(-50%, -50%) rotate(0deg);
}

.cursor-ring-hover {
    width: 40px;
    height: 40px;
    border-color: rgba(var(--accent-primary-rgb), 0.5);
    clip-path: polygon(0 0, 100% 0, 100% 25%, 25% 25%, 25% 100%, 0 100%);
    transform: translate(-50%, -50%) scale(1.1);
}

.cursor-click {
    width: 15px;
    height: 15px;
    transform: translate(-50%, -50%) rotate(180deg) scale(0.9);
}

.cursor-ring-click {
    width: 25px;
    height: 25px;
    transform: translate(-50%, -50%) scale(0.9);
}

/* Hide default cursor */
body {
    cursor: none !important;
}

a, button, input[type="button"], input[type="submit"], [role="button"] {
    cursor: none !important;
}

/* Add subtle animation for cursor ring */
@keyframes cursorPulse {
    0% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-50%, -50%) scale(1.1); }
    100% { transform: translate(-50%, -50%) scale(1); }
}

.cursor-ring {
    animation: cursorPulse 2s ease-in-out infinite;
}

:root {
    --accent-primary: #64ffda;
    --accent-primary-rgb: 100, 255, 218;
    --accent-secondary: #64ffda;
    --accent-tertiary: #64ffda;
}

/* Add to your existing animations.css */

/* Reveal animations for sections */
.reveal-element {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal-element.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered reveal for multiple elements */
.stagger-reveal > * {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

/* Enhanced glitch effect */
.glitch-text {
    position: relative;
    font-family: 'Orbitron', sans-serif;
    color: var(--text-primary);
    letter-spacing: 2px;
    text-shadow: 0.05em 0 0 rgba(255, 0, 0, 0.75),
               -0.025em -0.05em 0 rgba(0, 255, 0, 0.75),
               0.025em 0.05em 0 rgba(0, 0, 255, 0.75);
    animation: glitch 500ms infinite;
}

@keyframes glitch {
    0% {
        text-shadow: 0.05em 0 0 rgba(255, 0, 0, 0.75),
                   -0.025em -0.05em 0 rgba(0, 255, 0, 0.75),
                   0.025em 0.05em 0 rgba(0, 0, 255, 0.75);
    }
    14% {
        text-shadow: 0.05em 0 0 rgba(255, 0, 0, 0.75),
                   -0.025em -0.05em 0 rgba(0, 255, 0, 0.75),
                   0.025em 0.05em 0 rgba(0, 0, 255, 0.75);
    }
    15% {
        text-shadow: -0.05em -0.025em 0 rgba(255, 0, 0, 0.75),
                   0.025em 0.025em 0 rgba(0, 255, 0, 0.75),
                   -0.05em -0.05em 0 rgba(0, 0, 255, 0.75);
    }
    49% {
        text-shadow: -0.05em -0.025em 0 rgba(255, 0, 0, 0.75),
                   0.025em 0.025em 0 rgba(0, 255, 0, 0.75),
                   -0.05em -0.05em 0 rgba(0, 0, 255, 0.75);
    }
    50% {
        text-shadow: 0.025em 0.05em 0 rgba(255, 0, 0, 0.75),
                   0.05em 0 0 rgba(0, 255, 0, 0.75),
                   0 -0.05em 0 rgba(0, 0, 255, 0.75);
    }
    99% {
        text-shadow: 0.025em 0.05em 0 rgba(255, 0, 0, 0.75),
                   0.05em 0 0 rgba(0, 255, 0, 0.75),
                   0 -0.05em 0 rgba(0, 0, 255, 0.75);
    }
    100% {
        text-shadow: -0.025em 0 0 rgba(255, 0, 0, 0.75),
                   -0.025em -0.025em 0 rgba(0, 255, 0, 0.75),
                   -0.025em -0.05em 0 rgba(0, 0, 255, 0.75);
    }
}