/* VS V45 — corrección estable: Home + preloader tipo v31 mejorado
   Base: v44. Esta capa evita regresiones visuales acumuladas. */

/* HOME: recuperar tamaño editorial estable del titular del inicio */
#banner.vs-hero .inner.hero-copy {
  transform: translateY(2.1em) !important;
}
#banner.vs-hero h2.hero-title,
#banner.vs-hero h2 {
  font-size: clamp(1.72em, 3.65vw, 3.28em) !important;
  line-height: 1.13 !important;
  letter-spacing: 0.052em !important;
  max-width: 11.6em !important;
  overflow-wrap: normal !important;
  word-break: normal !important;
}
#banner.vs-hero h2 .hero-title-primary { color: #fff !important; }
#banner.vs-hero h2 .hero-title-secondary { color: #12ef83 !important; }

@media screen and (max-width: 980px) {
  #banner.vs-hero h2.hero-title,
  #banner.vs-hero h2 {
    font-size: clamp(1.78rem, 6.6vw, 3.45rem) !important;
    line-height: 1.08 !important;
    max-width: 10.8em !important;
  }
}
@media screen and (max-width: 736px) {
  #banner.vs-hero {
    align-items: center !important;
    padding-top: calc(var(--vs-header-h-mobile, 3.55rem) + 1.1rem) !important;
  }
  #banner.vs-hero .inner.hero-copy {
    transform: translateY(.85em) !important;
  }
  #banner.vs-hero h2.hero-title,
  #banner.vs-hero h2 {
    font-size: clamp(1.52rem, 8.2vw, 2.45rem) !important;
    line-height: 1.08 !important;
    max-width: 10.2em !important;
    letter-spacing: .045em !important;
  }
}
@media screen and (max-width: 420px) {
  #banner.vs-hero h2.hero-title,
  #banner.vs-hero h2 {
    font-size: clamp(1.36rem, 7.75vw, 2.05rem) !important;
  }
}

/* PRELOADER: estilo v31, pero respetando cambios finales.
   - Solo home.
   - Primera carga: palabras + barra + logotipo final. Sin isotipo.
   - Recarga/entrada posterior: palabras secuenciales + logotipo final. Sin barra ni isotipo.
   - Palabras en una sola línea en PC y responsive. */
#vs-preloader {
  background:
    radial-gradient(circle at 50% 48%, rgba(0,207,104,.13), rgba(0,207,104,.055) 22%, rgba(5,5,5,.985) 52%, #050505 100%) !important;
}
#vs-preloader::before {
  animation: vs-loader-light-sweep-v45 7.2s ease-in-out forwards !important;
}
#vs-preloader .vs-preloader-stage {
  width: min(820px, 88vw) !important;
  height: min(470px, 74vh) !important;
}

/* Nunca mostrar isotipo dentro de ningún preloader */
#vs-preloader .vs-preloader-mark,
#vs-preloader.is-first-visit .vs-preloader-mark,
#vs-preloader.is-returning .vs-preloader-mark {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  animation: none !important;
}

#vs-preloader .vs-preloader-words {
  position: absolute !important;
  inset: 0 !important;
  display: grid !important;
  place-items: center !important;
  z-index: 2 !important;
  pointer-events: none !important;
}
#vs-preloader .vs-preloader-words span {
  position: absolute !important;
  display: block !important;
  white-space: nowrap !important;
  word-break: keep-all !important;
  overflow-wrap: normal !important;
  hyphens: none !important;
  max-width: 96vw !important;
  width: auto !important;
  line-height: .95 !important;
  font-weight: 800 !important;
  text-transform: uppercase !important;
  text-align: center !important;
  opacity: 0;
}

/* Primera carga: zoom profundo, elegante, parecido a v31 pero más controlado */
#vs-preloader.is-first-visit .vs-preloader-words span {
  letter-spacing: clamp(.07em, .70vw, .24em) !important;
  font-size: clamp(1.12rem, 5.45vw, 5.2rem) !important;
  color: rgba(255,255,255,.16) !important;
  filter: blur(14px);
  transform: translate3d(0,0,0) scale(.42);
  animation: vs-word-zoom-v45 1.84s cubic-bezier(.17,.84,.34,1) forwards !important;
}
#vs-preloader.is-first-visit .vs-preloader-words span:nth-child(n+8) { display: none !important; }
#vs-preloader.is-first-visit .vs-preloader-words span:nth-child(1) { animation-delay: .14s !important; }
#vs-preloader.is-first-visit .vs-preloader-words span:nth-child(2) { animation-delay: .80s !important; }
#vs-preloader.is-first-visit .vs-preloader-words span:nth-child(3) { animation-delay: 1.46s !important; }
#vs-preloader.is-first-visit .vs-preloader-words span:nth-child(4) { animation-delay: 2.12s !important; }
#vs-preloader.is-first-visit .vs-preloader-words span:nth-child(5) { animation-delay: 2.78s !important; }
#vs-preloader.is-first-visit .vs-preloader-words span:nth-child(6) { animation-delay: 3.44s !important; }
#vs-preloader.is-first-visit .vs-preloader-words span:nth-child(7) { animation-delay: 4.10s !important; }

@keyframes vs-word-zoom-v45 {
  0%   { opacity: 0; transform: scale(.42); filter: blur(16px); color: rgba(255,255,255,.05); }
  12%  { opacity: .48; filter: blur(5px); color: rgba(255,255,255,.22); }
  34%  { opacity: .27; transform: scale(1.52); filter: blur(2px); }
  62%  { opacity: .13; transform: scale(3.55); filter: blur(10px); color: rgba(0,207,104,.16); }
  100% { opacity: 0; transform: scale(6.3); filter: blur(28px); color: rgba(255,255,255,0); }
}

