/* ============================================================
   BIOLOTEC — Animaciones CSS
   ============================================================ */

/* ── Keyframes globales ── */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-40px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(40px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.85);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes floatUpDown {

    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-18px);
    }
}

@keyframes floatRotate {
    0% {
        transform: translateY(0px) rotate(0deg);
    }

    50% {
        transform: translateY(-12px) rotate(3deg);
    }

    100% {
        transform: translateY(0px) rotate(0deg);
    }
}

@keyframes shimmer {
    0% {
        background-position: -200% center;
    }

    100% {
        background-position: 200% center;
    }
}

@keyframes pulseGlow {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(45, 106, 79, 0.5);
    }

    50% {
        box-shadow: 0 0 0 14px rgba(45, 106, 79, 0);
    }
}

@keyframes pulseWhatsApp {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.5);
    }

    70% {
        box-shadow: 0 0 0 12px rgba(37, 211, 102, 0);
    }
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

@keyframes orbitDot {
    from {
        transform: rotate(0deg) translateX(60px) rotate(0deg);
    }

    to {
        transform: rotate(360deg) translateX(60px) rotate(-360deg);
    }
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

@keyframes counterUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInNav {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes particleFade {

    0%,
    100% {
        opacity: 0.3;
        transform: scale(0.8);
    }

    50% {
        opacity: 0.9;
        transform: scale(1.2);
    }
}

@keyframes borderDraw {
    from {
        stroke-dashoffset: 1000;
    }

    to {
        stroke-dashoffset: 0;
    }
}

@keyframes blobMorph {

    0%,
    100% {
        border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
    }

    25% {
        border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%;
    }

    50% {
        border-radius: 50% 60% 30% 60% / 30% 40% 70% 60%;
    }

    75% {
        border-radius: 40% 60% 60% 40% / 60% 30% 50% 50%;
    }
}

/* ── Clases de utilidad de animación ── */
.anim-float {
    animation: floatUpDown 4s ease-in-out infinite;
}

.anim-float-slow {
    animation: floatUpDown 6s ease-in-out infinite;
}

.anim-float-rotate {
    animation: floatRotate 5s ease-in-out infinite;
}

.anim-pulse-glow {
    animation: pulseGlow 2.5s infinite;
}

.anim-spin-slow {
    animation: spin 20s linear infinite;
}

.anim-blob {
    animation: blobMorph 8s ease-in-out infinite;
}

/* ── Shimmer en badges/texto dorado ── */
.shimmer-text {
    background: linear-gradient(90deg, var(--color-accent) 25%, #f0d070 50%, var(--color-accent) 75%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmer 3s linear infinite;
}

/* ── Gradient animado en fondos ── */
.gradient-animated {
    background: linear-gradient(270deg, #1B2E4B, #2D6A4F, #1a3d40, #1B2E4B);
    background-size: 400% 400%;
    animation: gradientShift 10s ease infinite;
}

/* ── AOS (Animate On Scroll) — configuración extra ── */
/* Los elementos con data-aos="" se manejan por la librería AOS.js */
/* pero aquí pre-definimos el estado de "oculto" para los que no usan AOS */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

.reveal-left {
    opacity: 0;
    transform: translateX(-30px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal-left.visible {
    opacity: 1;
    transform: translateX(0);
}

.reveal-right {
    opacity: 0;
    transform: translateX(30px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal-right.visible {
    opacity: 1;
    transform: translateX(0);
}

/* ── Delays escalonados ── */
.delay-1 {
    transition-delay: 0.1s;
    animation-delay: 0.1s;
}

.delay-2 {
    transition-delay: 0.2s;
    animation-delay: 0.2s;
}

.delay-3 {
    transition-delay: 0.3s;
    animation-delay: 0.3s;
}

.delay-4 {
    transition-delay: 0.4s;
    animation-delay: 0.4s;
}

.delay-5 {
    transition-delay: 0.5s;
    animation-delay: 0.5s;
}

/* ── Hover en tarjetas ── */
.hover-lift {
    transition: transform var(--transition-medium), box-shadow var(--transition-medium);
}

.hover-lift:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-hover);
}

/* ── Partículas de fondo (solo posición, particles.js las dibuja en canvas) ── */
#particles-js {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
}

/* ── Loading spinner ── */
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-top-color: var(--color-accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* ── Texto con gradiente de marca ── */
.gradient-text {
    background: linear-gradient(135deg, var(--color-secondary), var(--color-accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ── Transición de página ── */
.page-transition {
    animation: fadeInUp 0.6s ease forwards;
}

/* ═══════════════════════════════════════
   HERO — Molecular Background Animations
═══════════════════════════════════════ */

@keyframes moleculeFloat1 {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(30px, -40px) rotate(90deg); }
    50% { transform: translate(-20px, -70px) rotate(180deg); }
    75% { transform: translate(40px, -30px) rotate(270deg); }
}

@keyframes moleculeFloat2 {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(-40px, 30px) rotate(-90deg); }
    50% { transform: translate(30px, 60px) rotate(-180deg); }
    75% { transform: translate(-50px, 20px) rotate(-270deg); }
}

@keyframes moleculeFloat3 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(50px, -30px) scale(1.1); }
    66% { transform: translate(-30px, 40px) scale(0.9); }
}

@keyframes hexPulse {
    0%, 100% { opacity: 0.08; transform: scale(1); }
    50% { opacity: 0.2; transform: scale(1.05); }
}

@keyframes connectionPulse {
    0% { stroke-dashoffset: 200; opacity: 0; }
    50% { opacity: 0.4; }
    100% { stroke-dashoffset: 0; opacity: 0; }
}

@keyframes nodeGlow {
    0%, 100% { box-shadow: 0 0 4px rgba(45, 106, 79, 0.3), 0 0 8px rgba(45, 106, 79, 0.1); }
    50% { box-shadow: 0 0 12px rgba(45, 106, 79, 0.6), 0 0 24px rgba(45, 106, 79, 0.2); }
}

@keyframes titleGlow {
    0%, 100% { text-shadow: 0 0 20px rgba(198, 164, 63, 0), 0 0 40px rgba(198, 164, 63, 0); }
    50% { text-shadow: 0 0 20px rgba(198, 164, 63, 0.15), 0 0 40px rgba(198, 164, 63, 0.08); }
}

@keyframes dnaHelixSpin {
    from { transform: rotateY(0deg); }
    to { transform: rotateY(360deg); }
}

@keyframes waveMove {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* ── Hero Molecular Network — Structure ── */
.hero-molecular-bg {
    position: absolute;
    inset: 0;
    z-index: 1;
    overflow: hidden;
    pointer-events: none;
}

/* Hexagonal grid pattern via SVG background */
.hero-molecular-bg::before {
    content: '';
    position: absolute;
    inset: -50%;
    width: 200%;
    height: 200%;
    background-image:
        radial-gradient(circle at 2px 2px, rgba(45, 106, 79, 0.15) 1px, transparent 1px);
    background-size: 60px 60px;
    animation: moleculeFloat3 30s ease-in-out infinite;
    opacity: 0.6;
}

/* Glowing molecular nodes */
.hero-mol-node {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}

.hero-mol-node--lg {
    width: 6px;
    height: 6px;
    background: rgba(45, 106, 79, 0.5);
    box-shadow: 0 0 12px rgba(45, 106, 79, 0.4), 0 0 24px rgba(45, 106, 79, 0.15);
    animation: nodeGlow 4s ease-in-out infinite;
}

.hero-mol-node--sm {
    width: 3px;
    height: 3px;
    background: rgba(198, 164, 63, 0.4);
    box-shadow: 0 0 6px rgba(198, 164, 63, 0.3);
    animation: nodeGlow 5s ease-in-out infinite;
}

.hero-mol-node--accent {
    width: 4px;
    height: 4px;
    background: rgba(105, 177, 240, 0.4);
    box-shadow: 0 0 8px rgba(105, 177, 240, 0.3);
    animation: nodeGlow 6s ease-in-out infinite;
}

/* Floating molecular structures (hexagons) */
.hero-hex-group {
    position: absolute;
    pointer-events: none;
}

.hero-hex {
    position: absolute;
    width: 120px;
    height: 120px;
    opacity: 0.06;
}

.hero-hex svg {
    width: 100%;
    height: 100%;
}

.hero-hex--1 {
    top: 8%;
    right: 10%;
    animation: moleculeFloat1 25s ease-in-out infinite, hexPulse 8s ease-in-out infinite;
}

.hero-hex--2 {
    bottom: 15%;
    right: 25%;
    width: 80px;
    height: 80px;
    animation: moleculeFloat2 20s ease-in-out infinite, hexPulse 6s ease-in-out infinite 2s;
}

.hero-hex--3 {
    top: 30%;
    right: 5%;
    width: 60px;
    height: 60px;
    animation: moleculeFloat3 22s ease-in-out infinite, hexPulse 7s ease-in-out infinite 1s;
}

.hero-hex--4 {
    bottom: 25%;
    left: 5%;
    width: 90px;
    height: 90px;
    animation: moleculeFloat1 28s ease-in-out infinite reverse, hexPulse 9s ease-in-out infinite 3s;
}

.hero-hex--5 {
    top: 15%;
    left: 15%;
    width: 70px;
    height: 70px;
    animation: moleculeFloat2 24s ease-in-out infinite reverse, hexPulse 8s ease-in-out infinite 4s;
}

/* Molecular connection lines (SVG) */
.hero-connections {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
}

.hero-connections svg {
    width: 100%;
    height: 100%;
}

.hero-connections line {
    stroke: rgba(45, 106, 79, 0.12);
    stroke-width: 1;
    stroke-dasharray: 8, 12;
    animation: connectionPulse 6s linear infinite;
}

.hero-connections line:nth-child(2) { animation-delay: 1s; stroke: rgba(198, 164, 63, 0.08); }
.hero-connections line:nth-child(3) { animation-delay: 2s; }
.hero-connections line:nth-child(4) { animation-delay: 3s; stroke: rgba(105, 177, 240, 0.08); }
.hero-connections line:nth-child(5) { animation-delay: 4s; }

/* DNA Helix Decorative element */
.hero-dna {
    position: absolute;
    right: 6%;
    top: 50%;
    transform: translateY(-50%);
    width: 80px;
    height: 300px;
    opacity: 0.08;
    perspective: 600px;
}

.hero-dna-strand {
    width: 100%;
    height: 100%;
    position: relative;
    animation: dnaHelixSpin 20s linear infinite;
    transform-style: preserve-3d;
}

.hero-dna-pair {
    position: absolute;
    width: 100%;
    height: 3px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.hero-dna-pair::before,
.hero-dna-pair::after {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--color-secondary);
    box-shadow: 0 0 6px var(--color-secondary);
}

.hero-dna-pair::before { background: var(--color-accent); box-shadow: 0 0 6px var(--color-accent); }

.hero-dna-pair span {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, var(--color-accent), transparent 30%, transparent 70%, var(--color-secondary));
}

/* Title glow */
.hero h1 {
    animation: titleGlow 4s ease-in-out infinite;
}

/* Wave separator at bottom of hero */
.hero-wave {
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 80px;
    z-index: 5;
    overflow: hidden;
}

.hero-wave svg {
    width: 100%;
    height: 100%;
    display: block;
}

@media (max-width: 768px) {
    .hero-dna { display: none; }
    .hero-hex--3, .hero-hex--4, .hero-hex--5 { display: none; }
    .hero-wave { height: 40px; }
}