/*
 * AdeptDEV Welcome Preloader v1.0.0
 * Frontend presentation layer only.
 * Copyright (c) 2026 AdeptDEV — t.me/tcpraw
 */

html.adev-welcome-armed,
html.adev-welcome-armed body {
  overflow: hidden;
}

.adev-welcome {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  display: none;
  align-items: center;
  justify-content: center;
  min-height: 100dvh;
  padding: max(24px, env(safe-area-inset-top)) max(22px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(22px, env(safe-area-inset-left));
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(circle at 50% 42%, rgba(167,45,82,.18), transparent 30%),
    radial-gradient(circle at 72% 68%, rgba(116,28,57,.12), transparent 34%),
    #f8f7f8;
  color: #171419;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity .42s cubic-bezier(.22,1,.36,1), visibility .42s ease;
}

html.adev-welcome-armed .adev-welcome {
  display: flex;
}

.adev-welcome::before,
.adev-welcome::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  filter: blur(2px);
  pointer-events: none;
}

.adev-welcome::before {
  width: min(62vw, 720px);
  aspect-ratio: 1;
  left: 50%;
  top: 46%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(167,45,82,.10), rgba(167,45,82,0) 67%);
  animation: adevWelcomeAura 3.2s ease-in-out infinite alternate;
}

.adev-welcome::after {
  width: 180px;
  height: 1px;
  left: 50%;
  top: calc(50% + 142px);
  transform: translateX(-50%);
  background: linear-gradient(90deg, transparent, rgba(167,45,82,.44), transparent);
  opacity: .8;
}

.adev-welcome.is-leaving {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.adev-welcome__panel {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: min(100%, 420px);
  text-align: center;
  transform: translateY(-2vh);
  animation: adevWelcomePanelIn .72s cubic-bezier(.16,1,.3,1) both;
}

.adev-welcome__mark {
  position: relative;
  display: grid;
  place-items: center;
  width: 92px;
  height: 92px;
  margin-bottom: 24px;
}

.adev-welcome__mark::before,
.adev-welcome__mark::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(167,45,82,.22);
}

.adev-welcome__mark::before {
  inset: 4px;
  animation: adevWelcomeOrbit 5.8s linear infinite;
}

.adev-welcome__mark::after {
  inset: 13px;
  border-color: rgba(217,77,121,.20);
  animation: adevWelcomeOrbit 4.6s linear infinite reverse;
}

.adev-welcome__logo-core {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 18px;
  background: linear-gradient(145deg, #b73760, #741c39);
  box-shadow: 0 16px 42px rgba(116,28,57,.24), inset 0 1px 0 rgba(255,255,255,.25);
  color: #fff;
  font-family: Onest, sans-serif;
  font-size: 27px;
  font-weight: 800;
  letter-spacing: -.04em;
}

.adev-welcome__dot {
  position: absolute;
  z-index: 3;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #d94d79;
  box-shadow: 0 0 0 4px rgba(217,77,121,.10);
}
.adev-welcome__dot--a { top: 18px; right: 3px; }
.adev-welcome__dot--b { bottom: 11px; left: 8px; width: 5px; height: 5px; background: #741c39; }
.adev-welcome__dot--c { bottom: 1px; right: 25px; width: 6px; height: 6px; background: #a72d52; }

.adev-welcome__brand {
  margin: 0;
  font-family: Onest, sans-serif;
  font-size: clamp(30px, 7vw, 42px);
  line-height: 1;
  font-weight: 800;
  letter-spacing: -.045em;
}

.adev-welcome__brand-accent {
  background: linear-gradient(135deg, #a72d52, #d94d79 62%, #741c39);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.adev-welcome__eyebrow {
  margin-top: 9px;
  color: #8b8088;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .22em;
  text-transform: uppercase;
}

.adev-welcome__status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  margin-top: 30px;
  color: #6f656d;
  font-size: 13px;
  font-weight: 650;
}

.adev-welcome__status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #28b77a;
  box-shadow: 0 0 0 5px rgba(40,183,122,.10);
  animation: adevWelcomeStatus 1.3s ease-in-out infinite;
}

.adev-welcome__progress {
  position: relative;
  width: min(230px, 64vw);
  height: 3px;
  margin-top: 18px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(23,20,25,.07);
}

.adev-welcome__progress::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  transform: scaleX(0);
  transform-origin: left center;
  background: linear-gradient(90deg, #741c39, #d94d79);
  animation: adevWelcomeProgress 1.15s cubic-bezier(.22,1,.36,1) forwards;
}

.adev-welcome__hint {
  margin-top: 19px;
  color: #a29aa0;
  font-size: 11px;
  font-weight: 600;
}

body.nx-dark .adev-welcome,
html.nx-dark .adev-welcome {
  background:
    radial-gradient(circle at 50% 42%, rgba(167,45,82,.24), transparent 30%),
    radial-gradient(circle at 70% 68%, rgba(74,58,138,.16), transparent 35%),
    #090b12;
  color: #f7f2f5;
}

body.nx-dark .adev-welcome__eyebrow,
html.nx-dark .adev-welcome__eyebrow { color: #817483; }
body.nx-dark .adev-welcome__status,
html.nx-dark .adev-welcome__status { color: #aaa0a8; }
body.nx-dark .adev-welcome__hint,
html.nx-dark .adev-welcome__hint { color: #6f6670; }
body.nx-dark .adev-welcome__progress,
html.nx-dark .adev-welcome__progress { background: rgba(255,255,255,.09); }

@keyframes adevWelcomePanelIn {
  from { opacity: 0; transform: translateY(14px) scale(.985); }
  to { opacity: 1; transform: translateY(-2vh) scale(1); }
}
@keyframes adevWelcomeOrbit { to { transform: rotate(360deg); } }
@keyframes adevWelcomeAura {
  from { opacity: .72; transform: translate(-50%, -50%) scale(.92); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1.06); }
}
@keyframes adevWelcomeStatus {
  50% { transform: scale(.72); opacity: .58; }
}
@keyframes adevWelcomeProgress {
  0% { transform: scaleX(.04); }
  38% { transform: scaleX(.44); }
  72% { transform: scaleX(.78); }
  100% { transform: scaleX(1); }
}

@media (max-width: 430px) {
  .adev-welcome__panel { transform: translateY(-4vh); }
  .adev-welcome__mark { width: 82px; height: 82px; margin-bottom: 21px; }
  .adev-welcome__logo-core { width: 54px; height: 54px; border-radius: 17px; font-size: 25px; }
  .adev-welcome__status { margin-top: 27px; font-size: 12px; }
  .adev-welcome__hint { margin-top: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .adev-welcome *,
  .adev-welcome::before,
  .adev-welcome::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
}
