/*
 * ai-hero-light.css
 * AI Solutions page — Light hero centrado + robot section + scroll-triggered dark.
 * Prefix: aihl-
 */

/* ══ GLOBAL TRANSITION SUPPORT ══ */
.aihl-hero,
.aihl-h1,
.aihl-subtitle,
.aihl-badge,
.aihl-robot-section,
.problema-section {
    transition-property: background, background-color, color, border-color, opacity;
    transition-duration: 0.4s; /* Faster, snappier transition */
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ══ ANIMATED GRADIENT KEYFRAMES ══ */
@keyframes aihlGradLight {
    0%   { background-position: 0% 30%; }
    50%  { background-position: 100% 70%; }
    100% { background-position: 0% 30%; }
}

@keyframes aihlGradDark {
    0%   { background-position: 0% 30%; }
    50%  { background-position: 100% 70%; }
    100% { background-position: 0% 30%; }
}

@keyframes aihlBlob1 {
    0%   { transform: translate(0%, 0%) scale(1); }
    33%  { transform: translate(15%, -10%) scale(1.12); }
    66%  { transform: translate(-8%, 14%) scale(0.95); }
    100% { transform: translate(0%, 0%) scale(1); }
}

@keyframes aihlBlob2 {
    0%   { transform: translate(0%, 0%) scale(1); }
    40%  { transform: translate(-12%, 8%) scale(1.08); }
    70%  { transform: translate(10%, -6%) scale(0.94); }
    100% { transform: translate(0%, 0%) scale(1); }
}

@keyframes aihlPulse {
    0%, 100% { transform: scale(1);   opacity: 1; }
    50%       { transform: scale(1.5); opacity: 0.5; }
}

@keyframes aihlScrollLine {
    0%   { transform: scaleY(0); transform-origin: top; }
    50%  { transform: scaleY(1); transform-origin: top; }
    51%  { transform: scaleY(1); transform-origin: bottom; }
    100% { transform: scaleY(0); transform-origin: bottom; }
}

/* ══════════════════════════════════════════════════
   HERO SECTION — Texto centrado, fondo animado
══════════════════════════════════════════════════ */
.aihl-hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start; /* Start from top to leave space for robot */
    overflow: visible; /* Ensure nothing clips */
    text-align: center;
    background: linear-gradient(
        -45deg,
        var(--creo-light) 0%,
        rgba(255, 106, 0, 0.15) 25%,
        #ffffff 50%,
        rgba(255, 106, 0, 0.25) 75%,
        var(--creo-light) 100%
    );
    background-size: 400% 400%;
    animation: aihlGradLight 12s ease infinite;
}

/* Blob 1 — naranja, top-right */
.aihl-blob-1 {
    position: absolute;
    top: -120px;
    right: -80px;
    width: 680px;
    height: 680px;
    border-radius: 50%;
    background: radial-gradient(circle at 40% 40%,
        rgba(255, 106, 0, 0.22) 0%,
        rgba(255, 160, 60, 0.10) 40%,
        transparent 70%
    );
    pointer-events: none;
    z-index: 0;
    animation: aihlBlob1 12s ease-in-out infinite;
}

/* Blob 2 — dorado cálido, bottom-left */
.aihl-blob-2 {
    position: absolute;
    bottom: -100px;
    left: -100px;
    width: 580px;
    height: 580px;
    border-radius: 50%;
    background: radial-gradient(circle at 60% 60%,
        rgba(255, 186, 100, 0.18) 0%,
        rgba(239, 229, 207, 0.5) 40%,
        transparent 70%
    );
    pointer-events: none;
    z-index: 0;
    animation: aihlBlob2 15s ease-in-out infinite;
}

