/* 
   LuxNest Realty - Awwwards Edition 
   Premium Real Estate Experience
*/

:root {
    /* Colors - Premium Palette */
    --color-black: #0a0a0a;
    /* Rich Black */
    --color-charcoal: #1c1c1c;
    /* Soft Black */
    --color-cream: #f4f1ea;
    /* Ivory/Cream */
    --color-gold: #c6a87c;
    /* Muted Luxury Gold */
    --color-gold-dark: #a68b5b;
    --color-grey-light: #e5e5e5;
    --color-grey-medium: #888888;

    /* Semantic Colors */
    --bg-body: var(--color-cream);
    --bg-dark: var(--color-black);
    --text-primary: var(--color-black);
    --text-secondary: var(--color-grey-medium);
    --text-inverted: var(--color-cream);
    --accent: var(--color-gold);
    --border: rgba(0, 0, 0, 0.08);

    /* Typography - Fluid Scale (Refined) */
    --font-heading: 'Playfair Display', serif;
    --font-body: 'Lato', sans-serif;

    --text-display: clamp(3.5rem, 6vw + 1rem, 7.5rem);
    --text-h1: clamp(2.5rem, 5vw + 1rem, 5rem);
    --text-h2: clamp(2rem, 3.5vw + 1rem, 4rem);
    --text-h3: clamp(1.5rem, 2vw + 1rem, 2.5rem);
    --text-body: clamp(1rem, 0.4vw + 0.9rem, 1.25rem);
    --text-small: 0.875rem;

    /* Spacing - 8px Rhythm */
    --space-1: 8px;
    --space-2: 16px;
    --space-3: 24px;
    --space-4: 32px;
    --space-6: 48px;
    --space-8: 64px;
    --space-12: 96px;
    --space-16: 128px;
    --space-24: 192px;

    /* Transitions */
    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
    --duration-fast: 0.4s;
    --duration-medium: 0.8s;
    --duration-slow: 1.2s;
}

/* Reset & Base */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-body);
    font-size: var(--text-body);
    background-color: var(--bg-body);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    cursor: none;
}

/* Focus States (Accessibility) */
:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 4px;
}

/* Form Elements (Premium) */
input,
select,
textarea {
    background: transparent;
    border: none;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 0;
    padding: var(--space-2) 0;
    font-family: var(--font-body);
    font-size: 1rem;
    color: var(--text-primary);
    width: 100%;
    transition: border-color var(--duration-fast);
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-bottom-color: var(--accent);
}

label {
    font-size: var(--text-small);
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
    margin-bottom: var(--space-1);
    display: block;
}

/* Custom Cursor */
.cursor-dot,
.cursor-outline {
    position: fixed;
    top: 0;
    left: 0;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    z-index: 9999;
    pointer-events: none;
}

.cursor-dot {
    width: 8px;
    height: 8px;
    background-color: var(--color-gold);
}

.cursor-outline {
    width: 40px;
    height: 40px;
    border: 1px solid var(--color-gold);
    transition: width 0.2s, height 0.2s, background-color 0.2s;
}

body:hover .cursor-outline {
    opacity: 1;
}

/* Typography Overrides */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    color: var(--text-primary);
    line-height: 1.1;
    font-weight: 400;
}

a {
    text-decoration: none;
    color: inherit;
    cursor: none;
}

/* Utilities */
.container {
    max-width: 1600px;
    /* Even wider for true luxury feel */
    margin: 0 auto;
    padding: 0 var(--space-6);
}

.grid-12 {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: var(--space-4);
}

.text-gold {
    color: var(--accent);
}

.text-center {
    text-align: center;
}

.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-4);
}

/* Buttons - Premium */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-2) var(--space-4);
    border: 1px solid var(--border);
    font-family: var(--font-heading);
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 0.8rem;
    position: relative;
    overflow: hidden;
    transition: all var(--duration-fast) var(--ease-out-expo);
    z-index: 1;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--accent);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform var(--duration-fast) var(--ease-out-expo);
    z-index: -1;
}

.btn:hover::before {
    transform: scaleX(1);
    transform-origin: left;
}

.btn:hover {
    color: var(--text-inverted);
    border-color: var(--accent);
}

.btn-primary {
    background: var(--color-black);
    color: var(--text-inverted);
    border-color: var(--color-black);
}

