/* ============================================
   THE VISITOR'S GUIDE - Handwritten Hero Effect
   ============================================ */

/* Handwritten animation for hero description */
.hero-description {
  font-family: var(--font-body);
  font-size: 1.2rem;
  color: var(--text-secondary);
  line-height: 1.6;
  max-width: 600px;
  margin: 0 auto;
}

/* Pen stroke effect */
.hero-description {
  position: relative;
}

.hero-description::before {
  content: '';
  position: absolute;
  top: 50%;
  left: -50px;
  width: 40px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--brand-gold), transparent);
  transform: translateY(-50%);
  animation: penMove 4s ease-out forwards;
  animation-delay: 0.5s;
  opacity: 0;
  pointer-events: none;
  z-index: 10;
}

@keyframes penMove {
  0% {
    left: -50px;
    opacity: 0;
  }
  5% {
    left: 0;
    opacity: 1;
  }
  80% {
    left: calc(100% + 10px);
    opacity: 1;
  }
  100% {
    left: calc(100% + 50px);
    opacity: 0;
  }
}

/* Ink splatter effect */
@keyframes inkSplatter {
  0% {
    opacity: 0;
    transform: scale(0) rotate(0deg);
  }
  50% {
    opacity: 0.3;
    transform: scale(1.5) rotate(180deg);
  }
  100% {
    opacity: 0;
    transform: scale(2) rotate(360deg);
  }
}

.hero-description span.ink-splatter {
  position: absolute;
  width: 10px;
  height: 10px;
  background: radial-gradient(circle, var(--brand-gold) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
  animation: inkSplatter 1s ease-out forwards;
}

/* Enhanced smooth glitch effect for Kickstarter */
#kickstarter .glitch {
  position: relative;
  color: var(--text-primary);
  animation: smoothGlitch 8s ease-in-out infinite;
}

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

#kickstarter .glitch::before {
  animation: glitchTop 0.8s ease-in-out infinite;
  clip-path: polygon(0 0, 100% 0, 100% 45%, 0 45%);
  opacity: 0.8;
}

#kickstarter .glitch::after {
  animation: glitchBottom 1.2s ease-in-out infinite;
  clip-path: polygon(0 55%, 100% 55%, 100% 100%, 0 100%);
  opacity: 0.8;
}

@keyframes smoothGlitch {
  0%, 100% {
    text-shadow: 
      0.02em 0 0 rgba(255, 0, 0, 0.75),
      -0.02em -0 0 rgba(0, 255, 255, 0.75);
  }
  25% {
    text-shadow: 
      0.01em 0.01em 0 rgba(255, 0, 255, 0.75),
      -0.01em -0.01em 0 rgba(0, 255, 0, 0.75);
  }
  50% {
    text-shadow: 
      -0.02em 0.005em 0 rgba(0, 0, 255, 0.75),
      0.02em -0.005em 0 rgba(255, 255, 0, 0.75);
  }
  75% {
    text-shadow: 
      0.015em -0.01em 0 rgba(255, 0, 0, 0.75),
      -0.015em 0.01em 0 rgba(0, 255, 255, 0.75);
  }
}

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

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

/* Subtle chromatic aberration */
#kickstarter .glitch {
  filter: 
    drop-shadow(0 0 1px rgba(255, 0, 0, 0.3))
    drop-shadow(0 0 1px rgba(0, 255, 0, 0.3))
    drop-shadow(0 0 1px rgba(0, 0, 255, 0.3));
  transition: filter 0.3s ease;
}

#kickstarter .glitch:hover {
  filter: 
    drop-shadow(0 0 3px rgba(255, 0, 0, 0.5))
    drop-shadow(0 0 3px rgba(0, 255, 0, 0.5))
    drop-shadow(0 0 3px rgba(0, 0, 255, 0.5));
}

/* Mobile adjustments */
@media (max-width: 768px) {
  .hero-description::after {
    font-size: 0.9rem;
    animation-duration: 3s;
  }
  
  @keyframes penMove {
    0% {
      left: -30px;
      opacity: 0;
    }
    5% {
      left: 0;
      opacity: 1;
    }
    80% {
      left: 100%;
      opacity: 1;
    }
    100% {
      left: calc(100% + 30px);
      opacity: 0;
    }
  }
}