:root {
    /* Default: Light Mode */
    --primary: #4a6647; 
    --primary-light: #668c62;
    --primary-dark: #2a3d28;
    --accent: #d48b6c; 
    --bg-main: #f9fbf9;
    --bg-secondary: #eef2ee;
    --bg-card: rgba(255, 255, 255, 0.7);
    --text-main: #1a231a;
    --text-muted: #4a5c4a;
    --border: rgba(0, 0, 0, 0.05);
    --shadow: rgba(0, 0, 0, 0.05);
    --nav-bg: rgba(249, 251, 249, 0.8);
    --logo-filter: none;
    
    --font-main: 'Outfit', sans-serif;
}

/* Dark Mode Variables */
html.dark-theme {
    --primary: #5c7c59; 
    --primary-light: #7b9c78;
    --primary-dark: #3a5438;
    --accent: #e59c7d; 
    --bg-main: #0f1412;
    --bg-secondary: #151c19;
    --bg-card: rgba(255, 255, 255, 0.03);
    --text-main: #f0f4f0;
    --text-muted: #a4b3a4;
    --border: rgba(255, 255, 255, 0.1);
    --shadow: rgba(0, 0, 0, 0.5);
    --nav-bg: rgba(15, 20, 18, 0.8);
    /* For dark mode, add a glow so the natural color logo is still visible against dark bg */
    --logo-filter: drop-shadow(0px 0px 5px rgba(255, 255, 255, 0.4));
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    font-family: var(--font-main);
    overflow-x: hidden;
    line-height: 1.6;
    transition: background-color 0.5s ease, color 0.5s ease;
}

/* Loader */
.loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: var(--bg-main);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
}

.loader-text {
    font-size: 3rem;
    font-weight: 300;
    letter-spacing: 5px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    opacity: 0;
}

/* Typography */
h1, h2, h3 {
    font-weight: 500;
    line-height: 1.2;
}

/* Nav */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    padding: 1.0rem 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
    background: var(--nav-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    transition: padding 0.3s ease, background-color 0.5s ease;
}

.navbar.scrolled {
    padding: 1rem 5%;
}

.logo {
    z-index: 101;
    display: flex;
    align-items: center;
}

.logo img {
    height: 60px;
    min-height: 60px;
    object-fit: contain;
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a {
    color: var(--text-main);
    text-decoration: none;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    transition: color 0.3s;
}

.nav-links a:hover {
    color: var(--primary-light);
}

.nav-links a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    background: var(--primary);
    left: 0;
    bottom: -4px;
    transition: width 0.3s ease;
}

.nav-links a:hover::after {
    width: 100%;
}

.nav-controls {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    z-index: 101;
}

/* Dropdown Selector */
.lang-selector {
    position: relative;
    display: inline-block;
}

.current-lang-btn {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    border-radius: 2px;
    box-shadow: 0 2px 4px var(--shadow);
    transition: transform 0.3s;
    height: fit-content;
}

.current-lang-btn:hover {
    transform: scale(1.05);
}

.lang-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 10px;
    background: rgba(235, 238, 235, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 10px 20px var(--shadow);
    min-width: 80px;
}

.lang-selector.open .lang-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.lang-btn {
    background: none;
    border: none;
    cursor: pointer;
    transition: background 0.3s, color 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
    border-radius: 4px;
    padding: 6px 10px;
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 500;
}

.lang-btn svg {
    border-radius: 2px;
    box-shadow: 0 1px 2px var(--shadow);
}

.lang-btn.active, .lang-btn:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--primary);
}

html.dark-theme .lang-btn.active, html.dark-theme .lang-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

html.dark-theme .lang-dropdown {
    background: rgba(50, 54, 50, 0.65);
}

.theme-toggle {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s;
}

.theme-toggle:hover {
    color: var(--accent);
}

.hamburger {
    display: none;
    flex-direction: column;
    gap: 6px;
    cursor: pointer;
    z-index: 101;
}

.hamburger span {
    width: 30px;
    height: 2px;
    background: var(--text-main);
    transition: 0.3s;
}

.hamburger.active span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.hamburger.active span:nth-child(2) {
    transform: translateY(-8px) rotate(-45deg);
}

.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: var(--bg-main);
    z-index: 99;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    transform: translateY(-100%);
    transition: transform 0.6s cubic-bezier(0.8, 0, 0.2, 1);
}

.mobile-menu-overlay.active {
    transform: translateY(0);
}

.mobile-menu-overlay a {
    color: var(--text-main);
    text-decoration: none;
    font-size: 2rem;
    font-weight: 300;
    text-transform: uppercase;
    letter-spacing: 2px;
    transition: color 0.3s;
}

