* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: auto;
  background-color: #071821;
  color: #e0f8cf;
  font-family: 'IBM Plex Mono', monospace;
  overflow-x: hidden;
  min-height: 100vh; /* só o necessário */
}
body {
  margin: 0;
  padding: 0;
  background-color: #071821;
  overflow-x: hidden;
}
body::after {
  content: none;
  display: block;
  height: auto; /* força scroll vertical */
}


section {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 1000;
  /* justify-content: center; */
  text-align: center;
  padding: 2rem;
}


.glitch {
  position: relative;
  color: #306850;
  font-family: 'IBM Plex Mono', monospace;
  z-index: 1000;
  font-size: 4rem;
  animation: glitch-skew var(--duration, 2s) infinite linear alternate;
  line-height: 0.5; /* reduz a altura da linha */
}

.glitch::before,
.glitch::after {
  content: attr(data-text);
  line-height: 0.5; /* Igual ao do .glitch */
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1000;
  width: 100%;
  overflow: hidden;
  color: #cceccc;
  background: transparent;
  clip: rect(0, 900px, 0, 0);
}
.glitch::before {
  left: 2px;
  z-index: 1000;
  text-shadow: -2px 0 rgba(0, 255, 8, 0.659);
  animation: glitch-top var(--duration, 2s) infinite linear alternate-reverse;
}

.glitch::after {
  left: -2px;
  z-index: 1000;
  text-shadow: -2px 0 rgba(13, 255, 0, 0.236);
  animation: glitch-bottom var(--duration, 2s) infinite linear alternate;
}

/* Glitch animation keyframes */
@keyframes glitch-top {
  0% {
    clip: rect(0, 9999px, 0, 0);
    transform: translate(0);
  }
  10% {
    clip: rect(10px, 9999px, 30px, 0);
    transform: translate(-2px, -2px);
  }
  50% {
    clip: rect(5px, 9999px, 20px, 0);
    transform: translate(2px, 2px);
  }
  100% {
    clip: rect(0, 9999px, 0, 0);
    transform: translate(0);
  }
}

@keyframes glitch-bottom {
  0% {
    clip: rect(0, 9999px, 0, 0);
    transform: translate(0);
  }
  20% {
    clip: rect(15px, 9999px, 40px, 0);
    transform: translate(3px, -1px);
  }
  60% {
    clip: rect(8px, 9999px, 25px, 0);
    transform: translate(-1px, 3px);
  }
  100% {
    clip: rect(0, 9999px, 0, 0);
    transform: translate(0);
  }
}

@keyframes glitch-skew {
  0% {
    transform: skew(0deg);
  }
  25% {
    transform: skew(5deg);
  }
  50% {
    transform: skew(-5deg);
  }
  75% {
    transform: skew(3deg);
  }
  100% {
    transform: skew(0deg);
  }
}

.glitchtitulo {
  display: inline-block;
  position: relative;
  color: #e0f8cf;
  font-family: monospace;
  font-weight: bold;
  text-transform: uppercase;
  z-index: 1000;
}

.glitchtitulo::before,
.glitchtitulo::after {
  content: attr(data-text);
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  z-index: 1000;
  overflow: hidden;
  color:  #306850;
  clip-path: inset(0 0 0 0);
  pointer-events: none;
}

.glitchtitulo::before {
  animation: glitchTop 2s infinite linear;
  left: 1px;
  text-shadow: 1px 0 rgba(0, 255, 8, 0.614);
}
.glitchtitulo::after {
  animation: glitchBottom 1.5s infinite linear;
  left: -1px;
  text-shadow: -1px 0 rgb(26, 255, 0);
}

@keyframes glitchTop {
  0% { clip-path: inset(0 0 90% 0); }
  10% { clip-path: inset(10% 0 80% 0); }
  20% { clip-path: inset(5% 0 60% 0); }
  30% { clip-path: inset(0 0 50% 0); }
  100% { clip-path: inset(0 0 90% 0); }
}

@keyframes glitchBottom {
  0% { clip-path: inset(90% 0 0 0); }
  10% { clip-path: inset(80% 0 10% 0); }
  20% { clip-path: inset(60% 0 5% 0); }
  30% { clip-path: inset(50% 0 0 0); }
  100% { clip-path: inset(90% 0 0 0); }
}



.glitch-paragraph {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 1.5rem;
  max-width: 800px;
  line-height: 1.6;
  color: #e0f8cf;
  margin-top: 1rem;
  white-space: normal;
  hyphens:none;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
  letter-spacing: normal;
  z-index: 100000;
  /* JUSTIFY */
  text-align:justify;
  /* Essa linha faz o último espaço de cada linha "esticar" para justificar 
  text-justify: inter-word;
  word-break: break-all;
  /* Esse truque adiciona um pseudo-elemento no final para forçar o browser justificar */
}

.glitch-paragraph::after {
  content: "";
  display: inline-block;
  width: 100%;
  z-index: 1000;
  hyphens: none;
}

.glitch-letter {
  display: inline-block;
  transition: color 0.2s ease;
  cursor: default;
  z-index: 1000;
}
#screen {
  position: fixed; /* ou absolute, dependendo do comportamento desejado */
  top: 0;
  left: 0;
  opacity: 0.75;
  width: 100%;
  height: 100%;
  z-index: 999999999; /* garante que a div ficará sobre os outros elementos */
  background-color: #07182105; /* Fundo semitransparente */
  pointer-events: none; /* Não bloqueia interação com outros elementos */

}

