/* APEX AI marketing site — custom effects (Tailwind + Flowbite handle layout) */

html { scroll-behavior: smooth; }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  padding: .75rem 1rem; background: #6366f1; color: #fff; border-radius: 0 0 .5rem 0;
}
.skip-link:focus { left: 0; }

.glass-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.nav-glass {
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background .25s ease, border-color .25s ease, backdrop-filter .25s ease;
}
.nav-glass.is-scrolled {
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-image: linear-gradient(90deg, #6366f1, #8b5cf6, #06b6d4) 1;
  border-bottom: 1px solid rgba(99, 102, 241, 0.35);
}

.gradient-text {
  background: linear-gradient(135deg, #ffffff, #94a3b8);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.gradient-text-accent {
  background: linear-gradient(135deg, #6366f1, #06b6d4);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.logo-apex { color: #fff; font-weight: 700; letter-spacing: -0.02em; }
.logo-ai { color: #f59e0b; font-weight: 700; }

/* Magic UI — shimmer button */
.btn-shimmer {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #6366f1, #8b5cf6, #06b6d4);
  background-size: 200% 200%;
}
.btn-shimmer::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 40%, rgba(255,255,255,.35) 50%, transparent 60%);
  transform: translateX(-120%);
  transition: transform .6s ease;
}
.btn-shimmer:hover::after { transform: translateX(120%); }

.btn-gold {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #0a0a0a;
}
.btn-gold:hover { filter: brightness(1.08); }

/* Border beam (pricing featured) */
.border-beam {
  position: relative;
  border-radius: 18px;
  padding: 1px;
  background: linear-gradient(90deg, #6366f1, #8b5cf6, #06b6d4, #6366f1);
  background-size: 300% 300%;
  animation: beam-spin 4s linear infinite;
}
.border-beam > .border-beam-inner {
  border-radius: 17px;
  background: #12121f;
  height: 100%;
}
@keyframes beam-spin {
  0% { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}

/* Hero ambient */
.hero-mesh {
  background:
    radial-gradient(ellipse at top right, rgba(99,102,241,0.18), transparent 55%),
    radial-gradient(ellipse at bottom left, rgba(6,182,212,0.12), transparent 55%),
    #000;
}
.hero-dots {
  background-image: radial-gradient(rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 24px 24px;
}
.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: .55;
  pointer-events: none;
}
.blob-indigo { width: 42vw; height: 42vw; background: #6366f1; left: -10%; bottom: -15%; }
.blob-cyan { width: 36vw; height: 36vw; background: #06b6d4; right: -8%; top: -10%; }

/* Device frames */
.device-tv {
  border-radius: 14px;
  border: 2px solid #334155;
  background: #0f172a;
  box-shadow: 0 0 60px rgba(99,102,241,.25), 0 25px 50px rgba(0,0,0,.55);
  overflow: hidden;
}
.device-phone {
  border-radius: 22px;
  border: 2px solid #475569;
  background: #0f172a;
  box-shadow: 0 0 40px rgba(245,158,11,.2), 0 20px 40px rgba(0,0,0,.5);
  overflow: hidden;
}
.device-tablet {
  border-radius: 16px;
  border: 2px solid #334155;
  background: #0f172a;
  box-shadow: 0 0 40px rgba(6,182,212,.2), 0 20px 40px rgba(0,0,0,.5);
  overflow: hidden;
}
.mock-row {
  display: flex; gap: 8px; overflow: hidden; padding: 6px 0;
}
.mock-poster {
  flex: 0 0 auto; width: 52px; height: 78px; border-radius: 6px;
  background: linear-gradient(145deg, #312e81, #1e293b);
}
.mock-poster.live { width: 72px; height: 42px; background: linear-gradient(145deg, #164e63, #1e293b); }
.mock-badge {
  font-size: 9px; font-weight: 700; letter-spacing: .04em;
  padding: 2px 6px; border-radius: 999px; display: inline-block;
}
.tilt-3d { transform-style: preserve-3d; transition: transform .2s ease; }

/* Marquee */
.marquee {
  overflow: hidden;
  white-space: nowrap;
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.marquee-track {
  display: inline-flex;
  gap: 2.5rem;
  animation: marquee 40s linear infinite;
}
@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* Scroll progress */
#scrollProgress {
  position: fixed; top: 0; left: 0; height: 2px; width: 0%;
  background: linear-gradient(90deg, #6366f1, #8b5cf6, #06b6d4);
  z-index: 100; pointer-events: none;
}

/* Spotlight */
#spotlight {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 1;
  background: radial-gradient(600px circle at var(--sx, 50%) var(--sy, 50%), rgba(99,102,241,.08), transparent 40%);
  opacity: 0;
  transition: opacity .3s ease;
}
body.has-spotlight #spotlight { opacity: 1; }

/* Reveal */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .7s ease, transform .7s ease;
}
.reveal.in { opacity: 1; transform: none; }

/* Typing caret */
.typing-caret::after {
  content: "|";
  animation: blink 1s step-end infinite;
  color: #6366f1;
  margin-left: 2px;
}
@keyframes blink { 50% { opacity: 0; } }

/* Pricing toggle */
.billing-toggle {
  position: relative;
  display: inline-flex;
  padding: 4px;
  border-radius: 999px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.1);
}
.billing-toggle button {
  position: relative; z-index: 1;
  padding: .5rem 1.25rem; border-radius: 999px;
  color: #94a3b8; font-weight: 600; font-size: .875rem;
  transition: color .2s;
}
.billing-toggle button.active { color: #fff; }
.billing-toggle .pill {
  position: absolute; top: 4px; bottom: 4px; width: calc(50% - 4px);
  left: 4px; border-radius: 999px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  transition: transform .25s ease;
}
.billing-toggle.annual .pill { transform: translateX(100%); }

/* FAQ */
.faq-item .faq-body { display: none; }
.faq-item.open .faq-body { display: block; }
.faq-item.open .faq-chevron { transform: rotate(180deg); }
.faq-chevron { transition: transform .2s ease; }

/* Back to top */
#backToTop {
  position: fixed; right: 1.25rem; bottom: 1.25rem; z-index: 50;
  opacity: 0; pointer-events: none; transition: opacity .25s ease;
}
#backToTop.show { opacity: 1; pointer-events: auto; }

/* If JS never runs, don't leave the hero at Tailwind opacity-0 forever. */
#heroBadge, #heroTitle, #heroSub, #heroCtas, #heroTrust, #deviceStage {
  animation: apex-hero-fallback 0.01s linear 2s forwards;
}
@keyframes apex-hero-fallback {
  to { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .marquee-track { animation: none; }
  .reveal { opacity: 1; transform: none; }
  #heroBadge, #heroTitle, #heroSub, #heroCtas, #heroTrust, #deviceStage {
    opacity: 1 !important;
    transform: none;
    animation: none;
  }
}
