/* ══════════════════════════════════════════════════════
   ANIMACIONES — HERO (carga inicial)
══════════════════════════════════════════════════════ */

.sae-anim {
    opacity: 0;
    transform: translateY(24px);
    animation: saeSlideUp 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes saeSlideUp {
    0% {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
        filter: blur(5px);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
    }
}

.sae-anim-delay-1 { animation-delay: 0.1s; }
.sae-anim-delay-2 { animation-delay: 0.25s; }
.sae-anim-delay-3 { animation-delay: 0.42s; }

/* ══════════════════════════════════════════════════════
   ANIMACIONES — SCROLL REVEAL
══════════════════════════════════════════════════════ */

.sae-reveal {
    opacity: 0;
    transform: translateY(40px) scale(0.98);
    filter: blur(3px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.8s cubic-bezier(0.16, 1, 0.3, 1),
                filter 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.sae-reveal.sae-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
}

.sae-stagger-1 { transition-delay: 0s; }
.sae-stagger-2 { transition-delay: 0.12s; }
.sae-stagger-3 { transition-delay: 0.24s; }


@media (prefers-reduced-motion: reduce) {
    .sae-anim,
    .sae-reveal,
    .sae-reveal.sae-visible .sae-bubble,
    .sae-reveal.sae-visible .sae-bubble-user,
    .sae-reveal.sae-visible .sae-typing-user,
    .sae-reveal.sae-visible .sae-bubble-ai,
    .sae-reveal.sae-visible .sae-metrics {
        animation: none !important;
        transition: none !important;
        opacity: 1 !important;
        transform: none !important;
        max-width: 100% !important;
    }
    .sae-reveal.sae-visible .sae-bubble-thinking {
        display: none !important;
    }
}

/* ══════════════════════════════════════════════════════
   TOKENS LOCALES
══════════════════════════════════════════════════════ */
:root {
    --sae-primary:  #6366f1;
    --sae-accent:   #f43f5e;
    --sae-dark:     #0f172a;
    --sae-gray:     #64748b;
    --sae-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* ══════════════════════════════════════════════════════
   UTILIDADES
══════════════════════════════════════════════════════ */

.sae-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(99, 102, 241, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.2);
    color: var(--primary, var(--sae-primary));
    padding: 7px 18px;
    border-radius: 100px;
    font-size: 0.8em;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 28px;
    position: relative;
    z-index: 1;
}

.sae-eyebrow::before {
    content: '';
    width: 7px;
    height: 7px;
    background: var(--primary, var(--sae-primary));
    border-radius: 50%;
    flex-shrink: 0;
    opacity: 0.8;
}

.sae-tag {
    display: inline-block;
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary, var(--sae-primary));
    padding: 6px 16px;
    border-radius: 100px;
    font-size: 0.85em;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-bottom: 16px;
}

.sae-tag-light {
    background: rgba(255, 255, 255, 0.18);
    color: white;
}

.sae-section-title {
    text-align: center;
    font-size: 2.8em;
    font-weight: 800;
    color: var(--dark, var(--sae-dark));
    margin-bottom: 20px;
    line-height: 1.25;
}

.sae-gradient-text {
    background: var(--gradient, var(--sae-gradient));
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: saeGradientSweep 4s linear infinite;
}

@keyframes saeGradientSweep {
    to {
        background-position: 200% center;
    }
}

.sae-section-sub {
    text-align: center;
    font-size: 1.15em;
    color: var(--gray, var(--sae-gray));
    max-width: 640px;
    margin: 0 auto 64px;
    line-height: 1.75;
}

/* Orbes animados */
.sae-orb {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    animation: saeFloat 20s ease-in-out infinite;
}

@keyframes saeFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33%       { transform: translate(40px, -50px) scale(1.04); }
    66%       { transform: translate(-30px, 30px) scale(0.97); }
}

@keyframes saeHeroRectFloat {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    33%       { transform: translate(30px, -30px) rotate(120deg); }
    66%       { transform: translate(-20px, 20px) rotate(240deg); }
}

/* ══════════════════════════════════════════════════════
   HERO
══════════════════════════════════════════════════════ */
.sae-hero {
    position: relative;
    background: linear-gradient(180deg, #fafbff 0%, #ffffff 60%, #f3f4ff 100%);
    padding: 160px 0 110px;
    text-align: center;
    overflow: hidden;
}

.sae-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.03) 0%, transparent 70%);
    animation: saeHeroRectFloat 20s ease-in-out infinite;
}

.sae-hero .container {
    position: relative;
    z-index: 1;
}

.sae-orb-1 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.07) 0%, transparent 70%);
    top: -150px;
    left: -80px;
    animation-duration: 18s;
}

