/* =========================================================
   XVOID DIGITAL STUDIO — CALM DARK STUDIO LOADER
   Palette: Base #0D0D10 | Surface #131318 | Accent #A8A1FF
   ========================================================= */

.xv-loader {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: #0D0D10;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: #E8E7E3;
  opacity: 1;
  transform: scale(1);
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.6s cubic-bezier(0.16, 1, 0.3, 1),
              visibility 0.6s;
  will-change: opacity, transform;
  contain: strict;
  pointer-events: all;
  user-select: none;
  min-height: 100vh;
  min-height: 100dvh;
  height: 100vh;
  height: 100dvh;
  padding: env(safe-area-inset-top, 16px) env(safe-area-inset-right, 16px) env(safe-area-inset-bottom, 16px) env(safe-area-inset-left, 16px);
  box-sizing: border-box;
}

.xv-loader::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, rgba(168, 161, 255, 0.05) 0%, rgba(13, 13, 16, 0) 70%);
  pointer-events: none;
  z-index: 0;
}

.xv-loader-grid-bg {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right,  rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.018) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
  z-index: 0;
}

.xv-loader-aurora {
  display: none !important;
}

.xv-loader-box {
  position: relative;
  isolation: isolate;
  z-index: 2;
  width: 90%;
  max-width: 380px;
  padding: 32px 28px;
  border-radius: 12px;
  background: #131318;
  border: 1px solid #292932;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.65), 0 2px 8px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  gap: 22px;
  animation: xvCardIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) both;
  transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
              visibility 0.4s;
  will-change: opacity, transform;
}

.xv-loader-box.xv-box-hide {
  opacity: 0;
  transform: translateY(-16px) scale(0.96);
  pointer-events: none;
  visibility: hidden;
  position: absolute;
}

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

.xv-loader-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.xv-loader-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.xv-loader-brand img {
  width: 20px;
  height: 20px;
  object-fit: contain;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.4));
}

.xv-loader-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #E8E7E3;
  font-family: 'Manrope', -apple-system, sans-serif;
}

.xv-loader-version {
  font-size: 10px;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: #A8A1FF;
  background: #18181E;
  border: 1px solid #292932;
  padding: 3px 9px;
  border-radius: 6px;
}

.xv-loader-track-wrap {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.xv-loader-track {
  position: relative;
  width: 100%;
  height: 3px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 999px;
  overflow: hidden;
}

.xv-loader-bar {
  position: relative;
  width: 0%;
  height: 100%;
  border-radius: 999px;
  background: #A8A1FF;
  box-shadow: 0 0 10px rgba(168, 161, 255, 0.4);
  transition: width 0.34s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: width;
}

.xv-loader-bar::after {
  content: '';
  position: absolute;
  top: 50%;
  right: -1px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #A8A1FF;
  transform: translate(50%, -50%);
  box-shadow: 0 0 8px rgba(168, 161, 255, 0.8);
}

.xv-loader-sheen {
  display: none !important;
}

.xv-loader-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.03em;
}

.xv-loader-status {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #8C8B91;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 260px;
  font-weight: 500;
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.xv-loader-status::before {
  content: '>';
  color: #A8A1FF;
  font-weight: 700;
  flex-shrink: 0;
}

.xv-loader-status.xv-swap {
  opacity: 0;
  transform: translateY(3px);
}

.xv-loader-pct {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  font-family: 'JetBrains Mono', monospace;
  color: #E8E7E3;
  letter-spacing: 0.05em;
}

/* === INTRO BOX === */
.xv-intro-box {
  --rand-x: 0px;
  --rand-y: 28px;
  --rand-rot: 0deg;
  --rand-scale: 0.94;

  position: absolute;
  isolation: isolate;
  z-index: 3;
  width: 90%;
  max-width: 420px;
  padding: 36px 30px;
  border-radius: 14px;
  background: #131318;
  border: 1px solid #292932;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7), 0 2px 8px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  opacity: 0;
  transform: translate3d(var(--rand-x), var(--rand-y), 0) scale(var(--rand-scale));
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.6s cubic-bezier(0.16, 1, 0.3, 1),
              visibility 0.6s;
  will-change: opacity, transform;
}

.xv-intro-box.xv-intro-active {
  opacity: 1;
  transform: translate3d(0, 0, 0) rotate(0deg) scale(1);
  visibility: visible;
}

.xv-intro-box.xv-intro-fadeout {
  opacity: 0;
  transform: translate3d(calc(var(--rand-x) * -0.4), -12px, 0);
  visibility: hidden;
}

.xv-intro-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  background: #18181E;
  border: 1px solid #292932;
  border-radius: 6px;
  margin-bottom: 18px;
  opacity: 0;
  transform: translate3d(var(--pill-x), var(--pill-y), 0);
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform, opacity;
}

.xv-intro-active .xv-intro-pill {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

.xv-intro-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #6EE7B7;
  box-shadow: 0 0 6px rgba(110, 231, 183, 0.5);
}

.xv-intro-tag {
  font-size: 10.5px;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: #A8A1FF;
}

.xv-intro-title {
  font-size: clamp(22px, 5vw, 30px);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: #E8E7E3;
  line-height: 1.25;
  margin-bottom: 12px;
  min-height: 1.35em;
  text-align: center;
  display: block;
  font-family: 'Manrope', -apple-system, sans-serif;
}

.xv-char {
  display: inline;
  color: inherit;
  animation: xvCharPop 0.18s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes xvCharPop {
  0% { opacity: 0; }
  100% { opacity: 1; }
}

.xv-cursor {
  display: inline-block;
  font-weight: 400;
  color: #A8A1FF;
  margin-left: 2px;
  animation: xvCursorBlink 0.75s step-end infinite;
  vertical-align: baseline;
}

@keyframes xvCursorBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.xv-intro-brand {
  font-weight: 700;
  color: #A8A1FF;
  display: inline;
  font-family: 'Manrope', -apple-system, sans-serif;
  letter-spacing: -0.03em;
}

.xv-intro-sub {
  font-size: 13.5px;
  color: #8C8B91;
  letter-spacing: -0.01em;
  font-weight: 400;
  font-family: 'Manrope', -apple-system, sans-serif;
  line-height: 1.5;
  margin: 0;
  opacity: 0;
  transform: translate3d(var(--sub-x), var(--sub-y), 0);
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform, opacity;
}

.xv-intro-active .xv-intro-sub {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

.xv-intro-line {
  width: 48px;
  height: 2px;
  background: #A8A1FF;
  border-radius: 999px;
  margin: 18px auto 0;
  opacity: 0;
  transform: scaleX(0);
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.5s ease;
}

.xv-intro-active .xv-intro-line {
  opacity: 0.6;
  transform: scaleX(1);
}
