/* =============================================
   MGEN IA — Efectos Espectaculares
   Animaciones avanzadas, partículas, 3D, glows
   ============================================= */

/* ---------- ANIMATED GRADIENT TEXT ---------- */
@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

.text-gradient {
    background: linear-gradient(135deg, #0ee668, #4fd1c5, #2563eb, #0ee668);
    background-size: 300% 300%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 4s ease infinite;
}

/* ---------- GLOWING BUTTONS ---------- */
@keyframes pulseGlow {

    0%,
    100% {
        box-shadow: 0 0 20px rgba(14, 230, 104, 0.3);
    }

    50% {
        box-shadow: 0 0 40px rgba(14, 230, 104, 0.6), 0 0 80px rgba(79, 209, 197, 0.2);
    }
}

.btn-primary {
    position: relative;
    overflow: hidden;
    animation: pulseGlow 3s ease infinite;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.2) 50%, transparent 70%);
    transform: rotate(45deg) translateX(-100%);
    transition: transform 0.6s;
}

.btn-primary:hover::before {
    transform: rotate(45deg) translateX(100%);
}

/* ---------- 3D CARD TILT ---------- */
.feature-card,
.service-main-card,
.paquete-card {
    transform-style: preserve-3d;
    perspective: 1000px;
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}

/* ---------- FLOATING PARTICLES ---------- */
@keyframes float {

    0%,
    100% {
        transform: translateY(0) rotate(0deg);
        opacity: 0.6;
    }

    33% {
        transform: translateY(-20px) rotate(120deg);
        opacity: 1;
    }

    66% {
        transform: translateY(10px) rotate(240deg);
        opacity: 0.4;
    }
}

@keyframes floatReverse {

    0%,
    100% {
        transform: translateY(0) rotate(0deg) scale(1);
    }

    50% {
        transform: translateY(-30px) rotate(180deg) scale(1.1);
    }
}

.section-white,
.section-light,
.section-soft {
    position: relative;
    overflow: hidden;
}

/* ---------- HERO ENHANCEMENTS ---------- */
.hero {
    position: relative;
}

#neuralCanvas {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
}

.hero-overlay {
    z-index: 2;
    background: rgba(15, 27, 45, 0.82);
}

.hero-content {
    z-index: 3;
}

/* Typing cursor */
@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

.typing-cursor {
    display: inline-block;
    width: 3px;
    height: 1em;
    background: var(--green);
    margin-left: 4px;
    animation: blink 0.8s step-end infinite;
    vertical-align: text-bottom;
}

/* ---------- STAT COUNTERS ---------- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 32px;
    margin-top: 60px;
}

.stat-card {
    text-align: center;
    padding: 32px 28px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: all 0.4s;
    position: relative;
    overflow: hidden;
    min-width: 0;
}

.stat-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-brand);
    transform: scaleX(0);
    transition: transform 0.4s;
}

.stat-card:hover::after {
    transform: scaleX(1);
}

.stat-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-card-hover);
}

.stat-number {
    font-family: var(--font-heading);
    font-size: 48px;
    font-weight: 900;
    background: var(--gradient-brand);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
    margin-bottom: 8px;
}

.stat-label {
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 500;
}

/* ---------- SCROLL PROGRESS BAR ---------- */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: var(--gradient-brand);
    z-index: 9999;
    transition: width 0.1s linear;
    border-radius: 0 2px 2px 0;
}

/* ---------- GLASSMORPHISM CARDS ---------- */
.glass-card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 32px rgba(15, 27, 45, 0.08);
}

/* ---------- GRADIENT BORDER EFFECT ---------- */
.gradient-border {
    position: relative;
    background: var(--bg-card);
    border-radius: var(--radius);
}

.gradient-border::before {
    content: '';
    position: absolute;
    inset: -2px;
    background: var(--gradient-brand);
    border-radius: calc(var(--radius) + 2px);
    z-index: -1;
    opacity: 0;
    transition: opacity 0.4s;
}

.gradient-border:hover::before {
    opacity: 1;
}

/* ---------- MARQUEE STRIP ---------- */
@keyframes marquee {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

.marquee-strip {
    overflow: hidden;
    white-space: nowrap;
    background: var(--bg-dark);
    padding: 24px 0;
}

.marquee-inner {
    display: inline-flex;
    animation: marquee 20s linear infinite;
}

.marquee-item {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 0 30px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 22px;
    font-weight: 600;
}

.marquee-item .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--green);
}

