/* Imports */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;700;900&family=IBM+Plex+Sans+Arabic:wght@300;400;500;600;700&family=Almarai:wght@300;400;700;800&display=swap');

:root {
    /* Premium Alsherif Palette */
    --deep-emerald: #082825;    /* Primary hero color, premium backgrounds */
    --warm-sand: #D2C4AB;       /* Main luxury tone, cards, highlights */
    --porcelain: #F5F2EA;       /* Breathing room, elegant backgrounds / text */
    --charcoal: #171717;        /* Text on light layouts, formal contrast */

    /* Token Mapping for Dark / High Contrast UI */
    --primary-dark: var(--deep-emerald);
    --secondary-dark: var(--charcoal);
    --accent-green: var(--warm-sand);
    --accent-gold: var(--warm-sand);

    /* Text Formatting */
    --text-primary: var(--porcelain);
    --text-secondary: rgba(245, 242, 234, 0.85); /* Slightly boosted for contrast */
    --text-muted: rgba(245, 242, 234, 0.55);

    /* Layout Tokens */
    --glass-bg: rgba(8, 40, 37, 0.7); /* Deepened glass for text legibility */
    --glass-border: rgba(210, 196, 171, 0.15); /* Using warm sand for borders */
    --transition-premium: all 1.2s cubic-bezier(0.16, 1, 0.3, 1);
    --transition-fast: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    --glow-gold: 0 0 25px rgba(210, 196, 171, 0.15);
}

/* Base Styling */
html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    background-color: var(--primary-dark);
    color: var(--text-primary);
    font-family: 'Almarai', sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
    padding-top: 0;
}

h1,
h2,
h3,
h4,
.font-serif {
    font-family: 'Playfair Display', 'IBM Plex Sans Arabic', serif;
    font-weight: 700;
}

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

::-webkit-scrollbar-track {
    background: var(--primary-dark);
}

::-webkit-scrollbar-thumb {
    background: var(--accent-gold);
    border-radius: 10px;
}

/* Revitalized Global Background */
.bg-modern-abstract {
    position: fixed;
    inset: 0;
    z-index: -2;
    background: var(--deep-emerald);
    /* Base Forest from Palette */
    overflow: hidden;
}

/* Noise Texture */
.bg-modern-abstract::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    opacity: 0.08;
    /* Slightly more visible texture */
    pointer-events: none;
}

/* Architectural Grid */
.grid-overlay {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    mask-image: radial-gradient(circle at 50% 50%, black, transparent 80%);
}

.blob-c {
    position: absolute;
    filter: blur(150px);
    opacity: 0.35;
    /* Boosted from 0.25 */
    animation: blob-float 20s infinite alternate ease-in-out;
}

.blob-1 {
    top: -10%;
    left: -10%;
    width: 70vw;
    height: 70vw;
    background: radial-gradient(circle, var(--secondary-dark), transparent 70%);
}

.blob-2 {
    bottom: -10%;
    right: -10%;
    width: 60vw;
    height: 60vw;
    background: radial-gradient(circle, var(--accent-green), transparent 70%);
}

.blob-3 {
    top: 50%;
    left: 40%;
    width: 40vw;
    height: 40vw;
    background: radial-gradient(circle, rgba(210, 196, 171, 0.08), transparent 70%);
    animation-delay: -5s;
}

@keyframes blob-float {
    0% {
        transform: scale(1) translate(0, 0) rotate(0deg);
    }

    50% {
        transform: scale(1.1) translate(5%, 10%) rotate(5deg);
    }

    100% {
        transform: scale(0.9) translate(-5%, -5%) rotate(-5deg);
    }
}

.brand-badge {
    display: inline-flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    padding: 10px 20px;
    border-left: 3px solid var(--accent-gold);
    font-size: 0.8rem;
    letter-spacing: 2px;
}

.luxury-divider {
    height: 1px;
    width: 100px;
    background: var(--accent-gold);
    margin: 20px 0;
}

/* Navigation */
.navbar {
    padding: 2rem 0;
    transition: var(--transition-premium);
    z-index: 1000;
    backdrop-filter: blur(0px);
}

.navbar.scrolled {
    padding: 1rem 0;
    background: rgba(10, 10, 11, 0.85);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
}

.navbar-brand img {
    height: 80px;
    filter: brightness(0) invert(1);
    transition: var(--transition-premium);
    transform: scale(1.9);
}

