/* =========================================================
   AXD Interactive – efectos visuales y sección de IA
   ========================================================= */

:root {
    --axd-accent-1: #7cf7ff;
    --axd-accent-2: #3d8bff;
    --axd-accent-gradient: linear-gradient(90deg, var(--axd-accent-1), var(--axd-accent-2), var(--axd-accent-1));
    --axd-glass: rgba(255, 255, 255, 0.04);
    --axd-glass-border: rgba(255, 255, 255, 0.12);
}

/* ---------- Barra de progreso de scroll ---------- */
.axdScrollProgress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    width: 100%;
    transform-origin: 0 50%;
    transform: scaleX(0);
    background: var(--axd-accent-gradient);
    background-size: 200% 100%;
    z-index: 2000;
    pointer-events: none;
    box-shadow: 0 0 12px rgba(124, 247, 255, 0.6);
}

/* ---------- Luz que sigue al cursor ---------- */
.axdCursorGlow {
    position: fixed;
    top: 0;
    left: 0;
    width: 480px;
    height: 480px;
    margin: -240px 0 0 -240px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(124, 247, 255, 0.10) 0%, rgba(61, 139, 255, 0.06) 35%, transparent 70%);
    pointer-events: none;
    z-index: 1;
    opacity: 0;
    transition: opacity 0.4s ease;
    will-change: transform;
}
.axdCursorGlow.isVisible { opacity: 1; }

/* ---------- Títulos con brillo animado ---------- */
.sectionTitle {
    background: linear-gradient(90deg, #ffffff 0%, #ffffff 40%, var(--axd-accent-1) 50%, #ffffff 60%, #ffffff 100%);
    background-size: 250% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: axdShine 6s linear infinite;
}

@keyframes axdShine {
    from { background-position: 100% 0; }
    to   { background-position: -150% 0; }
}

/* ---------- Botones con destello ---------- */
.cta-button {
    position: relative;
    overflow: hidden;
    transition: transform 0.25s ease, box-shadow 0.25s ease, background-color 0.3s ease;
}
.cta-button::after {
    content: '';
    position: absolute;
    top: 0;
    left: -120%;
    width: 60%;
    height: 100%;
    background: linear-gradient(120deg, transparent, rgba(255, 255, 255, 0.35), transparent);
    transform: skewX(-20deg);
    animation: axdSweep 3.5s ease-in-out infinite;
}
.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(124, 247, 255, 0.25);
}

@keyframes axdSweep {
    0%, 60% { left: -120%; }
    100%    { left: 160%; }
}

/* ---------- Tarjetas con inclinación 3D y reflejo ---------- */
.axdTilt {
    transform-style: preserve-3d;
    transition: transform 0.35s ease;
    will-change: transform;
}
.axdTilt::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 10px;
    background: radial-gradient(circle at var(--mx, 50%) var(--my, 50%), rgba(255, 255, 255, 0.14), transparent 55%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 2;
}
.axdTilt:hover::before { opacity: 1; }
/* AOS impone su propia duración de transición; al pasar el mouse la acortamos */
.axdTilt.axdTilt.aos-animate:hover { transition-duration: 0.15s; }

/* =========================================================
   Sección: IA y LLMs
   ========================================================= */
.aiSection {
    position: relative;
    overflow: hidden;
    padding: 12vh 0 10vh 0;
    color: #ffffff;
    background-color: #000000;
    background-image: radial-gradient(ellipse at 50% 0%, rgba(61, 139, 255, 0.16), transparent 60%);
}

.aiNetwork {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    opacity: 0.75;
}

.aiInner {
    position: relative;
    z-index: 1;
    padding-right: 70px; /* espacio para el menú vertical */
}

.aiBadge {
    display: inline-block;
    padding: 6px 16px;
    border: 1px solid var(--axd-glass-border);
    border-radius: 999px;
    background: var(--axd-glass);
    font-size: 0.85rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 24px;
    backdrop-filter: blur(6px);
}
.aiBadge::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    margin-right: 10px;
    border-radius: 50%;
    background: var(--axd-accent-1);
    box-shadow: 0 0 10px var(--axd-accent-1);
    animation: axdPulse 1.6s ease-in-out infinite;
    vertical-align: middle;
}

@keyframes axdPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50%      { transform: scale(1.6); opacity: 0.4; }
}

.aiTitle {
    font-family: "Nimbus-Bold", Arial, sans-serif;
    font-size: clamp(2.2rem, 5vw, 4rem);
    line-height: 1.05;
    max-width: 900px;
    margin-bottom: 24px;
}
.aiTitleAccent {
    background: var(--axd-accent-gradient);
    background-size: 200% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: axdGradientMove 5s linear infinite;
}

@keyframes axdGradientMove {
    from { background-position: 0% 0; }
    to   { background-position: 200% 0; }
}

.aiLead {
    font-size: 1.25rem;
    max-width: 760px;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 40px;
}

