  /* Custom styles for T-Boyz Garage */
  html {
    scroll-behavior: smooth;
  }

  body {
    overflow-x: hidden;
  }

  /* Scroll reveal animations */
  .reveal {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.6s ease, transform 0.6s ease;
  }

  @media (prefers-reduced-motion: no-preference) {
    .reveal {
      opacity: 0;
      transform: translateY(24px);
    }

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

  /* Navbar scroll effect */
  #navbar {
    background: transparent;
  }

  #navbar.scrolled {
    background: rgba(254, 252, 247, 0.95);
    backdrop-filter: blur(12px);
    box-shadow: 0 1px 20px rgba(0, 0, 0, 0.06);
  }

  /* Mobile menu animations */
  #mobile-menu.open .menu-line:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }

  #mobile-menu.open .menu-line:nth-child(2) {
    opacity: 0;
  }

  #mobile-menu.open .menu-line:nth-child(3) {
    width: 1.5rem;
    transform: rotate(-45deg) translate(5px, -5px);
  }

  /* Service card hover */
  .group:hover .rounded-xl {
    transform: scale(1.05);
  }

  /* Button ripple effect */
  button, a {
    position: relative;
    overflow: hidden;
  }

  /* Custom scrollbar */
  ::-webkit-scrollbar {
    width: 8px;
  }

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

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

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

  /* Selection color */
  ::selection {
    background: #f7c4b4;
    color: #745228;
  }

  /* Form focus styles */
  input:focus, select:focus, textarea:focus {
    outline: none;
  }

  /* Subtle pattern overlay for hero */
  #hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle at 25% 25%, rgba(255,255,255,0.08) 1px, transparent 1px),
                      radial-gradient(circle at 75% 75%, rgba(255,255,255,0.05) 1px, transparent 1px);
    background-size: 60px 60px, 40px 40px;
    pointer-events: none;
  }

  /* Floating animation for decorative elements */
  @media (prefers-reduced-motion: no-preference) {
    @keyframes float {
      0%, 100% { transform: translateY(0px); }
      50% { transform: translateY(-12px); }
    }

    .float-1 { animation: float 6s ease-in-out infinite; }
    .float-2 { animation: float 8s ease-in-out infinite; animation-delay: -2s; }
    .float-3 { animation: float 7s ease-in-out infinite; animation-delay: -4s; }
  }

  /* Mobile menu transitions */
  #mobile-menu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
  }

  #mobile-menu.open {
    max-height: 300px;
  }
</style>
<sm-file path="script.js">
  // T-Boyz Garage - Interactive Scripts

  document.addEventListener('DOMContentLoaded', function () {

    // ─── Navbar scroll effect ─────────────────────────────────────────────
    const navbar = document.getElementById('navbar');
    let lastScroll = 0;

    function handleScroll() {
      const currentScroll = window.pageYOffset;
      if (currentScroll > 50) {
        navbar.classList.add('scrolled');
      } else {
        navbar.classList.remove('scrolled');
      }
      lastScroll = currentScroll;
    }

    window.addEventListener('scroll', handleScroll, { passive: true });

    // ─── Mobile menu toggle ───────────────────────────────────────────────
    const menuBtn = document.getElementById('menu-btn');
    const mobileMenu = document.getElementById('mobile-menu');
    const mobileLinks = document.querySelectorAll('.mobile-link');

    menuBtn.addEventListener('click', function () {
      mobileMenu.classList.toggle('open');
      menuBtn.classList.toggle('open');
    });

    mobileLinks.forEach(function (link) {
      link.addEventListener('click', function () {
        mobileMenu.classList.remove('open');
        menuBtn.classList.remove('open');
      });
    });

    // ─── Scroll reveal (progressive enhancement) ──────────────────────────
    const prefersReducedMotion = window.matchMedia('(prefers-reduced-motion: reduce)').matches;

    if (!prefersReducedMotion && 'IntersectionObserver' in window) {
      const revealElements = document.querySelectorAll('.reveal');

      const revealObserver = new IntersectionObserver(function (entries) {
        entries.forEach(function (entry) {
          if (entry.isIntersecting) {
            entry.target.classList.add('revealed');
            revealObserver.unobserve(entry.target);
          }
        });
      }, {
        threshold: 0.1,
        rootMargin: '0px 0px -40px 0px'
      });

      revealElements.forEach(function (el) {
        revealObserver.observe(el);
      });
    } else {
      // If JS is disabled or reduced motion preferred, ensure all elements are visible
      document.querySelectorAll('.reveal').forEach(function (el) {
        el.classList.add('revealed');
      });
    }

    // ─── Contact form handling ────────────────────────────────────────────
    const contactForm = document.getElementById('contact-form');
    const successMsg = document.getElementById('success-msg');
    const submitBtn = document.getElementById('submit-btn');

    contactForm.addEventListener('submit', function (e) {
      e.preventDefault();

      // Basic validation
      const name = document.getElementById('name').value.trim();
      const email = document.getElementById('email').value.trim();
      const message = document.getElementById('message').value.trim();

      if (!name || !email || !message) {
        return;
      }

      // Simulate sending
      submitBtn.disabled = true;
      submitBtn.innerHTML = `
        <svg class="w-5 h-5 animate-spin" fill="none" viewBox="0 0 24 24">
          <circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle>
          <path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"></path>
        </svg>
        Sending…
      `;

      setTimeout(function () {
        contactForm.reset();
        contactForm.classList.add('hidden');
        successMsg.classList.remove('hidden');
        submitBtn.disabled = false;
        submitBtn.innerHTML = `
          <svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 19l9 2-9-18-9 18 9-2zm0 0v-8"/></svg>
          Send Message
        `;
      }, 1200);
    });

    // ─── Smooth scroll for anchor links ───────────────────────────────────
    document.querySelectorAll('a[href^="#"]').forEach(function (anchor) {
      anchor.addEventListener('click', function (e) {
        const targetId = this.getAttribute('href');
        if (targetId === '#') return;

        const target = document.querySelector(targetId);
        if (target) {
          e.preventDefault();
          const navHeight = navbar.offsetHeight;
          const targetPosition = target.getBoundingClientRect().top + window.pageYOffset - navHeight - 20;

          window.scrollTo({
            top: targetPosition,
            behavior: 'smooth'
          });
        }
      });
    });

    // ─── Active nav link highlighting ─────────────────────────────────────
    const sections = document.querySelectorAll('section[id]');
    const navLinks = document.querySelectorAll('nav ul li a[href^="#"]');

    function highlightNav() {
      const scrollPos = window.pageYOffset + 150;

      sections.forEach(function (section) {
        const top = section.offsetTop;
        const height = section.offsetHeight;
        const id = section.getAttribute('id');

        if (scrollPos >= top && scrollPos < top + height) {
          navLinks.forEach(function (link) {
            link.classList.remove('text-terracotta-500');
            if (link.getAttribute('href') === '#' + id) {
              link.classList.add('text-terracotta-500');
            }
          });
        }
      });
    }

    window.addEventListener('scroll', highlightNav, { passive: true });
  });
