/* ============================================
   HumanVAD — Shared Styles
   ============================================ */

/* Base */
body {
  font-family: 'Inter', system-ui, sans-serif;
  background: #020617;
  color: #E2E8F0;
}
code, pre, .font-mono {
  font-family: 'JetBrains Mono', monospace;
}

/* ============================================
   Scroll Progress Bar
   ============================================ */
#scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, #0D9488, #5EEAD4);
  z-index: 9999;
  transition: width 0.1s linear;
  pointer-events: none;
}

/* ============================================
   Glassmorphism Nav
   ============================================ */
.nav-glass {
  background: rgba(2, 6, 23, 0.7);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: background 0.4s cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 0.4s cubic-bezier(0.4, 0, 0.2, 1),
              border-color 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.nav-glass.nav-scrolled {
  background: rgba(2, 6, 23, 0.95);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3), 0 1px 0 rgba(13, 148, 136, 0.1);
}

/* Nav link hover underline animation */
.nav-link {
  position: relative;
}
.nav-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: #5EEAD4;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.nav-link:hover::after {
  width: 100%;
}

/* ============================================
   Waveform Bar Animations
   ============================================ */
@keyframes wave1 { 0%,100%{height:20%} 50%{height:85%} }
@keyframes wave2 { 0%,100%{height:35%} 50%{height:60%} }
@keyframes wave3 { 0%,100%{height:55%} 50%{height:25%} }
@keyframes wave4 { 0%,100%{height:40%} 50%{height:90%} }
@keyframes wave5 { 0%,100%{height:70%} 50%{height:30%} }
@keyframes wave6 { 0%,100%{height:15%} 50%{height:75%} }
@keyframes wave7 { 0%,100%{height:50%} 50%{height:95%} }
@keyframes wave8 { 0%,100%{height:80%} 50%{height:40%} }

@keyframes wave9 { 0%,100%{height:25%} 50%{height:78%} }
@keyframes wave10 { 0%,100%{height:60%} 50%{height:35%} }
@keyframes wave11 { 0%,100%{height:45%} 50%{height:88%} }
@keyframes wave12 { 0%,100%{height:30%} 50%{height:70%} }

