/* ─── reset & base ─── */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --red: #8a0000;
  --red2: #c0392b;
  --dim: rgba(255, 255, 255, 0.07);
  --bg: #050505;
  --font-mono: 'Share Tech Mono', monospace;
  --font-vt: 'VT323', monospace;
}

html,
body {
  width: 100%;
  height: 100%;
  background: var(--bg);
  color: #ccc;
  font-family: var(--font-mono);
  overflow: hidden;
  cursor: crosshair;
}

/* ─── background image ─── */
.bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: url('bg.jpg') center center / cover no-repeat;
  /* darken so text stays readable */
  filter: brightness(0.55) saturate(0.7);
}

/* ─── CRT scanlines ─── */
.crt-overlay {
  position: fixed;
  inset: 0;
  z-index: 10;
  pointer-events: none;
  background: repeating-linear-gradient(to bottom,
      transparent 0px,
      transparent 2px,
      rgba(0, 0, 0, 0.18) 2px,
      rgba(0, 0, 0, 0.18) 4px);
  animation: flicker 8s infinite;
}

@keyframes flicker {

  0%,
  100% {
    opacity: 1;
  }

  92% {
    opacity: 1;
  }

  93% {
    opacity: 0.7;
  }

  94% {
    opacity: 1;
  }

  96% {
    opacity: 0.85;
  }

  97% {
    opacity: 1;
  }
}

/* ─── film grain noise ─── */
.noise {
  position: fixed;
  inset: 0;
  z-index: 9;
  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");
  background-size: 200px 200px;
  animation: grain 0.4s steps(1) infinite;
}

@keyframes grain {
  0% {
    transform: translate(0, 0);
  }

  20% {
    transform: translate(-3px, 2px);
  }

  40% {
    transform: translate(2px, -2px);
  }

  60% {
    transform: translate(-1px, 3px);
  }

  80% {
    transform: translate(3px, -1px);
  }

  100% {
    transform: translate(0, 0);
  }
}

/* ─── center layout ─── */
.center {
  position: relative;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  height: 100vh;
  padding-left: 7vw;
}

/* ─── title block ─── */
.title-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.title {
  font-family: var(--font-vt);
  font-size: clamp(4rem, 10vw, 9rem);
  font-weight: 400;
  letter-spacing: 0.08em;
  color: #eee;
  position: relative;
  text-transform: lowercase;

  /* subtle red glow */
  text-shadow:
    0 0 12px rgba(138, 0, 0, 0.6),
    0 0 40px rgba(138, 0, 0, 0.25);

  animation: glitch 6s infinite;
}

/* glitch pseudo-layers */
.title::before,
.title::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  overflow: hidden;
}

.title::before {
  color: var(--red2);
  clip-path: inset(30% 0 50% 0);
  animation: glitch-top 6s infinite;
  opacity: 0;
}

.title::after {
  color: #aaa;
  clip-path: inset(60% 0 10% 0);
  animation: glitch-bot 6s infinite;
  opacity: 0;
}

@keyframes glitch {

  0%,
  89%,
  100% {
    transform: none;
  }

  90% {
    transform: translateX(-2px) skewX(-1deg);
  }

  91% {
    transform: translateX(2px) skewX(1deg);
  }

  92% {
    transform: none;
  }
}

@keyframes glitch-top {

  0%,
  89%,
  100% {
    opacity: 0;
    transform: none;
  }

  90% {
    opacity: 1;
    transform: translateX(3px);
  }

  91% {
    opacity: 1;
    transform: translateX(-3px);
  }

  92% {
    opacity: 0;
  }
}

@keyframes glitch-bot {

  0%,
  89%,
  100% {
    opacity: 0;
    transform: none;
  }

  90% {
    opacity: 1;
    transform: translateX(-4px);
  }

  91% {
    opacity: 1;
    transform: translateX(4px);
  }

  92% {
    opacity: 0;
  }
}

/* ─── subtitle ─── */
.subtitle {
  font-family: var(--font-mono);
  font-size: clamp(0.65rem, 1.3vw, 0.9rem);
  letter-spacing: 0.15em;
  color: rgba(138, 0, 0, 0.75);
  text-transform: lowercase;
  text-shadow: 0 0 8px rgba(138, 0, 0, 0.4);
  animation: blink-text 4s infinite;
}

@keyframes blink-text {

  0%,
  100% {
    opacity: 0.75;
  }

  50% {
    opacity: 0.35;
  }
}

/* ─── audio player ─── */
.audio-wrap {
  position: fixed;
  bottom: 2rem;
  left: 2rem;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.audio-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: transparent;
  border: 1px solid rgba(138, 0, 0, 0.45);
  color: rgba(200, 200, 200, 0.7);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  padding: 0.35rem 0.75rem;
  cursor: pointer;
  text-transform: lowercase;
  transition: border-color 0.3s, color 0.3s, box-shadow 0.3s;
}

.audio-btn:hover {
  border-color: var(--red);
  color: #ddd;
  box-shadow: 0 0 10px rgba(138, 0, 0, 0.35);
}

/* equalizer bars */
.audio-bars {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 18px;
  opacity: 0;
  transition: opacity 0.3s;
}

.audio-bars.active {
  opacity: 1;
}

.audio-bars span {
  display: block;
  width: 3px;
  background: var(--red);
  border-radius: 1px;
  height: 4px;
  box-shadow: 0 0 4px var(--red);
}

.audio-bars.active span:nth-child(1) {
  animation: bar 0.9s ease-in-out infinite alternate;
}

.audio-bars.active span:nth-child(2) {
  animation: bar 0.6s ease-in-out 0.1s infinite alternate;
}

.audio-bars.active span:nth-child(3) {
  animation: bar 1.1s ease-in-out 0.2s infinite alternate;
}

.audio-bars.active span:nth-child(4) {
  animation: bar 0.7s ease-in-out 0.05s infinite alternate;
}

.audio-bars.active span:nth-child(5) {
  animation: bar 0.8s ease-in-out 0.15s infinite alternate;
}

@keyframes bar {
  from {
    height: 3px;
  }

  to {
    height: 18px;
  }
}

/* ─── selection color ─── */
::selection {
  background: rgba(138, 0, 0, 0.5);
  color: #fff;
}

/* ─── splash / enter screen ─── */
.splash {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: opacity 1s ease;
}

.splash.fade-out {
  opacity: 0;
  pointer-events: none;
}

.splash-text {
  font-family: var(--font-mono);
  font-size: clamp(1rem, 2.5vw, 1.4rem);
  letter-spacing: 0.25em;
  color: rgba(138, 0, 0, 0.8);
  text-transform: lowercase;
  text-shadow: 0 0 14px rgba(138, 0, 0, 0.5);
  animation: blink-text 1.2s infinite;
  user-select: none;
}