/* =========================================================
   TRANSITIONS — identitas Ucansee di semua halaman.
   1) SPLASH "kamera menyala": sekali per sesi (website & /track/).
      Jendela bidik masuk, logo fokus (focus pull), AF terkunci,
      lalu shutter + iris terbuka memperlihatkan halaman.
   2) SHUTTER antar halaman: bidik + AF berkedip, tirai focal-plane
      menutup ("FRAME 03 · LAYANAN"), lalu di halaman baru tirai
      membuka dan isi halaman "rack focus" dari buram ke tajam.
   Kelas di <html> dipasang boot.js sebelum halaman tergambar.
   ========================================================= */

/* ---------- 1. SPLASH ---------- */
@property --iris { syntax: "<length>"; inherits: false; initial-value: 0px; }
.ucs-splash { display: none; }
html.ucs-splash-on { overflow: hidden; }
/* Penutup polos sampai elemen splash siap (cegah konten berkedip) */
html.ucs-splash-hold body:before { content: ""; position: fixed; inset: 0; z-index: 99998; background: #070807; }
html.ucs-splash-on .ucs-splash { position: fixed; inset: 0; z-index: 100000; /* di atas header (9999) */ display: grid; place-items: center; background: radial-gradient(900px circle at 50% 45%, #121512, #070807 70%); color: #fff; cursor: pointer;
  -webkit-mask: radial-gradient(circle at 50% 50%, transparent var(--iris), #000 calc(var(--iris) + 1px));
          mask: radial-gradient(circle at 50% 50%, transparent var(--iris), #000 calc(var(--iris) + 1px)); }
/* Animasi konten menunggu sampai splash terbuka */
html.ucs-splash-hold main *, html.ucs-splash-hold main *:before, html.ucs-splash-hold main *:after { animation-play-state: paused !important; }

/* Grid halus di latar */
.ucs-splash:before { content: ""; position: absolute; inset: 0; background: linear-gradient(rgba(255, 255, 255, .035) 1px, transparent 1px) 0 0 / 72px 72px, linear-gradient(90deg, rgba(255, 255, 255, .035) 1px, transparent 1px) 0 0 / 72px 72px; pointer-events: none; }

.ts-frame { position: relative; width: min(560px, 78vw); aspect-ratio: 16 / 9; display: grid; place-items: center; }
.ts-c { position: absolute; width: 34px; height: 34px; border: 0 solid var(--accent, #C4D982); }
.ts-tl { top: 0; left: 0; border-top-width: 2px; border-left-width: 2px; --fx: -40vw; --fy: -40vh; }
.ts-tr { top: 0; right: 0; border-top-width: 2px; border-right-width: 2px; --fx: 40vw; --fy: -40vh; }
.ts-bl { bottom: 0; left: 0; border-bottom-width: 2px; border-left-width: 2px; --fx: -40vw; --fy: 40vh; }
.ts-br { bottom: 0; right: 0; border-bottom-width: 2px; border-right-width: 2px; --fx: 40vw; --fy: 40vh; }
.ts-logo { width: 62%; height: auto; }
.ts-af { position: absolute; width: 74%; height: 62%; border: 1.5px solid rgba(255, 255, 255, .55); border-radius: 4px; opacity: 0; }
/* Crosshair kecil di tengah */
.ts-frame:after { content: ""; position: absolute; width: 14px; height: 14px; background: linear-gradient(var(--accent, #C4D982), var(--accent, #C4D982)) center / 100% 1.5px no-repeat, linear-gradient(var(--accent, #C4D982), var(--accent, #C4D982)) center / 1.5px 100% no-repeat; opacity: .5; }

.ts-hud { position: absolute; left: 28px; right: 28px; display: flex; justify-content: space-between; align-items: center; gap: 16px; font: .78rem ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .12em; color: rgba(255, 255, 255, .7); text-transform: uppercase; }
.ts-top { top: 24px; }
.ts-bottom { bottom: 30px; }
.ts-rec { display: inline-flex; align-items: center; gap: 8px; color: #fff; }
.ts-rec i { width: 9px; height: 9px; border-radius: 50%; background: #ff4d4d; box-shadow: 0 0 10px rgba(255, 77, 77, .8); }
.ts-tc { color: var(--accent, #C4D982); font-variant-numeric: tabular-nums; }
.ts-scene { max-width: 60%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #fff; }
.ts-meter { position: absolute; left: 28px; right: 28px; bottom: 18px; height: 2px; background: rgba(255, 255, 255, .08); overflow: hidden; }
.ts-meter span { position: absolute; inset: 0 auto 0 0; width: 30%; background: var(--accent, #C4D982); }
.ts-flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; }

/* Urutan animasi */
.ucs-splash .ts-c { animation: tsCorner .8s cubic-bezier(.16, 1, .3, 1) both; }
.ucs-splash .ts-logo { animation: tsFocus 1.5s cubic-bezier(.3, .7, .2, 1) .25s both; }
.ucs-splash .ts-af { animation: tsAf 1s ease-out 1.25s both; }
.ucs-splash .ts-rec i { animation: tsRec 1.2s steps(1, end) infinite; }
.ucs-splash .ts-hud { animation: tsFade .6s ease-out .2s both; }
.ucs-splash .ts-meter span { animation: tsMeter 1.3s ease-in-out infinite; }
@keyframes tsCorner { from { transform: translate(var(--fx), var(--fy)); opacity: 0; } 30% { opacity: 1; } }
/* Fokus "mencari" seperti autofocus lensa sebelum tajam */
@keyframes tsFocus { 0% { filter: blur(18px); opacity: 0; transform: scale(1.08); } 35% { filter: blur(4px); opacity: 1; } 55% { filter: blur(9px); } 75% { filter: blur(1.5px); } 100% { filter: blur(0); transform: scale(1); } }
@keyframes tsAf { 0% { opacity: 0; transform: scale(1.12); } 25% { opacity: 1; transform: scale(1); border-color: rgba(255, 255, 255, .55); } 45%, 65% { border-color: var(--accent, #C4D982); box-shadow: 0 0 18px rgba(196, 217, 130, .35); } 55% { opacity: .2; } 100% { opacity: .9; border-color: var(--accent, #C4D982); } }
@keyframes tsRec { 50% { opacity: .15; } }
@keyframes tsFade { from { opacity: 0; } }
@keyframes tsMeter { 0% { transform: translateX(-100%); } 100% { transform: translateX(400%); } }

/* Keluar: shutter berkedip lalu iris membuka dari tengah */
.ucs-splash.is-out .ts-flash { animation: tsFlash .35s ease-out both; }
.ucs-splash.is-out { transition: --iris 1s cubic-bezier(.7, 0, .2, 1) .12s; --iris: 150vmax; }
.ucs-splash.is-out .ts-frame { transition: transform 1s cubic-bezier(.7, 0, .2, 1) .12s, opacity .6s .3s; transform: scale(1.35); opacity: 0; }
@keyframes tsFlash { 0% { opacity: 0; } 20% { opacity: .85; } 100% { opacity: 0; } }

@media (max-width: 640px) {
  .ts-hud { left: 18px; right: 18px; font-size: .68rem; letter-spacing: .08em; }
  .ts-meter { left: 18px; right: 18px; }
  .ts-c { width: 24px; height: 24px; }
  .ts-bottom span:last-child { display: none; }
  .ts-scene { max-width: 100%; }
}

/* ---------- 2. SHUTTER antar halaman ---------- */
/* Tirai focal-plane shutter: dua bilah bergaris logam, tepi pertemuan hijau aksen */
.ucs-shot .sh-top, .ucs-shot .sh-bot, html.ucs-shot-in:before, html.ucs-shot-in:after {
  position: fixed; left: 0; right: 0; height: 50.5vh; z-index: 100001; pointer-events: none;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .05), transparent 30%, rgba(0, 0, 0, .35)),
    repeating-linear-gradient(180deg, #151815 0 26px, #0a0c0a 26px 28px, #1b1f1b 28px 29px); }
.ucs-shot .sh-top, html.ucs-shot-in:before { top: 0; border-bottom: 2px solid var(--accent, #C4D982); box-shadow: 0 6px 28px rgba(196, 217, 130, .18); }
.ucs-shot .sh-bot, html.ucs-shot-in:after { bottom: 0; border-top: 2px solid var(--accent, #C4D982); box-shadow: 0 -6px 28px rgba(196, 217, 130, .18); }
/* Label frame di garis pertemuan tirai */
.ucs-shot .sh-top, html.ucs-shot-in:before { display: flex; align-items: flex-end; justify-content: center; padding-bottom: 16px; box-sizing: border-box; font: 700 clamp(.82rem, 1.6vw, 1rem) ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .22em; text-transform: uppercase; color: #fff; text-shadow: 0 0 18px rgba(196, 217, 130, .35); }

/* Keluar (link diklik): bidik → AF berkedip → tirai menutup */
.ucs-shot { position: fixed; inset: 0; z-index: 100001; pointer-events: all; }
.ucs-shot .sh-top { transform: translateY(-101%); animation: shCloseDown .34s cubic-bezier(.55, 0, .9, .45) .16s forwards; }
.ucs-shot .sh-bot { transform: translateY(101%); animation: shCloseUp .34s cubic-bezier(.55, 0, .9, .45) .16s forwards; }
.ucs-shot .sh-top span { opacity: 0; animation: shLabel .2s ease-out .44s forwards; }
@keyframes shLabel { to { opacity: 1; } }
.ucs-shot .sh-vf { position: fixed; inset: 22px; z-index: 100002; pointer-events: none; animation: shFrame .2s cubic-bezier(.16, 1, .3, 1) both; }
.ucs-shot .sh-vf i { position: absolute; width: 30px; height: 30px; border: 0 solid var(--accent, #C4D982); }
.ucs-shot .sh-vf i:nth-child(1) { top: 0; left: 0; border-top-width: 2px; border-left-width: 2px; }
.ucs-shot .sh-vf i:nth-child(2) { top: 0; right: 0; border-top-width: 2px; border-right-width: 2px; }
.ucs-shot .sh-vf i:nth-child(3) { bottom: 0; left: 0; border-bottom-width: 2px; border-left-width: 2px; }
.ucs-shot .sh-vf i:nth-child(4) { bottom: 0; right: 0; border-bottom-width: 2px; border-right-width: 2px; }
.ucs-shot .sh-af { position: fixed; left: 50%; top: 50%; width: 90px; height: 64px; margin: -32px 0 0 -45px; z-index: 100002; border: 1.5px solid var(--accent, #C4D982); border-radius: 4px; opacity: 0; animation: shAf .22s steps(2, end) .02s 2 both; }
@keyframes shCloseDown { to { transform: translateY(0); } }
@keyframes shCloseUp { to { transform: translateY(0); } }
@keyframes shFrame { from { opacity: 0; transform: scale(1.06); } }
@keyframes shAf { 0% { opacity: 1; } 100% { opacity: 0; } }

/* Masuk (halaman baru): tirai membuka, bidik memudar, halaman "rack focus" dari buram ke tajam */
html.ucs-shot-in:before { content: attr(data-cut); animation: shOpenUp .55s cubic-bezier(.65, 0, .35, 1) .1s forwards; }
html.ucs-shot-in:after { content: ""; animation: shOpenDown .55s cubic-bezier(.65, 0, .35, 1) .1s forwards; }
html.ucs-shot-in body:after { content: ""; position: fixed; inset: 22px; z-index: 100002; pointer-events: none; opacity: .9;
  --c: var(--accent, #C4D982);
  background:
    linear-gradient(var(--c), var(--c)) 0 0 / 30px 2px, linear-gradient(var(--c), var(--c)) 0 0 / 2px 30px,
    linear-gradient(var(--c), var(--c)) 100% 0 / 30px 2px, linear-gradient(var(--c), var(--c)) 100% 0 / 2px 30px,
    linear-gradient(var(--c), var(--c)) 0 100% / 30px 2px, linear-gradient(var(--c), var(--c)) 0 100% / 2px 30px,
    linear-gradient(var(--c), var(--c)) 100% 100% / 30px 2px, linear-gradient(var(--c), var(--c)) 100% 100% / 2px 30px;
  background-repeat: no-repeat; animation: shVfOut .5s ease-out .45s forwards; }
html.ucs-shot-in main, html.ucs-shot-in footer { animation: shRack .8s cubic-bezier(.2, .7, .2, 1) .2s both; }
@keyframes shOpenUp { from { transform: translateY(0); } to { transform: translateY(-101%); } }
@keyframes shOpenDown { from { transform: translateY(0); } to { transform: translateY(101%); } }
@keyframes shVfOut { to { opacity: 0; transform: scale(1.04); } }
@keyframes shRack { from { filter: blur(6px); transform: scale(1.015); opacity: .6; } to { filter: none; transform: none; opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  .ucs-splash *, .ucs-splash:before { animation: none !important; }
  .ucs-splash.is-out { transition: opacity .3s; opacity: 0; --iris: 0px; }
  .ucs-splash.is-out .ts-frame { transition: none; transform: none; }
  html.ucs-shot-in main, html.ucs-shot-in footer { animation: none; }
}
