.hero-main {
    position: relative;
    isolation: isolate;
    /* Contém o bg com scale/translate — overflow-x:clip sozinho deixa overflow-y:visible e vaza no mobile */
    overflow: hidden;
    max-width: 100%;
}

.hero-with-stats {
    min-height: calc(100vh - 5rem);
    min-height: calc(100dvh - 5rem);
    display: flex;
    flex-direction: column;
}

.hero-main--stack {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.hero-main__bg {
    position: absolute;
    /* Folga além do inset para parallax/scale sem expor borda ao arrastar */
    inset: -12%;
    z-index: 0;
    background: url("../../images/happy-specialist-inspecting-neural-network-data-center-used-machine-learning.jpg")
        no-repeat center center;
    background-size: cover;
    animation: moveBg 20s infinite alternate ease-in-out;
    transform: translate3d(0, 0, 0) scale(1.04);
    transform-origin: center center;
    transition: transform 0.35s ease-out;
    will-change: transform;
    pointer-events: none;
}

@keyframes moveBg {
    0% {
        background-position: center;
    }
    100% {
        background-position: top;
    }
}

.hero-main__overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    background-color: rgba(0, 0, 0, 0.62);
    background-image:
        radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.08), transparent),
        radial-gradient(circle at 70% 70%, rgba(37, 214, 102, 0.08), transparent),
        linear-gradient(90deg, rgba(0, 0, 0, 0.45) 0%, rgba(0, 0, 0, 0.25) 50%, rgba(0, 0, 0, 0.35) 100%);
    pointer-events: none;
}

.hero-main > .container-custom {
    position: relative;
    z-index: 2;
}

.hero-main__content {
    display: flex;
    align-items: center;
    padding-top: clamp(1.75rem, 5vh, 3.5rem);
    padding-bottom: clamp(1.5rem, 4vh, 2.75rem);
}

.hero-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.75rem;
    align-items: center;
    width: 100%;
}

/* 2 colunas só no desktop — evita título/visual espremidos em tablet */
@media (min-width: 1024px) {
    .hero-layout {
        grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
        gap: 2rem 2.5rem;
    }

    .hero-main__content {
        padding-top: clamp(2rem, 5vh, 3.75rem);
        padding-bottom: clamp(1.75rem, 4vh, 3rem);
    }
}

@media (min-width: 1280px) {
    .hero-layout {
        grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
        gap: 2.25rem 3rem;
    }
}

.hero-copy {
    min-width: 0;
}

.hero-copy::before {
    content: "";
    display: block;
    width: 3.5rem;
    height: 3px;
    margin-bottom: 1.25rem;
    background: #25D366;
    box-shadow: 0 0 14px rgba(37, 214, 102, 0.55);
}

.hero-title {
    font-size: clamp(1.75rem, 4.2vw, 3rem);
    font-weight: 900;
    line-height: 1.15;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    margin: 0 0 1.15rem;
}

@media (min-width: 1024px) {
    .hero-title {
        font-size: clamp(1.9rem, 2.35vw, 2.75rem);
        letter-spacing: 0.02em;
        margin-bottom: 1.35rem;
    }
}

.hero-sub {
    font-size: clamp(1rem, 2vw, 1.3rem);
    color: #d1d5db;
    font-weight: 300;
    line-height: 1.55;
    max-width: 34rem;
    margin: 0 0 1.75rem;
    min-height: 3.2rem;
}

.hero-cta {
    display: inline-flex;
    align-items: center;
    padding: 0.85rem 1.5rem;
}

.typing-cursor {
    display: inline-block;
    width: 3px;
    height: 0.85em;
    margin-left: 0.35rem;
    vertical-align: -0.05em;
}

.typing-cursor--light {
    background: #fff;
}

.typing-cursor--neon {
    background: #25D366;
}

