/* =========================================================
   Kovak Motores · Animaciones al hacer scroll
   Ligeras: solo transform / opacity (y clip-path en las fotos grandes).
   Se activan con html.motion (motion.js); sin JS todo queda visible.
   ========================================================= */
:root { --r-ease: cubic-bezier(.16, 1, .3, 1); --r-wipe: cubic-bezier(.77, 0, .18, 1); }

/* Barra de progreso de lectura */
.scroll-progress { position: fixed; left: 0; right: 0; top: 0; height: 3px; z-index: 70; pointer-events: none; transform: scaleX(0); transform-origin: 0 50%; background: linear-gradient(90deg, #a3000c, #e30613 60%, #ff4b52); box-shadow: 0 0 12px rgba(227, 6, 19, .7); }

/* Base de las entradas */
html.motion [data-r]:not(.r-done) { transition: opacity .85s ease var(--rd, 0s), transform 1.15s var(--r-ease) var(--rd, 0s); }
html.motion [data-r="up"]:not(.is-in) { opacity: 0; transform: translate3d(0, 46px, 0); }
html.motion [data-r="card"]:not(.is-in) { opacity: 0; transform: translate3d(0, 70px, 0) scale(.96); }
html.motion [data-r="left"]:not(.is-in) { opacity: 0; transform: translate3d(-56px, 0, 0); }
html.motion [data-r="right"]:not(.is-in) { opacity: 0; transform: translate3d(56px, 0, 0); }
html.motion [data-r="fade"]:not(.is-in) { opacity: 0; }
html.motion [data-r="line"]:not(.r-done) { transform-origin: 0 50%; transition: transform 1.3s var(--r-ease) var(--rd, 0s); }
html.motion [data-r="line"]:not(.is-in) { transform: scaleX(0); }

/* Títulos: cada palabra sube desde una máscara */
html.motion [data-r="mask"]:not(.r-done) { transition: none; }
html.motion .w { display: inline-block; overflow: hidden; vertical-align: top; padding: .14em .04em .1em; margin: -.14em -.04em -.1em; }
html.motion .w > span { display: inline-block; transform: translate3d(0, 118%, 0) rotate(4deg); transform-origin: 0 100%; transition: transform 1.1s var(--r-ease); transition-delay: calc(var(--rd, 0s) + var(--wi, 0) * 60ms); }
html.motion .is-in .w > span { transform: none; }

/* Etiqueta roja: la barra se dibuja y el texto entra */
html.motion [data-r="eyebrow"]:not(.is-in) { opacity: 0; transform: translate3d(-16px, 0, 0); }
html.motion [data-r="eyebrow"]::before { transform-origin: 0 50%; transition: transform .8s var(--r-ease) calc(var(--rd, 0s) + .12s); }
html.motion [data-r="eyebrow"]:not(.is-in)::before { transform: skewX(-30deg) scaleX(0); }

/* Fotos grandes: corte diagonal al ángulo de la K, con filo rojo y zoom */
html.motion [data-r="wipe"]:not(.r-done) { transition: clip-path 1.3s var(--r-wipe) var(--rd, 0s); }
html.motion [data-r="wipe"]:not(.is-in) { clip-path: polygon(0 0, 0 0, -48% 100%, -48% 100%); }
html.motion [data-r="wipe"].is-in:not(.r-done) { clip-path: polygon(0 0, 148% 0, 100% 100%, -48% 100%); }
html.motion [data-r="wipe"] > img, html.motion [data-r="wipe"] > video { transition: transform 2s var(--r-ease) var(--rd, 0s); }
html.motion [data-r="wipe"]:not(.is-in) > img, html.motion [data-r="wipe"]:not(.is-in) > video { transform: scale(1.22); }
.r-slash { position: absolute; top: -25%; bottom: -25%; left: 0; width: 13%; z-index: 4; opacity: 0; pointer-events: none; transform: translateX(-170%) skewX(-38deg); background: linear-gradient(90deg, rgba(227, 6, 19, 0), #e30613 30%, #ff3a42 55%, rgba(255, 255, 255, .85) 62%, rgba(227, 6, 19, 0)); }
html.motion [data-r="wipe"].is-in .r-slash { animation: rSlash 1.3s var(--r-wipe) var(--rd, 0s) both; }
@keyframes rSlash { 0% { transform: translateX(-170%) skewX(-38deg); opacity: 1; } 82% { opacity: 1; } 100% { transform: translateX(980%) skewX(-38deg); opacity: 0; } }
html.motion .split__media img, html.motion .feature-fw__media img { scale: 1.12; }

/* Íconos render: aparecen con rebote */
html.motion [data-r="pop"]:not(.is-in) { opacity: 0; transform: translate3d(0, 34px, 0); }
html.motion [data-r="pop"] svg, html.motion .ticks [data-r] .ico { transition: transform 1s cubic-bezier(.34, 1.56, .64, 1) calc(var(--rd, 0s) + .18s); }
html.motion [data-r="pop"]:not(.is-in) svg, html.motion .ticks [data-r]:not(.is-in) .ico { transform: scale(.25) rotate(-28deg); }

/* Detalles por sección */
html.motion .contact-fw__info::after { transition: transform 1.6s var(--r-ease) .1s, opacity 1.2s ease .1s; }
html.motion .contact-fw__info:not(.is-lit)::after { transform: skewX(-24deg) translateX(45%); opacity: 0; }

/* =========================================================
   Cintas cruzadas (marquesina que reacciona al scroll)
   ========================================================= */
.tape { position: relative; height: clamp(170px, 19vw, 280px); overflow: hidden; background: #fff; }
.tape__band { position: absolute; left: -12%; right: -12%; top: 50%; padding: .38em 0 .42em; white-space: nowrap; overflow: hidden; }
.tape__band--red { z-index: 2; background: #e30613; color: #fff; transform: translateY(-50%) rotate(-3.6deg); box-shadow: 0 18px 40px -12px rgba(0, 0, 0, .45); }
.tape__band--dark { background: #0b0b0c; color: #fff; transform: translateY(-50%) rotate(3.2deg); }
.tape__track { display: inline-flex; will-change: transform; }
.tape__track > span { display: inline-flex; align-items: center; gap: .55em; padding-right: .55em; font-weight: 800; font-size: clamp(1.7rem, 4.2vw, 3.8rem); line-height: 1; letter-spacing: -.01em; text-transform: uppercase; }
.tape__band--dark .tape__track em { font-style: normal; color: #fff; filter: url(#kv-outline); }
.tape__track i { display: inline-block; width: .42em; height: .42em; flex: none; background: #fff; transform: skewX(-30deg); }
.tape__band--dark .tape__track i { background: #e30613; }
.tape__track b { color: #0b0b0c; font-weight: 800; }
.tape__band--dark .tape__track b { color: #e30613; -webkit-text-stroke: 0; }

/* =========================================================
   Liquid 3D negro (liquid.js): un lienzo WebGL fijo que se ve
   a través de las secciones negras marcadas con .liquid
   ========================================================= */
#liquid-bg { position: fixed; inset: 0; width: 100%; height: 100%; z-index: -1; display: block; pointer-events: none; background: #050506; clip-path: inset(50%); }
html.liquid-on .liquid { background: transparent !important; }
html.liquid-on .footer.liquid { background: rgba(4, 4, 5, .58) !important; }

/* Nosotros: la foto se funde con el líquido */
html.liquid-on .split.liquid .split__media::after { display: none; }
html.liquid-on .split.liquid .split__media { -webkit-mask-image: linear-gradient(90deg, #000 58%, transparent 100%); mask-image: linear-gradient(90deg, #000 58%, transparent 100%); }

/* Banda de cotización: la foto termina en diagonal con el filo rojo y luego el líquido */
html.liquid-on .quote-band.liquid .quote-band__img { clip-path: polygon(0 0, 90% 0, 74% 100%, 0 100%); }
html.liquid-on .quote-band.liquid .quote-band__img::after { left: 0; right: 0; width: auto; background: var(--red); clip-path: polygon(81% 0, 90% 0, 74% 100%, 65% 100%); }

/* Destellos de vidrio sobre el líquido en los textos grandes */
html.liquid-on .liquid h2 { text-shadow: 0 2px 30px rgba(0, 0, 0, .55); }

@media (max-width: 1024px) {
  html.liquid-on .split.liquid .split__media { -webkit-mask-image: linear-gradient(180deg, #000 65%, transparent 100%); mask-image: linear-gradient(180deg, #000 65%, transparent 100%); }
}
@media (max-width: 820px) {
  html.liquid-on .quote-band.liquid .quote-band__img { clip-path: polygon(0 0, 100% 0, 100% 64%, 0 90%); }
  html.liquid-on .quote-band.liquid .quote-band__img::after { clip-path: polygon(0 80%, 100% 54%, 100% 64%, 0 90%); background: var(--red); }
}

/* Celular: sin liquid 3D (más liviano). Fondo negro con brillo rojo estático */
@media (max-width: 820px), (pointer: coarse) {
  .liquid:not(.footer) { background: radial-gradient(120% 70% at 85% 15%, rgba(227, 6, 19, .22), transparent 60%), radial-gradient(90% 60% at 10% 100%, rgba(255, 255, 255, .06), transparent 60%), #0b0b0c !important; }
}
