@keyframes bridge-pulse {
    0% { transform: scale(1) translate(0,0); opacity: 0.3; }
    50% { transform: scale(1.15) translate(15px, -10px); opacity: 0.6; }
    100% { transform: scale(1) translate(0,0); opacity: 0.3; }
}

.bridge-glow {
    position: absolute;
    border-radius: 999px;
    filter: blur(52px);
    pointer-events: none;
    z-index: 1;
    animation: bridge-pulse 7s infinite alternate ease-in-out;
    will-change: transform, opacity;
}
.bridge-glow-1 {
    width: 320px;
    height: 320px;
    top: -120px;
    right: -60px;
    background: rgba(73, 177, 239, 0.45);
}
.bridge-glow-2 {
    width: 280px;
    height: 280px;
    left: -80px;
    bottom: -90px;
    background: rgba(73, 177, 239, 0.4);
    animation-delay: -3.5s;
}

.ai-demo-container {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-body);
    overflow: hidden;
    z-index: 2;
}

.ai-demo-prompt-scene {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: transparent;
    z-index: 2;
    /* El filter usa una curva que lo mantiene en su lugar y luego cae bruscamente a 0 al final */
    transition: opacity 1s ease-out, filter 1s cubic-bezier(0.8, 0, 1, 1);
}

.ai-demo-prompt-scene.fade-out {
    opacity: 0;
    filter: blur(24px);
    pointer-events: none;
}

.ai-demo-prompt-scene.initial-blur {
    filter: blur(24px);
}

.bridge-rect-inner {
    container-type: inline-size;
}

.ai-demo-input {
    width: 100%;
    max-width: 520px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 34px;
    padding: clamp(12px, 4cqw, 19px) clamp(16px, 5cqw, 30px);
    display: flex;
    align-items: center;
    justify-content: flex-start; /* Alineación normal a la izquierda */
    box-shadow: 0 8px 24px rgba(0,0,0,0.06);
    color: #111827;
    font-size: clamp(11px, 3.2cqw, 17px);
    font-weight: 500;
    line-height: 1.3;
    transition: transform 1.8s cubic-bezier(0.33, 1, 0.68, 1), box-shadow 1.8s ease;
}

.ai-demo-input.emphasize {
    /* Keep the typing emphasis inside the card at every showcase size. */
    transform: scale(1.04);
    box-shadow: 0 12px 32px rgba(0,0,0,0.1);
}

.ai-demo-text {
    flex-grow: 1;
    text-align: left; /* El texto se escribe de izquierda a derecha natural */
    min-width: 0;
    white-space: normal;
    overflow-wrap: anywhere;
    text-wrap: balance;
    position: relative;
    min-height: 1.2em;
}

.ai-demo-cursor {
    display: inline-block;
    width: 2px;
    height: 1.2em;
    background: #8b5cf6;
    margin-left: 2px;
    vertical-align: text-bottom;
    animation: ai-demo-blink 1s step-start infinite;
}

@keyframes ai-demo-blink {
    50% { opacity: 0; }
}

.ai-demo-result-scene {
    position: absolute;
    inset: 0;
    background: transparent;
    z-index: 1;
    overflow: hidden;
    opacity: 0;
    filter: blur(20px);
    transform: scale(1.05);
    transition: opacity 1.2s cubic-bezier(0.22, 1, 0.36, 1), filter 1.2s cubic-bezier(0.22, 1, 0.36, 1), transform 1.2s cubic-bezier(0.22, 1, 0.36, 1);
}

.ai-demo-result-scene.show {
    opacity: 1;
    filter: blur(0);
    transform: scale(1);
}

.ai-demo-flyer {
    width: 100%;
    height: auto;
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    will-change: transform;
}

@media (max-width: 500px) {
    .ai-demo-input {
        max-width: 100%;
        font-size: clamp(11px, 3.2cqw, 13px);
        padding: 11px 16px;
    }
    .ai-demo-icon {
        width: 16px;
        height: 16px;
    }
}
