/* ── Reset & Base ───────────────────────────────── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    overflow-x: hidden;
}

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

::selection {
    background-color: #7a1a2e;
    color: #fefcfb;
}

/* ── Scroll Reveal (progressive enhancement) ────── */
@media (prefers-reduced-motion: no-preference) {
    .reveal-up {
        opacity: 0;
        transform: translateY(32px);
        transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    }

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

    .reveal-scale {
        opacity: 0;
        transform: scale(0.96);
        transition: opacity 1s cubic-bezier(0.16, 1, 0.3, 1), transform 1s cubic-bezier(0.16, 1, 0.3, 1);
    }

    .reveal-scale.revealed {
        opacity: 1;
        transform: scale(1);
    }
}

/* Fallback: ensure content is visible if JS is disabled */
@media not all and (prefers-reduced-motion: no-preference) {
    .reveal-up,
    .reveal-scale {
        opacity: 1;
        transform: none;
    }
}

/* ── Navbar ─────────────────────────────────────── */
#navbar {
    background: rgba(254, 252, 251, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(61, 52, 45, 0.06);
}

#navbar.scrolled {
    box-shadow: 0 1px 20px rgba(61, 52, 45, 0.08);
}

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

.mobile-link {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.4s ease, transform 0.4s ease, color 0.3s ease;
}

#mobile-menu.open .mobile-link {
    opacity: 1;
    transform: translateY(0);
}

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

/* ── Menu Toggle Animation ──────────────────────── */
.menu-line {
    display: block;
}

#menu-toggle.active .menu-line:nth-child(1) {
    transform: rotate(45deg) translate(4px, 4px);
}

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

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

/* ── Smooth Image Loading ───────────────────────── */
img {
    background-color: #ece2d8;
}

/* ── Subtle Hover Effects ───────────────────────── */
a {
    text-decoration: none;
}

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

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

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

::-webkit-scrollbar-thumb:hover {
    background: #7a1a2e;
}

/* ── Focus Styles ───────────────────────────────── */
a:focus-visible,
button:focus-visible {
    outline: 2px solid #7a1a2e;
    outline-offset: 4px;
    border-radius: 2px;
}

/* ── Form Styles ────────────────────────────────── */
input:focus,
textarea:focus {
    outline: none;
    border-color: #7a1a2e;
    box-shadow: 0 0 0 3px rgba(122, 26, 46, 0.1);
}

/* ── Loading State for Images ───────────────────── */
img[loading="lazy"] {
    opacity: 0;
    transition: opacity 0.4s ease;
}

img[loading="lazy"].loaded {
    opacity: 1;
}
