/* ─────────────────────────────────────────────────────────────────
   IMMAC — "TRES CAPAS, UNA VÍA": animación de fotogramas al hacer scroll
   (entre el hero y la Planta de producción del inicio)
   Fotogramas: frames-mezclas/d (1600×900) y frames-mezclas/m (720×960, vertical)
───────────────────────────────────────────────────────────────── */
.mx-scroll {
  --mx-feather: 240px;
  --mx-ink: #0E1318;
  --mx-muted: #4A5568;
  --mx-accent: #0A5F9A;
  position: relative;
  z-index: 14;
  height: 440vh;
  margin-top: calc(-1 * var(--mx-feather));
  background: transparent;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.mx-sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  height: 100lvh;   /* pantalla completa también cuando se esconde la barra del navegador */
  overflow: hidden;
  background: #D9D5CA;
}

/* Fondo de respaldo (primer fotograma) y canvas animado */
.mx-poster,
.mx-poster img,
.mx-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.mx-poster img { object-fit: cover; }
.mx-canvas { opacity: 0; transition: opacity 0.6s ease; }
.mx-scroll.is-ready .mx-canvas { opacity: 1; }

/* Velo suave para que el texto se lea sobre el fondo claro */
.mx-veil {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
/* Dos capas fijas: solo cambia su opacidad (no se redibuja el degradado al hacer scroll) */
.mx-veil::before,
.mx-veil::after {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0;
  will-change: opacity;
}
.mx-veil::before { background: linear-gradient(90deg, rgba(236, 233, 225, 0.72) 0%, rgba(236, 233, 225, 0) 46%); opacity: var(--mx-veil-l, 1); }
.mx-veil::after { background: linear-gradient(270deg, rgba(236, 233, 225, 0.72) 0%, rgba(236, 233, 225, 0) 46%); opacity: var(--mx-veil-r, 0); }

/* Velo de entrada: mientras la sección se funde con el hero solo se ve el fondo claro;
   la muestra MDC-25 y las etiquetas aparecen cuando la sección ya cubre la pantalla */
.mx-cover {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: #D9D5CA;               /* el color real del borde lo pone el script una sola vez */
  opacity: 0;
  will-change: opacity;
}

/* Marca superior y progreso */
.mx-top {
  position: absolute;
  left: clamp(24px, 4vw, 64px);
  right: clamp(24px, 4vw, 64px);
  top: 104px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: rgba(14, 19, 24, 0.62);
  z-index: 1;
}

.mx-top h2 { max-width: min(660px, 62vw); margin: 0; font: inherit; line-height: 1.7; letter-spacing: inherit; color: inherit; text-transform: inherit; }
.mx-top b { color: var(--mx-accent); font-weight: 700; }

.mx-steps { display: flex; gap: 10px; list-style: none; margin: 0; padding: 0; }

.mx-steps li {
  position: relative;
  width: 64px;
  padding-top: 12px;
  font-size: 10px;
  letter-spacing: 0.16em;
  color: rgba(14, 19, 24, 0.45);
  transition: color 0.4s ease;
}

.mx-steps li::before,
.mx-steps li::after {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  height: 2px;
  border-radius: 2px;
}

.mx-steps li::before { right: 0; background: rgba(14, 19, 24, 0.14); }
.mx-steps li::after { width: 100%; background: var(--mx-accent); transform: scaleX(var(--fill, 0)); transform-origin: left center; }
.mx-steps li.is-on { color: var(--mx-ink); }

/* Textos de cada mezcla */
.mx-copy {
  position: absolute;
  top: 50%;
  left: clamp(24px, 6vw, 110px);
  width: min(460px, 38vw);
  translate: 0 calc(-50% + 28px);   /* posición y opacidad las escribe js/mezclas-scroll.js */
  opacity: 0;
  color: var(--mx-ink);
  pointer-events: none;
  will-change: opacity, translate;
}

.mx-copy--right { left: auto; right: clamp(24px, 6vw, 110px); }

.mx-tag {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--mx-accent);
}

