/* =============================================
   GPH2026 — Animations & Effects
   ============================================= */

/* ============ Glitch Text Effect ============ */
.glitch {
  position: relative;
  animation: glitch-shift 3s infinite;
}

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

.glitch::before {
  left: 2px;
  text-shadow: -2px 0 var(--neon-pink);
  clip: rect(44px, 450px, 56px, 0);
  animation: glitch-anim 5s infinite linear alternate-reverse;
}

.glitch::after {
  left: -2px;
  text-shadow: 2px 0 var(--neon-cyan);
  clip: rect(44px, 450px, 56px, 0);
  animation: glitch-anim2 5s infinite linear alternate-reverse;
}

@keyframes glitch-shift {
  0%, 95%, 100% { transform: translate(0); }
  96% { transform: translate(-2px, 1px); }
  97% { transform: translate(2px, -1px); }
  98% { transform: translate(-1px, -2px); }
  99% { transform: translate(1px, 2px); }
}

@keyframes glitch-anim {
  0% { clip: rect(31px, 9999px, 94px, 0); }
  5% { clip: rect(70px, 9999px, 71px, 0); }
  10% { clip: rect(29px, 9999px, 45px, 0); }
  15% { clip: rect(56px, 9999px, 89px, 0); }
  20% { clip: rect(14px, 9999px, 32px, 0); }
  25% { clip: rect(58px, 9999px, 75px, 0); }
  30% { clip: rect(22px, 9999px, 67px, 0); }
  35% { clip: rect(81px, 9999px, 98px, 0); }
  40% { clip: rect(12px, 9999px, 55px, 0); }
  45% { clip: rect(42px, 9999px, 83px, 0); }
  50% { clip: rect(33px, 9999px, 61px, 0); }
  55% { clip: rect(73px, 9999px, 91px, 0); }
  60% { clip: rect(8px, 9999px, 43px, 0); }
  65% { clip: rect(51px, 9999px, 78px, 0); }
  70% { clip: rect(27px, 9999px, 52px, 0); }
  75% { clip: rect(64px, 9999px, 96px, 0); }
  80% { clip: rect(18px, 9999px, 39px, 0); }
  85% { clip: rect(47px, 9999px, 72px, 0); }
  90% { clip: rect(35px, 9999px, 86px, 0); }
  95% { clip: rect(60px, 9999px, 99px, 0); }
  100% { clip: rect(25px, 9999px, 48px, 0); }
}

@keyframes glitch-anim2 {
  0% { clip: rect(65px, 9999px, 99px, 0); }
  5% { clip: rect(15px, 9999px, 48px, 0); }
  10% { clip: rect(52px, 9999px, 73px, 0); }
  15% { clip: rect(28px, 9999px, 91px, 0); }
  20% { clip: rect(73px, 9999px, 82px, 0); }
  25% { clip: rect(10px, 9999px, 38px, 0); }
  30% { clip: rect(61px, 9999px, 95px, 0); }
  35% { clip: rect(37px, 9999px, 56px, 0); }
  40% { clip: rect(83px, 9999px, 97px, 0); }
  45% { clip: rect(22px, 9999px, 69px, 0); }
  50% { clip: rect(48px, 9999px, 78px, 0); }
  55% { clip: rect(14px, 9999px, 43px, 0); }
  60% { clip: rect(55px, 9999px, 87px, 0); }
  65% { clip: rect(32px, 9999px, 64px, 0); }
  70% { clip: rect(71px, 9999px, 93px, 0); }
  75% { clip: rect(19px, 9999px, 51px, 0); }
  80% { clip: rect(43px, 9999px, 76px, 0); }
  85% { clip: rect(66px, 9999px, 88px, 0); }
  90% { clip: rect(11px, 9999px, 42px, 0); }
  95% { clip: rect(54px, 9999px, 81px, 0); }
  100% { clip: rect(39px, 9999px, 67px, 0); }
}

/* ============ Glow Hover Effects ============ */
.glow-hover {
  transition: all var(--transition-normal);
}

