/* =========================================================
   RINCÓN VISUALS — Animaciones e interacciones al scroll
   Capa añadida sobre styles.css: no cambia el diseño, solo
   le da movimiento. Se activa cuando js/scroll-fx.js añade
   la clase .fx a <html> (nunca con "reducir movimiento").
========================================================= */

/* ---------- NAVEGACIÓN ---------- */
/* Entra al cargar, se esconde al bajar y vuelve al subir */
html.fx .nav {
  transition: background 0.4s var(--ease), backdrop-filter 0.4s var(--ease),
    border-color 0.4s var(--ease), translate 0.55s var(--ease);
  animation: fx-drop 0.9s var(--ease) 0.05s backwards;
}
html.fx .nav.fx-nav-hide { translate: 0 calc(-100% - 4px); }

@media (min-width: 1101px) {
  html.fx .nav__links > a { animation: fx-drop 0.7s var(--ease) calc(var(--i, 0) * 60ms + 250ms) backwards; }
}
/* Menú móvil: los enlaces entran en cascada al abrirlo */
@media (max-width: 1100px) {
  html.fx .nav__links.is-open > a { animation: fx-from-right 0.6s var(--ease) calc(var(--i, 0) * 55ms + 120ms) backwards; }
}

/* ---------- HERO: parallax al bajar ---------- */
html.fx .hero__video { scale: calc(1 + var(--fx-hero, 0) * 0.14); will-change: scale; }
html.fx .hero__content {
  translate: 0 calc(var(--fx-hero, 0) * 140px);
  opacity: calc(1 - var(--fx-hero, 0) * 1.15);
  will-change: translate, opacity;
}
html.fx .hero__scroll { opacity: calc(1 - var(--fx-hero, 0) * 5); }

/* ---------- TÍTULOS: palabra a palabra ---------- */
html.fx .fx-word { display: inline-block; }
html.fx .is-visible .fx-word {
  animation: fx-word 0.95s var(--ease) calc(var(--rd, 0ms) + var(--wi, 0) * 55ms + 60ms) both;
}
html.fx .fx-split.reveal.is-visible { animation-name: fx-fade; animation-duration: 0.35s; }

/* Punto del eyebrow */
html.fx .is-visible .dot {
  animation: fx-dot 0.7s var(--ease) calc(var(--rd, 0ms) + 120ms) both, pulse 2.4s 1s infinite;
}

/* ---------- MARQUEE: reacciona a la velocidad del scroll ---------- */
html.fx .marquee__track > * { display: inline-block; transform: skewX(var(--fx-skew, 0deg)); }

/* ---------- SOBRE MÍ ---------- */
html.fx .about__media.reveal.is-visible { animation-name: fx-fade; }
html.fx .about__media.is-visible .about__main { animation: fx-clip-up 1.3s var(--ease) var(--rd, 0ms) both; }
html.fx .about__main img { scale: 1.08; translate: 0 calc(var(--fx-p, 0) * -3%); }
html.fx .about__media.is-visible .about__main img { animation: fx-zoom-about 1.8s var(--ease) var(--rd, 0ms) both; }
html.fx .about__badge { translate: 0 calc(var(--fx-p, 0) * -36px); }
html.fx .about__media.is-visible .about__badge { animation: fx-pop-tilt 0.9s var(--ease) calc(var(--rd, 0ms) + 700ms) both; }

html.fx .about__pillars.is-visible .pill {
  animation: fx-pop 0.6s var(--ease) calc(var(--rd, 0ms) + var(--i, 0) * 70ms + 150ms) both;
}

/* Timeline: la línea se dibuja con el scroll y los puntos se encienden */
html.fx .timeline { position: relative; }
html.fx .timeline::after {
  content: "";
  position: absolute; left: -2px; top: 0; bottom: 0;
  width: 2px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--yellow), var(--blue-light));
  transform-origin: top;
  scale: 1 var(--fx-line, 0);
  pointer-events: none;
}
html.fx .timeline__item::before { transition: box-shadow 0.6s var(--ease), scale 0.6s var(--ease); }
html.fx .timeline__item.fx-lit::before {
  scale: 1.15;
  box-shadow: 0 0 0 5px rgba(255, 222, 88, 0.16), 0 0 18px rgba(255, 222, 88, 0.55);
}
html.fx .timeline.is-visible .timeline__item {
  animation: fx-from-left 0.8s var(--ease) calc(var(--rd, 0ms) + var(--i, 0) * 120ms + 150ms) both;
}

