/* === Base & Typography === */
html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    overflow-x: hidden;
}

::selection {
    background-color: rgba(240, 90, 40, 0.15);
    color: #1a1b1f;
}

/* === Navbar === */
.nav-logo-text {
    transition: color 0.3s ease;
}

#navbar.scrolled .nav-logo-text {
    color: #1a1b1f;
}

.nav-link {
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: #F05A28;
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

/* === Mobile Menu === */
#mobile-menu.open {
    opacity: 1 !important;
    pointer-events: all !important;
}

#mobile-menu.open .mobile-nav-link {
    animation: fadeSlideDown 0.4s ease forwards;
}

#mobile-menu.open .mobile-nav-link:nth-child(1) { animation-delay: 0.05s; }
#mobile-menu.open .mobile-nav-link:nth-child(2) { animation-delay: 0.1s; }
#mobile-menu.open .mobile-nav-link:nth-child(3) { animation-delay: 0.15s; }
#mobile-menu.open .mobile-nav-link:nth-child(4) { animation-delay: 0.2s; }

@keyframes fadeSlideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* === Scroll Reveal === */
.reveal {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1), transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .reveal {
        opacity: 1;
        transform: none;
        transition: none;
    }
    html {
        scroll-behavior: auto;
    }
    * {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

/* === Smooth image loading === */
img {
    opacity: 1;
    transition: opacity 0.3s ease;
}

/* === Focus styles === */
a:focus-visible,
button:focus-visible {
    outline: 2px solid #F05A28;
    outline-offset: 2px;
    border-radius: 4px;
}

/* === Custom scrollbar === */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #F6F6F7;
}
::-webkit-scrollbar-thumb {
    background: #C4C6CB;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #9FA2AB;
}

/* === Mobile menu button animation === */
#menu-icon span:nth-child(1) {
    transform-origin: center;
}
#menu-icon span:nth-child(2) {
    transform-origin: center;
}
#menu-icon span:nth-child(3) {
    transform-origin: center;
}

body.menu-open #menu-icon span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}
body.menu-open #menu-icon span:nth-child(2) {
    opacity: 0;
    width: 0;
}
body.menu-open #menu-icon span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
    width: 24px;
}
