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

::selection {
    background-color: #7B2D3B;
    color: #FDF9F5;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #FDF9F5;
}
::-webkit-scrollbar-thumb {
    background: #b92f52;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #7B2D3B;
}

/* Navigation transitions */
.nav-text {
    transition: color 0.3s ease;
}
.nav-subtext {
    transition: color 0.3s ease;
}

/* Dark navbar states */
.navbar-dark .nav-text {
    color: #FDF9F5;
}
.navbar-dark .nav-subtext {
    color: #f9cfd8;
}
.navbar-dark .menu-line {
    background-color: #FDF9F5;
}
.navbar-dark .mobile-link {
    color: #FDF9F5;
}
.navbar-dark .mobile-link:hover {
    color: #f9cfd8;
}

/* Scroll Reveal Animations */
.reveal-up,
.reveal-left,
.reveal-right {
    opacity: 1;
    transform: none;
    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-up {
    transform: translateY(0);
}
.reveal-left {
    transform: translateX(0);
}
.reveal-right {
    transform: translateX(0);
}

/* Only apply hidden state when JS is enabled and prefers-reduced-motion is not set */
@media (prefers-reduced-motion: no-preference) {
    .reveal-up.hidden-reveal {
        opacity: 0;
        transform: translateY(40px);
    }
    .reveal-left.hidden-reveal {
        opacity: 0;
        transform: translateX(-40px);
    }
    .reveal-right.hidden-reveal {
        opacity: 0;
        transform: translateX(40px);
    }
}

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

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

/* Menu line animation */
.menu-line.active-1 {
    transform: rotate(45deg) translate(3px, 3px);
}
.menu-line.active-2 {
    opacity: 0;
}
.menu-line.active-3 {
    width: 24px;
    transform: rotate(-45deg) translate(3px, -3px);
}

/* Focus styles */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid #7B2D3B;
    outline-offset: 2px;
}

/* Image loading placeholder */
img {
    background-color: #f5e8d8;
}

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