/* Reset & Base Styles */
:root {
    --color-bg-dark: #0a0a0a;
    --color-bg-light: #f5f5f0;
    --color-text-light: #ffffff;
    --color-text-dark: #1a1a1a;
    --color-accent: #c9a96e; /* Gold-ish accent */
    --color-border: rgba(255, 255, 255, 0.1);
    
    --font-heading: 'Playfair Display', serif;
    --font-body: 'Inter', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: initial; /* Lenis takes over */
}

body {
    font-family: var(--font-body);
    background-color: var(--color-bg-dark);
    color: var(--color-text-light);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 500;
}

a {
    text-decoration: none;
    color: inherit;
}

img, video {
    max-width: 100%;
    display: block;
}

ul {
    list-style: none;
}

/* Utility Classes */
.container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 5vw;
}

/* 1. HERO SECTION */
.hero-section {
    position: relative;
    height: 300vh; /* Giving enough space to scroll */
    width: 100vw;
}

.video-container {
    position: sticky;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    z-index: -1;
}

.hero-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1.1); /* To allow some initial scale down or parallax if needed */
    filter: brightness(0.6); /* Dark overlay for text readability */
}

.hero-content {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    padding: 0 5vw;
    z-index: 10;
}

.hero-text-wrapper {
    max-width: 800px;
    margin-top: auto;
    margin-bottom: auto;
}

.hero-title {
    font-size: clamp(4rem, 8vw, 8rem);
    line-height: 1.1;
    text-transform: uppercase;
    letter-spacing: -2px;
    margin-bottom: 2rem;
    color: var(--color-text-light);
}

.line {
    display: block;
    overflow: hidden;
}

.reveal-text {
    display: inline-block;
    transform: translateY(110%);
}

.hero-subtitle {
    font-size: clamp(1.2rem, 2vw, 1.8rem);
    font-weight: 300;
    opacity: 0;
    transform: translateY(20px);
    max-width: 600px;
    line-height: 1.6;
}

.scroll-indicator {
    position: absolute;
    bottom: 40px;
    left: 5vw;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
    opacity: 0; /* Will be revealed with JS */
}

.scroll-text {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 500;
}

.scroll-line {
    width: 2px;
    height: 60px;
    background-color: var(--color-border);
    position: relative;
    overflow: hidden;
}

.scroll-line::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--color-accent);
    transform: translateY(-100%);
    animation: scrollLine 2s infinite ease-in-out;
}

@keyframes scrollLine {
    0% { transform: translateY(-100%); }
    50% { transform: translateY(0); }
    100% { transform: translateY(100%); }
}

/* 2. FEATURED PROPERTIES SECTION */
.featured-section {
    background-color: var(--color-bg-light);
    color: var(--color-text-dark);
    padding: 10vh 0 0 0;
    overflow: hidden;
}

.featured-header {
    margin-bottom: 5vh;
}

.section-title {
    font-size: clamp(3rem, 5vw, 5rem);
    line-height: 1.1;
    text-transform: uppercase;
    margin-bottom: 2rem;
}

.header-line {
    width: 0; /* Animated with JS */
    height: 1px;
    background-color: var(--color-text-dark);
}

.horizontal-scroll-wrapper {
    height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
}

.horizontal-scroll-container {
    display: flex;
    flex-wrap: nowrap;
    gap: 4vw;
    padding: 0 5vw;
    height: 70vh;
    width: 180vw;
}

.property-card {
    flex: 1;
    height: 100%;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    overflow: hidden;
}

.card-image-wrapper {
    width: 100%;
    height: 75%;
    overflow: hidden;
    position: relative;
    margin-bottom: 1.5rem;
}

.card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.property-card:hover .card-img {
    transform: scale(1.05);
}

.card-info {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex-grow: 1;
}

.card-price {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--color-accent);
    margin-bottom: 0.5rem;
}

.card-title {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}

.card-location {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 1rem;
}

.card-link {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 500;
    position: relative;
    align-self: flex-start;
    padding-bottom: 5px;
}

.card-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0%;
    height: 1px;
    background-color: var(--color-text-dark);
    transition: width 0.3s ease;
}

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

/* 3. PROPERTY STORYTELLING SECTION */
.story-section {
    background-color: var(--color-bg-dark);
    padding: 15vh 0;
    color: var(--color-text-light);
}

