/* ============================================
   NextHome Sterling Real Estate — Custom Styles
   Premium Dark Luxury Theme
   ============================================ */

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

body {
    overflow-x: hidden;
}

::selection {
    background-color: rgba(200, 149, 108, 0.3);
    color: #FDF9F3;
}

/* --- Custom Scrollbar --- */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #1A1A18;
}
::-webkit-scrollbar-thumb {
    background: #4A4A42;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #C8956C;
}

/* --- Navigation --- */
.nav-link {
    position: relative;
}

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

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

.nav-link:hover {
    color: #E0B088 !important;
}

/* Navbar background on scroll */
nav.scrolled {
    background: rgba(16, 16, 14, 0.95) !important;
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(212, 171, 100, 0.1);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

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

.mobile-link:hover {
    letter-spacing: 0.05em;
}

#mobileMenu.open {
    opacity: 1;
    pointer-events: all;
}

#mobileMenu.close {
    opacity: 0;
    pointer-events: none;
}

/* Hamburger animation */
.menu-line {
    display: block;
    transition: all 0.3s ease;
}

#mobileMenuBtn.active .menu-line:nth-child(1) {
    transform: rotate(45deg) translate(4px, 4px);
}

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

#mobileMenuBtn.active .menu-line:nth-child(3) {
    width: 24px;
    transform: rotate(-45deg) translate(4px, -4px);
}

/* --- Hero Animations --- */
.hero-eyebrow {
    animation: slideUp 0.8s ease forwards;
    animation-delay: 0.2s;
    opacity: 0;
}

.hero-headline {
    animation: slideUp 0.8s ease forwards;
    animation-delay: 0.4s;
    opacity: 0;
}

.hero-subtext {
    animation: slideUp 0.8s ease forwards;
    animation-delay: 0.6s;
    opacity: 0;
}

.hero-image {
    animation: fadeInRight 1s ease forwards;
    animation-delay: 0.8s;
    opacity: 0;
}

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

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(40px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Scroll indicator */
.scroll-line {
    animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse {
    0%, 100% { opacity: 0.3; height: 12px; }
    50% { opacity: 1; height: 20px; }
}

/* --- Buttons --- */
.cta-primary {
    display: inline-flex;
    align-items: center;
    padding: 16px 32px;
    background: linear-gradient(135deg, #B87A52, #C8956C);
    color: #FDF9F3;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    text-decoration: none;
    border: 1px solid #C8956C;
    border-radius: 2px;
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
}

.cta-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #C8956C, #E0B088);
    transition: left 0.4s ease;
    z-index: -1;
}

.cta-primary:hover::before {
    left: 0;
}

.cta-primary:hover {
    border-color: #E0B088;
    box-shadow: 0 8px 30px rgba(200, 149, 108, 0.3);
    transform: translateY(-2px);
}

.cta-secondary {
    display: inline-flex;
    align-items: center;
    padding: 16px 32px;
    background: transparent;
    color: #F5E6D8;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    text-decoration: none;
    border: 1px solid rgba(212, 171, 100, 0.3);
    border-radius: 2px;
    transition: all 0.4s ease;
}

.cta-secondary:hover {
    border-color: #C8956C;
    color: #E0B088;
    background: rgba(200, 149, 108, 0.08);
    transform: translateY(-2px);
}

/* --- Section Headers --- */
.section-eyebrow {
    animation: fadeIn 0.6s ease forwards;
}

.section-title {
    animation: fadeIn 0.6s ease forwards;
    animation-delay: 0.1s;
    opacity: 0;
}

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

/* --- Service Cards --- */
.service-card {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.service-card:hover {
    border-color: rgba(200, 149, 108, 0.4) !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

/* --- Neighborhood Cards --- */
.neighborhood-card {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.neighborhood-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.4);
}

.neighborhood-card:hover .absolute {
    /* Ensure overlay stays */
}

/* --- Testimonial Cards --- */
.testimonial-card {
    transition: all 0.4s ease;
}

.testimonial-card:hover {
    border-color: rgba(200, 149, 108, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
}

/* --- Form Inputs --- */
input:focus,
select:focus,
textarea:focus {
    background: rgba(42, 42, 36, 0.6);
}

select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23A8A8A0' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
}

/* --- Scroll Reveal Animations --- */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 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; }
.reveal-delay-4 { transition-delay: 0.4s; }
.reveal-delay-5 { transition-delay: 0.5s; }
.reveal-delay-6 { transition-delay: 0.6s; }

/* --- Gold Divider --- */
.gold-divider {
    width: 60px;
    height: 2px;
    background: linear-gradient(90deg, #C8956C, #E0B088);
    margin: 0 auto;
}

/* --- About Images --- */
.about-images {
    animation: fadeIn 1s ease forwards;
}

.about-text {
    animation: slideUp 0.8s ease forwards;
    opacity: 0;
    animation-delay: 0.2s;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .hero-headline {
        font-size: 2.5rem !important;
    }

    .section-title {
        font-size: 2.25rem !important;
    }

    .cta-primary,
    .cta-secondary {
        padding: 14px 24px;
        font-size: 0.8rem;
    }
}

@media (max-width: 640px) {
    .hero-headline {
        font-size: 2rem !important;
    }

    .section-title {
        font-size: 1.75rem !important;
    }
}

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