/* ============================================ */
/* BASE & RESET                                 */
/* ============================================ */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', system-ui, sans-serif;
  background: #0a0a0f;
  color: #e4e4ed;
  overflow-x: hidden;
  cursor: none;
}

::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: #0a0a0f; }
::-webkit-scrollbar-thumb { background: #6366f1; border-radius: 3px; }

/* ============================================ */
/* CUSTOM CURSOR                                */
/* ============================================ */
.cursor-dot {
  position: fixed;
  width: 8px;
  height: 8px;
  background: #fff;
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  transition: transform 0.1s ease;
  mix-blend-mode: difference;
}

.cursor-glow {
  position: fixed;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(99,102,241,0.5);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9998;
  transition: all 0.15s ease;
}

.cursor-glow.hovering {
  width: 60px;
  height: 60px;
  border-color: rgba(99,102,241,0.8);
  background: rgba(99,102,241,0.05);
}

/* ============================================ */
/* SCROLL PROGRESS BAR                          */
/* ============================================ */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  background: linear-gradient(90deg, #6366f1, #818cf8, #a78bfa);
  z-index: 9999;
  width: 0%;
  transition: width 0.05s linear;
}

/* ============================================ */
/* PARTICLE CANVAS                              */
/* ============================================ */
#particles-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

/* ============================================ */
/* GRID BACKGROUND                              */
/* ============================================ */
.grid-bg {
  background-image:
    linear-gradient(rgba(99,102,241,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(99,102,241,0.03) 1px, transparent 1px);
  background-size: 60px 60px;
}

/* ============================================ */
/* NOISE TEXTURE                                */
/* ============================================ */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  opacity: 0.018;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 1;
}

/* ============================================ */
/* NAVBAR                                       */
/* ============================================ */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(10, 10, 15, 0.6);
  backdrop-filter: blur(24px);
  border-bottom: 1px solid rgba(99,102,241,0.06);
  transition: all 0.3s ease;
}

.navbar.scrolled {
  border-bottom-color: rgba(99,102,241,0.15);
  background: rgba(10, 10, 15, 0.85);
}

.nav-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
  position: relative;
}