.story-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20vh;
    gap: 5vw;
}

.story-container.reverse {
    flex-direction: row-reverse;
}

.story-content {
    flex: 1;
    max-width: 500px;
}

.story-title {
    font-size: clamp(2.5rem, 4vw, 4rem);
    line-height: 1.1;
    margin-bottom: 2rem;
    clip-path: polygon(0 0, 100% 0, 100% 100%, 0% 100%);
}

.story-text {
    font-size: 1.1rem;
    line-height: 1.6;
    color: #ccc;
    clip-path: polygon(0 0, 100% 0, 100% 100%, 0% 100%);
}

.story-image-container {
    flex: 1.5;
    height: 70vh;
    overflow: hidden;
    position: relative;
    border-radius: 4px;
}

.story-image-container.small-image {
    flex: 1;
    height: 60vh;
}

.story-img {
    width: 100%;
    height: 130%; /* Larger than container for parallax */
    object-fit: cover;
    position: absolute;
    top: -15%;
    left: 0;
}

/* Media query for storytelling section */
@media (max-width: 900px) {
    .story-container, .story-container.reverse {
        flex-direction: column;
        gap: 3rem;
    }
    
    .story-content {
        max-width: 100%;
    }
    
    .story-image-container {
        width: 100%;
        height: 50vh;
    }
}

/* 4. PINNED CINEMATIC SECTION */
.pinned-section {
    height: 300vh; /* Allow for scrolling while pinned */
    background-color: var(--color-bg-light);
    color: var(--color-text-dark);
    position: relative;
}

.pinned-container {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 5vw;
    position: sticky;
    top: 0;
    overflow: hidden;
}

.pinned-text-container {
    flex: 1;
    z-index: 10;
    max-width: 500px;
}

.pinned-title {
    font-size: clamp(3rem, 5vw, 5rem);
    line-height: 1.1;
    margin-bottom: 2rem;
    text-transform: uppercase;
}

.pinned-description {
    font-size: 1.2rem;
    line-height: 1.6;
    color: #444;
}

.pinned-images-wrapper {
    flex: 1.5;
    height: 80vh;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.pinned-image-item {
    position: absolute;
    width: 80%;
    height: 100%;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
}

.pinned-image-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Initial states for animations */
.pinned-image-item.item-1 { z-index: 1; }
.pinned-image-item.item-2 { z-index: 2; clip-path: polygon(0 100%, 100% 100%, 100% 100%, 0% 100%); }
.pinned-image-item.item-3 { z-index: 3; clip-path: polygon(0 100%, 100% 100%, 100% 100%, 0% 100%); }

@media (max-width: 900px) {
    .pinned-container {
        flex-direction: column;
        justify-content: center;
        gap: 2rem;
    }
    .pinned-text-container, .pinned-images-wrapper {
        flex: none;
        width: 100%;
    }
    .pinned-images-wrapper {
        height: 50vh;
    }
}

/* 5. BENEFITS SECTION */
.benefits-section {
    background-color: var(--color-bg-dark);
    padding: 15vh 0;
    color: var(--color-text-light);
}

.benefits-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 4rem;
}

.benefit-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.benefit-icon {
    font-size: 3rem;
    color: var(--color-accent);
    margin-bottom: 1.5rem;
}

.benefit-title {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    letter-spacing: 1px;
}

.benefit-text {
    font-size: 1rem;
    line-height: 1.6;
    color: #aaa;
}

/* 6. PROPERTY GALLERY */
.gallery-section {
    background-color: var(--color-bg-light);
    color: var(--color-text-dark);
    padding: 15vh 0;
}

.gallery-title {
    margin-bottom: 3rem;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: 300px;
    gap: 1.5rem;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 4px;
    cursor: pointer;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.gallery-item:hover img {
    transform: scale(1.08);
}

.item-tall {
    grid-row: span 2;
    grid-column: span 2;
}

.item-wide {
    grid-column: span 2;
}

@media (max-width: 900px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-auto-rows: 250px;
    }
    
    .item-tall {
        grid-row: span 1;
        grid-column: span 2;
    }
}

@media (max-width: 600px) {
    .gallery-grid {
        grid-template-columns: 1fr;
    }
    
    .item-wide {
        grid-column: span 1;
    }
}

