/* =============================================
   ABxDesign — Welcome Screen
   welcome.css
   ============================================= */

#abx-welcome {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: #080810;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  opacity: 1;
  transition: opacity 0.55s cubic-bezier(0.4, 0, 0.2, 1);
}

#abx-welcome.abx-fadeout {
  opacity: 0;
  pointer-events: none;
}

/* ── Scanline overlay ── */
#abx-welcome::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(255,255,255,0.018) 2px,
    rgba(255,255,255,0.018) 4px
  );
  pointer-events: none;
  z-index: 1;
}

/* ── Ambient orbs ── */
#abx-welcome::after {
  content: '';
  position: absolute;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(124,111,247,0.07) 0%, transparent 70%);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 0;
}

/* ── Inner wrapper ── */
.abx-welcome-inner {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 48px;
}

/* ── Logo ── */
.abx-logo-wrap {
  position: relative;
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.abx-logo-wrap.abx-visible {
  opacity: 1;
  transform: translateY(0);
}

.abx-logo-wrap img,
.abx-logo-wrap svg {
  width: clamp(140px, 22vw, 220px);
  height: auto;
  display: block;
  filter: brightness(1.1);
}

/* ── Counter ── */
.abx-counter-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  opacity: 0;
  transition: opacity 0.4s ease 0.3s;
}

.abx-counter-wrap.abx-visible {
  opacity: 1;
}

.abx-counter {
  font-family: 'Courier New', 'Courier', monospace;
  font-size: clamp(52px, 9vw, 96px);
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.03em;
  line-height: 1;
  position: relative;
  display: inline-block;
}

.abx-counter-pct {
  font-size: 0.45em;
  color: rgba(255,255,255,0.45);
  margin-left: 4px;
  vertical-align: super;
  font-weight: 400;
}

/* ── Progress bar ── */
.abx-progress-track {
  width: clamp(180px, 28vw, 320px);
  height: 1px;
  background: rgba(255,255,255,0.1);
  position: relative;
  overflow: hidden;
}

.abx-progress-fill {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #7c6ff7, #06d6c7);
  transition: width 0.05s linear;
}

/* ── Skip button ── */
.abx-skip {
  position: absolute;
  bottom: 32px;
  right: 36px;
  z-index: 3;
  background: transparent;
  border: 0.5px solid rgba(255,255,255,0.18);
  color: rgba(255,255,255,0.4);
  font-family: 'Courier New', monospace;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 8px 16px;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}

.abx-skip:hover {
  color: rgba(255,255,255,0.85);
  border-color: rgba(255,255,255,0.45);
}

/* =============================================
   GLITCH KEYFRAMES
   ============================================= */

@keyframes abx-glitch-shake {
  0%   { transform: translate(0, 0); }
  15%  { transform: translate(-4px, 1px); }
  30%  { transform: translate(4px, -1px); }
  45%  { transform: translate(-3px, 2px); }
  60%  { transform: translate(3px, -2px); }
  75%  { transform: translate(-2px, 1px); }
  90%  { transform: translate(2px, 0px); }
  100% { transform: translate(0, 0); }
}

@keyframes abx-glitch-clip-1 {
  0%   { clip-path: inset(20% 0 60% 0); transform: translate(-6px, 0); }
  25%  { clip-path: inset(50% 0 20% 0); transform: translate(6px, 0); }
  50%  { clip-path: inset(10% 0 70% 0); transform: translate(-4px, 0); }
  75%  { clip-path: inset(70% 0 5%  0); transform: translate(4px, 0); }
  100% { clip-path: inset(40% 0 40% 0); transform: translate(0, 0); }
}

@keyframes abx-glitch-clip-2 {
  0%   { clip-path: inset(60% 0 10% 0); transform: translate(5px, 0); }
  25%  { clip-path: inset(10% 0 50% 0); transform: translate(-5px, 0); }
  50%  { clip-path: inset(30% 0 30% 0); transform: translate(3px, 0); }
  75%  { clip-path: inset(5%  0 60% 0); transform: translate(-3px, 0); }
  100% { clip-path: inset(20% 0 20% 0); transform: translate(0, 0); }
}

/* Glitch pseudo-layers on the inner wrapper */
.abx-welcome-inner.abx-glitching {
  animation: abx-glitch-shake 0.12s steps(1) infinite;
}

.abx-welcome-inner.abx-glitching::before,
.abx-welcome-inner.abx-glitching::after {
  content: '';
  position: absolute;
  inset: 0;
  background: inherit;
  pointer-events: none;
}

/* Red channel */
.abx-glitch-r,
.abx-glitch-c {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
}

.abx-glitch-r.abx-active {
  opacity: 0.65;
  animation: abx-glitch-clip-1 0.1s steps(1) infinite;
  mix-blend-mode: screen;
  filter: drop-shadow(0 0 0 rgba(255,30,30,0.9)) hue-rotate(-30deg) saturate(3);
}

.abx-glitch-c.abx-active {
  opacity: 0.55;
  animation: abx-glitch-clip-2 0.13s steps(1) infinite;
  mix-blend-mode: screen;
  filter: drop-shadow(0 0 0 rgba(0,255,255,0.9)) hue-rotate(160deg) saturate(3);
}

/* ── Responsive ── */
@media (max-width: 480px) {
  .abx-skip {
    bottom: 20px;
    right: 20px;
  }
}

/* ── Marketing Popup ── */
#abx-popup-overlay {
  position: fixed;
  inset: 0;
  z-index: 99998;
  background: rgba(0,0,0,0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  animation: abx-popup-fadein 0.4s 0.1s ease forwards;
}

@keyframes abx-popup-fadein { to { opacity: 1; } }
body.abx-popup-open { overflow: hidden; }
#abx-popup {
  background: var(--surf);
  border: 1px solid var(--bd2);
  border-radius: var(--radius-lg);
  max-width: 380px;
  width: 100%;
  padding: 2rem;
  position: relative;
  transform: translateY(20px);
  animation: abx-popup-slidein 0.4s 0.1s cubic-bezier(0.22,1,0.36,1) forwards;
}

@keyframes abx-popup-slidein { to { transform: translateY(0); } }

#abx-popup-close {
  position: absolute;
  top: 14px; right: 16px;
  background: transparent;
  border: none;
  color: var(--t3);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  transition: color 0.2s;
  padding: 2px 6px;
}
#abx-popup-close:hover { color: var(--t1); }

.abx-popup-eyebrow {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--a1);
  margin-bottom: 10px;
}

.abx-popup-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(20px, 4vw, 24px);
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--t1);
  margin-bottom: 10px;
}

.abx-popup-sub {
  font-size: 13px;
  color: var(--t3);
  line-height: 1.7;
  margin-bottom: 1.75rem;
}

.abx-popup-icons {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-bottom: 1.5rem;
}

.abx-popup-icons .social-link {
  width: 48px;
  height: 48px;
}

#abx-popup-dismiss {
  display: block;
  width: 100%;
  background: transparent;
  border: none;
  border-top: 1px solid var(--bd);
  padding-top: 1rem;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--t3);
  cursor: pointer;
  transition: color 0.2s;
  text-align: center;
}
#abx-popup-dismiss:hover { color: var(--t1); }