/* ══════════════════════════════════════════════════════════════
   MAGIC 3D — base.css
   Tokens, reset, tipografia, navegação, loader, hero, cursor
   ══════════════════════════════════════════════════════════════ */

/* ─────────────── TOKENS ─────────────── */
:root {
  /* cores da marca */
  --roxo-profundo: #191627;   /* background principal */
  --roxo-profundo-2: #1F1B33; /* painéis */
  --roxo-profundo-3: #262042; /* realces de superfície */
  --magic-purple: #7B5CFF;    /* primária */
  --magic-purple-dim: #5B41C8;
  --magic-purple-cta: #6C4CF0;   /* fundo de botão com texto branco — AA 5,3:1 */
  --magic-purple-deep: #5E3FE8;  /* hover do botão sólido */
  --magic-purple-soft: #8A6FFF;  /* roxo para TEXTO sobre fundo escuro — AA */
  --spark-yellow: #FFC845;    /* acento (máx. ~5%) */
  --branco: #FFFFFF;
  --cinza-nevoa: #9A96A8;

  --hairline: rgba(255, 255, 255, .08);
  --hairline-strong: rgba(255, 255, 255, .16);
  --hairline-purple: rgba(123, 92, 255, .38);

  /* tipografia */
  --font-display: 'Poppins', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-body: 'Poppins', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;

  /* escala fluida */
  --fs-hero: clamp(2.4rem, 7.4vw, 6.2rem);
  --fs-h2: clamp(1.9rem, 4.6vw, 3.6rem);
  --fs-h3: clamp(1.35rem, 2.5vw, 2.1rem);
  --fs-lead: clamp(1rem, 1.5vw, 1.22rem);
  --fs-body: clamp(.95rem, 1.1vw, 1.03rem);
  --fs-mono: clamp(.66rem, .82vw, .76rem);

  /* layout */
  --gutter: clamp(20px, 5vw, 84px);
  --maxw: 1440px;
  --radius: 3px;                /* cantos técnicos, nunca "SaaS" */
  --nav-h: 74px;

  /* movimento */
  --ease: cubic-bezier(.22, .61, .36, 1);
  --dur: .6s;
}

/* ─────────────── RESET ─────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: auto; }
body {
  margin: 0;
  background: var(--roxo-profundo);
  color: var(--branco);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  font-weight: 300;
  line-height: 1.65;
  letter-spacing: .002em;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body.is-loading { overflow: hidden; }
img, svg, canvas { display: block; max-width: 100%; }
img { height: auto; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4, p, figure, blockquote, dl, dd { margin: 0; }

/* ── [hidden] SEMPRE esconde, em qualquer largura de tela ──
   Sem esta regra, elementos com `hidden` mas com `display` definido no CSS
   (ex.: `.menu { display: flex }`) continuavam renderizados e INVISÍVEIS —
   cobrindo a tela inteira e capturando todos os cliques da página
   (era a causa dos botões que "voltavam para o hero": o clique nunca
   chegava ao botão, caía nos links do menu). Regra global de propósito. */
