/* Capa de movimiento (3-dic-2026), referencia camilocorrea.co.
   No agrega palabras: sólo diseño y animación encima de la portada.
   Todo estado inicial va colgado de html.mv, que pone movimiento.js. Sin JS o con
   «reducir movimiento» la página queda exactamente como antes. Se quita borrando
   las dos líneas que la cargan en index.html y en/index.html. */

/* Letra del hero más grande y apretada, como la referencia */
/* 6vw = el mismo tamaño de antes a 1280 (el enlace de WhatsApp tiene que verse sin bajar);
   crece sólo en pantallas más anchas */
.hero-h1 { font-size: clamp(3rem, 6vw, 5.8rem); letter-spacing: -.012em; }
.h2 { font-size: clamp(2.3rem, 5vw, 4.2rem); }

/* Títulos que suben línea por línea desde una máscara.
   El relleno arriba es para que la tilde de «Á» no quede cortada por la máscara. */
.ln { display: block; overflow: hidden; padding: .14em 0 .04em; margin: -.14em 0 -.04em; }
.ln-i { display: block; }
.mv .mv-split .ln-i { transform: translateY(108%) rotate(2deg); transform-origin: 0 100%; }
.mv .mv-split.mv-in .ln-i {
  transform: none;
  transition: transform 1.05s cubic-bezier(.16,1,.3,1);
  transition-delay: calc(var(--i, 0) * 110ms);
}

/* Entrada del hero: lo de abajo del título sube en cascada */
@keyframes mv-up { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: none; } }
.mv .hero > div:first-child > :not(h1) { animation: mv-up .9s cubic-bezier(.16,1,.3,1) both; }
.mv .hero > div:first-child > :nth-child(2) { animation-delay: .35s; }
.mv .hero > div:first-child > :nth-child(3) { animation-delay: .45s; }
.mv .hero > div:first-child > :nth-child(4) { animation-delay: .52s; }
.mv .hero > div:first-child > :nth-child(5) { animation-delay: .6s; }
.mv .hero > div:first-child > :nth-child(6) { animation-delay: .68s; }
.mv .hero > div:first-child > :nth-child(n+7) { animation-delay: .76s; }

/* Foto: entra con un acercamiento lento (sin opacidad, para no atrasar la carga visible)
   y luego se mueve un poco más lento que la página al bajar */