/* Grid overlay */
.aihl-hero::after {
    content: '';
    position: absolute;
    inset: 0;
    /* Grid de líneas en vez de puntos */
    background-image: 
        linear-gradient(rgba(11, 23, 61, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(11, 23, 61, 0.05) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
    z-index: 0;
    opacity: 1;
}

/* ── Centered content container ── */
.aihl-hero-center {
    position: relative;
    z-index: 10; /* Texto siempre al frente */
    max-width: 840px;
    padding: calc(var(--header-h, 80px) + 64px) 32px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    pointer-events: none; /* Dejar que los clics pasen al robot si se solapan */
}

.aihl-hero-center > * {
    pointer-events: auto; /* Reactivar clics en los textos reales */
}

/* Robot en Hero — Ancho Completo sin cortes */
.aihl-hero-robot-full {
    width: 100%;
    height: 85vh; /* Se apodera de la pantalla */
    margin-top: -60px; /* Sube un poco para integrarse mejor */
    position: relative;
    z-index: 1; /* Detrás del texto si es necesario, o delante si es interactivo */
    pointer-events: auto;
    overflow: visible;
}

.aihl-hero-robot-full spline-viewer {
    width: 100%;
    height: 100%;
    display: block;
}

/* Badge / eyebrow */
.aihl-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1.5px solid rgba(11, 23, 61, 0.15);
    border-radius: 100px;
    padding: 7px 20px;
    margin-bottom: 32px;
    background: rgba(255, 255, 255, 0.45);
    backdrop-filter: blur(8px);
    font-size: 10.5px;
    font-weight: 800;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--creo-accent);
}

.aihl-badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--creo-accent);
    animation: aihlPulse 2s ease-in-out infinite;
    flex-shrink: 0;
}

/* H1 */
.aihl-h1 {
    font-family: var(--font-display);
    font-size: clamp(3rem, 6.5vw, 5.2rem);
    font-weight: 900;
    line-height: 1.05;
    letter-spacing: -0.04em;
    color: var(--creo-dark);
    margin-bottom: 24px;
}

.aihl-h1 em {
    font-style: normal;
    color: var(--creo-accent);
}

/* Subtitle */
.aihl-subtitle {
    font-size: clamp(1rem, 2vw, 1.15rem);
    font-weight: 400;
    line-height: 1.75;
    color: rgba(11, 23, 61, 0.55);
    max-width: 540px;
    margin-bottom: 44px;
}

/* CTA row — centrado */
.aihl-cta-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 56px;
}

/* PRIMARY button — siempre naranja */
.aihl-btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: var(--creo-accent);
    color: var(--creo-white);
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    text-decoration: none;
    padding: 15px 32px;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    box-shadow: 0 8px 32px rgba(255, 106, 0, 0.38);
    white-space: nowrap;
}

.aihl-btn-primary:hover {
    transform: translateY(-2px);
    background: #e05a00;
    box-shadow: 0 14px 40px rgba(255, 106, 0, 0.52);
}

/* SECONDARY button — ghost naranja, siempre */
.aihl-btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: transparent;
    color: var(--creo-accent);
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    text-decoration: none;
    padding: 14px 32px;
    border-radius: 10px;
    border: 1.5px solid var(--creo-accent);
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    white-space: nowrap;
}

.aihl-btn-secondary:hover {
    background: rgba(255, 106, 0, 0.10);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(255, 106, 0, 0.18);
}

/* Scroll hint */
.aihl-scroll-hint {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: rgba(11, 23, 61, 0.35);
}

.aihl-scroll-line {
    width: 1px;
    height: 48px;
    background: rgba(11, 23, 61, 0.25);
    transform-origin: top;
    animation: aihlScrollLine 2s ease-in-out infinite;
}

/* ══════════════════════════════════════════════════
   ROBOT SECTION — ELIMINADA (Movemos robot al hero)
══════════════════════════════════════════════════ */

/* ══ DARK MODE TRANSITION ══
   body.creo-darkened fires when #aioEnfoque enters viewport
═══════════════════════════════════════════════════════════ */

/* Hero — fondo dark animado */
body.creo-darkened .aihl-hero {
    background: linear-gradient(
        135deg,
        #060d24 0%,
        #0b173d 22%,
        rgba(255, 106, 0, 0.18) 48%,
        #0d1b40 68%,
        #060d24 100%
    );
    background-size: 280% 280%;
    animation: aihlGradDark 10s ease infinite;
}

