/* =============================================================
   ANIMASI BERANDA (ringan)
   - Hanya transform & opacity (diproses GPU, tidak memicu layout)
   - Elemen hanya disembunyikan bila JS aktif (html.js-anim),
     jadi tanpa JS halaman tetap tampil normal
   - Mati otomatis untuk prefers-reduced-motion
   ============================================================= */

/* ── Progress bar baca di atas layar ── */
.h-progress {
    position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 200;
    background: linear-gradient(90deg, var(--brand), #a855f7, #ec4899);
    transform-origin: 0 50%;
    transform: scaleX(0);
    pointer-events: none;
}

/* ── Navbar: bayangan halus saat halaman di-scroll ── */
.ds-theme .navbar { transition: box-shadow .3s ease, background-color .3s ease; }
.ds-theme .navbar.is-scrolled {
    background: rgba(255,255,255,.92);
    box-shadow: 0 10px 30px -18px rgba(15,23,42,.35);
}

/* ── Hero: masuk bertahap saat halaman dibuka ── */
@keyframes hUp   { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: none; } }
@keyframes hZoom { from { opacity: 0; transform: translateY(26px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes hPop  { from { opacity: 0; transform: scale(.85); } to { opacity: 1; transform: none; } }

.js-anim .h-hero-text > * { animation: hUp .8s cubic-bezier(.2,.7,.2,1) both; }
.js-anim .h-hero-text > :nth-child(1) { animation-delay: .05s; }
.js-anim .h-hero-text > :nth-child(2) { animation-delay: .15s; }
.js-anim .h-hero-text > :nth-child(3) { animation-delay: .25s; }
.js-anim .h-hero-text > :nth-child(4) { animation-delay: .35s; }
.js-anim .h-hero-text > :nth-child(5) { animation-delay: .45s; }
.js-anim .h-hero-visual { animation: hZoom 1s cubic-bezier(.2,.7,.2,1) .2s both; }
.js-anim .h-float-a { animation: hPop .6s cubic-bezier(.3,1.4,.5,1) .9s both, hFloat 6s ease-in-out 1.5s infinite; }
.js-anim .h-float-b { animation: hPop .6s cubic-bezier(.3,1.4,.5,1) 1.1s both, hFloat 6s ease-in-out 1.7s infinite; }

/* Teks gradasi di judul hero bergerak pelan */
.h-hero h1 span {
    background-image: linear-gradient(90deg, var(--brand), #a855f7, var(--brand)); /* simetris: tanpa sambungan */
    background-size: 200% auto;
    animation: hShine 6s linear infinite;
}
@keyframes hShine { to { background-position: 200% center; } }

/* Titik hijau "online" berdenyut */
.h-dot { position: relative; }
.h-dot::after {
    content: ''; position: absolute; inset: 0; border-radius: 50%;
    background: #22c55e; animation: hPulse 2s ease-out infinite;
}
@keyframes hPulse { from { transform: scale(1); opacity: .6; } to { transform: scale(2.6); opacity: 0; } }

/* ── Muncul saat di-scroll (kelas dipasang oleh home-anim.js) ── */
.js-anim .rv {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity .7s cubic-bezier(.2,.7,.2,1), transform .7s cubic-bezier(.2,.7,.2,1);
    transition-delay: var(--rv-delay, 0s);
}
.js-anim .rv.rv-left  { transform: translateX(-32px); }
.js-anim .rv.rv-right { transform: translateX(32px); }
.js-anim .rv.rv-zoom  { transform: scale(.94); }
.js-anim .rv.is-in    { opacity: 1; transform: none; }

/* ── Efek hover tambahan ── */
/* Kilau melintas di tombol utama */
.h-btn-primary, .h-btn-white { position: relative; overflow: hidden; }
.h-btn-primary::after, .h-btn-white::after {
    content: ''; position: absolute; top: 0; left: 0; width: 60%; height: 100%;
    background: linear-gradient(100deg, transparent, rgba(255,255,255,.35), transparent);
    transform: translateX(-160%) skewX(-20deg);
    transition: transform .7s ease;
    pointer-events: none;
}
.h-btn-primary:hover::after, .h-btn-white:hover::after { transform: translateX(260%) skewX(-20deg); }
.h-btn:hover { transform: translateY(-2px); }
.h-btn:active { transform: translateY(0); }

/* Ikon layanan sedikit memutar saat kartu disorot */
.h-service .h-icon { transition: transform .35s cubic-bezier(.3,1.4,.5,1); }
.h-service:hover .h-icon { transform: rotate(-8deg) scale(1.08); }

/* Kartu harga terangkat */
.h-price-grid > * { transition: transform .25s ease, box-shadow .25s ease; }
.h-price-grid > *:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); }

/* CTA: cahaya bergerak pelan di latar */
.h-cta::after {
    content: ''; position: absolute; width: 380px; height: 380px; right: -120px; top: -160px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,255,255,.18), transparent 65%);
    animation: hDrift 9s ease-in-out infinite alternate;
    pointer-events: none;
}
@keyframes hDrift { to { transform: translate(-140px, 120px); } }

/* ── Aksesibilitas & performa: matikan semua gerakan bila diminta perangkat ── */
@media (prefers-reduced-motion: reduce) {
    .js-anim .h-hero-text > *, .js-anim .h-hero-visual, .js-anim .h-float-a, .js-anim .h-float-b,
    .h-hero h1 span, .h-dot::after, .h-cta::after { animation: none !important; }
    .js-anim .rv { opacity: 1; transform: none; transition: none; }
    .h-progress { display: none; }
    .h-btn:hover, .h-price-grid > *:hover, .h-service:hover .h-icon { transform: none; }
}
