/* ═══════════════════════════════════════════════════════════════
   ATLAS — MOTION LAYER
   Scroll motions inspirados na engenharia reversa de manychat.com
   (GSAP + ScrollTrigger com scrub, sticky sections, SplitText em
   linhas com máscara), traduzidos para a identidade Atlas:
   canvas preto, ouro, verde pixel, Bebas Neue, mono e Win95.

   Tudo aqui é progressivo: sem JS (ou com reduced motion) as seções
   novas aparecem estáticas. Estados animados só valem com html.mx-on.
═══════════════════════════════════════════════════════════════ */

/* ── 0. AJUSTES GLOBAIS QUANDO O MOTION ESTÁ ATIVO ───────────── */
/* O CRT flicker dos h2 é substituído pelo reveal de linhas mascaradas */
html.mx-on .section-header.visible h2 { animation: none !important; }

/* O ticker cinético substitui o marquee mobile */
html.mx-on .marquee-strip { display: none !important; }

/* Elementos controlados pelo GSAP não podem ser escondidos pelo snap Win95 */
html.mx-on .mx-owned {
  opacity: 1 !important;
  transition: none !important;
}

/* Máscaras de linha/char do SplitText */
.mx-mask { display: block; overflow: clip; padding-bottom: 0.06em; margin-bottom: -0.06em; }
.hero-name .mx-mask { display: inline-block; vertical-align: top; }

/* ── 1. TICKER CINÉTICO (scroll-scrub horizontal) ────────────── */
.mx-ticker {
  position: relative;
  padding: 28px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--canvas);
  overflow: hidden;
}

.mx-ticker-row { overflow: hidden; }
.mx-ticker-row + .mx-ticker-row { margin-top: 6px; }

.mx-ticker-track {
  display: flex;
  width: max-content;
  white-space: nowrap;
  will-change: transform;
}

.mx-ticker-track span {
  font-family: 'Bebas Neue', 'Impact', sans-serif;
  font-size: clamp(44px, 8vw, 112px);
  line-height: 1;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--frost);
  padding-right: 0.35em;
}

.mx-ticker-track .mx-ticker-star {
  color: var(--gold);
  font-size: 0.5em;
  align-self: center;
}

.mx-ticker-row--outline .mx-ticker-track span:not(.mx-ticker-star) {
  color: transparent;
  -webkit-text-stroke: 1.5px var(--gold);
}

/* ── 2. PALAVRA GIGANTE COM REVEAL POR CLIP-PATH ─────────────── */
.mx-bigword {
  position: relative;
  background: var(--canvas);
  overflow: clip;
}

.mx-bigword-sticky {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 80px 16px;
  text-align: center;
}

html.mx-on .mx-bigword { height: 220vh; height: 220svh; }
html.mx-on .mx-bigword-sticky { position: sticky; top: 0; height: 100vh; height: 100svh; }

.mx-bigword-kicker,
.mx-bigword-caption {
  font-family: 'Share Tech Mono', monospace;
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.mx-bigword-caption { color: rgba(255,255,255,0.6); max-width: 46ch; }

.mx-bigword-text {
  position: relative;
  font-family: 'Bebas Neue', 'Impact', sans-serif;
  font-weight: 400;
  font-size: clamp(120px, 31vw, 520px);
  line-height: 0.8;
  letter-spacing: 0.01em;
  margin: 0.12em 0 0;
}

.mx-bigword-kicker { position: relative; z-index: 1; }

.mx-bigword-ghost,
.mx-bigword-fill { display: block; }

.mx-bigword-ghost {
  color: transparent;
  -webkit-text-stroke: 1px var(--gold-dim);
}

.mx-bigword-fill {
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, #a0e0ab 0%, #c8a96e 35%, #ffac2e 60%, #a52d25 100%);
  background-size: 220% 100%;
  background-position: 0% 50%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Scanlines dentro das letras (identidade CRT) */
.mx-bigword-fill::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(0deg, rgba(0,0,0,0.28) 0 2px, transparent 2px 5px);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  pointer-events: none;
}

/* ── 3. PROCESSO — STEPPER STICKY (desktop) ──────────────────── */
.mx-steps { display: none; }

@media (min-width: 901px) {
  html.mx-on .processo .timeline { display: none; }
  html.mx-on .mx-steps {
    display: block;
    position: relative;
    height: calc(var(--n, 5) * 75vh + 100vh);
  }
}

.mx-steps-sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  align-items: center;
  gap: 56px;
}

.mx-steps-bars {
  display: flex;
  gap: 8px;
  margin-bottom: 28px;
}

.mx-bar {
  position: relative;
  flex: 0 0 56px;
  height: 4px;
  background: rgba(255,255,255,0.12);
  overflow: hidden;
}

.mx-bar i {
  position: absolute;
  inset: 0;
  background: var(--gold);
  transform-origin: left center;
  transform: scaleX(0);
}

.mx-steps-count {
  font-family: 'Share Tech Mono', monospace;
  font-size: 13px;
  letter-spacing: 0.14em;
  color: var(--muted);
  margin-bottom: 18px;
}

.mx-steps-count b { color: var(--gold); font-weight: 400; }

.mx-steps-stage {
  position: relative;
  min-height: 330px;
}

.mx-step {
  position: absolute;
  inset: 0 0 auto 0;
}

.mx-step + .mx-step { visibility: hidden; }

.mx-steps-left { min-width: 0; }

