@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;500;600;700&display=swap');

:root {
    --bs-pure-black: #1a1a1a;
    --bs-black: #333;
    --bs-grey: #ebebeb;
    --bs-grey-light: #f5f5f5;
    --bs-grey-lighter: #fafafa;
    --bs-white: #fff;
    --bs-warm-wood: #c5a47e; /* Added warm wood accent */
    --bs-neutral-grey: #8e8e8e;
    
    --bg-color: var(--bs-white);
    --text-color: var(--bs-pure-black);
    --border-color: var(--bs-grey);
    --font-main: 'Montserrat', sans-serif;
    --transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    --header-height: 120px;
}

/* ... (body and container unchanged) ... */

/* Cinematic Image Handling */
.cinematic-img-wrapper {
    position: relative;
    overflow: hidden;
    background: #000;
}

.cinematic-img-wrapper::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, rgba(0,0,0,0.2) 0%, rgba(255,255,255,0.05) 100%);
    pointer-events: none;
}

/* Spacious Section Layouts */
.foster-section {
    padding: 200px 80px; /* Increased padding for 'open-plan' feel */
    background: var(--bg-color);
}

.foster-section.grey {
    background: var(--bs-grey-light);
}

.foster-section.wood-accent {
    border-left: 4px solid var(--bs-warm-wood);
}

/* Refined Typography for Lifestyle */
.lifestyle-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.4em;
    color: var(--bs-warm-wood);
    font-weight: 700;
    margin-bottom: 30px;
    display: block;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 80px;
    margin-top: 100px;
    border-top: 1px solid var(--border-color);
    padding-top: 60px;
}

.stat-item h4 {
    font-size: 3rem;
    font-weight: 300;
    margin-bottom: 10px;
}

.stat-item p {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    opacity: 0.6;
}

body.dark-theme {
    --bg-color: var(--bs-pure-black);
    --text-color: var(--bs-white);
    --border-color: #333;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-main);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    transition: background-color 0.4s ease, color 0.4s ease;
}

/* Container */
.container {
    max-width: 100%;
    margin: 0;
    padding: 0;
}

/* Typography */
h1, h2, h3, h4 {
    font-weight: 300;
    text-transform: none;
    letter-spacing: -0.04em;
}

h1 { 
    font-size: clamp(3rem, 10vw, 7rem); 
    line-height: 0.9; 
    margin-bottom: 40px;
}

h2 { 
    font-size: clamp(1.8rem, 5vw, 4rem); 
    line-height: 1.05;
}

h3 { font-size: 1.2rem; font-weight: 500; text-transform: uppercase; letter-spacing: 0.1em; }

p {
    font-size: 1.1rem;
    font-weight: 300;
    color: inherit;
    opacity: 0.8;
    max-width: 850px;
    line-height: 1.6;
}

/* Navigation */
#header {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 2000;
    height: var(--header-height);
    display: flex;
    align-items: center;
    background: linear-gradient(to bottom, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0) 100%);
    color: #fff;
    transition: all 0.4s ease;
}

#header.scrolled {
    position: fixed;
    height: 90px;
    background: rgba(10, 10, 10, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 80px;
    width: 100%;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 30px;
}

.mobile-toggle {
    display: none;
    flex-direction: column;
    gap: 6px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    z-index: 2002;
}

.mobile-toggle span {
    display: block;
    width: 25px;
    height: 1px;
    background: #fff;
    transition: var(--transition);
}

.mobile-toggle.is-active span:nth-child(1) {
    transform: translateY(3.5px) rotate(45deg);
}

.mobile-toggle.is-active span:nth-child(2) {
    transform: translateY(-3.5px) rotate(-45deg);
}

.logo {
    font-size: 1.2rem;
    font-weight: 700;
    text-decoration: none;
    color: #fff;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.logo span { 
    color: rgba(255, 255, 255, 0.5); 
    font-weight: 300; 
    margin-left: 5px;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 60px;
}

.nav-item {
    position: relative;
}

.nav-links > li > a {
    text-decoration: none;
    color: #fff;
    font-size: 0.85rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    position: relative;
    padding: 10px 0;
    transition: color 0.3s ease;
}

/* Dropdown Base (Organic Glassy) */
.dropdown {
    position: absolute;
    top: 100%; /* Positioned directly below */
    left: -30px;
    background: rgba(15, 15, 15, 0.4);
    backdrop-filter: blur(25px);
    min-width: 280px;
    list-style: none;
    padding: 25px 0;
    margin-top: 15px; /* Visual gap maintained by margin */
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(20px) scale(0.95);
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 0;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5);
    z-index: 2001;
}

#header.scrolled .dropdown {
    background: rgba(10, 10, 10, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Invisible bridge to prevent dropdown from closing when moving mouse through the gap */
.dropdown::before {
    content: '';
    position: absolute;
    top: -20px;
    left: 0;
    width: 100%;
    height: 20px;
}

.nav-item:hover .dropdown {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

.dropdown li {
    position: relative;
    padding: 0 15px;
}

.dropdown a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
    letter-spacing: 0.2em;
    font-weight: 500;
    text-transform: uppercase;
    transition: all 0.3s ease;
    border-radius: 0;
    cursor: pointer;
    text-decoration: none;
    position: relative; /* Ensure it still has positioning for other needs if any */
}

.dropdown a:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
}

/* Submenu Toggle Indicator */
.has-submenu::after {
    content: '›';
    font-size: 1.2rem;
    margin-left: 10px;
    transition: transform 0.3s ease;
    line-height: 1;
}

.is-open .has-submenu::after {
    transform: rotate(90deg);
    color: rgba(255, 255, 255, 0.8);
}

