/* ==========================================================================
   Base: reset, tipografia, régua de alinhamento, ambiente e componentes
   ========================================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-top) + var(--header-h) + 24px);
  color-scheme: dark;
  background: var(--void);
}

body {
  position: relative;
  margin: 0;
  min-height: 100vh;
  overflow-x: clip;
  /* transparente: o fundo fica no <html>. Um fundo opaco aqui cobriria as luzes das seções e
     a vinheta (z-index negativo), porque o body é posicionado. */
  background: transparent;
  color: var(--frost);
  font-family: var(--font-ui);
  font-size: var(--fs-body);
  font-weight: 400;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

img,
svg,
video,
canvas,
picture {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
}

h1,
h2,
h3,
h4,
p,
figure,
blockquote,
ul,
ol,
dl,
dd {
  margin: 0;
}

h1,
h2,
h3,
h4 {
  font-weight: 400;
  text-wrap: balance;
}

p {
  text-wrap: pretty;
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.25em;
}

button {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

:focus-visible {
  outline: 2px solid var(--volt-hi);
  outline-offset: 3px;
}

::selection {
  background: var(--volt);
  color: var(--frost);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Ambiente contínuo ----------------------------------------------------------
   Uma única camada fixa (vinheta + granulação) atravessa todas as seções.
   As seções não têm fundo próprio; cada uma só acrescenta luzes suaves. */

.atmosphere {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(120% 80% at 50% 0%, transparent 55%, rgb(0 0 0 / 0.55) 100%),
    radial-gradient(70% 50% at 100% 100%, rgb(11 75 156 / 0.08), transparent 70%),
    var(--void);
}

/* neblina (baixa resolução, ampliada) e partículas: js/components/atmosphere.js */
.atmosphere__fog,
.atmosphere__dots {
  position: absolute;
  inset: 0;
  width: 100%;
  max-width: none;
  height: 100%;
  pointer-events: none;
}

.atmosphere::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.9 0'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Luz difusa reaproveitável: um ponto de luz azul que transborda os limites da seção */
.light {
  position: absolute;
  z-index: -1;
  width: var(--size, 60vmax);
  aspect-ratio: 1;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(closest-side, rgb(21 109 220 / var(--strength, 0.16)), rgb(11 75 156 / calc(var(--strength, 0.16) * 0.4)) 45%, transparent 75%);
  transform: translate(-50%, -50%);
}

/* Utilitários ------------------------------------------------------------ */

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: -100px;
  left: 12px;
  z-index: 100;
  padding: 12px 18px;
  border-radius: var(--radius-pill);
  background: var(--frost);
  color: var(--void);
  font-weight: 600;
  text-decoration: none;
}

.skip-link:focus {
  top: 12px;
}

/* A régua: todo conteúdo alinha por aqui (o cabeçalho usa a mesma largura) */
.container {
  width: var(--content-w);
  margin-inline: auto;
}

/* O raio principal (js/components/page-bolt.js) fica entre o fundo e o conteúdo das seções:
   passa atrás de textos, cards e painéis. */
main {
  position: relative;
}

.page-bolt {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
  width: 100%;
  max-width: none;
  overflow: visible;
  pointer-events: none;
}

/* ramos do traço elétrico (js/components/bolt-line.js): desenham-se quando a ponta passa */
.bolt-line__branch path {
  stroke-dasharray: var(--l);
  stroke-dashoffset: var(--l);
  transition: stroke-dashoffset 0.45s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.bolt-line__branch.is-on path {
  stroke-dashoffset: 0;
}

/* pontos de brilho do raio principal: acendem quando a ponta passa e pulsam devagar */
.bolt-line__hot {
  opacity: 0;
  transition: opacity 0.5s ease;
}

.bolt-line__branch.is-on .bolt-line__hot {
  opacity: 1;
  animation: bolt-hot 2.4s ease-in-out var(--d, 0s) infinite;
}

@keyframes bolt-hot {
  0%, 100% { opacity: 0.55; }
  12% { opacity: 1; }
  18% { opacity: 0.4; }
  24% { opacity: 0.9; }
}

@media (prefers-reduced-motion: reduce) {
  .bolt-line__branch path {
    transition: none;
  }

  .bolt-line__branch.is-on .bolt-line__hot {
    animation: none;
    opacity: 0.7;
  }
}

.section > :not(.light):not(.contact__symbol) {
  position: relative;
  z-index: 2;
}

.section {
  position: relative;
  /* as luzes atravessam de uma seção para outra na vertical, mas não criam rolagem lateral */
  overflow-x: clip;
  padding-block: var(--section-y);
}

/* Cabeçalho de seção: título editorial + texto de apoio */
.section-head {
  display: grid;
  gap: 1.5rem;
  align-items: end;
  margin-bottom: var(--stack);
}

@media (min-width: 900px) {
  .section-head {
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
    column-gap: clamp(2rem, 5vw, 5rem);
  }
}

.section-title {
  font-family: var(--font-display);
  font-size: var(--fs-section);
  font-weight: 300;
  line-height: 0.92;
  letter-spacing: -0.015em;
}

.section-title--sm {
  font-size: clamp(2.75rem, 1.6rem + 4vw, 5.25rem);
}

.section-intro {
  display: grid;
  gap: 0.85rem;
  max-width: 44ch;
  color: var(--mist);
}

.section-intro .lead {
  color: var(--frost);
  font-size: var(--fs-lead);
  font-weight: 400;
  line-height: 1.5;
}

/* Botões em cápsula ----------------------------------------------------------
   Contorno azul fino, fundo escuro e brilho controlado. O raio que percorre a borda
   é desenhado num canvas por js/components/button-bolt.js (.btn__bolt). */

.btn {
  --btn-h: 3rem;
  position: relative;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  max-width: 100%;
  min-height: var(--btn-h);
  padding: 0 1.4rem;
  border: 1px solid rgb(29 143 240 / 0.5);
  border-radius: var(--radius-pill);
  background: linear-gradient(180deg, rgb(17 34 66 / 0.6), rgb(4 9 20 / 0.86));
  box-shadow:
    inset 0 1px 0 rgb(234 241 255 / 0.09),
    0 0 0 1px rgb(29 143 240 / 0.06),
    0 8px 26px -14px rgb(29 143 240 / 0.7);
  color: var(--frost);
  font-family: var(--font-ui);
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: 0.005em;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  transition:
    border-color 0.3s var(--ease-out),
    box-shadow 0.3s var(--ease-out),
    background-color 0.3s var(--ease-out),
    transform 0.2s var(--ease-out);
}

.btn:hover {
  border-color: rgb(29 143 240 / 0.95);
  box-shadow:
    inset 0 1px 0 rgb(234 241 255 / 0.14),
    0 0 0 4px rgb(29 143 240 / 0.1),
    0 10px 34px -10px rgb(29 143 240 / 0.85);
}

.btn:active {
  transform: translateY(1px);
}

.btn:focus-visible {
  outline: 2px solid var(--frost);
  outline-offset: 4px;
}

.btn svg {
  flex: none;
  width: 1.15em;
  height: 1.15em;
}

.btn--sm {
  --btn-h: 2.5rem;
  gap: 0.5rem;
  padding: 0 1.05rem;
  font-size: 0.875rem;
}

.btn--lg {
  --btn-h: 3.5rem;
  padding: 0 1.9rem;
  font-size: 1rem;
}

/* Principal: luz azul no topo; o raio animado percorre a borda */
.btn--primary {
  border-color: rgb(29 143 240 / 0.7);
  background:
    radial-gradient(120% 150% at 50% -40%, rgb(29 143 240 / 0.38), transparent 62%),
    linear-gradient(180deg, #0c1a36, #040a17);
}

/* Canvas do raio da borda: passa 12 px da cápsula para caber o brilho e as faíscas.
   (-13 px porque o posicionamento parte de dentro da borda de 1 px) */
.btn__bolt {
  position: absolute;
  top: -13px;
  left: -13px;
  z-index: 1;
  width: calc(100% + 26px);
  max-width: none; /* o reset limita canvas a 100% */
  height: calc(100% + 26px);
  pointer-events: none;
}

/* Secundário: só o contorno */
.btn--ghost {
  border-color: var(--line-strong);
  background: rgb(234 241 255 / 0.02);
  box-shadow: inset 0 1px 0 rgb(234 241 255 / 0.05);
}

.btn--ghost:hover {
  border-color: rgb(29 143 240 / 0.8);
  background: rgb(29 143 240 / 0.06);
  box-shadow: 0 0 0 4px rgb(29 143 240 / 0.08);
}

/* Link de texto com sublinhado azul */
.text-link {
  color: var(--frost);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: var(--volt-hi);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.35em;
  transition: color 0.2s var(--ease-out);
}

.text-link:hover {
  color: var(--volt-hi);
}

/* Botão redondo de ícone */
.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 2.875rem;
  height: 2.875rem;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: rgb(234 241 255 / 0.02);
  color: var(--frost);
  transition: border-color 0.25s var(--ease-out), box-shadow 0.25s var(--ease-out), opacity 0.2s;
}

.icon-btn svg {
  width: 1.15rem;
  height: 1.15rem;
}

.icon-btn:hover:not(:disabled) {
  border-color: rgb(29 143 240 / 0.85);
  box-shadow: 0 0 0 4px rgb(29 143 240 / 0.1), 0 0 22px -6px rgb(29 143 240 / 0.8);
}

.icon-btn:disabled {
  opacity: 0.3;
  cursor: default;
}

/* Etiquetas */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0;
  list-style: none;
}

.chips li {
  padding: 0.28rem 0.8rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-pill);
  background: rgb(234 241 255 / 0.02);
  color: var(--frost-soft);
  font-size: var(--fs-micro);
  font-weight: 500;
  line-height: 1.45;
}

