/* ============================================================
   DiviNext Preloader — preloader.css
   ============================================================ */

/* ── CRITICAL: hide body until JS removes this class ── */
body.dnp-loading {
  overflow: hidden !important;
}

body.dnp-loading > *:not(#dnp-preloader) {
  visibility: hidden !important;
  opacity: 0 !important;
}

body.dnp-ready > *:not(#dnp-preloader) {
  visibility: visible !important;
  opacity: 1 !important;
  transition: opacity 0.5s ease 0.1s;
}

/* ── PRELOADER SHELL ── */
#dnp-preloader {
  position: fixed;
  inset: 0;
  z-index: 2147483647; /* max z-index */
  background: var(--dnp-bg, #07070F);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  overflow: hidden;
  font-family: 'Outfit', 'Segoe UI', system-ui, sans-serif;
}

/* ── EXIT ANIMATIONS ── */
#dnp-preloader.dnp-exit-slide_up {
  animation: dnp-exit-slide 0.7s cubic-bezier(0.77, 0, 0.175, 1) forwards;
}
@keyframes dnp-exit-slide {
  0%   { transform: translateY(0);      opacity: 1; }
  100% { transform: translateY(-100%);  opacity: 0; }
}

#dnp-preloader.dnp-exit-fade {
  animation: dnp-exit-fade 0.6s ease forwards;
}
@keyframes dnp-exit-fade {
  to { opacity: 0; }
}

#dnp-preloader.dnp-exit-split {
  animation: dnp-exit-split 0.7s cubic-bezier(0.77, 0, 0.175, 1) forwards;
}
@keyframes dnp-exit-split {
  0%   { clip-path: inset(0 0 0 0); }
  100% { clip-path: inset(50% 0 50% 0); opacity: 0; }
}

/* ── BACKGROUND GRID ── */
.dnp-bg-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(108, 58, 245, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(108, 58, 245, 0.06) 1px, transparent 1px);
  background-size: 48px 48px;
  animation: dnp-grid-drift 14s linear infinite;
}
@keyframes dnp-grid-drift {
  to { background-position: 48px 48px; }
}

/* ── GLOW MESH ── */
.dnp-bg-glow {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 55% 45% at 15% 65%, rgba(108, 58, 245, 0.2) 0%, transparent 60%),
    radial-gradient(ellipse 45% 40% at 85% 25%, rgba(168, 85, 247, 0.14) 0%, transparent 60%),
    radial-gradient(ellipse 30% 30% at 50% 90%, rgba(6, 182, 212, 0.08) 0%, transparent 60%);
  animation: dnp-glow-breathe 5s ease-in-out infinite alternate;
}
@keyframes dnp-glow-breathe {
  0%   { opacity: 0.6; }
  100% { opacity: 1; }
}

/* ── CORNER BRACKETS ── */
.dnp-corner {
  position: absolute;
  width: 36px;
  height: 36px;
  pointer-events: none;
  opacity: 0;
  animation: dnp-fade-in 0.6s ease 0.2s forwards;
}
.dnp-corner::before,
.dnp-corner::after {
  content: '';
  position: absolute;
  background: var(--dnp-primary, #6C3AF5);
  opacity: 0.5;
}
.dnp-corner::before { width: 100%; height: 1.5px; top: 0; left: 0; }
.dnp-corner::after  { width: 1.5px; height: 100%; top: 0; left: 0; }
.dnp-tl { top: 20px; left: 20px; }
.dnp-tr { top: 20px; right: 20px; transform: rotate(90deg); }
.dnp-bl { bottom: 20px; left: 20px; transform: rotate(-90deg); }
.dnp-br { bottom: 20px; right: 20px; transform: rotate(180deg); }

/* ── PARTICLES CONTAINER ── */
.dnp-particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}
.dnp-particle {
  position: absolute;
  border-radius: 50%;
  opacity: 0;
  animation: dnp-float-particle var(--pd, 7s) ease-in-out var(--pdl, 0s) infinite;
}
@keyframes dnp-float-particle {
  0%         { transform: translateY(0) scale(1);   opacity: 0; }
  15%, 80%   { opacity: var(--po, 0.5); }
  100%       { transform: translateY(-90px) scale(0.3); opacity: 0; }
}

/* ── ANIMATION CONTAINERS ── */
.dnp-anim { display: none; }

.dnp-style-orbit  .dnp-orbit-anim  { display: block; }
.dnp-style-pulse  .dnp-pulse-anim  { display: flex; align-items: center; justify-content: center; }
.dnp-style-bars   .dnp-bars-anim   { display: flex; align-items: center; justify-content: center; }

/* ============================================================
   ORBIT ANIMATION
   ============================================================ */
.dnp-orbit-wrap {
  position: relative;
  width: 180px;
  height: 180px;
  margin-bottom: 40px;
}

