/* NodoStudio — capa MOTION (opcional). Se carga solo con `build.py --motion`.
   Fondo de video que avanza con el scroll + entrada del hero + aparición de secciones.
   Video original claro: se invierte con CSS (blanco -> negro, núcleo naranja -> azul). */
:root {
  --e-expo: cubic-bezier(.16, 1, .3, 1);
  --e-quint: cubic-bezier(.23, 1, .32, 1);
  --e-settle: cubic-bezier(.2, .85, .3, 1);
  --lift: 10px;
}
html { background: #000; }
body { background: transparent; }

/* ---------- Escena fija de fondo (nunca se mueve: solo cambia de cuadro) ---------- */
.scene { position: fixed; inset: 0; z-index: 0; overflow: hidden; background: #000; pointer-events: none; }
.scene-media {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: 50% 50%; display: block;
  user-select: none; -webkit-user-drag: none;
  filter: invert(1) brightness(.78) contrast(1.18);
}
.scene-video { opacity: 0; transition: opacity .7s ease; }
.scene.is-ready .scene-video { opacity: 1; }
.scene-veil { position: absolute; inset: 0; background: #000; opacity: .15; }
main { position: relative; z-index: 1; }
/* sombra suave detrás del texto del hero para que se lea sobre el vidrio */
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(90deg, rgba(0,0,0,.78) 0%, rgba(0,0,0,.5) 42%, rgba(0,0,0,0) 72%);
}
.hero-in { position: relative; }
@media (max-width: 860px) {
  .hero::before { background: linear-gradient(180deg, rgba(0,0,0,.7) 0%, rgba(0,0,0,.45) 55%, rgba(0,0,0,.1) 100%); }
}

/* ---------- Entrada (una sola vez, después el JS borra estas clases) ---------- */
.anim .top-logo, .anim .menu a, .anim .top .lang, .anim .top .btn-sm,
.anim .hero .lead, .anim .hero .btn, .anim .hero-photo { opacity: 0; }
.anim .hl { clip-path: inset(-30% -6% -12% -6%); }
.anim .hl .rv { opacity: 0; transform: translateY(115%); }

.anim-run .top-logo, .anim-run .menu a, .anim-run .top .lang, .anim-run .top .btn-sm,
.anim-run .hero .lead, .anim-run .hero .btn, .anim-run .hero-photo, .anim-run .hl .rv { will-change: transform, opacity; }

.anim-run .top-logo { animation: lift .6s var(--e-quint) .06s both; }
.anim-run .menu a:nth-child(1) { animation: lift .55s var(--e-quint) .18s both; }
.anim-run .menu a:nth-child(2) { animation: lift .55s var(--e-quint) .235s both; }
.anim-run .menu a:nth-child(3) { animation: lift .55s var(--e-quint) .29s both; }
.anim-run .menu a:nth-child(4) { animation: lift .55s var(--e-quint) .345s both; }
.anim-run .top .lang { animation: lift .58s var(--e-quint) .26s both; }
.anim-run .top .btn-sm { animation: pop .52s var(--e-settle) .34s both; }
.anim-run .hl:nth-child(1) .rv { animation: reveal 1s var(--e-expo) .32s both; }
.anim-run .hl:nth-child(2) .rv { animation: reveal 1s var(--e-expo) .45s both; }
.anim-run .hero-photo { animation: photo 1.2s var(--e-quint) .4s both; }
.anim-run .hero .lead { animation: lift .58s var(--e-quint) .62s both; }
.anim-run .hero .actions .btn:nth-child(1) { animation: settle .6s var(--e-settle) .74s both; }
.anim-run .hero .actions .btn:nth-child(2) { animation: settle .6s var(--e-settle) .81s both; }

@keyframes lift { from { opacity: 0; transform: translateY(var(--lift)); } to { opacity: 1; transform: none; } }
@keyframes pop { from { opacity: 0; transform: translateY(6px) scale(.94); } to { opacity: 1; transform: none; } }
@keyframes settle { from { opacity: 0; transform: translateY(10px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes reveal { 0% { opacity: 0; transform: translateY(115%); } 30% { opacity: 1; } 100% { opacity: 1; transform: none; } }
@keyframes photo { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

/* ---------- Aparición de secciones al entrar en pantalla (una vez, nunca se vuelven a ocultar) ---------- */
.sr [data-reveal] {
  opacity: 0; transform: translateY(18px);
  transition: opacity .9s var(--e-quint) var(--d, 0s), transform 1.1s var(--e-expo) var(--d, 0s);
}
.sr [data-reveal].in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .anim .top-logo, .anim .menu a, .anim .top .lang, .anim .top .btn-sm,
  .anim .hero .lead, .anim .hero .btn, .anim .hero-photo { opacity: 1; }
  .anim .hl { clip-path: none; }
  .anim .hl .rv { opacity: 1; transform: none; animation: none; }
  .anim-run * { animation: none !important; }
  .sr [data-reveal] { opacity: 1 !important; transform: none !important; }
  .scene-video { transition: none; }
}