.wave-bar {
  width: 4px;
  min-height: 4px;
  border-radius: 2px;
  transition: background-color 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.wave-bar.voice { background: #0D9488; }
.wave-bar.silence { background: #334155; }
.wave-bar.energy-high { background: #F59E0B; }
.wave-bar.energy-low { background: #334155; }
.wave-bar.prosody { background: #8B5CF6; }

.wave-bar:nth-child(8n+1) { animation: wave1 1.8s ease-in-out infinite; }
.wave-bar:nth-child(8n+2) { animation: wave2 2.1s ease-in-out infinite; }
.wave-bar:nth-child(8n+3) { animation: wave3 1.5s ease-in-out infinite; }
.wave-bar:nth-child(8n+4) { animation: wave4 2.4s ease-in-out infinite; }
.wave-bar:nth-child(8n+5) { animation: wave5 1.9s ease-in-out infinite; }
.wave-bar:nth-child(8n+6) { animation: wave6 2.6s ease-in-out infinite; }
.wave-bar:nth-child(8n+7) { animation: wave7 1.4s ease-in-out infinite; }
.wave-bar:nth-child(8n+8) { animation: wave8 2.2s ease-in-out infinite; }

/* Delay offset per bar */
.wave-bar:nth-child(1) { animation-delay: 0s; }
.wave-bar:nth-child(2) { animation-delay: 0.05s; }
.wave-bar:nth-child(3) { animation-delay: 0.1s; }
.wave-bar:nth-child(4) { animation-delay: 0.15s; }
.wave-bar:nth-child(5) { animation-delay: 0.2s; }
.wave-bar:nth-child(6) { animation-delay: 0.25s; }
.wave-bar:nth-child(7) { animation-delay: 0.3s; }
.wave-bar:nth-child(8) { animation-delay: 0.35s; }
.wave-bar:nth-child(9) { animation-delay: 0.4s; }
.wave-bar:nth-child(10) { animation-delay: 0.45s; }
.wave-bar:nth-child(11) { animation-delay: 0.5s; }
.wave-bar:nth-child(12) { animation-delay: 0.55s; }
.wave-bar:nth-child(13) { animation-delay: 0.6s; }
.wave-bar:nth-child(14) { animation-delay: 0.65s; }
.wave-bar:nth-child(15) { animation-delay: 0.7s; }
.wave-bar:nth-child(16) { animation-delay: 0.75s; }
.wave-bar:nth-child(17) { animation-delay: 0.8s; }
.wave-bar:nth-child(18) { animation-delay: 0.85s; }
.wave-bar:nth-child(19) { animation-delay: 0.9s; }
.wave-bar:nth-child(20) { animation-delay: 0.95s; }
.wave-bar:nth-child(21) { animation-delay: 1.0s; }
.wave-bar:nth-child(22) { animation-delay: 1.05s; }
.wave-bar:nth-child(23) { animation-delay: 1.1s; }
.wave-bar:nth-child(24) { animation-delay: 1.15s; }
.wave-bar:nth-child(25) { animation-delay: 1.2s; }
.wave-bar:nth-child(26) { animation-delay: 1.25s; }
.wave-bar:nth-child(27) { animation-delay: 1.3s; }
.wave-bar:nth-child(28) { animation-delay: 1.35s; }
.wave-bar:nth-child(29) { animation-delay: 1.4s; }
.wave-bar:nth-child(30) { animation-delay: 1.45s; }
.wave-bar:nth-child(31) { animation-delay: 1.5s; }
.wave-bar:nth-child(32) { animation-delay: 1.55s; }
.wave-bar:nth-child(33) { animation-delay: 1.6s; }
.wave-bar:nth-child(34) { animation-delay: 1.65s; }
.wave-bar:nth-child(35) { animation-delay: 1.7s; }
.wave-bar:nth-child(36) { animation-delay: 1.75s; }
.wave-bar:nth-child(37) { animation-delay: 1.8s; }
.wave-bar:nth-child(38) { animation-delay: 1.85s; }
.wave-bar:nth-child(39) { animation-delay: 1.9s; }
.wave-bar:nth-child(40) { animation-delay: 1.95s; }
.wave-bar:nth-child(41) { animation-delay: 2.0s; }
.wave-bar:nth-child(42) { animation-delay: 2.05s; }
.wave-bar:nth-child(43) { animation-delay: 2.1s; }
.wave-bar:nth-child(44) { animation-delay: 2.15s; }
.wave-bar:nth-child(45) { animation-delay: 2.2s; }
.wave-bar:nth-child(46) { animation-delay: 2.25s; }
.wave-bar:nth-child(47) { animation-delay: 2.3s; }
.wave-bar:nth-child(48) { animation-delay: 2.35s; }

/* Large waveform bars for hero / demo */
.wave-bar-lg {
  width: 6px;
  min-height: 6px;
  border-radius: 3px;
  transition: background-color 0.4s cubic-bezier(0.4, 0, 0.2, 1), height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.wave-bar-lg.voice { background: #0D9488; }
.wave-bar-lg.silence { background: #334155; }

.wave-bar-lg:nth-child(8n+1) { animation: wave1 1.6s ease-in-out infinite; }
.wave-bar-lg:nth-child(8n+2) { animation: wave2 1.9s ease-in-out infinite; }
.wave-bar-lg:nth-child(8n+3) { animation: wave3 1.3s ease-in-out infinite; }
.wave-bar-lg:nth-child(8n+4) { animation: wave4 2.2s ease-in-out infinite; }
.wave-bar-lg:nth-child(8n+5) { animation: wave5 1.7s ease-in-out infinite; }
.wave-bar-lg:nth-child(8n+6) { animation: wave6 2.4s ease-in-out infinite; }
.wave-bar-lg:nth-child(8n+7) { animation: wave7 1.2s ease-in-out infinite; }
.wave-bar-lg:nth-child(8n+8) { animation: wave8 2.0s ease-in-out infinite; }

/* ============================================
   Code Syntax Highlighting
   ============================================ */
.line-num {
  color: #475569;
  user-select: none;
  text-align: right;
  min-width: 2rem;
  padding-right: 1rem;
}
.syn-kw { color: #5EEAD4; }
.syn-str { color: #CE9178; }
.syn-cmt { color: #6A9955; }
.syn-fn { color: #DCDCAA; }
.syn-num { color: #B5CEA8; }
.syn-op { color: #D4D4D4; }
.syn-var { color: #9CDCFE; }

/* ============================================
   Tooltip
   ============================================ */
.tooltip {
  position: absolute;
  background: #0D9488;
  color: #020617;
  padding: 4px 10px;
  font-size: 12px;
  font-family: 'JetBrains Mono', monospace;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
  top: -30px;
  right: 0;
  white-space: nowrap;
}
.tooltip.show {
  opacity: 1;
}

/* ============================================
   Bar Chart Animation
   ============================================ */
.bar-fill {
  transition: width 1s ease-out;
}

/* ============================================
   Pipeline Arrow
   ============================================ */
.pipeline-arrow {
  width: 40px;
  height: 2px;
  background: #0D9488;
  position: relative;
}
.pipeline-arrow::after {
  content: '';
  position: absolute;
  right: -1px;
  top: -4px;
  border: 5px solid transparent;
  border-left-color: #0D9488;
}

/* ============================================
   Scrollbar
   ============================================ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #0F172A; }
::-webkit-scrollbar-thumb { background: #334155; border-radius: 3px; }

/* ============================================
   Mobile Menu
   ============================================ */
.mobile-menu {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out;
}
.mobile-menu.open {
  max-height: 400px;
}

/* ============================================
   Speaking Glow Animation
   ============================================ */
@keyframes speakingPulse {
  0%, 100% { box-shadow: 0 0 20px rgba(13,148,136,0.3); }
  50% { box-shadow: 0 0 40px rgba(13,148,136,0.6); }
}
.speaking-glow {
  animation: speakingPulse 1.2s ease-in-out infinite;
}

/* ============================================
   VAD Log
   ============================================ */
.vad-log {
  max-height: 240px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #334155 #0F172A;
}

/* Canvas Responsive */
.vad-canvas-wrap canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* ============================================
   Scroll Reveal (enhanced with stagger)
   ============================================ */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s cubic-bezier(0.4, 0, 0.2, 1), transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }
.reveal-delay-5 { transition-delay: 0.5s; }
.reveal-delay-6 { transition-delay: 0.6s; }

/* ============================================
   Counter Animation
   ============================================ */
.counter-value {
  display: inline-block;
  min-width: 3ch;
}

/* ============================================
   Card Hover (premium lift + layered shadow)
   ============================================ */
.card-hover {
  transition: border-color 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}
.card-hover:hover {
  border-color: #0D9488;
  transform: translateY(-4px);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2),
              0 10px 30px rgba(13, 148, 136, 0.1),
              0 0 0 1px rgba(13, 148, 136, 0.15);
}

/* ============================================
   Button Hover (premium)
   ============================================ */
.btn-primary {
  transition: background-color 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.2s cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(13, 148, 136, 0.4),
              0 0 40px rgba(13, 148, 136, 0.15);
}
.btn-secondary {
  transition: border-color 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              color 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.2s cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.btn-secondary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(13, 148, 136, 0.2);
}

/* ============================================
   Focus Rings for Accessibility
   ============================================ */
a:focus-visible,
button:focus-visible,
input:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid #5EEAD4;
  outline-offset: 2px;
}

/* ============================================
   Benchmark Bar Comparison
   ============================================ */
.benchmark-bar {
  height: 28px;
  transition: width 1.2s ease-out;
  position: relative;
}
.benchmark-bar .benchmark-label {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  white-space: nowrap;
}

/* ============================================
   FAQ Accordion
   ============================================ */
.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out, padding 0.3s ease-out;
}
.faq-answer.open {
  max-height: 300px;
}
.faq-chevron {
  transition: transform 0.2s;
}
.faq-chevron.open {
  transform: rotate(180deg);
}

/* ============================================
   Demo Page Step Animation
   ============================================ */
@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
.demo-step {
  opacity: 0;
  animation: fadeSlideIn 0.5s ease-out forwards;
}
.demo-step.active {
  opacity: 1;
}

/* Pitch contour line animation */
@keyframes drawPitchLine {
  from { stroke-dashoffset: 600; }
  to { stroke-dashoffset: 0; }
}
.pitch-line {
  stroke-dasharray: 600;
  stroke-dashoffset: 600;
}
.pitch-line.animate {
  animation: drawPitchLine 2s ease-in-out forwards;
}

/* Segment highlight animation */
@keyframes highlightSegment {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Result counter animation */
@keyframes countUp {
  from { opacity: 0; transform: scale(0.8); }
  to { opacity: 1; transform: scale(1); }
}
.result-animate {
  animation: countUp 0.4s ease-out forwards;
}

/* ============================================
   Pricing Tier Cards
   ============================================ */
.tier-card {
  transition: border-color 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.tier-card:hover {
  border-color: #0D9488;
  transform: translateY(-4px);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2),
              0 10px 30px rgba(13,148,136,0.15);
}
.tier-card.featured {
  border-color: #0D9488;
  box-shadow: 0 0 30px rgba(13,148,136,0.1);
}
.tier-card.featured:hover {
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2),
              0 10px 40px rgba(13,148,136,0.25);
}

/* ============================================
   Gradient Text
   ============================================ */
.gradient-text {
  background: linear-gradient(135deg, #5EEAD4, #0D9488);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ============================================
   Hero Glow + Animated Gradient Blobs
   ============================================ */
@keyframes heroGlow {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 0.6; }
}
.hero-glow {
  position: absolute;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(13,148,136,0.15) 0%, transparent 70%);
  animation: heroGlow 4s ease-in-out infinite;
  pointer-events: none;
}

@keyframes blobFloat1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(30px, -50px) scale(1.1); }
  50% { transform: translate(-20px, -80px) scale(0.95); }
  75% { transform: translate(40px, -30px) scale(1.05); }
}
@keyframes blobFloat2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(-40px, 30px) scale(1.08); }
  50% { transform: translate(30px, 50px) scale(0.92); }
  75% { transform: translate(-20px, 20px) scale(1.04); }
}
@keyframes blobFloat3 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(50px, -40px) scale(1.12); }
  66% { transform: translate(-30px, 30px) scale(0.9); }
}

.gradient-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  will-change: transform;
}
.gradient-blob-1 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(13, 148, 136, 0.2) 0%, transparent 70%);
  top: -100px;
  left: -150px;
  animation: blobFloat1 8s ease-in-out infinite;
}
.gradient-blob-2 {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(6, 182, 212, 0.15) 0%, transparent 70%);
  bottom: -100px;
  right: -100px;
  animation: blobFloat2 10s ease-in-out infinite;
}
.gradient-blob-3 {
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(94, 234, 212, 0.1) 0%, transparent 70%);
  top: 50%;
  left: 50%;
  animation: blobFloat3 12s ease-in-out infinite;
}

/* ============================================
   Section Divider (gradient line)
   ============================================ */
.section-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(13, 148, 136, 0.3), transparent);
  border: none;
}

