/* ========== CUSTOM STYLES ========== */

/* Base */
html {
    scroll-behavior: smooth;
}

body {
    overflow-x: hidden;
}

/* Selection */
::selection {
    background: #E8735A;
    color: #fff;
}

/* ========== ANIMATIONS ========== */

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-up {
    animation-name: fadeUp;
    animation-duration: 0.8s;
    animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes scrollLine {
    0% {
        opacity: 0;
        transform: scaleY(0);
        transform-origin: top;
    }
    50% {
        opacity: 1;
        transform: scaleY(1);
        transform-origin: top;
    }
    51% {
        transform-origin: bottom;
    }
    100% {
        opacity: 0;
        transform: scaleY(0);
        transform-origin: bottom;
    }
}

.animate-scroll-line {
    animation: scrollLine 1.8s ease-in-out infinite;
}

/* ========== SCROLL REVEAL ========== */

.reveal {
    opacity: 0;
    transform: translateY(40px);
    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-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }

/* ========== NAVBAR ========== */

.navbar-scrolled {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06);
}

.navbar-scrolled .font-display {
    color: #1e2027 !important;
}

/* ========== MOBILE MENU ========== */

.mobile-menu-open {
    opacity: 1 !important;
    pointer-events: auto !important;
}

.mobile-link {
    opacity: 0;
    transform: translateY(20px);
    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.1s; }
.mobile-menu-open .mobile-link:nth-child(2) { transition-delay: 0.15s; }
.mobile-menu-open .mobile-link:nth-child(3) { transition-delay: 0.2s; }
.mobile-menu-open .mobile-link:nth-child(4) { transition-delay: 0.25s; }
.mobile-menu-open .mobile-link:nth-child(5) { transition-delay: 0.3s; }

/* Menu icon animation */
.menu-icon-active span:nth-child(1) {
    transform: rotate(45deg) translate(4px, 4px);
}

.menu-icon-active span:nth-child(2) {
    opacity: 0;
}

.menu-icon-active span:nth-child(3) {
    transform: rotate(-45deg) translate(4px, -4px);
}

/* ========== CUSTOM SELECT ========== */

select {
    background-image: url('data:image/svg+xml;charset=UTF-8,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 width=%2212%22 height=%2212%22 viewBox=%220 0 12 12%22%3E%3Cpath d=%22M6 8L1 3h10z%22 fill=%22%239a9fb0%22/%3E%3C/svg%3E');
    background-size: 12px;
    background-repeat: no-repeat;
    background-position: right 1rem center;
    appearance: none;
    -webkit-appearance: none;
}

/* ========== NEIGHBORHOOD CARDS ========== */

.neighborhood-card .neighborhood-overlay {
    transition: opacity 0.5s ease;
}

/* ========== SMOOTH HOVER FOR CARDS ========== */

.service-card {
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s ease;
}

.service-card:hover {
    transform: translateY(-4px);
}

/* ========== FOCUS VISIBLE ========== */

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid #E8735A;
    outline-offset: 2px;
    border-radius: 4px;
}

/* ========== RESPONSIVE ========== */

@media (max-width: 768px) {
    .font-display {
        line-height: 1.15;
    }
}

@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;
    }
}