/* Barra de primera carga: debe correr siempre y ser visible */
#vs-preloader.is-first-visit .vs-preloader-progress {
  display: block !important;
  position: relative !important;
  z-index: 5 !important;
  width: min(540px, 54vw) !important;
  height: 2px !important;
  margin-top: clamp(5.25rem, 12vh, 7.7rem) !important;
  background: rgba(255,255,255,.11) !important;
  border-radius: 999px !important;
  overflow: hidden !important;
  box-shadow: 0 0 18px rgba(0,207,104,.06) !important;
  animation: vs-preloader-ui-out-v45 .48s ease 5.56s forwards !important;
}
#vs-preloader.is-first-visit .vs-preloader-progress span {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  transform-origin: left center !important;
  transform: scaleX(0) !important;
  transition: none !important;
  background: linear-gradient(90deg, rgba(0,207,104,.05), rgba(0,207,104,.95), rgba(255,255,255,.76)) !important;
  animation: vs-loader-progress-v45 5.45s cubic-bezier(.19,1,.22,1) .12s forwards !important;
}
#vs-preloader.is-first-visit .vs-preloader-caption {
  display: block !important;
  position: relative !important;
  z-index: 5 !important;
  margin-top: 1rem !important;
  animation: vs-preloader-ui-out-v45 .48s ease 5.56s forwards !important;
}
@keyframes vs-loader-progress-v45 { to { transform: scaleX(1); } }
@keyframes vs-preloader-ui-out-v45 { to { opacity: 0; filter: blur(8px); } }

/* Segundo preloader: solo palabras, una por una, sin superposición */
#vs-preloader.is-returning .vs-preloader-progress,
#vs-preloader.is-returning .vs-preloader-caption {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  animation: none !important;
}
#vs-preloader.is-returning .vs-preloader-words span {
  letter-spacing: clamp(.06em, .58vw, .18em) !important;
  font-size: clamp(1.05rem, 4.55vw, 3.4rem) !important;
  color: rgba(255,255,255,.85) !important;
  animation: vs-word-single-v45 1.02s cubic-bezier(.19,.78,.25,1) both !important;
}
#vs-preloader.is-returning .vs-preloader-words span:nth-child(n+6) { display: none !important; }
#vs-preloader.is-returning .vs-preloader-words span:nth-child(1) { animation-delay: .18s !important; }
#vs-preloader.is-returning .vs-preloader-words span:nth-child(2) { animation-delay: 1.18s !important; }
#vs-preloader.is-returning .vs-preloader-words span:nth-child(3) { animation-delay: 2.18s !important; }
#vs-preloader.is-returning .vs-preloader-words span:nth-child(4) { animation-delay: 3.18s !important; }
#vs-preloader.is-returning .vs-preloader-words span:nth-child(5) { animation-delay: 4.18s !important; }
@keyframes vs-word-single-v45 {
  0%   { opacity: 0; transform: scale(.96); filter: blur(8px); color: rgba(255,255,255,.05); }
  24%  { opacity: .94; transform: scale(1); filter: blur(0); color: rgba(255,255,255,.90); }
  66%  { opacity: .90; transform: scale(1.015); filter: blur(0); color: rgba(255,255,255,.82); }
  100% { opacity: 0; transform: scale(1.16); filter: blur(16px); color: rgba(0,207,104,.22); }
}

/* Logotipo final: aparece después de palabras/barra, luego desenfoca */
#vs-preloader.is-first-visit .vs-preloader-final-logo {
  width: min(520px, 68vw) !important;
  animation: vs-final-logo-v45 1.28s cubic-bezier(.2,.8,.2,1) 6.00s forwards !important;
}
#vs-preloader.is-returning .vs-preloader-final-logo {
  width: min(460px, 68vw) !important;
  animation: vs-final-logo-v45 1.22s cubic-bezier(.2,.8,.2,1) 5.28s forwards !important;
}
@keyframes vs-final-logo-v45 {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(.90); filter: blur(18px); }
  24% { opacity: 1; transform: translate(-50%, -50%) scale(1); filter: blur(0); }
  62% { opacity: 1; transform: translate(-50%, -50%) scale(1); filter: blur(0); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1.055); filter: blur(18px); }
}
@keyframes vs-loader-light-sweep-v45 {
  0% { transform: translateX(-8%) rotate(-8deg); opacity: .38; }
  46% { opacity: .88; }
  100% { transform: translateX(8%) rotate(-8deg); opacity: .56; }
}

/* La web aparece inmediatamente después del cierre del logo, desde desenfoque a enfoque */
html.vs-site-revealing #page-wrapper {
  visibility: visible !important;
  opacity: 1 !important;
  filter: blur(10px) saturate(.9);
  transform: scale(1.012);
  transition: filter .46s ease, transform .46s ease, opacity .46s ease;
}
html.vs-site-revealing.vs-site-revealed #page-wrapper {
  filter: blur(0) saturate(1);
  transform: scale(1);
}

@media screen and (max-width: 736px) {
  #vs-preloader .vs-preloader-stage {
    width: calc(100vw - 1.2rem) !important;
    height: 62svh !important;
  }
  #vs-preloader.is-first-visit .vs-preloader-words span,
  #vs-preloader.is-returning .vs-preloader-words span {
    letter-spacing: .045em !important;
    font-size: clamp(.96rem, 7.25vw, 2.25rem) !important;
    max-width: 94vw !important;
  }
  #vs-preloader.is-first-visit .vs-preloader-progress {
    width: min(72vw, 22rem) !important;
    margin-top: clamp(5.1rem, 12vh, 7rem) !important;
  }
  #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(.82rem, 6.2vw, 1.65rem) !important;
  }
}
