/* =============================================================
   EL ABETO — abeto.css
   Sistema visual v2 · Sprint 1 (Hero cinematográfico)
   ============================================================= */


/* =============================================================
   1. TOKENS — variables globales
   ============================================================= */
:root {
    /* Paleta */
    --abeto-navy:        #1a3a5c;
    --abeto-navy-deep:   #0f2540;
    --abeto-blue:        #2b6cb0;
    --abeto-blue-light:  #4a90d9;
    --abeto-ice:         #e8eef5;

    /* Tipografía */
    --abeto-font-display: 'Montserrat', system-ui, sans-serif;
    --abeto-font-body:    'Open Sans', system-ui, sans-serif;

    /* Motion */
    --abeto-ease:        cubic-bezier(0.22, 1, 0.36, 1);
    --abeto-ease-in:     cubic-bezier(0.5, 0, 0.75, 0);
    --abeto-dur-fast:    200ms;
    --abeto-dur-base:    400ms;
    --abeto-dur-slow:    800ms;

    /* Escala */
    --abeto-space-xs:    0.5rem;
    --abeto-space-sm:    1rem;
    --abeto-space-md:    2rem;
    --abeto-space-lg:    4rem;
    --abeto-space-xl:    8rem;
}


/* =============================================================
   2. TIPOGRAFÍA BASE
   ============================================================= */
.abeto-hero-cinematic,
.abeto-hero-cinematic * {
    font-family: var(--abeto-font-body);
}


/* =============================================================
   3. HERO CINEMATOGRÁFICO — contenedor
   ============================================================= */

/* El banner de Flatsome con clase .abeto-hero-cinematic */
.abeto-hero-cinematic {
    position: relative;
    overflow: hidden;
    min-height: 100vh;
    isolation: isolate;

    /* Fallback visible mientras el cliente no suba video */
    background-color: var(--abeto-navy-deep);
    background-image:
        radial-gradient(ellipse at 25% 30%, rgba(43, 108, 176, 0.55) 0%, transparent 55%),
        radial-gradient(ellipse at 75% 70%, rgba(74, 144, 217, 0.35) 0%, transparent 55%),
        linear-gradient(135deg, var(--abeto-navy-deep) 0%, var(--abeto-navy) 100%);
    background-size: cover;
    background-position: center;
}

/* Capa 1 — Overlay gradiente azul navy con radial lights
   (encima del video / imagen de fondo del banner) */
.abeto-hero-cinematic > .banner-bg-overlay,
.abeto-hero-cinematic::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background:
        radial-gradient(ellipse at 25% 30%, rgba(43, 108, 176, 0.45) 0%, transparent 60%),
        radial-gradient(ellipse at 75% 70%, rgba(74, 144, 217, 0.30) 0%, transparent 60%),
        linear-gradient(180deg, rgba(15, 37, 64, 0.55) 0%, rgba(15, 37, 64, 0.80) 100%);
}

/* Capa 2 — Patrón de chevrones sutil */
.abeto-hero-cinematic::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    background-image: url('svg/chevron-pattern.svg');
    background-size: 80px 80px;
    background-repeat: repeat;
    opacity: 0.08;
    animation: abeto-pattern-drift 60s linear infinite;
}

/* Background layer (usado por el shortcode [abeto_hero]) */
.abeto-hero-cinematic > .abeto-hero-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    pointer-events: none;
}

/* Zoom lento del video / imagen de fondo (capa 0) */
.abeto-hero-cinematic > .abeto-hero-bg,
.abeto-hero-cinematic > .bg,
.abeto-hero-cinematic > video,
.abeto-hero-cinematic .ux-banner-bg-video,
.abeto-hero-cinematic .banner-bg-video {
    animation: abeto-hero-zoom 24s var(--abeto-ease) infinite alternate;
    transform-origin: center center;
}

/* Wrapper interno del shortcode [abeto_hero] */
.abeto-hero-cinematic .abeto-hero-inner {
    position: relative;
    z-index: 4;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    gap: 0;
    min-height: inherit;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 4rem clamp(1.25rem, 5vw, 5rem);
}

/* Aseguramos que el contenido interno de Flatsome queda encima */
.abeto-hero-cinematic .banner-inner,
.abeto-hero-cinematic .banner-layers {
    position: relative;
    z-index: 4;
}


/* =============================================================
   4. HERO — contenido textual (glass card)
   ============================================================= */
.abeto-hero-content {
    position: relative;
    z-index: 5;
    max-width: 780px;
    padding: clamp(1.75rem, 4vw, 3.5rem);
    background: rgba(15, 37, 64, 0.55);
    backdrop-filter: blur(24px) saturate(140%);
    -webkit-backdrop-filter: blur(24px) saturate(140%);
    border: 1px solid rgba(74, 144, 217, 0.22);
    border-radius: 20px;
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.08) inset,
        0 32px 64px rgba(0, 0, 0, 0.35);
    will-change: transform;
    transition: transform var(--abeto-dur-base) var(--abeto-ease);
}