/* ---------- SERVICIOS / POR QUÉ YO / HERRAMIENTAS ---------- */
html.fx .scard.reveal.is-visible,
html.fx .wcard.reveal.is-visible,
html.fx .tool.reveal.is-visible { animation-name: fx-rise; animation-duration: 1s; }

html.fx .scard.is-visible .scard__icon,
html.fx .wcard.is-visible .wcard__icon,
html.fx .ccard.is-visible .ccard__icon {
  animation: fx-icon 0.9s var(--ease) calc(var(--rd, 0ms) + 250ms) both;
}
html.fx .scard.is-visible .scard__list li {
  animation: fx-from-left-sm 0.6s var(--ease) calc(var(--rd, 0ms) + var(--i, 0) * 60ms + 350ms) both;
}

html.fx .wcard__num { translate: 0 calc(var(--fx-p, 0) * -26px); }
html.fx .wcard.is-visible .wcard__num { animation: fx-num 1.1s var(--ease) calc(var(--rd, 0ms) + 200ms) both; }

html.fx .tool::after { translate: 0 calc(var(--fx-p, 0) * -38px); }
html.fx .tool.is-visible .tool__mark { animation: fx-mark 1s var(--ease) calc(var(--rd, 0ms) + 200ms) both; }
html.fx .tool.is-visible .tool__bar { animation: fx-bar 1.5s var(--ease) calc(var(--rd, 0ms) + 450ms); }

/* ---------- PORTFOLIO ---------- */
html.fx .pcard.reveal.is-visible { animation-name: fx-clip; animation-duration: 1.2s; }
html.fx .pcard img { scale: 1.12; translate: 0 calc(var(--fx-p, 0) * -5%); }
html.fx .pcard.is-visible img { animation: fx-zoom-card 1.7s var(--ease) var(--rd, 0ms) both; }

/* ---------- GALERÍA: cada foto aparece al entrar en pantalla ---------- */
html.fx .gitem { animation-name: fx-gitem; animation-duration: 0.9s; }
html.fx .gitem:not(.fx-seen) { animation-play-state: paused; }
html.fx .gallery__filters.is-visible .gfilter {
  animation: fx-pop 0.6s var(--ease) calc(var(--rd, 0ms) + var(--i, 0) * 80ms + 150ms) both;
}

/* ---------- IA ---------- */
html.fx .ai__glow { translate: 0 calc(var(--fx-p, 0) * 90px); }
html.fx .afeat.reveal.is-visible { animation-name: fx-from-left-lg; animation-duration: 0.9s; }
html.fx .ai__steps.is-visible li {
  animation: fx-rise-sm 0.7s var(--ease) calc(var(--rd, 0ms) + var(--i, 0) * 110ms + 150ms) both;
}
html.fx .ai__showcase.is-visible .ai-slot {
  animation: fx-slot 1.1s var(--ease) calc(var(--rd, 0ms) + var(--i, 0) * 140ms + 100ms) both;
}

/* ---------- CLIENTE IDEAL ---------- */
html.fx .ideal__panels.is-visible .ipanel {
  animation: fx-rise-lg 1s var(--ease) calc(var(--rd, 0ms) + var(--i, 0) * 130ms) both;
}

/* ---------- CONTACTO ---------- */
html.fx .ccard { --fx-r: var(--radius-lg); }
html.fx .ccard--wa.reveal.is-visible { animation-name: fx-clip; animation-duration: 1.2s; }
html.fx .ccard--sm.reveal.is-visible { animation-name: fx-from-right; animation-duration: 0.9s; }
html.fx .ccard__bg { scale: 1.12; translate: 0 calc(var(--fx-p, 0) * -5%); }
html.fx .ccard.is-visible .ccard__arrow { animation: fx-arrow 0.8s var(--ease) calc(var(--rd, 0ms) + 400ms) both; }

