*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #030008;
  --neon-pink: #ff2d6a;
  --neon-cyan: #00f5ff;
  --neon-purple: #b84dff;
  --neon-gold: #ffd447;
  --text: #f8f4ff;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  font-family: "Bebas Neue", "Orbitron", system-ui, sans-serif;
  color: var(--text);
  cursor: crosshair;
}

#particles,
#matrix {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

#matrix {
  opacity: 0.22;
  mix-blend-mode: screen;
  z-index: 1;
}

#particles {
  z-index: 2;
}

.vignette {
  position: fixed;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background: radial-gradient(
    ellipse 70% 60% at 50% 50%,
    transparent 0%,
    rgba(3, 0, 8, 0.4) 55%,
    rgba(3, 0, 8, 0.95) 100%
  );
}

.scanlines {
  position: fixed;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.15) 2px,
    rgba(0, 0, 0, 0.15) 4px
  );
  animation: scanMove 8s linear infinite;
}

@keyframes scanMove {
  0% { transform: translateY(0); }
  100% { transform: translateY(4px); }
}

.noise {
  position: fixed;
  inset: -50%;
  z-index: 5;
  pointer-events: none;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: noiseShift 0.5s steps(2) infinite;
}

@keyframes noiseShift {
  0% { transform: translate(0, 0); }
  50% { transform: translate(-2%, 1%); }
  100% { transform: translate(1%, -2%); }
}

.orbs {
  position: fixed;
  inset: 0;
  z-index: 6;
  pointer-events: none;
  overflow: hidden;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  animation: orbFloat 12s ease-in-out infinite;
}

.orb-1 {
  width: 320px;
  height: 320px;
  background: var(--neon-pink);
  top: 10%;
  left: 15%;
  opacity: 0.35;
  animation-delay: 0s;
}

.orb-2 {
  width: 280px;
  height: 280px;
  background: var(--neon-cyan);
  bottom: 20%;
  right: 10%;
  opacity: 0.3;
  animation-delay: -3s;
}

.orb-3 {
  width: 200px;
  height: 200px;
  background: var(--neon-purple);
  top: 50%;
  right: 30%;
  opacity: 0.25;
  animation-delay: -6s;
}

.orb-4 {
  width: 180px;
  height: 180px;
  background: var(--neon-gold);
  bottom: 35%;
  left: 25%;
  opacity: 0.2;
  animation-delay: -9s;
}

@keyframes orbFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -40px) scale(1.1); }
  66% { transform: translate(-20px, 25px) scale(0.95); }
}

.rings {
  position: fixed;
  inset: 0;
  z-index: 7;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid transparent;
}

.ring-1 {
  width: min(90vw, 700px);
  height: min(90vw, 700px);
  border-color: rgba(255, 45, 106, 0.15);
  animation: ringPulse 4s ease-in-out infinite, ringSpin 30s linear infinite;
}

.ring-2 {
  width: min(75vw, 580px);
  height: min(75vw, 580px);
  border-color: rgba(0, 245, 255, 0.12);
  animation: ringPulse 4s ease-in-out infinite 0.5s, ringSpin 22s linear infinite reverse;
}

.ring-3 {
  width: min(60vw, 460px);
  height: min(60vw, 460px);
  border-color: rgba(184, 77, 255, 0.18);
  border-style: dashed;
  animation: ringPulse 3s ease-in-out infinite 1s, ringSpin 18s linear infinite;
}

@keyframes ringPulse {
  0%, 100% { transform: scale(1); opacity: 0.6; }
  50% { transform: scale(1.04); opacity: 1; }
}

@keyframes ringSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.stage {
  position: relative;
  z-index: 10;
  width: 100%;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  perspective: 1200px;
}

.hero {
  position: relative;
  text-align: center;
  transform-style: preserve-3d;
  transition: transform 0.1s ease-out;
}

.hero-glow {
  position: absolute;
  inset: -40% -20%;
  background: radial-gradient(
    ellipse at center,
    rgba(255, 45, 106, 0.25) 0%,
    rgba(0, 245, 255, 0.08) 40%,
    transparent 70%
  );
  filter: blur(40px);
  animation: glowPulse 2s ease-in-out infinite;
  pointer-events: none;
}

@keyframes glowPulse {
  0%, 100% { opacity: 0.7; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.08); }
}

