/* ============ BASE ============ */
html {
  scroll-behavior: smooth;
}

body {
  overflow-x: hidden;
}

/* ============ ANIMATIONS ============ */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes bounceSlow {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.animate-fade-in {
  animation: fadeIn 0.8s ease-out both;
}

.animate-fade-in-up {
  animation: fadeInUp 0.8s ease-out both;
}

.animate-bounce-slow {
  animation: bounceSlow 2s ease-in-out infinite;
}

.delay-100 { animation-delay: 0.1s; }
.delay-200 { animation-delay: 0.2s; }
.delay-300 { animation-delay: 0.3s; }

/* ============ SCROLL REVEAL ============ */
.scroll-reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.scroll-reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger children */
.scroll-reveal:nth-child(2) { transition-delay: 0.1s; }
.scroll-reveal:nth-child(3) { transition-delay: 0.2s; }
.scroll-reveal:nth-child(4) { transition-delay: 0.15s; }
.scroll-reveal:nth-child(5) { transition-delay: 0.2s; }
.scroll-reveal:nth-child(6) { transition-delay: 0.25s; }

/* ============ NAVBAR ============ */
#navbar {
  background: rgba(255, 255, 255, 0);
  backdrop-filter: blur(0px);
}

#navbar.scrolled {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(16px);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

/* ============ COUNTER ANIMATION ============ */
[data-counter] {
  font-variant-numeric: tabular-nums;
}

/* ============ CODE BLOCK ============ */
pre code {
  line-height: 1.8;
}

/* ============ CUSTOM SCROLLBAR ============ */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #a1a1a1;
}

/* ============ SELECTION ============ */
::selection {
  background-color: rgba(51, 97, 255, 0.15);
  color: inherit;
}

/* ============ SMOOTH ANCHOR OFFSET ============ */
section[id] {
  scroll-margin-top: 80px;
}

/* ============ CHAT DEMO BOUNCE ============ */
@keyframes chatBounce {
  0%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(-6px); }
}

/* ============ CHAT DEMO ============ */
#chat-demo {
  scroll-behavior: smooth;
  overflow-y: auto;
}

#chat-demo::-webkit-scrollbar {
  width: 4px;
}

#chat-demo::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 2px;
}

#lead-notification {
  animation: none;
}

#lead-notification[style*="opacity: 1"] {
  animation: notificationPop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
}

@keyframes notificationPop {
  from { opacity: 0; transform: translateY(16px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ============ RESPONSIVE FIXES ============ */
@media (max-width: 640px) {
  .scale-105 {
    transform: scale(1);
  }
}