/* Rótulo curto acima de títulos */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--frost-soft);
  font-size: var(--fs-micro);
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

/* Ponto de energia: marcador mínimo, com brilho */
.spark-dot {
  display: inline-block;
  flex: none;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #cfe6ff;
  box-shadow: 0 0 0 3px rgb(29 143 240 / 0.18), 0 0 12px 2px rgb(29 143 240 / 0.75);
}

/* Ícone de linha (traço consistente em todo o site) */
.line-icon {
  width: 1.5rem;
  height: 1.5rem;
  color: var(--volt-hi);
  filter: drop-shadow(0 0 6px rgb(29 143 240 / 0.45));
}

/* Cursor elétrico (js/components/cursor.js): só com mouse e sem "reduzir movimento" */
.cursor-fx {
  position: fixed;
  inset: 0;
  z-index: 250;
  width: 100%;
  max-width: none;
  height: 100%;
  pointer-events: none;
}

/* ponteiro próprio (js/components/cursor.js): a ponta da seta fica exatamente no ponto do mouse */
.cursor-pointer {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 252;
  width: 26px;
  height: 32px;
  margin: -3px 0 0 -3px; /* o viewBox começa em -3, -3: a ponta (0, 0) cai no ponto do mouse */
  pointer-events: none;
  opacity: 0;
  will-change: transform;
  transition: opacity 0.2s ease;
}

