/* CDXX first-visit session intro — see cdxx-intro.js */
html.cdxx-intro-active,
html.cdxx-intro-active body {
  overflow: hidden !important;
  height: 100%;
}

html.cdxx-intro-active body {
  touch-action: none;
}

html.cdxx-intro-active .site-header {
  visibility: hidden;
  pointer-events: none;
}

.cdxx-intro {
  position: fixed;
  inset: 0;
  z-index: 200000;
  display: grid;
  place-items: center;
  padding: max(1.25rem, env(safe-area-inset-top)) max(1.25rem, env(safe-area-inset-right))
    max(1.25rem, env(safe-area-inset-bottom)) max(1.25rem, env(safe-area-inset-left));
  box-sizing: border-box;
  background: #04020e;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity 0.45s cubic-bezier(0.22, 1, 0.32, 1), visibility 0.45s ease;
}

.cdxx-intro.is-exiting {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.cdxx-intro--instant[hidden] {
  display: none !important;
}

/* Static shell in HTML — visible before JS runs on mobile */
.cdxx-intro--instant .cdxx-intro__bar-fill {
  width: 42%;
  animation: cdxx-intro-bar-pulse 1.2s ease-in-out infinite alternate;
}

@keyframes cdxx-intro-bar-pulse {
  from {
    width: 28%;
    opacity: 0.72;
  }
  to {
    width: 72%;
    opacity: 1;
  }
}

.cdxx-intro__bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.cdxx-intro__glow {
  position: absolute;
  left: 50%;
  top: 46%;
  width: min(520px, 92vw);
  height: min(320px, 55vh);
  transform: translate(-50%, -50%);
  background:
    radial-gradient(ellipse 70% 65% at 50% 50%, rgba(110, 47, 255, 0.34) 0%, transparent 72%),
    radial-gradient(ellipse 45% 50% at 72% 58%, rgba(55, 100, 220, 0.14) 0%, transparent 68%);
  filter: blur(28px);
  opacity: 0.95;
}

.cdxx-intro__stars {
  position: absolute;
  inset: 0;
  opacity: 0.35;
  background-image:
    radial-gradient(1px 1px at 12% 18%, rgba(200, 180, 255, 0.5) 0, transparent 100%),
    radial-gradient(1px 1px at 78% 24%, rgba(140, 180, 255, 0.45) 0, transparent 100%),
    radial-gradient(1px 1px at 34% 72%, rgba(180, 150, 255, 0.4) 0, transparent 100%),
    radial-gradient(1px 1px at 88% 68%, rgba(120, 160, 255, 0.35) 0, transparent 100%),
    radial-gradient(1px 1px at 52% 42%, rgba(220, 200, 255, 0.35) 0, transparent 100%);
  background-size: 100% 100%;
}

.cdxx-intro__stage {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.15rem;
  width: min(100%, 280px);
}

.cdxx-intro__logo-wrap {
  position: relative;
  width: 5.5rem;
  height: 5.5rem;
  display: grid;
  place-items: center;
  animation: cdxx-intro-logo-in 0.65s cubic-bezier(0.22, 1, 0.32, 1) both;
}

.cdxx-intro__ring {
  position: absolute;
  inset: -0.35rem;
  border-radius: 50%;
  border: 1px solid transparent;
  border-top-color: rgba(159, 77, 255, 0.85);
  border-right-color: rgba(88, 140, 255, 0.45);
  box-shadow: 0 0 18px rgba(110, 47, 255, 0.25);
  transform-origin: center;
  animation: cdxx-intro-arc-pulse 2.8s ease-in-out infinite alternate;
  will-change: transform, opacity, filter;
}

.cdxx-intro__ring::after {
  content: "";
  position: absolute;
  inset: 0.22rem;
  border-radius: 50%;
  border: 1px dashed rgba(159, 77, 255, 0.22);
  transform-origin: center;
  animation: cdxx-intro-arc-pulse-inner 3.4s ease-in-out infinite alternate;
}

.cdxx-intro__logo-pulse {
  position: absolute;
  inset: 0.55rem;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(159, 77, 255, 0.28) 0%, transparent 70%);
  animation: cdxx-intro-pulse 2s ease-in-out infinite;
  pointer-events: none;
}

.cdxx-intro__ring-outer {
  position: relative;
  z-index: 1;
  width: 4.25rem;
  height: 4.25rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #f0ecff;
  box-shadow:
    0 0 0 1px rgba(200, 150, 255, 0.12) inset,
    0 0 22px rgba(164, 120, 255, 0.38);
}

.cdxx-intro__ring-inner {
  width: 2.65rem;
  height: 2.65rem;
  border-radius: 50%;
  border: 5px solid #5e22d8;
  background: #f2efff;
  box-sizing: border-box;
}

.cdxx-intro__bar {
  width: min(220px, 72vw);
  height: 3px;
  border-radius: 999px;
  background: rgba(110, 47, 255, 0.18);
  overflow: hidden;
  box-shadow: 0 0 12px rgba(110, 47, 255, 0.12);
}

.cdxx-intro__bar-fill {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(110, 47, 255, 0.85) 0%, rgba(140, 180, 255, 0.95) 100%);
  box-shadow: 0 0 14px rgba(159, 77, 255, 0.45);
  animation: cdxx-intro-bar 1.85s cubic-bezier(0.22, 1, 0.32, 1) forwards;
}

.cdxx-intro__label {
  margin: 0;
  font-family: Orbitron, system-ui, sans-serif;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(210, 196, 255, 0.82);
  animation: cdxx-intro-label-in 0.5s ease 0.2s both;
}

@keyframes cdxx-intro-logo-in {
  from {
    opacity: 0;
    transform: scale(0.88);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes cdxx-intro-arc-pulse {
  0% {
    transform: rotate(-8deg);
    opacity: 0.65;
    filter: drop-shadow(0 0 8px rgba(150, 80, 255, 0.4));
  }
  100% {
    transform: rotate(8deg);
    opacity: 1;
    filter: drop-shadow(0 0 16px rgba(150, 80, 255, 0.75));
  }
}

@keyframes cdxx-intro-arc-pulse-inner {
  0% {
    transform: rotate(6deg);
  }
  100% {
    transform: rotate(-6deg);
  }
}

@keyframes cdxx-intro-pulse {
  0%,
  100% {
    opacity: 0.45;
    transform: scale(0.92);
  }
  50% {
    opacity: 0.9;
    transform: scale(1.05);
  }
}

@keyframes cdxx-intro-bar {
  to {
    width: 100%;
  }
}

@keyframes cdxx-intro-label-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .cdxx-intro {
    transition: none;
  }

  .cdxx-intro__logo-wrap,
  .cdxx-intro__ring,
  .cdxx-intro__ring::after,
  .cdxx-intro__logo-pulse,
  .cdxx-intro__bar-fill,
  .cdxx-intro__label {
    animation: none;
  }

  .cdxx-intro__bar-fill {
    width: 100%;
  }
}
