/* Base & Utilities */
*, *::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 Animations */
.reveal {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal[data-delay="1"] { transition-delay: 0.1s; }
.reveal[data-delay="2"] { transition-delay: 0.2s; }
.reveal[data-delay="3"] { transition-delay: 0.3s; }
.reveal[data-delay="4"] { transition-delay: 0.4s; }

/* When JS is disabled or reduced motion preferred, content is always visible */
html.no-js .reveal,
.reveal.force-visible {
    opacity: 1;
    transform: none;
}

/* Scroll reveal active state - applied by JS */
html.animate-scroll-reveals .reveal {
    opacity: 0;
    transform: translateY(30px);
}

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

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    html, .reveal {
        transition: none !important;
        animation: none !important;
    }
    html.animate-scroll-reveals .reveal {
        opacity: 1;
        transform: none;
    }
    html.animate-scroll-reveals .reveal.revealed {
        opacity: 1;
        transform: none;
    }
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Navbar scroll state */
#navbar.scrolled {
    background: rgba(4, 10, 5, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(196, 146, 46, 0.1);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

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

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

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

/* Gold accent line animation */
@keyframes shimmer {
    0% { background-position: -200% center; }
    100% { background-position: 200% center; }
}

.gold-shimmer {
    background: linear-gradient(90deg, #c4922e, #e8c87a, #c4922e);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmer 4s linear infinite;
}

/* Subtle grain overlay for premium texture */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    opacity: 0.025;
    z-index: 9999;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 256px 256px;
}

/* Selection color */
::selection {
    background: rgba(196, 146, 46, 0.3);
    color: #f0f5ee;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #040a05;
}
::-webkit-scrollbar-thumb {
    background: #2d5f23;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #3d7a30;
}

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

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

img[data-src] {
    opacity: 0;
}

/* Aspect ratio helpers */
.aspect-portrait {
    aspect-ratio: 4/5;
}

/* Print styles */
@media print {
    nav, #mobileMenu, .reveal { display: none; }
    body { background: white; color: black; }
}
