/* Base styles and custom overrides */
html {
    scroll-behavior: smooth;
}

body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #1a1a1a;
}
::-webkit-scrollbar-thumb {
    background: #3a3a3a;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #FF6B4A;
}

/* Selection color */
::selection {
    background: rgba(255, 107, 74, 0.3);
    color: #ffffff;
}

/* Navbar scroll behavior */
.nav-scrolled {
    background: rgba(15, 15, 15, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(58, 58, 58, 0.5);
}

.nav-not-scrolled {
    background: transparent;
    border-bottom: 1px solid transparent;
}

/* Reveal animations - progressive enhancement */
.reveal {
    opacity: 1;
    transform: none;
    transition: none;
}

.js-enabled .reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.js-enabled .reveal.revealed {
    opacity: 1;
    transform: none;
}

/* Staggered delays for grid items */
.js-enabled .reveal:nth-child(1) { transition-delay: 0ms; }
.js-enabled .reveal:nth-child(2) { transition-delay: 80ms; }
.js-enabled .reveal:nth-child(3) { transition-delay: 160ms; }
.js-enabled .reveal:nth-child(4) { transition-delay: 240ms; }
.js-enabled .reveal:nth-child(5) { transition-delay: 320ms; }
.js-enabled .reveal:nth-child(6) { transition-delay: 400ms; }

/* Mobile menu transition */
#mobileMenu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

#mobileMenu.open {
    max-height: 400px;
}

/* Select dropdown styling */
select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236a6a6a' 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 12px center;
    background-size: 16px;
    padding-right: 40px;
}

select:focus {
    outline: none;
    border-color: #FF6B4A;
    box-shadow: 0 0 0 1px #FF6B4A;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
    .reveal,
    .js-enabled .reveal {
        opacity: 1;
        transform: none;
        transition: none;
    }
    #mobileMenu {
        transition: none;
    }
}

/* Tablet and desktop adjustments */
@media (min-width: 768px) {
    .font-serif {
        text-wrap: pretty;
    }
}

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

/* Image loading */
img {
    max-width: 100%;
    height: auto;
}
