/**
 * WTE Business Card — Smooth Scroll
 */
'use strict';
document.addEventListener('DOMContentLoaded', function() {
	document.querySelectorAll('a[href^="#"]').forEach(function(anchor) {
		anchor.addEventListener('click', function(e) {
			const targetId = this.getAttribute('href');
			if (!targetId || targetId === '#') return;
			const target = document.querySelector(targetId);
			if (!target) return;
			e.preventDefault();
			const headerH = parseInt(getComputedStyle(document.documentElement).getPropertyValue('--wte-header-height')) || 72;
			const top = target.getBoundingClientRect().top + window.scrollY - headerH;
			window.scrollTo({ top: top, behavior: 'smooth' });
		});
	});
});
