/* =========================================================
   PRELOADER - Animasi pembuka D'HOTZ Fried Chicken
   ========================================================= */

body.is-loading {
  overflow: hidden;
}

#preloader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 50% 38%, #E01010 0%, #C40000 45%, #7A0000 100%);
  color: #FFFFFF;
  overflow: hidden;
  transition: opacity 0.6s ease, visibility 0.6s ease, transform 0.8s cubic-bezier(0.7, 0, 0.2, 1);
}

#preloader.done {
  opacity: 0;
  visibility: hidden;
  transform: translateY(-100%);
  pointer-events: none;
}

/* Pola percikan api / titik di background */
#preloader::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(rgba(245, 166, 35, 0.18) 2px, transparent 2px),
    radial-gradient(rgba(255, 255, 255, 0.08) 1.5px, transparent 1.5px);
  background-size: 46px 46px, 28px 28px;
  background-position: 0 0, 14px 14px;
  animation: pl-drift 14s linear infinite;
  pointer-events: none;
}

.pl-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
  padding: 24px;
  text-align: center;
}

.pl-logo-wrap {
  position: relative;
  width: 170px;
  height: 170px;
  display: grid;
  place-items: center;
}

.pl-logo-wrap img {
  position: relative;
  z-index: 2;
  width: 140px;
  height: auto;
  filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.45));
  animation: pl-bounce 1.2s ease-in-out infinite;
}

/* Cincin berputar di sekeliling logo */
.pl-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 4px solid rgba(255, 255, 255, 0.15);
  border-top-color: #F5A623;
  border-right-color: #FFB703;
  animation: pl-spin 1s linear infinite;
}

.pl-ring.two {
  inset: 14px;
  border-width: 3px;
  border-top-color: transparent;
  border-right-color: transparent;
  border-bottom-color: #FFFFFF;
  animation-duration: 1.6s;
  animation-direction: reverse;
}

/* Denyut cahaya */
.pl-glow {
  position: absolute;
  inset: 10px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(245, 166, 35, 0.55), transparent 70%);
  animation: pl-pulse 1.6s ease-in-out infinite;
}

.pl-brand {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}

.pl-name {
  font-size: clamp(2rem, 7vw, 2.8rem);
  font-weight: 900;
  letter-spacing: -0.01em;
  color: #FFB703;
  text-shadow: 0 3px 0 #A80000, 0 8px 18px rgba(0, 0, 0, 0.35);
  animation: pl-rise 0.7s 0.1s both cubic-bezier(0.2, 0.8, 0.2, 1);
}

.pl-sub {
  margin-top: 4px;
  font-size: clamp(0.85rem, 3vw, 1.05rem);
  font-weight: 800;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: #FFFFFF;
  animation: pl-rise 0.7s 0.3s both cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* Progress bar */
.pl-bar {
  width: min(240px, 62vw);
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
  overflow: hidden;
  animation: pl-rise 0.7s 0.5s both cubic-bezier(0.2, 0.8, 0.2, 1);
}

.pl-bar span {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, #F5A623, #FFE08A);
  box-shadow: 0 0 12px rgba(245, 166, 35, 0.8);
  transition: width 0.25s ease-out;
}

.pl-text {
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.85);
  animation: pl-rise 0.7s 0.6s both cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes pl-spin {
  to { transform: rotate(360deg); }
}

@keyframes pl-bounce {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-8px) scale(1.04); }
}

@keyframes pl-pulse {
  0%, 100% { opacity: 0.5; transform: scale(0.9); }
  50% { opacity: 1; transform: scale(1.15); }
}

@keyframes pl-rise {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pl-drift {
  to { background-position: 46px 46px, 60px 60px; }
}

@media (prefers-reduced-motion: reduce) {
  #preloader { transition: opacity 0.3s ease, visibility 0.3s ease; transform: none !important; }
  .pl-ring, .pl-glow, .pl-logo-wrap img, #preloader::before { animation: none !important; }
}