.sae-orb-2 {
    width: 420px;
    height: 420px;
    background: radial-gradient(circle, rgba(244, 63, 94, 0.06) 0%, transparent 70%);
    top: 80px;
    right: -80px;
    animation-duration: 24s;
    animation-direction: reverse;
}

.sae-hero h1 {
    font-size: 4.2em;
    font-weight: 900;
    background: var(--sae-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.3;
    padding-bottom: 0.1em; 
    margin-bottom: 28px;
    letter-spacing: -0.02em;
    position: relative;
    z-index: 1;
    padding-left: 0.1em;
    padding-right: 0.1em;
}

/* Subtítulo principal — justo debajo del h1 */
.sae-hero-sub {
    font-size: 1.3em;
    color: var(--gray, var(--sae-gray));
    max-width: 580px;
    margin: 0 auto 48px;
    line-height: 1.8;
    position: relative;
    z-index: 1;
}





/* Elemento visual interactivo (Prompt bar) */
.sae-hero-visual {
    margin-top: 40px;
    display: flex;
    justify-content: center;
    position: relative;
    z-index: 10;
}

.sae-prompt-bar {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 10px 10px 10px 24px;
    border-radius: 100px;
    box-shadow: 0 20px 40px rgba(99, 102, 241, 0.12), 0 0 0 1px rgba(255, 255, 255, 0.5) inset;
    border: 1px solid rgba(99,102,241,0.15);
    max-width: 620px;
    width: 100%;
    gap: 16px;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.sae-prompt-bar:hover {
    transform: translateY(-4px) scale(1.01);
    box-shadow: 0 25px 50px rgba(99, 102, 241, 0.18), 0 0 0 1px rgba(99,102,241,0.25);
}

.sae-prompt-icon {
    width: 22px;
    height: 22px;
    color: var(--primary, var(--sae-primary));
    flex-shrink: 0;
}

.sae-prompt-text {
    flex: 1;
    text-align: left;
    font-size: 1.05em;
    color: var(--dark, var(--sae-dark));
    font-weight: 500;
    line-height: 1.4;
    word-break: break-word;
}

#typewriter-text {
    display: inline;
}

.sae-cursor {
    display: inline-block;
    color: var(--primary, var(--sae-primary));
    margin-left: 2px;
    animation: blink 1s step-end infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.sae-prompt-btn {
    background: var(--gradient, var(--sae-gradient));
    color: white;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.3);
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.sae-prompt-btn:hover {
    transform: scale(1.1);
}
.sae-prompt-btn svg { width: 20px; stroke-width: 2.5; }

/* ══════════════════════════════════════════════════════
   SECCIÓN COMPARATIVA
══════════════════════════════════════════════════════ */
/* Encabezado de sección */
.sae-section-header {
    text-align: center;
    margin-bottom: 64px;
}

.sae-section-header .sae-tag {
    margin-bottom: 20px;
}

/* Cards de beneficios (Bento Box) */
.sae-bento-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-gap: 24px;
    margin: 64px auto 0;
    max-width: 960px;
    text-align: left;
}

.sae-bento-card {
    background: white;
    border: 1px solid rgba(99, 102, 241, 0.1);
    border-radius: 24px;
    padding: 40px;
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
    display: flex;
    flex-direction: column;
}

.sae-bento-card:hover {
    border-color: rgba(99, 102, 241, 0.3);
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(99, 102, 241, 0.08);
}

.sae-bento-wide {
    grid-column: span 2;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
}

.sae-bento-content {
    flex: 1;
    max-width: 500px;
}

.sae-bento-decor {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: flex-end;
    opacity: 0.6;
}

.sae-decor-bar {
    height: 12px;
    background: var(--gradient, var(--sae-gradient));
    border-radius: 20px;
}

.sae-benefit-icon {
    width: 56px;
    height: 56px;
    background: rgba(99, 102, 241, 0.08);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
    transition: transform 0.4s ease, background 0.4s ease;
}

.sae-bento-card:hover .sae-benefit-icon {
    transform: scale(1.1) rotate(5deg);
    background: rgba(99, 102, 241, 0.12);
}

.sae-benefit-icon svg {
    width: 26px;
    height: 26px;
    stroke: var(--primary, var(--sae-primary));
}

.sae-bento-card h4 {
    font-size: 1.25em;
    font-weight: 800;
    color: var(--dark, var(--sae-dark));
    margin-bottom: 12px;
}

.sae-bento-card p {
    font-size: 1em;
    color: var(--gray, var(--sae-gray));
    line-height: 1.65;
    margin: 0;
}

.sae-compare-section {
    padding: 100px 0 120px;
    background: #f8fafc; /* Gris azulado muy sutil */
    text-align: center;
}

.sae-compare-grid {
    display: grid;
    grid-template-columns: 1fr 64px 1fr;
    gap: 0 40px;
    align-items: stretch;
    margin: 0 auto;
    max-width: 1140px;
    text-align: left;
}

.sae-col-badge {
    display: block;
    text-align: center;
    font-size: 0.78em;
    font-weight: 800;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    padding: 7px 20px;
    border-radius: 100px;
    width: fit-content;
    margin: 0 auto 16px;
}

.sae-badge-bad {
    background: rgba(244, 63, 94, 0.1);
    color: var(--accent, var(--sae-accent));
}

.sae-badge-good {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary, var(--sae-primary));
}