/* Blobs en dark */
body.creo-darkened .aihl-blob-1 {
    background: radial-gradient(circle at 40% 40%,
        rgba(255, 106, 0, 0.20) 0%,
        rgba(255, 140, 40, 0.08) 40%,
        transparent 70%
    );
}

body.creo-darkened .aihl-blob-2 {
    background: radial-gradient(circle at 60% 60%,
        rgba(255, 106, 0, 0.12) 0%,
        rgba(11, 23, 61, 0.5) 40%,
        transparent 70%
    );
}

/* Dot grid → puntos blancos */
body.creo-darkened .aihl-hero::after {
    background-image: radial-gradient(circle, rgba(255, 255, 255, 0.06) 1px, transparent 1px);
}

/* Badge */
body.creo-darkened .aihl-badge {
    border-color: rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.06);
}

/* H1: dark → white */
/* ── HERO DARK MODE ── */
body.creo-darkened .aihl-hero {
    background-color: var(--creo-dark) !important;
    background-image: none !important; /* Force removal of the light gradient */
    animation: none !important; /* Stop the light gradient animation */
}

/* Hide light blobs when dark is active */
body.creo-darkened .aihl-blob-1,
body.creo-darkened .aihl-blob-2 {
    opacity: 0;
    visibility: hidden;
}

/* Dim the line grid in dark mode for better contrast */
body.creo-darkened .aihl-hero::after {
    opacity: 0.15;
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.1) 1px, transparent 1px);
}

body.creo-darkened .aihl-h1 {
    color: var(--creo-white);
}

/* Subtitle */
body.creo-darkened .aihl-subtitle {
    color: rgba(239, 229, 207, 0.52);
}

/* Scroll hint */
body.creo-darkened .aihl-scroll-hint {
    color: rgba(239, 229, 207, 0.35);
}

body.creo-darkened .aihl-scroll-line {
    background: rgba(255, 255, 255, 0.2);
}

/* Robot section dark — Eliminada o ajustada si se requiere más adelante */

