/* ═══════════════════════════════════════════════════════
   MIEMPLOYA — Premium Design Enhancements
   Shared animations, modern effects & micro-interactions
   ═══════════════════════════════════════════════════════ */

/* ── Floating Particles ─────────────────────────── */
@keyframes floatUp {
    0%   { transform: translateY(100vh) scale(0); opacity: 0; }
    10%  { opacity: 1; }
    90%  { opacity: 1; }
    100% { transform: translateY(-10vh) scale(1); opacity: 0; }
}
@keyframes floatDrift {
    0%, 100% { transform: translateX(0) translateY(0); }
    25% { transform: translateX(20px) translateY(-10px); }
    50% { transform: translateX(-15px) translateY(-20px); }
    75% { transform: translateX(10px) translateY(-5px); }
}

.page-particles {
    position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 0;
}
.page-particles .particle {
    position: absolute; border-radius: 50%;
    animation: floatUp linear infinite;
}
.page-particles .particle:nth-child(1)  { width: 6px;  height: 6px;  left: 5%;  background: rgba(99,102,241,0.15);  animation-duration: 14s; animation-delay: 0s; }
.page-particles .particle:nth-child(2)  { width: 8px;  height: 8px;  left: 15%; background: rgba(168,85,247,0.12);  animation-duration: 18s; animation-delay: 2s; }
.page-particles .particle:nth-child(3)  { width: 4px;  height: 4px;  left: 25%; background: rgba(59,130,246,0.15);  animation-duration: 12s; animation-delay: 4s; }
.page-particles .particle:nth-child(4)  { width: 10px; height: 10px; left: 40%; background: rgba(16,185,129,0.10);  animation-duration: 20s; animation-delay: 1s; }
.page-particles .particle:nth-child(5)  { width: 5px;  height: 5px;  left: 55%; background: rgba(168,85,247,0.12);  animation-duration: 16s; animation-delay: 3s; }
.page-particles .particle:nth-child(6)  { width: 7px;  height: 7px;  left: 70%; background: rgba(99,102,241,0.15);  animation-duration: 22s; animation-delay: 5s; }
.page-particles .particle:nth-child(7)  { width: 4px;  height: 4px;  left: 85%; background: rgba(236,72,153,0.10);  animation-duration: 15s; animation-delay: 2.5s; }
.page-particles .particle:nth-child(8)  { width: 9px;  height: 9px;  left: 92%; background: rgba(59,130,246,0.12);  animation-duration: 19s; animation-delay: 0.5s; }

/* ── Gradient Text Animation ────────────────────── */
@keyframes gradientShift {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}
.gradient-text-animated {
    background: linear-gradient(270deg, #6366f1, #a855f7, #ec4899, #6366f1);
    background-size: 300% 300%;
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradientShift 6s ease infinite;
}

/* ── 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.5);
    box-shadow: 0 8px 32px rgba(0,0,0,0.06);
    transition: all 0.4s cubic-bezier(0.4,0,0.2,1);
}
.glass-card:hover {
    background: rgba(255,255,255,0.85);
    box-shadow: 0 20px 60px rgba(0,0,0,0.1);
    transform: translateY(-4px);
}

/* ── Card Shine Effect ──────────────────────────── */
.card-shine {
    position: relative; overflow: hidden;
}
.card-shine::after {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(105deg, transparent 40%, rgba(255,255,255,0.2) 45%, rgba(255,255,255,0.35) 50%, rgba(255,255,255,0.2) 55%, transparent 60%);
    background-size: 250% 100%; background-position: 100% 0;
    transition: background-position 0.8s cubic-bezier(0.4,0,0.2,1);
    pointer-events: none; border-radius: inherit;
}
.card-shine:hover::after { background-position: -50% 0; }

/* ── Pulse Ring for CTAs ────────────────────────── */
@keyframes pulseRing {
    0%   { box-shadow: 0 0 0 0 rgba(99,102,241,0.3); }
    70%  { box-shadow: 0 0 0 10px rgba(99,102,241,0); }
    100% { box-shadow: 0 0 0 0 rgba(99,102,241,0); }
}
.pulse-ring { animation: pulseRing 2s ease-in-out infinite; }

/* ── Stagger Reveal ─────────────────────────────── */
@keyframes cascadeIn {
    from { opacity: 0; transform: translateY(40px) scale(0.96); filter: blur(6px); }
    to   { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}
.cascade-in { animation: cascadeIn 0.7s ease forwards; opacity: 0; }
.cascade-1  { animation-delay: 0.05s; }
.cascade-2  { animation-delay: 0.12s; }
.cascade-3  { animation-delay: 0.19s; }
.cascade-4  { animation-delay: 0.26s; }
.cascade-5  { animation-delay: 0.33s; }
.cascade-6  { animation-delay: 0.40s; }
.cascade-7  { animation-delay: 0.47s; }
.cascade-8  { animation-delay: 0.54s; }

/* ── Glow Border on Hover ───────────────────────── */
.glow-border {
    position: relative; overflow: hidden;
    transition: all 0.4s ease;
}
.glow-border::before {
    content: ''; position: absolute; inset: -2px; border-radius: inherit;
    background: conic-gradient(from 0deg, #6366f1, #a855f7, #ec4899, #6366f1);
    opacity: 0; transition: opacity 0.4s ease; z-index: -1;
}
.glow-border:hover::before { opacity: 1; }

/* ── Floating Badge Bounce ──────────────────────── */
@keyframes badgeBounce {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-6px); }
}
.badge-bounce { animation: badgeBounce 2s ease-in-out infinite; }

/* ── Hero Background Blobs ──────────────────────── */
@keyframes blobMove1 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33%      { transform: translate(30px, -50px) scale(1.1); }
    66%      { transform: translate(-20px, 20px) scale(0.9); }
}
@keyframes blobMove2 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33%      { transform: translate(-40px, 30px) scale(0.95); }
    66%      { transform: translate(25px, -40px) scale(1.05); }
}
.hero-blob-1 { animation: blobMove1 20s ease-in-out infinite; }
.hero-blob-2 { animation: blobMove2 25s ease-in-out infinite; }

