/* ─────────────────────────────────────────────────────────────
   Pinguru Experience Engine — Portal Transitions.
   Tarayıcının sayfalar arası View Transitions özelliğini açar: eski sayfa kısa bir parlamayla söner, yeni sayfa
   yumuşakça belirir; bu sırada kenarlardan mor enerji ve ekrandan geçen ince bir ışık bandı (.pgx-portal) görünür.
   Geçiş yalnız İKİ sayfa da bu dosyayı yüklüyorsa olur: sepet, ödeme, hesap / giriş sayfaları yüklemediği için o
   sayfalara giriş-çıkışta, dış sitelere, banka / 3D Secure yönlendirmelerine geçişte efekt hiç çalışmaz. Gezinme
   beklemez; desteklemeyen tarayıcıda (ör. Firefox) normal sayfa geçişi olur. "Hareketi azalt" tercihinde kapalıdır.
   ───────────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }

  :root { --pgx-pt: .34s; }
  [data-pgx-level="minimal"] { --pgx-pt: .26s; }
  [data-pgx-level="intense"] { --pgx-pt: .42s; }

  ::view-transition-old(root) { animation: pgx-portal-out calc(var(--pgx-pt) * .6) ease-in both; }
  ::view-transition-new(root) { animation: pgx-portal-in var(--pgx-pt) cubic-bezier(.2, .7, .2, 1) calc(var(--pgx-pt) * .25) both; }

  .pgx-portal { position: fixed; inset: 0; z-index: 140; overflow: hidden; pointer-events: none; opacity: 0; }
  .pgx-portal::before {
    content: ""; position: absolute; inset: 0;
    box-shadow: inset 0 0 0 1px rgb(196 181 253 / .55), inset 0 0 70px 6px rgb(124 58 237 / .5), inset 0 0 160px 20px rgb(76 29 149 / .35);
  }
  .pgx-portal::after {
    content: ""; position: absolute; inset: 0 -60%;
    background: linear-gradient(100deg, transparent 42%, rgb(167 139 250 / .14) 47.5%, rgb(237 233 254 / .3) 50%, rgb(167 139 250 / .14) 52.5%, transparent 58%);
    transform: translateX(-45%);
  }
  [data-pgx-level="minimal"] .pgx-portal::after { display: none; }

  /* Geçiş sürerken bir kez oynar. Ayrı kurallar: :active-view-transition'ı tanımayan tarayıcı yedek kuralı da atmasın. */
  :root:active-view-transition .pgx-portal { animation: pgx-portal-edge calc(var(--pgx-pt) * 1.6) ease-out both; }
  :root:active-view-transition .pgx-portal::after { animation: pgx-portal-sweep calc(var(--pgx-pt) * 1.6) cubic-bezier(.3, .6, .3, 1) both; }
  /* Yedek (geçişi desteklemeyen tarayıcı): yalnız ışık katmanı, sayfa içeriği gizlenmez. */
  .pgx-portal.is-play { animation: pgx-portal-edge calc(var(--pgx-pt) * 1.6) ease-out both; }
  .pgx-portal.is-play::after { animation: pgx-portal-sweep calc(var(--pgx-pt) * 1.6) cubic-bezier(.3, .6, .3, 1) both; }
}
@keyframes pgx-portal-out { to { opacity: 0; filter: brightness(1.2) saturate(1.15); } }
@keyframes pgx-portal-in { from { opacity: 0; transform: scale(1.008); } }
@keyframes pgx-portal-edge { 0% { opacity: 0; } 25% { opacity: 1; } 100% { opacity: 0; } }
@keyframes pgx-portal-sweep { from { transform: translateX(-45%); } to { transform: translateX(45%); } }
