/* Transisi scroll dua arah: aktif setiap kali section masuk/keluar layar */
@media (prefers-reduced-motion:no-preference){
  html{scroll-behavior:smooth}

  /* Section: muncul & menghilang berulang (menimpa efek reveal lama) */
  html.js .reveal{
    --ry:48px;
    opacity:0 !important;
    transform:translate3d(0,var(--ry),0) !important;
    transition:opacity 1.1s cubic-bezier(.22,.61,.36,1),transform 1.1s cubic-bezier(.22,.61,.36,1) !important;
    will-change:opacity,transform;
  }
  html.js .reveal.from-above{--ry:-48px}
  html.js .reveal.in-view{opacity:1 !important;transform:none !important}

  /* Isi section: muncul berurutan (stagger) tiap kali section terlihat */
  html.js .reveal:not(.in-view) :is(.grid>*,.promo-grid>*,.cards3>*,.gal>*,.facts>li,.cx-scroll,.tabs,.btns>*,.info,.about-logo,.map){opacity:0}
  html.js .reveal.in-view :is(.grid>*,.promo-grid>*,.cards3>*,.gal>*,.facts>li,.cx-scroll,.tabs,.btns>*,.info,.about-logo,.map){
    animation:cx-rise .65s cubic-bezier(.22,.61,.36,1) both;
    animation-delay:calc(var(--i,0) * 70ms + 40ms);
  }
  html.js .reveal :is(.grid>*,.promo-grid>*,.cards3>*,.gal>*,.facts>li,.cx-scroll,.btns>*,.info):nth-child(1){--i:0}
  html.js .reveal :is(.grid>*,.promo-grid>*,.cards3>*,.gal>*,.facts>li,.cx-scroll,.btns>*,.info):nth-child(2){--i:1}
  html.js .reveal :is(.grid>*,.promo-grid>*,.cards3>*,.gal>*,.facts>li,.cx-scroll,.btns>*,.info):nth-child(3){--i:2}
  html.js .reveal :is(.grid>*,.promo-grid>*,.cards3>*,.gal>*,.facts>li,.cx-scroll,.btns>*,.info):nth-child(4){--i:3}
  html.js .reveal :is(.grid>*,.promo-grid>*,.cards3>*,.gal>*,.facts>li,.cx-scroll,.btns>*,.info):nth-child(n+5){--i:4}

  @keyframes cx-rise{
    from{opacity:0;translate:0 16px}
    to{opacity:1;translate:0 0}
  }

  /* Hero: teks memudar saat di-scroll keluar, muncul lagi saat kembali ke atas */
  html.js .hero-in{transition:opacity 1.1s ease,translate 1.1s cubic-bezier(.22,.61,.36,1)}
  html.js .hero-in.is-out{opacity:0;translate:0 -40px}

  /* Hover halus (specificity rendah, tidak menimpa gaya lama) */
  :where(.btn,.cx-b,.tab,.icon-btn){transition:translate .25s ease,box-shadow .25s ease,background-color .25s ease,color .25s ease,border-color .25s ease}
  :where(.btn,.cx-b):hover{translate:0 -2px}
  :where(.btn,.cx-b):active{translate:0 0}
  :where(.gal figure){overflow:hidden}
  :where(.gal img){transition:transform .7s cubic-bezier(.22,.61,.36,1)}
  :where(.gal figure):hover :where(img){transform:scale(1.06)}
  :where(.nav .links a){transition:color .25s ease,opacity .25s ease}
}