/* ── Typewriter Cursor ──────────────────────────── */
@keyframes blinkCursor {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0; }
}
.typing-cursor::after {
    content: '|'; animation: blinkCursor 1s step-end infinite;
    color: #6366f1; font-weight: 300;
}

/* ── Counter Stat ───────────────────────────────── */
.stat-card {
    text-align: center; padding: 1.5rem;
    transition: all 0.3s ease;
}
.stat-card:hover { transform: scale(1.05); }
.stat-number {
    font-size: 2.5rem; font-weight: 900; line-height: 1;
    background: linear-gradient(135deg, #6366f1, #a855f7);
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ── Smooth Page Section Transitions ────────────── */
section { position: relative; }
section + section { border-top: none; }

/* ── Enhanced Reveal Animation ──────────────────── */
.reveal {
    opacity: 0; transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}
.reveal.revealed {
    opacity: 1; transform: translateY(0);
}

/* ── Interactive Link Arrow ─────────────────────── */
.link-arrow {
    display: inline-flex; align-items: center; gap: 0.5rem;
    font-weight: 700; transition: all 0.3s ease;
}
.link-arrow i, .link-arrow svg {
    transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
}
.link-arrow:hover i, .link-arrow:hover svg {
    transform: translateX(4px);
}

/* ── Hover Scale for Buttons ────────────────────── */
.btn-hover {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.btn-hover:hover {
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}
.btn-hover:active {
    transform: translateY(0) scale(0.98);
}

/* ── Accordion Smooth ───────────────────────────── */
.accordion-chevron {
    transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
}
.accordion-open .accordion-chevron {
    transform: rotate(180deg);
}

/* ═══════════════════════════════════════════════════════
   MOBILE RESPONSIVE — Compact & Touch-Friendly
   ═══════════════════════════════════════════════════════ */

/* ── Small Screens (max 640px) ─────────────────────── */
@media (max-width: 640px) {
    /* Reduce section padding */
    section { padding-top: 3rem !important; padding-bottom: 3rem !important; }
    section .py-20 { padding-top: 3rem !important; padding-bottom: 3rem !important; }

    /* Hero heading — smaller on mobile */
    h1 { font-size: 1.75rem !important; line-height: 1.2 !important; }
    h2 { font-size: 1.5rem !important; }
    h1 .gradient-text, h1 .gradient-text-animated { display: inline; }

    /* Reduce container side padding */
    .max-w-7xl { padding-left: 1rem !important; padding-right: 1rem !important; }

    /* Stats grid — 3 cols to 3 smaller */
    .grid-cols-3 { gap: 0.75rem !important; }
    .grid-cols-3 .text-3xl { font-size: 1.5rem !important; }
    .grid-cols-3 .text-xs { font-size: 0.625rem !important; }

    /* Product flip-card — shorter on mobile */
    .group.perspective { min-height: 360px !important; }

    /* Floating decorations — hide on mobile */
    .float-animate { display: none !important; }
    .hero-blob-1, .hero-blob-2 { display: none !important; }

    /* Page particles — reduce count visibility */
    .page-particles .particle:nth-child(n+5) { display: none; }

    /* Glass card hover — no transform on touch */
    .glass-card:hover { transform: none; }
    .card-shine::after { display: none; }

    /* Buttons — full width on mobile */
    .flex-wrap.gap-4 a { width: 100%; justify-content: center; }

    /* Slideshow arrows — smaller on mobile */
    .slideshow-arrow, [class*="absolute"][class*="top-1/2"] button {
        width: 2.5rem !important; height: 2.5rem !important;
    }

    /* Service cards — stack properly */
    .svc-page-card { padding: 1.25rem !important; }

    /* Stat number size */
    .stat-number { font-size: 1.75rem !important; }
    .stat-card { padding: 1rem !important; }

    /* Badge bounce — smaller on mobile */
    .badge-bounce { font-size: 0.7rem !important; }
}

/* ── Medium Screens (641px – 768px) ────────────────── */
@media (min-width: 641px) and (max-width: 768px) {
    section { padding-top: 4rem !important; padding-bottom: 4rem !important; }
    h1 { font-size: 2.25rem !important; }
    .float-animate { opacity: 0.5; }
    .hero-blob-1, .hero-blob-2 { opacity: 0.15; }
}

/* ── Touch Devices — Disable hover-only effects ────── */
@media (hover: none) {
    .glass-card:hover { transform: none !important; }
    .card-shine::after { display: none !important; }
    .btn-hover:hover { transform: none !important; }
    .glow-border::before { display: none !important; }
}

/* ── Reduced Motion Preference ─────────────────────── */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    .page-particles, .hero-blob-1, .hero-blob-2, .float-animate {
        display: none !important;
    }
}
