/* ==========================================================
   Ishant Dubey — Performance Marketer | Custom styles
   ========================================================== */

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: auto; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }

body {
  background-color: #0a0e27;
  color: #ffffff;
  -webkit-tap-highlight-color: transparent;
}

/* Selection */
::selection { background: rgba(0, 242, 255, 0.3); color: #fff; }

/* ==========================================================
   Grain overlay (subtle noise on top)
   ========================================================== */
.grain-overlay {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='100'%3E%3Cfilter id='n'%3E%3CfeTurbulence baseFrequency='0.9' numOctaves='3' /%3E%3C/filter%3E%3Crect width='100' height='100' filter='url(%23n)' opacity='0.8'/%3E%3C/svg%3E");
}

/* ==========================================================
   Glassmorphism
   ========================================================== */
.glass {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

/* ==========================================================
   Buttons
   ========================================================== */
.btn-gradient {
  position: relative;
  background: linear-gradient(90deg, #00f2ff, #8b5cf6, #ec4899);
  background-size: 200% 100%;
  background-position: 0% 0%;
  color: #0a0e27;
  font-weight: 700;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 10px 40px -10px rgba(139, 92, 246, 0.5);
  border: none;
}
.btn-gradient:hover {
  background-position: 100% 0%;
  transform: translateY(-2px);
  box-shadow: 0 15px 50px -10px rgba(139, 92, 246, 0.7);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #fff;
  backdrop-filter: blur(10px);
  transition: all 0.3s;
}
.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(0, 242, 255, 0.4);
}

/* ==========================================================
   Nav + mobile menu
   ========================================================== */
#main-nav.scrolled {
  background: rgba(10, 14, 39, 0.72);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.mobile-link {
  position: relative;
  padding: 8px 0;
  transition: color 0.3s;
}
.mobile-link:hover { color: #00f2ff; }

/* ==========================================================
   Hero — layers, float anim, typed cursor
   ========================================================== */
.parallax-layer { will-change: transform; }

.blob { animation: blob-drift 20s ease-in-out infinite; mix-blend-mode: screen; }
@keyframes blob-drift {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(30px, -30px) scale(1.1); }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-20px); }
}
.animate-float { animation: float 6s ease-in-out infinite; }

#typed-text::after {
  content: '|';
  display: inline-block;
  margin-left: 4px;
  color: #00f2ff;
  animation: blink 0.8s steps(2) infinite;
  -webkit-text-fill-color: #00f2ff;
}
@keyframes blink { 0%, 50% { opacity: 1; } 51%, 100% { opacity: 0; } }

/* Particles (positioned by JS) */
.particle {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 242, 255, 0.8), rgba(0, 242, 255, 0));
  pointer-events: none;
  opacity: 0.6;
  animation: particle-drift 15s linear infinite;
}
@keyframes particle-drift {
  0% { transform: translate(0, 0); opacity: 0; }
  10%, 90% { opacity: 0.6; }
  100% { transform: translate(30px, -80px); opacity: 0; }
}

/* ==========================================================
   Service cards
   ========================================================== */
.service-card {
  position: relative;
  padding: 28px;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.01));
  border: 1px solid rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(10px);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  transform-style: preserve-3d;
}
.service-card::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 20px;
  padding: 1px;
  background: linear-gradient(135deg, rgba(0, 242, 255, 0), rgba(139, 92, 246, 0), rgba(236, 72, 153, 0));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.4s;
  pointer-events: none;
}
.service-card:hover {
  transform: translateY(-6px);
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: 0 20px 60px -20px rgba(139, 92, 246, 0.3);
}
.service-card:hover::before {
  opacity: 1;
  background: linear-gradient(135deg, rgba(0, 242, 255, 0.5), rgba(139, 92, 246, 0.5), rgba(236, 72, 153, 0.5));
}

.service-icon {
  width: 56px; height: 56px;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px;
  margin-bottom: 20px;
}

.service-card h3 {
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  font-size: 20px;
  margin-bottom: 8px;
  letter-spacing: -0.3px;
}
.service-card > p {
  color: #a0aec0;
  font-size: 14px;
  margin-bottom: 14px;
  line-height: 1.55;
}
.service-card ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex; flex-direction: column; gap: 6px;
}
.service-card li {
  position: relative;
  padding-left: 20px;
  color: #cbd5e0;
  font-size: 13px;
  line-height: 1.5;
}
.service-card li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: linear-gradient(135deg, #00f2ff, #8b5cf6);
}

