/* Base styles */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    overflow-x: hidden;
}

/* Scroll reveal animations - progressive enhancement only */
.js-active .reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.js-active .reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered delays for grid items */
.js-active .reveal:nth-child(1) { transition-delay: 0.05s; }
.js-active .reveal:nth-child(2) { transition-delay: 0.1s; }
.js-active .reveal:nth-child(3) { transition-delay: 0.15s; }
.js-active .reveal:nth-child(4) { transition-delay: 0.2s; }
.js-active .reveal:nth-child(5) { transition-delay: 0.25s; }
.js-active .reveal:nth-child(6) { transition-delay: 0.3s; }

/* Navbar scroll state */
#navbar.scrolled {
    background: rgba(10, 22, 40, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.05);
}

#navbar.scrolled #menu-icon-open,
#navbar.scrolled #menu-icon-close {
    /* icons always visible */
}

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

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

::-webkit-scrollbar-track {
    background: #0a1628;
}

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

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

/* Selection color */
::selection {
    background: rgba(201, 168, 76, 0.3);
    color: #fff;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
    .reveal {
        opacity: 1;
        transform: none;
        transition: none;
    }
    .group img {
        transition: none;
    }
}

/* Image placeholder fallback */
img {
    image-rendering: auto;
}
