/* =============================================
   HERO — "palco" de tecnologia (substitui o mockup de celular)
   Só transform/opacity são animados; sem blur/filter em loop.
   ============================================= */
.hx {
    --hx-text: #f8fafc;
    --hx-muted: #a5b4cc;
    --hx-line: rgba(255, 255, 255, 0.12);
    --hx-glass: rgba(15, 23, 42, 0.62);
    --hx-glass-strong: rgba(10, 16, 32, 0.86);
    --hx-cyan: #22d3ee;
    --hx-blue: #3b82f6;
    --hx-violet: #8b5cf6;
    --hx-good: #34d399;
    --hx-grid: rgba(148, 163, 184, 0.09);
    --hx-shadow: 0 30px 80px -24px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.04) inset;
    position: relative;
    isolation: isolate;
    min-height: max(100svh, 760px);
    display: flex;
    align-items: center;
    padding: 8rem 0 4.5rem;
    overflow: hidden;
    color: var(--hx-text);
    background: var(--bg-dark);
}

[data-theme="light"] .hx {
    --hx-text: #0b1220;
    --hx-muted: #475569;
    --hx-line: rgba(15, 23, 42, 0.12);
    --hx-glass: rgba(255, 255, 255, 0.72);
    --hx-glass-strong: rgba(255, 255, 255, 0.94);
    --hx-cyan: #0891b2;
    --hx-blue: #2563eb;
    --hx-violet: #7c3aed;
    --hx-good: #059669;
    --hx-grid: rgba(15, 23, 42, 0.07);
    --hx-shadow: 0 30px 70px -28px rgba(30, 58, 138, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.7) inset;
}

/* ---------- fundo ---------- */
.hx-bg {
    position: absolute;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.hx-aurora {
    position: absolute;
    width: 62vmax;
    height: 62vmax;
    border-radius: 50%;
    will-change: transform;
}

.hx-aurora--a {
    top: -28vmax;
    left: -14vmax;
    background: radial-gradient(closest-side, rgba(59, 130, 246, 0.34), transparent);
    animation: hx-drift-a 22s ease-in-out infinite alternate;
}

.hx-aurora--b {
    right: -22vmax;
    bottom: -30vmax;
    background: radial-gradient(closest-side, rgba(139, 92, 246, 0.3), transparent);
    animation: hx-drift-b 26s ease-in-out infinite alternate;
}

.hx-aurora--c {
    top: 8vmax;
    right: 8vmax;
    width: 34vmax;
    height: 34vmax;
    background: radial-gradient(closest-side, rgba(34, 211, 238, 0.18), transparent);
    animation: hx-drift-a 30s ease-in-out infinite alternate-reverse;
}

[data-theme="light"] .hx-aurora--a { background: radial-gradient(closest-side, rgba(59, 130, 246, 0.22), transparent); }
[data-theme="light"] .hx-aurora--b { background: radial-gradient(closest-side, rgba(139, 92, 246, 0.16), transparent); }
[data-theme="light"] .hx-aurora--c { background: radial-gradient(closest-side, rgba(34, 211, 238, 0.2), transparent); }

.hx-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(var(--hx-grid) 1px, transparent 1px),
        linear-gradient(90deg, var(--hx-grid) 1px, transparent 1px);
    background-size: 56px 56px;
    -webkit-mask-image: radial-gradient(ellipse 75% 70% at 62% 42%, #000 20%, transparent 78%);
    mask-image: radial-gradient(ellipse 75% 70% at 62% 42%, #000 20%, transparent 78%);
}

.hx-fade {
    position: absolute;
    inset: auto 0 0;
    height: 160px;
    background: linear-gradient(to bottom, transparent, var(--bg-dark));
}

@keyframes hx-drift-a {
    from { transform: translate3d(0, 0, 0) scale(1); }
    to { transform: translate3d(6vmax, 4vmax, 0) scale(1.12); }
}

@keyframes hx-drift-b {
    from { transform: translate3d(0, 0, 0) scale(1.05); }
    to { transform: translate3d(-7vmax, -3vmax, 0) scale(0.95); }
}

/* ---------- layout ---------- */
.hx-inner {
    width: min(100% - 3rem, 1360px);
    margin-inline: auto;
    display: grid;
    grid-template-columns: minmax(0, 1.02fr) minmax(0, 0.98fr);
    align-items: center;
    gap: clamp(2rem, 5vw, 5rem);
}

/* ---------- texto ---------- */
.hx-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0 0 1.6rem;
    padding: 0.3rem 1.1rem 0.3rem 0.3rem;
    border: 1px solid transparent;
    border-radius: 999px;
    background:
        linear-gradient(var(--hx-glass-strong), var(--hx-glass-strong)) padding-box,
        linear-gradient(100deg, var(--hx-blue), var(--hx-cyan), var(--hx-violet)) border-box;
    box-shadow: 0 10px 30px -12px rgba(59, 130, 246, 0.65);
    color: var(--hx-text);
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.005em;
}

.hx-eyebrow__badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.9rem;
    border-radius: 999px;
    color: #fff;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    background: linear-gradient(135deg, #1d4ed8, #3b82f6 55%, #6366f1);
}

