/* Depende de variables.css cargado antes (vía main.css / head-global) */

/* ========== Grid Tron & fondos ========== */
.tron-grid {
  background-image:
    linear-gradient(to right, rgba(0, 242, 234, 0.05) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(0, 242, 234, 0.05) 1px, transparent 1px);
  background-size: 50px 50px;
  perspective: 1000px;
  transform: rotateX(60deg) translateY(-20%);
  mask-image: linear-gradient(to bottom, black, transparent);
}

.tron-grid--static {
  transform: none;
  perspective: none;
  mask-image: none;
  opacity: 0.1;
}

.perspective-grid--legal {
  background-image:
    linear-gradient(to right, rgba(58, 74, 72, 0.1) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(58, 74, 72, 0.1) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(ellipse at center, black, transparent 80%);
}

.perspective-grid--terms {
  background-image:
    linear-gradient(to right, rgba(58, 74, 72, 0.1) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(58, 74, 72, 0.1) 1px, transparent 1px);
  background-size: 50px 50px;
  mask-image: linear-gradient(to bottom, black, transparent);
  transform: perspective(1000px) rotateX(60deg) translateY(-200px);
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
}

/* Partículas (canvas) */
.particles-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

body.is-custom-cursor {
  cursor: none;
}

.cursor-dot {
  position: fixed;
  width: var(--cursor-size);
  height: var(--cursor-size);
  border-radius: 50%;
  border: 1px solid var(--color-primary-container);
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  transition: transform 0.08s ease-out, opacity 0.2s;
  mix-blend-mode: screen;
  opacity: 0.85;
}

.cursor-dot.is-hidden {
  opacity: 0;
}

/* Glitch texto */
.glitch-text {
  text-shadow: 2px 0 var(--color-primary-container), -2px 0 var(--color-secondary-container);
}

.glitch-text--animated .char {
  display: inline-block;
  animation: glitch-shift 3s infinite ease-in-out;
}

@keyframes glitch-shift {
  0%,
  100% {
    transform: translate(0);
  }
  20% {
    transform: translate(-1px, 1px);
  }
  40% {
    transform: translate(1px, -1px);
  }
  60% {
    transform: translate(-1px, -1px);
  }
  80% {
    transform: translate(1px, 1px);
  }
}

/* Energy glow */
.energy-glow,
.btn-energy:hover {
  box-shadow: 0 0 20px rgba(0, 242, 234, 0.3);
}

/* Glass */
.glass-hud {
  background: rgba(19, 19, 24, 0.7);
  backdrop-filter: blur(30px);
}

.glass-panel {
  background: rgba(31, 31, 37, 0.6);
  backdrop-filter: blur(20px);
}

.glass-panel--terms::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--color-primary-container), transparent);
  opacity: 0.3;
}

/* Pulso barras (hero waveform) */
@keyframes bar-pulse {
  0%,
  100% {
    transform: scaleY(1);
  }
  50% {
    transform: scaleY(1.4);
  }
}

.waveform-bar {
  width: 0.25rem;
  border-radius: 1px;
  transform-origin: bottom;
  animation: bar-pulse 1s ease-in-out infinite;
}

.waveform-bar:nth-child(1) {
  animation-duration: 1s;
}
.waveform-bar:nth-child(2) {
  animation-duration: 1.2s;
}
.waveform-bar:nth-child(3) {
  animation-duration: 0.8s;
}
.waveform-bar:nth-child(4) {
  animation-duration: 1.5s;
}
.waveform-bar:nth-child(5) {
  animation-duration: 0.9s;
}
.waveform-bar:nth-child(6) {
  animation-duration: 1.1s;
}
.waveform-bar:nth-child(7) {
  animation-duration: 1.3s;
}

/* Typewriter */
.typewriter {
  overflow: hidden;
  white-space: nowrap;
  border-right: 2px solid var(--color-primary-container);
  animation: typing 4s steps(32, end) forwards, blink-caret 0.7s step-end infinite;
}

@keyframes typing {
  from {
    width: 0;
  }
  to {
    width: 100%;
  }
}

@keyframes blink-caret {
  50% {
    border-color: transparent;
  }
}

/* Reveal on scroll */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Pulse dot hero */
@keyframes pulse-dot {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.4;
  }
}

.hero__pulse-dot {
  animation: pulse-dot 2s ease-in-out infinite;
}
