/* Leopati animated preloader - adapted from preloader.html with namespaced selectors. */
:root {
  --leopati-preloader-bg: #050510;
  --leopati-preloader-text: #ffffff;
  --leopati-preloader-scale: 0.35;
}

body.leopati-preloader-active {
  overflow: hidden;
}

html.leopati-preloader-already-seen #leopati-preloader {
  display: none !important;
}

#leopati-preloader {
  position: fixed;
  inset: 0;
  background: var(--leopati-preloader-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2147483000;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.7s ease, visibility 0.7s ease;
}

#leopati-preloader.leopati-preloader-hide {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

#leopati-preloader-stage {
  position: relative;
  width: 500px;
  height: 450px;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: scale(var(--leopati-preloader-scale));
  transform-origin: center;
}

#leopati-preloader-logo {
  position: relative;
  display: flex;
  align-items: center;
  font-size: clamp(48px, 8vw, 96px);
  font-weight: 900;
  letter-spacing: -0.5px;
  color: var(--leopati-preloader-text);
  z-index: 10;
  user-select: none;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

#leopati-preloader-caret {
  display: inline-block;
  width: 3px;
  color: var(--leopati-preloader-text);
  opacity: 1;
  margin-left: 2px;
}

#leopati-preloader-caret.blinking {
  animation: leopati-preloader-blink 0.7s step-end infinite;
}

#leopati-preloader-caret.keystroke {
  animation: leopati-preloader-caret-keystroke 0.18s ease-out forwards;
}

#leopati-preloader-caret.hidden {
  opacity: 0;
  animation: none;
}

@keyframes leopati-preloader-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