.hx-eyebrow__badge .hx-dot {
    background: #fff;
    animation: hx-ping-white 2.4s ease-out infinite;
}

@keyframes hx-ping-white {
    0% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.7); }
    70%, 100% { box-shadow: 0 0 0 8px rgba(255, 255, 255, 0); }
}

.hx-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--hx-good);
    box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.6);
    animation: hx-ping 2.4s ease-out infinite;
}

@keyframes hx-ping {
    0% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.55); }
    70%, 100% { box-shadow: 0 0 0 10px rgba(52, 211, 153, 0); }
}

.hx h1 {
    margin: 0;
    font-size: clamp(2.6rem, 4.3vw, 4.3rem);
    font-weight: 700;
    line-height: 1.04;
    letter-spacing: -0.035em;
}

.hx h1 .hx-line {
    display: block;
    white-space: nowrap;
}

.hx h1 em {
    font-style: normal;
    background: linear-gradient(100deg, var(--hx-blue) 0%, var(--hx-cyan) 55%, var(--hx-violet) 110%);
    background-size: 140% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.hx-sub {
    max-width: 38rem;
    min-height: 3.4em;
    margin: 1.6rem 0 0;
    color: var(--hx-muted);
    font-size: clamp(1.02rem, 1.4vw, 1.2rem);
    line-height: 1.65;
}

.hx-sub .typing-effect {
    color: var(--hx-text);
    font-weight: 500;
}

.hx-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.9rem;
    margin-top: 2rem;
}

.hx .hx-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    padding: 1rem 1.7rem;
    border-radius: 14px;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease, background-color 0.25s ease, border-color 0.25s ease;
}

.hx .hx-btn svg {
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.hx .hx-btn:hover svg {
    transform: translateX(4px);
}

.hx .hx-btn--primary {
    color: #fff;
    background: linear-gradient(135deg, #1d4ed8, #3b82f6 55%, #6366f1);
    box-shadow: 0 14px 34px -10px rgba(59, 130, 246, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.18) inset;
}

.hx .hx-btn--primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 20px 40px -10px rgba(59, 130, 246, 0.85), 0 0 0 1px rgba(255, 255, 255, 0.25) inset;
}

.hx .hx-btn--ghost {
    color: var(--hx-text);
    border: 1px solid var(--hx-line);
    background: var(--hx-glass);
}

.hx .hx-btn--ghost:hover {
    transform: translateY(-3px);
    border-color: rgba(59, 130, 246, 0.55);
    background: rgba(59, 130, 246, 0.12);
}

.hx .hx-btn:focus-visible {
    outline: 3px solid var(--hx-cyan);
    outline-offset: 3px;
}

.hx-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 1.4rem 2.6rem;
    margin: 2.8rem 0 0;
    padding: 1.6rem 0 0;
    list-style: none;
    border-top: 1px solid var(--hx-line);
}

