/* ========================================
   KEYFRAME ANIMATIONS
   ======================================== */
@keyframes loadingProgress {
    0% { width: 0; }
    100% { width: 100%; }
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

@keyframes glow {
    0%, 100% { box-shadow: 0 0 5px var(--accent-glow); }
    50% { box-shadow: 0 0 20px var(--accent-glow), 0 0 30px var(--accent-dim); }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes drawLine {
    from { stroke-dashoffset: 1000; }
    to { stroke-dashoffset: 0; }
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* ========================================
   PAGE TRANSITION - GLITCH EFFECT
   ======================================== */
.page-transition {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
}

.page-transition.active {
    opacity: 1;
    visibility: visible;
    pointer-events: all;
}

.glitch-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg);
}

.glitch-slice {
    position: absolute;
    width: 100%;
    background-color: var(--bg);
    overflow: hidden;
}

@keyframes glitchSlice {
    0% { transform: translateX(0); }
    20% { transform: translateX(-10px); }
    40% { transform: translateX(10px); }
    60% { transform: translateX(-5px); }
    80% { transform: translateX(5px); }
    100% { transform: translateX(0); }
}

@keyframes rgbSplit {
    0% { text-shadow: 0 0 0 transparent; }
    25% { text-shadow: -2px 0 #ff0000, 2px 0 #00ffff; }
    50% { text-shadow: 2px 0 #ff0000, -2px 0 #00ffff; }
    75% { text-shadow: -1px 0 #ff0000, 1px 0 #00ffff; }
    100% { text-shadow: 0 0 0 transparent; }
}

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

.transition-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 14px;
    letter-spacing: 4px;
    color: var(--accent);
    text-transform: uppercase;
    animation: rgbSplit 0.3s ease infinite;
}

/* ========================================
   REVEAL ANIMATIONS
   ======================================== */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }
.reveal-delay-5 { transition-delay: 0.5s; }
.reveal-delay-6 { transition-delay: 0.6s; }

/* ========================================
   TYPING CURSOR
   ======================================== */
.typing-cursor {
    display: inline-block;
    width: 3px;
    height: 1em;
    background-color: var(--accent);
    margin-left: 4px;
    animation: blink 1s infinite;
    vertical-align: text-bottom;
    transition: background-color 0.4s ease;
}

/* ========================================
   COUNTER ANIMATION
   ======================================== */
.counter {
    display: inline-block;
}

.counter.animating {
    animation: pulse 0.1s ease;
}

/* ========================================
   STAGGER ANIMATIONS
   ======================================== */
.stagger-item {
    opacity: 0;
    transform: translateY(20px);
}

.stagger-item.visible {
    animation: slideInUp 0.6s ease forwards;
}

.stagger-item:nth-child(1) { animation-delay: 0.1s; }
.stagger-item:nth-child(2) { animation-delay: 0.2s; }
.stagger-item:nth-child(3) { animation-delay: 0.3s; }
.stagger-item:nth-child(4) { animation-delay: 0.4s; }
.stagger-item:nth-child(5) { animation-delay: 0.5s; }
.stagger-item:nth-child(6) { animation-delay: 0.6s; }

/* ========================================
   HOVER MICRO-INTERACTIONS
   ======================================== */
.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-4px);
}

.hover-glow:hover {
    box-shadow: 0 0 30px var(--accent-dim);
}

.hover-scale {
    transition: transform 0.3s ease;
}

.hover-scale:hover {
    transform: scale(1.05);
}

/* ========================================
   ICON ANIMATIONS
   ======================================== */
.icon-bounce:hover svg {
    animation: float 0.6s ease;
}

.icon-spin:hover svg {
    animation: spin 0.6s ease;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ========================================
   LINE DRAWING ANIMATION
   ======================================== */
.draw-line {
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
}

.draw-line.visible {
    animation: drawLine 2s ease forwards;
}

/* ========================================
   PROGRESS BAR ANIMATION
   ======================================== */
.progress-bar-fill {
    width: 0;
    transition: width 1.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-bar-fill.animated {
    /* Width set via data-width attribute in JS */
}
