/* --- CSS Variables & Theming --- */
:root {
    --bg-dark: #000000;
    --text-primary: #ffffff;
    --text-secondary: #aaaaaa;
    --text-muted: #555555;
    --accent: #4CAF50;
    /* Brand green identity */

    --font-display: 'Syne', sans-serif;
    --font-body: 'Plus Jakarta Sans', sans-serif;
}

/* --- Base Reset & Typography --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

/* --- Global Progress Bar --- */
#global-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.05);
    pointer-events: none;
}

#global-progress-bar {
    height: 100%;
    width: 0%;
    background: var(--accent);
    transform-origin: left;
    transition: width 0.1s linear;
}

h1,
h2,
h3,
h4,
.loader-brand,
.logo {
    font-family: var(--font-display);
    font-weight: 700;
}

/* --- Loader --- */
#loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: var(--bg-dark);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: opacity 0.8s ease-out;
}

.loader-brand {
    font-size: 4rem;
    letter-spacing: -2px;
    margin-bottom: 2rem;
}

.loader-brand-img {
    height: 80px;
    /* Adjust based on original text size */
    width: auto;
    margin-bottom: 2rem;
    object-fit: contain;
}

.loader-progress-wrap {
    width: 200px;
    height: 2px;
    background: var(--text-muted);
    position: relative;
    overflow: hidden;
}

#loader-bar {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0%;
    background: var(--text-primary);
    transition: width 0.1s linear;
}

#loader-percent {
    margin-top: 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
}

/* --- Header --- */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 1.5rem 4vw;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    background-color: #000000;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    pointer-events: auto;
}

.site-header>* {
    pointer-events: auto;
}

.logo {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.header-logo-img {
    height: 45px;
    /* Adjust to match previous text height */
    width: auto;
    object-fit: contain;
}

.desktop-nav {
    display: flex;
    gap: 2.5rem;
    align-items: center;
}

.desktop-nav a {
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: color 0.3s;
}

.desktop-nav a:hover {
    color: var(--accent);
}

.btn-outline {
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 0.75rem 1.75rem;
    border-radius: 50px;
    transition: all 0.3s ease;
    background: transparent;
    overflow: hidden;
    position: relative;
    z-index: 1;
    color: var(--text-primary);
    /* Ensure base color */
}

.btn-outline::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--text-primary);
    z-index: -1;
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

.btn-outline:hover {
    color: var(--bg-dark);
    border-color: var(--text-primary);
}

.btn-outline:hover::before {
    transform: scaleX(1);
    transform-origin: left;
}

/* --- Buttons --- */
.btn-primary,
.btn-secondary {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    padding: 1rem 2.5rem;
    text-decoration: none;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: 50px;
    transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1);
    cursor: pointer;
    border: none;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.btn-primary::after,
.btn-secondary::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--accent);
    z-index: -1;
    transform: scaleY(0);
    transform-origin: bottom;
    transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

.btn-primary {
    background-color: var(--text-primary);
    color: var(--bg-dark);
}

.btn-primary:hover {
    color: white;
}

.btn-primary:hover::after {
    transform: scaleY(1);
    transform-origin: top;
}

.btn-secondary {
    background-color: transparent;
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.btn-secondary:hover {
    color: white;
    border-color: transparent;
}

.btn-secondary:hover::after {
    transform: scaleY(1);
    transform-origin: top;
}

/* --- Mobile Menu Styles --- */
.mobile-toggle {
    display: none;
    /* Hidden on desktop */
    flex-direction: column;
    justify-content: space-around;
    width: 32px;
    height: 24px;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 1002;
    padding: 0;
}

.mobile-toggle span {
    width: 100%;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: all 0.3s linear;
    position: relative;
    transform-origin: 1px;
}

/* Toggle Animation Classes */
.mobile-toggle.active span:nth-child(1) {
    transform: rotate(45deg);
}

.mobile-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-toggle.active span:nth-child(3) {
    transform: rotate(-45deg);
}

.mobile-nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    z-index: 1001;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.mobile-nav-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.mobile-nav-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    transform: translateY(20px);
    transition: transform 0.4s ease;
}

.mobile-nav-overlay.active .mobile-nav-inner {
    transform: translateY(0);
}

.mobile-link {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
    text-transform: uppercase;
    transition: color 0.3s;
}

.mobile-link:hover {
    color: var(--accent);
}

.mobile-btn-outline {
    margin-top: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 1rem 3rem;
    border-radius: 50px;
    font-size: 1.25rem;
}