html[dir="rtl"] .navbar-brand img {
    transform-origin: right center;
}

html[dir="ltr"] .navbar-brand img {
    transform-origin: left center;
}

.navbar.scrolled .navbar-brand img {
    height: 75px;
    transform: scale(1.85);
}

.nav-link {
    color: var(--text-secondary) !important;
    font-weight: 500;
    font-size: 0.95rem;
    margin: 0 1rem;
    letter-spacing: 0.05em;
    transition: var(--transition-fast);
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    right: 50%;
    width: 0;
    height: 1px;
    background: var(--accent-gold);
    transition: var(--transition-fast);
    transform: translateX(50%);
}

.nav-link:hover {
    color: var(--text-primary) !important;
}

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

/* Animated Burger Icon */
.burger-icon {
    width: 30px;
    height: 20px;
    position: relative;
    transform: rotate(0deg);
    transition: .5s ease-in-out;
    cursor: pointer;
    margin: 5px;
}

.burger-icon span {
    display: block;
    position: absolute;
    height: 2px;
    width: 100%;
    background: var(--text-primary);
    border-radius: 9px;
    opacity: 1;
    left: 0;
    transform: rotate(0deg);
    transition: .25s ease-in-out;
}

.burger-icon span:nth-child(1) { top: 0px; }
.burger-icon span:nth-child(2) { top: 9px; }
.burger-icon span:nth-child(3) { top: 18px; }

.navbar-toggler[aria-expanded="true"] .burger-icon span:nth-child(1) {
    top: 9px;
    transform: rotate(135deg);
    background: var(--accent-gold);
}

.navbar-toggler[aria-expanded="true"] .burger-icon span:nth-child(2) {
    opacity: 0;
    left: -60px;
}

.navbar-toggler[aria-expanded="true"] .burger-icon span:nth-child(3) {
    top: 9px;
    transform: rotate(-135deg);
    background: var(--accent-gold);
}

/* Premium Mobile Navbar Menu */
@media (max-width: 991.98px) {
    .navbar-collapse {
        background: rgba(10, 10, 11, 0.95);
        backdrop-filter: blur(20px);
        margin-top: 1rem;
        padding: 2rem;
        border-radius: 15px;
        border: 1px solid var(--glass-border);
        box-shadow: 0 20px 40px rgba(0,0,0,0.5);
    }
    
    .navbar-nav {
        text-align: center;
    }
    
    .nav-link {
        font-size: 1.1rem;
        padding: 1rem 0 !important;
        margin: 0;
        border-bottom: 1px solid rgba(255,255,255,0.05);
    }
    
    .nav-item:last-child .nav-link {
        border-bottom: none;
    }
    
    .navbar-collapse .d-flex {
        justify-content: center;
        margin-top: 1.5rem;
    }
}

/* Logical Alignment Utilities */
html[dir="rtl"] {
    text-align: right;
}

html[dir="ltr"] {
    text-align: left;
}

/* Hero Section */
.hero-section {
    height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.hero-video-bg {
    position: absolute;
    inset: 0;
    z-index: -1;
}

.hero-video-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(0.4) contrast(1.1);
}

.hero-content {
    max-width: 900px;
}

.hero-subtitle {
    font-family: 'Almarai', sans-serif;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.3em;
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
}

.hero-title {
    font-size: clamp(3rem, 8vw, 6rem);
    line-height: 1.1;
    margin-bottom: 2rem;
    font-weight: 900;
}

html[dir="ltr"] .hero-title {
    font-size: clamp(2.5rem, 6.5vw, 4.5rem);
}


.hero-title span {
    display: block;
    color: transparent;
    -webkit-text-stroke: 3px rgba(255, 255, 255, 0.744);
}

html[dir="ltr"] .hero-title span {
    -webkit-text-stroke: 2px rgba(255, 255, 255, 0.744);
}


/* Premium Buttons */
.btn-premium {
    padding: 1.2rem 3rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 0.8rem;
    border-radius: 0;
    transition: var(--transition-premium);
    position: relative;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    gap: 1rem;
}

.btn-premium.btn-sm {
    padding: 0.8rem 2rem;
    font-size: 0.75rem;
}

.btn-gold {
    background: var(--secondary-dark);
    color: var(--text-primary) !important;
    border: 1px solid var(--accent-green);
}

