:root {
  --bg: #07090b;
  --fg: #eef4f3;
  --cyan: #00fff0;
  --magenta: #ff2ee6;
  --lime: #aaff33;
  --line: rgba(0, 255, 240, 0.12);
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  width: 100vw;
  height: 100vh;
  display: flex;
  font-family: 'Space Mono', 'Courier New', monospace;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  position: relative;
}

/* ---- HUD background: grid + scanlines instead of grainy noise ---- */

.grid-overlay {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.9) 0%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.9) 0%, transparent 75%);
}

.scanlines {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0) 0px,
    rgba(0, 0, 0, 0) 2px,
    rgba(0, 0, 0, 0.35) 3px,
    rgba(0, 0, 0, 0) 4px
  );
  mix-blend-mode: overlay;
}

/* ---- HUD corner brackets ---- */

.corner {
  position: fixed;
  width: 28px;
  height: 28px;
  border: 2px solid var(--cyan);
  opacity: 0.6;
  z-index: 3;
  pointer-events: none;
}

.corner-tl {
  top: 18px;
  left: 18px;
  border-right: none;
  border-bottom: none;
}

.corner-tr {
  top: 18px;
  right: 18px;
  border-left: none;
  border-bottom: none;
  border-color: var(--magenta);
}

.corner-bl {
  bottom: 18px;
  left: 18px;
  border-right: none;
  border-top: none;
  border-color: var(--magenta);
}

.corner-br {
  bottom: 18px;
  right: 18px;
  border-left: none;
  border-top: none;
}

ul {
  padding-left: 0;
}

ul li {
  list-style: none;
  text-align: left;
}

.container {
  position: relative;
  z-index: 4;
  text-align: left;
  padding: 2.5em 2em;
}

.glitch {
  font-family: 'Space Mono', monospace;
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  position: relative;
  text-shadow: 0.05em 0 0 var(--cyan), -0.03em -0.04em 0 var(--magenta),
    0.025em 0.04em 0 var(--lime);
  animation: glitch 725ms infinite;
}

ul li .glitch {
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  opacity: 0.8;
}

/* Blinking terminal caret shown while a line is being typed out */
.glitch.is-typing::after {
  content: "\258C";
  display: inline-block;
  margin-left: 0.08em;
  color: var(--cyan);
  animation: caret-blink 1s steps(1, end) infinite;
}

@keyframes caret-blink {
  0%, 49% {
    opacity: 1;
  }
  50%, 100% {
    opacity: 0;
  }
}

.glitch span {
  position: absolute;
  top: 0;
  left: 0;
}

.glitch span:first-child {
  animation: glitch 500ms infinite;
  clip-path: polygon(0 0, 100% 0, 100% 35%, 0 35%);
  transform: translate(-0.04em, -0.03em);
  opacity: 0.75;
}

.glitch span:last-child {
  animation: glitch 375ms infinite;
  clip-path: polygon(0 65%, 100% 65%, 100% 100%, 0 100%);
  transform: translate(0.04em, 0.03em);
  opacity: 0.75;
}

@keyframes glitch {
  0% {
    text-shadow: 0.05em 0 0 var(--cyan), -0.03em -0.04em 0 var(--magenta),
      0.025em 0.04em 0 var(--lime);
  }
  15% {
    text-shadow: 0.05em 0 0 var(--cyan), -0.03em -0.04em 0 var(--magenta),
      0.025em 0.04em 0 var(--lime);
  }
  16% {
    text-shadow: -0.05em -0.025em 0 var(--cyan), 0.025em 0.035em 0 var(--magenta),
      -0.05em -0.05em 0 var(--lime);
  }
  49% {
    text-shadow: -0.05em -0.025em 0 var(--cyan), 0.025em 0.035em 0 var(--magenta),
      -0.05em -0.05em 0 var(--lime);
  }
  50% {
    text-shadow: 0.05em 0.035em 0 var(--cyan), 0.03em 0 0 var(--magenta),
      0 -0.04em 0 var(--lime);
  }
  99% {
    text-shadow: 0.05em 0.035em 0 var(--cyan), 0.03em 0 0 var(--magenta),
      0 -0.04em 0 var(--lime);
  }
  100% {
    text-shadow: -0.05em 0 0 var(--cyan), -0.025em -0.04em 0 var(--magenta),
      -0.04em -0.025em 0 var(--lime);
  }
}