[hidden] { display: none !important; }
ul, ol { margin: 0; padding: 0; list-style: none; }
em { font-style: normal; }
::selection { background: var(--magic-purple-cta); color: #fff; }
:focus-visible { outline: 2px solid var(--spark-yellow); outline-offset: 3px; }

.defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.skip {
  position: fixed; top: 10px; left: 10px; z-index: 200;
  transform: translateY(-160%);
  background: var(--magic-purple-cta); color: #fff;
  padding: 10px 16px; border-radius: var(--radius);
  font-family: var(--font-mono); font-size: 12px; letter-spacing: .06em;
  transition: transform .25s var(--ease);
}
.skip:focus { transform: translateY(0); }

/* ─────────────── TIPOGRAFIA ─────────────── */
.mono {
  font-family: var(--font-mono);
  font-size: var(--fs-mono);
  font-weight: 400;
  letter-spacing: .16em;
  text-transform: uppercase;
  line-height: 1.4;
}
.eyebrow {
  color: var(--magic-purple-soft);
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 22px;
}
.eyebrow::before {
  content: ""; width: 26px; height: 1px; background: currentColor; opacity: .8;
}
h1, h2, h3 { font-weight: 600; line-height: 1.03; letter-spacing: -.028em; }
h2 em, h3 em { color: var(--spark-yellow); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }
p { color: var(--cinza-nevoa); }
strong { color: var(--branco); font-weight: 500; }

/* ─────────────── CAMADAS DE ATMOSFERA ─────────────── */
.grain {
  position: fixed; inset: 0; z-index: 90; pointer-events: none;
  opacity: .30; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='.55'/%3E%3C/svg%3E");
}
.rules { position: fixed; inset: 0; z-index: 1; pointer-events: none; }
.rules i {
  position: absolute; top: 0; bottom: 0; left: var(--x); width: 1px;
  background: linear-gradient(180deg, transparent, rgba(255,255,255,.05) 18%, rgba(255,255,255,.05) 82%, transparent);
}

/* ─────────────── CURSOR ─────────────── */
.cursor { position: fixed; top: 0; left: 0; z-index: 120; pointer-events: none; opacity: 0; }
.cursor span {
  position: absolute; top: 0; left: 0;
  width: 26px; height: 26px; margin: -13px 0 0 -13px;
  border: 1px solid var(--magic-purple); border-radius: 50%;
  transition: width .28s var(--ease), height .28s var(--ease), margin .28s var(--ease),
              background-color .28s var(--ease), border-color .28s var(--ease);
}
.cursor.is-on { opacity: 1; }
.cursor.is-link span {
  width: 54px; height: 54px; margin: -27px 0 0 -27px;
  background: rgba(123, 92, 255, .16); border-color: var(--spark-yellow);
}
@media (hover: none), (pointer: coarse) { .cursor { display: none; } }

/* ─────────────── BOTÕES ─────────────── */
.btn {
  --btn-bg: transparent;
  position: relative; display: inline-flex; align-items: center; gap: 10px;
  padding: 15px 22px; border-radius: var(--radius);
  font-family: var(--font-mono); font-size: var(--fs-mono);
  letter-spacing: .14em; text-transform: uppercase; white-space: nowrap;
  border: 1px solid var(--hairline-strong); background: var(--btn-bg);
  transition: background-color .3s var(--ease), color .3s var(--ease),
              border-color .3s var(--ease), transform .3s var(--ease);
}
.btn svg { width: 16px; height: 16px; }
.btn:hover { transform: translateY(-2px); border-color: var(--magic-purple); }
.btn--solid {
  background: var(--magic-purple-cta); border-color: var(--magic-purple-cta); color: #fff;
}
.btn--solid:hover { background: var(--magic-purple-deep); border-color: var(--magic-purple-deep); }
.btn--ghost:hover { background: rgba(123, 92, 255, .12); color: #fff; border-color: var(--hairline-purple); }
.btn--pulse::after {
  content: ""; position: absolute; inset: -1px; border-radius: var(--radius);
  border: 1px solid var(--spark-yellow); opacity: 0;
  animation: ctaPulse 3s var(--ease) infinite; pointer-events: none;
}
@keyframes ctaPulse {
  0%   { opacity: .0; transform: scale(1); }
  18%  { opacity: .9; transform: scale(1); }
  60%  { opacity: 0; transform: scale(1.14); }
  100% { opacity: 0; transform: scale(1.14); }
}
.link {
  color: var(--cinza-nevoa); border-bottom: 1px solid transparent;
  transition: color .3s var(--ease), border-color .3s var(--ease);
}
.link:hover { color: var(--branco); border-color: var(--spark-yellow); }

/* ─────────────── LOADER ─────────────── */
.loader {
  position: fixed; inset: 0; z-index: 150;
  display: grid; place-items: center;
  background: var(--roxo-profundo);
  transition: opacity .8s var(--ease), visibility .8s;
}
.loader.is-done { opacity: 0; visibility: hidden; }
.loader__inner { width: min(360px, 74vw); text-align: center; }
.loader__spark {
  width: 92px; height: 92px; margin: 0 auto 34px;
  color: var(--magic-purple);
  animation: sparkPulse 1.9s var(--ease) infinite;
}
@keyframes sparkPulse {
  0%, 100% { transform: scale(.86) rotate(-4deg); opacity: .55; }
  50%      { transform: scale(1.06) rotate(4deg); opacity: 1; }
}
.loader__meta {
  display: flex; justify-content: space-between; align-items: baseline;
  color: var(--cinza-nevoa); margin-bottom: 12px;
}
.loader__bar { height: 2px; background: rgba(255,255,255,.10); overflow: hidden; }
.loader__bar i { display: block; height: 100%; width: 0%; background: var(--magic-purple); }
.loader__hint { color: var(--cinza-nevoa); margin-top: 14px; }

/* ─────────────── NAV ─────────────── */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--nav-h);
  display: flex; align-items: center; gap: clamp(16px, 3vw, 46px);
  padding: 0 var(--gutter);
  background: linear-gradient(180deg, rgba(25,22,39,.94), rgba(25,22,39,.55) 72%, rgba(25,22,39,0));
  transition: background-color .4s var(--ease), border-color .4s var(--ease), transform .5s var(--ease);
  border-bottom: 1px solid transparent;
}
.nav.is-stuck {
  background: rgba(25, 22, 39, .88);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom-color: var(--hairline);
}
.nav.is-hidden { transform: translateY(-102%); }
.nav__brand { display: flex; align-items: center; gap: 12px; }
.nav__spark { width: 26px; height: 26px; color: var(--magic-purple); flex: none; }
.nav__wordmark img { height: 30px; width: auto; }
.nav__links { display: flex; gap: 30px; margin-left: auto; }
.nav__links a {
  position: relative; font-size: .82rem; font-weight: 400; color: var(--cinza-nevoa);
  letter-spacing: .01em; padding: 6px 0;
  transition: color .3s var(--ease);
}
.nav__links a::after {
  content: ""; position: absolute; left: 0; bottom: 0; height: 1px; width: 100%;
  background: var(--magic-purple); transform: scaleX(0); transform-origin: left;
  transition: transform .4s var(--ease);
}
.nav__links a:hover { color: var(--branco); }
.nav__links a:hover::after { transform: scaleX(1); }
.nav__cta { padding: 11px 16px; }

