/* Kintila Brutalist Aesthetic Styles - Studio Freight / Lenis Inspired */
:root {
    --bg-primary: #f4f4f4;
    --bg-secondary: #e5e5e5;
    --text-main: #0a0a0a;
    --text-muted: #555555;
    --text-gray: #888888;
    --accent-red: #ff2a2a;

    --font-heading: 'Inter', sans-serif;
    --font-body: 'Inter', sans-serif;
    --border-color: rgba(10, 10, 10, 0.15);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    color: var(--text-main);
    background-color: var(--bg-primary);
    overflow-x: clip;
    /* FIX: 'clip' instead of 'hidden' to prevent breaking position: sticky globally */
    line-height: 1.4;
    -webkit-font-smoothing: antialiased;
}

/* THE GRID AESTHETIC - Studio Freight 1px lines everywhere */
/* [MAIN CONTENT WRAPPERS] */
.grid-container {
    width: 100%;
    margin: 0 auto;
    /* Removed brutalist borders */
}

/* Default hero padding modifier */
.hero-section,
.portal-hero {
    min-height: 80vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-top: 120px;
    /* Offset for fixed navbar */
}

/* NAVBAR GLOBAL */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    transition: transform 0.3s ease, background 0.3s ease;
}

.navbar.nav-dark {
    background: var(--text-main);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.navbar-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 4vw;
    max-width: 1400px;
    margin: 0 auto;
}

@media (min-width: 768px) {
    .navbar-inner {
        padding: 1.5rem 2rem;
    }
}

.navbar-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.logo-img {
    height: 40px;
    max-width: 60vw;
    display: block;
    transition: filter 0.3s ease;
}

@media (min-width: 768px) {
    .logo-img {
        height: 55px;
    }
}

.nav-dark .logo-img {
    filter: invert(1);
}

.navbar-menu {
    display: none;
}

@media (min-width: 768px) {
    .navbar-menu {
        display: flex;
        gap: 2.5rem;
    }
}

.nav-link {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    text-decoration: none;
    color: var(--text-gray);
    position: relative;
    overflow: hidden;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background-color: var(--text-main);
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.19, 1, 0.22, 1);
}

.nav-link:hover::after,
.nav-link.active::after {
    transform: translateX(0);
}

.nav-link:hover,
.nav-link.active {
    color: var(--text-main);
}

.nav-dark .nav-link:hover,
.nav-dark .nav-link.active {
    color: var(--bg-primary);
}

.nav-dark .nav-link::after {
    background-color: var(--bg-primary);
}

.mobile-menu-btn {
    display: block;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-main);
    cursor: pointer;
}

.nav-dark .mobile-menu-btn {
    color: var(--bg-primary);
}

@media (min-width: 768px) {
    .mobile-menu-btn {
        display: none;
    }
}

/* MOBILE OVERLAY */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: var(--text-main);
    color: var(--bg-primary);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    /* Studio freight style curtain */
    clip-path: polygon(0 0, 100% 0, 100% 0, 0 0);
    transition: clip-path 0.7s cubic-bezier(0.77, 0, 0.175, 1);
}

.mobile-menu-overlay.open {
    clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
}

.mobile-nav-links {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    text-align: center;
}

.mobile-link {
    font-size: 10vw;
    font-weight: 900;
    text-transform: uppercase;
    text-decoration: none;
    color: var(--bg-primary);
    letter-spacing: -0.04em;
    line-height: 0.9;
    transition: opacity 0.3s, transform 0.3s;
}

.mobile-link:hover,
.mobile-link.active {
    color: var(--accent-red);
}

.mobile-close-btn {
    position: absolute;
    top: 2rem;
    right: 2rem;
    background: none;
    border: none;
    color: var(--bg-primary);
    font-size: 2rem;
    cursor: pointer;
}

/* PRELOADER */
.preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: var(--text-main);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    color: var(--bg-primary);
}

.loader-counter {
    font-size: 12vw;
    font-weight: 900;
    letter-spacing: -0.05em;
    line-height: 1;
}

