/* animations.css - Animation styles for VSIV Creative */

/* Pixel Logo Animation */
@keyframes pixelBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* Float Animation for Pixel Character */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-20px); }
}

/* Glitch Text Effect */
@keyframes glitch {
  0% { transform: translate(0); }
  20% { transform: translate(-2px, 2px); }
  40% { transform: translate(-2px, -2px); }
  60% { transform: translate(2px, 2px); }
  80% { transform: translate(2px, -2px); }
  100% { transform: translate(0); }
}

/* Pixel Shake Animation */
@keyframes pixelShake {
  0% { transform: translate(0,0); }
  25% { transform: translate(1px, -1px); }
  50% { transform: translate(-1px, 1px); }
  75% { transform: translate(1px, 1px); }
  100% { transform: translate(0,0); }
}

/* Typewriter Effect */
@keyframes typing {
  from { width: 0 }
  to { width: 100% }
}

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

/* Pixel Stars Twinkling */
@keyframes twinkle {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Progress Bar Animation */
@keyframes progressGrow {
  from { width: 0; }
  to { width: 100%; }
}

/* Spinner Animation */
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Fade In Animation */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Fade Out Animation */
@keyframes fadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

/* Bounce Animation */
@keyframes bounce {
  0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(-20px); }
  60% { transform: translateY(-10px); }
}

/* Scroll Arrow Animation */
@keyframes scrollArrow {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(10px); }
}

/* Apply animations to elements */
.pixel-character.animated {
  animation: float 3s ease-in-out infinite;
}

.glitch-text {
  animation: glitch 3s infinite;
}

.typewriter-text {
  overflow: hidden;
  border-right: .15em solid var(--dark);
  white-space: normal;
  margin: 0 auto;
  animation:
    typing 3.5s steps(40, end),
    blink-caret .75s step-end infinite;
}

.pixel-stars {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: radial-gradient(2px 2px at 20px 30px, #ffffff, rgba(0,0,0,0)),
                    radial-gradient(2px 2px at 40px 70px, #ffffff, rgba(0,0,0,0)),
                    radial-gradient(2px 2px at 50px 160px, #ffffff, rgba(0,0,0,0)),
                    radial-gradient(2px 2px at 90px 40px, #ffffff, rgba(0,0,0,0)),
                    radial-gradient(2px 2px at 130px 80px, #ffffff, rgba(0,0,0,0)),
                    radial-gradient(2px 2px at 160px 120px, #ffffff, rgba(0,0,0,0));
  background-repeat: repeat;
  background-size: 200px 200px;
  animation: twinkle 4s ease-in-out infinite;
  opacity: 0.7;
}

.pixel-mountains {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100px;
  background-image: linear-gradient(135deg, transparent 0%, transparent 50%, var(--dark) 50%, var(--dark) 60%, transparent 60%, transparent 100%),
                    linear-gradient(225deg, transparent 0%, transparent 50%, var(--secondary) 50%, var(--secondary) 60%, transparent 60%, transparent 100%);
  background-size: 50px 50px;
  background-repeat: repeat-x;
  opacity: 0.8;
}

.progress-bar {
  height: 4px;
  background: var(--accent);
  width: 0;
  position: absolute;
  bottom: 0;
  left: 0;
  transition: width 0.3s ease;
}

.scroll-arrow {
  animation: scrollArrow 2s ease-in-out infinite;
  font-size: 1.5rem;
  margin-top: 10px;
}

.pixel-spinner {
  width: 40px;
  height: 40px;
  background-color: var(--warm);
  margin: 0 auto;
  animation: spin 1.2s infinite ease-in-out;
}

/* Section fade in when visible */
.section-visible {
  animation: fadeIn 1s forwards;
}

/* Theme toggle animation */
.theme-icon {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--light);
  position: relative;
  transition: all 0.3s ease;
}

.theme-icon::before {
  content: '';
  position: absolute;
  top: -4px;
  left: -4px;
  right: -4px;
  bottom: -4px;
  border-radius: 50%;
  border: 2px solid var(--light);
  transition: all 0.3s ease;
  opacity: 0;
}

.theme-toggle:hover .theme-icon::before {
  opacity: 1;
}