.nav__burger { display: none; width: 44px; height: 44px; position: relative; margin-left: auto; }
.nav__burger i {
  position: absolute; left: 12px; right: 12px; height: 1.5px; background: var(--branco);
  transition: transform .35s var(--ease), opacity .3s var(--ease);
}
.nav__burger i:first-child { top: 19px; }
.nav__burger i:last-child { bottom: 19px; }
.nav__burger[aria-expanded="true"] i:first-child { transform: translateY(6px) rotate(45deg); }
.nav__burger[aria-expanded="true"] i:last-child { transform: translateY(-6px) rotate(-45deg); }

/* menu mobile */
.menu {
  position: fixed; inset: 0; z-index: 98;
  background: var(--roxo-profundo);
  padding: calc(var(--nav-h) + 24px) var(--gutter) var(--gutter);
  display: flex; flex-direction: column; justify-content: space-between;
  opacity: 0; transition: opacity .4s var(--ease);
}
.menu.is-open { opacity: 1; }
.menu nav { display: flex; flex-direction: column; gap: 4px; }
.menu nav a {
  display: flex; align-items: baseline; gap: 16px;
  font-size: clamp(1.7rem, 8vw, 2.6rem); font-weight: 500; letter-spacing: -.02em;
  padding: 12px 0; border-bottom: 1px solid var(--hairline);
}
.menu nav em { color: var(--magic-purple-soft); font-size: .7rem; }
.menu__foot { display: flex; flex-direction: column; gap: 16px; align-items: flex-start; }
.menu__foot .mono { color: var(--cinza-nevoa); }