@keyframes leopati-preloader-caret-keystroke {
  0%   { transform: scaleY(1.6); opacity: 1; color: #c084fc; }
  40%  { transform: scaleY(0.75); opacity: 0.2; }
  75%  { transform: scaleY(1.1); opacity: 1; color: #e9d5ff; }
  100% { transform: scaleY(1);   opacity: 1; color: var(--leopati-preloader-text); }
}

#leopati-preloader-blob-container {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.leopati-preloader-blob {
  position: absolute;
  border-radius: 50%;
  opacity: 0;
  transform: scale(0) translate(0, 0);
  mix-blend-mode: screen;
}

.leopati-preloader-blob:nth-child(1) {
  width: 220px; height: 220px;
  background: radial-gradient(circle at 35% 30%, #a855f7, #7b2ff7 60%, #2d1b69);
  left: calc(50% - 190px); top: calc(50% - 180px);
  border-radius: 60% 40% 55% 45% / 50% 60% 40% 50%;
}
.leopati-preloader-blob:nth-child(2) {
  width: 160px; height: 160px;
  background: radial-gradient(circle at 40% 35%, #f9a8d4, #e84393 55%, #be185d);
  left: calc(50% - 10px); top: calc(50% - 120px);
  border-radius: 45% 55% 40% 60% / 60% 40% 55% 45%;
}
.leopati-preloader-blob:nth-child(3) {
  width: 120px; height: 120px;
  background: radial-gradient(circle at 35% 30%, #67e8f9, #00c8e8 55%, #0284c7);
  left: calc(50% - 140px); top: calc(50% + 10px);
  border-radius: 55% 45% 60% 40% / 45% 55% 45% 55%;
}
.leopati-preloader-blob:nth-child(4) {
  width: 100px; height: 100px;
  background: radial-gradient(circle at 35% 30%, #fca5a5, #ff5c72 55%, #dc2626);
  left: calc(50% + 80px); top: calc(50% - 140px);
  border-radius: 40% 60% 45% 55% / 55% 45% 60% 40%;
}
.leopati-preloader-blob:nth-child(5) {
  width: 140px; height: 140px;
  background: radial-gradient(circle at 35% 30%, #93c5fd, #4a90d9 55%, #1d4ed8);
  left: calc(50% + 10px); top: calc(50% - 10px);
  border-radius: 50% 50% 40% 60% / 60% 40% 50% 50%;
}
.leopati-preloader-blob:nth-child(6) {
  width: 90px; height: 90px;
  background: radial-gradient(circle at 35% 30%, #e9d5ff, #c471ed 55%, #7c3aed);
  left: calc(50% - 185px); top: calc(50% - 35px);
  border-radius: 60% 40% 50% 50% / 50% 50% 60% 40%;
}
.leopati-preloader-blob:nth-child(7) {
  width: 180px; height: 180px;
  background: radial-gradient(circle at 35% 30%, #6d28d9, #2d1b69 60%, #1e1b4b);
  left: calc(50% - 110px); top: calc(50% - 10px);
  border-radius: 50% 50% 60% 40% / 40% 60% 50% 50%;
}
.leopati-preloader-blob:nth-child(8) {
  width: 80px; height: 80px;
  background: radial-gradient(circle at 35% 30%, #f0abfc, #e879f9 55%, #a21caf);
  left: calc(50% + 10px); top: calc(50% - 150px);
  border-radius: 45% 55% 55% 45% / 55% 45% 45% 55%;
}

@keyframes leopati-preloader-blob-morph-1 {
  0%,100% { border-radius: 60% 40% 55% 45% / 50% 60% 40% 50%; }
  33%      { border-radius: 40% 60% 45% 55% / 60% 40% 55% 45%; }
  66%      { border-radius: 55% 45% 60% 40% / 45% 55% 50% 50%; }
}
@keyframes leopati-preloader-blob-morph-2 {
  0%,100% { border-radius: 45% 55% 40% 60% / 60% 40% 55% 45%; }
  33%      { border-radius: 60% 40% 55% 45% / 45% 55% 40% 60%; }
  66%      { border-radius: 40% 60% 45% 55% / 55% 45% 60% 40%; }
}
@keyframes leopati-preloader-blob-morph-3 {
  0%,100% { border-radius: 55% 45% 60% 40% / 45% 55% 45% 55%; }
  50%      { border-radius: 40% 60% 45% 55% / 60% 40% 55% 45%; }
}
@keyframes leopati-preloader-blob-bloom {
  0%   { opacity: 0; transform: scale(0) translate(0, 0); }
  60%  { opacity: 0.85; }
  100% { opacity: 0.9;  transform: scale(1) translate(0, 0); }
}
@keyframes leopati-preloader-blob-dissolve {
  0%   { opacity: 0.9; transform: scale(1); }
  100% { opacity: 0;   transform: scale(0); }
}

#leopati-preloader-dot {
  display: inline-block;
  background: linear-gradient(90deg, #a78bfa, #f472b6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  opacity: 0;
}

#leopati-preloader-dot.pop {
  animation: leopati-preloader-dot-fall 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) forwards,
             leopati-preloader-dot-impact 0.7s ease-out 0.45s forwards;
}

@keyframes leopati-preloader-dot-fall {
  0%   { opacity: 0; transform: translateY(-40px); }
  100% { opacity: 1; transform: translateY(0); }
}
@keyframes leopati-preloader-dot-impact {
  0%   { text-shadow: none; }
  20%  { text-shadow: 0 0 20px rgba(167, 139, 250, 1), 0 0 45px rgba(244, 114, 182, 0.9), 0 0 70px rgba(167, 139, 250, 0.5); }
  100% { text-shadow: 0 0 6px rgba(167, 139, 250, 0.3), 0 0 14px rgba(244, 114, 182, 0.2); }
}

#leopati-preloader-burst {
  position: fixed;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: transparent;
  border: 2px solid rgba(196, 113, 237, 0.8);
  pointer-events: none;
  opacity: 0;
}
#leopati-preloader-burst.fire {
  animation: leopati-preloader-burst-ring 0.6s ease-out forwards;
}
@keyframes leopati-preloader-burst-ring {
  0%   { transform: scale(1);  opacity: 0.8; }
  100% { transform: scale(18); opacity: 0; }
}

@media (max-width: 768px) {
  :root { --leopati-preloader-scale: 0.30; }
  #leopati-preloader-stage { width: 430px; height: 390px; }
}

@media (prefers-reduced-motion: reduce) {
  .leopati-preloader-blob { animation: none !important; opacity: 0.7 !important; transform: scale(1) !important; }
  #leopati-preloader-caret { animation: none; }
  #leopati-preloader-dot.pop { animation: none; opacity: 1; }
  #leopati-preloader-burst.fire { animation: none; }
}
