/* --- CABECERA (HEADER) --- */
.site-header {
    position: sticky;
    top: 0;
    height: var(--header-height, 80px);
    background: rgba(18, 18, 18, 0.85);
    backdrop-filter: blur(10px);
    z-index: 1000;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
}
body.menu-open .site-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
}
.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}
.logo {
    text-decoration: none;
}
.logo-text {
    font-family: var(--font-sans);
    font-weight: 700;
    font-size: 0.75rem;
    letter-spacing: 0.5em;
    color: white;
    display: flex;
    align-items: center;
    height: 100%;
}
.logo-x {
    font-family: var(--font-logo);
    font-size: 2.5rem;
    font-weight: 900;
}
.nav-list {
    display: flex;
    gap: 2rem;
    list-style: none;
    align-items: center;
}
.nav-link,
.nav-link:visited {
    color: var(--text-secondary, #a1a1aa);
    text-decoration: none;
    font-size: 0.95rem;
    transition: color 0.3s ease;
}

.nav-link:hover,
.nav-link:focus {
    color: #ffffff;
}
.mobile-toggle {
    display: none;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    padding: 0.5rem;
    border-radius: 6px;
    cursor: pointer;
    z-index: 1001;
}
@media (max-width: 899px) {
    .mobile-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }
    .main-nav {
        position: fixed;
        top: var(--header-height, 80px);
        left: 0;
        transform: translateX(100%);
        width: 100%;
        height: calc(100dvh - var(--header-height, 80px));
        background: rgba(18, 18, 18, 0.95);
        backdrop-filter: blur(15px);
        visibility: hidden;
        transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), visibility 0s linear 0.3s;
        padding: 2rem;
        overflow-y: auto;
        border-top: 1px solid rgba(255, 255, 255, 0.05);
        z-index: 999;
    }
    .main-nav.is-open {
        transform: translateX(0);
        visibility: visible;
        transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), visibility 0s linear 0s;
    }
    .nav-list {
        flex-direction: column;
        gap: 2rem;
        align-items: flex-start;
    }
    .nav-link {
        font-size: 1.25rem;
        padding: 0.5rem 0;
        display: block;
        width: 100%;
    }
}

/* --- LAYOUT MACRO-ESPACIADO --- */
:root {
    --macro-padding: clamp(6rem, 10vw, 12rem);
    --gap-massive: clamp(4rem, 8vw, 8rem);
}
.macro-section {
    padding-block: var(--macro-padding);
}
.bg-elevated {
    background-color: #080808;
    border-top: 1px solid rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}
.section-header-macro {
    margin-bottom: var(--gap-massive);
}

/* --- HERO SPLIT --- */
.hero-macro {
    position: relative;
    min-height: 100svh;
    display: flex;
    align-items: center;
    padding-top: var(--header-height, 80px);
    overflow: hidden;
}
.hero-overlay-dark {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 30% 50%, rgba(5,5,5,0.4) 0%, #050505 80%);
    z-index: 1;
}

/* --- STICKY LAYOUT (Filosofía) --- */
.sticky-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 4rem;
    align-items: start;
}
@media (min-width: 1024px) {
    .sticky-layout {
        grid-template-columns: 1fr 1fr;
        gap: 6rem;
    }
    .sticky-sidebar {
        position: sticky;
        top: calc(var(--header-height, 80px) + 4rem);
    }
}
.sticky-content {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

/* --- Z-PATTERN (Soluciones) --- */
.z-pattern-container {
    display: flex;
    flex-direction: column;
    gap: clamp(8rem, 15vw, 16rem); /* Incrementado para forzar el macro espaciado */
}
.z-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 3rem;
    align-items: center;
}
@media (min-width: 1024px) {
    .z-row {
        grid-template-columns: 1fr 1fr;
        gap: var(--gap-massive);
    }
    .z-row.reverse .z-text {
        order: 2;
    }
    .z-row.reverse .z-visual {
        order: 1;
    }
}

/* --- CONTACT GRID --- */
.contact-macro-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 4rem;
    align-items: center;
}
@media (min-width: 1024px) {
    .contact-macro-grid {
        grid-template-columns: 1fr 1fr;
        gap: 8rem;
    }
}

/* --- PIE DE PÁGINA (FOOTER) --- */
.site-footer {
    background: #050505;
    padding-top: 4rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}
.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 3rem;
    padding-bottom: 4rem;
}
.footer-col h4,
.footer-col h5 {
    color: white;
    margin: 0 0 1.5rem 0;
    font-size: 1.1rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
}
.footer-col .footer-logo .logo-text {
    height: 100%;
}
.footer-links {
    list-style: none;
    padding: 0;
}
.footer-links li {
    margin-bottom: 0.75rem;
}
.footer-links a {
    color: var(--text-secondary, #a1a1aa);
    text-decoration: none;
    transition: color 0.2s;
}
.footer-links a:hover {
    color: white;
}
.tech-flex-bar {
    background: black;
    padding: 1rem 0;
    text-align: center;
    color: #444;
    border-top: 1px solid #111;
}
.tech-flex-bar a {
    color: inherit;
    text-decoration: none;
}

/* --- HERO MACRO LAYOUT --- */
.hero-macro {
    position: relative;
    min-height: 100svh;
    display: flex;
    align-items: center;
    padding-top: var(--header-height, 80px);
    overflow: hidden;
}

.hero-overlay-dark {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 30% 50%, rgba(5,5,5,0.4) 0%, #050505 80%);
    z-index: 1;
}

.hero-content-macro {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 600px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

@media (min-width: 1024px) {
    .hero-content-macro {
        max-width: 50%;
    }
}
