/* === Reset & Base === */
*, *::before, *::after {
    box-sizing: border-box;
}

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

body {
    overflow-x: hidden;
}

::selection {
    background: rgba(185, 28, 44, 0.15);
    color: #590e15;
}

/* === Animations === */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.animate-fade-in-up {
    animation: fadeInUp 0.8s ease-out both;
}

.animate-fade-in {
    animation: fadeIn 1s ease-out both;
}

/* === Scroll Reveal === */
.reveal {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.reveal[data-reveal] {
    opacity: 0;
    transform: translateY(40px);
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .reveal[data-reveal] {
        opacity: 1;
        transform: none;
    }
    html {
        scroll-behavior: auto;
    }
    .animate-fade-in-up,
    .animate-fade-in {
        animation: none;
    }
}

/* === Mobile Menu === */
.mobile-link {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.4s ease, transform 0.4s ease, color 0.3s ease;
}

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

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

/* === Menu Button Animation === */
.menu-line {
    display: block;
}

#menuBtn.active .menu-line:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}

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

#menuBtn.active .menu-line:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
    width: 5rem;
}

/* === Navbar Scroll State === */
#navbar.scrolled {
    box-shadow: 0 1px 20px rgba(185, 28, 44, 0.08);
}

/* === Stat Counter Animation === */
.stat-item {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.stat-item.visible {
    opacity: 1;
    transform: translateY(0);
}

.stat-item:nth-child(1) { transition-delay: 0s; }
.stat-item:nth-child(2) { transition-delay: 0.1s; }
.stat-item:nth-child(3) { transition-delay: 0.2s; }
.stat-item:nth-child(4) { transition-delay: 0.3s; }

@media (prefers-reduced-motion: reduce) {
    .stat-item {
        opacity: 1;
        transform: none;
    }
}

/* === Neighborhood Card Hover === */
.group:hover .group-hover\:scale-110 {
    transform: scale(1.1);
}

/* === Button Ripple Effect === */
button, a {
    position: relative;
    overflow: hidden;
}

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

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

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

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

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

/* === Print Styles === */
@media print {
    #navbar, #mobileMenu, .reveal {
        display: none !important;
    }
    body {
        color: #000;
        background: #fff;
    }
}
