/* =============================================================================
   Hero Home Liquid — Animated Shader Edition
   Prefijo: .hl-hero-      Ancla: #hl-hero
   Fondo: WebGL canvas GLSL (nebulosa azul eléctrica sobre negro naval)
   Fallback: orbes CSS (misma paleta, visibles solo sin WebGL2)
   ============================================================================= */

/* ── Variables locales ────────────────────────────────────────────────────── */
#hl-hero {
    --hl-blue:       #002FD9;
    --hl-electric:   #1A4FFF;
    --hl-celeste:    #38BEFF;
    --hl-sky:        #DCEAF8;    /* horizonte celeste claro */
    --hl-snow:       #F5F9FF;    /* casi-blanco azulado */
    --hl-black:      #0A1A2E;    /* navy profundo para texto */
    --hl-gray:       #4A5A78;    /* gris azulado para subtítulos */
    --hl-white:      #FFFFFF;
    --hl-glass:      rgba(255, 255, 255, 0.55);
    --hl-glass-bd:   rgba(255, 255, 255, 0.70);
    --hl-font:       -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', sans-serif;
    --hl-transition: 0.30s cubic-bezier(0.4, 0, 0.2, 1);
    --hl-min-height: 100svh;
}

/* =============================================================================
   SECCIÓN HERO — BASE
   ============================================================================= */
#hl-hero {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: var(--hl-min-height);
    width: 100%;
    overflow: hidden;
    background-color: var(--hl-sky);   /* fallback celeste mientras carga el shader */
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    box-shadow: none !important;
}

/* =============================================================================
   CANVAS WEBGL — ocupa toda la sección de fondo
   ============================================================================= */
#hl-hero .hl-hero__canvas {
    position: absolute;
    inset: 0;
    width: 100% !important;
    height: 100% !important;
    display: block;
    z-index: 0;
    touch-action: none;
    pointer-events: auto;   /* recibe pointerdown/move para interactividad del shader */
    background: var(--hl-sky); /* fallback mientras compila el shader */
}

/* =============================================================================
   ORBES CSS — fallback (el JS los oculta si WebGL2 está disponible)
   ============================================================================= */
#hl-hero .hl-hero__orbs-stage {
    position: absolute;
    inset: -20%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

#hl-hero .hl-hero__orb {
    position: absolute;
    border-radius: 50%;
    will-change: transform, opacity;
}

#hl-hero .hl-hero__orb--1 {
    width: 70vmax; height: 70vmax;
    top: -15%; left: -20%;
    background: radial-gradient(circle at 40% 40%, rgba(0,47,217,.60), rgba(0,47,217,0) 70%);
    filter: blur(90px);
    animation: hl-orb-drift-1 22s ease-in-out infinite alternate;
}
#hl-hero .hl-hero__orb--2 {
    width: 55vmax; height: 55vmax;
    top: -10%; right: -15%;
    background: radial-gradient(circle at 60% 50%, rgba(56,190,255,.50), rgba(56,190,255,0) 65%);
    filter: blur(100px);
    animation: hl-orb-drift-2 28s ease-in-out infinite alternate;
}
#hl-hero .hl-hero__orb--3 {
    width: 60vmax; height: 60vmax;
    bottom: -20%; left: 50%;
    transform: translateX(-50%);
    background: radial-gradient(circle at 50% 60%, rgba(0,71,171,.45), rgba(0,71,171,0) 68%);
    filter: blur(110px);
    animation: hl-orb-drift-3 32s ease-in-out infinite alternate;
}
#hl-hero .hl-hero__orb--4 {
    width: 35vmax; height: 35vmax;
    top: 35%; left: -5%;
    background: radial-gradient(circle at 45% 45%, rgba(26,79,255,.38), rgba(26,79,255,0) 60%);
    filter: blur(80px);
    animation: hl-orb-drift-4 18s ease-in-out infinite alternate;
}
#hl-hero .hl-hero__orb--5 {
    width: 28vmax; height: 28vmax;
    top: 40%; right: -5%;
    background: radial-gradient(circle at 55% 55%, rgba(56,190,255,.32), rgba(56,190,255,0) 55%);
    filter: blur(70px);
    animation: hl-orb-drift-5 24s ease-in-out infinite alternate;
}

