/* ========== BASE & RESET ========== */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

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

/* ========== NAVBAR ========== */
#navbar {
    background: transparent;
}

#navbar.scrolled {
    background: rgba(45, 17, 31, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 1px 20px rgba(0, 0, 0, 0.3);
}

/* ========== MOBILE MENU ========== */
#mobileMenu.open {
    opacity: 1;
    pointer-events: all;
}

#mobileMenu.open .mobile-link {
    animation: fadeInUp 0.4s ease forwards;
    opacity: 1;
}

#mobileMenu.open .mobile-link:nth-child(1) { animation-delay: 0.05s; }
#mobileMenu.open .mobile-link:nth-child(2) { animation-delay: 0.1s; }
#mobileMenu.open .mobile-link:nth-child(3) { animation-delay: 0.15s; }
#mobileMenu.open .mobile-link:nth-child(4) { animation-delay: 0.2s; }
#mobileMenu.open .mobile-link:nth-child(5) { animation-delay: 0.25s; }

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Menu button animations */
.menu-btn-active .menu-line:nth-child(1) {
    transform: rotate(45deg) translate(4px, 4px);
}

.menu-btn-active .menu-line:nth-child(2) {
    opacity: 0;
}

.menu-btn-active .menu-line:nth-child(3) {
    width: 1.5rem;
    transform: rotate(-45deg) translate(4px, -4px);
}

/* ========== REVEAL ANIMATIONS ========== */
/* Default state: visible (progressive enhancement — works without JS) */
.reveal-up,
.reveal-left,
.reveal-right {
    opacity: 1;
    transition: opacity 0.7s ease, transform 0.7s ease;
}

/* When JS adds the class, animate into place */
.reveal-up.animated {
    opacity: 1;
    transform: translateY(0);
}

.reveal-left.animated {
    opacity: 1;
    transform: translateX(0);
}

.reveal-right.animated {
    opacity: 1;
    transform: translateX(0);
}

/* Hidden initial state — applied by JS only (progressive enhancement) */
@media (prefers-reduced-motion: no-preference) {
    .reveal-up {
        opacity: 0;
        transform: translateY(30px);
    }
    .reveal-left {
        opacity: 0;
        transform: translateX(-30px);
    }
    .reveal-right {
        opacity: 0;
        transform: translateX(30px);
    }
}

/* ========== FORM FOCUS STYLES ========== */
input:focus,
textarea:focus {
    outline: none;
}

/* ========== SMOOTH IMAGE LOADING ========== */
img {
    image-rendering: auto;
}

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

::-webkit-scrollbar-track {
    background: #2d111f;
}

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

::-webkit-scrollbar-thumb:hover {
    background: #943d68;
}

/* ========== SELECTION ========== */
::selection {
    background: #b3640b;
    color: #faf0f4;
}

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