/* Submenu (Click Triggered) */
.submenu {
    list-style: none;
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
    opacity: 0;
    border-left: 1px solid rgba(255, 255, 255, 0.2);
    margin-left: 15px;
}

.is-open .submenu {
    max-height: 300px; /* Large enough for content */
    opacity: 1;
    padding: 5px 0 15px 0;
    margin-top: 5px;
}

.submenu a {
    padding: 8px 15px;
    font-size: 0.65rem;
    opacity: 0.5;
    text-transform: uppercase;
    text-decoration: none;
}

.submenu a:hover {
    opacity: 1;
    background: transparent;
    transform: translateX(5px);
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateX(-5px); }
    to { opacity: 1; transform: translateX(0); }
}

.nav-links > li > a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--bs-white);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.nav-links > li > a:hover::after {
    transform: scaleX(1);
    transform-origin: left;
}

/* Remove underline for nav-item (Layihələr) */
.nav-item > a:hover::after {
    transform: scaleX(0);
}

.btn-contact {
    color: #fff;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    padding: 12px 30px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
}

.btn-contact:hover {
    background: #fff;
    color: #000;
    border-color: #fff;
}

/* Form Styles */
.foster-input {
    width: 100%;
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--border-color);
    padding: 20px 0;
    font-family: var(--font-main);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-color);
    outline: none;
    transition: var(--transition);
}

.foster-input:focus {
    border-bottom-color: var(--bs-warm-wood);
}

.foster-input::placeholder {
    color: rgba(0,0,0,0.3);
}

body.dark-theme .foster-input {
    color: #fff;
    border-bottom-color: #333;
}

body.dark-theme .foster-input::placeholder {
    color: rgba(255,255,255,0.2);
}

/* Hero Section */
.foster-hero {
    height: 100vh;
    width: 100%;
    position: relative;
    overflow: hidden;
    background: var(--bs-pure-black);
}

.hero-bg-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(0.7);
    transition: transform 10s linear;
}

.foster-hero:hover .hero-bg-img {
    transform: scale(1.1);
}

.hero-content {
    position: absolute;
    bottom: 120px;
    left: 60px;
    color: #fff;
    max-width: 1000px;
}

.hero-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.3em;
    margin-bottom: 30px;
    display: block;
    font-weight: 600;
    color: var(--bs-grey-dark);
}

/* Sharp Project Grid (Compact) */
.foster-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px; /* Increased gap for a more modern, spaced look */
    padding: 80px; /* Generous padding around the grid */
    background: var(--bg-color);
}

.grid-project {
    position: relative;
    aspect-ratio: 16 / 9; /* Rectangular shape */
    overflow: hidden;
    text-decoration: none;
    color: #fff;
    background: var(--bs-pure-black);
}

.grid-project::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(0,0,0,0.6) 0%, rgba(0,0,0,0) 50%, rgba(0,0,0,0.3) 100%);
    opacity: 0.4; /* Base shading */
    transition: opacity 0.5s ease;
    z-index: 1;
}

.grid-project:hover::after {
    opacity: 0.7; /* Stronger shading on hover */
}

.grid-project img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 1.5s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 0;
}

.grid-project:hover img {
    transform: scale(1.05);
}

.project-info {
    position: absolute;
    bottom: 30px;
    left: 30px;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.5s ease, transform 0.5s ease;
    z-index: 2; /* Layered above overlay */
}

.grid-project:hover .project-info {
    opacity: 1;
    transform: translateY(0);
}

.project-cat {
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
}

.project-title {
    font-size: 1.4rem;
    font-weight: 400;
}

/* Sections */
.foster-section {
    padding: 180px 60px;
    background: var(--bg-color);
}

.foster-section.dark {
    background: var(--bs-pure-black);
    color: var(--bs-white);
}

.section-title {
    margin-bottom: 80px;
    max-width: 1300px;
}

/* Footer (Component Placeholder) */
#footer {
    background: var(--bs-pure-black);
    color: var(--bs-white);
    padding: 120px 60px 60px;
    border-top: 1px solid #333;
}

.footer-inner {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 120px;
}

.footer-col h4 {
    margin-bottom: 40px;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: #666;
    font-weight: 600;
}

.footer-links {
    list-style: none;
}

.footer-links li { margin-bottom: 20px; }

.footer-links a {
    text-decoration: none;
    color: #fff;
    font-size: 0.85rem;
    transition: opacity 0.3s;
    font-weight: 300;
}

.footer-links a:hover { opacity: 0.5; }

/* Responsive */
@media (max-width: 1200px) {
    .footer-inner { gap: 60px; }
    nav { padding: 0 40px; }
    .hero-content { left: 40px; }
}

@media (max-width: 1024px) {
    .foster-grid { grid-template-columns: 1fr; }
    .grid-project { height: 70vh; }
    .footer-inner { grid-template-columns: 1fr; gap: 80px; }
    
    .mobile-toggle { display: flex; }
    
    .nav-links {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background: #000;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        padding: 40px;
        z-index: 2001;
    }

    .nav-links.is-active {
        display: flex;
    }

    .nav-links > li {
        width: 100%;
        text-align: center;
    }

    .nav-links > li > a {
        font-size: 1.5rem;
    }

    .dropdown {
        position: static;
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transform: none;
        background: transparent;
        box-shadow: none;
        border: none;
        min-width: 0;
        width: 100%;
        max-height: 0;
        overflow: hidden;
        padding: 0;
        margin-top: 0;
    }

    .nav-item.is-open .dropdown {
        max-height: 1000px;
        padding: 20px 0;
    }

    .dropdown a {
        justify-content: center;
        font-size: 1rem;
    }
}