.aiGrid {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    gap: 32px;
    align-items: start;
}

/* Estadísticas */
.aiStats {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 24px;
}
.aiStat {
    flex: 1 1 160px;
    padding: 20px;
    border: 1px solid var(--axd-glass-border);
    border-radius: 14px;
    background: var(--axd-glass);
    backdrop-filter: blur(6px);
}
.aiStatNumber {
    display: block;
    font-family: "Nimbus-Bold", Arial, sans-serif;
    font-size: 2.8rem;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    background: var(--axd-accent-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.aiStatLabel {
    display: block;
    margin-top: 8px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.95rem;
}

/* Tarjetas de capacidades */
.aiCards {
    display: grid;
    gap: 16px;
}
.aiCard {
    position: relative;
    padding: 22px 22px 22px 64px;
    border: 1px solid var(--axd-glass-border);
    border-radius: 14px;
    background: var(--axd-glass);
    backdrop-filter: blur(6px);
    transition: border-color 0.3s ease, background-color 0.3s ease;
}
.aiCard:hover {
    border-color: rgba(124, 247, 255, 0.45);
    background: rgba(124, 247, 255, 0.05);
}
.aiCardIcon {
    position: absolute;
    left: 20px;
    top: 22px;
    width: 28px;
    height: 28px;
    color: var(--axd-accent-1);
}
.aiCard h3 {
    font-family: "Nimbus-Bold", Arial, sans-serif;
    font-size: 1.2rem;
    margin: 0 0 6px 0;
}
.aiCard p {
    margin: 0;
    color: rgba(255, 255, 255, 0.72);
}

/* Terminal */
.aiTerminal {
    border: 1px solid var(--axd-glass-border);
    border-radius: 14px;
    background: rgba(10, 10, 14, 0.85);
    box-shadow: 0 20px 60px rgba(124, 247, 255, 0.08), 0 0 0 1px rgba(61, 139, 255, 0.08) inset;
    overflow: hidden;
    backdrop-filter: blur(8px);
}
.aiTerminalBar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--axd-glass-border);
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
}
.aiTerminalBar span {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.18);
}
.aiTerminalBar em {
    margin-left: 8px;
    font-style: normal;
}
.aiTerminalBody {
    min-height: 260px;
    padding: 18px 18px 22px 18px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.92rem;
    line-height: 1.7;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    color: rgba(255, 255, 255, 0.85);
}
.aiTerminalBody .tPrompt { color: var(--axd-accent-1); }
.aiTerminalBody .tOk     { color: #86efac; }
.aiTerminalBody .tDim    { color: rgba(255, 255, 255, 0.5); }
.aiCaret {
    display: inline-block;
    width: 8px;
    height: 1.1em;
    margin-left: 2px;
    vertical-align: text-bottom;
    background: var(--axd-accent-1);
    animation: axdBlink 1s steps(1) infinite;
}

@keyframes axdBlink {
    50% { opacity: 0; }
}

.aiSubtitle {
    font-family: "Nimbus-Bold", Arial, sans-serif;
    font-size: clamp(1.4rem, 2.6vw, 2rem);
    margin: 48px 0 20px 0;
}
.aiCardsWide {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}
.aiCard h3 a {
    color: inherit;
    text-decoration: none;
}
.aiCard h3 a:hover { color: var(--axd-accent-1); }
/* Toda la tarjeta abre el enlace de su título */
.aiCard h3 a::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 14px;
}
.aiCtaRow {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 28px;
    margin-top: 40px;
}
.aiCtaRow .cta-button { margin-top: 0; }
.aiMoreLink {
    color: var(--axd-accent-1);
    font-size: 1.05rem;
    text-decoration: none;
}
.aiMoreLink:hover {
    color: #ffffff;
    text-decoration: underline;
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
    .aiGrid { grid-template-columns: 1fr; }
    .aiCardsWide { grid-template-columns: 1fr; }
    .aiInner { padding-right: 16px; padding-left: 16px; }
    .aiSection { padding: 10vh 0 8vh 0; }
    .aiLead { font-size: 1.1rem; }
}

/* ---------- Accesibilidad: movimiento reducido ---------- */
@media (prefers-reduced-motion: reduce) {
    .sectionTitle,
    .aiTitleAccent,
    .aiBadge::before,
    .cta-button::after,
    .aiCaret {
        animation: none;
    }
    .cta-button,
    .cta-button:hover {
        transition: none;
        transform: none;
    }
    .axdCursorGlow,
    .axdTilt::before { display: none; }
}

/* ---------- Tarjetas de servicio: toda la tarjeta abre su página ---------- */
.serviceLink {
    position: absolute;
    inset: 0;
    z-index: 3;
    border-radius: 10px;
}
.serviceLink:focus-visible {
    outline: 2px solid var(--axd-accent-1);
    outline-offset: 2px;
}