.btn-primary:hover {
    background: var(--color-charcoal);
}

/* Navigation - Glassmorphism */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: var(--space-4) 0;
    z-index: 1000;
    transition: all var(--duration-medium) var(--ease-out-expo);
    color: var(--text-inverted);
    /* Default to white for dark heroes */
}

/* Scrolled State - Light Background, Dark Text */
.navbar.scrolled {
    padding: var(--space-2) 0;
    background: rgba(244, 241, 234, 0.95);
    /* Cream opacity */
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    color: var(--text-primary);
    /* Switch to black */
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand-logo {
    font-family: var(--font-heading);
    font-size: 2rem;
    color: inherit;
    /* Follow navbar color */
}

.nav-links {
    display: flex;
    gap: var(--space-6);
    list-style: none;
    /* Remove bullets */
}

.nav-link {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    position: relative;
    color: inherit;
    /* Follow navbar color */
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 50%;
    width: 0;
    height: 1px;
    background: var(--accent);
    transition: width var(--duration-fast) var(--ease-out-expo), left var(--duration-fast) var(--ease-out-expo);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
    left: 0;
}

/* Hero Section */
.hero-section {
    height: 100vh;
    width: 100%;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 120%;
    background-size: cover;
    background-position: center;
    z-index: -1;
    will-change: transform;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.7));
    /* Darker overlay for contrast */
}

.hero-content {
    color: var(--text-inverted);
    text-align: center;
    max-width: 900px;
    position: relative;
    z-index: 1;
    /* Removed mix-blend-mode to restore visibility */
}

.hero-title {
    font-size: var(--text-display);
    color: var(--text-inverted);
    /* Force white text */
    opacity: 0.9;
    /* Soften brightness */
    margin-bottom: var(--space-2);
    font-weight: 700;
    text-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
}

.hero-subtitle {
    font-size: var(--text-h3);
    font-weight: 300;
    margin-bottom: var(--space-6);
    opacity: 0;
    transform: translateY(30px);
}

/* Search Form */
.hero-search-form {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(12px);
    padding: var(--space-2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    display: inline-flex;
    gap: var(--space-2);
    opacity: 0;
    transform: translateY(20px);
    border-radius: 4px;
    /* Slight softening */
}

.hero-search-form input,
.hero-search-form select {
    background: transparent;
    border: none;
    color: var(--text-inverted);
    /* White text in hero */
    font-family: var(--font-body);
    font-size: 1rem;
    padding: var(--space-2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.5);
    min-width: 200px;
}

.hero-search-form input::placeholder {
    color: rgba(255, 255, 255, 0.8);
}

.hero-search-form input:focus {
    outline: none;
    border-bottom-color: var(--accent);
}

/* Ensure select options are readable (browser default is white bg) */
.hero-search-form select option {
    color: var(--text-primary);
    background: var(--bg-body);
}

/* Featured Section */
.section {
    padding: var(--space-16) 0;
}

.section-title {
    font-size: var(--text-h2);
    margin-bottom: var(--space-8);
    position: relative;
    padding-left: var(--space-4);
}

.section-title::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    width: 2px;
    height: 100%;
    background: var(--accent);
    transform: translateY(-50%) scaleY(0);
    transition: transform var(--duration-medium) var(--ease-out-expo);
}

.section-title.in-view::before {
    transform: translateY(-50%) scaleY(1);
}

.properties-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    /* Responsive auto-fill, fits 320px screens with padding */
    gap: var(--space-4);
    /* Tighter gap */
}

/* Property Card */
.property-card {
    background: var(--color-white);
    transition: transform var(--duration-medium) var(--ease-out-expo);
    cursor: none;
    opacity: 0;
    transform: translateY(30px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    /* Subtle depth */
}

.property-card:hover {
    transform: translateY(-10px);
}

.card-image-wrapper {
    height: 350px;
    /* Adjusted height */
    overflow: hidden;
    position: relative;
}

.card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 1.5s var(--ease-out-expo);
}

.property-card:hover .card-image {
    transform: scale(1.1);
}

.card-content {
    padding: var(--space-4);
}

.card-price {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    color: var(--accent);
    display: block;
    margin-bottom: var(--space-1);
}

/* Trust Metrics */
.metrics-section {
    background: var(--color-black);
    color: var(--text-inverted);
    padding: var(--space-12) 0;
}