@keyframes hl-orb-drift-1 {
    0%   { transform: translate(0%,   0%)   scale(1.00); opacity: .60; }
    50%  { transform: translate(6%,   10%)  scale(.97);  opacity: .50; }
    100% { transform: translate(10%,  -4%)  scale(1.06); opacity: .58; }
}
@keyframes hl-orb-drift-2 {
    0%   { transform: translate(0%,   0%)  scale(1.00); opacity: .50; }
    50%  { transform: translate(-8%,  8%)  scale(1.06); opacity: .40; }
    100% { transform: translate(-12%, 5%)  scale(1.04); opacity: .48; }
}
@keyframes hl-orb-drift-3 {
    0%   { transform: translateX(-50%) translateY(0%)    scale(1.00); opacity: .42; }
    50%  { transform: translateX(-44%) translateY(-8%)   scale(1.06); opacity: .52; }
    100% { transform: translateX(-48%) translateY(-10%)  scale(1.08); opacity: .44; }
}
@keyframes hl-orb-drift-4 {
    0%   { transform: translate(0%,  0%)   scale(1.00); opacity: .36; }
    50%  { transform: translate(12%, -10%) scale(1.10); opacity: .46; }
    100% { transform: translate(6%,  8%)   scale(.94);  opacity: .30; }
}
@keyframes hl-orb-drift-5 {
    0%   { transform: translate(0%,  0%)  scale(1.00); opacity: .30; }
    50%  { transform: translate(-8%, 6%)  scale(1.07); opacity: .40; }
    100% { transform: translate(-4%,-8%)  scale(.96);  opacity: .28; }
}

/* =============================================================================
   GRANO (textura de film grain)
   ============================================================================= */
#hl-hero .hl-hero__grain {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 2;
    opacity: 0.018;
    mix-blend-mode: multiply;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    background-size: 200px 200px;
}

/* =============================================================================
   CONTENIDO CENTRAL — sobre el canvas (z-index: 10)
   ============================================================================= */
#hl-hero .hl-hero__content {
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    max-width: 880px;
    width: 100%;
    padding: 8rem 2rem 6rem;
    gap: 0;
}

/* ── Trust Badge ──────────────────────────────────────────────────────────── */
#hl-hero .hl-hero__trust-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.4rem;
    padding: 0.4rem 1rem;
    background: var(--hl-glass);
    border: 1px solid var(--hl-glass-bd);
    border-radius: 50px;
    font-family: var(--hl-font);
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--hl-black);
    letter-spacing: 0.02em;
    backdrop-filter: blur(14px) saturate(140%);
    -webkit-backdrop-filter: blur(14px) saturate(140%);
    box-shadow: 0 4px 16px rgba(0, 47, 217, 0.08);
    animation: hl-fade-up 0.7s ease both;
    animation-delay: 0.05s;
}

#hl-hero .hl-hero__trust-stars {
    color: #F5A623;
    font-size: 0.72rem;
    letter-spacing: 0.04em;
}

/* ── Eyebrow ──────────────────────────────────────────────────────────────── */
#hl-hero .hl-hero__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.6rem;
    padding: 0.4rem 1rem;
    background: rgba(0, 47, 217, 0.08);
    border: 1px solid rgba(0, 47, 217, 0.20);
    border-radius: 50px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    font-family: var(--hl-font);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.10em;
    text-transform: uppercase;
    color: var(--hl-blue);
    animation: hl-fade-up 0.7s ease both;
    animation-delay: 0.15s;
}

#hl-hero .hl-hero__eyebrow-dot {
    display: block;
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--hl-blue);
    animation: hl-pulse-dot 2.5s ease-in-out infinite;
}

