

html {
    scroll-behavior: smooth;
    overflow-x: clip; 
}

#about,
#contact {
    scroll-margin-top: 70px;
}

.hamburger {
    display: none;
}

nav li a {
    text-underline-offset: 6px;
    transition: color 0.3s ease, text-underline-offset 0.3s ease;
}

nav li a:focus-visible,
.hamburger:focus-visible {
    outline: 2px solid #F4EBDD;
    outline-offset: 2px;
}



@media (max-width: 1024px) {

    nav {
        top: 0;
        left: 0;
        height: 80px;
        padding: 0 28px;
    }

    nav .logo {
        width: 100px;
    }

    nav .icons {
        display: none;
    }

    .hamburger {
        display: block;
        position: relative;
        z-index: 2;
        width: 44px;
        height: 44px;
        margin-right: -9px;
        padding: 0;
        border: 0;
        background: none;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }

    .hamburger span {
        position: absolute;
        left: 9px;
        width: 26px;
        height: 2px;
        border-radius: 2px;
        background-color: #fff;
        transition: transform 0.35s ease, opacity 0.2s ease;
    }

    .hamburger span:nth-child(1) { top: 13px; }
    .hamburger span:nth-child(2) { top: 21px; }
    .hamburger span:nth-child(3) { top: 29px; }

    .menu-open .hamburger span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
    .menu-open .hamburger span:nth-child(2) { opacity: 0; }
    .menu-open .hamburger span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

    nav .nav-links {
        position: fixed;
        z-index: 1;
        top: 0;
        right: 0;
        width: 100%;
        height: 100vh;
        height: 100dvh;
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        padding: 110px 28px 40px;
        overflow-y: auto;
        overscroll-behavior: contain;
        background-color: #29442F;
        transform: translateX(100%);
        visibility: hidden;
        transition: transform 0.45s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s 0.45s;
    }

    .menu-open nav .nav-links {
        transform: translateX(0);
        visibility: visible;
        transition: transform 0.45s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s;
    }

   
    .nav-links li:nth-child(1) { order: 1; }
    .nav-links li:nth-child(4) { order: 2; }
    .nav-links li:nth-child(2) { order: 3; }
    .nav-links li:nth-child(3) { order: 4; }

    nav .nav-links li a {
        width: auto;
        height: auto;
        padding: 10px 0;
        justify-content: flex-start;
        font-size: 24px;
        letter-spacing: 1.5px;
        text-decoration: none;
    }

    nav .nav-links li a:active {
        color: #D9743F;
        font-weight: 500;
    }

    html.menu-open,
    .menu-open body {
        overflow: hidden;
    }

    .menu-open .nav-links {
        touch-action: pan-y;
    }
}

@media (max-width: 1024px) and (hover: hover) {
    nav .nav-links li a:hover {
        color: #D9743F;
    }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    nav .nav-links,
    .hamburger span { transition: none !important; }
}
