/* ==================== 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;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

::selection {
    background: #83142e;
    color: #FDF6F0;
}

/* ==================== NAVBAR ==================== */
#navbar {
    background: transparent;
    transition: background 0.4s ease, box-shadow 0.4s ease, padding 0.4s ease;
}

#navbar.scrolled {
    background: rgba(253, 246, 240, 0.97);
    backdrop-filter: blur(12px);
    box-shadow: 0 1px 20px rgba(61, 19, 45, 0.08);
}

#navbar .nav-link {
    color: rgba(253, 246, 240, 0.85);
    transition: color 0.3s ease;
}

#navbar.scrolled .nav-link {
    color: #3D2B1F;
}

#navbar .nav-link:hover {
    color: #ffc3cc;
}

#navbar.scrolled .nav-link:hover {
    color: #83142e;
}

#navbar .nav-logo-text {
    color: #FDF6F0;
    transition: color 0.3s ease;
}

#navbar.scrolled .nav-logo-text {
    color: #6E132C;
}

#navbar .nav-tree-text {
    fill: #FDF6F0;
    transition: fill 0.3s ease;
}

#navbar.scrolled .nav-tree-text {
    fill: #83142e;
}

#navbar .nav-bar {
    background: #FDF6F0;
    transition: background 0.3s ease;
}

#navbar.scrolled .nav-bar {
    background: #3D2B1F;
}

#navbar .mobile-nav-link {
    color: #6E132C;
}

/* ==================== SCROLL REVEAL (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-delay-1 { transition-delay: 0.1s; }
    .reveal-delay-2 { transition-delay: 0.2s; }
    .reveal-delay-3 { transition-delay: 0.3s; }
    .reveal-delay-4 { transition-delay: 0.4s; }
}

/* ==================== MOBILE MENU ==================== */
#mobile-menu {
    pointer-events: none;
}

#mobile-menu.open {
    pointer-events: auto;
    transform: translateX(0);
}

/* ==================== BUTTON HOVER EFFECTS ==================== */
a {
    text-decoration: none;
}

/* ==================== CUSTOM SCROLLBAR ==================== */
::-webkit-scrollbar {
    width: 8px;
}

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

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

::-webkit-scrollbar-thumb:hover {
    background: #83142e;
}

/* ==================== FOCUS STYLES ==================== */
a:focus-visible,
button:focus-visible {
    outline: 2px solid #83142e;
    outline-offset: 3px;
    border-radius: 4px;
}

/* ==================== IMAGE LOADING ==================== */
img {
    background-color: #F5EDE4;
}

/* ==================== ACCESSIBILITY ==================== */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* ==================== 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;
    }
}