/* ---------- FOOTER ---------- */
html.fx .fx-foot { opacity: 0; translate: 0 30px; }
html.fx .fx-foot.fx-in { animation: fx-rise-sm 0.9s var(--ease) var(--rd, 0ms) both; }
html.fx .footer__nav.fx-in a { animation: fx-from-left-sm 0.6s var(--ease) calc(var(--i, 0) * 45ms + 200ms) both; }
html.fx .footer__brand.fx-in .footer__logo { animation: fx-logo 1.2s var(--ease) 0.15s both; }

/* ---------- KEYFRAMES ---------- */
@keyframes fx-fade      { from { opacity: 0; translate: none; } to { opacity: 1; translate: none; } }
@keyframes fx-drop      { from { opacity: 0; translate: 0 -100%; } to { opacity: 1; translate: none; } }
@keyframes fx-word      { from { opacity: 0; translate: 0 0.55em; filter: blur(8px); } to { opacity: 1; translate: none; filter: none; } }
@keyframes fx-dot       { from { scale: 0; } 60% { scale: 1.6; } to { scale: 1; } }
@keyframes fx-rise      { from { opacity: 0; translate: 0 60px; scale: 0.94; filter: blur(6px); } to { opacity: 1; translate: none; scale: 1; filter: none; } }
@keyframes fx-rise-sm   { from { opacity: 0; translate: 0 24px; } to { opacity: 1; translate: none; } }
@keyframes fx-rise-lg   { from { opacity: 0; translate: 0 80px; } to { opacity: 1; translate: none; } }
@keyframes fx-from-left    { from { opacity: 0; translate: -24px 0; } to { opacity: 1; translate: none; } }
@keyframes fx-from-left-sm { from { opacity: 0; translate: -14px 0; } to { opacity: 1; translate: none; } }
@keyframes fx-from-left-lg { from { opacity: 0; translate: -60px 0; } to { opacity: 1; translate: none; } }
@keyframes fx-from-right   { from { opacity: 0; translate: 50px 0; } to { opacity: 1; translate: none; } }
@keyframes fx-pop       { from { opacity: 0; scale: 0.6; } to { opacity: 1; scale: 1; } }
@keyframes fx-pop-tilt  { from { opacity: 0; scale: 0.5; rotate: -12deg; } to { opacity: 1; scale: 1; rotate: 0deg; } }
@keyframes fx-icon      { from { opacity: 0; scale: 0.4; rotate: -30deg; } to { opacity: 1; scale: 1; rotate: 0deg; } }
@keyframes fx-num       { from { opacity: 0; scale: 1.8; } to { opacity: 1; scale: 1; } }
@keyframes fx-mark      { from { opacity: 0; scale: 0.4; rotate: -120deg; } to { opacity: 1; scale: 1; rotate: 0deg; } }
@keyframes fx-arrow     { from { opacity: 0; translate: -14px 14px; } to { opacity: 1; translate: none; } }
@keyframes fx-logo      { from { opacity: 0; scale: 0.4; rotate: -180deg; } to { opacity: 0.9; scale: 1; rotate: 0deg; } }
@keyframes fx-bar {
  0%   { transform: scaleX(0); transform-origin: left; }
  45%  { transform: scaleX(1); transform-origin: left; }
  55%  { transform: scaleX(1); transform-origin: right; }
  100% { transform: scaleX(0); transform-origin: right; }
}
@keyframes fx-clip {
  from { opacity: 1; translate: none; clip-path: inset(100% 0 0 0 round var(--fx-r, var(--radius))); }
  to   { opacity: 1; translate: none; clip-path: inset(0 0 0 0 round var(--fx-r, var(--radius))); }
}
@keyframes fx-clip-up {
  from { clip-path: inset(100% 0 0 0 round var(--radius-lg)); }
  to   { clip-path: inset(0 0 0 0 round var(--radius-lg)); }
}
@keyframes fx-slot {
  from { opacity: 0; scale: 0.94; clip-path: inset(0 0 100% 0 round var(--radius)); }
  to   { opacity: 1; scale: 1; clip-path: inset(0 0 0 0 round var(--radius)); }
}
@keyframes fx-zoom-card  { from { scale: 1.4; } to { scale: 1.12; } }
@keyframes fx-zoom-about { from { scale: 1.3; } to { scale: 1.08; } }
@keyframes fx-gitem { from { opacity: 0; translate: 0 50px; scale: 0.95; } to { opacity: 1; translate: none; scale: 1; } }
