
/* Utilities: glitch, redaction, scanlines, noise filter */

:root {
  --color-bg: #000000;
  --color-primary: #D11A2A; /* vivid red */
  --color-accent: #FF4242;
  --color-text: #E5E7EB;
  --color-muted: #9CA3AF;
  --color-green: #16A34A;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(0,0,0,0.6);
  --maxw: 1200px;
  --spacing: clamp(16px, 2vw, 28px);
}

/* Scanlines overlay */
.scanlines {
  position: relative;
}
.scanlines::after {
  content: "";
  pointer-events: none;
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    to bottom,
    rgba(22,163,74,0.06) 0px,
    rgba(22,163,74,0.06) 1px,
    rgba(0,0,0,0) 3px,
    rgba(0,0,0,0) 4px
  );
  opacity: .10;
  mix-blend-mode: screen;
}

/* Noise overlay */
.noise::before {
  content: "";
  pointer-events: none;
  position: absolute;
  inset: 0;
  background: url('../assets/noise-overlay.png') repeat;
  opacity: .12;
  mix-blend-mode: overlay;
}

/* Glitch text */
.glitch {
  position: relative;
  display: inline-block;
  color: var(--color-text);
  text-shadow:
    0 0 1px rgba(255,255,255,0.6),
    0 0 2px rgba(255,255,255,0.4);
}
.glitch::before,
.glitch::after {
  content: attr(data-text);
  position: absolute;
  left: 0; top: 0;
  width: 100%; height: 100%;
  overflow: hidden;
}
.glitch::before {
  transform: translate(1px, 0);
  color: #2ef2ff; /* cyan channel */
  clip-path: polygon(0 0, 100% 0, 100% 45%, 0 55%);
  mix-blend-mode: screen;
  filter: drop-shadow(0 0 2px rgba(46,242,255,0.4));
  animation: glitchTop 3.5s infinite linear alternate;
}
.glitch::after {
  transform: translate(-1px, 0);
  color: var(--color-accent); /* red channel */
  clip-path: polygon(0 60%, 100% 50%, 100% 100%, 0 100%);
  mix-blend-mode: screen;
  filter: drop-shadow(0 0 2px rgba(255,66,66,0.5));
  animation: glitchBot 3s infinite linear alternate;
}

@keyframes glitchTop {
  0% { transform: translate(1px, -1px); }
  20% { transform: translate(2px, 0); }
  40% { transform: translate(-1px, 1px); }
  60% { transform: translate(3px, -1px); }
  80% { transform: translate(-2px, 1px); }
  100% { transform: translate(1px, 0); }
}
@keyframes glitchBot {
  0% { transform: translate(-1px, 1px); }
  20% { transform: translate(-2px, 0); }
  40% { transform: translate(1px, -1px); }
  60% { transform: translate(-3px, 1px); }
  80% { transform: translate(2px, -1px); }
  100% { transform: translate(-1px, 0); }
}

/* Redaction bar */
.redact {
  background: linear-gradient(90deg, var(--color-bg) 0%, var(--color-bg) 50%, transparent 50%);
  background-size: 200% 100%;
  animation: redact-reveal 1.8s ease forwards;
  color: transparent;
  border-radius: 2px;
}
.redact::selection { background: var(--color-primary); color: var(--color-bg); }
@keyframes redact-reveal {
  to { background-position: -100% 0; }
}
.redact.revealed {
  background: transparent;
  color: var(--color-text);
}

/* Visually-hidden for a11y */
.visually-hidden {
  position: absolute !important;
  height: 1px; width: 1px;
  overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px);
  white-space: nowrap;
}