/* --- Hero Section --- */
.hero-standalone {
    position: relative;
    width: 100%;
    height: 100vh;
    background: transparent;
    display: flex;
    align-items: center;
    padding-left: 5vw;
    /* Left aligned, but gives space */
    z-index: 10;
}

.hero-content {
    max-width: 60vw;
}

.section-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 3px;
    margin-bottom: 2rem;
}

.hero-heading {
    font-size: clamp(4rem, 8vw, 8rem);
    line-height: 0.95;
    letter-spacing: -3px;
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
}

.hero-tagline {
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    color: var(--text-secondary);
    font-weight: 300;
    margin-bottom: 3rem;
}

.hero-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.scroll-indicator {
    position: absolute;
    bottom: 3rem;
    left: 5vw;
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.75rem;
    letter-spacing: 2px;
    color: var(--text-secondary);
}

.scroll-indicator svg {
    color: var(--text-primary);
    opacity: 0.8;
}

.scroll-wheel {
    animation: scrollWheel 1.5s infinite cubic-bezier(0.25, 1, 0.5, 1);
}

@keyframes scrollWheel {
    0% {
        transform: translateY(0);
        opacity: 1;
    }

    50% {
        transform: translateY(12px);
        opacity: 0;
    }

    50.01% {
        transform: translateY(-12px);
        opacity: 0;
    }

    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

/* --- Canvas Wrap Layout --- */
.canvas-wrap {
    position: fixed;
    top: 0;
    right: 0;
    width: 66.66vw;
    /* Right 2/3 of viewport */
    height: 100vh;
    z-index: 1;
    /* Below content, above background */
    display: flex;
    justify-content: center;
    align-items: center;
    /* Will be clipped during hero reveal */
}

canvas#canvas {
    width: 100%;
    height: 100%;
    object-fit: contain;
    /* ensures whole video is visible */
}

#dark-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: linear-gradient(to right, rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, 0.8) 33.33vw, rgba(0, 0, 0, 0) 100%);
    z-index: 2;
    /* Between canvas and text */
    pointer-events: none;
    opacity: 1;
}

/* --- Footer Wrap (Native scrolling sections at end) --- */
.footer-wrap {
    position: relative;
    z-index: 20;
    /* Above #scroll-container (5) and overlays (2) */
    background-color: #f4f4f4;
    width: 100%;
    padding: 6rem 0;
    /* Add top and bottom padding since it's normal flow */
    color: #111111;
}

.normal-section {
    position: relative;
    /* overriding .scroll-section absolute positioning context */
    width: 100%;
    margin-bottom: 4rem;
    /* Spacing between normal sections */
}

/* Light Mode Text Overrides applied to footer wrap */
.footer-wrap .section-heading,
.footer-wrap .section-label,
.footer-wrap .section-body,
.footer-wrap .feature-item h3,
.footer-wrap .feature-item p,
.footer-wrap .project-item h3,
.footer-wrap .project-item p,
.footer-wrap .contact-form input,
.footer-wrap .contact-form select,
.footer-wrap .contact-form textarea,
.footer-wrap .footer-info {
    color: #111111;
    border-color: #cccccc;
}

.footer-wrap .section-label {
    color: #444444;
}

.footer-wrap .contact-form input::placeholder,
.footer-wrap .contact-form textarea::placeholder {
    color: #888888;
}

.footer-wrap .contact-form option {
    background: #ffffff;
    color: #111111;
}

.footer-wrap .btn-primary {
    background-color: #4B792F;
    color: white;
}

.footer-wrap .btn-primary:hover {
    background-color: #3A6024;
}


/* --- Scroll Sections & Alignment --- */
#scroll-container {
    position: relative;
    width: 100%;
    height: 600vh;
    /* Increased to allow for 400vh+ of sections + buffer */
    z-index: 15;
    /* Above hero and dark overlay */
}

.scroll-spacer-hero {
    height: 100vh;
    width: 100%;
}

.scroll-section {
    position: absolute;
    left: 0;
    width: 100%;
    /* Positioned centrally via JS */
    transform: translateY(-50%);
    pointer-events: none;
}

.scroll-section .section-inner {
    pointer-events: auto;
    /* Re-enable clicks inside */
}

#a-propos {
    margin-top: 25vh;
}


/* Dynamic Content constrained to left 1/3 */
.align-left {
    padding-left: 5vw;
}

.align-left .section-inner {
    width: 30vw;
    margin-top: 10vh;
    /* Keeps text away from floating header */
    /* Leaves some margin before the canvas starts at 33.3vw */
}