@keyframes mv-zoom { from { transform: scale(1.14); } to { transform: scale(1); } }
.mv .hero-photo { animation: mv-zoom 1.6s cubic-bezier(.16,1,.3,1) both; }
.mv .hero-photo-wrap { will-change: transform; }
@keyframes mv-badge { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.mv .hero-photo-badge { animation: mv-badge .8s .9s cubic-bezier(.16,1,.3,1) both; }

/* Cinta de trabajos que corre sola debajo del hero (decorativa, aria-hidden) */
.mv-marquee {
  position: relative; overflow: hidden; padding: .5rem 0 1.5rem;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.mv-track { display: flex; gap: 1rem; width: max-content; animation: mv-run 55s linear infinite; }
.mv-marquee:hover .mv-track { animation-play-state: paused; }
.mv-tile {
  flex: 0 0 auto; width: clamp(220px, 24vw, 340px); aspect-ratio: 16/10;
  border-radius: 8px; border: 1px solid var(--border);
  background: var(--panel-2) center top / cover no-repeat;
  box-shadow: 0 20px 40px -24px rgba(0,0,0,.7);
  transition: transform .5s cubic-bezier(.16,1,.3,1), border-color .3s ease;
}
.mv-tile:nth-child(even) { transform: translateY(14px); }
.mv-marquee:hover .mv-tile:hover { transform: translateY(-6px) scale(1.03); border-color: var(--gold); }
@keyframes mv-run { to { transform: translateX(-50%); } }

/* Trabajos: la foto se acerca al pasar el mouse */
.work { overflow: hidden; }
.work-shot { transition: transform .8s cubic-bezier(.16,1,.3,1), filter .4s ease; }
.work:hover .work-shot { transform: scale(1.06); }
.work-open { transition: letter-spacing .35s ease, color .25s ease; }
.work:hover .work-open { letter-spacing: .08em; color: var(--gold); }

/* Círculo que sigue al mouse sobre los trabajos (sólo con mouse) */
.mv-cursor {
  position: fixed; left: 0; top: 0; z-index: 90; pointer-events: none;
  width: 84px; height: 84px; margin: -42px 0 0 -42px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--gold); color: #0A0908; font-size: 1.6rem; font-weight: 700;
  transform: translate3d(var(--x, -200px), var(--y, -200px), 0) scale(0);
  transition: transform .45s cubic-bezier(.16,1,.3,1);
}
.mv-cursor.on { transform: translate3d(var(--x), var(--y), 0) scale(1); }

/* Productos: luz dorada que sigue al mouse y número que se enciende */
.mv .product {
  background-image: radial-gradient(380px circle at var(--mx, -999px) var(--my, -999px), var(--glow), transparent 45%);
}
.mv .product.featured {
  background-image:
    radial-gradient(380px circle at var(--mx, -999px) var(--my, -999px), var(--glow), transparent 45%),
    linear-gradient(160deg, var(--panel) 0%, var(--panel-2) 100%);
}
.product-num { transition: color .3s ease, transform .5s cubic-bezier(.16,1,.3,1); }
.product:hover .product-num { color: var(--gold); transform: translateX(6px); }
.product-link { transition: letter-spacing .35s ease; }
.product:hover .product-link { letter-spacing: .06em; }

/* Aparición con un poco más de recorrido y la curva de la referencia */
.mv .reveal { transform: translateY(36px); transition: opacity .9s cubic-bezier(.16,1,.3,1), transform .9s cubic-bezier(.16,1,.3,1); }
.mv .reveal.on { transform: none; }

/* Barra de arriba: se esconde al bajar y vuelve al subir */
nav { transition: background .25s ease, padding .25s ease, transform .45s cubic-bezier(.16,1,.3,1); }
nav.mv-hide { transform: translateY(-100%); }

/* Botones que se dejan atraer por el mouse */
.mv .btn-primary, .mv .nav-cta { transition: background .2s ease, transform .35s cubic-bezier(.16,1,.3,1); }

@media (prefers-reduced-motion: reduce) {
  .mv-track { animation: none; }
  .mv-cursor { display: none; }
}

/* ─── Cambios de pantalla (3-dic-2026, 2ª vuelta) ───
   Cada sección es un panel de borde a borde. Al entrar se abre como una ventana que
   crece hasta llenar la pantalla; la que se va se encoge un poco y se oscurece debajo.
   Colores: hero oscuro → trabajos panel → franja dorada inclinada → productos →
   «sobre mí» en el tema contrario (crema si la página es oscura) → contacto.
   Todo con animaciones atadas al scroll del propio navegador (sin librerías).
   Donde el navegador no las tiene, quedan los colores y los bordes, sin movimiento. */
.mv .mv-pan { isolation: isolate; color: var(--ink); }
.mv .mv-pan::before, .mv .mv-pan::after {
  content: ""; position: absolute; top: 0; bottom: 0; left: 50%; width: 100vw;
  transform: translateX(-50%); pointer-events: none;
}
.mv .mv-pan::before { z-index: -1; background: var(--bg); }
.mv .mv-pan::after { z-index: 3; background: #000; opacity: 0; }
.mv .mv-pan:not(.hero) { margin-top: -3rem; padding-top: 8rem; }
.mv .mv-pan:not(.hero)::before {
  border-radius: 3rem 3rem 0 0;
  box-shadow: 0 -40px 80px -40px rgba(0,0,0,.75);
  border-top: 1px solid var(--border);
}
.mv #trabajos::before { background: var(--panel); }
.mv .mv-marquee { padding-bottom: 4rem; }

/* Franja dorada inclinada entre trabajos y productos */
.mv .trust {
  position: relative; z-index: 2; margin: 3rem -6vw 0; padding: 2.6rem 6vw; outline: 1px solid transparent; backface-visibility: hidden;
  background: #D4A030; border: 0; rotate: -2deg; overflow: hidden;
}
.mv .trust .trust-label { color: #3B2A0C; }
.mv .trust .trust-line {
  color: #0A0908; font-size: clamp(1.5rem, 3.4vw, 2.9rem); line-height: 1.1;
  letter-spacing: .03em; text-transform: uppercase;
}

/* Barra de avance arriba */
.mv-prog {
  position: fixed; left: 0; top: 0; z-index: 120; width: 100%; height: 3px;
  background: var(--gold); transform-origin: 0 50%; transform: scaleX(0); pointer-events: none;
}

@supports (animation-timeline: view()) {
  .mv .mv-pan { view-timeline: --sec block; }

  /* entra: ventana que crece de borde a borde */
  @keyframes mv-abre {
    from { clip-path: inset(0 7vw 0 7vw round 3rem); }
    to   { clip-path: inset(0 0 0 0 round 3rem 3rem 0 0); }
  }
  .mv .mv-pan:not(.hero)::before {
    animation: mv-abre linear both; animation-timeline: --sec; animation-range: entry 0% entry 80%;
  }

  /* se va: se encoge y se oscurece mientras la siguiente le pasa por encima */
  @keyframes mv-sale-c { to { scale: .94; } }
  @keyframes mv-sale-o { to { opacity: .6; } }
  .mv .mv-pan > * {
    transform-origin: 50% 0;
    animation: mv-sale-c linear both; animation-timeline: --sec; animation-range: exit 0% exit 100%;
  }
  .mv .mv-pan::after { animation: mv-sale-o linear both; animation-timeline: --sec; animation-range: exit 0% exit 100%; }

  /* franja dorada: se endereza al pasar y la frase corre de lado */
  @keyframes mv-franja { from { rotate: -4deg; } to { rotate: 1deg; } }
  @keyframes mv-frase { from { translate: 9vw 0; } to { translate: -9vw 0; } }
  .mv .trust { animation: mv-franja linear both; animation-timeline: view(); }
  .mv .trust .trust-line { animation: mv-frase linear both; animation-timeline: --franja; }
  .mv .trust { view-timeline: --franja block; }

  /* fotos: se destapan de abajo hacia arriba */
  @keyframes mv-destapa {
    from { clip-path: inset(22% 0 0 0 round 8px); scale: 1.12; }
    to   { clip-path: inset(0 0 0 0 round 8px); scale: 1; }
  }
  .mv .about-photo img, .mv .work-shot {
    animation: mv-destapa linear both; animation-timeline: view(); animation-range: entry 0% cover 35%;
  }

  @keyframes mv-avance { to { transform: scaleX(1); } }
  .mv-prog { animation: mv-avance linear both; animation-timeline: scroll(root); }
}
.mv main { overflow-x: clip; }

/* ─── Botones flotantes (3-dic-2026) ───
   WhatsApp a la izquierda y el asistente a la derecha (decisión de Daro, 31-oct), ahora a la
   MISMA altura y del mismo tamaño: el centro de abajo queda libre para leer.
   La letra del botón verde pasa a tinta oscura: blanco sobre #25D366 daba 2,0:1. */
html #wa-float, html #ax-fab { bottom: calc(1.25rem + env(safe-area-inset-bottom, 0px)); height: 56px; }
html #ax-fab { width: 56px; }
html #ax-teaser { bottom: calc(5.6rem + env(safe-area-inset-bottom, 0px)); }
html #wa-float { color: #0A0908; }
html #wa-float svg { fill: #0A0908; }
/* lo último de la página no queda debajo de los botones */
html footer { padding-bottom: calc(6rem + env(safe-area-inset-bottom, 0px)); }
/* el rol bajo la foto repetía, palabra por palabra, el de la barra de arriba */
.hero-photo-role { display: none; }
/* En la primera pantalla ya hay enlace a WhatsApp: el botón verde aparece al pasarla
   (antes tapaba «o escríbeme directo por WhatsApp» en el computador). */
html #wa-float { transition: opacity .35s ease, translate .35s ease, transform .2s ease; }
html #wa-float.wa-espera { opacity: 0; translate: 0 14px; pointer-events: none; visibility: hidden; }
/* El hero perdía el margen de los lados por debajo de 1250 px: `.hero { padding: 4rem 0 5rem }`
   pisaba el `0 1.5rem` de .wrap y en el celular el texto quedaba pegado al borde (antes de esta capa). */
@media (max-width: 1250px) { section.wrap.hero { padding-left: 1.5rem; padding-right: 1.5rem; } }
