/* ============================================
   SHIFT3 TECH MEDIA — ANIMATIONS
   ============================================ */

/* ─── GLITCH TEXT ─── */
.glitch {
  position: relative;
  display: inline-block;
}
.glitch::before,
.glitch::after {
  content: attr(data-text);
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
}
.glitch::before {
  color: var(--cyan);
  animation: glitch-top 3s infinite linear;
  clip-path: polygon(0 0, 100% 0, 100% 35%, 0 35%);
}
.glitch::after {
  color: var(--pink);
  animation: glitch-bot 3.1s infinite linear;
  clip-path: polygon(0 65%, 100% 65%, 100% 100%, 0 100%);
}

@keyframes glitch-top {
  0%   { transform: translate(0); opacity: 0; }
  2%   { transform: translate(-2px, -1px); opacity: 0.8; }
  4%   { transform: translate(2px, 0); opacity: 0; }
  42%  { transform: translate(0); opacity: 0; }
  44%  { transform: translate(3px, 1px); opacity: 0.9; }
  46%  { transform: translate(0); opacity: 0; }
  72%  { transform: translate(0); opacity: 0; }
  74%  { transform: translate(-3px, 0px); opacity: 0.7; }
  76%  { transform: translate(0); opacity: 0; }
  100% { transform: translate(0); opacity: 0; }
}

@keyframes glitch-bot {
  0%   { transform: translate(0); opacity: 0; }
  5%   { transform: translate(2px, 1px); opacity: 0.8; }
  7%   { transform: translate(0); opacity: 0; }
  55%  { transform: translate(0); opacity: 0; }
  57%  { transform: translate(-2px, -1px); opacity: 0.9; }
  59%  { transform: translate(0); opacity: 0; }
  85%  { transform: translate(0); opacity: 0; }
  87%  { transform: translate(3px, 0); opacity: 0.7; }
  89%  { transform: translate(0); opacity: 0; }
  100% { transform: translate(0); opacity: 0; }
}

/* ─── NEON PULSE BORDER ─── */
@keyframes pulse-cyan {
  0%, 100% { box-shadow: 0 0 8px rgba(0,255,255,0.3), 0 0 20px rgba(0,255,255,0.1); }
  50% { box-shadow: 0 0 16px rgba(0,255,255,0.6), 0 0 40px rgba(0,255,255,0.2), 0 0 60px rgba(0,255,255,0.08); }
}
@keyframes pulse-pink {
  0%, 100% { box-shadow: 0 0 8px rgba(255,0,110,0.3), 0 0 20px rgba(255,0,110,0.1); }
  50% { box-shadow: 0 0 16px rgba(255,0,110,0.6), 0 0 40px rgba(255,0,110,0.2), 0 0 60px rgba(255,0,110,0.08); }
}
@keyframes pulse-green {
  0%, 100% { box-shadow: 0 0 8px rgba(57,255,20,0.3), 0 0 20px rgba(57,255,20,0.1); }
  50% { box-shadow: 0 0 16px rgba(57,255,20,0.6), 0 0 40px rgba(57,255,20,0.2), 0 0 60px rgba(57,255,20,0.08); }
}
@keyframes pulse-purple {
  0%, 100% { box-shadow: 0 0 8px rgba(191,0,255,0.3), 0 0 20px rgba(191,0,255,0.1); }
  50% { box-shadow: 0 0 16px rgba(191,0,255,0.6), 0 0 40px rgba(191,0,255,0.2), 0 0 60px rgba(191,0,255,0.08); }
}

.pulse-cyan   { animation: pulse-cyan   2s ease-in-out infinite; }
.pulse-pink   { animation: pulse-pink   2.3s ease-in-out infinite; }
.pulse-green  { animation: pulse-green  2.6s ease-in-out infinite; }
.pulse-purple { animation: pulse-purple 1.9s ease-in-out infinite; }

/* ─── FADE IN ANIMATIONS ─── */
@keyframes fade-up {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes slide-in-left {
  from { opacity: 0; transform: translateX(-32px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes slide-in-right {
  from { opacity: 0; transform: translateX(32px); }
  to   { opacity: 1; transform: translateX(0); }
}

.anim-fade-up    { animation: fade-up 0.6s ease both; }
.anim-fade-in    { animation: fade-in 0.6s ease both; }
.anim-slide-left { animation: slide-in-left 0.6s ease both; }
.anim-slide-right{ animation: slide-in-right 0.6s ease both; }

.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
.delay-4 { animation-delay: 0.4s; }
.delay-5 { animation-delay: 0.5s; }
.delay-6 { animation-delay: 0.6s; }
.delay-7 { animation-delay: 0.7s; }
.delay-8 { animation-delay: 0.8s; }

/* ─── SCAN LINE OVERLAY ─── */
.scanlines::after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0,0,0,0.08) 2px,
    rgba(0,0,0,0.08) 4px
  );
  pointer-events: none;
  z-index: 1;
}

/* ─── GRADIENT ANIMATE ─── */
@keyframes gradient-shift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
.gradient-animate {
  background-size: 200% 200%;
  animation: gradient-shift 4s ease infinite;
}

/* ─── SPIN ─── */
@keyframes spin-slow { to { transform: rotate(360deg); } }
.spin-slow { animation: spin-slow 12s linear infinite; }

/* ─── BLINK CURSOR ─── */
@keyframes blink { 50% { opacity: 0; } }
.blink { animation: blink 1s step-end infinite; }

/* ─── PROGRESS BAR FILL ─── */
@keyframes fill-bar {
  from { width: 0; }
}
.fill-bar { animation: fill-bar 1.2s cubic-bezier(0.4,0,0.2,1) both; }

/* ─── BORDER MARCH ─── */
@keyframes border-march {
  to { background-position: 100% 0, 0 100%, 0 0, 100% 100%; }
}
.border-march {
  background:
    linear-gradient(90deg, var(--cyan) 50%, transparent 50%) top / 20px 2px repeat-x,
    linear-gradient(90deg, var(--pink) 50%, transparent 50%) bottom / 20px 2px repeat-x,
    linear-gradient(0deg, var(--purple) 50%, transparent 50%) left / 2px 20px repeat-y,
    linear-gradient(0deg, var(--green) 50%, transparent 50%) right / 2px 20px repeat-y;
  animation: border-march 1s linear infinite;
}

/* ─── FLOATING ─── */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-8px); }
}
.float { animation: float 3s ease-in-out infinite; }

/* ─── SCROLL REVEAL (JS-triggered) ─── */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}
.reveal-left {
  opacity: 0;
  transform: translateX(-24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal-left.revealed {
  opacity: 1;
  transform: translateX(0);
}
.reveal-right {
  opacity: 0;
  transform: translateX(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal-right.revealed {
  opacity: 1;
  transform: translateX(0);
}

/* ─── GLOW-SWIPE BUTTON ANIMATION ─── */
@keyframes glow-swipe {
  0%   { left: -100%; }
  50%  { left: 100%; }
  100% { left: -100%; }
}
.btn-glow-swipe {
  position: relative;
  overflow: hidden;
}
.btn-glow-swipe::before {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
  animation: glow-swipe 2.5s infinite;
}

/* ─── REDUCED MOTION ─── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