.sae-vs {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 56px;
    position: relative;
    z-index: 2;
}

.sae-vs span {
    width: 40px;
    height: 40px;
    background: var(--dark, var(--sae-dark));
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72em;
    font-weight: 900;
    letter-spacing: 0.06em;
    flex-shrink: 0;
    animation: saeVsFloat 4s ease-in-out infinite;
}

@keyframes saeVsFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.sae-chat-frame {
    background: #1e1e2e;
    border-radius: 16px;
    overflow: hidden;
    box-shadow:
        0 30px 60px rgba(0, 0, 0, 0.18),
        0 0 0 1px rgba(255, 255, 255, 0.06);
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 420px; /* Asegura que el contenedor no se aplaste cuando hay poco texto (ej. vista móvil) */
}

.sae-compare-col {
    display: flex;
    flex-direction: column;
}

.sae-chat-active {
    box-shadow:
        0 30px 60px rgba(0, 0, 0, 0.18),
        0 0 0 1px rgba(99, 102, 241, 0.3);
}

.sae-chat-bar {
    background: #2d2d3f;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 7px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
}

.sae-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}
.sae-dot-red    { background: #ff5f57; }
.sae-dot-yellow { background: #febc2e; }
.sae-dot-green  { background: #28c840; }

.sae-chat-name {
    font-size: 0.82em;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.55);
    margin-left: 4px;
    flex: 1;
}

.sae-connected-pill {
    font-size: 0.7em;
    font-weight: 700;
    background: rgba(99, 102, 241, 0.28);
    color: #a5b4fc;
    padding: 3px 10px;
    border-radius: 100px;
    border: 1px solid rgba(99, 102, 241, 0.4);
    flex-shrink: 0;
}

@keyframes saePulsePill {
    to {
        box-shadow: 0 0 0 8px rgba(99, 102, 241, 0);
    }
}

.sae-chat-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
}

.sae-bubble {
    padding: 12px 16px;
    border-radius: 14px;
    font-size: 0.88em;
    line-height: 1.55;
    opacity: 0;
    transform: scale(0.9) translateY(10px);
}

.sae-reveal.sae-visible .sae-bubble-user {
    animation: saeBubblePop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    animation-delay: 0.3s;
}

.sae-reveal.sae-visible .sae-bubble-ai {
    animation: saeBubblePop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    animation-delay: 4.8s;
}

@keyframes saeBubblePop {
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.sae-bubble p { margin: 0; }

.sae-bubble-user {
    background: var(--primary, var(--sae-primary));
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
    width: fit-content;
    min-width: 24px;
    min-height: 24px;
    max-width: 88%;
}

.sae-bubble-ai {
    background: rgba(255, 255, 255, 0.07);
    color: rgba(255, 255, 255, 0.82);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    width: 100%;
}

/* Animación de usuario escribiendo */
.sae-typing-user {
    display: inline-block;
    overflow: hidden;
    white-space: nowrap;
    border-right: 2px solid transparent;
    max-width: 0;
    vertical-align: bottom;
}

.sae-reveal.sae-visible .sae-typing-user {
    animation: 
        saeUserType 1.5s steps(28, end) forwards,
        saeUserBlink 0.5s step-end 4;
    animation-delay: 0.8s;
}

@keyframes saeUserType {
    from { max-width: 0; }
    to { max-width: 300px; }
}
@keyframes saeUserBlink {
    0%, 100% { border-right-color: transparent; }
    50% { border-right-color: rgba(255, 255, 255, 0.9); }
}

.sae-bubble-thinking {
    background: rgba(255, 255, 255, 0.07);
    border-radius: 14px;
    border-bottom-left-radius: 4px;
    align-self: flex-start;
    display: flex;
    gap: 4px;
    opacity: 0;
    max-height: 0;
    padding: 0;
    border: 0px solid rgba(255, 255, 255, 0.1);
    transform: scale(0.9) translateY(10px);
    width: fit-content;
    overflow: hidden;
    margin-top: -12px;
}

.sae-reveal.sae-visible .sae-bubble-thinking {
    animation: saeThinkingSequence 2.2s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    animation-delay: 2.5s; 
}

@keyframes saeThinkingSequence {
    0% { opacity: 0; transform: scale(0.9) translateY(10px); max-height: 0; padding: 0; border-width: 0; margin-top: -12px; overflow: hidden; }
    5% { opacity: 0; max-height: 100px; padding: 12px 18px; border-width: 1px; margin-top: 0; }
    15% { opacity: 1; transform: scale(1) translateY(0); padding: 12px 18px; max-height: 100px; border-width: 1px; margin-top: 0; }
    85% { opacity: 1; transform: scale(1) translateY(0); padding: 12px 18px; max-height: 100px; border-width: 1px; margin-top: 0; }
    100% { opacity: 0; transform: scale(0.8) translateY(0); padding: 0; max-height: 0; border-width: 0; margin-top: -12px; overflow: hidden; }
}

.sae-bubble-thinking span {
    width: 6px;
    height: 6px;
    background-color: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    animation: saeThinkingDots 1.4s infinite ease-in-out both;
}

.sae-bubble-thinking span:nth-child(1) { animation-delay: -0.32s; }
.sae-bubble-thinking span:nth-child(2) { animation-delay: -0.16s; }
.sae-bubble-thinking span:nth-child(3) { animation-delay: 0s; }

@keyframes saeThinkingDots {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

.sae-bubble-error {
    background: rgba(244, 63, 94, 0.09);
    color: #fca5a5;
    border-color: rgba(244, 63, 94, 0.22);
}

.sae-bubble-success strong {
    color: #a5b4fc;
}

.sae-metrics {
    margin-top: 12px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    padding: 10px 14px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    opacity: 0;
    transform: translateY(10px);
}

.sae-reveal.sae-visible .sae-metrics {
    animation: saeMetricsFade 0.5s ease forwards;
    animation-delay: 5.4s;
}

@keyframes saeMetricsFade {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.sae-metric {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 7px 0;
    font-size: 0.9em;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    transition: background 0.3s ease, padding-left 0.3s ease, padding-right 0.3s ease;
    border-radius: 4px;
}

.sae-metric:hover {
    background: rgba(255, 255, 255, 0.04);
    padding-left: 6px;
    padding-right: 6px;
}

.sae-metric:last-child {
    border-bottom: none;
    padding-bottom: 7px;
}

.sae-metric span {
    color: rgba(255, 255, 255, 0.48);
    font-weight: 500;
}

.sae-metric b {
    color: white;
    font-weight: 700;
}



/* ══════════════════════════════════════════════════════
   CTA FINAL
══════════════════════════════════════════════════════ */
.sae-cta-strip {
    background: var(--gradient, var(--sae-gradient));
    color: white;
    padding: 90px 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.sae-cta-strip h2 {
    font-size: 2.6em;
    font-weight: 800;
    margin-bottom: 20px;
    position: relative;
    z-index: 1;
}

.sae-cta-strip p {
    font-size: 1.15em;
    opacity: 0.9;
    margin-bottom: 40px;
    position: relative;
    z-index: 1;
}

.sae-cta-strip .sae-tag {
    position: relative;
    z-index: 1;
    margin-bottom: 20px;
}

.sae-orb-cta-1 {
    width: 400px;
    height: 400px;
    background: rgba(255, 255, 255, 0.08);
    top: -200px;
    left: -150px;
    animation-duration: 15s;
}

.sae-orb-cta-2 {
    width: 350px;
    height: 350px;
    background: rgba(255, 255, 255, 0.06);
    bottom: -180px;
    right: -100px;
    animation-duration: 22s;
    animation-direction: reverse;
}

.sae-btn-white {
    display: inline-block;
    background: white;
    color: var(--primary, var(--sae-primary));
    padding: 18px 52px;
    border-radius: 100px;
    text-decoration: none;
    font-size: 1.1em;
    font-weight: 700;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    position: relative;
    z-index: 1;
}

.sae-btn-white:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
    color: var(--dark, var(--sae-dark));
}

/* ══════════════════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════════════════ */
@media (max-width: 992px) {
    .sae-hero { padding: 120px 0 80px; }

    .sae-compare-grid {
        grid-template-columns: 1fr;
        gap: 24px 0;
    }

    .sae-bento-grid {
        grid-template-columns: 1fr;
    }

    .sae-bento-wide {
        grid-column: span 1;
        flex-direction: column;
        align-items: flex-start;
    }
    
    .sae-bento-decor {
        align-items: flex-start;
        margin-top: 30px;
        width: 100%;
    }

    .sae-vs {
        padding-top: 0;
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .sae-hero h1 { font-size: 2.2em; }
    .sae-section-title { font-size: 1.9em; }
    .sae-cta-strip h2 { font-size: 1.8em; }
    .sae-orb { display: none; }
    
    .sae-prompt-bar {
        padding: 10px 10px 10px 18px;
        gap: 12px;
        border-radius: 30px;
    }
    .sae-prompt-text {
        font-size: 0.95em;
        line-height: 1.4;
    }
}