'use client'; import Link from 'next/link'; import { usePathname } from 'next/navigation'; import { useState, useEffect } from 'react'; const LINKS = [ { href: '/', label: 'Home' }, { href: '/services/music', label: 'AI 음악' }, { href: '/services/blog', label: '블로그 팩' }, { href: '/saju', label: 'AI 사주' }, { href: '/legal/refund', label: '환불정책' }, ]; export default function TopNav() { const pathname = usePathname(); const [open, setOpen] = useState(false); const [scrolled, setScrolled] = useState(false); useEffect(() => { const onScroll = () => setScrolled(window.scrollY > 8); onScroll(); window.addEventListener('scroll', onScroll, { passive: true }); return () => window.removeEventListener('scroll', onScroll); }, []); useEffect(() => { setOpen(false); }, [pathname]); useEffect(() => { if (open) { const prev = document.body.style.overflow; document.body.style.overflow = 'hidden'; return () => { document.body.style.overflow = prev; }; } }, [open]); const isActive = (href: string) => href === '/' ? pathname === '/' : pathname.startsWith(href); return ( <> {/* 모바일 오버레이 */} {open && (