.glow-hover:hover {
  box-shadow: 0 0 20px rgba(0, 240, 255, 0.3),
              0 0 40px rgba(0, 240, 255, 0.1);
}

.glow-hover-purple:hover {
  box-shadow: 0 0 20px rgba(168, 85, 247, 0.3),
              0 0 40px rgba(168, 85, 247, 0.1);
}

/* ============ Pulse Glow ============ */
@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 5px rgba(0, 240, 255, 0.3); }
  50%      { box-shadow: 0 0 20px rgba(0, 240, 255, 0.6), 0 0 40px rgba(0, 240, 255, 0.3); }
}

.pulse {
  animation: pulse-glow 2s infinite;
}

/* ============ Float Animation ============ */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-10px); }
}

.float {
  animation: float 3s ease-in-out infinite;
}

/* ============ Fade In Animations ============ */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-30px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInLeft {
  from { opacity: 0; transform: translateX(-30px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes fadeInRight {
  from { opacity: 0; transform: translateX(30px); }
  to   { opacity: 1; transform: translateX(0); }
}

.fade-in-up    { animation: fadeInUp 0.6s ease forwards; }
.fade-in-down  { animation: fadeInDown 0.6s ease forwards; }
.fade-in-left  { animation: fadeInLeft 0.6s ease forwards; }
.fade-in-right { animation: fadeInRight 0.6s ease forwards; }

/* Stagger delays */
.delay-1 { animation-delay: 0.1s; opacity: 0; }
.delay-2 { animation-delay: 0.2s; opacity: 0; }
.delay-3 { animation-delay: 0.3s; opacity: 0; }
.delay-4 { animation-delay: 0.4s; opacity: 0; }
.delay-5 { animation-delay: 0.5s; opacity: 0; }

/* ============ Scroll Reveal ============ */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.6s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============ Typing / Terminal Effect ============ */
@keyframes blink {
  0%, 50% { border-color: var(--neon-cyan); }
  51%, 100% { border-color: transparent; }
}

.typing-cursor::after {
  content: '▌';
  animation: blink 1s step-end infinite;
  color: var(--neon-cyan);
}

/* ============ Scan Line Effect ============ */
.scanline {
  position: relative;
  overflow: hidden;
}

.scanline::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(to right, transparent, var(--neon-cyan), transparent);
  opacity: 0.3;
  animation: scanline-move 4s linear infinite;
}

@keyframes scanline-move {
  0% { top: -5%; }
  100% { top: 105%; }
}

/* ============ Border Glow Effect ============ */
@keyframes border-glow {
  0%, 100% { border-color: rgba(0, 240, 255, 0.3); }
  50%      { border-color: rgba(168, 85, 247, 0.5); }
}

.border-animate {
  animation: border-glow 3s ease infinite;
}

/* ============ Rotate Icon ============ */
@keyframes spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

.spin {
  animation: spin 1s linear infinite;
}

/* ============ Scale on Hover ============ */
.scale-hover {
  transition: transform var(--transition-normal);
}

.scale-hover:hover {
  transform: scale(1.05);
}

/* ============ Loading Spinner ============ */
.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border-color);
  border-top-color: var(--neon-cyan);
  border-radius: var(--radius-full);
  animation: spin 0.8s linear infinite;
}

/* ============ Loading Bar (Game-style) ============ */
.loading-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: var(--gradient-primary);
  z-index: 9999;
  transition: width 0.3s ease;
}

/* ============ Particle Canvas ============ */
#particles-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* ============ Neon Border Animation ============ */
@keyframes neon-border-rotate {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.neon-border {
  position: relative;
  padding: 2px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--neon-cyan), var(--neon-purple), var(--neon-pink), var(--neon-cyan));
  background-size: 300% 300%;
  animation: neon-border-rotate 4s ease infinite;
}

.neon-border > * {
  background: var(--bg-secondary);
  border-radius: calc(var(--radius-lg) - 2px);
}

/* ============ Page Transition ============ */
.page-enter {
  animation: fadeInUp 0.4s ease forwards;
}

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