/* =========================================
   CUSTOM CURSOR (MÁS PEQUEÑO Y CLEAN)
========================================= */
#cursor {
    position: fixed;
    width: 6px;
    height: 6px;
    background: var(--accent);
    border-radius: 50%;
    pointer-events: none;
    z-index: 10000;
    transform: translate(-50%, -50%);
    transition: width 0.2s, height 0.2s, background 0.2s;
    mix-blend-mode: screen;
}

#cursor-trail {
    position: fixed;
    width: 24px;   /* Reducido para no saturar */
    height: 24px;
    border: 1px solid var(--accent);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
    transition: width 0.3s, height 0.3s;
    opacity: 0.5;
}

/* Hover States for Cursor (Más pequeño) */
.hovering #cursor {
    width: 0px;
    height: 0px;
}
.hovering #cursor-trail {
    width: 40px;  /* Reducido fuertemente, antes 60 */
    height: 40px;
    background: rgba(0, 224, 255, 0.05); /* Muy sutil */
    border-color: rgba(0, 224, 255, 0.4);
    backdrop-filter: invert(5%); /* Más elegante */
}

@media (pointer: coarse) {
    #cursor, #cursor-trail { display: none; }
    body { cursor: auto; }
    .btn, a, button { cursor: pointer; }
}