.mx-tag span {
  padding: 4px 10px;
  border-radius: 4px;
  color: var(--mx-accent);
  background: rgba(63, 180, 230, 0.12);
  border: 1px solid rgba(10, 95, 154, 0.3);
}

.mx-name {
  font-size: clamp(56px, 7.4vw, 116px);
  font-weight: 800;
  line-height: 0.92;
  letter-spacing: -0.045em;
  color: var(--mx-ink);
}

.mx-type {
  margin-top: 14px;
  font-size: clamp(16px, 1.3vw, 20px);
  font-weight: 600;
  color: var(--mx-accent);
}

.mx-desc {
  margin-top: 12px;
  font-size: clamp(15px, 1.1vw, 17px);
  line-height: 1.65;
  color: var(--mx-muted);
}

.mx-specs {
  display: grid;
  grid-template-columns: repeat(3, auto);
  justify-content: start;
  gap: 8px 26px;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid rgba(14, 19, 24, 0.14);
}

.mx-specs dt {
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(14, 19, 24, 0.55);
}

.mx-specs dd { margin: 4px 0 0; font-size: 14px; font-weight: 600; color: var(--mx-ink); }

/* Indicador para seguir bajando (solo al inicio) */
.mx-hint {
  z-index: 1;
  position: absolute;
  left: 50%;
  bottom: calc(28px + var(--tb, 0px));
  translate: -50% 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: rgba(14, 19, 24, 0.55);
  pointer-events: none;
}

.mx-hint i {
  width: 1px;
  height: 34px;
  background: linear-gradient(180deg, rgba(14, 19, 24, 0), rgba(14, 19, 24, 0.5));
  animation: mx-drop 1.8s ease-in-out infinite;
  transform-origin: top;
}

@keyframes mx-drop {
  0% { transform: scaleY(0); opacity: 0; }
  40% { transform: scaleY(1); opacity: 1; }
  100% { transform: scaleY(1) translateY(14px); opacity: 0; }
}

/* ── Pantallas verticales: el encuadre sigue a cada muestra y el texto va abajo ── */
@media (max-aspect-ratio: 4/5) {
  .mx-scroll { height: 400vh; }
  .mx-poster img { object-fit: contain; object-position: 50% 22%; }
  .mx-top { top: 92px; flex-direction: column; align-items: flex-start; }
  .mx-veil {
    background:
      /* arriba: el texto de la sección se lee sobre la muestra */
      linear-gradient(180deg, rgba(236, 233, 225, 0.97) 0%, rgba(236, 233, 225, 0.92) 24%, rgba(236, 233, 225, 0.55) 32%, rgba(236, 233, 225, 0) 40%),
      linear-gradient(0deg, rgba(236, 233, 225, 0.97) 0%, rgba(236, 233, 225, 0.9) 34%, rgba(236, 233, 225, 0) 58%);
  }
  .mx-veil::before, .mx-veil::after { display: none; }
  .mx-copy,
  .mx-copy--right {
    top: auto;
    bottom: calc(max(34px, env(safe-area-inset-bottom)) + var(--tb, 0px));
    left: 20px;
    right: 20px;
    width: auto;
    translate: 0 24px;
  }
  .mx-name { font-size: clamp(48px, 15vw, 72px); }
  .mx-desc { display: none; }
  .mx-specs { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px 14px; margin-top: 16px; padding-top: 14px; }
  .mx-specs dd { font-size: 13px; }
  .mx-hint { display: none; }
}

@media (max-width: 380px) {
  .mx-specs dd { font-size: 12px; }
  .mx-tag { font-size: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .mx-copy { translate: 0 -50%; }
  .mx-hint i { animation: none; }
}

@media (prefers-reduced-motion: reduce) and (max-aspect-ratio: 4/5) {
  .mx-copy, .mx-copy--right { translate: none; }
}

/* Alto de la barra del navegador en el celular (0 en computador) */
.mx-scroll { --tb: 0px; }
@supports (height: 100lvh) {
  .mx-scroll { --tb: calc(100lvh - 100svh); }
}
