/* ==========================================================================
   BURAKKO — Animaciones de las páginas claras "Casos de éxito" y "Hoteles"
   --------------------------------------------------------------------------
   Se carga DESPUÉS de home-motion.css, del que reutiliza los efectos comunes
   (revelado al scroll, títulos palabra por palabra, luz en tarjetas, cursor,
   barra de progreso). Acá va solo lo propio: intro del hero, cortina de los
   textos en degradé, asteriscos, hovers y el cursor sobre fondo claro.

   Mismas reglas que el resto del sitio: solo opacity / transform / clip-path,
   todo dentro de (prefers-reduced-motion: no-preference) y sin ocultar nada
   si el JS no carga.
   ========================================================================== */

@media (prefers-reduced-motion: no-preference) {

  /* 01. INTRO DEL HERO (solo CSS, no espera al JS) ====================== */

  .ce-header__bar > *                { animation: m-rise .8s var(--m-ease) backwards; }
  .ce-header__bar > :nth-child(2)    { animation-delay: .06s; }
  .ce-header__bar > :nth-child(3)    { animation-delay: .12s; }

  .ce-hero .ce-eyebrow               { animation: m-in-left .8s var(--m-ease) .05s backwards; }
  .ce-hero .ce-eyebrow .ce-ast       { animation: ce-spin 1.2s var(--m-ease) .1s backwards; }
  .ce-hero__title                    { animation: m-rise-mask 1.1s var(--m-ease) .12s backwards; }
  .ce-hero__title .ce-grad           { animation: ce-wipe 1.1s var(--m-ease) .5s backwards; }
  .ce-hero__lead                     { animation: m-rise .9s var(--m-ease) .35s backwards; }

  /* Tarjeta "Resultados destacados": entra desde la derecha y sus filas
     suben escalonadas (los números cuentan desde 0, ver casos-motion.js). */
  .ce-highlights                     { animation: ce-in-right 1.1s var(--m-ease) .25s backwards; }
  .ce-highlights__label              { animation: m-in-left .8s var(--m-ease) .55s backwards; }
  .ce-highlights li                  { animation: m-rise .8s var(--m-ease) backwards; }
  .ce-highlights li:nth-child(1)     { animation-delay: .6s; }
  .ce-highlights li:nth-child(2)     { animation-delay: .72s; }
  .ce-highlights li:nth-child(3)     { animation-delay: .84s; }
  .ce-highlights li:nth-child(4)     { animation-delay: .96s; }

  @keyframes ce-in-right { from { opacity: 0; transform: translateX(48px) scale(.97); } to { opacity: 1; transform: none; } }
  @keyframes ce-wipe     { from { clip-path: inset(-20% 100% -30% 0); } to { clip-path: inset(-20% -2% -30% 0); } }
  @keyframes ce-spin     { from { transform: rotate(-180deg) scale(.4); } to { transform: none; } }


  /* 02. REVELADO: complementos de home-motion.css ======================== */

  /* Textos en degradé dentro de un título palabra por palabra: cortina. */
  .m-js [data-m="words"] .ce-grad {
    transition: clip-path 1.2s var(--m-ease) var(--m-gd, .2s);
    clip-path: inset(-20% -2% -30% 0);
  }
  .m-js [data-m="words"]:not(.is-in) .ce-grad { clip-path: inset(-20% 100% -30% 0); }

  /* ✱ de los eyebrows: gira al entrar. */
  .m-js [data-m] > .ce-ast { transition: transform 1.2s var(--m-ease) calc(var(--m-d, 0s) + .1s); }
  .m-js [data-m]:not(.is-in) > .ce-ast { transform: rotate(-180deg) scale(.4); }

  /* Íconos de "El desafío" / "Qué hicimos" y tilde de los resultados:
     aparecen con rebote apenas después de su tarjeta. */
  .ce-box__icon, .ce-stat__check {
    transition: transform .6s var(--m-ease-back), opacity .4s ease;
  }
  .m-js [data-m] .ce-box__icon, .m-js [data-m] .ce-stat__check {
    transition-delay: calc(var(--m-d, 0s) + .3s);
  }
  .m-js [data-m]:not(.is-in) .ce-box__icon { opacity: 0; transform: rotate(-20deg) scale(.6); }
  .m-js [data-m]:not(.is-in) .ce-stat__check { opacity: 0; transform: scale(.4); }

  /* Raya verde sobre cada número: se dibuja de izquierda a derecha. */
  .ce-stat::before { transition: transform .8s var(--m-ease) calc(var(--m-d, 0s) + .35s); transform-origin: 0 50%; }
  .m-js .ce-stat[data-m]:not(.is-in)::before { transform: scaleX(0); }


  /* 02b. PÁGINA DE HOTELES ============================================== */

  /* Hero: chips y botones entran después del título. */
  .ht-chips li                       { animation: m-pop .6s var(--m-ease-back) backwards; }
  .ht-chips li:nth-child(1)          { animation-delay: .45s; }
  .ht-chips li:nth-child(2)          { animation-delay: .5s; }
  .ht-chips li:nth-child(3)          { animation-delay: .55s; }
  .ht-chips li:nth-child(4)          { animation-delay: .6s; }
  .ht-chips li:nth-child(5)          { animation-delay: .65s; }
  .ht-actions                        { animation: m-rise .9s var(--m-ease) .55s backwards; }

  /* Gráfico de temporadas: las barras crecen mes a mes. */
  .ht-bar__fill { transition: transform 1s var(--m-ease); }
  .ht-bar:nth-child(1) .ht-bar__fill  { transition-delay: .15s; }
  .ht-bar:nth-child(2) .ht-bar__fill  { transition-delay: .2s; }
  .ht-bar:nth-child(3) .ht-bar__fill  { transition-delay: .25s; }
  .ht-bar:nth-child(4) .ht-bar__fill  { transition-delay: .3s; }
  .ht-bar:nth-child(5) .ht-bar__fill  { transition-delay: .35s; }
  .ht-bar:nth-child(6) .ht-bar__fill  { transition-delay: .4s; }
  .ht-bar:nth-child(7) .ht-bar__fill  { transition-delay: .45s; }
  .ht-bar:nth-child(8) .ht-bar__fill  { transition-delay: .5s; }
  .ht-bar:nth-child(9) .ht-bar__fill  { transition-delay: .55s; }
  .ht-bar:nth-child(10) .ht-bar__fill { transition-delay: .6s; }
  .ht-bar:nth-child(11) .ht-bar__fill { transition-delay: .65s; }
  .ht-bar:nth-child(12) .ht-bar__fill { transition-delay: .7s; }
  .m-js .ht-chart[data-m]:not(.is-in) .ht-bar__fill { transform: scaleY(0); }

  /* Íconos de tipos y servicios, y tildes del equipo: rebote al entrar. */
  .ht-type__icon, .ht-svc__icon, .ht-check { transition: transform .6s var(--m-ease-back), opacity .4s ease; }
  .m-js [data-m] .ht-type__icon, .m-js [data-m] .ht-svc__icon, .m-js [data-m] .ht-check {
    transition-delay: calc(var(--m-d, 0s) + .3s);
  }
  .m-js [data-m]:not(.is-in) .ht-type__icon,
  .m-js [data-m]:not(.is-in) .ht-svc__icon { opacity: 0; transform: rotate(-20deg) scale(.6); }
  .m-js [data-m]:not(.is-in) .ht-check { opacity: 0; transform: scale(.4); }

  @media (hover: hover) and (pointer: fine) {
    .ht-type:hover .ht-type__icon, .ht-svc:hover .ht-svc__icon { transform: rotate(-8deg) scale(1.1); }
    .ht-case__logo img { transition: transform .8s var(--m-ease); }
    .ht-case:hover .ht-case__logo img { transform: scale(1.04); }
    .ht-flag { transition: translate .4s var(--m-ease), border-color .3s ease; }
    .ht-flag:hover { translate: 0 -3px; border-color: rgba(28, 233, 177, .5); }
    .ht-chips li { transition: border-color .3s ease, translate .4s var(--m-ease); }
    .ht-chips li:hover { translate: 0 -2px; border-color: rgba(28, 233, 177, .5); }
    .ht-btn-light:hover { transform: translateY(-2px); }
    .ht-svc--dark.m-spot::before {
      background: radial-gradient(320px circle at var(--mx, 50%) var(--my, 50%), rgba(28, 233, 177, .22), transparent 62%);
    }
  }


  /* 03. ASTERISCOS DEL CIERRE: giran lento y siguen al scroll ============= */

  .ce-cta__ast { translate: 0 var(--ce-py, 0px); }
  .ce-cta__ast--violet { animation: ce-rotate 22s linear infinite; }
  .ce-cta__ast--green  { animation: ce-rotate 30s linear infinite reverse; }
  @keyframes ce-rotate { to { transform: rotate(360deg); } }


  /* 04. HEADER INTELIGENTE ================================================ */

  .ce-header { transition: transform .45s var(--m-ease); }
  .ce-header.m-hide { transform: translateY(-101%); }


  /* 05. HOVER (solo con mouse) =========================================== */

  @media (hover: hover) and (pointer: fine) {
    .ce-btn svg { transition: translate .45s var(--m-ease); }
    .ce-btn:hover svg { translate: 2px -2px; }

    .ce-brand { transition: translate .45s var(--m-ease), box-shadow .45s var(--m-ease); }
    .ce-brand:hover { translate: 0 -5px; box-shadow: 0 22px 36px -18px rgba(0, 0, 0, .22); }

    .ce-case__logo img { transition: transform .8s var(--m-ease); }
    .ce-case:hover .ce-case__logo img { transform: scale(1.04); }

    .ce-box:hover .ce-box__icon { transform: rotate(-8deg) scale(1.1); }

    .ce-cta__pills a:hover { transform: translateY(-3px); }

    /* En fondo claro la luz de las tarjetas las levanta apenas. */
    .ce-page .m-spot:hover { translate: 0 -3px; }
    .ce-page .ce-highlights.m-spot:hover { translate: none; }
  }


  /* 06. CURSOR Y BARRA SOBRE FONDO CLARO ================================== */

  .ce-page .m-cursor { border-color: rgba(10, 10, 10, .3); }
  .ce-page .m-cursor.is-link { border-color: var(--ce-green); background-color: rgba(28, 233, 177, .16); }
  .ce-page .m-progress { z-index: 70; }

} /* fin prefers-reduced-motion: no-preference */


@media print {
  .m-js .ht-chart .ht-bar__fill { transform: none !important; }
  .m-js [data-m] .ce-grad, .m-js [data-m] .ce-box__icon, .m-js [data-m] .ce-stat__check {
    opacity: 1 !important; transform: none !important; clip-path: none !important;
  }
}