.btn-gold:hover {
    background: var(--accent-green);
    color: var(--primary-dark) !important;
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(23, 23, 23, 0.3);
}

.btn-outline {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-primary) !important;
}

.btn-outline:hover {
    background: white;
    color: black !important;
    border-color: white;
}

/* Glass Search Bar */
.search-container {
    margin-top: -100px;
    z-index: 10;
    position: relative;
}

.glass-search {
    background: rgba(8, 40, 37, 0.95);
    backdrop-filter: blur(30px);
    border: 1px solid var(--glass-border);
    padding: 2.5rem;
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.5);
}

.form-select-premium {
    background-color: transparent;
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    border-radius: 0;
    padding: 1rem 0;
    font-size: 1rem;
}

.form-select-premium:focus {
    box-shadow: none;
    border-bottom: 1px solid var(--accent-green);
}

/* Section Styling */
.section-padding {
    padding: 120px 0;
}

.section-title {
    margin-bottom: 4rem;
}

.section-label {
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4em;
    display: block;
    margin-bottom: 1rem;
}

.section-heading {
    font-size: clamp(2rem, 5vw, 3.5rem);
    line-height: 1.2;
}

/* Infinite Text Slider */
.text-slider {
    overflow: hidden;
    padding: 4rem 0;
    background: var(--secondary-dark);
}

.text-slider-content {
    display: flex;
    white-space: nowrap;
    animation: text-scroll 30s linear infinite;
}

.text-slider-content h2 {
    font-size: 5rem;
    margin: 0 2rem;
    color: transparent;
    -webkit-text-stroke: 1px rgba(255, 255, 255, 0.05);
    text-transform: uppercase;
}

@keyframes text-scroll {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(50%);
    }
}

/* Property Cards */
.prop-card {
    background: var(--secondary-dark);
    border: 1px solid var(--glass-border);
    transition: var(--transition-premium);
    position: relative;
    overflow: hidden;
}

.prop-img-wrapper {
    aspect-ratio: 4/5;
    overflow: hidden;
}

.prop-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition-premium);
}

.prop-card:hover .prop-img-wrapper img {
    transform: scale(1.1);
}

.prop-content {
    padding: 2rem;
}

.prop-price {
    color: var(--text-primary);
    font-size: 1.25rem;
    font-weight: 700;
}

.prop-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    margin: 1rem 0;
}

/* Team Cards */
.team-card {
    background: var(--secondary-dark);
    border: 1px solid var(--glass-border);
    padding: 3rem 2rem;
    text-align: center;
    transition: var(--transition-premium);
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.team-card:hover {
    transform: translateY(-10px);
    border-color: var(--accent-gold);
    box-shadow: var(--glow-gold);
}

.team-img-wrapper {
    width: 150px;
    height: 150px;
    margin: 0 auto 2rem;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid var(--accent-gold);
    position: relative;
    background: var(--primary-dark);
}

.team-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition-premium);
}

.team-card:hover .team-img-wrapper img {
    transform: scale(1.1);
}

.team-name {
    font-size: 1.5rem;
    color: var(--text-primary);
    margin-bottom: 1rem !important;
}

.team-title {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 0;
}

/* Neighborhood Tiles */
.neb-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.neb-tile {
    position: relative;
    height: 500px;
    overflow: hidden;
    background: var(--secondary-dark);
}

.neb-tile:nth-child(2) {
    grid-row: span 2;
    height: auto;
}

.neb-tile img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(0.6);
    transition: var(--transition-premium);
}

.neb-tile:hover img {
    transform: scale(1.05);
    filter: brightness(0.4);
}

.neb-content {
    position: absolute;
    bottom: 0;
    right: 0;
    padding: 3rem;
    z-index: 2;
}

/* --- THE SHOCKING FIVE COMPONENTS --- */

/* 01. Blueprint */
.blueprint-container {
    width: 100%;
    height: 450px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px dashed var(--accent-green);
    background: radial-gradient(circle, rgba(86, 117, 95, 0.05) 1px, transparent 1px);
    background-size: 30px 30px;
    margin: 40px 0;
}

#blueprintCanvas {
    width: 100%;
    height: 100%;
}

/* 02. Liquid Gold Horizon */
.wave-container {
    height: 450px;
    width: 100%;
    background: rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(210, 196, 171, 0.1);
}