.cursor-pointer.is-visible {
  opacity: 1;
}

.cursor-pointer svg {
  display: block;
  overflow: visible;
  transform-origin: 3px 3px;
  transition: transform 0.25s var(--ease-out);
}

.cursor-pointer__body {
  stroke-width: 1.35;
  stroke-linejoin: round;
}

.cursor-pointer__glow {
  fill: none;
  stroke: #1d8ff0;
  stroke-width: 5;
  stroke-linejoin: round;
  opacity: 0.32;
  filter: blur(2.5px);
  transition: opacity 0.25s var(--ease-out), stroke-width 0.25s var(--ease-out);
}

/* traço de luz interno, como um pequeno raio dentro da seta */
.cursor-pointer__spark {
  fill: none;
  stroke: #9fd0ff;
  stroke-width: 0.9;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.75;
}

/* sobre links, botões e cartões: a seta acende e cresce um pouco */
.cursor-pointer.is-hot svg {
  transform: scale(1.12);
}

.cursor-pointer.is-hot .cursor-pointer__glow {
  stroke-width: 7;
  opacity: 0.7;
}

.cursor-pointer.is-hot .cursor-pointer__spark {
  stroke: #ffffff;
  opacity: 1;
}

.cursor-pointer.is-press svg {
  animation: cursor-press 0.32s var(--ease-out);
}

@keyframes cursor-press {
  40% { transform: scale(0.86); }
}

/* descargas de clique e toque (js/components/zap.js) */
.zap-fx {
  position: fixed;
  inset: 0;
  z-index: 251;
  width: 100%;
  max-width: none;
  height: 100%;
  pointer-events: none;
}

.has-cursor,
.has-cursor * {
  cursor: none !important;
}