.metrics-grid {
    display: grid;
    /* Switched to Grid for easier responsive */
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-8);
}

.metric-item {
    text-align: center;
}

.metric-number {
    font-size: var(--text-h1);
    color: var(--accent);
    line-height: 1;
    margin-bottom: var(--space-2);
}

/* Footer */
/* Footer */
.footer {
    background: var(--color-charcoal);
    color: var(--color-grey-light);
    padding: var(--space-12) 0 var(--space-6);
    font-size: 0.9rem;
}

.footer h3 {
    color: var(--color-gold);
    margin-bottom: var(--space-4);
}

.footer ul {
    list-style: none;
    /* Remove bullets */
    padding: 0;
    margin: 0;
}

.footer ul li {
    margin-bottom: var(--space-1);
}

.footer-links-group {
    display: grid;
    /* Desktop: side by side */
    grid-template-columns: 1fr 1fr;
    gap: var(--space-4);
}

/* Ensure children occupy single columns in the wrapper's grid */
.footer-links-group>div {
    grid-column: auto !important;
}

/* Mobile Footer Optimization */
@media (max-width: 768px) {
    .footer {
        padding: var(--space-8) 0 var(--space-4);
        text-align: left;
        /* Left align for Tablet & Mobile */
    }

    .footer .grid-12 {
        display: flex;
        flex-direction: column;
        gap: var(--space-6);
    }

    /* 2-Column Layout for links on Tablet & Mobile */
    .footer-links-group {
        display: grid;
        grid-template-columns: 1fr 1fr;
        text-align: left;
        gap: var(--space-4);
        margin: 0;
        width: 100%;
        max-width: none;
    }
}

/* Motion Classes */
.reveal-text {
    opacity: 0;
    transform: translateY(100%);
    display: inline-block;
    will-change: transform, opacity;
}

.fade-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity var(--duration-medium) ease, transform var(--duration-medium) var(--ease-out-expo);
}

.fade-up.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Mobile & Responsive Overrides */
@media (max-width: 1024px) {
    .container {
        padding: 0 var(--space-4);
    }

    .grid-12 {
        display: flex;
        flex-direction: column;
        gap: var(--space-8);
    }

    /* Revert span logic for stacked layout */
    .grid-12>div[style*="grid-column: span"] {
        grid-column: span 12 !important;
    }

    .hero-search-form {
        flex-direction: column;
        width: 100%;
    }

    .hero-search-form input,
    .hero-search-form select {
        width: 100%;
    }

    .metrics-grid {
        grid-template-columns: 1fr;
        gap: var(--space-6);
    }

    .info-grid,
    .split-section {
        grid-template-columns: 1fr !important;
    }

    .contact-wrapper {
        grid-template-columns: 1fr !important;
    }
}

@media (max-width: 768px) {

    /* Tablet & Mobile Menu */
    .navbar {
        padding: var(--space-2) 0;
        background: rgba(0, 0, 0, 0.9);
        /* Darker background for legibility */
        backdrop-filter: blur(10px);
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: var(--color-black);
        padding: var(--space-4);
        flex-direction: column;
        align-items: center;
        gap: var(--space-4);
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        color: var(--text-inverted);
        /* Force white text to avoid black-on-black when scrolled */
    }

    .nav-links.active {
        display: flex;
    }

    .mobile-menu-btn {
        display: block;
        font-size: 1.5rem;
        cursor: pointer;
        color: inherit;
        /* Inherit from navbar to handle scroll state */
    }

    .hero-title {
        font-size: 3rem;
    }

    .hero-subtitle {
        font-size: 1.25rem;
    }

    .cursor-dot,
    .cursor-outline {
        display: none;
    }

    body {
        cursor: auto;
    }
}

@media (max-width: 480px) {

    /* Mobile Small (320px+) */
    html {
        font-size: 14px;
    }

    /* Scale down base REM */

    .hero-title {
        font-size: 2.5rem;
        line-height: 1.1;
    }

    /* Disable complex overlaps on small mobile for safety */
    .details-container {
        margin-top: 0 !important;
        border-radius: 0 !important;
        padding-top: var(--space-4);
    }

    .details-hero {
        height: 40vh !important;
    }

    .section {
        padding: var(--space-8) 0;
    }
}

@media (max-width: 360px) {
    .container {
        padding: 0 var(--space-2);
    }
}