:root {
    --emerald-950: #022c22;
    --emerald-900: #064e3b;
    --emerald-800: #065f46;
    --emerald-700: #047857;
    --emerald-600: #059669;
    --emerald-300: #6ee7b7;
    --emerald-200: #a7f3d0;
    --emerald-100: #d1fae5;
    --cream-50: #fefdf8;
    --cream-100: #fdf8ed;
    --cream-200: #faedd2;
    --cream-300: #f5dbb0;
    --cream-400: #edc48a;
    --cream-500: #e0a960;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

body {
    overflow-x: hidden;
}

/* Navbar scroll state */
#navbar.scrolled {
    background-color: rgba(2, 44, 34, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 1px 0 rgba(212, 165, 116, 0.1);
}

.nav-link {
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 1px;
    transition: width 0.3s ease;
    background-color: var(--cream-400);
}

.nav-link:hover::after {
    width: 100%;
}

/* Mobile menu */
#mobile-menu.active {
    opacity: 1;
    pointer-events: all;
    transform: scale(1);
}

#mobile-menu.active #bar1 {
    transform: rotate(45deg) translate(4px, 4px);
}

#mobile-menu.active #bar2 {
    opacity: 0;
}

#mobile-menu.active #bar3 {
    transform: rotate(-45deg) translate(4px, -4px);
    width: 24px;
}

.mobile-link {
    position: relative;
}

.mobile-link::after {
    content: '';
    display: block;
    width: 0;
    height: 1px;
    margin: 4px auto 0;
    transition: width 0.3s ease;
    background-color: var(--cream-400);
}

.mobile-link:hover::after {
    width: 100%;
}

/* Reveal animations */
.reveal {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

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

@media (prefers-reduced-motion: no-preference) {
    .reveal {
        opacity: 0;
        transform: translateY(30px);
        transition: opacity 0.8s ease, transform 0.8s ease;
    }
    
    .reveal.revealed {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Subtle grain texture overlay on hero */
#hero::before {
    content: '';
    position: absolute;
    inset: 0;
    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");
    pointer-events: none;
    z-index: 1;
}

#hero > * {
    position: relative;
    z-index: 2;
}

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

/* Selection color */
::selection {
    background-color: var(--cream-400);
    color: var(--emerald-950);
}

/* Focus styles */
a:focus-visible,
button:focus-visible {
    outline: 2px solid var(--cream-400);
    outline-offset: 4px;
    border-radius: 2px;
}

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

::-webkit-scrollbar-track {
    background: var(--emerald-950);
}

::-webkit-scrollbar-thumb {
    background: var(--emerald-700);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--emerald-600);
}
