/* ============================================================
   SOLARMAR - LOADING SCREEN
   Company logo reveal + glow + progress animation
   ============================================================ */

.loader {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #0d1b2a;
  overflow: hidden;
}

.loader::before,
.loader::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.loader::before {
  width: 700px;
  height: 700px;
  background: radial-gradient(circle, rgba(244, 162, 97, 0.12) 0%, rgba(13, 27, 42, 0) 62%);
  animation: loaderGlow 2.4s ease-in-out infinite;
}

.loader::after {
  width: 940px;
  height: 940px;
  background: radial-gradient(circle, rgba(255, 209, 102, 0.07) 0%, rgba(13, 27, 42, 0) 55%);
  animation: loaderGlow 3s ease-in-out infinite reverse;
}

@keyframes loaderGlow {
  0%, 100% { transform: scale(0.88); opacity: 0.7; }
  50% { transform: scale(1.06); opacity: 1; }
}

.loader__inner {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 2;
}

/* Company logo */
.loader__logo {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 2.4rem;
  opacity: 0;
  transform: scale(0.72);
}

.loader__logo-glow {
  position: absolute;
  width: 460px;
  height: 460px;
  border-radius: 50%;
  background: radial-gradient(circle,
    rgba(255, 209, 102, 0.22) 0%,
    rgba(244, 162, 97, 0.08) 42%,
    rgba(13, 27, 42, 0) 70%);
  animation: loaderGlow 2.2s ease-in-out infinite;
  pointer-events: none;
}

.loader__logo-img {
  position: relative;
  width: min(330px, 72vw);
  height: auto;
  filter: drop-shadow(0 0 24px rgba(255, 209, 102, 0.35));
  animation: logoBreathe 2.4s ease-in-out infinite;
}

@keyframes logoBreathe {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.025); opacity: 0.94; }
}

/* Loader text */
.loader__brand {
  text-align: center;
}

.loader__brand-main {
  font-family: "Montserrat", sans-serif;
  font-weight: 700;
  font-size: clamp(0.72rem, 2.4vw, 0.92rem);
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: var(--amber-300, #ffd166);
  opacity: 0;
  transform: translateY(18px);
}

.loader__brand-sub {
  font-family: "Montserrat", sans-serif;
  font-weight: 600;
  font-size: clamp(0.72rem, 2.2vw, 0.9rem);
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.8);
  margin-top: 0.7rem;
  opacity: 0;
  transform: translateY(16px);
}

.loader__brand-tagline {
  font-family: "Open Sans", sans-serif;
  font-weight: 400;
  font-size: 0.78rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
  margin-top: 0.7rem;
  opacity: 0;
  transform: translateY(12px);
}

.loader__progress {
  position: relative;
  width: 260px;
  height: 4px;
  border-radius: 0;
  background: rgba(255, 255, 255, 0.12);
  margin-top: 3.2rem;
  overflow: hidden;
  opacity: 0;
}

.loader__progress-bar {
  position: absolute;
  inset: 0;
  width: 0%;
  background: linear-gradient(90deg, #f4a261, #ffd166);
  border-radius: 0;
  box-shadow: 0 0 14px rgba(255, 209, 102, 0.7);
}

.loader__progress-text {
  font-family: "Montserrat", sans-serif;
  font-weight: 600;
  font-size: 0.72rem;
  letter-spacing: 0.35em;
  color: rgba(255, 255, 255, 0.7);
  margin-top: 1rem;
  opacity: 0;
}

.loader__done {
  opacity: 0;
  font-family: "Montserrat", sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.3em;
  color: #ffd166;
  margin-top: 1rem;
  text-transform: uppercase;
}

/* Small stars for depth */
.loader__star {
  position: absolute;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #ffd166;
  opacity: 0.5;
  animation: starTwinkle 2.6s ease-in-out infinite;
}

@keyframes starTwinkle {
  0%, 100% { opacity: 0.2; }
  50% { opacity: 0.8; }
}

/* Loader exit -> reveal main page */
body.loaded .loader {
  animation: loaderExit 0.9s cubic-bezier(0.77, 0, 0.175, 1) forwards;
  pointer-events: none;
}

@keyframes loaderExit {
  to {
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
  }
}

@media (max-width: 420px) {
  .loader__logo-img { width: 66vw; }
}

@media (prefers-reduced-motion: reduce) {
  .loader__logo-glow,
  .loader__logo-img {
    animation: none;
  }
}