/* VS V44 — carga más ágil, barra funcional y favicon actualizado
   Base: v43. No cambia estructura visual; corrige timing/animación del preloader. */

/* El preloader con barra ya no muestra isotipo: solo palabras + barra + logotipo final */
#vs-preloader.is-first-visit .vs-preloader-mark {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  animation: none !important;
}

/* Palabras del preloader: una sola línea, controladas y legibles */
#vs-preloader .vs-preloader-words span,
#vs-preloader.is-first-visit .vs-preloader-words span,
#vs-preloader.is-returning .vs-preloader-words span {
  white-space: nowrap !important;
  word-break: keep-all !important;
  overflow-wrap: normal !important;
  hyphens: none !important;
  line-height: .96 !important;
  width: max-content !important;
  max-width: none !important;
  text-align: center !important;
}

/* Primera carga: menos eterna, más limpia; no mostrar demasiadas palabras para que se lea bien */
#vs-preloader.is-first-visit .vs-preloader-words span {
  letter-spacing: clamp(.045em, .52vw, .16em) !important;
  font-size: clamp(1.05rem, 5.05vw, 4.35rem) !important;
  animation: vs-word-zoom-v44 1.28s cubic-bezier(.17,.84,.34,1) forwards !important;
}
#vs-preloader.is-first-visit .vs-preloader-words span:nth-child(n+9) { display: none !important; }
#vs-preloader.is-first-visit .vs-preloader-words span:nth-child(1) { animation-delay: .12s !important; }
#vs-preloader.is-first-visit .vs-preloader-words span:nth-child(2) { animation-delay: .64s !important; }
#vs-preloader.is-first-visit .vs-preloader-words span:nth-child(3) { animation-delay: 1.16s !important; }
#vs-preloader.is-first-visit .vs-preloader-words span:nth-child(4) { animation-delay: 1.68s !important; }
#vs-preloader.is-first-visit .vs-preloader-words span:nth-child(5) { animation-delay: 2.20s !important; }
#vs-preloader.is-first-visit .vs-preloader-words span:nth-child(6) { animation-delay: 2.72s !important; }
#vs-preloader.is-first-visit .vs-preloader-words span:nth-child(7) { animation-delay: 3.24s !important; }
#vs-preloader.is-first-visit .vs-preloader-words span:nth-child(8) { animation-delay: 3.76s !important; }

@keyframes vs-word-zoom-v44 {
  0%   { opacity: 0; transform: scale(.82); filter: blur(10px); color: rgba(255,255,255,.04); }
  18%  { opacity: .78; transform: scale(1); filter: blur(0); color: rgba(255,255,255,.78); }
  58%  { opacity: .62; transform: scale(1.18); filter: blur(0); color: rgba(255,255,255,.62); }
  100% { opacity: 0; transform: scale(1.75); filter: blur(18px); color: rgba(0,207,104,.18); }
}

/* Barra: más visible y controlada por JS para que siempre avance */
#vs-preloader.is-first-visit .vs-preloader-progress {
  display: block !important;
  position: relative !important;
  z-index: 5 !important;
  width: min(560px, 58vw) !important;
  height: 3px !important;
  margin-top: clamp(5.7rem, 13vh, 8.2rem) !important;
  background: rgba(255,255,255,.13) !important;
  overflow: hidden !important;
}
#vs-preloader.is-first-visit .vs-preloader-progress span {
  animation: none !important;
  transform: scaleX(0) !important;
  transform-origin: left center !important;
  transition: none !important;
  background: linear-gradient(90deg, rgba(0,207,104,.18), rgba(0,207,104,1), rgba(255,255,255,.86)) !important;
  box-shadow: 0 0 18px rgba(0,207,104,.30) !important;
}
#vs-preloader.is-first-visit.is-progress-running .vs-preloader-progress span {
  transform: scaleX(1) !important;
  transition: transform var(--vs-progress-time, 5.15s) cubic-bezier(.18,.82,.22,1) !important;
}
#vs-preloader.is-first-visit .vs-preloader-caption {
  margin-top: .95rem !important;
  animation: vs-preloader-ui-out .42s ease 4.75s forwards !important;
}
#vs-preloader.is-first-visit .vs-preloader-progress {
  animation: vs-preloader-ui-out .42s ease 4.75s forwards !important;
}

