/* Scroll-expand hero — ¿Qué es VIRTU4L? (vanilla scroll-expansion-hero port) */

.vr-scroll-expand {
  --expand-p: 0;
  --media-w: calc(17.5rem + var(--expand-p) * 58rem);
  --media-h: calc(22.5rem + var(--expand-p) * 20rem);
  --title-shift: calc(var(--expand-p) * 8vw);
  position: relative;
  overflow-x: clip;
}

.vr-scroll-expand[data-mobile='1'] {
  --media-w: calc(16.25rem + var(--expand-p) * 26rem);
  --media-h: calc(21.25rem + var(--expand-p) * 8.75rem);
  --title-shift: calc(var(--expand-p) * 10vw);
}

.vr-scroll-expand__spacer {
  position: relative;
  height: 240vh;
}

.vr-scroll-expand__sticky {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100dvh;
  padding: 5rem 1rem 3rem;
  background: transparent;
}

.vr-scroll-expand__head {
  position: relative;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 1.25rem;
  pointer-events: none;
}

.vr-scroll-expand__head .vr-kicker {
  margin-bottom: 0.75rem;
}

.vr-scroll-expand__title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: center;
  gap: 0.35rem 0.65rem;
  max-width: 100%;
}

.vr-scroll-expand__title-row .vr-display-lg {
  margin: 0;
  line-height: 1;
  transition: transform 0.08s linear;
  will-change: transform;
}

.vr-scroll-expand__title-before {
  transform: translateX(calc(-1 * var(--title-shift)));
}

.vr-scroll-expand__title-after {
  transform: translateX(var(--title-shift));
}

.vr-scroll-expand__hint {
  margin: 1rem 0 0;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-secondary);
  transition: opacity 0.15s linear;
}

.vr-scroll-expand__media-outer {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.vr-scroll-expand__media {
  position: relative;
  width: var(--media-w);
  height: var(--media-h);
  max-width: 95vw;
  max-height: 82dvh;
  border-radius: 1rem;
  border: 1px solid var(--border-quiet);
  overflow: hidden;
  background: var(--surface-slate);
  transition:
    width 0.08s linear,
    height 0.08s linear,
    border-color 0.2s ease;
  will-change: width, height;
}

.vr-scroll-expand.is-expanded .vr-scroll-expand__media {
  border-color: color-mix(in srgb, var(--tv-mint) 55%, var(--border-quiet));
}

.vr-scroll-expand__poster {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  opacity: calc(1 - var(--expand-p) * 0.92);
  transition: opacity 0.12s linear;
}

.vr-scroll-expand__media iframe {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  border: 0;
  pointer-events: none;
  background: transparent;
}

.vr-scroll-expand__media.is-fallback iframe {
  display: none;
}

.vr-scroll-expand__yt-link {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transform: translate(-50%, -50%);
  padding: 0.65rem 1.1rem;
  border-radius: 9999px;
  border: 1px solid var(--border-quiet);
  background: var(--tv-mint);
  color: var(--text-absolute);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.vr-scroll-expand__media.is-fallback .vr-scroll-expand__yt-link,
.vr-scroll-expand__media:hover .vr-scroll-expand__yt-link {
  opacity: 1;
  pointer-events: auto;
}

.vr-scroll-expand__yt-link:hover {
  transform: translate(-50%, -50%) scale(1.04);
}

.vr-scroll-expand.is-expanded .vr-scroll-expand__yt-link {
  opacity: 0;
  pointer-events: none;
}

.vr-scroll-expand.is-expanded .vr-scroll-expand__media:hover .vr-scroll-expand__yt-link {
  opacity: 0.9;
  pointer-events: auto;
}

.vr-scroll-expand__scrim {
  pointer-events: none;
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: color-mix(in srgb, var(--canvas) 55%, transparent);
  opacity: calc(0.55 - var(--expand-p) * 0.45);
  transition: opacity 0.12s linear;
}

.vr-scroll-expand__after {
  position: relative;
  z-index: 1;
  max-width: 40rem;
  margin: 0 auto;
  padding: 0 1rem 5rem;
  text-align: center;
  opacity: 0;
  transform: translateY(1.5rem);
  transition:
    opacity 0.55s ease,
    transform 0.55s ease;
  pointer-events: none;
}

.vr-scroll-expand__after.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.vr-scroll-expand__after .vr-body {
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

.vr-scroll-expand__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.65rem;
}

.vr-scroll-expand__stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem 1.25rem;
  margin: 2rem 0 1.75rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--border-quiet);
}

@media (min-width: 640px) {
  .vr-scroll-expand__stats {
    grid-template-columns: repeat(4, 1fr);
  }
}

.vr-scroll-expand__stat-value {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 3vw, 2rem);
  font-weight: 900;
  line-height: 1;
  color: var(--tv-mint);
}

.vr-scroll-expand__stat-label {
  display: block;
  margin-top: 0.25rem;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

@media (prefers-reduced-motion: reduce) {
  .vr-scroll-expand__spacer {
    height: auto;
  }

  .vr-scroll-expand__sticky {
    position: relative;
    min-height: auto;
    padding: 4rem 1rem 2rem;
  }

  .vr-scroll-expand {
    --expand-p: 1;
    --title-shift: 0vw;
  }

  .vr-scroll-expand__title-before,
  .vr-scroll-expand__title-after {
    transform: none;
  }

  .vr-scroll-expand__hint {
    display: none;
  }

  .vr-scroll-expand__media {
    width: min(95vw, 56rem);
    height: min(70dvh, 32rem);
  }

  .vr-scroll-expand__after {
    opacity: 1;
    transform: none;
    pointer-events: auto;
  }
}
