/* ===== TXP MORPH MEJORADO - SIN TEMBLOR ===== */
.txp-morph svg {
    position: absolute;
    width: 0;
    height: 0;
}

.txp-morph {
    position: relative;
    padding: 4rem 1.5rem;
    text-align: center;
    background: rgb(255, 255, 255);
    font-family: 'Poppins', sans-serif;
    overflow: hidden;
    width: 100%;
    box-sizing: border-box;

    /* Previene cualquier desbordamiento durante la animación */
}

.txp-morph-container {
    position: relative;
    font-size: clamp(3rem, 15vw, 10rem);
    font-weight: 700;
    filter: url(#txp-threshold);
    user-select: none;
    line-height: 1.0;
    color: rgb(0, 0, 0);
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
}

.txp-word-rotator {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    --words: 5;
    width: 100%;
    max-width: 100%;
    height: 1em;
    margin: 0 auto;
    overflow: visible;
}

.txp-word {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    white-space: nowrap;
    animation: txp-rotate-smooth calc(var(--words) * 3s) infinite ease-in-out;
    animation-fill-mode: both;
    text-wrap: balance;

    /* Optimizaciones para animaciones suaves */
    will-change: opacity, filter, transform;
    backface-visibility: hidden;
    -webkit-font-smoothing: antialiased;
}

.txp-word:nth-child(1) {
    animation-delay: 0s;
}

.txp-word:nth-child(2) {
    animation-delay: -3s;
}

.txp-word:nth-child(3) {
    animation-delay: -6s;
}

.txp-word:nth-child(4) {
    animation-delay: -9s;
}

.txp-word:nth-child(5) {
    animation-delay: -12s;
}

/* Keyframe optimizado - SIN TEMBLOR */
@keyframes txp-rotate-smooth {
    0% {
        opacity: 0;
        filter: blur(10px);
        transform: translate(-50%, -50%) scale(0.9);
    }

    4% {
        opacity: 1;
        filter: blur(0);
        transform: translate(-50%, -50%) scale(1);
    }

    20% {
        opacity: 1;
        filter: blur(0);
        transform: translate(-50%, -50%) scale(1);
    }

    24% {
        opacity: 0;
        filter: blur(10px);
        transform: translate(-50%, -50%) scale(1.1);
    }

    100% {
        opacity: 0;
        filter: blur(10px);
        transform: translate(-50%, -50%) scale(1.1);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .txp-morph-container {
        font-size: clamp(2.8rem, 16vw, 6rem);

        /* mantienes tu tamaño original */
    }

    .txp-word-rotator {
        height: 2.6em;

        /* espacio para dos líneas (1.3em × 2) */
        width: 100%;
        min-width: unset;

        /* ← cancela el min-width: max-content */
    }

    .txp-word {
        white-space: normal;

        /* ← permite salto de línea */
        text-align: center;
        line-height: 1.3em;
        padding: 0 1rem;
        width: 100%;
    }
}

/* ===== FIX MOBILE ===== */
@media (max-width: 768px) {
    .txp-morph-container {
        font-size: clamp(2.8rem, 16vw, 6rem);
    }

    .txp-word {
        white-space: normal;
        padding: 0 1rem;
        width: 100%;
        text-align: center;
        line-height: 70.0px;
    }

    .txp-word-ai {
        font-size: 0.78em;
    }
}

/* ===== FIX IPAD VERTICAL ===== */
@media (min-width: 769px) and (max-width: 1024px) and (orientation: portrait) {
    .txp-morph-container {
        font-size: clamp(5.5rem, 12vw, 8.5rem);
    }

    .txp-word {
        width: 100%;
        text-align: center;
        padding: 0 1rem;
        line-height: 70.0px;
    }

    .txp-word-ai {
        font-size: 0.82em;
    }
}

/* ===== IPAD HORIZONTAL ===== */
@media (min-width: 769px) and (max-width: 1366px) and (orientation: landscape) {
    .txp-morph-container {
        font-size: clamp(6.5rem, 9vw, 10rem);
    }

    .txp-word {
        width: 100%;
        text-align: center;
        padding: 0 1rem;
        line-height: 70.0px;
    }

    .txp-word-ai {
        font-size: 0.9em;
    }
}


/* ===== IPAD VERTICAL  ===== */
@media (min-width: 769px) and (max-width: 1024px) and (orientation: portrait) {
    .txp-word {
        padding: 0.5rem 2rem;
        line-height: 1.4em;
        min-height: 2.8em;
    }
    
    .txp-word-ai {
        font-size: 0.78em;
        padding: 0.5rem 2.5rem;
    }
}