.mx-step h3 {
  font-family: 'Bebas Neue', 'Impact', sans-serif;
  font-weight: 400;
  font-size: clamp(44px, 4.4vw, 76px);
  overflow-wrap: anywhere;
  line-height: 0.92;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--frost);
  margin-bottom: 14px;
}

.mx-step-sub {
  font-family: 'Share Tech Mono', monospace;
  font-size: 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--pixel-green);
  margin-bottom: 18px;
}

.mx-step-desc {
  font-size: 17px;
  line-height: 1.6;
  color: rgba(255,255,255,0.7);
  max-width: 46ch;
  margin-bottom: 22px;
}

/* Janela Win95 do lado direito */
.mx-steps-window { max-width: 420px; }

.mx-steps-screen {
  background: #000;
  border: 2px solid;
  border-color: #808080 #ffffff #ffffff #808080;
  margin: 6px;
  padding: 26px 22px 22px;
  color: var(--pixel-green);
  font-family: 'VT323', 'Share Tech Mono', monospace;
}

.mx-steps-prompt { font-size: 18px; opacity: 0.75; }

.mx-steps-num {
  display: block;
  font-size: 168px;
  line-height: 0.85;
  color: var(--gold);
  text-shadow: 4px 4px 0 rgba(165,45,37,0.45);
  margin: 10px 0 14px;
}

.mx-steps-meter {
  display: grid;
  grid-template-columns: repeat(20, 1fr);
  gap: 3px;
  height: 16px;
  border: 1px solid rgba(160,224,171,0.4);
  padding: 2px;
}

.mx-steps-meter span { background: transparent; }
.mx-steps-meter span.on { background: var(--pixel-green); }

/* ── 4. ATLAS CRM — JANELA QUE "MAXIMIZA" NO SCROLL ──────────── */
html.mx-on .bento-produto .win95-window { will-change: transform; transform-origin: 50% 100%; }

/* ── 5. ANTES / DEPOIS (cards sticky que se sobrepõem) ───────── */
.mx-compare { position: relative; margin: 72px 0 24px; }

.mx-compare-head { text-align: center; margin-bottom: 32px; }

.mx-compare-grid {
  display: grid;
  gap: 14px;
}

@media (min-width: 641px) {
  .mx-compare-grid { grid-template-columns: 1fr 1fr; gap: 24px; }
  html.mx-on .mx-compare { height: 200vh; height: 200svh; }
  html.mx-on .mx-compare-sticky { position: sticky; top: var(--offset-y, 12vh); }
}

/* Mobile: os dois cards ocupam a mesma célula e o "depois" sobe por cima */
@media (max-width: 640px) {
  html.mx-on .mx-compare { height: 240vh; height: 240svh; }
  html.mx-on .mx-compare-sticky { position: sticky; top: var(--offset-y, 12vh); }
  html.mx-on .mx-compare-grid { grid-template-areas: "stack"; }
  html.mx-on .mx-cmp { grid-area: stack; }
  html.mx-on .mx-cmp--before { transform-origin: 50% 0; }
}

.mx-cmp {
  position: relative;
  border: 1px solid var(--border);
  padding: 36px 32px 28px;
  min-height: 420px;
  display: flex;
  flex-direction: column;
  will-change: transform;
}

.mx-cmp--before {
  background: var(--canvas-3);
  z-index: 1;
}

.mx-cmp--after {
  background:
    radial-gradient(120% 90% at 80% 0%, rgba(200,169,110,0.16), transparent 60%),
    #0b0b0b;
  border-color: rgba(200,169,110,0.45);
  box-shadow: 6px 6px 0 rgba(200,169,110,0.18);
  z-index: 2;
}

.mx-cmp-label {
  font-family: 'Share Tech Mono', monospace;
  font-size: 13px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 12px;
}

.mx-cmp--after .mx-cmp-label { color: var(--gold); }

.mx-cmp-title {
  position: relative;
  font-family: 'Bebas Neue', 'Impact', sans-serif;
  font-weight: 400;
  font-size: clamp(40px, 4.4vw, 64px);
  line-height: 0.92;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  margin-bottom: 28px;
}

.mx-cmp--before .mx-cmp-title { color: rgba(255,255,255,0.55); }
.mx-cmp--after  .mx-cmp-title { color: var(--frost); }

.mx-cmp-squiggle {
  position: absolute;
  left: -4%;
  top: -18%;
  width: 108%;
  height: 136%;
  overflow: visible;
  pointer-events: none;
}

.mx-cmp-squiggle path {
  fill: none;
  stroke: var(--gold);
  stroke-width: 2.5;
  stroke-linecap: square;
}

.mx-cmp-list {
  list-style: none;
  margin-top: auto;
}

.mx-cmp-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  border-top: 1px solid var(--border);
  font-family: 'Share Tech Mono', monospace;
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.55);
}

.mx-cmp--after .mx-cmp-list li { color: rgba(255,255,255,0.85); }

.mx-check {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  background: var(--pixel-green);
  color: #000;
}

.mx-cross {
  flex: 0 0 auto;
  color: #a52d25;
  font-size: 16px;
  line-height: 1;
}

/* ── RESPONSIVE ──────────────────────────────────────────────── */
@media (max-width: 640px) {
  .mx-ticker { padding: 18px 0; }
  .mx-cmp { min-height: 0; padding: 28px 22px 20px; }
  .mx-compare { margin-top: 48px; }
}
