/* ========== ENHANCEMENTS FROM DEV SPA ========== */

/* Scroll-reveal animation */
.nv-reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}
.nv-reveal.visible {
  opacity: 1;
  transform: translateY(0);
}
.nv-reveal-left {
  opacity: 0;
  transform: translateX(-40px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}
.nv-reveal-left.visible {
  opacity: 1;
  transform: translateX(0);
}
.nv-reveal-right {
  opacity: 0;
  transform: translateX(40px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}
.nv-reveal-right.visible {
  opacity: 1;
  transform: translateX(0);
}

/* Stagger children animation */
.nv-stagger > * {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.nv-stagger.visible > *:nth-child(1) { transition-delay: 0.05s; }
.nv-stagger.visible > *:nth-child(2) { transition-delay: 0.1s; }
.nv-stagger.visible > *:nth-child(3) { transition-delay: 0.15s; }
.nv-stagger.visible > *:nth-child(4) { transition-delay: 0.2s; }
.nv-stagger.visible > *:nth-child(5) { transition-delay: 0.25s; }
.nv-stagger.visible > *:nth-child(6) { transition-delay: 0.3s; }
.nv-stagger.visible > *:nth-child(7) { transition-delay: 0.35s; }
.nv-stagger.visible > *:nth-child(8) { transition-delay: 0.4s; }
.nv-stagger.visible > *:nth-child(9) { transition-delay: 0.45s; }
.nv-stagger.visible > * {
  opacity: 1;
  transform: translateY(0);
}

/* Hero grid background */
.nv-hero {
  position: relative;
}
.nv-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(255,255,255,0.02) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,0.02) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
  z-index: 0;
}
.nv-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 800px 800px at 50% 40%, var(--nv-accent-glow), transparent);
  pointer-events: none;
  z-index: 0;
}
.nv-hero > * {
  position: relative;
  z-index: 1;
}

/* Animated grid overlay on hero */
@keyframes grid-shift {
  0% { opacity: 0.05; background-position: 0 0; }
  50% { opacity: 0.15; }
  100% { opacity: 0.05; background-position: 40px 40px; }
}
.nv-hero-grid-anim {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(99,102,241,0.06) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(99,102,241,0.06) 1px, transparent 1px);
  background-size: 80px 80px;
  animation: grid-shift 4s linear infinite;
  pointer-events: none;
  z-index: 0;
}

/* Scan line on cards */
.nv-card {
  overflow: hidden;
}
.nv-card::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(to right, transparent, var(--nv-accent), transparent);
  opacity: 0;
  top: -100%;
  transition: none;
  animation: scan-line 5s linear infinite;
  pointer-events: none;
}
@keyframes scan-line {
  0% { top: -10%; opacity: 0; }
  5% { opacity: 0.15; }
  95% { opacity: 0.15; }
  100% { top: 110%; opacity: 0; }
}

/* Enhanced card hover */
.nv-card {
  transition: all 0.3s ease, transform 0.3s ease;
}
.nv-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 60px -15px rgba(99, 102, 241, 0.15);
}

/* Corner accents on cards */
.nv-card::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 20px;
  height: 20px;
  border-top: 1px solid transparent;
  border-right: 1px solid transparent;
  transition: border-color 0.3s;
  pointer-events: none;
}
.nv-card:hover::before {
  border-top-color: var(--nv-accent);
  border-right-color: var(--nv-accent);
}

/* Glow on primary buttons */
.nv-btn-primary {
  position: relative;
  overflow: hidden;
}
.nv-btn-primary::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, transparent 50%);
  opacity: 0;
  transition: opacity 0.3s;
}
.nv-btn-primary:hover::after {
  opacity: 1;
}

/* Pipeline step pulse */
.nv-pipeline-step {
  position: relative;
}
.nv-pipeline-step .nv-pipeline-num::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1px solid var(--nv-accent);
  opacity: 0;
  animation: num-pulse 3s ease-in-out infinite;
}
@keyframes num-pulse {
  0%, 100% { opacity: 0; transform: scale(1); }
  50% { opacity: 0.3; transform: scale(1.2); }
}

/* Terminal typing cursor */
.nv-terminal-body code:last-child::after,
.nv-terminal-body > div:last-child::after {
  content: '▋';
  color: var(--nv-accent);
  animation: blink-cursor 1s step-end infinite;
  margin-left: 2px;
}
@keyframes blink-cursor {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

/* Gradient text for headings */
.nv-gradient-text {
  background: linear-gradient(135deg, #fff 0%, #a5a5b5 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Section dividers */
.nv-section + .nv-section::before {
  content: '';
  display: block;
  height: 1px;
  max-width: 80%;
  margin: 0 auto;
  background: linear-gradient(to right, transparent, var(--nv-border-accent), transparent);
}

/* Floating orb in hero */
@keyframes float-orb {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-20px); }
}
.nv-hero-orb {
  position: absolute;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--nv-accent-glow), transparent);
  filter: blur(80px);
  animation: float-orb 8s ease-in-out infinite;
  pointer-events: none;
  z-index: 0;
}

/* Status bar glow */
.nv-status-bar {
  box-shadow: 0 0 30px -10px rgba(34, 197, 94, 0.1);
}

/* Pricing card featured glow */
.nv-pricing-card.featured {
  box-shadow: 0 0 40px -10px rgba(99, 102, 241, 0.2);
}

/* FAQ smooth open */
.nv-faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease, padding 0.3s ease;
  padding: 0 24px;
}
.nv-faq-item.open .nv-faq-answer {
  max-height: 500px;
  padding: 0 24px 24px;
}

/* Nav link active indicator */
.nv-nav-links a.active {
  color: var(--nv-accent);
  position: relative;
}
.nv-nav-links a.active::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--nv-accent);
  border-radius: 1px;
}

/* Smooth image loading */
img {
  opacity: 0;
  transition: opacity 0.5s ease;
}
img.loaded, img[src^="data:"] {
  opacity: 1;
}

/* Counter animation */
.nv-counter {
  display: inline-block;
}

/* Mobile improvements */
@media (max-width: 768px) {
  .nv-hero h1 {
    font-size: clamp(2rem, 8vw, 3rem) !important;
  }
  .nv-section {
    padding: 60px 0 !important;
  }
  .nv-split {
    gap: 32px !important;
  }
}