@keyframes hl-pulse-dot {
    0%, 100% { opacity: 1;   transform: scale(1);   }
    50%       { opacity: 0.4; transform: scale(.65); }
}

/* ── H1 ───────────────────────────────────────────────────────────────────── */
#hl-hero .hl-hero__headline {
    font-family: var(--hl-font) !important;
    font-size: clamp(3.2rem, 9vw, 7rem) !important;
    font-weight: 800 !important;
    line-height: 1.04 !important;
    letter-spacing: -0.045em !important;
    color: var(--hl-black) !important;
    margin: 0 0 1.75rem !important;
    padding: 0 !important;
    text-shadow: 0 2px 24px rgba(255, 255, 255, 0.45);
    animation: hl-fade-up 0.8s ease both;
    animation-delay: 0.15s;
}

/* <em> — gradiente azul corporativo → celeste */
#hl-hero .hl-hero__headline em {
    font-style: normal !important;
    background: linear-gradient(135deg, var(--hl-blue) 0%, var(--hl-celeste) 100%) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    background-clip: text !important;
}

/* ── Subtítulo ────────────────────────────────────────────────────────────── */
#hl-hero .hl-hero__subheadline {
    font-family: var(--hl-font) !important;
    font-size: clamp(1.15rem, 2.6vw, 1.45rem) !important;
    font-weight: 500 !important;
    line-height: 1.6 !important;
    color: var(--hl-gray) !important;
    max-width: 680px !important;
    margin: 0 auto 2.75rem !important;
    padding: 0 !important;
    text-shadow: 0 1px 12px rgba(255, 255, 255, 0.55);
    animation: hl-fade-up 0.8s ease both;
    animation-delay: 0.28s;
}

/* ── CTA Group ────────────────────────────────────────────────────────────── */
#hl-hero .hl-hero__cta-group {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.85rem;
    margin-bottom: 3.5rem;
    animation: hl-fade-up 0.8s ease both;
    animation-delay: 0.50s;
}

/* ── CTA Primario (WhatsApp) ──────────────────────────────────────────────── */
#hl-hero .hl-hero__cta--primary,
#hl-hero .hl-hero__cta--primary:visited {
    position: relative;
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.55rem !important;
    overflow: hidden;
    padding: 0.9rem 1.9rem !important;
    font-family: var(--hl-font) !important;
    font-size: 0.95rem !important;
    font-weight: 600 !important;
    letter-spacing: 0.01em !important;
    line-height: 1 !important;
    white-space: nowrap !important;
    text-decoration: none !important;
    color: var(--hl-white) !important;
    background: var(--hl-blue) !important;
    border-radius: 50px !important;
    border: none !important;
    box-shadow:
        0 4px 24px rgba(0, 47, 217, 0.50),
        0 0 0 1px rgba(77, 124, 255, 0.30),
        inset 0 1px 0 rgba(255,255,255,0.15) !important;
    cursor: pointer !important;
    transition: transform var(--hl-transition), box-shadow var(--hl-transition) !important;
}

#hl-hero .hl-hero__cta--primary:hover {
    transform: translateY(-2px) !important;
    box-shadow:
        0 10px 40px rgba(0, 47, 217, 0.65),
        0 0 0 6px rgba(0, 47, 217, 0.14),
        inset 0 1px 0 rgba(255,255,255,0.15) !important;
    color: var(--hl-white) !important;
    text-decoration: none !important;
}

#hl-hero .hl-hero__cta--primary:active { transform: translateY(0) !important; }

#hl-hero .hl-hero__cta-glow {
    position: absolute !important; inset: 0 !important;
    border-radius: 50px !important;
    background: radial-gradient(circle at 50% 0%, rgba(255,255,255,.22), transparent 60%) !important;
    pointer-events: none !important;
    opacity: 0 !important;
    transition: opacity .3s ease !important;
}
#hl-hero .hl-hero__cta--primary:hover .hl-hero__cta-glow { opacity: 1 !important; }

