/* ================================================================
   DevCloudPeru – Animations
   ================================================================ */

/* ---- Keyframes ---- */
@keyframes pulse-glow {

    0%,
    100% {
        transform: scale(1);
        filter: drop-shadow(0 0 12px rgba(212, 160, 23, 0.4));
    }

    50% {
        transform: scale(1.05);
        filter: drop-shadow(0 0 24px rgba(212, 160, 23, 0.8));
    }
}

@keyframes load-bar {
    0% {
        width: 0%;
        margin-left: 0;
    }

    50% {
        width: 80%;
        margin-left: 0;
    }

    100% {
        width: 0%;
        margin-left: 100%;
    }
}

@keyframes blink-dot {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.4;
        transform: scale(0.7);
    }
}

@keyframes scroll-anim {
    0% {
        height: 40px;
        opacity: 1;
    }

    100% {
        height: 0px;
        opacity: 0;
    }
}

@keyframes float-badge-1 {

    0%,
    100% {
        transform: translateY(0px) rotate(-2deg);
    }

    50% {
        transform: translateY(-8px) rotate(1deg);
    }
}

@keyframes float-badge-2 {

    0%,
    100% {
        transform: translateY(0px) rotate(1deg);
    }

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

@keyframes shimmer {
    0% {
        background-position: -400px 0;
    }

    100% {
        background-position: 400px 0;
    }
}

@keyframes gradient-shift {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

@keyframes spin-slow {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

@keyframes bounce-in {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }

    70% {
        transform: scale(1.05);
    }

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

@keyframes slide-in-left {
    from {
        transform: translateX(-60px);
        opacity: 0;
    }

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

@keyframes slide-in-right {
    from {
        transform: translateX(60px);
        opacity: 0;
    }

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

@keyframes ripple {
    0% {
        transform: scale(0);
        opacity: 0.4;
    }

    100% {
        transform: scale(4);
        opacity: 0;
    }
}

@keyframes pattern-scroll {
    0% {
        background-position: 0 0;
    }

    100% {
        background-position: 60px 0;
    }
}

/* ---- Float Badges ---- */
.float-1 {
    animation: float-badge-1 4s ease-in-out infinite;
}

.float-2 {
    animation: float-badge-2 5s ease-in-out infinite 1s;
}

/* ---- Inca Band Animation ---- */
.inca-band {
    animation: pattern-scroll 3s linear infinite;
}

/* ---- Hero Title Shimmer ---- */
.hero-title .gradient-text {
    background-size: 200% 200%;
    animation: gradient-shift 4s ease infinite;
}

/* ---- Hero Parallax BG ---- */
.hero-img {
    transition: transform 0.1s linear;
    will-change: transform;
}

/* ---- Hover Tab Ripple ---- */
.region-tab {
    position: relative;
    overflow: hidden;
}

.region-tab::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.15) 0%, transparent 70%);
    transform: scale(0);
    border-radius: inherit;
    transition: transform 0.4s ease;
    pointer-events: none;
}

.region-tab:active::after {
    transform: scale(2);
    opacity: 0;
}

/* ---- Service Card Glow Pulse (on hover) ---- */
.service-card:hover .service-icon-wrap {
    animation: pulse-glow 1.5s ease-in-out infinite;
}

/* ---- About Logo Spin ---- */
.about-logo:hover {
    animation: spin-slow 4s linear infinite;
}

/* ---- Nav smooth underline ---- */
.nav-link {
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--sierra-gold);
    border-radius: 1px;
    transition: width 0.3s ease, left 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 80%;
    left: 10%;
}

/* ---- Scroll progress bar ---- */
#scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg,
            var(--peru-red),
            var(--sierra-gold),
            var(--selva-green));
    z-index: 9001;
    width: 0%;
    transition: width 0.1s linear;
}

/* ---- Counter number animation ---- */
.region-stat .rs-num {
    display: inline-block;
}

/* ---- Value items stagger ---- */
.value-item:nth-child(1) {
    transition-delay: 0.05s;
}

.value-item:nth-child(2) {
    transition-delay: 0.15s;
}

.value-item:nth-child(3) {
    transition-delay: 0.25s;
}

/* ---- Form input focus animation ---- */
.form-group input:focus+.input-highlight,
.form-group textarea:focus+.input-highlight {
    transform: scaleX(1);
}

/* ---- Button ripple ---- */
.btn {
    position: relative;
    overflow: hidden;
}

.btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 10px;
    height: 10px;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(0);
    pointer-events: none;
}

.btn:active::after {
    animation: ripple 0.5s ease-out forwards;
}

/* ---- Service card entrance stagger ---- */
.service-card:nth-child(1) {
    transition-delay: 0.0s;
}

.service-card:nth-child(2) {
    transition-delay: 0.1s;
}

.service-card:nth-child(3) {
    transition-delay: 0.2s;
}

.service-card:nth-child(4) {
    transition-delay: 0.15s;
}

.service-card:nth-child(5) {
    transition-delay: 0.25s;
}

.service-card:nth-child(6) {
    transition-delay: 0.35s;
}

/* ---- Porque items stagger ---- */
.porque-item:nth-child(1) {
    transition-delay: 0.00s;
}

.porque-item:nth-child(2) {
    transition-delay: 0.08s;
}

.porque-item:nth-child(3) {
    transition-delay: 0.16s;
}

.porque-item:nth-child(4) {
    transition-delay: 0.24s;
}

.porque-item:nth-child(5) {
    transition-delay: 0.32s;
}

.porque-item:nth-child(6) {
    transition-delay: 0.40s;
}

/* ---- Footer links hover ---- */
.footer-col a {
    position: relative;
    display: inline-block;
}

.footer-col a::before {
    content: '▸ ';
    opacity: 0;
    transition: opacity 0.2s ease, margin 0.2s ease;
    color: var(--sierra-gold);
    margin-right: 0;
}

.footer-col a:hover::before {
    opacity: 1;
    margin-right: 2px;
}

/* ---- Reduced motion ---- */
@media (prefers-reduced-motion: reduce) {

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