/* ─────────────── HERO ─────────────── */
.hero {
  position: relative; min-height: 100svh;
  padding: calc(var(--nav-h) + clamp(28px, 6vh, 80px)) var(--gutter) clamp(90px, 12vh, 130px);
  display: flex; align-items: center;
  overflow: hidden;
}
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(58% 48% at 78% 42%, rgba(123,92,255,.20), transparent 68%),
    radial-gradient(30% 26% at 92% 84%, rgba(255,200,69,.07), transparent 70%);
}
.hero__particles { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero__grid {
  position: relative; z-index: 2; width: 100%; max-width: var(--maxw); margin: 0 auto;
  display: grid; grid-template-columns: minmax(0, 1.02fr) minmax(0, .98fr);
  gap: clamp(28px, 5vw, 72px); align-items: center;
}
.hero__copy { max-width: 640px; }
.hero__title {
  font-size: var(--fs-hero); font-weight: 600; line-height: .98;
  letter-spacing: -.035em; margin: 6px 0 26px;
}
.hero__title .letters { display: block; }
.hero__title .letters--accent { color: var(--spark-yellow); }
.hero__title .ltr { display: inline-block; will-change: transform, opacity; }
.hero__sub {
  font-size: var(--fs-lead); color: #C9C6D6; max-width: 46ch; font-weight: 300;
}
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 34px 0 44px; }
.hero__facts {
  display: flex; flex-wrap: wrap; gap: clamp(18px, 3vw, 44px);
  padding-top: 24px; border-top: 1px solid var(--hairline);
}
.hero__facts > div { display: flex; flex-direction: column; align-items: flex-start; }
.hero__facts > div > .fact__icon { display: block; margin-bottom: 5px; }
.hero__facts dt { color: #B4B0C2; margin-bottom: 6px; }
.hero__facts dd { color: var(--branco); font-family: var(--font-body); font-size: .92rem; letter-spacing: 0; }

.hero__mark { position: relative; display: grid; place-items: center; }
.hero__markGlow {
  position: absolute; width: 78%; aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle, rgba(123,92,255,.34), transparent 66%);
  filter: blur(18px);
}
.hero__spark { position: relative; width: min(100%, 520px); color: var(--magic-purple); }
.hero__sparkFill { opacity: 0; }
.hero__sparkDraw { color: var(--magic-purple); stroke-dasharray: 1; stroke-dashoffset: 1; }
.hero__markMeta {
  position: absolute; bottom: -6px; left: 4%; right: 4%;
  display: flex; justify-content: space-between; color: var(--cinza-nevoa); opacity: .8;
}
.hero__scroll {
  position: absolute; left: var(--gutter); bottom: clamp(20px, 4vh, 40px); z-index: 3;
  display: flex; align-items: center; gap: 12px; color: var(--cinza-nevoa);
}
.hero__scroll i { display: block; width: 62px; height: 1px; background: var(--hairline-strong); position: relative; overflow: hidden; }
.hero__scroll i::after {
  content: ""; position: absolute; inset: 0; background: var(--spark-yellow);
  transform: translateX(-100%); animation: scrollHint 2.4s var(--ease) infinite;
}
@keyframes scrollHint {
  0% { transform: translateX(-100%); } 55% { transform: translateX(0); }
  100% { transform: translateX(100%); }
}

/* reveal base (ativado apenas quando há JS) */
.js .reveal-up { opacity: 0; transform: translateY(26px); }

/* ─────────────── CTA FLUTUANTE ─────────────── */
.fab {
  position: fixed; right: clamp(16px, 3vw, 34px); bottom: clamp(16px, 3vw, 34px); z-index: 95;
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 18px; border-radius: 999px;
  background: var(--magic-purple-cta); color: #fff;
  opacity: 0; transform: translateY(18px) scale(.96); pointer-events: none;
  transition: opacity .45s var(--ease), transform .45s var(--ease), background-color .3s var(--ease);
}
.fab.is-on { opacity: 1; transform: none; pointer-events: auto; }
body.is-menu .fab { opacity: 0; pointer-events: none; }   /* menu aberto cobre a tela */
.fab:hover { background: var(--magic-purple-deep); }
.fab svg { width: 20px; height: 20px; }
.fab span { font-size: .62rem; }