#hl-hero .hl-hero__cta-icon {
    flex-shrink: 0 !important;
    transition: transform var(--hl-transition) !important;
}
#hl-hero .hl-hero__cta--primary:hover .hl-hero__cta-icon {
    transform: scale(1.15) !important;
}

/* ── CTA Secundario ───────────────────────────────────────────────────────── */
#hl-hero .hl-hero__cta--secondary,
#hl-hero .hl-hero__cta--secondary:visited {
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.45rem !important;
    padding: 0.9rem 1.6rem !important;
    font-family: var(--hl-font) !important;
    font-size: 0.95rem !important;
    font-weight: 600 !important;
    line-height: 1 !important;
    white-space: nowrap !important;
    text-decoration: none !important;
    color: var(--hl-blue) !important;
    background: var(--hl-glass) !important;
    border: 1.5px solid rgba(0, 47, 217, 0.25) !important;
    border-radius: 50px !important;
    box-shadow: 0 4px 16px rgba(0, 47, 217, 0.08) !important;
    backdrop-filter: blur(10px) saturate(140%) !important;
    -webkit-backdrop-filter: blur(10px) saturate(140%) !important;
    transition: border-color var(--hl-transition), background var(--hl-transition), color var(--hl-transition), transform var(--hl-transition) !important;
}

#hl-hero .hl-hero__cta--secondary:hover {
    background: rgba(255,255,255,.85) !important;
    border-color: var(--hl-blue) !important;
    color: var(--hl-blue) !important;
    transform: translateY(-1px) !important;
    text-decoration: none !important;
}

#hl-hero .hl-hero__cta-arrow {
    transition: transform var(--hl-transition) !important;
}
#hl-hero .hl-hero__cta--secondary:hover .hl-hero__cta-arrow {
    transform: translateX(3px) !important;
}

/* ── Métricas ─────────────────────────────────────────────────────────────── */
#hl-hero .hl-hero__metrics {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2.5rem;
    flex-wrap: wrap;
    padding-top: 1.75rem;
    border-top: 1px solid rgba(0, 47, 217, 0.18);
    width: 100%;
    max-width: 520px;
    margin: 0 auto;
    animation: hl-fade-up 0.8s ease both;
    animation-delay: 0.65s;
}

#hl-hero .hl-hero__metric {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
}

#hl-hero .hl-hero__metric-value {
    font-family: var(--hl-font) !important;
    font-size: 1.5rem !important;
    font-weight: 800 !important;
    letter-spacing: -0.03em !important;
    color: var(--hl-blue) !important;
    line-height: 1 !important;
    text-shadow: 0 1px 8px rgba(255, 255, 255, 0.55);
}

#hl-hero .hl-hero__metric-label {
    font-family: var(--hl-font) !important;
    font-size: 0.75rem !important;
    font-weight: 500 !important;
    color: var(--hl-gray) !important;
    line-height: 1.2 !important;
    text-align: center !important;
}

/* =============================================================================
   FADE BOTTOM — transición suave al Trust Bar azul (#002FD9) siguiente
   ============================================================================= */
#hl-hero .hl-hero__fade-bottom {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 100px;
    background: linear-gradient(to bottom, transparent, var(--hl-snow));
    pointer-events: none;
    z-index: 5;
}

/* =============================================================================
   ANIMACIONES DE ENTRADA
   ============================================================================= */
