/* Typewriter Animation - Infinite Loop */
.typewriter {
  overflow: hidden;
  border-right: 2px solid var(--accent-purple);
  white-space: nowrap;
  letter-spacing: 0.05em;
  animation: typing 8s steps(20, end) infinite, blink-caret 0.75s step-end infinite;
}

@keyframes typing {
  0% {
    width: 0;
  }
  40% {
    width: 100%;
  }
  50% {
    width: 100%;
  }
  65% {
    width: 100%;
  }
  90% {
    width: 0;
  }
  100% {
    width: 0;
  }
}

@keyframes blink-caret {
  from,
  to {
    border-right-color: var(--accent-purple);
  }
  50% {
    border-right-color: transparent;
  }
}

/* Animated Low-Poly Background */
.hero-background {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg-primary);
  overflow: hidden;
  z-index: -1;
}

.polygon-container {
  position: absolute;
  width: 100%;
  height: 100%;
  opacity: 0.5;
  animation: float 25s ease-in-out infinite;
  will-change: transform, opacity;
  transform: translateZ(0); /* Force hardware acceleration */
}

.polygon {
  position: absolute;
  opacity: 0.7;
  animation: drift 35s ease-in-out infinite;
  filter: blur(0.5px);
  will-change: transform, opacity;
  transform: translateZ(0); /* Force hardware acceleration */
}

.polygon-1 {
  top: 10%;
  left: 10%;
  width: 200px;
  height: 200px;
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.1), rgba(20, 184, 166, 0.1));
  clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
  animation-delay: 0s;
}

.polygon-2 {
  top: 60%;
  right: 15%;
  width: 300px;
  height: 300px;
  background: linear-gradient(225deg, rgba(20, 184, 166, 0.08), rgba(168, 85, 247, 0.08));
  clip-path: polygon(30% 0%, 70% 0%, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0% 70%, 0% 30%);
  animation-delay: -5s;
}

.polygon-3 {
  bottom: 20%;
  left: 20%;
  width: 250px;
  height: 250px;
  background: linear-gradient(45deg, rgba(168, 85, 247, 0.12), rgba(239, 68, 68, 0.08));
  clip-path: polygon(50% 0%, 100% 38%, 82% 100%, 18% 100%, 0% 38%);
  animation-delay: -10s;
}

.polygon-4 {
  top: 30%;
  right: 30%;
  width: 180px;
  height: 180px;
  background: linear-gradient(315deg, rgba(20, 184, 166, 0.1), rgba(168, 85, 247, 0.1));
  clip-path: polygon(25% 0%, 100% 0%, 75% 100%, 0% 100%);
  animation-delay: -15s;
}

.polygon-5 {
  bottom: 40%;
  right: 10%;
  width: 220px;
  height: 220px;
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.08), rgba(168, 85, 247, 0.1));
  clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
  animation-delay: -20s;
}

.polygon-6 {
  top: 50%;
  left: 5%;
  width: 160px;
  height: 160px;
  background: linear-gradient(45deg, rgba(20, 184, 166, 0.1), rgba(168, 85, 247, 0.08));
  clip-path: polygon(20% 0%, 80% 0%, 100% 20%, 100% 80%, 80% 100%, 20% 100%, 0% 80%, 0% 20%);
  animation-delay: -25s;
}

/* Additional smaller polygons for texture */
.polygon-7 {
  top: 25%;
  right: 40%;
  width: 120px;
  height: 120px;
  background: linear-gradient(180deg, rgba(168, 85, 247, 0.06), rgba(20, 184, 166, 0.06));
  clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
  animation-delay: -8s;
  opacity: 0.5;
}

.polygon-8 {
  bottom: 30%;
  left: 40%;
  width: 140px;
  height: 140px;
  background: linear-gradient(270deg, rgba(239, 68, 68, 0.05), rgba(168, 85, 247, 0.05));
  clip-path: polygon(30% 0%, 70% 0%, 100% 50%, 70% 100%, 30% 100%, 0% 50%);
  animation-delay: -18s;
  opacity: 0.4;
}

.polygon-9 {
  top: 70%;
  right: 25%;
  width: 100px;
  height: 100px;
  background: linear-gradient(90deg, rgba(20, 184, 166, 0.07), rgba(168, 85, 247, 0.07));
  clip-path: polygon(50% 0%, 100% 100%, 0% 100%);
  animation-delay: -12s;
  opacity: 0.5;
}

@keyframes float {
  0%,
  100% {
    transform: translate3d(0, 0, 0) rotate(0deg);
    opacity: 0.6;
  }
  25% {
    transform: translate3d(30px, -30px, 0) rotate(90deg);
    opacity: 0.8;
  }
  50% {
    transform: translate3d(-20px, 20px, 0) rotate(180deg);
    opacity: 0.4;
  }
  75% {
    transform: translate3d(20px, 30px, 0) rotate(270deg);
    opacity: 0.7;
  }
}

/* Geometric Pattern Overlay */
.geometric-pattern {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0.03;
  background-image: repeating-linear-gradient(45deg, transparent, transparent 2px, rgba(255, 255, 255, 0.1) 2px, rgba(255, 255, 255, 0.1) 4px),
    repeating-linear-gradient(-45deg, transparent, transparent 2px, rgba(255, 255, 255, 0.1) 2px, rgba(255, 255, 255, 0.1) 4px);
  background-size: 40px 40px;
  animation: patternMove 60s linear infinite;
}

@keyframes patternMove {
  0% {
    background-position: 0 0, 0 0;
  }
  100% {
    background-position: 40px 40px, -40px -40px;
  }
}


