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

::selection {
    background-color: rgba(161, 22, 54, 0.15);
    color: #6e132b;
}

/* ─── Scroll Reveal (progressive enhancement) ─── */
@media (prefers-reduced-motion: no-preference) {
    .reveal {
        opacity: 0;
        transform: translateY(30px);
        transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
                    transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
    }

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

    .reveal:nth-child(2) { transition-delay: 0.1s; }
    .reveal:nth-child(3) { transition-delay: 0.2s; }
    .reveal:nth-child(4) { transition-delay: 0.3s; }
}

/* ─── Navbar scroll state ─── */
#navbar.scrolled {
    background: rgba(254, 253, 251, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 1px 20px rgba(110, 19, 43, 0.08);
}

/* ─── Nav link underline hover ─── */
.nav-link {
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #a11636, #f5a8b8);
    border-radius: 1px;
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

/* ─── Button micro-interactions ─── */
a, button {
    -webkit-tap-highlight-color: transparent;
}

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

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

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

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

/* ─── Mobile menu transitions ─── */
#mobile-menu {
    transition: max-height 0.4s cubic-bezier(0.22, 1, 0.36, 1),
                opacity 0.3s ease;
    opacity: 0;
}

#mobile-menu.open {
    max-height: 400px;
    opacity: 1;
}

/* ─── Image hover zoom container ─── */
.group img {
    will-change: transform;
}

/* ─── Focus styles ─── */
:focus-visible {
    outline: 2px solid #a11636;
    outline-offset: 2px;
    border-radius: 4px;
}

/* ─── Subtle gradient text support ─── */
.text-gradient {
    background: linear-gradient(135deg, #a11636, #f5a8b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ─── Loading animation for images ─── */
img {
    background: linear-gradient(135deg, #fce7eb 0%, #fdf2f4 100%);
}

/* ─── Form input focus glow ─── */
input:focus,
textarea:focus {
    box-shadow: 0 0 0 4px rgba(161, 22, 54, 0.08);
}

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

    .reveal {
        opacity: 1;
        transform: none;
    }
}
