/**
 * ASCII Motion FX Stylesheet v1.0.0
 * High-performance, GPU-accelerated CRT overlays, phosphor luminescence,
 * scanlines, and animated micro-interaction styles.
 *
 * (c) 2026 Aleph OS Engineering Unit
 */

/* ============================================================================
   1. CORE CONTAINERS & OVERLAYS
   ============================================================================ */

.ascii-motion-container {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: #05050d;
}

/* CRT Scanlines Overlay */
.ascii-scanlines {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: hidden;
  z-index: 10;
}

.ascii-scanlines::after {
  content: " ";
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
  background: linear-gradient(
    to bottom,
    rgba(18, 16, 16, 0) 50%,
    rgba(0, 0, 0, 0.35) 51%
  );
  background-size: 100% 4px;
  animation: ascii-scanline-scroll 18s linear infinite;
  will-change: transform;
}

/* CRT Radial Vignette */
.ascii-vignette {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  background: radial-gradient(
    circle at center,
    transparent 55%,
    rgba(0, 0, 0, 0.5) 85%,
    rgba(0, 0, 0, 0.9) 100%
  );
  z-index: 11;
}

/* Curved CRT Bezel Housing */
.ascii-crt-curved {
  border-radius: 12px;
  box-shadow:
    inset 0 0 18px rgba(0, 0, 0, 0.9),
    0 0 24px rgba(0, 0, 0, 0.7);
  animation: ascii-crt-flicker 0.15s infinite;
}

/* ============================================================================
   2. PHOSPHOR LUMINESCENCE & GLOW UTILITIES
   ============================================================================ */

.ascii-glow-matrix {
  color: #00ff66;
  text-shadow:
    0 0 4px rgba(0, 255, 102, 0.9),
    0 0 12px rgba(0, 255, 102, 0.5),
    0 0 24px rgba(0, 255, 102, 0.25);
}

.ascii-glow-amber {
  color: #ffb000;
  text-shadow:
    0 0 4px rgba(255, 176, 0, 0.9),
    0 0 12px rgba(255, 176, 0, 0.5),
    0 0 24px rgba(255, 140, 0, 0.25);
}

.ascii-glow-cyan {
  color: #00f0ff;
  text-shadow:
    0 0 5px rgba(0, 240, 255, 0.9),
    0 0 15px rgba(0, 240, 255, 0.6),
    0 0 30px rgba(0, 240, 255, 0.3);
}

.ascii-glow-magenta {
  color: #ff003c;
  text-shadow:
    0 0 5px rgba(255, 0, 60, 0.9),
    0 0 15px rgba(255, 0, 60, 0.5),
    0 0 30px rgba(255, 0, 60, 0.3);
}

.ascii-glow-violet {
  color: #c084fc;
  text-shadow:
    0 0 6px rgba(192, 132, 252, 0.9),
    0 0 18px rgba(129, 140, 248, 0.6),
    0 0 32px rgba(129, 140, 248, 0.3);
}

/* ============================================================================
   3. SEARCH INPUT SHARKS & MARINE STYLING
   ============================================================================ */

.ascii-search-container {
  position: relative;
  display: inline-flex;
  align-items: center;
  box-sizing: border-box;
  background-color: #1a0f00;
  border: 1px solid #cc8800;
  border-radius: 6px;
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.ascii-search-container:focus-within {
  border-color: #ffb000;
  box-shadow:
    0 0 8px rgba(255, 176, 0, 0.5),
    inset 0 0 6px rgba(255, 176, 0, 0.2);
}

.ascii-search-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.ascii-search-input {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  background-color: transparent !important;
  border: none;
  outline: none;
  font-family: ui-monospace, "Courier New", "Fira Code", monospace;
  font-size: 14px;
  line-height: 1.5;
  color: #ffe082;
  caret-color: #ffb000;
  padding: 0 14px;
}

.ascii-search-input::placeholder {
  color: rgba(255, 224, 130, 0.45);
  font-style: italic;
}

/* ============================================================================
   4. KEYFRAME ANIMATIONS
   ============================================================================ */

/* CRT Continuous Vertical Scanline Drift */
@keyframes ascii-scanline-scroll {
  0% {
    transform: translateY(0);
  }
  100% {
    transform: translateY(100%);
  }
}

/* CRT Micro-Voltage Flicker */
@keyframes ascii-crt-flicker {
  0% {
    opacity: 0.985;
  }
  50% {
    opacity: 1.0;
  }
  100% {
    opacity: 0.99;
  }
}

/* Phosphor Pulse / Slow Breathing */
@keyframes ascii-phosphor-pulse {
  0%, 100% {
    filter: brightness(1.0) drop-shadow(0 0 4px rgba(0, 255, 102, 0.6));
  }
  50% {
    filter: brightness(1.15) drop-shadow(0 0 10px rgba(0, 255, 102, 0.9));
  }
}

/* Monospace Terminal Cursor Blinking */
@keyframes ascii-cursor-blink {
  0%, 49% {
    opacity: 1;
  }
  50%, 100% {
    opacity: 0;
  }
}

.ascii-cursor-block {
  display: inline-block;
  width: 8px;
  height: 15px;
  background-color: currentColor;
  vertical-align: middle;
  margin-left: 2px;
  animation: ascii-cursor-blink 1s step-start infinite;
}

/* Glitch Slice Displacement */
@keyframes ascii-glitch-slice {
  0% {
    clip-path: inset(40% 0 61% 0);
    transform: skew(0.3deg);
  }
  20% {
    clip-path: inset(92% 0 1% 0);
    transform: skew(-0.5deg);
  }
  40% {
    clip-path: inset(10% 0 85% 0);
    transform: skew(0.8deg);
  }
  60% {
    clip-path: inset(58% 0 35% 0);
    transform: skew(-0.2deg);
  }
  80% {
    clip-path: inset(80% 0 5% 0);
    transform: skew(0.4deg);
  }
  100% {
    clip-path: inset(0 0 0 0);
    transform: skew(0deg);
  }
}

.ascii-glitch-active {
  animation: ascii-glitch-slice 0.35s steps(2, start) infinite;
}
