/* ── Cursor blink ─────────────────────────────────────── */
@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

.cursor-block {
  animation: blink 1.1s step-end infinite;
}

/* ── CRT Scanlines overlay ────────────────────────────── */
.scanlines {
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    transparent          0px,
    transparent          2px,
    rgba(0, 0, 0, 0.07)  2px,
    rgba(0, 0, 0, 0.07)  4px
  );
  pointer-events: none;
  z-index: 9999;
  animation: scanroll 12s linear infinite;
}

@keyframes scanroll {
  from { background-position: 0 0; }
  to   { background-position: 0 200px; }
}

/* ── Line fade-in ─────────────────────────────────────── */
.line {
  animation: fadein 0.1s ease-out both;
}

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

/* ── Border pulse (hire easter egg) ──────────────────── */
@keyframes border-pulse-amber {
  0%, 100% {
    box-shadow: 0 0 0 1px #1a1a1a, 0 0 40px rgba(255,176,0,0.05), 0 20px 60px rgba(0,0,0,0.8);
    border-color: #1e1e1e;
  }
  50% {
    box-shadow: 0 0 0 1px var(--amber), 0 0 50px rgba(255,176,0,0.35), 0 20px 60px rgba(0,0,0,0.8);
    border-color: var(--amber);
  }
}

/* ── Rainbow border (Konami code) ────────────────────── */
@keyframes border-pulse-rainbow {
  0%   { border-color: #ff0000; box-shadow: 0 0 20px rgba(255,0,0,0.5); }
  16%  { border-color: #ff8800; box-shadow: 0 0 20px rgba(255,136,0,0.5); }
  33%  { border-color: #ffff00; box-shadow: 0 0 20px rgba(255,255,0,0.5); }
  50%  { border-color: #00ff00; box-shadow: 0 0 20px rgba(0,255,0,0.5); }
  66%  { border-color: #0088ff; box-shadow: 0 0 20px rgba(0,136,255,0.5); }
  83%  { border-color: #8800ff; box-shadow: 0 0 20px rgba(136,0,255,0.5); }
  100% { border-color: #ff0000; box-shadow: 0 0 20px rgba(255,0,0,0.5); }
}

/* ── Shake (exit command) ────────────────────────────── */
@keyframes shake {
  0%, 100% { transform: translate(0, 0); }
  10%       { transform: translate(-3px, -2px); }
  20%       { transform: translate(3px, -1px); }
  30%       { transform: translate(-2px,  2px); }
  40%       { transform: translate(3px,   1px); }
  50%       { transform: translate(-3px, -1px); }
  60%       { transform: translate(3px,   2px); }
  70%       { transform: translate(-1px,  2px); }
  80%       { transform: translate(1px,  -2px); }
  90%       { transform: translate(-3px,  1px); }
}

/* ── Glitch text effect ───────────────────────────────── */
@keyframes glitch-clip-1 {
  0%   { clip-path: inset(0 0 96% 0); transform: translate(-2px, 0); }
  20%  { clip-path: inset(30% 0 55% 0); transform: translate(2px, 0); }
  40%  { clip-path: inset(70% 0 10% 0); transform: translate(-2px, 0); }
  60%  { clip-path: inset(15% 0 75% 0); transform: translate(2px, 0); }
  80%  { clip-path: inset(55% 0 30% 0); transform: translate(-1px, 0); }
  100% { clip-path: inset(0 0 96% 0); transform: translate(0); }
}

@keyframes glitch-clip-2 {
  0%   { clip-path: inset(50% 0 35% 0); transform: translate(2px, 0); }
  25%  { clip-path: inset(10% 0 80% 0); transform: translate(-2px, 0); }
  50%  { clip-path: inset(85% 0 5% 0); transform: translate(1px, 0); }
  75%  { clip-path: inset(40% 0 45% 0); transform: translate(-1px, 0); }
  100% { clip-path: inset(50% 0 35% 0); transform: translate(0); }
}

.glitch-text {
  position: relative;
}

.glitch-text::before,
.glitch-text::after {
  content: attr(data-text);
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.glitch-text::before {
  color: var(--red);
  animation: glitch-clip-1 0.4s infinite linear alternate-reverse;
  opacity: 0.75;
}

.glitch-text::after {
  color: var(--cyan);
  animation: glitch-clip-2 0.4s 0.08s infinite linear alternate-reverse;
  opacity: 0.75;
}

/* ── Green phosphor flicker (ambient) ────────────────── */
@keyframes phosphor-flicker {
  0%, 97%, 100% { opacity: 1; }
  98%            { opacity: 0.94; }
  99%            { opacity: 1; }
  99.5%          { opacity: 0.97; }
}

.terminal-output {
  animation: phosphor-flicker 8s ease-in-out infinite;
}