/* ==========================================================
   Why cards
   ========================================================== */
.why-card {
  padding: 32px 28px;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.01));
  border: 1px solid rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(10px);
  transition: all 0.4s;
}
.why-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 255, 255, 0.14);
}
.why-card h3 {
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  font-size: 18px;
  margin-bottom: 8px;
  letter-spacing: -0.2px;
}
.why-card p {
  color: #a0aec0;
  font-size: 14px;
  line-height: 1.6;
}

/* ==========================================================
   Certification pills
   ========================================================== */
.cert-pill {
  display: inline-block;
  padding: 7px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 12px;
  font-weight: 500;
  color: #e2e8f0;
  backdrop-filter: blur(8px);
}

/* ==========================================================
   Reveal animations (triggered via JS + IntersectionObserver)
   ========================================================== */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1), transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ==========================================================
   Floating contact buttons
   ========================================================== */
.float-btn {
  position: relative;
  width: 56px; height: 56px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.5);
  transition: transform 0.3s;
  cursor: pointer;
  border: none;
}
.float-btn:hover { transform: scale(1.08); }

#float-call .pulse-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: #0ea5e9;
  animation: pulse-ring 2.4s ease-out infinite;
  opacity: 0;
  z-index: -1;
}
@keyframes pulse-ring {
  0% { transform: scale(1); opacity: 0.7; }
  100% { transform: scale(1.8); opacity: 0; }
}

#float-whatsapp {
  animation: wa-bounce 4s ease-in-out infinite;
}
@keyframes wa-bounce {
  0%, 90%, 100% { transform: translateY(0); }
  95% { transform: translateY(-6px); }
}

.tooltip {
  position: absolute;
  right: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%) translateX(8px);
  background: rgba(10, 14, 39, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: white;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s;
  backdrop-filter: blur(10px);
}
.float-btn:hover .tooltip {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}

/* ==========================================================
   Contact circles (in final CTA)
   ========================================================== */
.contact-circle {
  width: 60px; height: 60px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.4);
  transition: all 0.3s;
}
.contact-circle:hover {
  transform: translateY(-4px) scale(1.05);
  box-shadow: 0 15px 35px -5px rgba(0, 0, 0, 0.6);
}

/* ==========================================================
   Stats
   ========================================================== */
.stat-num {
  display: inline-block;
  line-height: 1;
}

/* ==========================================================
   Magnetic effect (applied via JS)
   ========================================================== */
.magnetic {
  display: inline-flex;
  will-change: transform;
  transition: transform 0.2s cubic-bezier(0.2, 0, 0.2, 1);
}

/* ==========================================================
   Responsive tweaks
   ========================================================== */
@media (max-width: 768px) {
  /* Disable heavy parallax on mobile for performance */
  .parallax-layer { transform: none !important; }
  .blob { filter: blur(60px); }
  #particles { display: none; }

  .service-card, .why-card { padding: 24px 20px; }
  .float-btn { width: 52px; height: 52px; }
  .tooltip { display: none; } /* no hover on touch */
}

/* Reduce motion preference */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}

/* ==========================================================
   Chat-CTA pill button (lead converter)
   ========================================================== */
.chat-cta-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px;
  background: linear-gradient(135deg, #8b5cf6, #ec4899);
  color: #fff !important;
  border-radius: 999px;
  box-shadow: 0 10px 40px -8px rgba(139, 92, 246, 0.6);
  text-decoration: none;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: transform 0.3s, box-shadow 0.3s;
  margin-bottom: 4px;
  z-index: 1;
}
.chat-cta-btn:hover {
  transform: scale(1.04);
  box-shadow: 0 15px 55px -8px rgba(139, 92, 246, 0.8);
}
.chat-cta-pulse {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, #8b5cf6, #ec4899);
  opacity: 0;
  animation: chat-cta-ring 2.5s ease-out infinite;
  z-index: -1;
}
@keyframes chat-cta-ring {
  0%   { transform: scale(1);    opacity: 0.55; }
  100% { transform: scale(1.28); opacity: 0;    }
}
.chat-cta-text { white-space: nowrap; font-family: 'Inter', sans-serif; }
.chat-cta-badge {
  background: #00f2ff;
  color: #0a0e27;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.5px;
}
@media (max-width: 768px) {
  .chat-cta-btn {
    padding: 0;
    width: 60px; height: 60px;
    border-radius: 50%;
    justify-content: center;
  }
  .chat-cta-text, .chat-cta-badge { display: none; }
}