.hero-visual {
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Meta + celular + badge (referência Devlynx) */
.hero-visual-composition {
    position: relative;
    width: 100%;
    max-width: min(400px, 90vw);
    min-height: clamp(260px, 48vw, 360px);
    margin-inline: auto;
}

.hero-visual-glow {
    position: absolute;
    inset: 8% 0;
    background: radial-gradient(ellipse 70% 60% at 55% 50%, rgba(37, 214, 102, 0.22), transparent 72%);
    pointer-events: none;
    z-index: 0;
}

.hero-cover-img {
    position: absolute;
    top: 2%;
    left: 0;
    width: 52%;
    max-width: 200px;
    height: auto;
    object-fit: contain;
    z-index: 1;
    filter: drop-shadow(0 0 28px rgba(37, 214, 102, 0.35));
    transition: transform 0.35s ease-out;
    will-change: transform;
}

.hero-phone-img {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 68%;
    max-width: 270px;
    height: auto;
    object-fit: contain;
    z-index: 2;
    filter: drop-shadow(0 12px 32px rgba(0, 0, 0, 0.55)) drop-shadow(0 0 24px rgba(37, 214, 102, 0.25));
    transition: transform 0.35s ease-out;
    will-change: transform;
}

.hero-phone-badge {
    position: absolute;
    z-index: 3;
    bottom: 10%;
    left: 50%;
    transform: translateX(-50%) rotate(-3deg);
    padding: 0.5rem 0.95rem;
    margin: 0;
    background: rgba(0, 0, 0, 0.92);
    border: 1px solid #25D366;
    font-family: Orbitron, sans-serif;
    font-size: clamp(0.52rem, 1.5vw, 0.62rem);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #25D366;
    white-space: nowrap;
    box-shadow: 0 0 20px rgba(37, 214, 102, 0.55);
}

@media (min-width: 768px) {
    .hero-visual-composition {
        max-width: 420px;
        min-height: 340px;
    }

    .hero-cover-img {
        max-width: 220px;
    }

    .hero-phone-img {
        max-width: 300px;
    }
}

@media (min-width: 1024px) {
    .hero-visual {
        justify-content: flex-end;
    }

    .hero-visual-composition {
        max-width: 460px;
        min-height: 390px;
        margin-inline: 0 0 auto;
    }

    .hero-cover-img {
        max-width: 240px;
    }

    .hero-phone-img {
        max-width: 320px;
    }

    .hero-phone-badge {
        font-size: 0.62rem;
    }
}

@media (min-width: 1280px) {
    .hero-visual-composition {
        max-width: 500px;
        min-height: 420px;
    }

    .hero-cover-img {
        max-width: 260px;
    }

    .hero-phone-img {
        max-width: 340px;
    }
}

@media (max-width: 767px) {
    .hero-with-stats {
        min-height: 0;
        overflow-x: hidden;
        max-width: 100%;
    }

    /* Sem scale no mobile: evita vão lateral ao overscroll/arraste */
    .hero-main__bg {
        inset: 0;
        transform: none;
        animation: none;
        will-change: auto;
    }

    .hero-visual {
        max-width: 100%;
        min-width: 0;
    }

    .hero-copy {
        text-align: center;
    }

    .hero-copy::before {
        margin-inline: auto;
    }

    .hero-sub {
        margin-inline: auto;
        min-height: 0;
    }

    .hero-cta {
        margin-inline: auto;
    }

    .hero-visual-composition {
        max-width: min(340px, calc(100% - 0.5rem));
        min-height: clamp(220px, 58vw, 300px);
    }

    .hero-phone-badge {
        white-space: normal;
        text-align: center;
        max-width: 92%;
        bottom: 5%;
    }
}

@media (max-width: 480px) {
    .hero-main__content {
        padding-top: 1.25rem;
        padding-bottom: 1.25rem;
    }

    .hero-layout {
        gap: 1.25rem;
    }

    .hero-stats-strip {
        padding: 1.15rem 0;
    }

    .hero-stats-grid {
        gap: 1.15rem 0.75rem;
    }

    .hero-stat__label {
        font-size: 0.75rem;
    }
}

/* Stats: faixa verde sólida */
.hero-stats-strip {
    position: relative;
    z-index: 5;
    background: #25D366;
    border-top: 1px solid #25D366;
    border-bottom: 1px solid #25D366;
    padding: 1.5rem 0;
}

.hero-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.75rem 1.5rem;
    text-align: center;
}

@media (min-width: 768px) {
    .hero-stats-strip {
        padding: 1.75rem 0;
    }

    .hero-stats-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 1.5rem;
    }
}

@media (min-width: 1024px) {
    .hero-stats-strip {
        padding: 2rem 0;
    }
}

.hero-stat {
    transition: transform 0.2s ease;
}

.hero-stat:hover {
    transform: scale(1.1);
}

.hero-stat__value {
    font-size: clamp(1.75rem, 3.5vw, 2.25rem);
    font-weight: 900;
    color: #000000;
    line-height: 1.1;
}

.hero-stat__label {
    margin-top: 0.4rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #171717;
}

@media (prefers-reduced-motion: reduce) {
    .hero-main__bg {
        animation: none;
    }

    .hero-cover-img,
    .hero-phone-img {
        transition: none;
    }
}
