/* mateojaramillo.com — movimiento
   Todo vive bajo .js-motion: si el JavaScript no carga o el visitante pidió
   reducir el movimiento, la página se ve completa y quieta. */

/* ---------- Reloj del partido y barra de progreso ---------- */

.mj-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: var(--accent);
  transform-origin: 0 50%;
  transform: scaleX(var(--progress, 0));
}
.js-motion .site-header .wrap {
  gap: 12px;
}
.js-motion .site-header .brand {
  margin-right: auto;
}
.mj-clock {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 11px;
  border-radius: 999px;
  background: var(--paper-2);
  color: var(--ink);
  font: 600 0.82rem/1 var(--sans);
  font-variant-numeric: tabular-nums;
  min-width: 4.4em;
  justify-content: center;
}
.mj-clock::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  animation: mj-pulse 1.6s ease-in-out infinite;
}
@keyframes mj-pulse {
  50% { opacity: 0.25; }
}

/* ---------- Aparición general ---------- */

/* Lo que entra desde un costado no debe crear scroll horizontal (clip no rompe el sticky) */
.js-motion main {
  overflow-x: clip;
}

.js-motion .rv {
  opacity: 0;
  transform: translateY(28px);
  transition:
    opacity 0.8s ease,
    transform 1s cubic-bezier(0.2, 0.8, 0.2, 1);
  transition-delay: var(--d, 0ms);
}
.js-motion .rv.from-right {
  transform: translateX(56px);
}
.js-motion .rv.in {
  opacity: 1;
  transform: none;
}

/* ---------- Portada ---------- */

.mj-w {
  display: inline-block;
}
.js-motion .mj-w {
  opacity: 0;
  transform: translateY(0.45em);
  filter: blur(8px);
  transition:
    opacity 0.7s ease,
    transform 0.9s cubic-bezier(0.2, 0.8, 0.2, 1),
    filter 0.7s ease;
}
.js-motion .mj-w.in {
  opacity: 1;
  transform: none;
  filter: none;
}
.mj-flap span {
  display: inline-block;
  text-align: center;
}

.js-motion .hero h1 {
  translate: 0 calc(var(--hy, 0) * -1px);
  opacity: calc(1 - var(--ho, 0));
}

/* Foto, recuadro y nombre se desplazan como un solo bloque para que nada tape
   al nombre; en móvil la foto va debajo del botón y no hay espacio para moverla */
@media (min-width: 861px) {
  .js-motion .portrait {
    translate: 0 calc(var(--py, 0) * -0.5px);
  }
}
.js-motion .portrait img {
  clip-path: inset(100% 0 0 0 round 8px);
  transition: clip-path 1.2s cubic-bezier(0.7, 0, 0.2, 1);
}
.js-motion .portrait .frame::before {
  opacity: 0;
  transform: translate(-16px, -16px);
  transition:
    opacity 0.6s ease 0.7s,
    transform 1s cubic-bezier(0.2, 0.8, 0.2, 1) 0.7s;
}
.js-motion .portrait figcaption {
  opacity: 0;
  transition: opacity 0.8s ease 1.1s;
}
.js-motion .portrait.in img {
  clip-path: inset(0 0 0 0 round 8px);
}
.js-motion .portrait.in .frame::before {
  opacity: 1;
  transform: none;
}
.js-motion .portrait.in figcaption {
  opacity: 1;
}

/* Botón magnético */
.js-motion .btn {
  translate: var(--mx, 0) var(--my, 0);
  transition:
    background-color 0.15s ease,
    translate 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* WhatsApp flotante */
.js-motion .wa {
  opacity: 0;
  scale: 0.6;
  transition:
    background-color 0.15s ease,
    opacity 0.5s ease,
    scale 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.js-motion .wa.in {
  opacity: 1;
  scale: 1;
}

/* ---------- Estadio: se abre al bajar y una luz sigue al cursor ---------- */

.js-motion .stadium {
  clip-path: inset(0 calc((1 - var(--reveal, 1)) * 5vw) round calc((1 - var(--reveal, 1)) * 40px));
}
.js-motion .stadium::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(520px circle at var(--sx, 75%) var(--sy, 35%), color-mix(in srgb, var(--signal) 10%, transparent), transparent 65%);
  transition: opacity 0.4s ease;
}
.js-motion .stadium .wrap {
  z-index: 1;
}

/* ---------- Informe: cada fila se prende al pasar ---------- */

.js-motion .ledger li {
  transition: opacity 0.6s ease;
}
.js-motion .ledger li:not(.lit) {
  opacity: 0.22;
}
@media (min-width: 861px) {
  .js-motion .ledger li {
    min-height: 34vh;
    align-content: center;
  }
}
/* ---------- Primera cita ---------- */

.js-motion .big-number b {
  font-variant-numeric: tabular-nums;
}
.js-motion .steps li::after {
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 1s cubic-bezier(0.2, 0.8, 0.2, 1) 0.15s;
}
.js-motion .steps li::before {
  transition:
    background-color 0.4s ease,
    color 0.4s ease;
}
.js-motion .steps li.reached::after {
  transform: scaleY(1);
}
.js-motion .steps li.reached::before {
  background: var(--ink);
  color: var(--paper);
}


@media (max-width: 340px) {
  .mj-clock {
    display: none;
  }
}
