/* 
 * RESYD — MASTER ENTERPRISE CSS/UI 
 * THEME: LIGHT LUXURY US REAL ESTATE
 * TARGET: DETERMINISTIC, PREDICTABLE, PREMIUM
 */

:root {
    /* --- COLOR PALETTE: LUXURY NEUTRALS --- */
    --resyd-white: #FFFFFF;
    --resyd-cream: #FDFBF7;
    --resyd-beige-light: #F7F5F2;
    --resyd-beige-mid: #E8E4DE;
    --resyd-champagne: #D4C9B8;
    --resyd-gold-muted: #B5A280;
    --resyd-graphite: #2D2D2D;
    --resyd-text-main: #3A3A3A;
    --resyd-text-soft: #666666;
    --resyd-border-warm: rgba(212, 201, 184, 0.3);
    
    /* --- DETERMINISTIC SPACING SYSTEM --- */
    --space-unit: 4px;
    --space-xs: calc(var(--space-unit) * 2); /* 8px */
    --space-s:  calc(var(--space-unit) * 4); /* 16px */
    --space-m:  calc(var(--space-unit) * 6); /* 24px */
    --space-l:  calc(var(--space-unit) * 10); /* 40px */
    --space-xl: calc(var(--space-unit) * 20); /* 80px */
    
    /* --- TYPOGRAPHY: EDITORIAL SCALE --- */
    --font-serif: "Cormorant Garamond", serif; /* Or similar premium serif */
    --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    
    --type-h1: clamp(2.5rem, 5vw, 4rem);
    --type-h2: clamp(2rem, 4vw, 2.75rem);
    --type-h3: clamp(1.5rem, 3vw, 2rem);
    --type-body: clamp(1rem, 1.1vw, 1.125rem);
    --type-small: 0.875rem;

    /* --- UI ELEVATION & GLASS --- */
    --shadow-soft: 0 4px 20px rgba(45, 45, 45, 0.04);
    --shadow-luxury: 0 12px 40px rgba(181, 162, 128, 0.12);
    --shadow-inset: inset 0 2px 4px rgba(0, 0, 0, 0.02);
    --glass-surface: rgba(255, 255, 255, 0.7);
    --glass-blur: blur(12px);
    
    /* --- PERFORMANCE & MOTION --- */
    --timing-fast: 200ms cubic-bezier(0.2, 0, 0, 1);
    --timing-premium: 400ms cubic-bezier(0.3, 0, 0.1, 1);
    --radius-s: 4px;
    --radius-m: 8px;
    --radius-l: 12px;
    
    /* --- Z-INDEX ARCHITECTURE --- */
    --z-header: 1000;
    --z-dropdown: 1010;
    --z-drawer: 1020;
    --z-modal: 1030;
}

/* --- RESET & OPTIMIZATION --- */
* {
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    margin: 0; padding: 0;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
    background: var(--resyd-white);
}

body {
    font-family: var(--font-sans);
    color: var(--resyd-text-main);
    line-height: 1.6;
    background-color: var(--resyd-white);
    text-rendering: optimizeLegibility;
}

a {
    text-decoration: none; /* No underlines as per requirements */
    color: inherit;
    transition: var(--timing-fast);
}

img {
    max-width: 100%;
    display: block;
    content-visibility: auto; /* Optimization */
}

/* --- HEADER.PHP --- */
.resyd-header {
    position: fixed;
    top: 0; width: 100%;
    z-index: var(--z-header);
    background: transparent;
    border-bottom: 1px solid transparent;
    transition: background var(--timing-premium), border var(--timing-premium), backdrop-filter var(--timing-premium);
    padding: var(--space-s) 0;
}

.resyd-header--scrolled {
    background: var(--glass-surface);
    backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid var(--resyd-border-warm);
    padding: var(--space-xs) 0;
}

.nav-link {
    font-size: var(--type-small);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 500;
    padding: 0 var(--space-s);
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px; left: 50%;
    width: 0; height: 1px;
    background: var(--resyd-gold-muted);
    transition: width var(--timing-fast), left var(--timing-fast);
}

.nav-link:hover::after {
    width: 100%; left: 0;
}

/* --- HERO.PHP --- */
.resyd-hero {
    position: relative;
    height: 100vh;
    min-height: 700px;
    display: flex;
    align-items: center;
    background: var(--resyd-beige-light);
    overflow: hidden;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.8) 0%, rgba(247,245,242,0.4) 100%);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-m);
}

.hero-title {
    font-family: var(--font-serif);
    font-size: var(--type-h1);
    font-weight: 400;
    color: var(--resyd-graphite);
    line-height: 1.1;
    margin-bottom: var(--space-m);
}

.search-panel-glass {
    background: var(--glass-surface);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--resyd-border-warm);
    border-radius: var(--radius-l);
    padding: var(--space-s);
    box-shadow: var(--shadow-luxury);
    display: flex;
    gap: var(--space-xs);
}

/* --- LISTINGS.PHP (NETFLIX LUXURY GRID) --- */
.listing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: var(--space-m);
    padding: var(--space-l) 0;
}

.listing-card {
    background: var(--resyd-white);
    border-radius: var(--radius-m);
    overflow: hidden;
    transition: transform var(--timing-premium), box-shadow var(--timing-premium);
    border: 1px solid var(--resyd-beige-light);
}

.listing-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-luxury);
}

.listing-image-wrapper {
    position: relative;
    aspect-ratio: 4/3;
    overflow: hidden;
}

.listing-image-wrapper img {
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform var(--timing-premium);
}

.listing-card:hover img {
    transform: scale(1.05);
}

.listing-details {
    padding: var(--space-s);
}

.listing-price {
    font-family: var(--font-sans);
    font-size: var(--type-h3);
    font-weight: 600;
    color: var(--resyd-graphite);
}

/* --- BUTTON SYSTEM --- */
.btn-premium {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-s) var(--space-l);
    background: var(--resyd-graphite);
    color: var(--resyd-white);
    border-radius: var(--radius-s);
    font-size: var(--type-small);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(45, 45, 45, 0.2);
    transition: all var(--timing-fast);
    position: relative;
    overflow: hidden;
}

.btn-premium:hover {
    background: #000;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(181, 162, 128, 0.4);
}

.btn-premium::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    transition: 0.5s;
}

.btn-premium:hover::before {
    left: 100%;
}

/* --- FAQ & ACCORDION --- */
.resyd-accordion {
    border-bottom: 1px solid var(--resyd-border-warm);
    padding: var(--space-s) 0;
}

.accordion-trigger {
    display: flex;
    justify-content: space-between;
    width: 100%;
    font-family: var(--font-sans);
    font-size: 1.2rem;
    color: var(--resyd-graphite);
    background: none; border: none;
    cursor: pointer;
    text-align: left;
}

/* --- ACCESSIBILITY & PERFORMANCE --- */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* iOS Safe Area Support */
.resyd-footer {
    padding-bottom: env(safe-area-inset-bottom);
    background: var(--resyd-beige-light);
    border-top: 1px solid var(--resyd-border-warm);
}

/* Mobile Responsive Adjustments */
@media (max-width: 768px) {
    .listing-grid {
        grid-template-columns: 1fr;
        padding: var(--space-s);
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .search-panel-glass {
        flex-direction: column;
    }
}

/* GPU OPTIMIZATIONS */
.listing-card, .btn-premium, .hero-content {
    will-change: transform, opacity;
}