/* ===== SITE-WIDE ANIMATIONS ===== */

/* ==============================
   SCROLL REVEAL SYSTEM
   Elements start hidden and animate in
   when they enter the viewport.
   ============================== */

/* Base state: hidden until JS marks them visible */
.reveal-on-scroll {
    opacity: 0;
    transform: translateY(32px);
    transition:
        opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
        transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
    transition-delay: var(--reveal-delay, 0ms);
}

.reveal-on-scroll.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Slide-in variants */
.reveal-left {
    opacity: 0;
    transform: translateX(-40px);
    transition:
        opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
        transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
    transition-delay: var(--reveal-delay, 0ms);
}

.reveal-left.is-visible {
    opacity: 1;
    transform: translateX(0);
}

.reveal-right {
    opacity: 0;
    transform: translateX(40px);
    transition:
        opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
        transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
    transition-delay: var(--reveal-delay, 0ms);
}

.reveal-right.is-visible {
    opacity: 1;
    transform: translateX(0);
}

.reveal-scale {
    opacity: 0;
    transform: scale(0.9);
    transition:
        opacity 0.6s cubic-bezier(0.22, 1, 0.36, 1),
        transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
    transition-delay: var(--reveal-delay, 0ms);
}

.reveal-scale.is-visible {
    opacity: 1;
    transform: scale(1);
}

/* ==============================
   CARDS - HOVER EFFECTS
   ============================== */

.skill-card,
.capability-card,
.project-card,
.service-card-v2 {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.skill-card:hover,
.capability-card:hover,
.service-card-v2:hover {
    transform: translateY(-12px) scale(1.02);
    box-shadow: 0 25px 60px rgba(47, 129, 217, 0.25);
}

.project-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 50px rgba(47, 129, 217, 0.3);
}

/* Icon Rotation on Hover */
.skill-icon,
.card-icon {
    transition: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.skill-card:hover .skill-icon,
.capability-card:hover .card-icon {
    transform: scale(1.15) rotate(360deg);
}

/* ==============================
   ABOUT SECTION
   ============================== */

.about-img {
    position: relative;
    animation: floatImage 4s ease-in-out infinite;
}

@keyframes floatImage {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

.about-img img:hover {
    transform: scale(1.05) rotate(2deg);
}

/* ==============================
   PROGRESS BAR SHIMMER
   ============================== */

.progress-bar {
    position: relative;
    overflow: hidden;
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}

/* ==============================
   NAVIGATION
   ============================== */

.nav-links a {
    position: relative;
    transition: all 0.3s ease;
}

.nav-links a::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.nav-links a:hover::before,
.nav-links a.active::before {
    width: 80%;
}

/* ==============================
   BUTTONS
   ============================== */

.btn {
    position: relative;
    overflow: hidden;
}

.btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    transform: translate(-50%, -50%);
    transition: width 0.5s, height 0.5s;
}

.btn:active::after {
    width: 300px;
    height: 300px;
}

/* ==============================
   PROJECT SLIDER
   ============================== */

.project-slide {
    transition: all 0.5s ease;
}

.project-slide.active {
    animation: slideIn 0.6s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(50px);
    }

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

/* ==============================
   CONTACT SECTION
   ============================== */

.form-control {
    transition: all 0.3s ease;
}

.form-control:focus {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(47, 129, 217, 0.25);
}

.info-item {
    transition: all 0.3s ease;
}

.info-item:hover {
    transform: translateX(8px);
    background: rgba(47, 129, 217, 0.08);
}

/* ==============================
   SOCIAL ICONS
   ============================== */

.social-icons a {
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.social-icons a:hover {
    transform: translateY(-10px) scale(1.15);
}

/* ==============================
   SCROLL TOP BUTTON
   ============================== */

.scroll-top-btn {
    transition: all 0.3s ease;
}

.scroll-top-btn:hover {
    transform: translateY(-5px);
}

/* ==============================
   TECH STACK TAGS
   ============================== */

.tech-stack span {
    display: inline-block;
    transition: all 0.3s ease;
}

.tech-stack span:hover {
    transform: translateY(-3px) scale(1.1);
    background: var(--primary-color);
    color: white;
}

/* ==============================
   LOGO
   ============================== */

.logo {
    transition: all 0.3s ease;
}

.logo:hover {
    transform: scale(1.1);
}

/* ==============================
   FILTER BUTTONS
   ============================== */

.filter-btn {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.filter-btn:hover {
    transform: translateY(-3px);
}

.filter-btn.active {
    animation: pulse 0.5s ease-out;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(1);
    }
}

/* ==============================
   MOBILE OPTIMIZATIONS
   ============================== */

@media (max-width: 768px) {

    .skill-card:hover,
    .capability-card:hover,
    .service-card-v2:hover {
        transform: translateY(-6px) scale(1.01);
    }

    .project-card:hover {
        transform: translateY(-5px);
    }

    .about-img {
        animation: none;
    }

    /* Faster reveal on mobile */
    .reveal-on-scroll,
    .reveal-left,
    .reveal-right,
    .reveal-scale {
        transition-duration: 0.5s;
    }
}

/* ==============================
   REDUCED MOTION
   ============================== */

@media (prefers-reduced-motion: reduce) {

    .reveal-on-scroll,
    .reveal-left,
    .reveal-right,
    .reveal-scale {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}