/* Eyebrow con chevron triple */
.abeto-hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.75em;
    margin: 0 0 var(--abeto-space-md);
    font-family: var(--abeto-font-display);
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--abeto-blue-light);
    line-height: 1.4;
}
.abeto-hero-eyebrow::before {
    content: "▲▲▲";
    letter-spacing: -3px;
    font-size: 0.85em;
    color: var(--abeto-blue-light);
}

/* H1 gigante */
.abeto-hero-title {
    margin: 0 0 var(--abeto-space-md);
    font-family: var(--abeto-font-display);
    font-size: clamp(2.25rem, 6.5vw, 5rem);
    font-weight: 800;
    line-height: 1.02;
    letter-spacing: -0.035em;
    color: #fff;
    text-wrap: balance;
}
.abeto-hero-title .emphasis {
    display: inline-block;
    color: var(--abeto-blue-light);
    background: linear-gradient(90deg, var(--abeto-blue-light) 0%, #fff 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Subtitle */
.abeto-hero-subtitle {
    margin: 0 0 var(--abeto-space-lg);
    max-width: 52ch;
    font-family: var(--abeto-font-body);
    font-size: clamp(1rem, 1.4vw, 1.25rem);
    font-weight: 400;
    line-height: 1.55;
    color: rgba(232, 238, 245, 0.85);
}

/* CTAs */
.abeto-hero-ctas {
    display: flex;
    flex-wrap: wrap;
    gap: var(--abeto-space-sm);
    margin: 0;
}

.abeto-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.6em;
    padding: 1.05em 2em;
    font-family: var(--abeto-font-display);
    font-size: 0.875rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    text-decoration: none;
    border-radius: 4px;
    border: 1px solid transparent;
    cursor: pointer;
    transition:
        transform  var(--abeto-dur-fast) var(--abeto-ease),
        background var(--abeto-dur-base) var(--abeto-ease),
        color      var(--abeto-dur-base) var(--abeto-ease),
        border     var(--abeto-dur-base) var(--abeto-ease),
        box-shadow var(--abeto-dur-base) var(--abeto-ease);
    position: relative;
    overflow: hidden;
}
.abeto-cta::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, transparent 40%, rgba(255,255,255,0.25) 50%, transparent 60%);
    transform: translateX(-100%);
    transition: transform 700ms var(--abeto-ease);
    pointer-events: none;
}
.abeto-cta:hover::after { transform: translateX(100%); }

.abeto-cta--primary {
    background: var(--abeto-blue-light);
    color: var(--abeto-navy-deep);
    border-color: var(--abeto-blue-light);
}
.abeto-cta--primary:hover {
    background: #fff;
    color: var(--abeto-navy-deep);
    border-color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 14px 28px rgba(74, 144, 217, 0.35);
}

.abeto-cta--ghost {
    background: transparent;
    color: #fff;
    border-color: rgba(255, 255, 255, 0.35);
}
.abeto-cta--ghost:hover {
    color: var(--abeto-blue-light);
    border-color: var(--abeto-blue-light);
    background: rgba(74, 144, 217, 0.08);
    transform: translateY(-2px);
}

.abeto-cta:focus-visible {
    outline: 3px solid var(--abeto-blue-light);
    outline-offset: 4px;
}


/* =============================================================
   5. HERO — satellite cards (tipo NEFT)
   ============================================================= */
.abeto-satellite-grid {
    position: relative;
    z-index: 5;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: var(--abeto-space-sm);
    margin-top: var(--abeto-space-md);
    max-width: 780px;
}

.abeto-satellite-card {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 1.1rem 1.35rem;
    background: rgba(15, 37, 64, 0.7);
    backdrop-filter: blur(18px) saturate(140%);
    -webkit-backdrop-filter: blur(18px) saturate(140%);
    border: 1px solid rgba(74, 144, 217, 0.18);
    border-radius: 14px;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22);
    transition:
        transform    var(--abeto-dur-base) var(--abeto-ease),
        border-color var(--abeto-dur-base) var(--abeto-ease),
        background   var(--abeto-dur-base) var(--abeto-ease);
    will-change: transform;
}
.abeto-satellite-card:hover {
    transform: translateY(-4px);
    border-color: rgba(74, 144, 217, 0.45);
    background: rgba(15, 37, 64, 0.82);
}
.abeto-satellite-card__label {
    font-family: var(--abeto-font-display);
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--abeto-blue-light);
}
.abeto-satellite-card__value {
    font-family: var(--abeto-font-display);
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.15;
    color: #fff;
}


/* =============================================================
   6. HERO — círculos decorativos (capa 5)
   ============================================================= */