#waveCanvas {
    width: 100%;
    height: 100%;
}

.market-stat {
    position: absolute;
    top: 30px;
    z-index: 5;
}

html[dir="rtl"] .market-stat {
    right: 30px;
    text-align: right;
    border-right: 3px solid var(--accent-gold);
    padding-right: 20px;
}

html[dir="ltr"] .market-stat {
    left: 30px;
    text-align: left;
    border-left: 3px solid var(--accent-gold);
    padding-left: 20px;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--text-primary);
    line-height: 1;
}

.stat-label {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 3px;
    opacity: 0.7;
}

/* 03. Spotlight Reveal */
.spotlight-container {
    position: relative;
    width: 100%;
    height: 550px;
    background: url('https://images.unsplash.com/photo-1600607687920-4e2a09cf159d?auto=format&fit=crop&w=1200') center;
    background-size: cover;
    border-radius: 0;
    overflow: hidden;
    cursor: none;
}

.spotlight-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    /* Reduced darkness */
    z-index: 1;
}

.spotlight-pulse {
    position: absolute;
    width: 350px;
    height: 350px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.4) 0%, rgba(255, 255, 255, 0) 75%);
    border-radius: 50%;
    pointer-events: none;
    transform: translate(-50%, -50%);
    z-index: 10;
}

/* 04. Investment Tree */
.tree-container {
    height: 500px;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
}

#treeCanvas {
    width: 100%;
    height: 100%;
}

/* 05. Material Symphony */
.material-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
    perspective: 2000px;
}

.material-card {
    height: 250px;
    position: relative;
    overflow: hidden;
    border-radius: 5px;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: flex-end;
    padding: 35px;
    transition: transform 0.1s ease;
    transform-style: preserve-3d;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.material-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.9) 0%, transparent 60%);
    z-index: 1;
}

.material-info {
    position: relative;
    z-index: 2;
    transform: translateZ(50px);
}

.material-name {
    font-weight: 800;
    font-size: 1.4rem;
    color: var(--text-secondary);
    margin-bottom: 5px;
}

.material-desc {
    font-size: 0.9rem;
    opacity: 0.6;
}

.card-marble {
    background-image: url('https://images.unsplash.com/photo-1618221195710-dd6b41faaea6?auto=format&fit=crop&w=800');
}

.card-walnut {
    background-image: url('https://images.unsplash.com/photo-1533090161767-e6ffed986c88?auto=format&fit=crop&w=800');
}

.card-glass {
    background-image: url('https://images.unsplash.com/photo-1505330622279-bf7d7fc918f4?auto=format&fit=crop&w=800');
}

.card-metal {
    background-image: url('https://images.unsplash.com/photo-1610296669228-602fa827fc1f?auto=format&fit=crop&w=800');
}

/* Extra Premium Utilities */
.max-w-600 {
    max-width: 600px;
}

.font-serif {
    font-family: 'Playfair Display', serif;
}

.text-gold {
    color: var(--accent-gold) !important;
}

.border-gold {
    border-color: var(--accent-gold) !important;
}

/* Missing utility classes mapped to the new palette to fix invisible text bugs */
.text-primary-green { color: var(--text-primary) !important; }
.text-secondary-green { color: var(--text-secondary) !important; }
.text-brand-blue { color: var(--text-primary) !important; }
.text-accent-blue { color: var(--text-secondary) !important; }

/* Ensure high contrast on white/light backgrounds (like property-details cards) */
.bg-white .text-primary-green, 
.bg-white .text-brand-blue,
.bg-light .text-primary-green,
.bg-light .text-brand-blue { 
    color: var(--primary-dark) !important; 
}

.bg-white .text-secondary-green, 
.bg-white .text-accent-blue,
.bg-light .text-secondary-green,
.bg-light .text-accent-blue { 
    color: var(--secondary-dark) !important; 
}

/* Enhanced Hero */
.bg-black {
    background-color: #000 !important;
}

.bg-graphite {
    background-color: #111 !important;
}

.border-top-none {
    border-top: none !important;
}

footer {
    background-color: #000 !important;
}

.footer-link {
    color: #fff !important;
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.footer-link:hover {
    color: #fff !important;
    opacity: 0.7;
}

.scrolled-nav {
    background: rgba(8, 40, 37, 0.98) !important;
}

/* --- SHOCKING INTEGRATION (06-09, 14) --- */

/* 06. Golden Spiral (Divine Proportion) */
.spiral-container {
    height: 450px;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--glass-border);
}

