/* ============================================================
   BASE — reset, tipografia, fundo tecnológico, utilitários
   ============================================================ */

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

* {
  margin: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  background: var(--navy);
  color: var(--branco);
  font-family: var(--f-texto);
  font-size: var(--t-corpo);
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img,
picture,
svg {
  display: block;
  max-width: 100%;
  /* Sem isto, o atributo height do HTML vira altura fixa e distorce a imagem
     sempre que só a largura for definida no CSS. */
  height: auto;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

a {
  color: var(--ciano);
  text-decoration: none;
  transition: color var(--transicao);
}

a:hover {
  color: var(--magenta);
}

:focus-visible {
  outline: 3px solid var(--ciano);
  outline-offset: 3px;
}

/* ------------------------------------------------------------
   FUNDO TECNOLÓGICO
   Grade + pontilhado discreto. Suporte visual, nunca protagonista.
   ------------------------------------------------------------ */

.fundo-tec {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background-color: var(--navy);
  background-image:
    linear-gradient(var(--linha) 1px, transparent 1px),
    linear-gradient(90deg, var(--linha) 1px, transparent 1px);
  background-size: 64px 64px;
  opacity: 0.35;
  mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 30%, transparent 100%);
}

/* Pontilhado em CSS: emenda perfeita e nenhum byte de imagem */
.fundo-pontos {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background-image: radial-gradient(
    circle at 1px 1px,
    rgba(0, 234, 255, 0.16) 1.4px,
    transparent 1.5px
  );
  background-size: 32px 32px;
}

/* Scanlines de CRT — sutis o suficiente pra não atrapalhar leitura */
.scanlines {
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0 4px,
    rgba(0, 0, 0, 0.14) 4px 5px
  );
  opacity: 0.35;
  mix-blend-mode: multiply;
}

/* ------------------------------------------------------------
   TIPOGRAFIA
   ------------------------------------------------------------ */

.display {
  font-family: var(--f-logo);
  font-size: var(--t-display);
  line-height: 0.9;
  letter-spacing: 0.01em;
  text-transform: uppercase;
}

.titulo-secao {
  font-family: var(--f-titulo);
  font-size: var(--t-h2);
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.subtitulo {
  font-family: var(--f-texto);
  font-weight: 600;
  font-size: var(--t-tag);
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--ciano);
}

.texto {
  color: var(--texto-suave);
  max-width: 62ch;
}

.ciano {
  color: var(--ciano);
}

.magenta {
  color: var(--magenta);
}

/* ------------------------------------------------------------
   GRAMÁTICA VISUAL DA MARCA
   //  encerramento    [ ]  enquadramento    >  navegação
   ------------------------------------------------------------ */

/* Barras duplas — assinala fim de título ou destaque */
.barras::after {
  content: "//";
  color: var(--magenta);
  margin-left: 0.15em;
}

.barras-ciano::after {
  content: "//";
  color: var(--ciano);
  margin-left: 0.15em;
}

/* Colchetes — enquadra categorias e seções */
/* inline, não inline-flex: assim os colchetes acompanham a quebra de linha
   em vez de virarem itens soltos nas pontas */
.tag {
  display: inline;
  font-family: var(--f-texto);
  font-weight: 600;
  font-size: var(--t-tag);
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--ciano);
}

.tag::before {
  content: "[\00a0";
}

.tag::after {
  content: "\00a0]";
}

.tag--magenta {
  color: var(--magenta);
}

/* Maior-que — bullet point da identidade */
.lista-hud {
  list-style: none;
  padding: 0;
  display: grid;
  gap: var(--e-2);
}

.lista-hud > li {
  position: relative;
  padding-left: 1.6em;
  color: var(--texto-suave);
}

.lista-hud > li::before {
  content: ">";
  position: absolute;
  left: 0;
  top: 0;
  font-family: var(--f-titulo);
  color: var(--ciano);
}

.lista-hud > li:nth-child(even)::before {
  color: var(--magenta);
}

/* ------------------------------------------------------------
   BOXES E CONTAINERS
   ------------------------------------------------------------ */

