/* ==========================================
   Homes By Westbay — Custom Styles
   ========================================== */

/* Base & Smooth Scrolling */
html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    overflow-x: hidden;
}

/* Selection Color */
::selection {
    background-color: rgba(45, 90, 45, 0.15);
    color: #1a3a1a;
}

/* Reveal Animations — Progressive Enhancement */
.reveal {
    opacity: 1;
    transform: none;
    transition: opacity 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                transform 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

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

@media (prefers-reduced-motion: no-preference) {
    .reveal {
        opacity: 0;
        transform: translateY(24px);
    }

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

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

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

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

::-webkit-scrollbar-thumb:hover {
    background: #8fc48f;
}

/* Mobile Menu Transitions */
#mobile-menu {
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mobile Link Hover */
.mobile-link {
    position: relative;
}

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

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

/* Navbar Scroll State */
nav.scrolled {
    box-shadow: 0 1px 20px rgba(6, 78, 59, 0.06);
}

/* Button Focus States */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid #4a8a4a;
    outline-offset: 2px;
    border-radius: 0.5rem;
}

/* Form Select Arrow Override */
select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
}

/* Subtle card hover lift */
.group:hover {
    will-change: transform;
}

/* Print Styles */
@media print {
    nav,
    #mobile-menu,
    .reveal,
    button,
    iframe {
        display: none !important;
    }

    body {
        color: #0f240f;
        background: white;
    }

    .bg-forest-800 {
        background: #1a3a1a !important;
        color: white !important;
    }
}

/* Ensure hero content is always visible (no JS gate) */
#top h1,
#top p,
#top a,
#top .relative {
    opacity: 1 !important;
    transform: none !important;
}

/* Reduce motion preference — kill all non-essential animations */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

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