/* ===== Custom Styles for Range Real Estate ===== */

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

html {
    scroll-behavior: smooth;
}

body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

::selection {
    background-color: #fbbf24;
    color: #240f24;
}

/* --- Scroll Reveal (progressive enhancement) --- */
@media (prefers-reduced-motion: no-preference) {
    .reveal {
        opacity: 0;
        transform: translateY(24px);
        transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1), transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
    }

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

/* --- Navbar --- */
.nav {
    background: transparent;
}

.nav.scrolled {
    background: rgba(244, 241, 247, 0.97);
    backdrop-filter: blur(12px);
    box-shadow: 0 1px 0 rgba(83, 40, 83, 0.08);
}

.nav.scrolled .nav-logo-text {
    color: #532853;
}

.nav.scrolled .nav-logo-sub {
    color: #8e528e;
}

.nav.scrolled .nav-link {
    color: #7a3f7a;
}

/* --- Hero --- */
.hero {
    position: relative;
}

.hero-bg {
    will-change: transform;
}

.hero-img {
    transition: transform 8s ease-out;
}

.hero:hover .hero-img {
    transform: scale(1.02);
}

.hero-overlay {
    background: linear-gradient(
        180deg,
        rgba(36, 15, 36, 0.55) 0%,
        rgba(36, 15, 36, 0.45) 40%,
        rgba(36, 15, 36, 0.65) 100%
    );
}

.hero-scroll-line {
    animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse {
    0%, 100% { opacity: 0.3; transform: scaleY(0.6); transform-origin: top; }
    50% { opacity: 1; transform: scaleY(1); }
}

/* --- Section Labels --- */
.section-label {
    display: block;
}

/* --- Service Cards --- */
.service-card-inner {
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.4s ease;
}

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

/* --- Area Cards --- */
.area-card-overlay {
    opacity: 0;
    transition: opacity 0.5s ease;
}

.area-card:hover .area-card-overlay {
    opacity: 1;
}

.area-card-content {
    transform: translateY(8px);
    transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.area-card:hover .area-card-content {
    transform: translateY(0);
}

/* --- Form Inputs --- */
.form-input,
.form-select,
.form-textarea {
    background: white;
    border: 1px solid #ebe0ee;
    border-radius: 4px;
    padding: 0.75rem 1rem;
    font-family: 'Montserrat', system-ui, sans-serif;
    font-size: 0.9375rem;
    color: #452145;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    width: 100%;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: #fbbf24;
    box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.15);
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: #c29fc4;
}

.form-select {
    appearance: none;
    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='%238e528e' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

.form-textarea {
    resize: vertical;
    min-height: 100px;
}

/* --- Primary Button --- */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: #532853;
    color: #fffbeb;
    font-family: 'Montserrat', system-ui, sans-serif;
    font-size: 0.9375rem;
    font-weight: 600;
    padding: 0.875rem 2rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
}

.btn-primary:hover {
    background: #663066;
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(83, 40, 83, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary svg {
    transition: transform 0.3s ease;
}

.btn-primary:hover svg {
    transform: translate(3px, -3px);
}

/* --- Back to Top --- */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 44px;
    height: 44px;
    background: #532853;
    color: #fbbf24;
    border: none;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease, background 0.3s ease;
    z-index: 30;
    box-shadow: 0 4px 12px rgba(83, 40, 83, 0.3);
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    background: #663066;
}

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

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

/* --- Mobile Menu --- */
.mobile-nav-link {
    display: block;
}

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

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

    .hero-scroll-line {
        animation: none;
    }
}

/* --- Responsive --- */
@media (max-width: 767px) {
    .hero-content h1 {
        font-size: 2.75rem;
    }

    .hero-badge {
        margin-bottom: 1.5rem !important;
    }

    .section {
        padding-top: 4rem;
        padding-bottom: 4rem;
    }

    .service-card-inner {
        padding: 1.5rem;
    }
}

@media (min-width: 768px) and (max-width: 1023px) {
    .hero-content h1 {
        font-size: 4rem;
    }
}