.abeto-hero-circle {
    position: absolute;
    border-radius: 50%;
    border: 1px solid rgba(74, 144, 217, 0.28);
    pointer-events: none;
    z-index: 3;
    will-change: transform;
    transition: transform var(--abeto-dur-base) var(--abeto-ease);
}
.abeto-hero-circle--1 {
    width: 620px;
    height: 620px;
    top: -200px;
    right: -180px;
    border-color: rgba(74, 144, 217, 0.22);
}
.abeto-hero-circle--1::after {
    content: "";
    position: absolute;
    inset: 80px;
    border: 1px solid rgba(74, 144, 217, 0.15);
    border-radius: 50%;
}
.abeto-hero-circle--2 {
    width: 320px;
    height: 320px;
    bottom: -120px;
    left: 8%;
    border-color: rgba(74, 144, 217, 0.18);
}


/* =============================================================
   7. ANIMACIONES DE ENTRADA (reveal on viewport)
   ============================================================= */

/* Estado inicial — oculto hasta que JS añada .abeto-is-visible */
[data-abeto-reveal] {
    opacity: 0;
    transform: translateY(24px);
    transition:
        opacity   var(--abeto-dur-slow) var(--abeto-ease),
        transform var(--abeto-dur-slow) var(--abeto-ease);
}
[data-abeto-reveal].abeto-is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger: cuando el padre revela, hijos directos escalonan */
.abeto-hero-content.abeto-is-visible > * {
    animation: abeto-fade-up var(--abeto-dur-slow) var(--abeto-ease) both;
}
.abeto-hero-content.abeto-is-visible > :nth-child(1) { animation-delay: 0ms; }
.abeto-hero-content.abeto-is-visible > :nth-child(2) { animation-delay: 120ms; }
.abeto-hero-content.abeto-is-visible > :nth-child(3) { animation-delay: 240ms; }
.abeto-hero-content.abeto-is-visible > :nth-child(4) { animation-delay: 360ms; }

/* Título: clip-path reveal de izquierda a derecha (Sección 1 del doc) */
.abeto-hero-title[data-abeto-reveal] {
    opacity: 1;
    transform: none;
    clip-path: inset(0 100% 0 0);
}
.abeto-hero-title[data-abeto-reveal].abeto-is-visible {
    animation: abeto-clip-reveal 900ms var(--abeto-ease) forwards;
}


/* =============================================================
   8. KEYFRAMES
   ============================================================= */
@keyframes abeto-hero-zoom {
    0%   { transform: scale(1); }
    100% { transform: scale(1.1); }
}

@keyframes abeto-pattern-drift {
    0%   { background-position: 0 0; }
    100% { background-position: 80px 80px; }
}

@keyframes abeto-clip-reveal {
    0%   { clip-path: inset(0 100% 0 0); }
    100% { clip-path: inset(0 0 0 0); }
}

@keyframes abeto-fade-up {
    0%   { opacity: 0; transform: translateY(20px); }
    100% { opacity: 1; transform: translateY(0); }
}


/* =============================================================
   9. RESPONSIVE
   ============================================================= */
@media (max-width: 1024px) {
    .abeto-hero-circle--1 {
        width: 420px;
        height: 420px;
        top: -140px;
        right: -120px;
    }
    .abeto-hero-circle--1::after { inset: 60px; }
    .abeto-hero-circle--2 {
        width: 220px;
        height: 220px;
    }
}

@media (max-width: 768px) {
    .abeto-hero-cinematic { min-height: 88vh; }

    .abeto-hero-content {
        padding: 1.75rem 1.5rem;
        border-radius: 16px;
    }
    .abeto-hero-title { font-size: clamp(2rem, 9vw, 3rem); }
    .abeto-hero-subtitle { font-size: 1rem; }

    .abeto-hero-ctas { flex-direction: column; align-items: stretch; }
    .abeto-cta { justify-content: center; }

    .abeto-satellite-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.6rem;
    }
    .abeto-satellite-card { padding: 0.9rem 1rem; }
    .abeto-satellite-card__value { font-size: 1.15rem; }

    .abeto-hero-circle--1,
    .abeto-hero-circle--2 { display: none; }
}

@media (max-width: 420px) {
    .abeto-satellite-grid { grid-template-columns: 1fr; }
}


/* =============================================================
   10. ACCESIBILIDAD — prefers-reduced-motion
   ============================================================= */
@media (prefers-reduced-motion: reduce) {
    .abeto-hero-cinematic::after,
    .abeto-hero-cinematic > .bg,
    .abeto-hero-cinematic > video,
    .abeto-hero-cinematic .ux-banner-bg-video,
    .abeto-hero-cinematic .banner-bg-video,
    .abeto-hero-circle,
    .abeto-satellite-card,
    .abeto-cta,
    .abeto-hero-content,
    .abeto-hero-content.abeto-is-visible > *,
    .abeto-hero-title[data-abeto-reveal].abeto-is-visible {
        animation: none !important;
        transition: none !important;
    }
    [data-abeto-reveal] {
        opacity: 1 !important;
        transform: none !important;
        clip-path: none !important;
    }
}
