---
import Base from '../layouts/Base.astro';
import Hero from '../components/sections/Hero.astro';
import Speed from '../components/sections/Speed.astro';
import Coverage from '../components/sections/Coverage.astro';
import Rules from '../components/sections/Rules.astro';
import Install from '../components/sections/Install.astro';
import Footer from '../components/sections/Footer.astro';
---

<Base
  title="foxguard — Security scanner as fast as a linter"
  description="Security scanner as fast as a linter. 100+ built-in rules across 10 languages, secrets scanning, Semgrep-compatible YAML. Single Rust binary."
>
  <Hero />
  <Speed />
  <Coverage />
  <Install />
  <Rules />
  <Footer />

  <script>
    document.querySelectorAll('.copy-btn').forEach(btn => {
      btn.addEventListener('click', () => {
        const text = btn.getAttribute('data-copy') || '';
        navigator.clipboard.writeText(text);
        btn.classList.add('text-fox');
        setTimeout(() => btn.classList.remove('text-fox'), 1200);
      });
    });

    const npxBtn = document.getElementById('npx-btn');
    if (npxBtn) {
      npxBtn.addEventListener('click', () => {
        navigator.clipboard.writeText('npx foxguard .');
        npxBtn.querySelector('span:nth-child(2)')!.textContent = 'copied!';
        setTimeout(() => {
          npxBtn.querySelector('span:nth-child(2)')!.textContent = 'npx foxguard .';
        }, 1200);
      });
    }
  </script>
</Base>
