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

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

body {
    min-height: 100vh;
    overflow-x: hidden;
}

::selection {
    background: rgba(26, 58, 42, 0.2);
    color: inherit;
}

/* ── Scroll Reveal (Progressive Enhancement) ── */
@media (prefers-reduced-motion: no-preference) {
    .reveal {
        opacity: 0;
        transform: translateY(24px);
        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.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; }
}

/* Always visible fallback for reduced motion */
@media (prefers-reduced-motion: reduce) {
    .reveal {
        opacity: 1;
        transform: none;
    }
}

/* ── Navbar ── */
#navbar {
    background: transparent;
    border-bottom: 1px solid transparent;
}

#navbar.scrolled {
    background: rgba(250, 248, 244, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom-color: rgba(26, 58, 42, 0.08);
    box-shadow: 0 1px 0 rgba(26, 58, 42, 0.05);
}

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

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

.mobile-link {
    position: relative;
}

.mobile-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background: currentColor;
    transition: width 0.3s ease;
}

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

/* ── Menu Button Animation ── */
.menu-btn.active .menu-line:first-child {
    transform: rotate(45deg) translate(3px, 3px);
}

.menu-btn.active .menu-line:last-child {
    transform: rotate(-45deg) translate(3px, -3px);
}

/* ── Stat Items ── */
.stat-item {
    position: relative;
}

.stat-item::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(to right, transparent, rgba(250, 248, 244, 0.15), transparent);
}

.stat-item:last-child::after {
    display: none;
}

/* ── Smooth Hover on Cards ── */
.group:hover .group-hover\:scale-105 {
    transform: scale(1.05);
}

/* ── Input Autofill Override ── */
input:-webkit-autofill,
textarea:-webkit-autofill {
    -webkit-box-shadow: 0 0 0 30px #faf8f4 inset !important;
    -webkit-text-fill-color: #1a3a2a !important;
    transition: background-color 5000s ease-in-out 0s;
}

/* ── Focus Visible ── */
:focus-visible {
    outline: 1px solid rgba(26, 58, 42, 0.3);
    outline-offset: 2px;
}

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

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

::-webkit-scrollbar-thumb {
    background: #8fb88c;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #4a7a47;
}

/* ── Responsive ── */
@media (max-width: 767px) {
    .font-serif {
        line-height: 1.1;
    }
}

/* ── Print Styles ── */
@media print {
    #navbar, #mobile-menu, .reveal {
        display: none !important;
    }
    
    body {
        background: white !important;
        color: black !important;
    }
}
