

body.preloader-active {
  overflow: hidden !important;
  height: 100vh !important;
}

.preloader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #080808;
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.6s cubic-bezier(0.16, 1, 0.3, 1),
              filter 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform, filter;
}

body.light-theme .preloader {
  background: #fafafa;
}

.preloader__progress {
  position: absolute;
  top: 0;
  left: 0;
  height: 2px;
  width: 0%;
  background: linear-gradient(90deg, transparent, #fff, transparent);
  transition: width 0.4s ease;
  z-index: 1;
}

body.light-theme .preloader__progress {
  background: linear-gradient(90deg, transparent, #0a0a0a, transparent);
}

.preloader__body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
}

.preloader__logo-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.preloader__logo-glow {
  position: absolute;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,0.06) 0%, transparent 70%);
  animation: preloaderGlowPulse 2s ease-in-out infinite;
  pointer-events: none;
}

body.light-theme .preloader__logo-glow {
  background: radial-gradient(circle, rgba(0,0,0,0.04) 0%, transparent 70%);
}

@keyframes preloaderGlowPulse {
  0%, 100% {
    transform: scale(1);
    opacity: 0.5;
  }
  50% {
    transform: scale(1.3);
    opacity: 1;
  }
}

.preloader__text-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.2rem;
}

.preloader__brand {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 4.5rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  color: #fff;
  display: flex;
  align-items: baseline;
  user-select: none;
  -webkit-user-select: none;
}

body.light-theme .preloader__brand {
  color: #0a0a0a;
}

.preloader__brand span {
  display: inline-block;
  opacity: 0;
  transform: translateY(30px) scale(0.8);
  animation: preloaderLetterIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.preloader__brand span:nth-child(1)  { animation-delay: 0.1s; }
.preloader__brand span:nth-child(2)  { animation-delay: 0.15s; }
.preloader__brand span:nth-child(3)  { animation-delay: 0.2s; }
.preloader__brand span:nth-child(4)  { animation-delay: 0.25s; }
.preloader__brand span:nth-child(5)  { animation-delay: 0.3s; }
.preloader__brand span:nth-child(6)  { animation-delay: 0.35s; }
.preloader__brand span:nth-child(7)  { animation-delay: 0.4s; }

.preloader__brand span:nth-child(8)  { animation-delay: 0.45s; }
.preloader__brand span:nth-child(9)  { animation-delay: 0.5s; }
.preloader__brand span:nth-child(10) { animation-delay: 0.55s; }

@keyframes preloaderLetterIn {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.8);
    filter: blur(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

.preloader__brand-dot {
  color: #444 !important;
  animation-delay: 0.5s !important;
  margin: 0 0.05em;
}

body.light-theme .preloader__brand-dot {
  color: #bbb !important;
}

.preloader[data-type="page"] .preloader__brand {
  font-size: 2.8rem;
  letter-spacing: 0.2em;
}

.preloader[data-type="page"] .preloader__logo-glow {
  width: 140px;
  height: 140px;
}

.preloader__line {
  width: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, #333, transparent);
  animation: preloaderLineExpand 1s cubic-bezier(0.16, 1, 0.3, 1) 0.6s forwards;
}

body.light-theme .preloader__line {
  background: linear-gradient(90deg, transparent, #ccc, transparent);
}

@keyframes preloaderLineExpand {
  from {
    width: 0;
    opacity: 0;
  }
  to {
    width: 200px;
    opacity: 1;
  }
}

.preloader__subtitle {
  font-family: 'Inter', sans-serif;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.5em;
  text-transform: uppercase;
  color: #444;
  opacity: 0;
  animation: preloaderSubIn 0.8s ease 0.8s forwards;
}

body.light-theme .preloader__subtitle {
  color: #999;
}

@keyframes preloaderSubIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.preloader.preloader--hidden {
  opacity: 0;
  transform: scale(1.05);
  filter: blur(10px);
  pointer-events: none;
}

.preloader.preloader--gone {
  display: none !important;
}

@media (max-width: 768px) {
  .preloader__brand {
    font-size: 2.8rem;
    letter-spacing: 0.2em;
  }

  .preloader__logo-glow {
    width: 140px;
    height: 140px;
  }

  @keyframes preloaderLineExpand {
    from {
      width: 0;
      opacity: 0;
    }
    to {
      width: 140px;
      opacity: 1;
    }
  }
}

@media (max-width: 480px) {
  .preloader__brand {
    font-size: 2rem;
    letter-spacing: 0.15em;
  }

  .preloader__logo-glow {
    width: 100px;
    height: 100px;
  }

  @keyframes preloaderLineExpand {
    from {
      width: 0;
      opacity: 0;
    }
    to {
      width: 100px;
      opacity: 1;
    }
  }
}

.preloader__mark { margin: 0 auto 26px; animation: preMarkIn 1.1s cubic-bezier(.2,.8,.25,1) both; }
.preloader__mark-img { width: 92px; height: 92px; object-fit: contain; border-radius: 24px; animation: preBreathe 2.8s ease-in-out 1.1s infinite; filter: drop-shadow(0 0 34px rgba(255,255,255,.16)); }
@keyframes preMarkIn { from { opacity: 0; transform: scale(.9); filter: blur(10px); } to { opacity: 1; transform: scale(1); filter: blur(0); } }
@keyframes preBreathe { 0%,100% { filter: drop-shadow(0 0 22px rgba(255,255,255,.10)); } 50% { filter: drop-shadow(0 0 40px rgba(255,255,255,.22)); } }
.preloader__count { font-size: .8rem; font-weight: 500; letter-spacing: .45em; text-indent: .45em; color: rgba(255,255,255,.55); font-variant-numeric: tabular-nums; }
.preloader__bar { width: 160px; height: 1px; margin: 14px auto 16px; background: rgba(255,255,255,.14); border-radius: 99px; overflow: hidden; }
.preloader__bar-fill { display: block; height: 100%; width: 0%; background: #fff; }
.preloader__subtitle { font-size: .68rem; letter-spacing: .5em; text-indent: .5em; text-transform: uppercase; color: rgba(255,255,255,.4); animation: preMarkIn 1.1s .15s cubic-bezier(.2,.8,.25,1) both; }
.preloader.preloader--hidden { opacity: 0; transform: scale(1.04); transition: opacity .45s ease, transform .45s ease; }
body.light-theme .preloader__mark-img { filter: drop-shadow(0 0 26px rgba(0,0,0,.18)); animation-name: preBreatheLight; }
@keyframes preBreatheLight { 0%,100% { filter: drop-shadow(0 0 18px rgba(0,0,0,.12)); } 50% { filter: drop-shadow(0 0 34px rgba(0,0,0,.2)); } }
body.light-theme .preloader__count { color: rgba(0,0,0,.55); }
body.light-theme .preloader__bar { background: rgba(0,0,0,.14); }
body.light-theme .preloader__bar-fill { background: #111; }
body.light-theme .preloader__subtitle { color: rgba(0,0,0,.4); }
.preloader[data-type="welcome"] .preloader__progress { display: none; }
@media (prefers-reduced-motion: reduce) {
  .preloader__mark, .preloader__mark-img, .preloader__subtitle { animation: none; }
  .preloader.preloader--hidden { transition: none; }
}
