/* O topo da principal (partials/hero.php + assets/hero.js).
   A entrada é uma coreografia: cada peça tem o seu momento (--t, em ms) e só
   começa quando o JS põe .is-in. Sem JS ou com menos movimento, tudo à vista. */

.hx { position: relative; z-index: 2; width: 100%; min-height: 100vh; display: grid; grid-template-rows: 1fr auto; align-content: center; padding: 92px 0 110px; }
.hx .wrap { width: min(1380px, calc(100% - 64px)); margin-inline: auto; }
.hx-grid { display: grid; grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr); gap: 64px; align-items: center; }

/* ---- texto ---- */
.hx-eyebrow { display: flex; align-items: center; gap: 18px; margin: 0 0 22px; color: #7fd3f5; font-size: .82rem; font-weight: 800; letter-spacing: .32em; text-transform: uppercase; }
.hx-eyebrow i { display: block; width: 80px; height: 1px; background: linear-gradient(90deg, #7fd3f5, transparent); transform-origin: left; }
.hx-title { font-family: var(--font-display); font-size: clamp(2.4rem, 3.7vw, 4.3rem); line-height: 1.04; letter-spacing: -.025em; margin: 0; color: #fff; max-width: none; text-wrap: balance; }
.hx-line { display: block; overflow: hidden; padding-bottom: .06em; }
.hx-line > span { display: inline-block; }
.hx-hl > span { background: linear-gradient(100deg, #1ba8e6, #3fc3ff 50%, #1ba8e6); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hx-lead { margin: 26px 0 0; max-width: 36rem; color: #c9d6e8; font-size: 1.12rem; line-height: 1.65; }
.hx-actions { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 36px; }
.hx-btn { display: inline-flex; align-items: center; gap: 12px; min-height: 58px; padding: 0 30px; border-radius: 12px; font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; text-decoration: none; transition: transform .25s, box-shadow .25s, background .25s, border-color .25s; }
.hx-btn-primary { color: #fff; background: linear-gradient(135deg, #1ba8e6, #1570ef); box-shadow: 0 14px 40px rgba(27,168,230,.4), inset 0 1px 0 rgba(255,255,255,.25); }
.hx-btn-primary:hover { transform: translateY(-2px); box-shadow: 0 20px 50px rgba(27,168,230,.55); }
.hx-btn-primary svg { transition: transform .25s; }
.hx-btn-primary:hover svg { transform: translateX(4px); }
.hx-btn-ghost { color: #fff; border: 1px solid rgba(255,255,255,.28); background: rgba(8,21,39,.45); backdrop-filter: blur(8px); }
.hx-btn-ghost:hover { border-color: #7fd3f5; background: rgba(27,168,230,.12); }

/* ---- painel ---- */
.hx-panel { position: relative; display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 0; min-height: 430px; border-radius: 22px; isolation: isolate; }
.hx-panel::before { content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; background: linear-gradient(180deg, rgba(14,30,54,.78), rgba(8,17,31,.86)); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); box-shadow: 0 40px 100px rgba(0,0,0,.45), 0 0 60px rgba(27,168,230,.08); }
/* a borda desenha-se */
.hx-frame { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; z-index: 2; }
.hx-frame rect { width: calc(100% - 2px); height: calc(100% - 2px); fill: none; stroke: rgba(127,211,245,.55); stroke-width: 1.2; stroke-dasharray: 100 100; stroke-dashoffset: 0; vector-effect: non-scaling-stroke; filter: drop-shadow(0 0 6px rgba(27,168,230,.45)); }
.hx-tabs { display: grid; align-content: center; gap: 12px; padding: 22px 0 22px 22px; position: relative; }
.hx-tabs::after { content: ""; position: absolute; right: 0; top: 22px; bottom: 22px; width: 1px; background: linear-gradient(180deg, transparent, rgba(127,211,245,.25), transparent); }
.hx-tab {
    position: relative; display: flex; align-items: center; gap: 16px; width: calc(100% - 22px); min-height: 76px; padding: 14px 18px; text-align: left; cursor: pointer;
    font: inherit; font-size: 1.02rem; font-weight: 800; color: #e6eef8; border-radius: 14px; background: rgba(12,24,42,.6); border: 1px solid rgba(127,211,245,.14);
    transition: background .3s, border-color .3s, box-shadow .3s, color .3s;
}
.hx-tab svg { color: #7fd3f5; flex-shrink: 0; }
.hx-tab:hover { border-color: rgba(127,211,245,.45); }
.hx-tab.is-on { background: linear-gradient(135deg, rgba(27,168,230,.32), rgba(21,112,239,.18)); border-color: #7fd3f5; box-shadow: 0 0 0 1px rgba(127,211,245,.4), 0 12px 34px rgba(27,168,230,.25), inset 0 1px 0 rgba(255,255,255,.12); }
.hx-tab.is-on::after { content: ""; position: absolute; right: -11px; top: 50%; margin-top: -9px; border: 9px solid transparent; border-left-color: #7fd3f5; border-right: 0; filter: drop-shadow(0 0 6px rgba(27,168,230,.7)); }
/* o tempo que falta para a secção seguinte, quando roda sozinha */
.hx-tab-time { position: absolute; left: 14px; right: 14px; bottom: 6px; height: 2px; border-radius: 2px; transform-origin: left; transform: scaleX(0); background: rgba(127,211,245,.8); }
.hx.is-auto .hx-tab.is-on .hx-tab-time { animation: hxTime var(--hx-ciclo, 6s) linear forwards; }
@keyframes hxTime { to { transform: scaleX(1); } }

.hx-panes { position: relative; padding: 30px 30px 26px 34px; min-width: 0; display: grid; }
.hx-pane { grid-area: 1 / 1; display: flex; flex-direction: column; min-width: 0; }
.hx-pane[hidden] { display: none; }
.hx-pane h2 { margin: 0; font-family: var(--font-display); font-size: 1.75rem; color: #fff; letter-spacing: -.01em; }
.hx-pane > p { margin: 10px 0 0; color: #a9b8cf; font-size: 1rem; line-height: 1.55; max-width: 30rem; }
.hx-go { align-self: flex-start; margin-top: 16px; display: inline-flex; align-items: center; gap: 8px; color: #7fd3f5; font-weight: 800; font-size: .92rem; text-decoration: none; }
.hx-go:hover svg { transform: translateX(4px); }
.hx-go svg { transition: transform .2s; }

/* ---- as ilustrações ---- */
.hx-art { margin-top: 20px; flex: 1; min-height: 190px; display: grid; }
.hx-win { position: relative; border-radius: 14px; border: 1px solid rgba(127,211,245,.28); background: linear-gradient(180deg, rgba(16,34,60,.85), rgba(10,22,40,.9)); padding: 30px 14px 14px; overflow: hidden; }
.hx-dots { position: absolute; top: 11px; left: 14px; display: flex; gap: 6px; }
.hx-dots i { width: 7px; height: 7px; border-radius: 50%; background: rgba(127,211,245,.55); }
/* sistemas */
.hx-sys { display: grid; grid-template-columns: 56px 1fr 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 10px; height: 100%; }
.hx-side { grid-row: 1 / 3; display: grid; align-content: start; gap: 9px; padding-top: 4px; }
.hx-side i { height: 4px; border-radius: 4px; background: rgba(127,211,245,.35); }
.hx-side i:first-child { background: #1ba8e6; }
.hx-chart, .hx-donut, .hx-tile { border-radius: 10px; border: 1px solid rgba(127,211,245,.18); background: rgba(27,168,230,.06); }
.hx-chart { grid-column: 2 / 4; padding: 8px; }
.hx-chart svg { width: 100%; height: 100%; overflow: visible; }
.hx-chart polyline { fill: none; stroke: #7fd3f5; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 100; stroke-dashoffset: 100; vector-effect: non-scaling-stroke; filter: drop-shadow(0 0 4px rgba(27,168,230,.8)); }
.hx-chart circle { fill: #fff; opacity: 0; }
.hx-donut { display: grid; place-items: center; }
.hx-donut svg { width: 62%; transform: rotate(-90deg); }
.hx-donut circle { fill: none; stroke: rgba(127,211,245,.15); stroke-width: 5; }
.hx-donut circle.v { stroke: #1ba8e6; stroke-linecap: round; stroke-dasharray: 0 100; }
.hx-tile { display: grid; place-items: center; gap: 6px; padding: 8px; color: #7fd3f5; }
.hx-tile i { width: 60%; height: 4px; border-radius: 4px; background: rgba(127,211,245,.3); }
/* websites */
.hx-art-web .hx-win { display: grid; grid-template-columns: 1fr 70px; gap: 14px; }
.hx-site { display: grid; gap: 10px; align-content: start; }
.hx-site-nav { display: flex; gap: 8px; align-items: center; }
.hx-site-nav b { width: 34px; height: 8px; border-radius: 4px; background: #1ba8e6; }
.hx-site-nav i { width: 22px; height: 5px; border-radius: 4px; background: rgba(127,211,245,.3); }
.hx-site-nav i:first-of-type { margin-left: auto; }
.hx-site-hero { position: relative; height: 70px; border-radius: 10px; overflow: hidden; background: linear-gradient(120deg, rgba(21,112,239,.55), rgba(27,168,230,.2)); padding: 12px; display: grid; align-content: center; gap: 6px; }
.hx-site-hero span { display: block; height: 6px; width: 60%; border-radius: 4px; background: rgba(255,255,255,.85); transform-origin: left; }
.hx-site-hero span + span { width: 40%; background: rgba(255,255,255,.45); }
.hx-site-hero em { width: 46px; height: 12px; border-radius: 6px; background: #fff; }
.hx-site-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.hx-site-cards i { height: 38px; border-radius: 8px; border: 1px solid rgba(127,211,245,.22); background: rgba(27,168,230,.08); }
.hx-phone { align-self: center; height: 128px; border-radius: 14px; border: 2px solid rgba(127,211,245,.4); padding: 14px 8px; display: grid; gap: 7px; align-content: start; background: rgba(8,17,31,.6); }
.hx-phone i { height: 22px; border-radius: 5px; background: rgba(27,168,230,.22); }
.hx-phone i:first-child { height: 34px; background: linear-gradient(120deg, rgba(21,112,239,.6), rgba(27,168,230,.25)); }
/* automação */
.hx-flow { position: relative; border-radius: 14px; border: 1px solid rgba(127,211,245,.28); background: linear-gradient(180deg, rgba(16,34,60,.85), rgba(10,22,40,.9)); overflow: hidden; }
.hx-flow svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.hx-flow path { fill: none; stroke: rgba(127,211,245,.55); stroke-width: 1.6; stroke-dasharray: 3 5; vector-effect: non-scaling-stroke; }
.hx-node { position: absolute; left: var(--x); top: var(--y); transform: translate(-50%, -50%); display: inline-flex; align-items: center; gap: 7px; padding: 7px 11px; border-radius: 10px; font-size: .78rem; font-weight: 800; color: #e6eef8;
    background: rgba(12,26,46,.95); border: 1px solid rgba(127,211,245,.35); white-space: nowrap; }
.hx-node svg { color: #7fd3f5; }
.hx-core { width: 52px; height: 52px; padding: 0; justify-content: center; border-radius: 50%; background: radial-gradient(circle, rgba(27,168,230,.55), rgba(21,112,239,.25)); border-color: #7fd3f5; box-shadow: 0 0 30px rgba(27,168,230,.55); }
.hx-core svg { color: #fff; }
.hx.is-ready .hx-pane.is-on .hx-flow path { animation: hxFlow 1.2s linear infinite; }
@keyframes hxFlow { to { stroke-dashoffset: -16; } }
.hx.is-ready .hx-pane.is-on .hx-core { animation: hxPulse 2.2s ease-in-out infinite; }
@keyframes hxPulse { 50% { box-shadow: 0 0 0 10px rgba(27,168,230,.12), 0 0 40px rgba(27,168,230,.7); } }
/* acompanhamento */
.hx-track { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; align-items: center; }
.hx-phases { display: grid; gap: 10px; }
.hx-phases div { display: grid; gap: 5px; }
.hx-phases b { font-size: .74rem; color: #a9b8cf; font-weight: 700; }
.hx-phases i { position: relative; height: 7px; border-radius: 7px; background: rgba(255,255,255,.07); overflow: hidden; }
.hx-phases i::after { content: ""; position: absolute; inset: 0; width: 0; border-radius: inherit; background: linear-gradient(90deg, #7fd3f5, #1570ef); }
.hx-checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.hx-checks li { display: flex; align-items: center; gap: 8px; font-size: .8rem; color: #cfdae8; }
.hx-checks li::before { content: "✓"; width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; font-size: .66rem; font-weight: 900; color: #08251a; background: #4fd49a; flex-shrink: 0; }

/* ---- números ---- */
.hx-stats { display: flex; align-items: center; justify-content: center; gap: 0; margin-top: 46px; }
.hx-rule { flex: 1; height: 1px; background: linear-gradient(90deg, transparent, rgba(127,211,245,.3)); max-width: 200px; }
.hx-rule:last-child { background: linear-gradient(90deg, rgba(127,211,245,.3), transparent); }
.hx-stat { display: inline-flex; align-items: baseline; gap: 8px; padding: 0 34px; color: #a9b8cf; font-size: 1.12rem; white-space: nowrap; }
.hx-stat + .hx-stat { border-left: 1px solid rgba(127,211,245,.25); }
.hx-stat b { font-family: var(--font-display); font-size: 2.1rem; color: #fff; letter-spacing: -.02em; }
.hx-stat em { font-style: normal; color: #f4c14a; font-size: 1.3rem; margin-left: -4px; }

/* ===================== a coreografia ===================== */
/* Estado inicial (só com JS ativo: .hx-anim é posto pelo hero.js antes do primeiro desenho) */
.hx-anim .hx-eyebrow span, .hx-anim .hx-lead, .hx-anim .hx-actions, .hx-anim .hx-stat, .hx-anim .hx-rule,
.hx-anim .hx-tab, .hx-anim .hx-pane.is-on > *, .hx-anim .hx-panel::before { opacity: 0; }
.hx-anim .hx-eyebrow span { transform: translateY(10px); }
.hx-anim .hx-eyebrow i { transform: scaleX(0); }
.hx-anim .hx-line > span { transform: translateY(105%); }
.hx-anim .hx-lead { transform: translateY(14px); }
.hx-anim .hx-panel::before { transform: scale(.97); }
.hx-anim .hx-frame rect { stroke-dashoffset: 100; }
.hx-anim .hx-tab { transform: translateX(-16px); }
.hx-anim .hx-pane.is-on > * { transform: translateY(12px); }
.hx-anim .hx-actions { transform: translateY(16px); }
.hx-anim .hx-stat { transform: translateY(12px); }
.hx-anim .hx-rule { transform: scaleX(0); }

/* A entrada: cada peça no seu tempo. */
.hx-anim.is-in .hx-eyebrow span { opacity: 1; transform: none; transition: opacity .6s ease .1s, transform .7s cubic-bezier(.2,.8,.2,1) .1s; }
.hx-anim.is-in .hx-eyebrow i { transform: none; transition: transform .8s cubic-bezier(.2,.8,.2,1) .45s; }
.hx-anim.is-in .hx-line > span { transform: none; transition: transform .85s cubic-bezier(.2,.8,.2,1); transition-delay: calc(.55s + var(--i) * .13s); }
.hx-anim.is-in .hx-lead { opacity: 1; transform: none; transition: opacity .7s ease 1.35s, transform .8s cubic-bezier(.2,.8,.2,1) 1.35s; }
.hx-anim.is-in .hx-panel::before { opacity: 1; transform: none; transition: opacity .8s ease 1.6s, transform .9s cubic-bezier(.2,.8,.2,1) 1.6s; }
.hx-anim.is-in .hx-frame rect { stroke-dashoffset: 0; transition: stroke-dashoffset 1.4s cubic-bezier(.6,0,.2,1) 1.7s; }
.hx-anim.is-in .hx-tab { opacity: 1; transform: none; transition: opacity .5s ease, transform .6s cubic-bezier(.2,.8,.2,1), background .3s, border-color .3s, box-shadow .3s; transition-delay: calc(2.4s + var(--i) * .14s); }
.hx-anim.is-in .hx-pane.is-on > * { opacity: 1; transform: none; transition: opacity .55s ease, transform .6s cubic-bezier(.2,.8,.2,1); }
.hx-anim.is-in .hx-pane.is-on > h2 { transition-delay: 3s; }
.hx-anim.is-in .hx-pane.is-on > p { transition-delay: 3.12s; }
.hx-anim.is-in .hx-pane.is-on > .hx-art { transition-delay: 3.25s; }
.hx-anim.is-in .hx-pane.is-on > .hx-go { transition-delay: 3.5s; }
.hx-anim.is-in .hx-actions { opacity: 1; transform: none; transition: opacity .6s ease 3.7s, transform .7s cubic-bezier(.2,.8,.2,1) 3.7s; }
.hx-anim.is-in .hx-rule { opacity: 1; transform: none; transition: opacity .6s ease 4.1s, transform 1s cubic-bezier(.2,.8,.2,1) 4.1s; }
.hx-anim.is-in .hx-stat { opacity: 1; transform: none; transition: opacity .5s ease, transform .6s cubic-bezier(.2,.8,.2,1); transition-delay: calc(4.2s + var(--i) * .15s); }
/* Depois da entrada, as trocas de secção são rápidas. */
.hx.is-ready .hx-pane.is-on > * { transition-delay: 0s !important; }
.hx.is-ready .hx-tab { transition-delay: 0s !important; }

/* As ilustrações animam-se cada vez que a secção fica ativa (.is-play). */
.hx-pane.is-play .hx-chart polyline { animation: hxDraw 1.4s cubic-bezier(.6,0,.2,1) .35s forwards; }
.hx-pane.is-play .hx-chart circle { animation: hxFade .4s ease 1.6s forwards; }
.hx-pane.is-play .hx-donut circle.v { animation: hxDonut 1.3s cubic-bezier(.2,.8,.2,1) .5s forwards; }
.hx-pane.is-play .hx-tile, .hx-pane.is-play .hx-side i, .hx-pane.is-play .hx-site > *, .hx-pane.is-play .hx-phone i,
.hx-pane.is-play .hx-site-cards i, .hx-pane.is-play .hx-node, .hx-pane.is-play .hx-phases > div, .hx-pane.is-play .hx-checks li { animation: hxPop .5s cubic-bezier(.2,.8,.2,1) both; }
.hx-pane.is-play .hx-tile:nth-of-type(4) { animation-delay: .5s; } .hx-pane.is-play .hx-tile:nth-of-type(5) { animation-delay: .62s; } .hx-pane.is-play .hx-tile:nth-of-type(6) { animation-delay: .74s; }
.hx-pane.is-play .hx-side i:nth-child(2) { animation-delay: .08s; } .hx-pane.is-play .hx-side i:nth-child(3) { animation-delay: .16s; } .hx-pane.is-play .hx-side i:nth-child(4) { animation-delay: .24s; } .hx-pane.is-play .hx-side i:nth-child(5) { animation-delay: .32s; }
.hx-pane.is-play .hx-site > :nth-child(2) { animation-delay: .15s; } .hx-pane.is-play .hx-site > :nth-child(3) { animation-delay: .3s; }
.hx-pane.is-play .hx-site-cards i:nth-child(2) { animation-delay: .4s; } .hx-pane.is-play .hx-site-cards i:nth-child(3) { animation-delay: .5s; }
.hx-pane.is-play .hx-phone i:nth-child(2) { animation-delay: .5s; } .hx-pane.is-play .hx-phone i:nth-child(3) { animation-delay: .6s; }
.hx-pane.is-play .hx-site-hero span { animation: hxGrow .6s cubic-bezier(.2,.8,.2,1) .35s both; }
.hx-pane.is-play .hx-flow path { stroke-dasharray: 100; stroke-dashoffset: 100; animation: hxDraw .9s cubic-bezier(.6,0,.2,1) .3s forwards, hxFlowIn 0s linear 1.25s forwards; }
@keyframes hxFlowIn { to { stroke-dasharray: 3 5; stroke-dashoffset: 0; } }
.hx-pane.is-play .hx-node:nth-of-type(1) { animation-delay: .05s; } .hx-pane.is-play .hx-node:nth-of-type(2) { animation-delay: .15s; } .hx-pane.is-play .hx-node:nth-of-type(3) { animation-delay: .7s; } .hx-pane.is-play .hx-node:nth-of-type(4) { animation-delay: 1s; } .hx-pane.is-play .hx-node:nth-of-type(5) { animation-delay: 1.1s; }
.hx-pane.is-play .hx-phases > div:nth-child(2) { animation-delay: .1s; } .hx-pane.is-play .hx-phases > div:nth-child(3) { animation-delay: .2s; } .hx-pane.is-play .hx-phases > div:nth-child(4) { animation-delay: .3s; }
.hx-pane.is-play .hx-phases i::after { animation: hxBar 1.1s cubic-bezier(.2,.8,.2,1) .5s forwards; }
.hx-pane.is-play .hx-checks li:nth-child(1) { animation-delay: .9s; } .hx-pane.is-play .hx-checks li:nth-child(2) { animation-delay: 1.1s; } .hx-pane.is-play .hx-checks li:nth-child(3) { animation-delay: 1.3s; }
@keyframes hxDraw { to { stroke-dashoffset: 0; } }
@keyframes hxFade { to { opacity: 1; } }
@keyframes hxDonut { to { stroke-dasharray: 72 100; } }
@keyframes hxPop { from { opacity: 0; transform: translateY(8px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes hxGrow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes hxBar { to { width: var(--w); } }
/* o nó central da automação mantém o seu transform de posição */
.hx-pane.is-play .hx-node { animation-name: hxNode; }
@keyframes hxNode { from { opacity: 0; transform: translate(-50%, -40%) scale(.9); } to { opacity: 1; transform: translate(-50%, -50%); } }

/* ---- responsivo ---- */
@media (max-width: 1100px) {
    .hx-grid { grid-template-columns: 1fr; gap: 40px; }
    .hx-panel { grid-template-columns: 220px minmax(0, 1fr); }
}
@media (max-width: 720px) {
    .hx .wrap { width: calc(100% - 32px); }
    .hx { padding: 86px 0 90px; min-height: 0; }
    .hx-title { font-size: clamp(2.2rem, 10vw, 3rem); }
    .hx-panel { grid-template-columns: 1fr; min-height: 0; }
    .hx-tabs { grid-auto-flow: column; grid-auto-columns: minmax(150px, 1fr); overflow-x: auto; padding: 14px; gap: 8px; scrollbar-width: none; }
    .hx-tabs::after { display: none; }
    .hx-tab { width: auto; min-height: 56px; padding: 10px 12px; font-size: .88rem; gap: 10px; }
    .hx-tab.is-on::after { display: none; }
    .hx-panes { padding: 8px 16px 18px; }
    .hx-pane h2 { font-size: 1.35rem; }
    .hx-actions { flex-direction: column; gap: 10px; }
    .hx-actions .hx-btn { justify-content: center; min-height: 52px; white-space: nowrap; }
    .hx-stats { flex-wrap: wrap; gap: 14px 0; margin-top: 34px; }
    .hx-rule { display: none; }
    .hx-stat { padding: 0 16px; font-size: .95rem; }
    .hx-stat b { font-size: 1.6rem; }
    .hx-stat + .hx-stat { border-left: 0; }
}
@media (prefers-reduced-motion: reduce) {
    .hx * { animation: none !important; transition: none !important; }
}