/* Cierre: logotipo final entra después de palabras/barra, nítido, luego desenfoque */
#vs-preloader.is-first-visit .vs-preloader-final-logo {
  width: min(520px, 68vw) !important;
  animation: vs-final-logo-focus-blur 1.28s cubic-bezier(.2,.8,.2,1) 5.02s forwards !important;
}
#vs-preloader.is-returning .vs-preloader-final-logo {
  width: min(440px, 66vw) !important;
  animation: vs-final-logo-focus-blur 1.30s cubic-bezier(.2,.8,.2,1) 4.62s forwards !important;
}

/* Segundo preloader: solo palabras secuenciales + logotipo; ritmo más suave, sin superposición */
#vs-preloader.is-returning .vs-preloader-mark,
#vs-preloader.is-returning .vs-preloader-progress,
#vs-preloader.is-returning .vs-preloader-caption {
  display: none !important;
  animation: none !important;
}
#vs-preloader.is-returning .vs-preloader-words span {
  letter-spacing: clamp(.04em, .50vw, .16em) !important;
  font-size: clamp(1rem, 4.15vw, 3.2rem) !important;
  animation: vs-word-single-soft-v44 .86s cubic-bezier(.19,.78,.25,1) both !important;
}
#vs-preloader.is-returning .vs-preloader-words span:nth-child(n+7) { display: none !important; }
#vs-preloader.is-returning .vs-preloader-words span:nth-child(1) { animation-delay: .20s !important; }
#vs-preloader.is-returning .vs-preloader-words span:nth-child(2) { animation-delay: .98s !important; }
#vs-preloader.is-returning .vs-preloader-words span:nth-child(3) { animation-delay: 1.76s !important; }
#vs-preloader.is-returning .vs-preloader-words span:nth-child(4) { animation-delay: 2.54s !important; }
#vs-preloader.is-returning .vs-preloader-words span:nth-child(5) { animation-delay: 3.32s !important; }
#vs-preloader.is-returning .vs-preloader-words span:nth-child(6) { animation-delay: 4.10s !important; }
@keyframes vs-word-single-soft-v44 {
  0%   { opacity: 0; transform: scale(.96); filter: blur(8px); color: rgba(255,255,255,.04); }
  24%  { opacity: .94; transform: scale(1); filter: blur(0); color: rgba(255,255,255,.88); }
  68%  { opacity: .90; transform: scale(1.02); filter: blur(0); color: rgba(255,255,255,.82); }
  100% { opacity: 0; transform: scale(1.14); filter: blur(15px); color: rgba(0,207,104,.22); }
}

@media screen and (max-width: 736px) {
  #vs-preloader .vs-preloader-stage { width: calc(100vw - 1.25rem) !important; height: 62svh !important; }
  #vs-preloader.is-first-visit .vs-preloader-words span,
  #vs-preloader.is-returning .vs-preloader-words span {
    letter-spacing: .04em !important;
    font-size: clamp(.92rem, 5.2vw, 2.05rem) !important;
  }
  #vs-preloader.is-first-visit .vs-preloader-progress {
    width: min(72vw, 22rem) !important;
    margin-top: clamp(5.2rem, 12vh, 7rem) !important;
  }
  .vs-preloader-final-logo,
  #vs-preloader.is-first-visit .vs-preloader-final-logo,
  #vs-preloader.is-returning .vs-preloader-final-logo {
    width: min(300px, 74vw) !important;
  }
}

@media screen and (max-width: 380px) {
  #vs-preloader.is-first-visit .vs-preloader-words span,
  #vs-preloader.is-returning .vs-preloader-words span {
    letter-spacing: .025em !important;
    font-size: clamp(.86rem, 4.85vw, 1.7rem) !important;
  }
}