.spiral-container img, .magnetic-container img {
    transition: var(--transition-premium);
}

.spiral-container:hover img, .magnetic-container:hover img {
    transform: scale(1.1);
}

/* 07. Magnetic Grid */
.magnetic-container {
    height: 450px;
    background: transparent;
    border: 1px solid var(--glass-border);
}

/* 08. 3D Cube (Architectural Frame) */
.cube-wrapper {
    height: 450px;
    perspective: 1200px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: move;
}

.cube {
    position: relative;
    width: 200px;
    height: 200px;
    transform-style: preserve-3d;
    transition: transform 0.1s ease-out;
}

.cube-face {
    position: absolute;
    width: 200px;
    height: 200px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.03);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Playfair Display', serif;
    color: var(--text-primary);
    font-size: 0.8rem;
    letter-spacing: 2px;
    backface-visibility: visible;
}

.front {
    transform: translateZ(100px);
}

.back {
    transform: rotateY(180deg) translateZ(100px);
}

.right {
    transform: rotateY(90deg) translateZ(100px);
}

.left {
    transform: rotateY(-90deg) translateZ(100px);
}

.top {
    transform: rotateX(90deg) translateZ(100px);
}

.bottom {
    transform: rotateX(-90deg) translateZ(100px);
}

.cube-face::after {
    content: '';
    position: absolute;
    inset: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* 09. Liquid Marble */
.marble-container {
    height: 450px;
    width: 100%;
    background: rgba(0, 0, 0, 0.05);
    border: 1px solid var(--glass-border);
}

/* 14. Split Slide */
.split-slide {
    height: 550px;
    position: relative;
    overflow: hidden;
    background: #111;
}

.slide-part {
    position: absolute;
    width: 50%;
    height: 100%;
    background-size: cover;
    background-position: center;
    transition: 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 2;
}

.part-left {
    left: 0;
    background-image: url('https://images.unsplash.com/photo-1600585154340-be6161a56a0c?auto=format&fit=crop&w=1200');
    background-position: right center;
}

.part-right {
    right: 0;
    background-image: url('https://images.unsplash.com/photo-1600566753376-12c8ab7fb75b?auto=format&fit=crop&w=1200');
    background-position: left center;
}

.slide-reveal-text {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
    color: var(--accent-gold);
    font-size: 3rem;
    font-weight: 900;
    letter-spacing: 15px;
    font-family: 'Playfair Display', serif;
}

.split-slide:hover .part-left {
    transform: translateX(-100%);
}

.split-slide:hover .part-right {
    transform: translateX(100%);
}

.bg-secondary-dark-20 {
    background: rgba(60, 86, 70, 0.2);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .material-grid {
        grid-template-columns: 1fr;
    }

    .blueprint-container,
    .wave-container,
    .spotlight-container,
    .spiral-container,
    .magnetic-container,
    .cube-wrapper,
    .marble-container {
        height: 350px;
    }

    .split-slide {
        height: 400px;
    }

    .slide-reveal-text {
        font-size: 1.5rem;
        letter-spacing: 5px;
    }
}

/* Building Animation Styles */
.house-container {
    zoom: 0.8;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 300px;
    width: 100%;
}

@media (max-width: 991px) {
    .house-container {
        zoom: 0.6;
    }
}

[data-type="Villa"] .house-wings {
    width: 425px;
    left: calc(50% - 212.5px);
}

[data-type="Villa"] {
    --wings-width: 425px;
    --front-width: 150px;
}

[data-type="Villa"] .house-front {
    width: 150px;
    left: calc(50% - 75px);
}

[data-type="Commercial"] .house-wings {
    width: 355px;
    left: calc(50% - 177.5px);
}

[data-type="Commercial"] {
    --wings-width: 355px;
    --front-width: 150px;
}

[data-type="Commercial"] .house-front {
    width: 150px;
    left: calc(50% - 75px);
}

[data-type="All"] .house-wings {
    width: 300px;
    left: calc(50% - 150px);
}

[data-type="All"] {
    --wings-width: 300px;
    --front-width: 125px;
}

[data-type="All"] .house-front {
    width: 125px;
    left: calc(50% - 62.5px);
}

[data-type="Apartment"] .house-wings {
    width: 240px;
    left: calc(50% - 120px);
}

[data-type="Apartment"] {
    --wings-width: 240px;
    --front-width: 150px;
}

[data-type="Apartment"] .house-front {
    width: 150px;
    left: calc(50% - 75px);
}

.house {
    height: 225px;
    width: 520px;
    position: relative;
    overflow: visible;
}

.house *,
.house *:before,
.house *:after {
    box-sizing: border-box;
}

.house *:before,
.house *:after {
    content: "";
    display: block;
}

/* Absolute-positioned children must NOT be overridden to relative */
.house-wings,
.house-front,
.house-chimney,
.house-gable,
.house-facade,
.house-doorway,
.house-stairs,
.house-door,
.house-sparkle {
    position: absolute;
}

.house-label {
    text-transform: uppercase;
    font-weight: bold;
    padding-left: calc(20px + 1ch);
    font-size: 25px;
    color: var(--accent-gold);
    margin: 30px 0 5px;
    font-family: 'Playfair Display', serif;
    min-height: 1em;
}

.house-label:before,
.house-label:after {
    position: absolute;
    text-align: right;
    left: 0;
    top: 0;
    padding: 0 0.5ch;
    will-change: transform;
}

.house-label:before {
    content: attr(data-prev-type);
}

.house-label:after {
    content: attr(data-type);
}

/* Unified label animations */
.house-label[data-type-delta]:before {
    animation: prev-label-up 500ms cubic-bezier(0.1, 0, 0.3, 1) both;
}

.house-label[data-type-delta]:after {
    animation: label-up 1000ms cubic-bezier(0.1, 0, 0.3, 1) both;
}

@keyframes prev-label-up {
    from {
        transform: translateY(0);
        opacity: 1;
    }

    to {
        transform: translateY(-100%) scale(1.5);
        opacity: 0;
    }
}

@keyframes label-up {
    from {
        transform: translateY(100%);
        opacity: 0;
    }

    50% {
        transform: translateY(0) scale(1.5);
        opacity: 1;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.house-wings {
    position: absolute;
    bottom: 0;
    height: 125px;
    transition: var(--transition-premium);
}

.house-wings:before {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #fff;
    border: 5px solid var(--primary-dark);
    box-shadow: inset 0 15px var(--text-secondary);
}

.house-wings:after {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 5px;
    width: 100%;
    background-color: var(--primary-dark);
    transform: scaleX(1.1);
}

.house-wings>.house-roof {
    height: 65px;
    width: calc(100% + 40px);
    left: -20px;
    border-bottom: 5px solid var(--primary-dark);
    position: absolute;
    bottom: 100%;
}

.house-wings>.house-roof:before,
.house-wings>.house-roof:after {
    position: absolute;
    height: 100%;
    width: 50%;
    background-color: var(--accent-green);
    border: 5px solid var(--primary-dark);
    border-bottom: none;
}

.house-wings>.house-roof:before {
    left: 0;
    transform-origin: bottom left;
    transform: skewX(-30deg);
    border-right: none;
}

.house-wings>.house-roof:after {
    right: 0;
    transform-origin: bottom right;
    transform: skewX(30deg);
    border-left: none;
}

.house-facade {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.house-facade:before,
.house-facade:after {
    position: absolute;
    height: 100%;
    width: 50%;
    background-color: #fff;
    top: 0;
    border-top: 5px solid var(--primary-dark);
    box-shadow: inset 0 calc(var(--front-width) / 6) var(--text-secondary);
}

.house-facade:before {
    left: 0;
    transform-origin: top left;
    transform: skewY(-40deg);
    border-left: 5px solid var(--primary-dark);
}

.house-facade:after {
    right: 0;
    transform-origin: top right;
    transform: skewY(40deg);
    border-right: 5px solid var(--primary-dark);
}

/* Animation triggers */
[data-type] .house-wings>.house-roof {
    animation: wing-roof-move 800ms cubic-bezier(0.1, 0, 0.3, 1);
}

[data-type] .house-front>.house-gable {
    animation: front-roof-move 800ms cubic-bezier(0.1, 0, 0.3, 1);
}

[data-type] .house-wings:before,
[data-type] .house-left-wing,
[data-type] .house-right-wing {
    animation: house-move 800ms cubic-bezier(0.1, 0, 0.3, 1);
}

@keyframes wing-roof-move {
    from {
        transform: translateY(-10px) rotate(-5deg);
    }

    to {
        transform: none;
    }
}

@keyframes front-roof-move {
    from {
        transform: translateY(-5px) rotate(5deg);
    }

    to {
        transform: none;
    }
}

@keyframes house-move {
    from {
        transform: scale(0.95, 1.05);
    }

    to {
        transform: none;
    }
}

.house-front {
    position: absolute;
    bottom: 0;
    height: 160px;
    transition: var(--transition-premium);
}

.house-window {
    height: 60px;
    width: 30px;
    border: 5px solid var(--primary-dark);
    border-top-left-radius: 30px;
    border-top-right-radius: 30px;
    background-image: linear-gradient(to right, #B2C0B6, #B2C0B6 49.9%, #C5D2C9 50%, #C5D2C9);
}

.house-window:before {
    height: 100%;
    width: 5px;
    left: calc(50% - 2.5px);
    top: 0;
    background-color: var(--primary-dark);
}

.house-front>.house-window {
    width: 60px;
    height: 55px;
    position: absolute;
    left: calc(50% - 30px);
    top: -10px;
}

.house-gable {
    position: absolute;
    bottom: calc(100% - 5px);
    left: 0;
    width: 100%;
    height: 70px;
}

.house-gable>.house-roof {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transform: scaleY(0.8);
    z-index: 1;
}

.house-chimney {
    width: 35px;
    height: 70px;
    position: absolute;
    background-color: var(--primary-dark);
    left: 15px;
    bottom: 100%;
    z-index: 0;
}

.house-left-wing,
.house-right-wing {
    position: absolute;
    height: 100%;
    width: calc(50% - var(--front-width) / 2);
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 0 10px;
}

.house-left-wing {
    left: 0;
}

.house-right-wing {
    right: 0;
    flex-flow: row-reverse;
}

.house-doorway {
    width: 65px;
    height: 90px;
    position: absolute;
    bottom: 0;
    left: calc(50% - 32.5px);
}

.house-stairs {
    width: 100%;
    position: absolute;
    bottom: 0;
    left: 0;
    height: 15px;
    border: 5px solid var(--primary-dark);
    background-color: white;
}

.house-stairs:before {
    content: "";
    position: absolute;
    bottom: 100%;
    left: 10%;
    width: 80%;
    height: 15px;
    border: 5px solid var(--primary-dark);
    background-color: white;
}

.house-door {
    position: absolute;
    background-color: var(--accent-gold);
    width: 50%;
    height: 55px;
    left: 25%;
    bottom: 35px;
    border: 2px solid var(--primary-dark);
}

/* Hide/Show logic for wings windows */
.house[data-type="Apartment"] .house-wings .house-window {
    display: none;
}

.house[data-type="All"] .house-wings .house-window:last-child {
    display: none;
}

.house[data-type="Commercial"] .house-wings .house-window,
.house[data-type="Villa"] .house-wings .house-window {
    display: block;
}

/* Branding Section (Who We Are) */
.branding-section {
    position: relative;
    z-index: 1;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px 30px;
}

.stat-item {
    padding: 10px 0;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 5px;
    font-family: 'Playfair Display', serif;
}

.stat-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0;
}

.learn-more-link {
    display: inline-flex;
    align-items: center;
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 0.85rem;
    transition: var(--transition-fast);
}

.learn-more-link:hover {
    color: var(--accent-gold);
    transform: translateX(10px);
}

html[dir="rtl"] .learn-more-link:hover {
    transform: translateX(-10px);
}

.overlapping-images {
    position: relative;
    padding: 40px 0;
}

.img-large {
    margin-left: auto;
    width: 85%;
}

html[dir="rtl"] .img-large {
    margin-left: 0;
    margin-right: auto;
}

.img-large img {
    width: 100%;
    height: auto;
    display: block;
}

.img-small {
    position: absolute;
    top: 50%;
    left: 0;
    width: 55%;
    z-index: 2;
    transform: translateY(-50%);
}

html[dir="rtl"] .img-small {
    left: auto;
    right: 0;
}

.img-small img {
    width: 100%;
    height: auto;
    border: 15px solid var(--primary-dark);
}

@media (max-width: 991.98px) {
    .img-large img {
        width: 100%;
    }
    .img-small {
        width: 60%;
        bottom: -20px;
    }
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}