/* === PREMIUM ANIMATIONS & MICRO-INTERACTIONS === */

/* 1. Scroll Animations (Fade + Upward Motion) */
.reveal-on-scroll {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1), transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
    will-change: opacity, transform;
}

.reveal-on-scroll.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger delays handled via JS or inline styles */

/* 2. Magnetic Buttons */
.magnetic-btn {
    display: inline-block;
    transition: transform 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform;
}

/* 3. Hero Section Upgrades */
/* Floating Gradient Blobs */
.hero-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
    z-index: -1;
    animation: floatBlob 10s infinite alternate ease-in-out;
}

.blob-1 {
    top: -10%;
    left: -10%;
    width: 400px;
    height: 400px;
    background: var(--gradient-start);
    animation-delay: 0s;
}

.blob-2 {
    bottom: -10%;
    right: -10%;
    width: 300px;
    height: 300px;
    background: var(--gradient-end);
    animation-delay: -5s;
}

@keyframes floatBlob {
    0% {
        transform: translate(0, 0) scale(1);
    }

    100% {
        transform: translate(40px, -40px) scale(1.1);
    }
}

/* Animated Glowing Underline */
.glow-underline {
    position: relative;
    display: inline-block;
}

.glow-underline::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent-color), transparent);
    background-size: 200% 100%;
    animation: shimmerUnderline 3s infinite linear;
    transform-origin: left;
    transform: scaleX(0);
    transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.glow-underline:hover::after,
.glow-underline.animate-underline::after {
    transform: scaleX(1);
}

@keyframes shimmerUnderline {
    0% {
        background-position: 100% 0;
    }

    100% {
        background-position: -100% 0;
    }
}

/* Cursor Glow */
.cursor-glow {
    position: fixed;
    top: 0;
    left: 0;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(var(--accent-color-rgb), 0.15), transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    transform: translate(-50%, -50%);
    z-index: 9999;
    mix-blend-mode: screen;
    opacity: 0;
    transition: opacity 0.5s ease;
}

body:hover .cursor-glow {
    opacity: 1;
}

/* 4. Project Cards 3D Tilt */
.tilt-card {
    transition: transform 0.1s ease-out, box-shadow 0.3s ease;
    transform-style: preserve-3d;
    perspective: 1000px;
}

.tilt-card:hover {
    z-index: 10;
}

.tilt-content {
    transform: translateZ(20px);
}

/* 5. Skills Section Hover Pulse & Rotate */
.skill-item {
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.3s ease;
}

.skill-item:hover {
    transform: scale(1.1) rotate(3deg);
    filter: drop-shadow(0 0 15px rgba(var(--accent-color-rgb), 0.4));
}

.skill-item:hover i,
.skill-item:hover svg,
.skill-item:hover img {
    animation: iconPulse 1s infinite;
}

@keyframes iconPulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
    }
}

/* 6. Timeline Upgrade */
/* Vertical Gradient Line Growth handled in existing CSS or will be enhanced */
.timeline-line-gradient {
    box-shadow: 0 0 10px var(--accent-color);
}

/* Pulse Effect on Timeline Icons */
.timeline-icon-pulse {
    position: relative;
}

.timeline-icon-pulse::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid var(--accent-color);
    opacity: 0;
    animation: ripple 2s infinite;
}

@keyframes ripple {
    0% {
        width: 100%;
        height: 100%;
        opacity: 0.6;
    }

    100% {
        width: 200%;
        height: 200%;
        opacity: 0;
    }
}

/* 7. Scroll Progress Bar */
#scroll-progress-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    z-index: 100;
    background: transparent;
}

#scroll-progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--gradient-start), var(--gradient-mid), var(--gradient-end));
    border-radius: 0 2px 2px 0;
    transition: width 0.1s linear;
    box-shadow: 0 0 10px rgba(var(--accent-color-rgb), 0.5);
}

/* 8. Page Transition Effect */
body {
    opacity: 0;
    animation: pageFadeIn 0.8s ease-out forwards;
}

@keyframes pageFadeIn {
    from {
        opacity: 0;
        transform: scale(0.98);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Optional: Smooth Scroll Inertia (Basic CSS implementation) */
html {
    scroll-behavior: smooth;
}