.mobile-menu-overlay a:hover {
    color: var(--primary);
}

/* Hero */
.hero {
    position: relative;
    height: 100vh;
    display: flex;
    align-items: center;
    padding: 0 5%;
}

.spline-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    transition: opacity 0.5s;
}

html.dark-theme .spline-container {
    opacity: 0.5; /* Dim spline a bit in dark mode so text pops */
}

.spline-container spline-viewer {
    width: 100%;
    height: 100%;
}

.hero-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    z-index: 1;
    gap: 4rem;
}

.hero-content {
    flex: 1.2;
    pointer-events: none;
}

.hero-image-container {
    flex: 1;
    position: relative;
    perspective: 1000px;
}

.hero-floating-img {
    width: 100%;
    max-width: 500px;
    height: auto;
    border-radius: 40px 10px 40px 10px;
    box-shadow: 0 30px 60px rgba(0,0,0,0.3);
    object-fit: cover;
    opacity: 1; /* Handled by GSAP fromTo */
}

.hero-title {
    font-size: 5vw;
    font-weight: 300;
    margin-bottom: 1.5rem;
    pointer-events: auto;
}

.hero-title .line {
    display: block;
    overflow: hidden;
}

.hero-title .highlight {
    font-weight: 700;
    background: linear-gradient(90deg, var(--primary-light), var(--primary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    font-size: 1.2rem;
    color: var(--text-main);
    max-width: 500px;
    margin-bottom: 2rem;
    opacity: 0;
    pointer-events: auto;
}

.btn {
    display: inline-block;
    padding: 1rem 2.5rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 500;
    letter-spacing: 1px;
    transition: transform 0.3s, box-shadow 0.3s, background-color 0.5s;
    opacity: 0;
    pointer-events: auto;
    cursor: pointer;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
    border: 1px solid var(--primary-light);
}

.btn-primary:hover {
    box-shadow: 0 10px 20px var(--shadow);
}

/* Sections */
section {
    padding: 8rem 5%;
}

/* Home Intro Text Block */
.home-intro {
    padding: 6rem 10% 2rem;
    text-align: center;
    background: var(--bg-main);
}

.home-intro-container {
    max-width: 900px;
    margin: 0 auto;
}

.home-intro p {
    font-size: 1.15rem;
    color: var(--text-muted);
    line-height: 1.8;
    margin-bottom: 1.5rem;
}

.home-intro p.lead-text {
    font-size: 1.4rem;
    color: var(--text-main);
    font-weight: 500;
}

/* About Section Profile Layout */
.about {
    padding: 3rem 10% 6rem;
    background: var(--bg-main);
}

.about-profile {
    display: flex;
    gap: 4rem;
    align-items: center;
    margin-top: 3rem;
}

.about-image-container {
    flex: 1;
    clip-path: circle(100% at 50% 50%); /* Base state for ScrollTrigger manipulation if wanted */
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 15px 30px var(--shadow);
}

.about-founder-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    aspect-ratio: 4/5;
    transition: transform 0.5s ease;
}

.about-image-container:hover .about-founder-img {
    transform: scale(1.05);
}

.about-story {
    flex: 1.2;
}

.about-story p {
    font-size: 1.1rem;
    color: var(--text-muted);
    line-height: 1.8;
    margin-bottom: 1.2rem;
}

.about-story p:last-child {
    margin-bottom: 0;
}

@media (max-width: 900px) {
    .about-profile {
        flex-direction: column;
        gap: 2rem;
    }
    .about-image-container {
        width: 100%;
    }
}
/* Services */
.services {
    background: linear-gradient(to bottom, var(--bg-main), var(--bg-secondary));
    padding: 8rem 0; /* Removing side padding for full-width masked reveals inside wrappers */
}

/* Pin wrapper logic used in JS */
.pinned-services-container {
    display: flex;
    flex-wrap: wrap;
}

.services-wrapper {
    display: flex;
    flex-direction: column;
    gap: 15rem;
    width: 100%;
    padding: 0 5%;
}

.service-item {
    display: flex;
    align-items: center;
    gap: 5rem;
}

.service-item.reverse {
    flex-direction: row-reverse;
}

.service-image-container {
    flex: 1;
    height: 500px;
    border-radius: 20px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 20px 50px var(--shadow);
}

.service-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    /* We'll scale this down slightly via GSAP on load */
    transform: scale(1.2); 
}

.service-content {
    flex: 1;
}

.service-content h2 {
    font-size: 3rem;
    margin-bottom: 1.5rem;
    color: var(--primary-light);
}

.service-content p {
    font-size: 1.2rem;
    color: var(--text-muted);
}

/* Works Section Setup for Portfolio */
.works {
    padding: 8rem 10%;
    background: var(--bg-card);
}

