/* ROADD — «La ruta» · capa cinematográfica (prototipo Inicio).
   Todo vive bajo html.rc-on: si el script no arranca (reduced-motion, ?fx off, error),
   no se aplica ninguna regla y la página queda exactamente como la actual.
   Solo propiedades compuestas: transform/translate/scale/rotate, opacity, clip-path. */

/* ---------- HERO: carretera fija bajo el contenido (la página se desliza por encima) ---------- */
@media (min-height:621px){
  html.rc-on [data-screen-label="Inicio · Hero"]{position:sticky !important;top:0;z-index:0}
  html.rc-on main > section:not([data-screen-label="Inicio · Hero"]){position:relative;z-index:1}
  html.rc-on #idea{box-shadow:0 -28px 60px -12px rgba(8,12,11,.55)}
}
html.rc-on #hero-ph{will-change:transform}
html.rc-on #hero-img{transform-origin:64% 52%}
@media (max-width:640px){html.rc-on #hero-img{transform-origin:60% 40%}}

/* velo que oscurece la carretera al avanzar */
html.rc-on #hero-ph::before{content:"";position:absolute;inset:0;z-index:1;pointer-events:none;background:#131615;opacity:calc(var(--hq,0) * .62)}
/* sol del atardecer: brillo cálido que respira con el avance */
html.rc-on #hero-ph::after{content:"";position:absolute;inset:-10%;z-index:1;pointer-events:none;
  background:radial-gradient(circle at 21% 50%,rgba(255,166,182,.55) 0,rgba(252,120,145,.18) 16%,rgba(252,108,133,0) 38%);
  mix-blend-mode:screen;opacity:calc(.35 + var(--hq,0) * .5);transform:scale(calc(1 + var(--hq,0) * .25));transform-origin:21% 50%;
  animation:rc-sun 2.6s .3s cubic-bezier(.19,1,.22,1) backwards}
@media (max-width:640px){html.rc-on #hero-ph::after{background:radial-gradient(circle at 12% 39%,rgba(255,166,182,.6) 0,rgba(252,120,145,.2) 14%,rgba(252,108,133,0) 34%);transform-origin:12% 39%}}
@keyframes rc-sun{from{opacity:0}}
/* barrido de luz de faros, una sola vez al entrar */
html.rc-on [data-screen-label="Inicio · Hero"]::after{content:"";position:absolute;top:-10%;bottom:-10%;left:0;width:55%;z-index:2;pointer-events:none;
  background:linear-gradient(100deg,rgba(255,214,222,0) 0,rgba(255,214,222,.16) 45%,rgba(255,236,240,.24) 50%,rgba(255,214,222,.16) 55%,rgba(255,214,222,0) 100%);
  mix-blend-mode:screen;transform:translate3d(-110%,0,0) skewX(-12deg);animation:rc-sweep 2.1s .55s cubic-bezier(.45,0,.2,1) forwards}
@keyframes rc-sweep{to{transform:translate3d(260%,0,0) skewX(-12deg)}}
html.rc-lite [data-screen-label="Inicio · Hero"]::after{display:none}

/* ---------- MOVIMIENTO: camiones con inercia (acelera y frena) ---------- */
html.rc-on #idea [data-kin][style*="1120 / 299"]{transform:translate3d(calc(var(--pe,0.5) * (100vw - 2 * clamp(20px,4vw,56px) - clamp(240px,26vw,440px))),0,0) !important}
html.rc-on #cl-t{transform:translate3d(calc(var(--pe,0.5) * (min(100vw, 1440px) - 2 * clamp(20px,4vw,56px) - clamp(300px,36vw,600px))),0,0) !important}
html.rc-on #cl-t[data-rc-arrived] img{animation:rc-arrive 1.1s cubic-bezier(.19,1,.22,1)}
@keyframes rc-arrive{0%{filter:brightness(1)}35%{filter:brightness(1.25) drop-shadow(0 0 18px rgba(157,196,186,.7))}100%{filter:brightness(1)}}

/* ---------- PERSPECTIVA: escenarios con profundidad ---------- */
html.rc-on [data-docstage]{perspective:1500px}
html.rc-on [data-doc]{transform-origin:50% 100%}
html.rc-on [data-rc-persp]{perspective:1100px}

/* ---------- COBERTURA: un punto recorre la línea de carretera ---------- */
html.rc-on #cov::after{content:"";position:absolute;top:7px;left:0;width:12px;height:12px;border-radius:50%;background:#406962;
  box-shadow:0 0 0 5px rgba(64,105,98,.18);transform:translate3d(calc(max(0, min(1, calc(var(--p,1) * 2.2 - 0.4))) * (var(--covw,600px) - 12px)),0,0)}
@media (max-width:640px){html.rc-on #cov::after{top:22px;left:1px;transform:translate3d(0,calc(max(0, min(1, calc(var(--p,1) * 2.2 - 0.4))) * (var(--covh,300px) - 12px)),0)}}
