html {
    scroll-behavior: smooth;
    overflow-x: hidden; /* Prevents horizontal scrolling at the root level */
}
body {
    font-family: 'Kantumruy Pro', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
/* Custom scrollbar for a modern look */
::-webkit-scrollbar { 
    width: 8px; 
}
::-webkit-scrollbar-track { 
    background: #111827; 
}
::-webkit-scrollbar-thumb { 
    background: #4b5563; 
    border-radius: 10px; 
}
::-webkit-scrollbar-thumb:hover { 
    background: #6b7280; 
}

/* --- ANIMATION STYLES --- */
/* Base state for all animated elements */
.animate-on-scroll {
    opacity: 0;
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
    will-change: opacity, transform; /* Performance optimization */
}

/* Specific animation starting positions */
.animate-from-bottom {
    transform: translateY(40px);
}
.animate-from-left {
    transform: translateX(-40px);
}
.animate-from-right {
    transform: translateX(40px);
}

/* The state when the element becomes visible */
.animate-on-scroll.visible {
    opacity: 1;
    transform: translate(0, 0);
}

/* Staggered items inherit the base animation style */
.stagger-item {
   opacity: 0;
   transform: translateY(30px);
   transition: opacity 0.6s ease-out, transform 0.6s ease-out;
   will-change: opacity, transform; /* Performance optimization */
}
.stagger-item.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Mobile Menu Transition - Updated for smoother slide-down */
#mobileMenu {
    transform: translateY(-110%); /* Start off-screen */
    transition: transform 0.4s ease-in-out, opacity 0.4s ease-in-out;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}
#mobileMenu.menu-open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}


/* Back to top button visibility */
#toTopBtn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: opacity 0.4s ease-out, visibility 0.4s ease-out, transform 0.4s ease-out;
}

#toTopBtn.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
