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

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

body {
    background-color: #0d1009;
    color: #f5f3ee;
}

::selection {
    background-color: rgba(212, 168, 75, 0.3);
    color: #faf9f6;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #0d1009;
}
::-webkit-scrollbar-thumb {
    background: #28411e;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #3d662d;
}

/* Reveal animations - progressive enhancement, only with JS */
@media (prefers-reduced-motion: no-preference) {
    .reveal {
        opacity: 0;
        transform: translateY(24px);
        transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
    }
    .reveal.revealed {
        opacity: 1;
        transform: translateY(0);
    }
    .reveal:nth-child(2) { transition-delay: 0.08s; }
    .reveal:nth-child(3) { transition-delay: 0.16s; }
    .reveal:nth-child(4) { transition-delay: 0.24s; }
    .reveal:nth-child(5) { transition-delay: 0.32s; }
}

/* Fallback: ensure content is visible without JS */
.no-js .reveal,
.js:not(body) .reveal {
    opacity: 1;
    transform: none;
}

/* Navbar scroll state */
.navbar-scrolled {
    background-color: rgba(13, 16, 9, 0.95) !important;
    box-shadow: 0 1px 0 rgba(45, 65, 28, 0.3);
}

/* Mobile menu transitions */
#mobile-menu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
#mobile-menu.open {
    max-height: 400px;
}

/* Select styling */
select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23d9d4c9' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

/* Focus visible */
:focus-visible {
    outline: 2px solid rgba(212, 168, 75, 0.6);
    outline-offset: 2px;
}

/* Smooth image loading */
img {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}
