/* ==========================================================================
   nixyGT - Entrance Animations, Keyframes & View Transitions
   ========================================================================== */

/* --------------------------------------------------------------------------
   Futuristic Fullscreen Preloader
   -------------------------------------------------------------------------- */
.site-preloader {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: #000000;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.75s cubic-bezier(0.16, 1, 0.3, 1), transform 0.75s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

.site-preloader.loaded {
  opacity: 0;
  transform: scale(1.03);
  pointer-events: none;
}

.preloader-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 340px;
  width: 88%;
  position: relative;
  z-index: 2;
}

.preloader-logo-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 30px;
}

.preloader-badge {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: 0 0 30px rgba(255, 255, 255, 0.15);
  animation: preloaderPulse 2.4s ease-in-out infinite alternate;
}

.preloader-badge img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.preloader-brand {
  font-family: var(--font-heading);
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: #ffffff;
  text-shadow: 0 0 25px rgba(255, 255, 255, 0.35);
}

.preloader-gt {
  font-size: 0.95rem;
  font-weight: 800;
  background: #ffffff;
  color: #000000;
  padding: 2px 7px;
  border-radius: 6px;
  margin-left: 6px;
  vertical-align: middle;
  display: inline-block;
  box-shadow: 0 0 15px rgba(255, 255, 255, 0.4);
}

/* Minimal Ultrafine Progress Bar */
.preloader-progress-track {
  width: 100%;
  height: 2px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 2px;
  overflow: hidden;
  position: relative;
  margin-bottom: 14px;
}

.preloader-progress-bar {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #71717a, #ffffff, #ffffff);
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.85);
  transition: width 0.08s ease-out;
  border-radius: 2px;
}

.preloader-meta-row {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: #71717a;
  letter-spacing: 0.02em;
}

.preloader-percentage {
  font-weight: 600;
  color: #ffffff;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

@keyframes preloaderPulse {
  0% { box-shadow: 0 0 15px rgba(255, 255, 255, 0.1); }
  100% { box-shadow: 0 0 35px rgba(255, 255, 255, 0.35); }
}

/* --------------------------------------------------------------------------
   Keyframe Definitions
   -------------------------------------------------------------------------- */
@keyframes fadeInDown {
  0% {
    opacity: 0;
    transform: translateY(-24px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInUp {
  0% {
    opacity: 0;
    transform: translateY(30px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInScale {
  0% {
    opacity: 0;
    transform: scale(0.92);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes cardDeployLeft {
  0% {
    opacity: 0;
    transform: translateX(-40px) scale(0.9) rotateY(15deg);
  }
  100% {
    opacity: 1;
    transform: translateX(0) scale(1) rotateY(0);
  }
}

@keyframes cardDeployCenterLeft {
  0% {
    opacity: 0;
    transform: translateY(40px) scale(0.9) rotateX(10deg);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1) rotateX(0);
  }
}

@keyframes cardDeployCenterRight {
  0% {
    opacity: 0;
    transform: translateY(40px) scale(0.9) rotateX(10deg);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1) rotateX(0);
  }
}

@keyframes cardDeployRight {
  0% {
    opacity: 0;
    transform: translateX(40px) scale(0.9) rotateY(-15deg);
  }
  100% {
    opacity: 1;
    transform: translateX(0) scale(1) rotateY(0);
  }
}

@keyframes pulseLight {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
    box-shadow: 0 0 10px #ffffff;
  }
  50% {
    opacity: 0.4;
    transform: scale(0.85);
    box-shadow: 0 0 4px #ffffff;
  }
}

@keyframes textShimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

@keyframes floatGentle {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}

@keyframes borderRotate {
  100% {
    transform: rotate(1turn);
  }
}

@keyframes rippleWave {
  0% {
    transform: scale(0.8);
    opacity: 0.8;
  }
  100% {
    transform: scale(2.4);
    opacity: 0;
  }
}

@keyframes audioBar {
  0%, 100% {
    height: 4px;
  }
  50% {
    height: 22px;
  }
}

/* --------------------------------------------------------------------------
   Staggered Entry Animation Classes (Loaded on DOM ready)
   -------------------------------------------------------------------------- */
.anim-initial {
  opacity: 0;
}

/* 1. Header & Logo */
.animate-header {
  animation: fadeInDown 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.15s forwards;
}

/* 2. Badge */
.animate-badge {
  animation: fadeInScale 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.35s forwards;
}

/* 3. Title */
.animate-title {
  animation: fadeInUp 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.5s forwards;
}

/* 4. Subtitle */
.animate-subtitle {
  animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.65s forwards;
}

/* 5. Requirement Search */
.animate-search {
  animation: fadeInScale 0.85s cubic-bezier(0.16, 1, 0.3, 1) 0.8s forwards;
}

/* 6. Service Cards - Center Outward Deployment */
.service-card[data-card-index="0"] {
  animation: cardDeployLeft 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.95s forwards;
}

.service-card[data-card-index="1"] {
  animation: cardDeployCenterLeft 0.9s cubic-bezier(0.16, 1, 0.3, 1) 1.05s forwards;
}

.service-card[data-card-index="2"] {
  animation: cardDeployCenterRight 0.9s cubic-bezier(0.16, 1, 0.3, 1) 1.15s forwards;
}

.service-card[data-card-index="3"] {
  animation: cardDeployRight 0.9s cubic-bezier(0.16, 1, 0.3, 1) 1.25s forwards;
}

/* --------------------------------------------------------------------------
   Interactive Micro-Animations
   -------------------------------------------------------------------------- */
.ripple-fx {
  position: absolute;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.6);
  pointer-events: none;
  animation: rippleWave 0.8s ease-out forwards;
}

/* Audio visualizer bars in Voice AI demo */
.audio-visualizer {
  display: flex;
  align-items: center;
  gap: 3px;
  height: 28px;
}

.audio-visualizer .bar {
  width: 3px;
  background: #ffffff;
  border-radius: 2px;
  height: 4px;
}

.audio-visualizer.playing .bar:nth-child(1) { animation: audioBar 0.8s infinite ease-in-out 0.1s; }
.audio-visualizer.playing .bar:nth-child(2) { animation: audioBar 0.7s infinite ease-in-out 0.25s; }
.audio-visualizer.playing .bar:nth-child(3) { animation: audioBar 0.9s infinite ease-in-out 0.05s; }
.audio-visualizer.playing .bar:nth-child(4) { animation: audioBar 0.6s infinite ease-in-out 0.35s; }
.audio-visualizer.playing .bar:nth-child(5) { animation: audioBar 0.85s infinite ease-in-out 0.15s; }
.audio-visualizer.playing .bar:nth-child(6) { animation: audioBar 0.75s infinite ease-in-out 0.3s; }
.audio-visualizer.playing .bar:nth-child(7) { animation: audioBar 0.65s infinite ease-in-out 0.2s; }
.audio-visualizer.playing .bar:nth-child(8) { animation: audioBar 0.95s infinite ease-in-out 0.1s; }

/* --------------------------------------------------------------------------
   View Transitions API Styling (SPA Smooth Seamless Transitions)
   -------------------------------------------------------------------------- */
::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 0.4s;
  animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
}

::view-transition-old(root) {
  animation-name: spaFadeOut;
}

::view-transition-new(root) {
  animation-name: spaFadeIn;
}

@keyframes spaFadeOut {
  from {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
  to {
    opacity: 0;
    transform: scale(0.98) translateY(-10px);
  }
}

@keyframes spaFadeIn {
  from {
    opacity: 0;
    transform: scale(1.02) translateY(12px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}
