/* ===== SCROLL REVEAL ANIMATIONS ===== */

/* Auto-applied scroll reveal (via JavaScript) */
.scroll-reveal {
    opacity: 0;
    transform: translateY(25px) translateZ(0);
    transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
        transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: opacity, transform;
}

.scroll-reveal.revealed {
    opacity: 1;
    transform: translateY(0) translateZ(0);
}

/* Manual reveal class */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.active,
.reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

.reveal-left {
    opacity: 0;
    transform: translateX(-50px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal-left.active {
    opacity: 1;
    transform: translateX(0);
}

.reveal-right {
    opacity: 0;
    transform: translateX(50px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal-right.active {
    opacity: 1;
    transform: translateX(0);
}

.reveal-scale {
    opacity: 0;
    transform: scale(0.8);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal-scale.active {
    opacity: 1;
    transform: scale(1);
}

/* ===== STAGGER ANIMATIONS ===== */
.stagger>* {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.stagger.active>*:nth-child(1) {
    transition-delay: 0.1s;
}

.stagger.active>*:nth-child(2) {
    transition-delay: 0.2s;
}

.stagger.active>*:nth-child(3) {
    transition-delay: 0.3s;
}

.stagger.active>*:nth-child(4) {
    transition-delay: 0.4s;
}

.stagger.active>*:nth-child(5) {
    transition-delay: 0.5s;
}

.stagger.active>*:nth-child(6) {
    transition-delay: 0.6s;
}

.stagger.active>*:nth-child(7) {
    transition-delay: 0.7s;
}

.stagger.active>*:nth-child(8) {
    transition-delay: 0.8s;
}

.stagger.active>*:nth-child(9) {
    transition-delay: 0.9s;
}

.stagger.active>*:nth-child(10) {
    transition-delay: 1s;
}

.stagger.active>* {
    opacity: 1;
    transform: translateY(0);
}

/* ===== HERO ANIMATIONS ===== */
.hero__greeting {
    animation: fadeInDown 0.8s ease forwards;
    opacity: 0;
}

.hero__title {
    animation: fadeInUp 0.8s ease 0.2s forwards;
    opacity: 0;
}

.hero__profession {
    animation: fadeInUp 0.8s ease 0.4s forwards;
    opacity: 0;
}

.hero__subtitle {
    animation: fadeInUp 0.8s ease 0.6s forwards;
    opacity: 0;
}

.hero__buttons {
    animation: fadeInUp 0.8s ease 0.8s forwards;
    opacity: 0;
}

.hero__social {
    animation: fadeInUp 0.8s ease 1s forwards;
    opacity: 0;
}

.hero__image {
    animation: fadeInRight 1s ease 0.5s forwards;
    opacity: 0;
}

/* ===== PARTICLE ANIMATION ===== */
.particle {
    position: absolute;
    width: 10px;
    height: 10px;
    background: var(--primary);
    border-radius: 50%;
    opacity: 0.3;
    animation: float 15s infinite;
}

.particle:nth-child(1) {
    top: 10%;
    left: 10%;
    animation-delay: 0s;
    width: 15px;
    height: 15px;
}

.particle:nth-child(2) {
    top: 20%;
    left: 80%;
    animation-delay: 2s;
    width: 8px;
    height: 8px;
}

.particle:nth-child(3) {
    top: 60%;
    left: 15%;
    animation-delay: 4s;
    width: 12px;
    height: 12px;
}

.particle:nth-child(4) {
    top: 70%;
    left: 70%;
    animation-delay: 1s;
    width: 6px;
    height: 6px;
}

.particle:nth-child(5) {
    top: 40%;
    left: 40%;
    animation-delay: 3s;
    width: 10px;
    height: 10px;
}

.particle:nth-child(6) {
    top: 80%;
    left: 25%;
    animation-delay: 5s;
    width: 14px;
    height: 14px;
}

.particle:nth-child(7) {
    top: 30%;
    left: 60%;
    animation-delay: 2.5s;
    width: 9px;
    height: 9px;
}

.particle:nth-child(8) {
    top: 50%;
    left: 85%;
    animation-delay: 1.5s;
    width: 11px;
    height: 11px;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0) translateX(0) rotate(0deg);
        opacity: 0.3;
    }

    25% {
        transform: translateY(-30px) translateX(20px) rotate(90deg);
        opacity: 0.5;
    }

    50% {
        transform: translateY(-10px) translateX(-20px) rotate(180deg);
        opacity: 0.3;
    }

    75% {
        transform: translateY(-40px) translateX(10px) rotate(270deg);
        opacity: 0.5;
    }
}

/* ===== COUNTER ANIMATION ===== */
.stat__number {
    display: inline-block;
}

/* ===== BUTTON ANIMATIONS ===== */
.btn {
    position: relative;
    overflow: hidden;
}

.btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.btn:active::after {
    width: 300px;
    height: 300px;
}

/* ===== HOVER ANIMATIONS ===== */
.nav__link::after {
    transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.gallery__item img {
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.project-card,
.benefit-card,
.cert-card,
.package,
.skill {
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1),
        box-shadow 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    transform: translateZ(0);
    will-change: transform, box-shadow;
}

/* ===== LOADING ANIMATION ===== */
.loading-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ===== GRADIENT ANIMATION ===== */
.animated-gradient {
    background: linear-gradient(-45deg, #0066CC, #6C63FF, #FF6B35, #0066CC);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* ===== KEYFRAMES ===== */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }

    50% {
        transform: scale(1.05);
    }

    70% {
        transform: scale(0.9);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes slideInFromBottom {
    from {
        opacity: 0;
        transform: translateY(100%);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== GLOW PULSE ===== */
@keyframes glowPulse {

    0%,
    100% {
        filter: blur(80px);
        opacity: 0.3;
    }

    50% {
        filter: blur(100px);
        opacity: 0.5;
    }
}

.hero__image-glow {
    animation: glowPulse 3s ease-in-out infinite;
}

/* ===== SHAKE ANIMATION ===== */
@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    10%,
    30%,
    50%,
    70%,
    90% {
        transform: translateX(-5px);
    }

    20%,
    40%,
    60%,
    80% {
        transform: translateX(5px);
    }
}

.shake {
    animation: shake 0.5s ease;
}

/* ===== SUCCESS ANIMATION ===== */
@keyframes successPop {
    0% {
        transform: scale(0);
        opacity: 0;
    }

    50% {
        transform: scale(1.2);
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.success-icon {
    animation: successPop 0.5s ease forwards;
}

/* ===== TESTIMONIALS INFINITE SCROLL ===== */
.testimonials__track {
    display: flex;
    gap: 30px;
    width: max-content;
}

/* Duplicate cards for seamless loop - handled in JS */