/* ─────────────── ACESSIBILIDADE / MOVIMENTO REDUZIDO ─────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .js .reveal-up { opacity: 1; transform: none; }
  .loader__spark { animation: none; }
}

/* ─────────────── RESPONSIVO ─────────────── */
@media (max-width: 1100px) {
  .hero__grid { grid-template-columns: 1fr; }
  .hero__mark { order: -1; margin-bottom: 8px; }
  .hero__spark { width: min(58%, 300px); }
  .hero__markMeta { display: none; }
}
@media (max-width: 760px) {
  /* hero mobile: título, subtítulo e CTA visíveis na primeira tela */
  .hero { padding-top: calc(var(--nav-h) + 18px); padding-bottom: 76px; }
  .hero__mark { margin-bottom: 0; }
  .hero__spark { width: min(46%, 190px); }
  .hero__title { margin: 4px 0 16px; font-size: clamp(2.1rem, 11vw, 2.9rem); }
  .hero__sub { font-size: .98rem; }
  .hero__actions { margin: 22px 0 0; gap: 10px; }
  .hero__facts { margin-top: 26px; padding-top: 18px; gap: 14px 26px; }
  .hero__facts dt { margin-bottom: 2px; }
  .hero__facts dd { font-size: .84rem; }
  .hero__scroll { display: none; }
}
@media (max-width: 1100px) {
  .nav__appLabel { display: none; }
  .nav__app { padding: 10px; }
}
@media (max-width: 900px) {
  .nav__links, .nav__cta { display: none; }
  .nav__burger { display: block; }
  .nav__wordmark img { height: 26px; }
  .menu[hidden] { display: none; }
}

/* ── botão do painel de gestão no cabeçalho ── */
.nav__app {
  display: inline-flex; align-items: center; gap: 8px; flex: none;
  margin-left: 22px; margin-right: 10px;
  padding: 9px 12px; border: 1px solid var(--hairline); border-radius: var(--radius);
  font-family: var(--font-mono); font-size: .58rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--cinza-nevoa);
  transition: color .3s var(--ease), border-color .3s var(--ease), background-color .3s var(--ease);
}
.nav__app svg { width: 13px; height: 13px; opacity: .8; }
.nav__app:hover { color: var(--branco); border-color: var(--hairline-purple); background: rgba(123, 92, 255, .1); }
.nav__appDot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--spark-yellow);
  box-shadow: 0 0 0 2px rgba(255, 200, 69, .18); flex: none;
}
.menu__app { width: 100%; justify-content: center; }

/* ── área do cliente (link de acompanhamento) ── */
.nav__cliente { position: relative; }
.nav__cliente::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -7px; height: 1px;
  background: var(--spark-yellow); transform: scaleX(0); transform-origin: left;
  transition: transform .4s var(--ease);
}
.nav__cliente:hover::after { transform: scaleX(1); }
.nav__cliente:hover { color: var(--spark-yellow); }
.menu__cliente { color: var(--spark-yellow); }
.btn--track { border-color: rgba(255, 200, 69, .34); }
.btn--track:hover { border-color: var(--spark-yellow); color: var(--spark-yellow); }
.footer__equipe { color: #B4B0C2; }
.footer__equipe:hover { opacity: 1; color: var(--spark-yellow); }

/* ─────────────── LENIS (smooth scroll) ─────────────── */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-stopped { overflow: hidden; }
.lenis.lenis-scrolling iframe { pointer-events: none; }

/* ─────────────── ACESSIBILIDADE ─────────────── */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ── botão do painel: no mobile o acesso fica no menu ──
   (no fim do arquivo de propósito: precisa vencer a regra base) */
@media (max-width: 900px) {
  .nav__app { display: none; }
}
