/* GO RENTAL RD — Preloader | v=20260817
   Full-viewport splash shown while the page's critical assets (chiefly the
   hero video) become ready to play. Reuses the site's own gold/near-black
   tokens (--accent-3, --bg from styles.css) — no separate palette.

   Two independent dismissal paths, so a JS failure can never trap a visitor
   behind a black screen:
   1. JS (lib/preloader.js) hides it once the hero video can actually play,
      with a floor (never flashes for <650ms) and a ceiling (never blocks
      past 3.5s) — see hidePreloader()/finish() there.
   2. A pure-CSS animation (#preloader's own `animation`) fades it out on a
      fixed 4.6s timer as a fallback if JS never attaches. `.pl-ready`
      (added by the JS as soon as it runs) cancels this fallback so the two
      paths never fight each other. */

#preloader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: radial-gradient(120% 90% at 50% 42%, #1a150c 0%, #0a0805 70%);
  animation: pl-timeout-fallback 4.6s forwards;
}
#preloader.pl-ready { animation: none; }
#preloader.pl-hide {
  opacity: 0;
  transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.pl-glow {
  position: absolute;
  width: 60vw;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(212, 175, 55, 0.14), transparent 70%);
  animation: pl-pulse 2.6s ease-in-out infinite;
  pointer-events: none;
}

.pl-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  opacity: 0;
  animation: pl-logo-in 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.15s forwards;
}
.pl-logo {
  width: 84px;
  height: auto;
  filter: drop-shadow(0 6px 24px rgba(212, 175, 55, 0.25));
}
.pl-line {
  width: 0;
  height: 1.5px;
  background: linear-gradient(90deg, transparent, var(--accent-3), transparent);
  animation: pl-line-draw 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.55s forwards;
}
.pl-tag {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: rgba(245, 244, 240, 0.55);
  opacity: 0;
  animation: pl-fade-in 0.6s ease-out 0.75s forwards;
}
.pl-bar {
  width: 120px;
  height: 2px;
  border-radius: 2px;
  background: rgba(245, 244, 240, 0.12);
  overflow: hidden;
  margin-top: 2px;
}
.pl-bar-fill {
  width: 40%;
  height: 100%;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, var(--accent-3), transparent);
  animation: pl-sweep 1.3s ease-in-out infinite;
}

@keyframes pl-logo-in {
  from { opacity: 0; transform: translateY(10px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes pl-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes pl-line-draw { to { width: 64px; } }
@keyframes pl-pulse {
  0%, 100% { opacity: 0.55; transform: scale(1); }
  50%      { opacity: 1;    transform: scale(1.08); }
}
@keyframes pl-sweep {
  0%   { transform: translateX(-140%); }
  100% { transform: translateX(340%); }
}
@keyframes pl-timeout-fallback {
  0%, 85% { opacity: 1; }
  100%    { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  #preloader { animation-duration: 0.01ms; }
  .pl-glow, .pl-bar-fill { animation: none; opacity: 0.8; }
  .pl-content { animation: none; opacity: 1; }
  .pl-line { animation: none; width: 64px; }
  .pl-tag { animation: none; opacity: 1; }
  #preloader.pl-hide { transition: opacity 0.15s ease; }
}