@keyframes hl-fade-up {
    from { opacity: 0; transform: translateY(22px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* =============================================================================
   INTEGRACIÓN HEADER ↔ HERO (conservada íntegramente)
   ============================================================================= */
.page-template-home-template #vi-header-wrapper {
    display: none !important;
}

.page-template-home-template body,
.page-template-home-template #page,
.page-template-home-template .hfeed {
    padding-top: 0 !important;
    margin-top:  0 !important;
}

.page-template-home-template.ast-header-sticky-disabled body,
.page-template-home-template .ast-above-header-bar {
    padding-top: 0 !important;
    margin-top:  0 !important;
}

.page-template-home-template #hl-hero { margin-top: 0 !important; }

.page-template-home-template #hl-hero .hl-hero__content {
    padding-top: 9rem !important;
}

/* ── Jerarquía de capas ───────────────────────────────────────────────────── */
.page-template-home-template #hl-hero .hl-hero__canvas      { z-index: 0;  }
.page-template-home-template #hl-hero .hl-hero__orbs-stage  { z-index: 0;  }
.page-template-home-template #hl-hero .hl-hero__grain       { z-index: 2;  }
.page-template-home-template #hl-hero .hl-hero__content     { z-index: 10; }
.page-template-home-template #hl-hero .hl-hero__fade-bottom { z-index: 5;  }
.page-template-home-template #vi-header                     { z-index: 9999; }

/* =============================================================================
   RESPONSIVE
   ============================================================================= */
/* ── Tablet ────────────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
    #hl-hero .hl-hero__content { padding: 7rem 2rem 5rem; }

    #hl-hero .hl-hero__headline {
        font-size: clamp(3rem, 8vw, 5rem) !important;
    }
    #hl-hero .hl-hero__subheadline {
        font-size: clamp(1.1rem, 2.2vw, 1.3rem) !important;
        max-width: 560px !important;
    }
}

/* ── Mobile ───────────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
    #hl-hero { --hl-min-height: 100svh; }

    #hl-hero .hl-hero__content {
        padding: 5.5rem 1.25rem 4rem;
        max-width: 100%;
    }

    #hl-hero .hl-hero__headline {
        font-size: clamp(2.5rem, 11vw, 3.6rem) !important;
        line-height: 1.05 !important;
        letter-spacing: -0.035em !important;
        margin-bottom: 1.25rem !important;
    }

    #hl-hero .hl-hero__subheadline {
        font-size: 1.05rem !important;
        line-height: 1.55 !important;
        max-width: 100% !important;
        margin-bottom: 2rem !important;
    }

    #hl-hero .hl-hero__orb--4,
    #hl-hero .hl-hero__orb--5 { display: none; }

    #hl-hero .hl-hero__cta-group {
        flex-direction: column;
        gap: 0.65rem;
        width: 100%;
        margin-bottom: 0;
    }

    #hl-hero .hl-hero__cta--primary,
    #hl-hero .hl-hero__cta--secondary {
        width: 100% !important;
        justify-content: center !important;
        max-width: 360px !important;
        padding: 0.95rem 1.5rem !important;
        font-size: 0.95rem !important;
    }
}

/* ── Mobile pequeño ───────────────────────────────────────────────────────── */
@media (max-width: 380px) {
    #hl-hero .hl-hero__content { padding: 5rem 1rem 3.5rem; }

    #hl-hero .hl-hero__headline {
        font-size: 2.25rem !important;
    }
    #hl-hero .hl-hero__subheadline {
        font-size: 0.98rem !important;
    }
}

/* ── Ajuste del padding-top frente al header island ───────────────────────── */
@media (max-width: 768px) {
    .page-template-home-template #hl-hero .hl-hero__content { padding-top: 7rem !important; }
}

@media (max-width: 480px) {
    .page-template-home-template #hl-hero .hl-hero__content { padding-top: 6rem !important; }
}

/* =============================================================================
   REDUCE MOTION — desactiva animaciones, el canvas ya fue bloqueado en JS
   ============================================================================= */
@media (prefers-reduced-motion: reduce) {
    #hl-hero .hl-hero__orb,
    #hl-hero .hl-hero__eyebrow-dot,
    #hl-hero .hl-hero__trust-badge { animation: none !important; }

    #hl-hero .hl-hero__content > * {
        animation: none !important;
        opacity: 1 !important;
        transform: none !important;
    }
}