.loader-text {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--accent-red);
    margin-top: 1rem;
}

/* TYPOGRAPHY - MASSIVE & TIGHT */
h1,
h2,
h3 {
    font-family: var(--font-heading);
    font-weight: 900;
    text-transform: uppercase;
    line-height: 0.9;
    letter-spacing: -0.04em;
}

/* BUTTONS */
.btn-primary {
    display: inline-block;
    background-color: transparent;
    color: var(--text-main);
    padding: 1rem 1.5rem;
    font-size: 0.85rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 1px;
    border: 1px solid var(--text-main);
    cursor: pointer;
    border-radius: 50px;
    transition: all 0.3s cubic-bezier(0.19, 1, 0.22, 1);
    margin-top: 2rem;
}

@media (min-width: 768px) {
    .btn-primary {
        padding: 1.2rem 2.5rem;
        font-size: 0.9rem;
    }
}

.btn-primary:hover {
    background-color: var(--text-main);
    color: var(--bg-primary);
}

/* ........................................................... */
/* ANIMACIONES, REVEALS Y ESTILOS AUXILIARES */
/* ........................................................... */
/* HERO SECTION (Now a panel) */
.hero-content {
    padding: 0 4vw;
}

.hero-title {
    font-size: clamp(3.5rem, 13vw, 10rem);
    /* MASSIVE but legible on mobile */
    color: var(--text-main);
    margin-bottom: 2rem;
    white-space: nowrap;
}

.hero-subtitle {
    font-size: clamp(1.2rem, 2vw, 1.8rem);
    color: var(--text-muted);
    max-width: 800px;
    font-weight: 400;
    line-height: 1.3;
}

.stack-dark .hero-title,
.stack-red .hero-title {
    color: var(--bg-primary);
}

.stack-dark .hero-subtitle,
.stack-red .hero-subtitle {
    color: rgba(255, 255, 255, 0.7);
}

.stack-dark .btn-primary {
    border-color: var(--bg-primary);
    color: var(--bg-primary);
}

.stack-dark .btn-primary:hover {
    background-color: var(--bg-primary);
    color: var(--text-main);
}

/* MARQUEE INFINITE SCROLL */
.marquee-container {
    width: 100%;
    overflow: hidden;
    white-space: nowrap;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    padding: 2rem 0;
    background: var(--text-main);
    color: var(--bg-primary);
}

.marquee-content {
    display: inline-block;
    font-size: clamp(3rem, 8vw, 8rem);
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: -0.04em;
    padding-left: 100%;
    animation: marquee 40s linear infinite;
    /* Slowed down from 20s to 40s */
    will-change: transform;
}

@keyframes marquee {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-100%);
    }
}

/* MANIFESTO / BIG TEXT MODULE */
.manifesto-section {
    padding: 0 4vw;
}

.manifesto-line {
    font-size: clamp(2.5rem, 8vw, 6rem);
    margin-bottom: 0;
    /* Studio Freight mixes opacity per word dynamically, but we'll use mask wrapper */
}

.text-red {
    color: var(--accent-red);
}

/* DUALITY / SPLIT (Studio Freight Split logic) */
.duality-section {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100vh;
}

@media (min-width: 768px) {
    .duality-section {
        flex-direction: row;
    }
}

.duality-pane {
    flex: 1;
    padding: 4rem 4vw;
    display: flex;
    align-items: center;
    border: 1px solid var(--border-color);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.pane-investor {
    background-color: var(--bg-secondary);
    color: var(--text-main);
}

.pane-developer {
    background-color: var(--text-main);
    color: var(--bg-primary);
}

/* Hover effect Lenis style (Image reveal or background fill) */
.duality-pane::before {
    content: '';
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--accent-red);
    transition: top 0.5s cubic-bezier(0.19, 1, 0.22, 1);
    z-index: 0;
}

.duality-pane:hover::before {
    top: 0;
}

.duality-pane .pane-content {
    position: relative;
    z-index: 2;
    transition: color 0.3s;
}

