// Плавная прокрутка для навигационных ссылок document.addEventListener('DOMContentLoaded', function() { const navLinks = document.querySelectorAll('a[href^="#"]:not([href="#"])'); navLinks.forEach(link => { link.addEventListener('click', function(e) { e.preventDefault(); const targetId = this.getAttribute('href'); const targetElement = document.querySelector(targetId); if(targetElement) { window.scrollTo({ top: targetElement.offsetTop - 100, behavior: 'smooth' }); } }); }); // Динамическое изменение навигации при скролле window.addEventListener('scroll', function() { const navbar = document.querySelector('.navbar'); if (window.scrollY > 100) { navbar.style.backgroundColor = 'rgba(44, 24, 16, 0.98)'; navbar.style.boxShadow = '0 4px 12px rgba(0,0,0,0.15)'; } else { navbar.style.backgroundColor = 'rgba(44, 24, 16, 0.95)'; navbar.style.boxShadow = '0 2px 10px rgba(0,0,0,0.1)'; } }); });