.dnp-orbit {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid rgba(108, 58, 245, 0.2);
  animation: dnp-spin var(--ospd, 4s) linear infinite var(--orev, normal);
}
.dnp-orbit::before {
  content: '';
  position: absolute;
  top: -5px;
  left: 50%;
  transform: translateX(-50%);
  width: 9px;
  height: 9px;
  background: var(--odot, #6C3AF5);
  border-radius: 50%;
  box-shadow: 0 0 14px var(--odot, #6C3AF5), 0 0 28px var(--odot, #6C3AF5);
}

.dnp-orbit-1 { --ospd: 2.8s; --odot: var(--dnp-primary, #6C3AF5); }
.dnp-orbit-2 { inset: 16px; --ospd: 4.2s; --orev: reverse; --odot: var(--dnp-secondary, #A855F7); border-color: rgba(168, 85, 247, 0.25); }
.dnp-orbit-3 { inset: 32px; --ospd: 5.8s; --odot: var(--dnp-accent, #06B6D4); border-color: rgba(6, 182, 212, 0.18); }

@keyframes dnp-spin {
  to { transform: rotate(360deg); }
}

.dnp-logo-mark {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dnp-hexagon {
  width: 76px;
  height: 76px;
  background: linear-gradient(135deg, var(--dnp-primary, #6C3AF5), var(--dnp-secondary, #A855F7));
  clip-path: polygon(50% 0%, 93% 25%, 93% 75%, 50% 100%, 7% 75%, 7% 25%);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: dnp-hex-breathe 3s ease-in-out infinite;
  box-shadow: 0 0 32px rgba(108, 58, 245, 0.6), 0 0 64px rgba(108, 58, 245, 0.2);
}
@keyframes dnp-hex-breathe {
  0%, 100% { transform: scale(1);    filter: brightness(1); }
  50%       { transform: scale(1.08); filter: brightness(1.25); }
}

/* ============================================================
   PULSE ANIMATION
   ============================================================ */
.dnp-pulse-anim { margin-bottom: 40px; }

.dnp-pulse-rings {
  position: relative;
  width: 140px;
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dnp-pulse-ring {
  position: absolute;
  border-radius: 50%;
  border: 2px solid var(--dnp-primary, #6C3AF5);
  opacity: 0;
  animation: dnp-pulse-ring var(--prspd, 2.4s) ease-out var(--prdl, 0s) infinite;
}
.dnp-pr1 { width: 100%; height: 100%; --prspd: 2.4s; --prdl: 0s; }
.dnp-pr2 { width: 100%; height: 100%; --prspd: 2.4s; --prdl: 0.8s; border-color: var(--dnp-secondary, #A855F7); }
.dnp-pr3 { width: 100%; height: 100%; --prspd: 2.4s; --prdl: 1.6s; border-color: var(--dnp-accent, #06B6D4); }

@keyframes dnp-pulse-ring {
  0%   { transform: scale(0.4); opacity: 0.8; }
  100% { transform: scale(1.6); opacity: 0; }
}

.dnp-pulse-center {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--dnp-primary, #6C3AF5), var(--dnp-secondary, #A855F7));
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
  box-shadow: 0 0 30px rgba(108, 58, 245, 0.7);
  animation: dnp-hex-breathe 3s ease-in-out infinite;
}

/* ============================================================
   BARS ANIMATION
   ============================================================ */
.dnp-bars-anim { margin-bottom: 40px; }

.dnp-bars {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 70px;
}

.dnp-bar {
  width: 10px;
  border-radius: 6px;
  background: linear-gradient(to top, var(--dnp-primary, #6C3AF5), var(--dnp-secondary, #A855F7));
  animation: dnp-bar-bounce 1.2s ease-in-out calc(var(--i) * 0.12s) infinite alternate;
  box-shadow: 0 0 10px rgba(108, 58, 245, 0.5);
}
@keyframes dnp-bar-bounce {
  0%   { height: 12px; opacity: 0.4; }
  100% { height: 60px; opacity: 1; }
}

/* ============================================================
   SHARED TEXT + PROGRESS
   ============================================================ */
.dnp-initials {
  font-size: 26px;
  font-weight: 900;
  color: #fff;
  letter-spacing: -1px;
  user-select: none;
  line-height: 1;
}

.dnp-wordmark {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
  opacity: 0;
  animation: dnp-fade-up 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.25s forwards;
}
.dnp-t1 {
  font-size: 30px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.02em;
}
.dnp-t2 {
  font-size: 30px;
  font-weight: 800;
  background: linear-gradient(90deg, var(--dnp-primary, #6C3AF5), var(--dnp-secondary, #A855F7), var(--dnp-accent, #06B6D4));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.02em;
}

.dnp-tagline {
  font-size: 11px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.3);
  letter-spacing: 0.25em;
  text-transform: uppercase;
  margin: 0 0 42px;
  opacity: 0;
  animation: dnp-fade-up 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.4s forwards;
}

.dnp-progress-wrap {
  width: 220px;
  opacity: 0;
  animation: dnp-fade-up 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.55s forwards;
}

.dnp-track {
  height: 2px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 10px;
  position: relative;
}

.dnp-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg,
    var(--dnp-primary, #6C3AF5),
    var(--dnp-secondary, #A855F7),
    var(--dnp-accent, #06B6D4)
  );
  border-radius: 2px;
  transition: width 0.08s linear;
  position: relative;
}
.dnp-fill::after {
  content: '';
  position: absolute;
  right: -1px;
  top: 50%;
  transform: translateY(-50%);
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #fff;
  box-shadow:
    0 0 8px var(--dnp-secondary, #A855F7),
    0 0 18px var(--dnp-secondary, #A855F7);
}

.dnp-pct {
  font-size: 11px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.25);
  text-align: center;
  letter-spacing: 0.15em;
  transition: color 0.4s ease;
}

/* ── KEYFRAMES ── */
@keyframes dnp-fade-up {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes dnp-fade-in {
  to { opacity: 1; }
}

/* ── REDUCED MOTION ── */
@media (prefers-reduced-motion: reduce) {
  #dnp-preloader * {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