/* =========================================
   NOISE TEXTURE OVERLAY (Menos opacidad)
========================================= */
.noise-overlay {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 9998;
    opacity: 0.04;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.7' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}
/* Al aplicar la clase reduced-noise se baja la opacidad */
.reduced-noise {
    opacity: 0.015; /* Súper sutil */
}

/* =========================================
   HERO TITLE TECH REVEAL (Robust Multiline)
========================================= */
.fluid-title {
    display: block;
    animation: tech-reveal-robust 0.8s cubic-bezier(0.25, 1, 0.5, 1) forwards;
    opacity: 0;
    transform: translateY(5px);
    transition: transform 0.4s ease;
    cursor: default;
}

@keyframes tech-reveal-robust {
    0% {
        opacity: 0;
        transform: translateY(10px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.fluid-title:hover {
    transform: scale(1.02);
    text-shadow: 0 5px 25px rgba(0, 224, 255, 0.3);
}

.fluid-title .text-gradient {
    display: inline-block;
    background: linear-gradient(135deg, var(--accent), var(--accent-alt));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), text-shadow 0.5s ease;
}

.fluid-title:hover .text-gradient {
    transform: scale(1.05) rotate(-1deg);
    text-shadow: 0 0 15px rgba(0,224,255,0.4);
}

/* =========================================
   SCROLL REVEAL ANIMATIONS
========================================= */
.js .reveal-up { opacity: 0; transform: translateY(40px); transition: opacity 0.8s ease-out, transform 0.8s ease-out; }
.js .reveal-up.active { opacity: 1; transform: translateY(0); }
.js .reveal-left { opacity: 0; transform: translateX(-40px); transition: opacity 0.8s ease-out, transform 0.8s ease-out; }
.js .reveal-left.active { opacity: 1; transform: translateX(0); }
.js .reveal-right { opacity: 0; transform: translateX(40px); transition: opacity 0.8s ease-out, transform 0.8s ease-out; }
.js .reveal-right.active { opacity: 1; transform: translateX(0); }
.js .reveal-scale { opacity: 0; transform: scale(0.9); transition: opacity 0.8s ease-out, transform 0.8s ease-out; }
.js .reveal-scale.active { opacity: 1; transform: scale(1); }
html[data-motion='reduced'].js .reveal-up,
html[data-motion='reduced'].js .reveal-left,
html[data-motion='reduced'].js .reveal-right,
html[data-motion='reduced'].js .reveal-scale { opacity: 1; transform: none; }

/* =========================================
   HOVER EFFECTS
========================================= */
.hover-float { transition: transform 0.4s ease, box-shadow 0.4s ease; }
.hover-float:hover { transform: translateY(-8px); box-shadow: 0 15px 30px rgba(0,0,0,0.4); }
.hover-glow { transition: all 0.3s ease; }
.hover-glow:hover { border-color: rgba(0, 224, 255, 0.3); box-shadow: 0 0 15px rgba(0, 224, 255, 0.08); background: rgba(255,255,255,0.04); }
.pulse-glow { animation: soft-pulse 3s infinite alternate; }
@keyframes soft-pulse { 0% { box-shadow: 0 0 0px transparent; } 100% { box-shadow: 0 0 20px rgba(0, 224, 255, 0.15); border-color: rgba(0,224,255,0.3);} }

/* =========================================
   SCROLL INDICATOR (MOUSE)
========================================= */
.scroll-indicator { position: absolute; bottom: 40px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 12px; opacity: 0.6; transition: opacity 0.3s; }
.scroll-indicator:hover { opacity: 1; }
.mouse { width: 20px; height: 32px; border: 2px solid var(--text-secondary); border-radius: 12px; position: relative; }
.wheel { width: 2px; height: 6px; background: var(--accent); border-radius: 2px; position: absolute; top: 6px; left: 50%; transform: translateX(-50%); animation: scroll-wheel 1.5s infinite; }
.scroll-text { font-family: var(--font-mono); font-size: 0.65rem; text-transform: uppercase; letter-spacing: 2px; color: var(--text-secondary); }
@keyframes scroll-wheel { 0% { top: 6px; opacity: 1; } 100% { top: 16px; opacity: 0; } }

/* EGG DROP ANIMATION (PACA) */
@keyframes egg-float-up { 0% { transform: translateY(0) scale(1); opacity: 1; } 100% { transform: translateY(-50px) scale(1.5); opacity: 0; } }
.egg-plus-anim { position: absolute; color: var(--accent-alt); font-family: var(--font-display); font-weight: bold; pointer-events: none; animation: egg-float-up 1s forwards ease-out; }

/* Animaciones de tarjetas de servicios */
.service-anim { width: 100%; height: 130px; margin-bottom: 20px; overflow: hidden; border: 1px solid rgba(255,255,255,.06); border-radius: 8px; background: rgba(255,255,255,.02); }
.service-anim .anim-svg { display: block; width: 100%; height: 100%; }
.service-card.is-visible .anim-rect { animation: dash-draw 1.4s ease-out forwards; }
.service-card.is-visible .anim-line-1 { animation: dash-draw .8s ease-out .4s forwards; }
.service-card.is-visible .anim-fill-1 { animation: fade-in .4s ease-out 1s forwards; }
.service-card.is-visible .anim-fill-2 { animation: fade-in .4s ease-out 1.2s forwards; }
.service-card.is-visible .anim-fill-3 { animation: fade-in .4s ease-out 1.4s forwards; }
.service-card.is-visible .anim-fill-4 { animation: fade-in .4s ease-out 1.6s forwards; }
.service-card.is-visible .anim-product-1 { animation: drop-in .6s ease-out .2s forwards; }
.service-card.is-visible .anim-product-2 { animation: drop-in .6s ease-out .5s forwards; }
.service-card.is-visible .anim-product-3 { animation: drop-in .6s ease-out .8s forwards; }
.service-card.is-visible .anim-check, .service-card.is-visible .anim-check-path { animation: pop-in .5s ease-out 1.4s forwards; }
.service-card.is-visible .anim-module-1 { animation: slide-from-left .6s ease-out .2s both; }
.service-card.is-visible .anim-module-2 { animation: slide-from-top .6s ease-out .5s both; }
.service-card.is-visible .anim-module-3 { animation: slide-from-right .6s ease-out .8s both; }
.service-card.is-visible .anim-conn-1 { animation: fade-in .4s ease-out 1.2s forwards; }
.service-card.is-visible .anim-conn-2 { animation: fade-in .4s ease-out 1.4s forwards; }
@keyframes dash-draw { to { stroke-dashoffset: 0; } }
@keyframes fade-in { to { opacity: 1; } }
@keyframes drop-in { from { opacity: 0; transform: translateY(-20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pop-in { from { opacity: 0; transform: scale(.6); } to { opacity: 1; transform: scale(1); } }
@keyframes slide-from-left { from { opacity: 0; transform: translateX(-30px); } to { opacity: 1; transform: translateX(0); } }
@keyframes slide-from-right { from { opacity: 0; transform: translateX(30px); } to { opacity: 1; transform: translateX(0); } }
@keyframes slide-from-top { from { opacity: 0; transform: translateY(-30px); } to { opacity: 1; transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) { .service-anim * { animation: none !important; opacity: 1 !important; transform: none !important; stroke-dashoffset: 0 !important; } }
html[data-motion='reduced'] .service-anim * { animation: none !important; opacity: 1 !important; transform: none !important; stroke-dashoffset: 0 !important; }