/* ---------- ENHANCED SLIDE-IN VARIANTS ---------- */
.slide-in-left {
    opacity: 0;
    transform: translateX(-60px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.slide-in-right {
    opacity: 0;
    transform: translateX(60px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.slide-in-scale {
    opacity: 0;
    transform: scale(0.85);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.slide-in-left.visible,
.slide-in-right.visible,
.slide-in-scale.visible {
    opacity: 1;
    transform: none;
}

/* ---------- DECORATIVE SHAPES ---------- */
.deco-circle {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    opacity: 0.06;
}

.deco-circle-1 {
    width: 400px;
    height: 400px;
    background: var(--green);
    top: -100px;
    right: -100px;
    animation: floatReverse 8s ease infinite;
}

.deco-circle-2 {
    width: 300px;
    height: 300px;
    background: var(--teal);
    bottom: -80px;
    left: -80px;
    animation: float 10s ease infinite;
}

.deco-circle-3 {
    width: 200px;
    height: 200px;
    background: var(--blue);
    top: 50%;
    right: -60px;
    animation: floatReverse 12s ease infinite;
}

/* ---------- SMOOTH HOVER LIFT FOR ALL CARDS ---------- */
.feature-card:hover,
.service-main-card:hover,
.paquete-card:hover {
    transform: translateY(-8px) scale(1.01);
}

/* ---------- IMAGE REVEAL ---------- */
.img-reveal {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-xl);
}

.img-reveal::after {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--gradient-brand);
    transform: translateX(-100%);
    transition: transform 0.8s cubic-bezier(0.77, 0, 0.175, 1);
}

.img-reveal.visible::after {
    transform: translateX(100%);
}

/* ---------- RESPONSIVE STATS ---------- */
@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    .stat-number {
        font-size: 36px;
    }
}

/* ---------- DYNAMIC HERO TITLE ---------- */
.hero-title-dynamic {
    position: relative;
    animation: heroTitleGlow 3s ease-in-out infinite;
}

@keyframes heroTitleGlow {

    0%,
    100% {
        text-shadow:
            0 0 20px rgba(79, 209, 197, 0.2),
            0 0 40px rgba(79, 209, 197, 0.1);
    }

    50% {
        text-shadow:
            0 0 30px rgba(79, 209, 197, 0.4),
            0 0 60px rgba(79, 209, 197, 0.2),
            0 0 100px rgba(14, 230, 104, 0.1);
    }
}

/* ---------- ANIMATED FLOATING TITLE ---------- */
.animated-title {
    animation: titleFloat 4s ease-in-out infinite;
    position: relative;
}

.animated-title .text-gradient-animated {
    display: inline-block;
    animation: titleFloat 3s ease-in-out infinite reverse, gradientFlow 3s linear infinite;
    background: linear-gradient(90deg,
            #4fd1c5 0%,
            #0ee668 20%,
            #2563eb 40%,
            #4fd1c5 60%,
            #0ee668 80%,
            #4fd1c5 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 0 12px rgba(14, 230, 104, 0.3));
}

@keyframes titleFloat {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-6px);
    }
}

/* Animated gradient text with shimmer */
.text-gradient-animated {
    background: linear-gradient(90deg,
            #4fd1c5 0%,
            #0ee668 20%,
            #2563eb 40%,
            #4fd1c5 60%,
            #0ee668 80%,
            #4fd1c5 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientFlow 3s linear infinite;
    position: relative;
    display: inline-block;
}

@keyframes gradientFlow {
    0% {
        background-position: 0% center;
    }

    100% {
        background-position: 200% center;
    }
}

/* Shimmer light sweep over the text */
.text-gradient-animated::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 60%;
    height: 100%;
    background: linear-gradient(90deg,
            transparent 0%,
            rgba(255, 255, 255, 0.4) 50%,
            transparent 100%);
    animation: shimmerSweep 4s ease-in-out infinite;
    pointer-events: none;
}

@keyframes shimmerSweep {
    0% {
        left: -100%;
    }

    50% {
        left: 150%;
    }

    100% {
        left: 150%;
    }
}

/* ─── Stats Inline ─── */
.stats-inline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 40px;
    padding: 32px 0;
}

.stat-inline {
    text-align: center;
    flex: 1;
}

.stat-inline-number {
    display: flex;
    align-items: baseline;
    justify-content: center;
    font-size: 46px;
    font-weight: 800;
    background: linear-gradient(135deg, #39FF14, #00d4aa, #2563eb);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
    line-height: 1;
    gap: 2px;
}

.stat-inline-number span {
    font-size: 0.6em; /* Escalar prefijos/sufijos */
    font-weight: 700;
}

.stat-inline-label {
    display: block;
    font-size: 15px;
    color: var(--text-secondary, #6e6e73);
    margin-top: 8px;
    font-weight: 500;
}

.stat-inline-divider {
    width: 1px;
    height: 40px;
    background: var(--border, rgba(0,0,0,0.08));
}

@media (max-width: 640px) {
    .stats-inline {
        flex-wrap: wrap;
        gap: 20px;
    }
    .stat-inline {
        flex: 0 0 45%;
    }
    .stat-inline-divider {
        display: none;
    }
}

/* ─── Services Mini Grid ─── */
.services-mini-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin-top: 48px;
}

.service-mini-card {
    background: var(--bg-card, #fff);
    border: 1px solid var(--border, rgba(0,0,0,0.08));
    border-radius: var(--radius, 16px);
    padding: 32px 24px;
    text-align: center;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.service-mini-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #39FF14, #2DE000);
    transform: scaleX(0);
    transition: transform 0.4s;
}

.service-mini-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 40px rgba(57, 255, 20, 0.08);
    border-color: rgba(57, 255, 20, 0.2);
}

.service-mini-card:hover::before {
    transform: scaleX(1);
}

.service-mini-icon {
    font-size: 36px;
    margin-bottom: 16px;
}

.service-mini-card h4 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary, #1d1d1f);
    margin-bottom: 8px;
    letter-spacing: -0.01em;
}

.service-mini-card p {
    font-size: 13px;
    color: var(--text-secondary, #6e6e73);
    line-height: 1.5;
}

@media (max-width: 768px) {
    .services-mini-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .services-mini-grid {
        grid-template-columns: 1fr;
    }
}