/* Gerak "feel alive" (design 8.10). Transform + opacity sahaja. Semua mati masa rakam (.sedang-rakam) dan bila reduced-motion. */
@media (prefers-reduced-motion: no-preference) {
  /* skrin buka: glow bernafas */
  .buka .glow { animation: nafas 1.6s ease-in-out infinite; }
  .buka .logo { animation: naik .6s cubic-bezier(.2, .8, .2, 1) both; }
  .buka.hilang { animation: pudar .35s ease forwards; }

  /* masuk/keluar skrin */
  .skrin.masuk-kanan { animation: masukKanan .38s cubic-bezier(.2, .8, .2, 1) both; }
  .skrin.keluar-kiri { animation: keluarKiri .32s cubic-bezier(.4, 0, .8, .2) both; }
  .skrin.masuk-pudar { animation: naik .35s ease both; }

  /* kad naik berperingkat */
  .naik > * { animation: naik .5s cubic-bezier(.2, .8, .2, 1) both; animation-delay: calc(var(--i, 0) * 70ms); }
  .kad-ep .cover:not(.lakaran) { animation: kenBurns 14s ease-in-out infinite alternate; }

  /* titik menyala satu-satu */
  .titik i.lulus, .matriks i.lulus { animation: nyala .5s ease both; animation-delay: calc(var(--i, 0) * 45ms + 250ms); }

  /* tekan butang: kecut + lantun, kilauan krim */
  .pil, .rnd, .bulat-kecil, .tab button, .pilih3 button, .kad-ep, .jalur-take button, .senarai > button { transition: transform .18s cubic-bezier(.3, 1.6, .5, 1); }
  .pil:active, .kad-ep:active, .senarai > button:active { transform: scale(.97); }
  .rnd:active, .bulat-kecil:active, .pilih3 button:active { transform: scale(.9); }
  .pil::before { content: ""; position: absolute; top: 0; bottom: 0; width: 40%; left: -60%; z-index: 1;
    background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .55), transparent); transform: skewX(-18deg); }
  .pil:active::before, .pil.kilau::before { animation: kilau .7s ease; }
  .rnd.pusing svg { animation: pusing .5s cubic-bezier(.3, 1.4, .5, 1); }
  .pilih3 button[aria-pressed="true"] { animation: lompat .35s cubic-bezier(.3, 1.8, .5, 1); }
  .pil .rec-dot { animation: denyut 1.4s ease-in-out infinite; }

  /* lakaran gerak hantu bernafas */
  .lakaran-kad img { animation: hantu 3.2s ease-in-out infinite; }

  /* kiraan undur */
  .kiraan span { animation: kiraBesar .9s cubic-bezier(.2, .8, .2, 1) both; }
  .cincin-kira { transition: stroke-dashoffset 1s linear; }

  /* REC berdenyut, cincin henti penuh ikut durasi (transition diset dari JS) */
  .rec-titik { animation: denyut 1s ease-in-out infinite; }

  /* AI semak: kertas naik, senget, mendap; teks ditaip */
  .kertas.letak { animation: letakKertas .7s cubic-bezier(.2, .9, .3, 1.15) both; }
  .kertas li { animation: taip .45s ease both; animation-delay: calc(var(--i, 0) * 160ms + 450ms); }
  .tunggu-kilau { background: linear-gradient(90deg, rgba(42, 29, 18, .25) 0%, rgba(224, 105, 46, .55) 50%, rgba(42, 29, 18, .25) 100%);
    background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: kilauTeks 1.4s linear infinite; }

  /* upload: bar berkilau, tanda dilukis */
  .bar i { position: relative; overflow: hidden; transition: width .4s ease; }
  .bar i::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .45), transparent); animation: sapu 1.3s linear infinite; }
  .lukis-tanda path { stroke-dasharray: 24; stroke-dashoffset: 24; animation: lukis .5s ease .1s forwards; }

  /* lembaran */
  .lembaran { animation: pudarMasuk .25s ease both; }
  .lembaran .isi-lembaran { animation: naikBawah .35s cubic-bezier(.2, .8, .2, 1) both; }
}

/* masa rakam: hanya REC, cincin, teleprompter bergerak */
.sedang-rakam *:not(.rec-titik):not(.cincin-isi) { animation: none !important; transition: none !important; }

@keyframes nafas { 0%, 100% { transform: scale(.85); opacity: .6; } 50% { transform: scale(1.12); opacity: 1; } }
@keyframes naik { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes pudar { to { opacity: 0; visibility: hidden; } }
@keyframes pudarMasuk { from { opacity: 0; } }
@keyframes naikBawah { from { transform: translateY(100%); } }
@keyframes masukKanan { from { opacity: 0; transform: translateX(36%); } to { opacity: 1; transform: none; } }
@keyframes keluarKiri { to { opacity: 0; transform: translateX(-30%); } }
@keyframes kenBurns { from { transform: scale(1); } to { transform: scale(1.09) translate(-1.5%, -1%); } }
@keyframes nyala { 0% { transform: scale(.2); opacity: 0; } 60% { transform: scale(1.5); } 100% { transform: scale(1); opacity: 1; } }
@keyframes kilau { from { left: -60%; } to { left: 130%; } }
@keyframes pusing { from { transform: rotate(0); } to { transform: rotate(-360deg); } }
@keyframes lompat { 0% { transform: scale(.85); } 60% { transform: scale(1.12); } 100% { transform: scale(1); } }
@keyframes denyut { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .35; transform: scale(.75); } }
@keyframes hantu { 0%, 100% { transform: translateX(0); filter: none; } 50% { transform: translateX(-1.5%); filter: drop-shadow(10px 0 6px rgba(241, 234, 219, .18)); } }
@keyframes kiraBesar { 0% { transform: scale(.4); opacity: 0; } 40% { transform: scale(1.08); opacity: 1; } 100% { transform: scale(1); opacity: .9; } }
@keyframes letakKertas { 0% { transform: translateY(70%) rotate(-5deg); opacity: 0; } 70% { transform: translateY(-3%) rotate(1.2deg); opacity: 1; } 100% { transform: none; } }
@keyframes taip { from { opacity: 0; clip-path: inset(0 100% 0 0); } to { opacity: 1; clip-path: inset(0 0 0 0); } }
@keyframes kilauTeks { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@keyframes sapu { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
@keyframes lukis { to { stroke-dashoffset: 0; } }