.works-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 4rem;
}

.work-item {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 10px 20px var(--shadow);
}

.work-image-container {
    padding-bottom: 100%; /* square ratio */
    position: relative;
    overflow: hidden;
    width: 100%;
}

.work-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 110%; /* slight excess for hover scale */
    height: 110%;
    background-size: cover;
    background-position: center;
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.work-item:hover .work-image {
    transform: scale(1.05);
}

/* Contact CTA Section */
.contact-cta {
    padding: 8rem 5% 4rem;
    background: var(--bg-main);
}

.cta-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-secondary);
    border-radius: 40px;
    padding: 5rem;
    box-shadow: 0 30px 60px var(--shadow);
    gap: 4rem;
    position: relative;
    overflow: hidden;
}

.cta-content {
    flex: 1;
    z-index: 2;
}

.cta-title {
    font-size: 4rem;
    color: var(--accent);
    margin-bottom: 1rem;
    line-height: 1.1;
}

.cta-desc {
    font-size: 1.2rem;
    color: var(--text-muted);
    margin-bottom: 3rem;
    max-width: 400px;
}

.cta-details {
    margin-bottom: 3rem;
}

.cta-details p {
    font-size: 1.1rem;
    color: var(--text-main);
    margin-bottom: 0.8rem;
}

.cta-name {
    font-size: 1.3rem !important;
    color: var(--primary) !important;
}

.cta-details a {
    color: var(--primary-light);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
    display: inline-block;
}

.cta-details a:hover {
    color: var(--accent);
}

.cta-socials h3 {
    font-size: 1.3rem;
    color: var(--text-main);
    margin-bottom: 1rem;
}

.social-icons {
    display: flex;
    gap: 1.5rem;
}

.social-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--bg-main);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 10px 20px var(--shadow);
}

.social-icon:hover {
    background: var(--primary);
    color: #fff;
    transform: translateY(-5px);
}

.cta-spline-container {
    flex: 1.2;
    aspect-ratio: 1 / 1;
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    z-index: 1;
    background: var(--bg-main);
    box-shadow: inset 0 0 30px rgba(0,0,0,0.02);
}

/* Algarve Map */
#algarve-map {
    width: 100%;
    height: 100%;
    border-radius: 20px;
    z-index: 1;
}

.custom-map-marker {
    background: none !important;
    border: none !important;
}

.marker-pin {
    filter: drop-shadow(0 3px 6px rgba(0,0,0,0.4));
    animation: marker-bounce 0.6s ease-out;
}

@keyframes marker-bounce {
    0% { transform: translateY(-30px); opacity: 0; }
    60% { transform: translateY(5px); opacity: 1; }
    100% { transform: translateY(0); }
}

.succulent-popup .leaflet-popup-content-wrapper {
    background: var(--bg-secondary);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    border: 1px solid var(--border);
}

.succulent-popup .leaflet-popup-tip {
    background: var(--bg-secondary);
}

.map-popup {
    font-family: var(--font-main);
    padding: 4px 2px;
    text-align: center;
}

.map-popup strong {
    font-size: 1.05rem;
    color: var(--primary);
    display: block;
    margin-bottom: 4px;
}

.map-popup span {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Minimal Footer */
.footer-minimal {
    background: var(--bg-main);
    padding: 0 5% 2rem;
}

.footer-bottom {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    border-top: 1px solid var(--border);
    padding-top: 2rem;
}

.footer-bottom a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.3s;
}

.footer-bottom a:hover {
    color: var(--accent);
}

/* Mobile */
@media (max-width: 900px) {
    .nav-links {
        display: none;
    }
    .hamburger {
        display: flex;
    }
    .hero-wrapper {
        flex-direction: column-reverse; /* Put image above text or hide if too cluttered */
        justify-content: center;
        text-align: center;
        gap: 2rem;
    }
    .hero-content {
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    .hero-floating-img {
        max-width: 280px;
        margin: 0 auto;
        border-radius: 30px 10px 30px 10px;
    }
    .hero-title {
        font-size: 12vw;
    }
    .service-item, .service-item.reverse {
        flex-direction: column;
        gap: 2rem;
    }
    .service-image-container {
        width: 100%;
        height: 350px;
        flex: none; /* Prevent flex-basis: 0 from collapsing height in column layout */
    }
    section {
        padding: 5rem 5%;
    }
    .services-wrapper {
        gap: 5rem;
    }
    .cta-wrapper {
        flex-direction: column;
        padding: 3rem 2rem;
        gap: 3rem;
    }
    .cta-title {
        font-size: 2.8rem;
    }
    .cta-spline-container {
        width: 100%;
        aspect-ratio: 16 / 9;
        flex: none;
    }
}