.container {
  width: 100%;
  max-width: var(--largura-max);
  margin-inline: auto;
  padding-inline: var(--e-3);
}

.secao {
  position: relative;
  padding-block: var(--secao-y);
  /* Impede que a nav grudenta cubra o título ao pular por âncora */
  scroll-margin-top: calc(var(--nav-h) + var(--e-2));
}

.box {
  background: var(--navy-alto);
  border: var(--borda) solid var(--ciano);
  border-radius: var(--raio);
  padding: var(--e-4);
  box-shadow: 0 0 0 1px rgba(0, 234, 255, 0.1), 0 0 28px -12px var(--ciano-glow);
}

.box--magenta {
  border-color: var(--magenta);
  box-shadow: 0 0 0 1px rgba(250, 62, 121, 0.1), 0 0 28px -12px var(--magenta-glow);
}

/* ------------------------------------------------------------
   BOTÕES
   ------------------------------------------------------------ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6em;
  font-family: var(--f-titulo);
  font-size: clamp(1.05rem, 2.2vw, 1.35rem);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.85em 1.8em;
  border: var(--borda) solid var(--ciano);
  border-radius: var(--raio-p);
  background: transparent;
  color: var(--ciano);
  cursor: pointer;
  transition: background var(--transicao), color var(--transicao),
    box-shadow var(--transicao), transform var(--transicao);
}

.btn:hover,
.btn:focus-visible {
  background: var(--ciano);
  color: var(--navy);
  box-shadow: 0 0 30px -6px var(--ciano-glow);
  transform: translateY(-2px);
}

.btn--primario {
  background: var(--magenta);
  border-color: var(--magenta);
  color: var(--branco);
}

.btn--primario:hover,
.btn--primario:focus-visible {
  background: var(--branco);
  border-color: var(--branco);
  color: var(--navy);
  box-shadow: 0 0 34px -6px var(--magenta-glow);
}

/* ------------------------------------------------------------
   GLITCH — logo e títulos de impacto
   Duas cópias deslocadas em ciano e magenta, como na marca.
   ------------------------------------------------------------ */

.glitch {
  position: relative;
  display: inline-block;
}

.glitch::before,
.glitch::after {
  content: attr(data-texto);
  position: absolute;
  inset: 0;
  pointer-events: none;
  clip-path: inset(0 0 100% 0);
}

.glitch::before {
  color: var(--magenta);
  transform: translate(-3px, 1px);
}

.glitch::after {
  color: var(--ciano);
  transform: translate(3px, -1px);
}

.glitch:hover::before,
.glitch.glitch--ativo::before {
  animation: glitch-fatia 700ms steps(3, end) infinite;
}

.glitch:hover::after,
.glitch.glitch--ativo::after {
  animation: glitch-fatia 700ms steps(3, end) infinite reverse;
}

@keyframes glitch-fatia {
  0%   { clip-path: inset(85% 0 5% 0); }
  20%  { clip-path: inset(10% 0 80% 0); }
  40%  { clip-path: inset(55% 0 30% 0); }
  60%  { clip-path: inset(25% 0 65% 0); }
  80%  { clip-path: inset(70% 0 15% 0); }
  100% { clip-path: inset(40% 0 50% 0); }
}

/* ------------------------------------------------------------
   REVEAL ON SCROLL
   ------------------------------------------------------------ */

.revelar {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 600ms ease, transform 600ms cubic-bezier(0.2, 0.7, 0.3, 1);
}

.revelar.visivel {
  opacity: 1;
  transform: none;
}

/* ------------------------------------------------------------
   ACESSIBILIDADE
   ------------------------------------------------------------ */

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

.pular-para-conteudo {
  position: absolute;
  top: -100px;
  left: var(--e-2);
  z-index: 100;
  background: var(--ciano);
  color: var(--navy);
  padding: 0.6em 1em;
  border-radius: var(--raio-p);
  font-weight: 700;
  transition: top var(--transicao);
}

.pular-para-conteudo:focus {
  top: var(--e-2);
}

@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;
  }

  .scanlines,
  .glitch::before,
  .glitch::after {
    display: none;
  }

  .revelar {
    opacity: 1;
    transform: none;
  }
}