.duality-pane:hover .pane-content,
.duality-pane:hover .pane-title,
.duality-pane:hover .pane-desc,
.duality-pane:hover .pane-action {
    color: #fff !important;
}

.pane-label {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 2rem;
    display: block;
    opacity: 0.6;
}

.pane-title {
    font-size: clamp(2.5rem, 6vw, 5rem);
    margin-bottom: 1.5rem;
}

.pane-action {
    font-weight: 900;
    text-transform: uppercase;
    margin-top: 3rem;
    font-size: 1.5rem;
}

/* TECH STACK GRID */
.tech-stack-section {
    padding: 0 4vw;
}

.tech-title {
    font-size: clamp(3rem, 8vw, 6rem);
    margin-bottom: 4rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
}

.tech-grid {
    display: grid;
    grid-template-columns: 1fr;
    border-top: 1px solid var(--border-color);
    border-left: 1px solid var(--border-color);
}

.tech-card {
    border-bottom: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
    padding: 3rem 2rem;
    background-color: transparent;
    display: flex;
    flex-direction: column;
}

@media (min-width: 768px) {
    .tech-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .tech-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.tech-step {
    font-size: 0.8rem;
    font-weight: 900;
    color: var(--text-gray);
    display: block;
    margin-bottom: 3rem;
    text-transform: uppercase;
}

.tech-card h3 {
    font-size: 1.5rem;
    letter-spacing: -0.02em;
}

/* BARRIER ENTRY FORM / FORMS */
.barrier-section {
    padding: 8rem 4vw;
    background-color: var(--bg-secondary);
}

.barrier-title {
    font-size: clamp(3rem, 8vw, 6rem);
    margin-bottom: 2rem;
}

.barrier-form {
    max-width: 800px;
    margin: 0;
}

.form-group {
    margin-bottom: 3rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
}

.form-group label {
    display: block;
    font-weight: 900;
    margin-bottom: 1rem;
    font-size: 1.2rem;
    text-transform: uppercase;
    color: var(--text-main);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 1rem 0;
    background: transparent;
    border: none;
    font-family: inherit;
    font-size: 1.5rem;
    color: var(--text-muted);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    color: var(--text-main);
}

/* LENIS CORE CLASSES */
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;
}

/* GSAP REVEAL */
.reveal-wrapper {
    overflow: hidden;
    display: inline-flex;
    vertical-align: top;
}

.reveal-text {
    display: inline-flex;
    transform: translateY(110%);
    opacity: 0;
    will-change: transform, opacity;
}

.premium-fade-up {
    opacity: 0;
    transform: translateY(40px);
    will-change: opacity, transform;
}

/* ==========================================
   MOBILE OPTIMIZATIONS (Smart Adjustments)
   ========================================== */
@media (max-width: 768px) {
    .navbar-inner {
        padding: 1rem 1.5rem;
    }

    .logo-img {
        height: 35px;
        /* Fit perfectly in mobile nav */
    }

    .hero-section,
    .portal-hero {
        padding-top: 100px;
        min-height: 70vh;
    }

    .hero-title {
        font-size: 15vw;
        white-space: normal;
        /* FUNDAMENTAL: stop infinite horizontal scroll overflow */
        line-height: 1.1;
        margin-bottom: 1rem;
    }

    .hero-subtitle {
        font-size: 1.1rem;
    }

    .marquee-container {
        padding: 1rem 0;
    }

    .marquee-content {
        font-size: 4rem;
        /* Downsized from 8rem for mobile */
    }

    .manifesto-line {
        font-size: 12vw;
        line-height: 1.1;
    }

    /* Target generic large text blocks */
    .pane-title,
    .barrier-title {
        font-size: 10vw;
    }

    .tech-title {
        font-size: 10vw;
        margin-bottom: 2rem;
    }

    .tech-card {
        padding: 2rem 1.5rem;
    }

    .barrier-section {
        padding: 4rem 4vw;
    }

    .btn-primary {
        padding: 1rem 1.5rem;
        width: 100%;
        /* Full width buttons for mobile UI */
        text-align: center;
        margin-top: 1.5rem;
    }
}