/* Center nav links */
.nav-center { display: flex; align-items: center; gap: 2rem; position: absolute; left: 50%; transform: translateX(-50%); }
.nav-center a {
  color: #d1d1e0;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: color 0.2s ease;
  cursor: none;
}
.nav-center a:hover { color: #fff; }

/* Right nav group */
.nav-right { display: flex; align-items: center; gap: 1rem; }
.nav-mobile-controls { display: none; align-items: center; gap: 8px; }

/* ============================================ */
/* GLITCH LOGO (Navbar size)                    */
/* ============================================ */
.logo-glitch {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: none;
  padding: 6px;
  text-decoration: none;
}

.logo-glitch::before {
  content: '';
  position: absolute;
  inset: -8px;
  background: repeating-linear-gradient(0deg, transparent, transparent 1px, rgba(99,102,241,0.02) 1px, rgba(99,102,241,0.02) 2px);
  pointer-events: none;
  z-index: 10;
}

.logo-icon-wrap {
  position: relative;
  width: 40px;
  height: 40px;
}
.logo-icon-wrap svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.logo-icon-wrap svg:nth-child(2) { animation: logo-split-c 2.5s infinite; mix-blend-mode: screen; }
.logo-icon-wrap svg:nth-child(3) { animation: logo-split-r 2.5s infinite; mix-blend-mode: screen; }

.logo-glitch-text {
  font-size: 24px;
  font-weight: 800;
  color: #fff;
  position: relative;
  letter-spacing: -0.3px;
}
.logo-glitch-text::before {
  content: 'Codexa';
  position: absolute; top: 0; left: 0;
  color: #22d3ee;
  animation: logo-text-c 2.5s infinite;
  mix-blend-mode: screen;
}
.logo-glitch-text::after {
  content: 'Codexa';
  position: absolute; top: 0; left: 0;
  color: #f43f5e;
  animation: logo-text-r 2.5s infinite;
  mix-blend-mode: screen;
}

.logo-glitch:hover .logo-icon-wrap svg:nth-child(2) { animation-duration: 0.4s; }
.logo-glitch:hover .logo-icon-wrap svg:nth-child(3) { animation-duration: 0.35s; }
.logo-glitch:hover .logo-glitch-text::before { animation-duration: 0.4s; }
.logo-glitch:hover .logo-glitch-text::after { animation-duration: 0.35s; }
.logo-glitch:hover .logo-glitch-text { animation: logo-shake 0.08s infinite; }

@keyframes logo-split-c {
  0%,70%,100% { transform: translate(0); opacity: 0; clip-path: inset(0); }
  72% { transform: translate(5px,-2px); opacity: 0.9; clip-path: inset(0 0 50% 0); }
  74% { transform: translate(-6px,2px); opacity: 0.7; clip-path: inset(20% 0 20% 0); }
  76% { transform: translate(4px,-3px) skewX(-4deg); opacity: 1; clip-path: inset(50% 0 0 0); }
  78% { transform: translate(-3px,1px); opacity: 0.6; clip-path: inset(10% 0 40% 0); }
  80% { transform: translate(0); opacity: 0; }
}
@keyframes logo-split-r {
  0%,62%,100% { transform: translate(0); opacity: 0; clip-path: inset(0); }
  64% { transform: translate(-6px,2px); opacity: 0.8; clip-path: inset(40% 0 10% 0); }
  66% { transform: translate(7px,-3px) skewX(4deg); opacity: 1; clip-path: inset(0 0 60% 0); }
  68% { transform: translate(-4px,3px); opacity: 0.7; clip-path: inset(30% 0 30% 0); }
  70% { transform: translate(5px,-1px); opacity: 0.5; clip-path: inset(55% 0 5% 0); }
  72% { transform: translate(0); opacity: 0; }
}
@keyframes logo-text-c {
  0%,70%,100% { transform: translate(0); opacity: 0; clip-path: inset(0); }
  72% { transform: translate(6px,-2px) skewX(-3deg); opacity: 0.9; clip-path: inset(0 0 55% 0); }
  75% { transform: translate(-5px,2px) skewX(2deg); opacity: 0.7; clip-path: inset(30% 0 20% 0); }
  78% { transform: translate(4px,-1px); opacity: 0.5; clip-path: inset(60% 0 5% 0); }
  80% { transform: translate(0); opacity: 0; }
}
@keyframes logo-text-r {
  0%,62%,100% { transform: translate(0); opacity: 0; clip-path: inset(0); }
  64% { transform: translate(-7px,2px) skewX(4deg); opacity: 0.8; clip-path: inset(50% 0 10% 0); }
  67% { transform: translate(5px,-2px) skewX(-3deg); opacity: 1; clip-path: inset(10% 0 50% 0); }
  70% { transform: translate(-4px,1px); opacity: 0.6; clip-path: inset(35% 0 30% 0); }
  72% { transform: translate(0); opacity: 0; }
}
@keyframes logo-shake {
  0% { transform: translate(0); }
  25% { transform: translate(-2px,1px); }
  50% { transform: translate(2px,-1px); }
  75% { transform: translate(-1px,-1px); }
  100% { transform: translate(1px,1px); }
}

/* ============================================ */
/* MAGNETIC BUTTON                              */
/* ============================================ */
.btn-magnetic {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 16px 32px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 16px;
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  cursor: none;
  overflow: hidden;
}

.btn-magnetic .btn-text { position: relative; z-index: 2; }
.btn-magnetic svg { position: relative; z-index: 2; }

.btn-primary {
  background: linear-gradient(135deg, #6366f1, #818cf8);
  color: #fff;
  box-shadow: 0 4px 20px rgba(99,102,241,0.3);
}
.btn-primary:hover {
  box-shadow: 0 8px 40px rgba(99,102,241,0.5);
  transform: translateY(-2px);
}

/* Shine sweep on hover */
.btn-primary::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -75%;
  width: 50%;
  height: 200%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
  transform: skewX(-20deg);
  transition: left 0.6s ease;
}
.btn-primary:hover::after { left: 125%; }

.btn-secondary {
  color: #8b8b9e;
  border: 1px solid #1e1e2e;
  background: transparent;
}
.btn-secondary:hover {
  color: #fff;
  border-color: rgba(99,102,241,0.3);
  background: rgba(99,102,241,0.05);
}

/* ============================================ */
/* GRADIENT TEXT                                 */
/* ============================================ */
.gradient-text {
  background: linear-gradient(135deg, #fff 0%, #6366f1 50%, #818cf8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.gradient-text-accent {
  background: linear-gradient(135deg, #6366f1, #a78bfa, #818cf8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Animated flowing gradient */
.gradient-flow {
  background: linear-gradient(270deg, #6366f1, #818cf8, #a78bfa, #6366f1);
  background-size: 300% 300%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradient-flow 6s ease infinite;
}

@keyframes gradient-flow {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* ============================================ */
/* GLASS CARD with SPOTLIGHT                    */
/* ============================================ */
.glass-card {
  background: rgba(22, 22, 31, 0.6);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(99,102,241,0.08);
  border-radius: 20px;
  transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  position: relative;
  overflow: hidden;
  cursor: none;
}

/* Spotlight effect */
.glass-card .spotlight {
  position: absolute;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(99,102,241,0.12) 0%, transparent 70%);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s ease;
  transform: translate(-50%, -50%);
}
.glass-card:hover .spotlight { opacity: 1; }

.glass-card:hover {
  border-color: rgba(99,102,241,0.25);
  transform: translateY(-6px);
  box-shadow: 0 25px 50px rgba(99,102,241,0.08);
}

/* 3D Tilt */
.tilt-card {
  transform-style: preserve-3d;
  perspective: 1000px;
}

/* ============================================ */
/* BADGE / PILL                                 */
/* ============================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
}

.badge-accent {
  border: 1px solid rgba(99,102,241,0.2);
  background: rgba(99,102,241,0.05);
  color: #818cf8;
}

.badge-red {
  border: 1px solid rgba(239,68,68,0.2);
  background: rgba(239,68,68,0.05);
  color: #f87171;
}

/* ============================================ */
/* SECTION COMMONS                              */
/* ============================================ */
section { position: relative; z-index: 2; }

.section-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ============================================ */
/* HERO                                         */
/* ============================================ */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 72px;
  position: relative;
  overflow: hidden;
}

.hero-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.12;
  pointer-events: none;
}

.hero-content {
  text-align: center;
  max-width: 900px;
  margin: 0 auto;
  position: relative;
  z-index: 5;
}

.hero h1 {
  font-size: clamp(2.5rem, 7vw, 5.5rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -2px;
  margin-bottom: 1.5rem;
}

.hero p {
  font-size: clamp(1rem, 2vw, 1.25rem);
  color: #8b8b9e;
  max-width: 600px;
  margin: 0 auto 2.5rem;
  line-height: 1.7;
}

.hero-ctas {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

/* ============================================ */
/* TEXT REVEAL ANIMATION                        */
/* ============================================ */
.split-text .char {
  display: inline-block;
  opacity: 0;
  transform: translateY(40px) rotateX(-40deg);
  transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.split-text.visible .char {
  opacity: 1;
  transform: translateY(0) rotateX(0);
}

/* ============================================ */
/* MARQUEE (Infinite scroll logos)              */
/* ============================================ */
.marquee-wrapper {
  overflow: hidden;
  padding: 2rem 0;
  mask-image: linear-gradient(to right, transparent, black 15%, black 85%, transparent);
}

.marquee-track {
  display: flex;
  gap: 4rem;
  animation: marquee-scroll 25s linear infinite;
  width: max-content;
}

.marquee-item {
  font-size: 18px;
  font-weight: 600;
  color: #fff;
  opacity: 0.2;
  white-space: nowrap;
  letter-spacing: -0.5px;
  transition: opacity 0.3s ease;
}

.marquee-item:hover { opacity: 0.5; }

@keyframes marquee-scroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ============================================ */
/* SCROLL REVEAL                                */
/* ============================================ */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: all 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-left {
  opacity: 0;
  transform: translateX(-60px);
  transition: all 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal-left.visible {
  opacity: 1;
  transform: translateX(0);
}

.reveal-right {
  opacity: 0;
  transform: translateX(60px);
  transition: all 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal-right.visible {
  opacity: 1;
  transform: translateX(0);
}

.reveal-scale {
  opacity: 0;
  transform: scale(0.85);
  transition: all 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal-scale.visible {
  opacity: 1;
  transform: scale(1);
}

/* Stagger */
[data-delay="1"] { transition-delay: 0.1s; }
[data-delay="2"] { transition-delay: 0.2s; }
[data-delay="3"] { transition-delay: 0.3s; }
[data-delay="4"] { transition-delay: 0.4s; }
[data-delay="5"] { transition-delay: 0.5s; }

/* ============================================ */
/* COUNTER                                      */
/* ============================================ */
.counter-value {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 800;
  line-height: 1;
}

/* ============================================ */
/* PRICING                                      */
/* ============================================ */
.pricing-popular {
  background: linear-gradient(135deg, rgba(99,102,241,0.15), rgba(22,22,31,0.9));
  border: 1px solid rgba(99,102,241,0.4);
  box-shadow: 0 0 60px rgba(99,102,241,0.1), inset 0 1px 0 rgba(255,255,255,0.05);
  transform: scale(1.03);
}

.pricing-popular:hover { transform: scale(1.05) translateY(-6px); }

.pricing-badge {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, #6366f1, #818cf8);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 6px 20px;
  border-radius: 999px;
  letter-spacing: 0.5px;
}

/* ============================================ */
/* FAQ                                          */
/* ============================================ */
.faq-item { overflow: hidden; }

.faq-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem;
  background: none;
  border: none;
  color: #fff;
  font-family: inherit;
  font-size: 16px;
  font-weight: 500;
  text-align: left;
  cursor: none;
}

.faq-icon {
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  color: #6366f1;
  flex-shrink: 0;
}
.faq-icon.open { transform: rotate(45deg); }

.faq-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
.faq-content.open { max-height: 300px; }

/* ============================================ */
/* WHATSAPP FLOAT                               */
/* ============================================ */
.wa-float {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 90;
  width: 56px;
  height: 56px;
  background: #25D366;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 24px rgba(37,211,102,0.35);
  cursor: none;
  text-decoration: none;
  transition: all 0.3s ease;
  animation: wa-bounce 3s ease-in-out infinite;
}
.wa-float:hover {
  transform: scale(1.15);
  box-shadow: 0 6px 32px rgba(37,211,102,0.5);
}

/* Pulse ring */
.wa-float::before {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px solid rgba(37,211,102,0.4);
  animation: wa-pulse 2s ease-out infinite;
}

@keyframes wa-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

@keyframes wa-pulse {
  0% { transform: scale(1); opacity: 1; }
  100% { transform: scale(1.5); opacity: 0; }
}

/* ============================================ */
/* LANGUAGE TOGGLE                              */
/* ============================================ */
.lang-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(99,102,241,0.08);
  border: 1px solid rgba(99,102,241,0.15);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: none;
  transition: all 0.3s ease;
  white-space: nowrap;
}
.lang-toggle:hover {
  background: rgba(99,102,241,0.18);
  border-color: rgba(99,102,241,0.35);
}
.lang-flag { line-height: 1; display: flex; align-items: center; border-radius: 3px; overflow: hidden; }
.lang-code { font-family: 'Inter', sans-serif; letter-spacing: 0.5px; }

/* Hide mobile toggle on desktop, show on mobile */
.mobile-lang-toggle { display: none; }

/* ============================================ */
/* MOBILE MENU                                  */
/* ============================================ */
.mobile-toggle {
  display: none;
  background: none;
  border: none;
  color: #fff;
  cursor: none;
  padding: 8px;
}

.mobile-menu {
  position: fixed;
  inset: 0;
  background: rgba(10,10,15,0.97);
  backdrop-filter: blur(30px);
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  transform: translateX(100%);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.mobile-menu.open { transform: translateX(0); }

.mobile-menu a {
  color: #fff;
  text-decoration: none;
  font-size: 1.5rem;
  font-weight: 600;
  cursor: none;
}

/* ============================================ */
/* FORM                                         */
/* ============================================ */
.form-input {
  width: 100%;
  padding: 14px 18px;
  border-radius: 14px;
  background: #0a0a0f;
  border: 1px solid #1e1e2e;
  color: #fff;
  font-family: inherit;
  font-size: 15px;
  outline: none;
  transition: all 0.3s ease;
  cursor: none;
}
.form-input:focus {
  border-color: rgba(99,102,241,0.4);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.08);
}
.form-input::placeholder { color: rgba(139,139,158,0.5); }

.form-label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: #e4e4ed;
  margin-bottom: 8px;
}

/* ============================================ */
/* FOOTER                                       */
/* ============================================ */
footer {
  border-top: 1px solid #1e1e2e;
  padding: 3rem 0;
  position: relative;
  z-index: 2;
}

/* ============================================ */
/* RESPONSIVE                                   */
/* ============================================ */
@media (max-width: 768px) {
  body { cursor: auto; }
  .cursor-dot, .cursor-glow { display: none; }
  * { cursor: auto !important; }
  .nav-center { display: none; }
  .nav-right { display: none; }
  .nav-mobile-controls { display: flex; }
  .mobile-toggle { display: block; }
  .mobile-lang-toggle { display: flex; }
  .hero h1 { letter-spacing: -1px; }
  .pricing-popular { transform: scale(1); }
  .pricing-popular:hover { transform: translateY(-6px); }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  .marquee-track { animation: none; }
  .reveal, .reveal-left, .reveal-right, .reveal-scale { opacity: 1; transform: none; }
}