#scan {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
}

#terminal {
  font-family: 'IBM Plex Mono', monospace;
  color: #e0f8cf;
  background-color: #071821;
  padding: 0.5rem 1rem;
  width: 100%;
  height: 100vh;
  overflow-y: auto;
  border-top: 2px solid #306850; /* em vez de border-bottom */
  position: fixed;
  bottom: 0; /* <-- aqui está a alteração principal */
  left: 0;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}


#terminal-log {
  flex-grow: 1;
  overflow-y: auto;
  margin-bottom: 0.5rem;
}

#terminal input {
  background: none;
  border: none;
  border-top: 1px solid #306850;
  color: #e0f8cf;
  font: inherit;
  width: 100%;
  outline: none;
  padding: 0.5rem 0;
}
#ascii-art {
  position: absolute;
  top: 50%;
  left: 51%;
  transform: translate(-50%, -50%);
  font-family: 'VT323', monospace;
  text-align: center;
  white-space: pre;
  line-height: 1.2;
  font-size: 1rem;
  color: #cceccc;
  z-index: 10;
  pointer-events: none; /* garante que não interfere com cliques */
}


.terminal-welcome {
  font-family: 'VT323', monospace;
  color: #cceccc;
  margin: 0;           /* Remove margens padrão */
  padding-bottom: 20px; /* Dá um espaço interno embaixo */
}

#inicio{
  top: 150px;
  z-index: 1000;
}
#info{
  top: 150px;
  z-index: 1000;
}
.inicio, .titulo, #info {
  display: none; /* só aparecem depois do 'start' */
  font-family: 'IBM Plex Mono', monospace; /* ou a fonte que estás a usar */
  text-align: center;
  letter-spacing: 0.08em;
  z-index: 1000;
  line-height: 1;
  max-width: 80ch;
  margin: 2rem auto;
  white-space: pre-wrap; /* importante para manter quebras e espaços */
}
.visible-section {
  display: block !important;
}
.glitch-word {
  display: inline-block;
  margin-right: 0; /* controla o espaçamento entre palavras */
}
body.modo-colapso {
  background-color: black !important;
  color: #ff4444;
  animation: shake 0.05s infinite;
  overflow: hidden;
  position: relative;
}

@keyframes shake {
  0% { transform: translate(1px, 1px); }
  25% { transform: translate(-1px, 2px); }
  50% { transform: translate(2px, -2px); }
  75% { transform: translate(-2px, 1px); }
  100% { transform: translate(1px, -1px); }
}

canvas#canvas-glitch {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 9999;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  mix-blend-mode: difference;
}

.erro-terminal {
  color: #ff5555;
  font-family: monospace;
  font-size: 1.2rem;
  animation: blink 0.2s infinite alternate;
}

@keyframes blink {
  from { opacity: 1; }
  to { opacity: 0.1; }
}
@keyframes flicker {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.2; }
}

#chaos-container span {
  animation: flicker 0.1s infinite alternate;
}

.video-background {
  position: fixed; /* ou absolute, se preferires */
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  z-index: 1; /* menor que os textos */
  overflow: hidden;
  pointer-events: none;
}

.video-background video {
  object-fit: contain;
  object-position: top center;
  width: 52vw;
  height: auto;
  position: absolute;
  top: 0%;
  left: 50%;
  transform: translateX(-50%);
  opacity: 0.35;
  filter: invert(0);
  filter:
    sepia(45%)           /* dá um tom amarelado */
    saturate(200%)       /* aumenta saturação para destacar cor */
    hue-rotate(70deg)    /* muda a tonalidade para verde-amarelado */
    brightness(.9)      /* deixa um pouco mais claro */
    contrast(1.2);       /* aumenta o contraste */
 

  /* Fade só nas laterais - corrigido */
  -webkit-mask-image: linear-gradient(to right,
    transparent 0%,
    black 10%,
    black 90%,
    transparent 100%
  );
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-size: 100% 100%;

  mask-image: linear-gradient(to right,
    transparent 0%,
    black 10%,
    black 90%,
    transparent 100%
  );
  mask-repeat: no-repeat;
  mask-size: 100% 100%;
  pointer-events: none;
}

  

:root {
  --z-base: 100;
  --z-overlay: 500;
  --z-terminal: 1000;
  --z-screen: 1100;
}
.glitch,
.glitchtitulo,
.glitch-paragraph {
  position: relative;
  z-index: 10; /* mais alto que o vídeo */
}

.custom-link {
  font-family: 'OCRA', monospace;
  color: #00ff00;
  text-decoration: none;
  border-bottom: 1px dashed #00ff00;
  transition: all 0.3s ease-in-out;
}

.custom-link:hover {
  color: #86c06c;
  border-bottom: 1px solid #86c06c;
  text-shadow: 0 0 3px #00ff00;
}
.referencia {
  font-family: 'OCRA', monospace;
  font-size: 1rem;
  color: #e0f8cf;
  text-align: justify;
  margin: 2rem 0;
  line-height: 1.6;
  max-width: 800px;
  margin-left: auto;
}