.hx-stats strong {
    display: block;
    font-size: clamp(1.6rem, 2.4vw, 2.1rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1;
}

.hx-stats span {
    display: block;
    margin-top: 0.4rem;
    color: var(--hx-muted);
    font-size: 0.85rem;
}

/* ---------- palco ---------- */
.hx-stage {
    --px: 0;
    --py: 0;
    position: relative;
    width: 100%;
    max-width: 620px;
    margin-inline: auto;
    aspect-ratio: 1 / 0.98;
}

.hx-orbit {
    position: absolute;
    inset: -6%;
    width: 112%;
    height: 112%;
    pointer-events: none;
}

.hx-orbit circle {
    fill: none;
    stroke: var(--hx-line);
    stroke-width: 1;
}

.hx-orbit .hx-orbit__dash {
    stroke-dasharray: 3 9;
    transform-origin: 50% 50%;
    animation: hx-spin 70s linear infinite;
}

@keyframes hx-spin {
    to { transform: rotate(360deg); }
}

.hx-layer {
    position: absolute;
    transform: translate3d(calc(var(--px) * var(--depth, 10px)), calc(var(--py) * var(--depth, 10px)), 0);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.hx-float {
    animation: hx-bob 7s ease-in-out infinite;
}

@keyframes hx-bob {
    0%, 100% { transform: translate3d(0, 0, 0); }
    50% { transform: translate3d(0, -10px, 0); }
}

.hx-rise {
    animation: hx-rise 0.9s cubic-bezier(0.16, 1, 0.3, 1) both;
    animation-delay: var(--d, 0s);
}

@keyframes hx-rise {
    from { opacity: 0; transform: translate3d(0, 28px, 0) scale(0.97); }
    to { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
}

.hx-copy > * {
    animation: hx-rise 0.9s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.hx-copy > :nth-child(1) { animation-delay: 0.05s; }
.hx-copy > :nth-child(2) { animation-delay: 0.15s; }
.hx-copy > :nth-child(3) { animation-delay: 0.28s; }
.hx-copy > :nth-child(4) { animation-delay: 0.4s; }
.hx-copy > :nth-child(5) { animation-delay: 0.52s; }

/* janela principal */
.hx-win {
    --depth: 14px;
    top: 5%;
    right: 0;
    width: 88%;
}

.hx-card {
    border: 1px solid var(--hx-line);
    border-radius: 22px;
    background: var(--hx-glass-strong);
    box-shadow: var(--hx-shadow);
    overflow: hidden;
}

.hx-card--code {
    overflow: visible;
}

.hx-win__bar {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.85rem 1.1rem;
    border-bottom: 1px solid var(--hx-line);
}

.hx-win__bar i {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--hx-line);
}

.hx-win__bar i:nth-child(1) { background: #fb7185; }
.hx-win__bar i:nth-child(2) { background: #fbbf24; }
.hx-win__bar i:nth-child(3) { background: #34d399; }

.hx-win__url {
    margin-left: 0.8rem;
    padding: 0.2rem 0.8rem;
    border-radius: 8px;
    background: var(--hx-glass);
    color: var(--hx-muted);
    font-size: 0.72rem;
}

.hx-win__live {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--hx-good);
    font-size: 0.7rem;
    font-weight: 600;
}

.hx-win__live::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    animation: hx-blink 1.6s ease-in-out infinite;
}

@keyframes hx-blink {
    50% { opacity: 0.25; }
}

.hx-win__body {
    padding: 1.2rem 1.2rem 1rem;
}

.hx-kpis {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.7rem;
}

.hx-kpi {
    padding: 0.8rem 0.85rem;
    border: 1px solid var(--hx-line);
    border-radius: 14px;
    background: var(--hx-glass);
}

.hx-kpi small {
    display: block;
    color: var(--hx-muted);
    font-size: 0.66rem;
    letter-spacing: 0.02em;
}

.hx-kpi b {
    display: block;
    margin-top: 0.3rem;
    font-size: clamp(0.95rem, 1.5vw, 1.2rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    white-space: nowrap;
}

.hx-kpi span {
    display: inline-block;
    margin-top: 0.25rem;
    color: var(--hx-good);
    font-size: 0.66rem;
    font-weight: 600;
}

.hx-chart {
    position: relative;
    margin-top: 1rem;
    padding: 0.9rem 0.9rem 0.4rem;
    border: 1px solid var(--hx-line);
    border-radius: 16px;
    background: var(--hx-glass);
}

.hx-chart__head {
    display: flex;
    justify-content: space-between;
    color: var(--hx-muted);
    font-size: 0.68rem;
}

.hx-chart svg {
    display: block;
    width: 100%;
    height: auto;
    margin-top: 0.4rem;
    overflow: visible;
}

.hx-chart__area {
    animation: hx-fade 1.2s ease 1.5s both;
}

.hx-chart__line {
    stroke-dasharray: 620;
    stroke-dashoffset: 620;
    animation: hx-draw 2s cubic-bezier(0.65, 0, 0.35, 1) 0.9s forwards;
}

.hx-chart__end {
    transform-box: fill-box;
    transform-origin: center;
    animation: hx-fade 0.4s ease 2.7s both, hx-pulse 2.2s ease-in-out 3s infinite;
}

@keyframes hx-draw {
    to { stroke-dashoffset: 0; }
}

@keyframes hx-fade {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes hx-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.7); }
}

/* janela de código */
.hx-code {
    --depth: 26px;
    left: 0;
    bottom: 6%;
    width: 58%;
}

.hx-card--code {
    padding: 0.95rem 1.1rem 1.05rem;
    border-radius: 18px;
    font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
    font-size: clamp(0.62rem, 0.95vw, 0.78rem);
    line-height: 1.85;
}

.hx-code__line {
    display: block;
    white-space: nowrap;
    color: var(--hx-muted);
    animation: hx-rise 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
    animation-delay: calc(1.1s + var(--i) * 0.16s);
}

.hx-code .k { color: var(--hx-violet); }
.hx-code .s { color: var(--hx-good); }
.hx-code .f { color: var(--hx-cyan); }
.hx-code .c { opacity: 0.7; }

/* chips */
.hx-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 0.95rem 0.6rem 0.65rem;
    border: 1px solid var(--hx-line);
    border-radius: 14px;
    background: var(--hx-glass-strong);
    box-shadow: var(--hx-shadow);
    font-size: 0.74rem;
    font-weight: 600;
    white-space: nowrap;
}

.hx-chip i {
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border-radius: 9px;
    color: #fff;
    font-size: 0.8rem;
    background: linear-gradient(135deg, var(--hx-blue), var(--hx-violet));
}

.hx-chip small {
    display: block;
    margin-top: 1px;
    color: var(--hx-muted);
    font-size: 0.64rem;
    font-weight: 500;
}

.hx-pos-shield { --depth: 36px; top: -1%; left: 6%; }
.hx-pos-speed { --depth: 32px; right: -1%; bottom: 14%; }
.hx-chip--shield i { background: linear-gradient(135deg, #059669, #34d399); }
.hx-chip--speed i { background: linear-gradient(135deg, #0891b2, #22d3ee); }
.hx-pos-speed .hx-float { animation-duration: 8.5s; animation-delay: -3s; }

/* ---------- responsivo ---------- */
@media (max-width: 992px) {
    .hx {
        min-height: auto;
        padding: 7.5rem 0 4rem;
    }

    .hx-inner {
        grid-template-columns: 1fr;
        gap: 3.2rem;
    }

    .hx-copy {
        text-align: center;
    }

    .hx-sub {
        margin-inline: auto;
    }

    .hx-actions,
    .hx-stats {
        justify-content: center;
    }

    .hx-stage {
        max-width: 560px;
    }
}

@media (max-width: 640px) {
    .hx {
        padding: 5.6rem 0 2.6rem;
    }

    .hx-inner {
        width: min(100% - 2rem, 1360px);
        gap: 1.8rem;
    }

    .hx-eyebrow {
        gap: 0.55rem;
        margin-bottom: 1.1rem;
        padding-right: 0.9rem;
        font-size: 0.84rem;
    }

    .hx-eyebrow__badge {
        padding: 0.35rem 0.75rem;
        font-size: 0.72rem;
    }

    .hx h1 {
        font-size: clamp(2.3rem, 11.5vw, 3rem);
        line-height: 1.04;
    }

    .hx h1 .hx-line {
        white-space: normal;
    }

    .hx-sub {
        min-height: 3.2em;
        margin-top: 1rem;
        font-size: 1rem;
    }

    .hx-actions {
        flex-direction: column;
        gap: 0.65rem;
        margin-top: 1.3rem;
    }

    .hx .hx-btn {
        width: 100%;
        justify-content: center;
        padding: 0.95rem 1.4rem;
    }

    .hx-stats {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 0.6rem;
        margin-top: 1.5rem;
        padding-top: 1.2rem;
    }

    .hx-stats strong {
        font-size: 1.4rem;
    }

    .hx-stats span {
        font-size: 0.7rem;
    }

    /* palco compacto: só a janela do painel, sem as camadas extras */
    .hx-stage {
        aspect-ratio: auto;
        max-width: none;
    }

    .hx-stage .hx-orbit,
    .hx-code,
    .hx-pos-shield,
    .hx-pos-speed {
        display: none;
    }

    .hx-win {
        position: relative;
        top: auto;
        right: auto;
        width: 100%;
    }

    .hx-win__url {
        display: none;
    }

    .hx-kpi:nth-child(3) {
        display: none;
    }

    .hx-kpis {
        grid-template-columns: repeat(2, 1fr);
    }

    .hx-chart svg {
        height: 90px;
    }
}

/* ---------- movimento reduzido ---------- */
@media (prefers-reduced-motion: reduce) {
    .hx *,
    .hx *::before {
        animation-duration: 0.01ms !important;
        animation-delay: 0s !important;
        animation-iteration-count: 1 !important;
    }

    .hx-chart__line {
        stroke-dashoffset: 0;
    }

    .hx-layer {
        transition: none;
    }
}
