/* ══════════════════════════════════════════
   ANIMATIONS
   Fade-in, reveal, hover effects
   ══════════════════════════════════════════ */

/* ─── Hero Fade-up Animations ─── */
.animate-fade-up {
    opacity: 0;
    transform: translateY(30px);
    animation: fadeUp 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.delay-1 { animation-delay: 0.15s; }
.delay-2 { animation-delay: 0.3s; }
.delay-3 { animation-delay: 0.45s; }
.delay-4 { animation-delay: 0.6s; }
.delay-5 { animation-delay: 0.75s; }

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

/* ─── Scroll Reveal ─── */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.7s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.reveal:nth-child(2) { transition-delay: 0.1s; }
.reveal:nth-child(3) { transition-delay: 0.2s; }
.reveal:nth-child(4) { transition-delay: 0.3s; }

/* ─── Card Hover Glow ─── */
.glass-card {
    position: relative;
}

.glass-card::after {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    background: var(--gradient-primary);
    opacity: 0;
    z-index: -1;
    transition: opacity 0.4s ease;
    filter: blur(20px);
}

.glass-card:hover::after {
    opacity: 0.08;
}

/* ─── Tech Bar Animation ─── */
@keyframes barFill {
    from { width: 0; }
}

/* ─── Skill Icon Rotate ─── */
.skill-card:hover .skill-icon-wrapper i {
    animation: iconBounce 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes iconBounce {
    0% { transform: scale(1); }
    40% { transform: scale(1.25); }
    100% { transform: scale(1); }
}

/* ─── Project Card Shimmer ─── */
.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(79, 106, 245, 0.03),
        transparent
    );
    transition: 0.6s ease;
    z-index: 1;
    pointer-events: none;
}

.project-card:hover::before {
    left: 100%;
}

/* ─── Timeline Pulse ─── */
.timeline-dot {
    animation: timelinePulse 3s ease-in-out infinite;
}

@keyframes timelinePulse {
    0%, 100% { box-shadow: 0 0 0 3px rgba(79, 106, 245, 0.3); }
    50% { box-shadow: 0 0 0 6px rgba(79, 106, 245, 0.15); }
}

/* ─── Contact Arrow Bounce ─── */
.contact-card:hover .contact-arrow i {
    animation: arrowBounce 0.6s ease infinite;
}

@keyframes arrowBounce {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(4px); }
}

/* ─── Code Window Typing Cursor ─── */
.code-body::after {
    content: '|';
    color: var(--primary-400);
    animation: blink 1s step-end infinite;
}

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

/* ─── Floating Particle ─── */
.particle {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    opacity: 0;
    animation: particleFloat linear infinite;
}

@keyframes particleFloat {
    0% {
        opacity: 0;
        transform: translateY(0) translateX(0) scale(0);
    }
    10% {
        opacity: 0.6;
        transform: scale(1);
    }
    90% {
        opacity: 0.3;
    }
    100% {
        opacity: 0;
        transform: translateY(-100vh) translateX(50px) scale(0.5);
    }
}

/* ─── Nav link underline transition ─── */
.nav-link::before {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--gradient-primary);
    border-radius: 2px;
    transition: var(--transition-base);
    transform: translateX(-50%);
}

.nav-link:hover::before {
    width: 20px;
}

/* ─── Section Tag Blink ─── */
.section-tag::after {
    content: '_';
    animation: blink 1.2s step-end infinite;
    color: var(--primary-400);
}

/* ─── About Card Slide ─── */
.about-card {
    transition: var(--transition-base);
}

.about-card:hover {
    transform: translateX(6px);
}

.about-card:hover .about-icon-wrapper {
    background: rgba(79, 106, 245, 0.15);
    border-color: var(--primary-500);
    color: var(--primary-300);
}

/* ─── Badge Shimmer ─── */
.hero-badge {
    position: relative;
    overflow: hidden;
}

.hero-badge::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 200%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.05),
        transparent
    );
    animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* ─── Tech Item Hover Glow ─── */
.tech-item:hover .tech-item-icon {
    background: rgba(79, 106, 245, 0.15);
    border-color: var(--primary-500);
    box-shadow: 0 0 15px rgba(79, 106, 245, 0.2);
}

/* ─── Reduced Motion ─── */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .reveal {
        opacity: 1;
        transform: none;
    }

    .animate-fade-up {
        opacity: 1;
        transform: none;
    }
}