.headline {
  position: relative;
  font-family: "Bebas Neue", sans-serif;
  font-size: clamp(2.5rem, 12vw, 8rem);
  line-height: 0.95;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.layer {
  display: block;
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: max-content;
}

.layer-base {
  color: transparent;
  -webkit-text-stroke: 1px rgba(255, 255, 255, 0.08);
  z-index: 1;
}

.layer-glitch {
  opacity: 0;
  z-index: 2;
  pointer-events: none;
}

.layer-glitch.r {
  color: #ff0040;
  animation: glitchR 3s infinite;
}

.layer-glitch.g {
  color: #00ff88;
  animation: glitchG 2.5s infinite;
}

.layer-glitch.b {
  color: #0088ff;
  animation: glitchB 2.8s infinite;
}

.headline.glitch-active .layer-glitch {
  opacity: 0.85;
}

@keyframes glitchR {
  0%, 90%, 100% { clip-path: inset(0 0 100% 0); transform: translate(-50%, -50%); }
  91% { clip-path: inset(10% 0 60% 0); transform: translate(calc(-50% - 4px), calc(-50% + 2px)); }
  93% { clip-path: inset(50% 0 20% 0); transform: translate(calc(-50% + 3px), calc(-50% - 1px)); }
  95% { clip-path: inset(0 0 100% 0); transform: translate(-50%, -50%); }
}

@keyframes glitchG {
  0%, 88%, 100% { clip-path: inset(0 0 100% 0); transform: translate(-50%, -50%); }
  89% { clip-path: inset(30% 0 40% 0); transform: translate(calc(-50% + 5px), calc(-50% + 1px)); }
  92% { clip-path: inset(70% 0 5% 0); transform: translate(calc(-50% - 2px), calc(-50% - 3px)); }
}

@keyframes glitchB {
  0%, 92%, 100% { clip-path: inset(0 0 100% 0); transform: translate(-50%, -50%); }
  93% { clip-path: inset(5% 0 80% 0); transform: translate(calc(-50% - 6px), calc(-50% + 2px)); }
  96% { clip-path: inset(40% 0 30% 0); transform: translate(calc(-50% + 4px), calc(-50% - 2px)); }
}

.layer-main {
  position: relative;
  z-index: 3;
  display: inline-block;
  transform: translate(-50%, -50%);
  white-space: nowrap;
  animation: textPulse 1.5s ease-in-out infinite;
}

.char {
  display: inline-block;
  font-family: "Bebas Neue", sans-serif;
  color: var(--text);
  text-shadow:
    0 0 12px rgba(0, 245, 255, 0.9),
    0 0 28px rgba(255, 45, 106, 0.55);
  animation: charWave 2.4s ease-in-out infinite;
  transition: color 0.1s ease, transform 0.1s ease;
}

.char.space {
  width: 0.35em;
}

.char.accent {
  font-family: "Orbitron", sans-serif;
  font-weight: 900;
  color: var(--neon-pink);
  text-shadow:
    0 0 16px rgba(255, 45, 106, 1),
    0 0 32px rgba(255, 212, 71, 0.7),
    0 0 48px rgba(0, 245, 255, 0.5);
  animation: charWaveAccent 1.1s ease-in-out infinite;
}

.char.flicker {
  color: var(--neon-cyan);
  transform: translateY(-3px) scale(1.08);
  text-shadow:
    0 0 20px rgba(0, 245, 255, 1),
    0 0 40px rgba(184, 77, 255, 0.8);
}

@keyframes charWave {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

@keyframes charWaveAccent {
  0%, 100% {
    transform: translateY(0) scale(1);
    color: var(--neon-pink);
  }
  50% {
    transform: translateY(-6px) scale(1.12);
    color: var(--neon-gold);
  }
}

@keyframes textPulse {
  0%, 100% { filter: drop-shadow(0 0 12px rgba(255, 45, 106, 0.5)); }
  50% { filter: drop-shadow(0 0 28px rgba(0, 245, 255, 0.8)); }
}

.underline {
  position: absolute;
  bottom: -0.35em;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 4px;
  background: linear-gradient(90deg, transparent, var(--neon-pink), var(--neon-cyan), transparent);
  border-radius: 2px;
  animation: underlineGrow 2s ease forwards 1.2s, underlineGlow 2s ease-in-out infinite 3s;
  box-shadow: 0 0 20px var(--neon-pink), 0 0 40px var(--neon-cyan);
}

@keyframes underlineGrow {
  to { width: 90%; }
}

@keyframes underlineGlow {
  0%, 100% { opacity: 0.8; box-shadow: 0 0 20px var(--neon-pink); }
  50% { opacity: 1; box-shadow: 0 0 40px var(--neon-cyan), 0 0 60px var(--neon-pink); }
}

.cursor-glow {
  position: fixed;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 100;
  transform: translate(-50%, -50%);
  background: radial-gradient(
    circle,
    rgba(255, 45, 106, 0.15) 0%,
    rgba(0, 245, 255, 0.06) 40%,
    transparent 70%
  );
  mix-blend-mode: screen;
  transition: opacity 0.3s;
}

body.loaded .layer-main {
  animation: revealText 1s cubic-bezier(0.16, 1, 0.3, 1) forwards, textPulse 1.5s ease-in-out infinite 1s;
}

@keyframes revealText {
  from {
    opacity: 0;
    filter: blur(10px);
  }
  to {
    opacity: 1;
    filter: blur(0);
  }
}

@media (max-width: 640px) {
  .headline {
    font-size: clamp(2rem, 10vw, 4rem);
  }

  .layer-main {
    white-space: normal;
    max-width: 95vw;
    text-align: center;
  }
}
