/* ─── AUTOMATIZACIÓN SCROLL SECTION ─── */

.auto-section {
    position: relative;
    width: 100%;
    height: 325vh;
    background-color: #000000;
}

.auto-sticky-wrapper {
    position: sticky;
    top: 0;
    height: 100vh;
    width: 100%;
    overflow: hidden;
    z-index: 2;
    background-color: #000000;
    perspective: 1400px;
    perspective-origin: 50% 50%;
}

/* ─── STARS ─── */
#auto-stars {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

/* ─── MARQUEE BACKGROUND ─── */
.auto-marquee-bg {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.5rem;
    pointer-events: none;
    z-index: 2;
    overflow: hidden;
}

.auto-marquee-track {
    display: flex;
    width: max-content;
    white-space: nowrap;
}

.auto-marquee-track-1 {
    animation: marqueeLeft 30s linear infinite;
}

.auto-marquee-track-2 {
    animation: marqueeRight 24s linear infinite;
}

@keyframes marqueeLeft {
    0%   { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

@keyframes marqueeRight {
    0%   { transform: translateX(-50%); }
    100% { transform: translateX(0); }
}

.auto-marquee-text {
    font-family: 'Playfair Display', serif;
    font-size: clamp(4.5rem, 9vw, 10rem);
    font-weight: 700;
    color: rgba(255, 255, 255, 0.03);
    letter-spacing: -0.02em;
    line-height: 1.1;
    user-select: none;
}

.auto-marquee-text.accent {
    color: rgba(134, 85, 246, 0.03);
}

/* ─── PHONE CONTAINER ─── */
.auto-container {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: auto;
    height: auto;
    will-change: transform;
    z-index: 10;
}

.auto-container.recompose {
    transition: transform 1.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.auto-frame {
    width: auto;
    height: auto;
    max-height: 74vh;
    object-fit: contain;
    display: block;
    mix-blend-mode: screen;
    will-change: transform;
    filter: drop-shadow(0 0 40px rgba(134, 85, 246, 0.2));
}

/* ─── LEFT CONTENT ─── */
.auto-content {
    position: absolute;
    left: 6%;
    top: 50%;
    width: 40%;
    max-width: 510px;
    text-align: left;
    opacity: 0;
    transform: translateY(-50%) translateX(-40px);
    transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    pointer-events: none;
    z-index: 20;
}

.auto-content.post-bubbles {
    max-width: 550px;
}

.auto-content.visible {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
    pointer-events: all;
}

.auto-content .content-tag {
    display: inline-block;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.25em;
    color: #8655F6;
    font-weight: 700;
    margin-bottom: 1.5rem;
}

.auto-content h1, .auto-content h2 {
    font-family: 'Playfair Display', serif;
    font-size: clamp(2rem, 5vw, 4rem);
    color: #F8F9FA;
    line-height: 0.95;
    margin-bottom: 1.25rem;
    text-shadow: 0 0 30px rgba(134, 85, 246, 0.3);
}

.auto-content h1 em, .auto-content h2 em {
    font-style: italic;
    color: #C084FC;
}

.auto-content p {
    font-size: clamp(0.9rem, 1.5vw, 1.1rem);
    color: #A1A1AA;
    line-height: 1.8;
    margin-bottom: 2rem;
    font-weight: 300;
}

/* ── Stat metrics row ── */
.auto-stats-row {
    display: flex;
    align-items: baseline;
    gap: 3rem;
    margin-bottom: 2.5rem;
}

.auto-stat {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.auto-stat-number {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: clamp(1.8rem, 3vw, 2.6rem);
    font-weight: 800;
    color: #F8F9FA;
    line-height: 1;
    letter-spacing: -0.02em;
}

.auto-stat-label {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.6rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: #71717A;
}

.auto-content .cta-button {
    display: inline-flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 2.8rem;
    border-radius: 9999px;
    border: 1px solid rgba(134, 85, 246, 0.5);
    background: rgba(134, 85, 246, 0.1);
    color: #F8F9FA;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    text-decoration: none;
    transition: all 0.4s ease;
    cursor: pointer;
}

.auto-content .cta-button:hover {
    background: rgba(134, 85, 246, 0.2);
    border-color: #8655F6;
    box-shadow: 0 0 20px rgba(134, 85, 246, 0.4);
    transform: scale(1.03);
}

/* ─── CHAT BUBBLES ─── */
.auto-bubble {
    position: absolute;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 1.25rem;
    padding: 1rem 1.4rem;
    opacity: 0;
    transform: scale(0.75);
    transition: opacity 0.6s cubic-bezier(0.34, 1.56, 0.64, 1),
                transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: none;
    z-index: 25;
    max-width: 340px;
}

.auto-bubble.visible {
    opacity: 1;
    transform: scale(1);
    pointer-events: all;
}

.auto-bubble-user {
    top: 14%;
    left: 40%;
    background: rgba(18, 16, 26, 0.82);
    border: 1px solid rgba(255, 255, 255, 0.09);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    transform: scale(0.75) rotate(-2deg);
}

.auto-bubble-user.visible {
    transform: scale(1) rotate(-2deg);
}

.auto-bubble-ai {
    bottom: 20%;
    right: 1%;
    background: rgba(28, 22, 48, 0.9);
    border: 1px solid rgba(134, 85, 246, 0.25);
    box-shadow: 0 8px 40px rgba(134, 85, 246, 0.2);
    transform: scale(0.75) rotate(1.5deg);
    min-width: 340px;
    max-width: 460px;
}

.auto-bubble-ai.visible {
    transform: scale(1) rotate(1.5deg);
}

/* ── Timer bar inside AI bubble ── */
.auto-bubble-timer {
    width: 100%;
    height: 3px;
    background: rgba(134, 85, 246, 0.18);
    border-radius: 2px;
    margin: 0.6rem 0 0.75rem;
    overflow: hidden;
}

.auto-bubble-timer-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(to right, #8655F6, #C084FC);
    border-radius: 2px;
}

.auto-bubble-ai.visible .auto-bubble-timer-bar {
    animation: fillTimerBar 10s linear forwards;
}

@keyframes fillTimerBar {
    0%   { width: 0%; }
    100% { width: 100%; }
}

.auto-bubble.fade-out {
    opacity: 0 !important;
    transition: opacity 1.5s ease !important;
}

.auto-bubble-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.auto-bubble-avatar-user {
    background: rgba(255, 255, 255, 0.1);
    color: #A1A1AA;
}

.auto-bubble-avatar-ai {
    background: #8655F6;
    color: #fff;
    box-shadow: 0 0 14px rgba(134, 85, 246, 0.5);
}

.auto-bubble-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.6rem;
}

.auto-bubble-meta {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.auto-bubble-label {
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #8655F6;
}

.auto-bubble-sublabel {
    font-size: 0.55rem;
    color: #A1A1AA;
}

.auto-bubble-body {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.auto-bubble-text {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.8125rem;
    line-height: 1.5;
    color: rgba(248, 249, 250, 0.88);
    margin: 0;
}

.auto-bubble-time {
    font-size: 0.575rem;
    color: #A1A1AA;
}

/* ─── NAVIGATION DOTS ─── */
.auto-nav {
    position: absolute;
    left: 2.5rem;
    top: 50%;
    transform: translateY(-50%);
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 1.4rem;
    opacity: 0;
    transition: opacity 0.8s ease;
    pointer-events: none;
    width: fit-content;
}

.auto-nav.visible {
    opacity: 1;
    pointer-events: all;
}

.auto-nav .nav-item {
    display: flex;
    align-items: center;
    flex-direction: row;
    gap: 0.75rem;
    justify-content: flex-start;
    cursor: pointer;
    transition: all 0.25s ease;
}

.auto-nav .nav-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    transition: all 0.3s ease;
    background: rgba(180, 180, 180, 0.35);
}

.auto-nav .nav-item.active .nav-dot {
    background: #8655F6;
    box-shadow: 0 0 10px rgba(134, 85, 246, 0.7);
    transform: scale(1.25);
}

.auto-nav .nav-label {
    font-size: 0.65rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    font-weight: 700;
    white-space: nowrap;
    color: rgba(255, 255, 255, 1);
    user-select: none;
    opacity: 0;
    max-width: 0;
    overflow: hidden;
    transition: opacity 0.4s ease, max-width 0.5s ease;
    pointer-events: none;
    text-shadow:
        0 0 8px rgba(134, 85, 246, 1),
        0 0 20px rgba(134, 85, 246, 0.8),
        0 0 40px rgba(134, 85, 246, 0.4),
        0 2px 4px rgba(0, 0, 0, 1);
}

.auto-nav .nav-item.active .nav-label {
    color: #E0AAFF;
}

.auto-nav:hover .nav-label {
    opacity: 1;
    max-width: 200px;
}

.auto-nav:hover .nav-item:hover .nav-label {
    color: #ffffff;
}

.auto-nav:hover .nav-item:hover .nav-dot {
    background: #8655F6;
    box-shadow: 0 0 16px rgba(134, 85, 246, 1);
    transform: scale(1.3);
}

/* ─── SCROLL INDICATOR ─── */
.auto-section .scroll-indicator {
    position: absolute;
    bottom: 2.5rem;
    left: 0;
    right: 0;
    width: 100%;
    transform: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
    opacity: 1;
    transition: opacity 0.6s ease;
    pointer-events: none;
    z-index: 30;
}

.auto-section .scroll-indicator .scroll-mouse-icon {
    position: absolute;
    right: 2.5rem;
    top: 0;
}

.auto-section .scroll-indicator.hide-mouse .scroll-mouse-icon {
    opacity: 0;
    height: 0;
    padding: 0;
    margin: 0;
    overflow: hidden;
}

.auto-section .scroll-text {
    font-size: 0.75rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 1);
    font-weight: 700;
    white-space: nowrap;
    text-shadow: 0 0 10px rgba(192, 132, 252, 0.8);
}

.auto-section .scroll-line {
    width: 1px;
    height: 30px;
    background: linear-gradient(to bottom, rgba(192, 132, 252, 0.8), transparent);
    position: relative;
}

.auto-section .scroll-line::after {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 1px;
    height: 40%;
    background: #C084FC;
    animation: autoScrollSlide 1.8s ease-in-out infinite;
}

@keyframes autoScrollSlide {
    0%   { transform: translateY(0);    opacity: 0; }
    30%  { opacity: 1; }
    100% { transform: translateY(200%); opacity: 0; }
}

/* ═══════════════════════════════════════════════════
   TABLET — hasta 1024px
═══════════════════════════════════════════════════ */
@media (max-width: 1024px) {
    .auto-container {
        left: 50%;
        top: 35%;
    }

    .auto-frame {
        max-height: 60vh;
    }

    .auto-content {
        left: 4%;
        width: 52%;
        top: 62%;
        transform: translateY(0) translateX(-40px);
    }

    .auto-content.visible {
        transform: translateY(0) translateX(0);
    }

    .auto-content h1, .auto-content h2 {
        font-size: clamp(1.8rem, 4.5vw, 3rem);
    }

    .auto-bubble-user {
        top: 14%;
        left: 30%;
        right: auto;
        max-width: 260px;
    }

    .auto-bubble-ai {
        bottom: 18%;
        right: 2%;
        min-width: 0;
        max-width: 280px;
    }

    .auto-nav {
        left: 50%;
        top: 1.5rem;
        transform: translateX(-50%);
        flex-direction: row;
        gap: 1.5rem;
        align-items: center;
    }

    .auto-nav .nav-item {
        flex-direction: column;
        gap: 0.4rem;
        align-items: center;
    }

    .auto-nav .nav-label {
        font-size: 0.5rem;
        opacity: 0;
        max-width: none;
        text-shadow: none;
    }

    .auto-nav.visible .nav-label {
        opacity: 1;
        max-width: 100px;
        text-align: center;
    }

    .auto-nav .nav-dot {
        width: 7px;
        height: 7px;
    }
}

/* ═══════════════════════════════════════════════════
   MÓVIL GRANDE — hasta 768px
   Layout: teléfono arriba (~42% de altura), contenido abajo
═══════════════════════════════════════════════════ */
@media (max-width: 768px) {
    .auto-section {
        height: 390vh;
    }

    /* Teléfono posicionado en la mitad superior */
    .auto-container {
        left: 50%;
        top: 27%;
        transform: translate(-50%, -50%);
    }

    .auto-frame {
        max-height: none;
        height: 35vh;
        width: auto;
    }

    /* Contenido posicionado en la mitad inferior, sin solapamiento */
    .auto-content {
        left: 0;
        right: 0;
        /* teléfono: 35vh centrado en 27% → borde inferior ≈ 27vh + 17.5vh = 44.5vh
           contenido arranca desde bottom:9vh para dejar espacio al scroll indicator */
        top: auto;
        bottom: 9vh;
        width: 100%;
        max-width: 100%;
        padding: 0 1.4rem;
        transform: translateX(-20px);
        text-align: center;
    }

    .auto-content.visible {
        transform: translateX(0);
    }

    .auto-content .content-tag {
        font-size: 0.6rem;
        margin-bottom: 0.5rem;
        letter-spacing: 0.2em;
    }

    .auto-content h1, .auto-content h2 {
        font-size: clamp(1.6rem, 6.5vw, 2.4rem);
        margin-bottom: 0.5rem;
        line-height: 1.05;
    }

    .auto-content p {
        font-size: 0.88rem;
        line-height: 1.55;
        margin-bottom: 0.75rem;
        display: -webkit-box;
        -webkit-line-clamp: 3;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .auto-stats-row {
        justify-content: center;
        gap: 2rem;
        margin-bottom: 1rem;
    }

    .auto-stat-number {
        font-size: 1.6rem;
    }

    .auto-stat-label {
        font-size: 0.52rem;
    }

    .auto-content .cta-button {
        padding: 0.8rem 2rem;
        font-size: 0.68rem;
        gap: 0.6rem;
    }

    .auto-content .tags-container {
        justify-content: center;
        gap: 0.5rem;
        margin-bottom: 0.8rem;
    }

    .auto-content .tech-tag {
        padding: 0.4rem 1rem;
        font-size: 0.74rem;
    }

    /* Burbujas ocultas en mobile para no saturar */
    .auto-bubble-user,
    .auto-bubble-ai {
        display: none;
    }

    /* Nav horizontal en la parte superior */
    .auto-nav {
        left: 50%;
        top: 1rem;
        bottom: auto;
        padding-top: 0;
        transform: translateX(-50%);
        flex-direction: row;
        gap: 0;
        align-items: center;
        background: rgba(10, 8, 20, 0.65);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
        border: 1px solid rgba(134, 85, 246, 0.18);
        border-radius: 9999px;
        box-shadow: 0 4px 24px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.05);
        padding: 0.45rem 0.8rem;
        max-width: calc(100% - 2rem);
    }

    .auto-nav .nav-item {
        flex-direction: row;
        gap: 0.35rem;
        align-items: center;
        padding: 0.4rem 0.75rem;
        border-radius: 9999px;
        transition: background 0.25s ease;
    }

    .auto-nav .nav-item:hover,
    .auto-nav .nav-item:active {
        background: rgba(134, 85, 246, 0.14);
    }

    .auto-nav .nav-label {
        font-size: 0.55rem;
        letter-spacing: 0.08em;
        opacity: 1;
        max-width: 80px;
        text-shadow: none;
        color: rgba(255, 255, 255, 0.65);
        pointer-events: auto;
    }

    .auto-nav.visible .nav-label {
        opacity: 1;
        max-width: 80px;
        text-align: center;
    }

    .auto-nav .nav-item.active .nav-label {
        color: #C084FC;
    }

    .auto-nav .nav-dot {
        width: 6px;
        height: 6px;
    }

    /* Scroll indicator */
    .auto-section .scroll-indicator {
        bottom: 1.2rem;
        right: 1.5rem;
        left: auto;
        top: auto;
        width: auto;
        transform: none;
        flex-direction: row;
        gap: 0.5rem;
        align-items: center;
    }

    .auto-section .scroll-indicator .scroll-mouse-icon {
        position: static;
    }

    .auto-section .scroll-text {
        font-size: 0.5rem;
        letter-spacing: 0.1em;
        text-shadow: none;
        color: rgba(255, 255, 255, 0.35);
        font-weight: 500;
    }

    .auto-section .scroll-line { display: none; }

    .auto-marquee-text {
        font-size: clamp(3rem, 12vw, 5rem);
    }
}

/* ═══════════════════════════════════════════════════
   MÓVIL PEQUEÑO — hasta 430px
═══════════════════════════════════════════════════ */
@media (max-width: 430px) {

    .auto-container {
        top: 26%;
    }

    .auto-frame {
        height: 32vh;
    }

    .auto-content {
        bottom: 8vh;
        padding: 0 1rem;
    }

    .auto-content h1, .auto-content h2 {
        font-size: clamp(1.35rem, 6vw, 1.9rem);
    }

    .auto-content p {
        -webkit-line-clamp: 2;
        font-size: 0.8rem;
    }

    .auto-stats-row {
        gap: 1.2rem;
    }

    .auto-stat-number {
        font-size: 1.35rem;
    }

    .auto-content .cta-button {
        padding: 0.7rem 1.6rem;
        font-size: 0.62rem;
    }

    .auto-nav {
        padding: 0.38rem 0.6rem;
    }

    .auto-nav .nav-item {
        padding: 0.38rem 0.55rem;
    }

    .auto-nav .nav-label {
        font-size: 0.48rem;
        max-width: 55px;
    }

    .auto-nav .nav-dot {
        width: 5px;
        height: 5px;
    }

    .auto-section .scroll-indicator {
        bottom: 1rem;
        right: 1rem;
    }
}

/* ═══════════════════════════════════════════════════
   LANDSCAPE MÓVIL — orientación horizontal
═══════════════════════════════════════════════════ */
@media (max-width: 900px) and (orientation: landscape) {
    .auto-container {
        left: 62%;
        top: 50%;
        width: auto;
    }

    .auto-frame {
        height: auto;
        width: auto;
        max-height: 85vh;
        max-width: 30vw;
    }

    .auto-content {
        left: 3%;
        top: 50%;
        bottom: auto;
        width: 40%;
        max-width: none;
        padding: 0 0.8rem;
        transform: translateY(-50%) translateX(-30px);
        text-align: left;
    }

    .auto-content.visible {
        transform: translateY(-50%) translateX(0);
    }

    .auto-content h1, .auto-content h2 {
        font-size: clamp(1.1rem, 3vw, 1.8rem);
        margin-bottom: 0.4rem;
    }

    .auto-content p {
        font-size: 0.72rem;
        margin-bottom: 0.5rem;
    }

    .auto-stats-row {
        gap: 1.5rem;
        margin-bottom: 1rem;
    }

    .auto-stat-number {
        font-size: 1.4rem;
    }

    .auto-stat-label {
        font-size: 0.5rem;
    }

    .auto-content .cta-button {
        padding: 0.5rem 1rem;
        font-size: 0.55rem;
    }

    .auto-bubble-user,
    .auto-bubble-ai {
        display: none;
    }

    .auto-marquee-text {
        font-size: clamp(2rem, 6vw, 3.5rem);
    }

    .auto-nav {
        left: 1.2rem;
        top: 50%;
        bottom: auto;
        transform: translateY(-50%);
        flex-direction: column;
        gap: 1rem;
        padding: 0;
        background: none;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        border: none;
        border-radius: 0;
        box-shadow: none;
    }

    .auto-nav .nav-item {
        flex-direction: row;
        gap: 0.5rem;
        align-items: center;
        padding: 0;
        border-radius: 0;
    }

    .auto-nav .nav-label {
        font-size: 0.45rem;
        max-width: 0;
        opacity: 0;
    }

    .auto-nav.visible .nav-label {
        max-width: 0;
        opacity: 0;
    }

    .auto-nav:hover .nav-label {
        opacity: 1;
        max-width: 120px;
    }

    .auto-section .scroll-indicator {
        bottom: 1rem;
        right: 1.2rem;
        left: auto;
        top: auto;
        transform: none;
        flex-direction: row;
        gap: 0.4rem;
        width: auto;
    }

    .auto-section .scroll-indicator .scroll-mouse-icon {
        position: static;
    }

    .auto-section .scroll-line { display: none; }

    .auto-section .scroll-text {
        font-size: 0.5rem;
        color: rgba(255, 255, 255, 0.35);
        font-weight: 500;
    }
}