/* ----------------------------------------------------------------------------
 * Preloader overlay — logo + morphing orb animation.
 *
 * Covers the page until all images, fonts, and animations are ready.
 * All rules scoped under #loader-overlay.
 * --------------------------------------------------------------------------*/

#loader-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0a0a0a;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  overflow: hidden;
  transition: opacity 0.45s ease, visibility 0s linear 0.45s;
}

html.light #loader-overlay,
html:not(.dark):not([data-theme="dark"]) #loader-overlay {
  background: #ffffff;
}

#loader-overlay.loader-exiting {
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
}

/* ---------- Centred content wrapper ---------- */

.loader-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 40px;
}

/* ---------- Logo ---------- */

.loader-logo {
  width: 180px;
  height: auto;
  object-fit: contain;
}

@media (max-width: 480px) {
  .loader-logo {
    width: 130px;
  }
}

/* ---------- Morphing orb animation ---------- */

.loader {
  height: 80px;
  width: 80px;
  border-radius: 50%;
  position: relative;
}

.loader::before {
  content: "";
  height: 100%;
  width: 100%;
  border: 1px solid rgba(163, 230, 53, 0.5);
  border-radius: 50%;
  position: absolute;
  animation: doitreverse 4s infinite;
}

.loader::after {
  content: "";
  height: 100%;
  width: 100%;
  border: 1px solid rgba(163, 230, 53, 0.5);
  border-radius: 50%;
  position: absolute;
  animation: doit 4s infinite;
}

html.light .loader::before,
html:not(.dark):not([data-theme="dark"]) .loader::before {
  border-color: rgba(0, 0, 0, 0.25);
}

html.light .loader::after,
html:not(.dark):not([data-theme="dark"]) .loader::after {
  border-color: rgba(0, 0, 0, 0.25);
}

@keyframes doit {
  0% {
    transform: scale(1);
  }
  50% {
    border-radius: 20% 50%;
    transform: scale(1.25);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes doitreverse {
  0% {
    transform: rotate(360deg);
  }
  50% {
    border-radius: 50% 20%;
    transform: rotate(180deg);
  }
  100% {
    transform: rotate(0deg);
  }
}

.eye {
  height: 50%;
  width: 50%;
  border-radius: 50%;
  border: 1px solid rgba(163, 230, 53, 0.5);
  background-color: rgb(85, 0, 128);
  position: absolute;
  left: 25%;
  top: 25%;
  animation: showme 4s infinite;
}

html.light .eye,
html:not(.dark):not([data-theme="dark"]) .eye {
  border-color: rgba(0, 0, 0, 0.25);
}

.eye::before {
  content: "";
  height: 20%;
  width: 20%;
  border-radius: 50%;
  background-color: white;
  position: absolute;
  top: 25%;
  left: 50%;
  animation: showme 4s infinite;
}

.eye::after {
  content: "";
  height: 10%;
  width: 10%;
  border-radius: 50%;
  background-color: white;
  position: absolute;
  top: 60%;
  left: 50%;
  animation: showme 4s infinite;
}

html.light .eye::before,
html:not(.dark):not([data-theme="dark"]) .eye::before,
html.light .eye::after,
html:not(.dark):not([data-theme="dark"]) .eye::after {
  background-color: #0a0a0a;
}

@keyframes showme {
  0% {
    transform: scale(0.3);
  }
  50% {
    transform: scale(1);
  }
  100% {
    transform: scale(0.3);
  }
}

@media (prefers-reduced-motion: reduce) {
  #loader-overlay {
    transition: opacity 0.2s ease, visibility 0s linear 0.2s;
  }
  .loader::before,
  .loader::after,
  .eye,
  .eye::before,
  .eye::after {
    animation: none;
  }
}