/* 7. CALL TO ACTION SECTION */
.cta-section {
    background-color: var(--color-bg-dark);
    color: var(--color-text-light);
    padding: 20vh 0;
    text-align: center;
}

.cta-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.cta-title {
    font-size: clamp(3rem, 6vw, 6rem);
    line-height: 1.1;
    margin-bottom: 4rem;
    text-transform: uppercase;
}

.cta-button {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem 4rem;
    font-size: 1.2rem;
    font-weight: 500;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--color-text-dark);
    overflow: hidden;
    border-radius: 50px;
    transition: color 0.4s ease;
}

.cta-btn-text {
    position: relative;
    z-index: 2;
}

.cta-btn-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--color-accent);
    z-index: 1;
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    border-radius: 50px;
}

.cta-button::before {
    content: '';
    position: absolute;
    top: -2px; left: -2px; right: -2px; bottom: -2px;
    background: linear-gradient(45deg, transparent, rgba(201, 169, 110, 0.5), transparent);
    z-index: 0;
    border-radius: 50px;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.cta-button:hover {
    color: var(--color-text-light);
}

.cta-button:hover .cta-btn-bg {
    transform: scale(1.1);
    background-color: #a38550;
}

.cta-button:hover::before {
    opacity: 1;
    animation: glow 1.5s linear infinite;
}

@keyframes glow {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 8. FOOTER */
.footer {
    background-color: #050505;
    color: #fff;
    padding: 10vh 0 2rem 0;
    border-top: 1px solid rgba(255,255,255,0.05);
}

.footer-container {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 3rem;
    margin-bottom: 5rem;
}

.footer-brand {
    max-width: 300px;
}

.footer-logo {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: var(--color-accent);
}

.footer-tagline {
    font-size: 0.9rem;
    color: #888;
}

.footer-links {
    display: flex;
    gap: 5vw;
}

.footer-links ul {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.footer-links a {
    color: #aaa;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: var(--color-accent);
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 2rem;
    font-size: 0.8rem;
    color: #666;
}

@media (max-width: 768px) {
    .footer-container {
        flex-direction: column;
    }
    
    .footer-links {
        flex-direction: column;
        gap: 2rem;
    }
    
    .footer-bottom {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
}

/* Lenis Recommended Styles */
html.lenis, html.lenis body {
  height: auto;
}
.lenis.lenis-smooth {
  scroll-behavior: auto !important;
}
.lenis.lenis-smooth [data-lenis-prevent] {
  overscroll-behavior: contain;
}
.lenis.lenis-stopped {
  overflow: hidden;
}
.lenis.lenis-smooth iframe {
  pointer-events: none;
}

/* 9. 3D MODAL OVERLAY */
#three-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(10, 10, 10, 0.95);
    z-index: 9999;
    display: none;
    opacity: 0;
}

#three-modal.active {
    display: block;
    pointer-events: all;
}

#three-canvas-container {
    width: 100%;
    height: 100%;
}

.modal-ui {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    padding: 2rem 5vw;
    display: flex;
    justify-content: space-between;
    align-items: center;
    pointer-events: none;
}

.modal-ui > * {
    pointer-events: auto;
}

.modal-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.modal-btn {
    background-color: transparent;
    border: 1px solid var(--color-accent);
    color: var(--color-accent);
    padding: 0.5rem 1.5rem;
    border-radius: 50px;
    font-family: var(--font-body);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.modal-btn:hover {
    background-color: var(--color-accent);
    color: var(--color-bg-dark);
}

.modal-select {
    background-color: rgba(10, 10, 10, 0.8);
    border: 1px solid var(--color-accent);
    color: var(--color-accent);
    padding: 0.5rem 1rem;
    border-radius: 5px;
    font-family: var(--font-body);
    outline: none;
    cursor: pointer;
}

.modal-select option {
    background-color: var(--color-bg-dark);
    color: var(--color-text-light);
}

.close-btn {
    font-size: 1.5rem;
    background: none;
    border: none;
    color: var(--color-accent);
    cursor: pointer;
    padding: 0.5rem;
    transition: transform 0.3s ease;
}

.close-btn:hover {
    transform: rotate(90deg);
}