*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    overflow-x: hidden;
}

/* Scroll reveal — progressive enhancement, only applies when JS runs */
@media (prefers-reduced-motion: no-preference) {
    .scroll-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);
    }

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

/* Default visible state for scroll-reveal (no JS) */
.scroll-reveal {
    opacity: 1;
    transform: translateY(0);
}

/* Navbar styles */
#navbar {
    transition: background-color 0.4s ease, box-shadow 0.4s ease, padding 0.4s ease;
}

#navbar.scrolled {
    background-color: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(12px);
    box-shadow: 0 1px 20px rgba(0, 0, 0, 0.08);
}

.nav-logo {
    transition: color 0.3s ease;
}

#navbar:not(.scrolled) .nav-logo {
    color: #ffffff;
}

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

.nav-link {
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: #ff6b3f;
    transition: width 0.3s ease;
    border-radius: 1px;
}

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

#navbar:not(.scrolled) .nav-link {
    color: rgba(255, 255, 255, 0.8);
}

#navbar:not(.scrolled) .nav-link:hover {
    color: #ffd2c0;
}

#navbar.scrolled .nav-link {
    color: #4a4d55;
}

/* Mobile menu */
.mobile-link {
    border-radius: 0.75rem;
}

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

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f6f6f7;
}

::-webkit-scrollbar-thumb {
    background: #c4c5ca;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a1a3aa;
}

/* Selection color */
::selection {
    background-color: #ffd2c0;
    color: #1a1b1f;
}

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

/* Animation keyframes */
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes shimmer {
    0% { background-position: -200% center; }
    100% { background-position: 200% center; }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    .group:hover {
        transform: none;
    }

    .group:hover img {
        transform: none;
    }
}
