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

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

body {
    overflow-x: hidden;
}

/* Selection */
::selection {
    background-color: rgba(255, 107, 63, 0.2);
    color: #1f2328;
}

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

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

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

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

/* Reveal Animations - Progressive Enhancement */
@media (prefers-reduced-motion: no-preference) {
    .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);
    }
    
    .reveal.revealed {
        opacity: 1;
        transform: translateY(0);
    }
    
    .reveal:nth-child(2) { transition-delay: 0.1s; }
    .reveal:nth-child(3) { transition-delay: 0.2s; }
    .reveal:nth-child(4) { transition-delay: 0.3s; }
    .reveal:nth-child(5) { transition-delay: 0.4s; }
    .reveal:nth-child(6) { transition-delay: 0.5s; }
}

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

/* Navbar Scroll State */
#navbar.scrolled {
    background-color: rgba(255, 245, 242, 0.95);
    backdrop-filter: blur(20px);
    box-shadow: 0 1px 0 rgba(31, 35, 40, 0.08);
}

#navbar.scrolled .font-serif {
    color: #1f2328;
}

#navbar.scrolled a:not(.bg-) {
    color: #52575e;
}

#navbar.scrolled a:not(.bg-):hover {
    color: #ff6b3f;
}

/* Mobile Menu Transitions */
#mobileMenu.open {
    opacity: 1;
    pointer-events: all;
}

#mobileMenu.closed {
    opacity: 0;
    pointer-events: none;
}

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

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

/* Button Hover Effects */
button, a {
    -webkit-tap-highlight-color: transparent;
}

/* Prevent layout shift on images */
img {
    max-width: 100%;
    height: auto;
}

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

@keyframes pulse-soft {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Print Styles */
@media print {
    #navbar,
    #mobileMenu,
    .reveal {
        display: none !important;
    }
    
    body {
        color: #000;
        background: #fff;
    }
}