/* ==========================================================
   Chat Modal (in-window AI agent widget)
   ========================================================== */
.chat-modal {
  position: fixed;
  bottom: 0;
  right: 24px;
  width: 380px;
  height: 600px;
  max-height: 85vh;
  z-index: 10001;
  background: #161c44;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 16px 16px 0 0;
  box-shadow: 0 -10px 60px -5px rgba(0,0,0,0.6);
  display: flex;
  flex-direction: column;
  transform: translateY(110%);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: 'Inter', sans-serif;
}
.chat-modal.open { transform: translateY(0); }
.chat-modal[aria-hidden="false"] { transform: translateY(0); }

.chat-header {
  padding: 14px 18px;
  background: linear-gradient(135deg, #8b5cf6, #ec4899);
  color: #fff;
  display: flex;
  align-items: center;
  gap: 12px;
  border-radius: 16px 16px 0 0;
  flex-shrink: 0;
}
.chat-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,0.18);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
}
.chat-id { line-height: 1.2; }
.chat-title { font-weight: 700; font-size: 15px; }
.chat-subtitle { font-size: 11px; opacity: 0.88; margin-top: 2px; display: flex; align-items: center; gap: 6px; }
.chat-online {
  width: 8px; height: 8px; border-radius: 50%;
  background: #34d399; box-shadow: 0 0 8px #34d399;
  animation: chat-pulse 1.6s ease-in-out infinite;
}
@keyframes chat-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(0.85); }
}
.chat-close {
  margin-left: auto;
  background: rgba(255,255,255,0.18);
  border: none;
  color: #fff;
  width: 32px; height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
  transition: background 0.2s;
}
.chat-close:hover { background: rgba(255,255,255,0.3); }

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #0f1334;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.15) transparent;
}
.chat-messages::-webkit-scrollbar { width: 6px; }
.chat-messages::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 3px; }

.chat-msg {
  max-width: 82%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.5;
  word-wrap: break-word;
  white-space: pre-wrap;
  animation: msg-pop 0.25s ease-out;
}
@keyframes msg-pop {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.msg-user {
  align-self: flex-end;
  background: linear-gradient(135deg, #8b5cf6, #ec4899);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.msg-ai {
  align-self: flex-start;
  background: rgba(255,255,255,0.06);
  color: #e2e8f0;
  border-bottom-left-radius: 4px;
  border: 1px solid rgba(255,255,255,0.04);
}
.msg-ai a { color: #00f2ff; text-decoration: underline; word-break: break-all; }
.msg-ai strong { color: #fff; }

.chat-typing { padding: 12px 16px !important; display: flex; gap: 4px; align-items: center; max-width: 70px; }
.chat-typing span {
  width: 8px; height: 8px; border-radius: 50%;
  background: #a0aec0; opacity: 0.4;
  animation: typing-dot 1.2s ease-in-out infinite;
}
.chat-typing span:nth-child(2) { animation-delay: 0.2s; }
.chat-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typing-dot {
  0%, 60%, 100% { opacity: 0.4; transform: scale(1); }
  30% { opacity: 1; transform: scale(1.2); }
}

.chat-input-wrap {
  padding: 12px;
  background: #161c44;
  border-top: 1px solid rgba(255,255,255,0.06);
  display: flex; gap: 8px;
  flex-shrink: 0;
}
.chat-input {
  flex: 1;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  color: #fff;
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}
.chat-input:focus { border-color: rgba(139,92,246,0.5); }
.chat-input::placeholder { color: #71717a; }
.chat-send {
  background: linear-gradient(135deg, #8b5cf6, #ec4899);
  border: none; color: #fff;
  width: 40px; height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: transform 0.15s;
}
.chat-send:hover { transform: scale(1.08); }
.chat-send:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

@media (max-width: 768px) {
  .chat-modal {
    right: 0; bottom: 0;
    width: 100vw; height: 100vh;
    max-height: 100vh;
    border-radius: 0;
    border: none;
  }
  .chat-header { border-radius: 0; }
}