/* Full Width Sections */
.align-center {
    display: flex;
    justify-content: center;
    padding: 0 5vw;
}

.align-center .section-inner {
    width: 100%;
    max-width: 1200px;
    text-align: center;
}

.align-center .section-heading {
    text-align: center;
}

/* Specific left alignment for the heading inside full-width section per mockup */
.align-center .section-label.left-brand {
    text-align: left;
    font-size: 1.25rem;
    font-weight: 800;
    color: #111;
    letter-spacing: 0;
    border-bottom: 2px solid #ddd;
    padding-bottom: 1rem;
    margin-bottom: 3rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.align-center .section-label.left-brand::after {
    content: '';
    flex-grow: 1;
    height: 1px;
    background: #ddd;
}

.section-heading {
    font-size: clamp(3rem, 4vw, 4.5rem);
    line-height: 1.05;
    letter-spacing: -2px;
    margin-bottom: 2rem;
}

.section-body {
    font-size: 1.125rem;
    line-height: 1.6;
    font-weight: 300;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

/* --- Component Typography & Spacing --- */
.features-list,
.project-grid {
    margin-top: 3rem;
}

.feature-item {
    margin-bottom: 2rem;
}

.feature-item h3 {
    font-family: var(--font-body);
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.feature-item p {
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.5;
}

/* --- Project Grid (Mockup Style) --- */
.project-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 4rem;
}

.project-card {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16/9;
    border-radius: 4px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.project-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

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

.project-card-title {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent);
    color: white !important;
    /* Always white text on dark gradient */
    padding: 2rem 1.5rem 1rem;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 1.125rem;
    text-align: left;
    margin: 0;
}

/* --- Contact Form --- */
.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 4rem;
}

.contact-form input,
.contact-form select,
.contact-form textarea {
    width: 100%;
    padding: 1rem 1.5rem;
    background: transparent;
    border: 1px solid var(--text-muted);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 1rem;
    border-radius: 4px;
    transition: border-color 0.3s;
}

.contact-form input::placeholder,
.contact-form textarea::placeholder {
    color: var(--text-muted);
}

.contact-form input:focus,
.contact-form select:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: var(--text-primary);
}

.contact-form select {
    appearance: none;
    cursor: pointer;
}

.contact-form option {
    background: var(--bg-dark);
    color: var(--text-primary);
}

.contact-form button {
    margin-top: 1rem;
    display: inline-flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    transform: none !important;
}

.footer-info {
    border-top: 1px solid var(--text-muted);
    padding-top: 2rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.footer-info p {
    margin-bottom: 0.5rem;
}

/* --- Mobile Breakpoint --- */
@media (max-width: 1024px) {
    .desktop-nav {
        display: none;
        /* Hide standard links */
    }

    .mobile-toggle {
        display: flex;
        /* Show hamburger */
    }

    .canvas-wrap {
        width: 100%;
    }

    .hero-content {
        max-width: 90vw;
        padding-top: 4rem;
    }

    .scroll-indicator {
        position: relative;
        bottom: auto;
        left: auto;
        margin-top: 4rem;
    }

    #dark-overlay {
        background: rgba(0, 0, 0, 0.7);
        /* Solid overlay on mobile */
    }

    .align-left .section-inner {
        width: 100%;
        max-width: 90vw;
    }

    .project-grid {
        grid-template-columns: 1fr;
    }

    #scroll-container {
        height: 400vh;
    }
}

/* --- Lenis Specific --- */
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;
}

/* --- WhatsApp Floating Button --- */
.whatsapp-float {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background-color: #25D366;
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
    z-index: 99999;
    transition: all 0.3s ease;
    text-decoration: none;
}

.whatsapp-float svg {
    width: 35px;
    height: 35px;
    fill: currentColor;
}

.whatsapp-float:hover {
    transform: translateY(-5px) scale(1.05);
    background-color: #1EBE55;
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.4);
    color: white;
}

/* Pulsing animation */
.whatsapp-float::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background-color: transparent;
    border: 2px solid #25D366;
    animation: pulse-wa 2s infinite;
    z-index: -1;
}

@keyframes pulse-wa {
    0% {
        transform: scale(1);
        opacity: 0.8;
    }
    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

@media (max-width: 768px) {
    .whatsapp-float {
        bottom: 1.5rem;
        right: 1.5rem;
        width: 50px;
        height: 50px;
        z-index: 99999;
    }
    .whatsapp-float svg {
        width: 28px;
        height: 28px;
    }
}