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

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

body {
    margin: 0;
    overflow-x: hidden;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: #1A0517;
}
::-webkit-scrollbar-thumb {
    background: #4A1942;
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: #5D2E5E;
}

/* Selection */
::selection {
    background: rgba(212, 160, 23, 0.3);
    color: #F5F0F7;
}

/* Focus */
:focus-visible {
    outline: 1px solid rgba(212, 160, 23, 0.5);
    outline-offset: 2px;
}

/* Smooth reveal for above-the-fold content */
#hero, #about, #experience, #visit, #contact {
    opacity: 1;
}

/* Scroll Reveal Animations */
.reveal {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94), transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Nav active state */
.nav-link.active {
    color: #F2C94C;
}

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

/* Subtle grain overlay option */
.grain::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    opacity: 0.03;
    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");
    z-index: 9999;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    html {
        scroll-behavior: auto;
    }
}

/* Mobile menu transitions */
#mobile-menu {
    transition: max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
    opacity: 1;
}

#mobile-menu.collapsed {
    max-height: 0;
    opacity: 0;
}

#mobile-menu.expanded {
    max-height: 300px;
    opacity: 1;
}
