/* ===== Base & Utilities ===== */
*, *::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;
}

/* ===== Scroll Reveal ===== */
.scroll-reveal {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

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

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

/* ===== Navbar Scroll State ===== */
nav.scrolled {
    background: rgba(250, 247, 242, 0.95) !important;
    backdrop-filter: blur(12px);
    box-shadow: 0 1px 20px rgba(0, 0, 0, 0.08);
}

nav.scrolled .menu-line {
    background: #a53220 !important;
}

/* ===== Mobile Menu Animation ===== */
#mobileMenu.open {
    animation: slideDown 0.3s ease forwards;
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
    }
    to {
        opacity: 1;
        max-height: 400px;
    }
}

#mobileMenu.closing {
    animation: slideUp 0.25s ease forwards;
}

@keyframes slideUp {
    from {
        opacity: 1;
        max-height: 400px;
    }
    to {
        opacity: 0;
        max-height: 0;
    }
}

/* ===== Mobile Menu Button Active ===== */
#menuBtn.active .menu-line:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

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

#menuBtn.active .menu-line:nth-child(3) {
    width: 20px;
    transform: rotate(-45deg) translate(5px, -5px);
    margin-left: 0;
}

/* ===== Mobile Links ===== */
.mobile-link {
    display: block;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.mobile-link:last-child {
    border-bottom: none;
}

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

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

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

::-webkit-scrollbar-thumb:hover {
    background: #c44025;
}

/* ===== Selection ===== */
::selection {
    background: #f3bdae;
    color: #6d231a;
}

/* ===== Focus Visible ===== */
:focus-visible {
    outline: 2px solid #e56b52;
    outline-offset: 2px;
}

/* ===== Image Placeholder Fallback ===== */
img {
    background: linear-gradient(135deg, #f3e8d0 0%, #f9ddd3 100%);
}

/* ===== Smooth Image Loading ===== */
img {
    transition: opacity 0.3s ease;
}

img[loading="lazy"] {
    opacity: 0;
}

img.loaded {
    opacity: 1;
}

/* ===== Print Styles ===== */
@media print {
    nav, #contactForm, .scroll-reveal {
        display: none !important;
    }

    body {
        color: #000;
        background: #fff;
    }

    a {
        color: #000;
    }
}
