$(document).ready(function() {
    $('.scrolled').on('click', function(e) {
        $('.scrolled').removeClass('actived');
        var targetId = $(this).attr('href');
        $(this).addClass('actived');
        var offsetTop = $(targetId).offset().top - 80;
        $('html, body').animate({
            scrollTop: offsetTop
        }, 700); // Adjust scroll speed here (ms)
    });
    $('.contact01').on('click', function(e) {
        var targetId = $(this).attr('href');
        var offsetTop = $(targetId).offset().top - 80;
        $('html, body').animate({
            scrollTop: offsetTop
        }, 700); // Adjust scroll speed here (ms)
    });
    $('.contact02').on('click', function(e) {
        var targetId = $(this).attr('href');
        var offsetTop = $(targetId).offset().top - 80;
        $('html, body').animate({
            scrollTop: offsetTop
        }, 700); // Adjust scroll speed here (ms)
    });
});