/* ============================================================
   GLOBAL — Layout, componentes e atmosfera compartilhados
   ============================================================ */

/* ---- Containers ---- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--pad);
}
.container--wide { max-width: var(--container-wide); }

/* ---- Seção base ---- */
.section {
  position: relative;
  padding-block: clamp(4.5rem, 11vw, 8.5rem);
}
.section--tight { padding-block: clamp(3.5rem, 8vw, 6rem); }

/* ============================================================
   ATMOSFERA — grade de pontos, glow radial e ruído sutil
   Aplicada a .atmos (geralmente no <body> ou em seções hero)
   ============================================================ */
.atmos { position: relative; isolation: isolate; }

.atmos::before {
  /* grade de pontos roxos muito sutil */
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background-image: radial-gradient(rgba(157, 78, 221, 0.10) 1px, transparent 1px);
  background-size: 30px 30px;
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 30%, transparent 75%);
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 30%, transparent 75%);
  pointer-events: none;
}

/* glow roxo difuso vindo do topo/canto */
.glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.5;
  pointer-events: none;
  z-index: -1;
}
.glow--tr {
  width: 46vw; height: 46vw; max-width: 620px; max-height: 620px;
  top: -18vw; right: -8vw;
  background: radial-gradient(circle, rgba(157, 78, 221, 0.55), transparent 65%);
}
.glow--bl {
  width: 40vw; height: 40vw; max-width: 520px; max-height: 520px;
  bottom: -16vw; left: -10vw;
  background: radial-gradient(circle, rgba(123, 47, 190, 0.4), transparent 65%);
}

/* textura de ruído fina sobre o canvas (SVG inline em data-uri) */
.noise::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.035;
  mix-blend-mode: screen;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ============================================================
   LABEL TÉCNICO (eyebrow em mono) — assinatura tipográfica
   <span class="eyebrow"><i></i> Categoria</span>
   ============================================================ */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--purple-light);
}
.eyebrow i {
  width: 26px; height: 1px;
  background: var(--purple);
  display: inline-block;
}
.eyebrow--index { color: var(--muted); }
.eyebrow--index b { color: var(--purple-light); font-weight: 700; }

/* ---- Cabeçalho de seção ---- */
.section-head { max-width: 720px; margin-bottom: clamp(2.5rem, 5vw, 4rem); }
.section-head--center { margin-inline: auto; text-align: center; }
.section-head--center .eyebrow { justify-content: center; }

.section-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2rem, 5.2vw, 3.6rem);
  line-height: 0.98;
  letter-spacing: -0.03em;
  margin-top: 1.1rem;
  color: var(--ink);
}
.section-title em {
  font-style: normal;
  color: var(--purple-light);
}
.section-lead {
  margin-top: 1.4rem;
  font-size: clamp(1rem, 1.5vw, 1.15rem);
  color: var(--ink-2);
  max-width: 56ch;
}
.section-head--center .section-lead { margin-inline: auto; }

/* ============================================================
   BOTÕES
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.95rem 1.7rem;
  font-family: var(--font-body);
  font-size: 0.97rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  border-radius: var(--radius-btn);
  position: relative;
  isolation: isolate;
  transition: transform 0.4s var(--ease-out-expo), background 0.3s ease,
              color 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
  white-space: nowrap;
}
.btn svg { width: 1.15em; height: 1.15em; flex-shrink: 0; }
.btn--lg svg { width: 1.2em; height: 1.2em; }

/* fill que sobe de baixo no hover */
.btn--primary {
  background: var(--purple);
  color: #fff;
  box-shadow: 0 10px 30px -8px rgba(157, 78, 221, 0.6);
}
.btn--primary::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, var(--purple-light), var(--purple-dark));
  transform: scaleY(0);
  transform-origin: bottom;
  transition: transform 0.4s var(--ease-out-expo);
}
.btn--primary:hover::before { transform: scaleY(1); }
.btn--primary:hover { box-shadow: 0 16px 40px -8px rgba(157, 78, 221, 0.75); }

.btn--secondary {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}
.btn--secondary::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: rgba(157, 78, 221, 0.12);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s var(--ease-out-expo);
}
.btn--secondary:hover { border-color: var(--purple); color: var(--ink); }
.btn--secondary:hover::before { transform: scaleX(1); }

.btn--lg { padding: 1.1rem 2rem; font-size: 1.02rem; }
.btn--block { width: 100%; }

.btn__arrow { transition: transform 0.4s var(--ease-out-expo); }
.btn:hover .btn__arrow { transform: translateX(4px); }

/* ============================================================
   MARQUEE — tecnologias parceiras
   ============================================================ */
.marquee-section {
  padding-block: clamp(2rem, 4vw, 3rem);
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  background: var(--bg-2);
  overflow: hidden;
}
.marquee-title {
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1.6rem;
}
.marquee {
  position: relative;
  width: 100%;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.marquee__track {
  display: flex;
  width: max-content;
  animation: marquee 34s linear infinite;
}
.marquee:hover .marquee__track { animation-play-state: paused; }
.marquee__item {
  flex: 0 0 auto;
  padding-inline: clamp(1.4rem, 4vw, 3rem);
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 2vw, 1.6rem);
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--muted);
  transition: color 0.3s ease;
  user-select: none;
}
.marquee__item:hover { color: var(--purple-light); }

/* ============================================================
   BARRA DE PROGRESSO DE LEITURA
   ============================================================ */
#progress {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  width: 0;
  z-index: var(--z-progress);
  background: linear-gradient(90deg, var(--purple-dark), var(--purple-light));
  box-shadow: 0 0 12px rgba(157, 78, 221, 0.7);
  transition: width 0.08s linear;
}

/* ============================================================
   PRELOADER
   ============================================================ */
#preloader {
  position: fixed;
  inset: 0;
  z-index: var(--z-transition);
  display: grid;
  place-items: center;
  background: var(--bg);
  transition: opacity 0.5s ease, visibility 0.5s ease;
}
#preloader.is-hidden { opacity: 0; visibility: hidden; }
.preloader__mark {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.4rem;
  letter-spacing: -0.02em;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 0.7rem;
}
.preloader__mark .brand-hub { color: var(--purple-light); }
.mark-inline { height: 30px; width: auto; display: block; flex-shrink: 0; }
#page-transition .mark-inline { height: 34px; }
.preloader__dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--purple);
  animation: pulse-dot 1s ease-in-out infinite;
}

/* ============================================================
   BACK TO TOP
   ============================================================ */
#back-to-top {
  position: fixed;
  right: 1.4rem; bottom: 1.4rem;
  z-index: var(--z-nav);
  width: 50px; height: 50px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--purple);
  color: #fff;
  box-shadow: 0 10px 30px -6px rgba(157, 78, 221, 0.6);
  opacity: 0; visibility: hidden;
  transform: translateY(16px) scale(0.9);
  transition: var(--transition);
}
#back-to-top.is-visible { opacity: 1; visibility: visible; transform: none; }
#back-to-top:hover { background: var(--purple-dark); transform: translateY(-3px); }

/* ---- Helper acessível ---- */
.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;
}

/* ---- Skip link ---- */
.skip-link {
  position: fixed;
  top: -60px; left: 1rem;
  z-index: var(--z-cursor);
  background: var(--purple);
  color: #fff;
  padding: 0.7rem 1.1rem;
  border-radius: var(--radius-btn);
  font-weight: 600;
  transition: top 0.2s ease;
}
.skip-link:focus { top: 1rem; }