/* ============================================
   Parallax Hero Elements
   ============================================ */
.parallax-hero {
  will-change: transform;
  transition: transform 0.1s linear;
}

/* ============================================
   Testimonial Card
   ============================================ */
.testimonial-card {
  transition: border-color 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}
.testimonial-card:hover {
  border-color: rgba(13, 148, 136, 0.4);
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2),
              0 0 0 1px rgba(13, 148, 136, 0.1);
}

/* ============================================
   Compatible Logo
   ============================================ */
.compat-logo {
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 0.5;
}
.compat-logo:hover {
  opacity: 1;
  transform: translateY(-2px);
}

/* ============================================
   Footer Project Link
   ============================================ */
.footer-project-link {
  transition: color 0.2s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.footer-project-link:hover {
  color: #5EEAD4;
  transform: translateX(2px);
}

/* ============================================
   Processing Pipeline SVG
   ============================================ */
.pipeline-box {
  transition: border-color 0.3s, box-shadow 0.3s;
}
.pipeline-box:hover {
  border-color: #5EEAD4;
  box-shadow: 0 0 20px rgba(13,148,136,0.2);
}

/* ============================================
   Comparison Table
   ============================================ */
.comparison-winner {
  position: relative;
}
.comparison-winner::after {
  content: '';
  position: absolute;
  inset: 0;
  border: 1px solid rgba(13,148,136,0.2);
  pointer-events: none;
}

/* ============================================
   Backer Tier Elevated
   ============================================ */
.tier-backer {
  position: relative;
  border-color: rgba(13, 148, 136, 0.4);
  background: linear-gradient(135deg, #0F172A, rgba(13, 148, 136, 0.05));
}
.tier-backer::before {
  content: 'Popular';
  position: absolute;
  top: -10px;
  right: 16px;
  background: linear-gradient(135deg, #0D9488, #5EEAD4);
  color: #020617;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 10px;
  letter-spacing: 0.05em;
}

/* ============================================
   Legal Pages
   ============================================ */
.legal-content h2 {
  color: #E2E8F0;
  font-size: 1.25rem;
  font-weight: 600;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}
.legal-content h3 {
  color: #94A3B8;
  font-size: 1rem;
  font-weight: 500;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}
.legal-content p {
  color: #94A3B8;
  line-height: 1.7;
  margin-bottom: 1rem;
}
.legal-content ul {
  color: #94A3B8;
  list-style-type: disc;
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}
.legal-content li {
  margin-bottom: 0.5rem;
  line-height: 1.6;
}
.legal-content a {
  color: #5EEAD4;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.legal-content a:hover {
  color: #0D9488;
}

/* ============================================
   Print
   ============================================ */
@media print {
  body { background: white; color: black; }
  nav, footer { display: none; }
}