/* ══ PROBLEMA SECTION TRANSITION ══ */
.problema-section {
    transition: background-color 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

body.creo-darkened .problema-section { background: var(--creo-dark); }
body.creo-darkened .problema-title   { color: var(--creo-white); }
body.creo-darkened .problema-w       { color: rgba(255, 255, 255, 0.1); }
body.creo-darkened .problema-w.lit   { color: var(--creo-white); }
body.creo-darkened .problema-stats-h,
body.creo-darkened .problema-sn      { color: var(--creo-white); }
body.creo-darkened .problema-stats-note  { color: rgba(239, 229, 207, 0.4); }
body.creo-darkened .problema-stats-grid  { border-color: rgba(255, 255, 255, 0.08); }
body.creo-darkened .problema-sc:not(:last-child) { border-right-color: rgba(255, 255, 255, 0.08); }
body.creo-darkened .problema-sc:hover    { background: rgba(255, 255, 255, 0.04); }
body.creo-darkened .problema-stats-head  { border-bottom-color: rgba(255, 255, 255, 0.08); }
body.creo-darkened .problema-sl  { color: rgba(239, 229, 207, 0.85); }
body.creo-darkened .problema-ss  { color: rgba(239, 229, 207, 0.35); }

/* ══ RESPONSIVE ══ */
@media (max-width: 768px) {
    .aihl-hero-center {
        padding: calc(var(--header-h, 80px) + 32px) 24px 60px;
    }

    .aihl-h1 {
        font-size: clamp(2.4rem, 9vw, 3.2rem);
    }

    .aihl-subtitle {
        font-size: 1rem;
    }

    .aihl-btn-primary,
    .aihl-btn-secondary {
        width: 100%;
        justify-content: center;
    }

    .aihl-cta-row {
        flex-direction: column;
        width: 100%;
        max-width: 340px;
    }

    .aihl-robot-container {
        max-width: 100%;
        height: 500px;
        margin: 20px auto;
    }
}

@media (max-width: 480px) {
    .aihl-hero-center {
        padding: calc(var(--header-h, 80px) + 24px) 20px 48px;
    }

    .aihl-robot-container {
        height: 400px;
    }
}

/* ══════════════════════════════════════════════════
   MARQUEE INFINITA — Servicios CREO
══════════════════════════════════════════════════ */
@keyframes aihlMarqueeScroll {
    0%   { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* Franja completa — fondo dark */
.aihl-marquee-strip {
    width: 100%;
    background: var(--creo-dark);
    overflow: hidden;
    position: relative;
    padding: 0;
    /* Fade edges */
    -webkit-mask-image: linear-gradient(
        to right,
        transparent 0%,
        #000 6%,
        #000 94%,
        transparent 100%
    );
    mask-image: linear-gradient(
        to right,
        transparent 0%,
        #000 6%,
        #000 94%,
        transparent 100%
    );
}

/* Track — el elemento que se mueve */
.aihl-marquee-track {
    display: flex;
    align-items: center;
    gap: 0;
    width: max-content;
    animation: aihlMarqueeScroll 28s linear infinite;
    padding: 18px 0;
}

/* Pausa en hover para comodidad */
.aihl-marquee-strip:hover .aihl-marquee-track {
    animation-play-state: paused;
}

/* Ítem — cada servicio */
.aihl-marquee-item {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 28px;
    text-decoration: none;
    color: rgba(239, 229, 207, 0.7);
    font-family: 'Inter', 'Outfit', sans-serif;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    white-space: nowrap;
    border-radius: var(--radius-md, 8px);
    transition: color 0.2s ease, background 0.2s ease;
    position: relative;
}

/* Hover — el ítem no tiene fondo, solo color */
.aihl-marquee-item:hover {
    color: var(--creo-accent-hover, #FF6A00);
    /* Fondo transparente */
    background: transparent;
}

/* Rolling Text Effect */
.aihl-rolling-wrapper {
    display: inline-block;
    overflow: hidden;
    vertical-align: middle;
    height: 1.2em; /* constrain to line-height */
}

.aihl-rolling-content {
    display: flex;
    flex-direction: column;
    transition: transform 0.4s cubic-bezier(0.5, 0, 0, 1);
    position: relative;
    line-height: 1.2em;
}

.aihl-rolling-content::after {
    content: attr(data-text);
    position: absolute;
    top: 100%;
    left: 0;
    color: var(--creo-accent-hover, #FF6A00);
}

.aihl-marquee-item:hover .aihl-rolling-content {
    transform: translateY(-100%);
}

/* Ícono SVG — animación pequeña en hover */
.aihl-marquee-icon {
    display: inline-flex;
    align-items: center;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), stroke 0.3s ease;
}

.aihl-marquee-item:hover .aihl-marquee-icon {
    transform: scale(1.15) rotate(-5deg);
    stroke: var(--creo-accent-hover, #FF6A00);
}

/* Flecha → aparece en hover */
.aihl-marquee-arrow {
    font-size: 14px;
    color: var(--creo-accent-hover, #FF6A00);
    opacity: 0;
    transform: translateX(-6px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.aihl-marquee-item:hover .aihl-marquee-arrow {
    opacity: 1;
    transform: translateX(0);
}

/* Separador ✦ entre ítems */
.aihl-marquee-sep {
    color: rgba(255, 106, 0, 0.4);
    font-size: 10px;
    padding: 0 12px;
    user-select: none;
    flex-shrink: 0;
}

/* Respetar prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
    .aihl-marquee-track {
        animation: none;
        flex-wrap: wrap;
        justify-content: center;
    }
    .aihl-rolling-content {
        transition: none;
    }
}

/* Responsive: strip más compacto en móvil */
@media (max-width: 768px) {
    .aihl-marquee-item {
        font-size: 12px;
        padding: 8px 14px;
        gap: 6px;
    }

    .aihl-marquee-icon svg {
        width: 16px;
        height: 16px;
    }

    .aihl-marquee-track {
        animation-duration: 20s;
    }
}
