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

:root {
  --bg: #050505;
  --accent: #c41e1e;
  --accent-glow: rgba(196, 30, 30, 0.55);
  --text: #e8e4dc;
}

html,
body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: "Bebas Neue", sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

#smoke-canvas,
#embers-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

#smoke-canvas {
  z-index: 1;
}

#embers-canvas {
  z-index: 2;
}

.scanlines {
  position: fixed;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.08) 2px,
    rgba(0, 0, 0, 0.08) 4px
  );
  opacity: 0.35;
}

.vignette {
  position: fixed;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  background: radial-gradient(
    ellipse at center,
    transparent 30%,
    rgba(0, 0, 0, 0.75) 100%
  );
}

.hero {
  position: relative;
  z-index: 10;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100dvh;
  padding: 1.5rem;
  text-align: center;
}

.hero__title {
  position: relative;
  font-size: clamp(3.5rem, 14vw, 7rem);
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0.12em;
  text-shadow:
    0 0 40px var(--accent-glow),
    0 0 80px rgba(196, 30, 30, 0.2);
  animation: fadeIn 1.4s ease-out both, titlePulse 4s ease-in-out infinite;
}

.hero__title::before,
.hero__title::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  opacity: 0;
}

.hero__title::before {
  color: var(--accent);
  animation: glitch1 5s infinite;
  clip-path: polygon(0 0, 100% 0, 100% 35%, 0 35%);
}

.hero__title::after {
  color: rgba(255, 255, 255, 0.6);
  animation: glitch2 5s infinite;
  clip-path: polygon(0 65%, 100% 65%, 100% 100%, 0 100%);
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes titlePulse {
  0%,
  100% {
    text-shadow:
      0 0 40px var(--accent-glow),
      0 0 80px rgba(196, 30, 30, 0.2);
  }
  50% {
    text-shadow:
      0 0 60px var(--accent-glow),
      0 0 120px rgba(196, 30, 30, 0.35);
  }
}

@keyframes glitch1 {
  0%,
  92%,
  100% {
    opacity: 0;
    transform: translate(0);
  }
  93% {
    opacity: 0.8;
    transform: translate(-4px, 2px);
  }
  94% {
    opacity: 0;
    transform: translate(4px, -2px);
  }
  95% {
    opacity: 0.6;
    transform: translate(-2px, 0);
  }
}

@keyframes glitch2 {
  0%,
  90%,
  100% {
    opacity: 0;
    transform: translate(0);
  }
  91% {
    opacity: 0.7;
    transform: translate(3px, -1px);
  }
  92% {
    opacity: 0;
    transform: translate(-3px, 1px);
  }
  93% {
    opacity: 0.5;
    transform: translate(2px, 0);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  #smoke-canvas,
  #embers-canvas {
    display: none;
  }
}
