/* Pure CSS Glitch Effect */
.glitch-text {
  font-family: 'JetBrains Mono', monospace;
  font-size: clamp(1.2rem, 3vw, 2rem);
  font-weight: 800;
  color: #fff;
  position: relative;
  letter-spacing: -1px;
  display: none;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
  z-index: 2;
  margin-top: 0;
}

.glitch-text.active {
  display: inline-block;
}

.glitch-text::before,
.glitch-text::after {
  content: attr(data-text);
  position: absolute;
  width: 100%;
  z-index: -1;
  opacity: 0;
}

.glitch-text::before {
  top: 10px;
  left: 15px;
  color: #ff0055;
  animation: glitch-anim-before 8s step-end infinite;
  clip-path: polygon(0 0, 100% 0, 100% 45%, 0 58%);
}

.glitch-text::after {
  top: 5px;
  left: -10px;
  color: #00f2ff;
  animation: glitch-anim-after 6s step-end infinite;
  clip-path: polygon(0 60%, 100% 50%, 100% 100%, 0 100%);
}

.glitch-text.active::before,
.glitch-text.active::after {
  animation: glitch-anim-before 8s step-end infinite, glitch-opacity 8s step-end infinite !important;
}

.glitch-text.active::after {
  animation: glitch-anim-after 6s step-end infinite, glitch-opacity 6s step-end infinite !important;
}

@keyframes glitch-anim-before {
  0%, 19%, 21%, 23%, 25%, 54%, 56%, 100% {
    clip-path: polygon(0 0, 100% 0, 100% 45%, 0 58%);
    left: 15px;
    top: 10px;
  }
  20%, 24%, 55% {
    clip-path: polygon(0 0, 100% 0, 100% 0%, 0 0%);
    left: -8px;
    top: -5px;
  }
}

@keyframes glitch-anim-after {
  0%, 19%, 21%, 23%, 25%, 54%, 56%, 100% {
    clip-path: polygon(0 60%, 100% 50%, 100% 100%, 0 100%);
    left: -10px;
    top: 5px;
  }
  20%, 24%, 55% {
    clip-path: polygon(0 100%, 100% 100%, 100% 100%, 0 0%);
    left: 10px;
    top: 12px;
  }
}

@keyframes glitch-opacity {
  0% { opacity: 1; }
  100% { opacity: 1; }
}

.glitch-container {
  position: relative;
  display: inline-block;
  width: auto;
  white-space: nowrap;
  z-index: 5;
  text-align: center;
  will-change: transform;
  min-height: 120px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.aka {
  font-family: 'Montserrat', sans-serif !important;
  font-size: 0.95rem !important;
  color: var(--text-dim) !important;
  text-transform: lowercase !important;
  margin-bottom: 0.25rem !important;
  letter-spacing: 0.6px !important;
  display: none !important;
  height: 20px;
  line-height: 20px;
}

.aka.show {
  display: block !important;
}

/* Legacy layers CSS */
.glitch-layers {
  display: none;
}

.layer {
  display: none;
}

@media (prefers-reduced-motion: reduce) {
  .glitch-text::before,
  .glitch-text::after {
    animation: none !important;
    display: none;
  }
}
