/* ==========================================================================
   Creastx AI Design System & Custom Styles
   Art-directed for Apollo.io-grade B2B SaaS Aesthetics
   ========================================================================== */

:root {
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --color-primary: #4f46e5;
  --color-primary-hover: #4338ca;
  --color-primary-light: #eef2ff;
  --color-primary-dark: #3730a3;
  --color-slate-950: #090d16;
  --color-slate-900: #0f172a;
  --color-slate-800: #1e293b;
  --color-slate-700: #334155;
  --color-slate-600: #475569;
  --color-slate-500: #64748b;
  --color-slate-400: #94a3b8;
  --color-slate-300: #cbd5e1;
  --color-slate-200: #e2e8f0;
  --color-slate-100: #f1f5f9;
  --color-slate-50: #f8fafc;
  --color-white: #ffffff;
}

/* Base resets & typography */
html {
  scroll-behavior: smooth;
  font-family: var(--font-sans);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  color: var(--color-slate-900);
  background-color: var(--color-white);
  overflow-x: hidden;
  margin: 0;
  padding: 0;
}

/* Focus styles for accessibility */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* Custom Gradients & Accents */
.bg-mesh-subtle {
  background-image: 
    radial-gradient(at 10% 10%, rgba(99, 102, 241, 0.05) 0px, transparent 50%),
    radial-gradient(at 90% 0%, rgba(59, 130, 246, 0.04) 0px, transparent 50%),
    radial-gradient(at 50% 50%, rgba(248, 250, 252, 0.8) 0px, transparent 100%);
}

.bg-dark-mesh {
  background-color: #090D16;
  background-image: 
    radial-gradient(circle at 50% 0%, rgba(79, 70, 229, 0.15) 0%, transparent 60%),
    radial-gradient(circle at 100% 100%, rgba(30, 58, 138, 0.1) 0%, transparent 50%);
}

/* Subtle grid line background */
.bg-grid-pattern {
  background-size: 40px 40px;
  background-image: 
    linear-gradient(to right, rgba(226, 232, 240, 0.4) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(226, 232, 240, 0.4) 1px, transparent 1px);
}

.bg-grid-pattern-dark {
  background-size: 40px 40px;
  background-image: 
    linear-gradient(to right, rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
}

/* Smooth Horizontal Scroll snapping for Services */
.services-track {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none; /* Firefox */
  gap: 1.5rem;
  padding-bottom: 1.5rem;
  padding-top: 0.5rem;
}

.services-track::-webkit-scrollbar {
  display: none; /* Chrome, Safari, Opera */
}

.services-track > * {
  scroll-snap-align: start;
  flex-shrink: 0;
}

/* Custom audio waveform animation for Live Demo */
@keyframes soundwave {
  0%, 100% { height: 6px; }
  50% { height: 28px; }
}

.wave-bar {
  width: 3px;
  border-radius: 9999px;
  background-color: #6366f1;
  animation: soundwave 1.4s ease-in-out infinite;
}

.wave-bar:nth-child(1) { animation-delay: 0.0s; height: 12px; }
.wave-bar:nth-child(2) { animation-delay: 0.15s; height: 20px; }
.wave-bar:nth-child(3) { animation-delay: 0.3s; height: 26px; }
.wave-bar:nth-child(4) { animation-delay: 0.45s; height: 14px; }
.wave-bar:nth-child(5) { animation-delay: 0.2s; height: 24px; }
.wave-bar:nth-child(6) { animation-delay: 0.35s; height: 18px; }
.wave-bar:nth-child(7) { animation-delay: 0.5s; height: 10px; }
.wave-bar:nth-child(8) { animation-delay: 0.1s; height: 22px; }
.wave-bar:nth-child(9) { animation-delay: 0.4s; height: 16px; }
.wave-bar:nth-child(10) { animation-delay: 0.25s; height: 28px; }

/* Custom slider thumb styles for ROI calculator */
input[type=range] {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  background: #e2e8f0;
  border-radius: 9999px;
  outline: none;
  transition: background 0.2s;
}

input[type=range]:hover {
  background: #cbd5e1;
}

input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #4f46e5;
  cursor: pointer;
  border: 2px solid #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  transition: transform 0.15s ease, background-color 0.15s ease;
}

input[type=range]::-webkit-slider-thumb:hover {
  transform: scale(1.15);
  background: #4338ca;
}

input[type=range]::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #4f46e5;
  cursor: pointer;
  border: 2px solid #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  transition: transform 0.15s ease, background-color 0.15s ease;
}

input[type=range]::-moz-range-thumb:hover {
  transform: scale(1.15);
  background: #4338ca;
}

/* Accordion transition */
.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s ease;
  opacity: 0;
}

.faq-answer.open {
  opacity: 1;
}

/* Subtle card hover elevation */
.card-hover {
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.25s ease;
}

.card-hover:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px -10px rgba(15, 23, 42, 0.08);
  border-color: #cbd5e1;
}

/* Live Workflow node pulse */
@keyframes flowPulse {
  0% { transform: scale(0.95); opacity: 0.7; }
  50% { transform: scale(1.05); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.7; }
}

.pulse-indicator {
  animation: flowPulse 2s ease-in-out infinite;
}

/* Connection line pulse */
@keyframes beamTravel {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.flow-beam {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent, #4f46e5, transparent);
  animation: beamTravel 2.5s infinite linear;
}

/* Respect prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .wave-bar,
  .pulse-indicator,
  .flow-beam {
    animation: none !important;
  }
  .faq-answer {
    transition: none !important;
  }
  .card-hover {
    transition: none !important;
  }
}
