/* ==========================================================================
   XRS HOMEPAGE — STRATEGIC PARTNER V2
   Design System: Dark Architectural Monolith
   ========================================================================== */

/* ── TOKENS ── */
:root {
    --surface:             #131313;
    --surface-dim:         #131313;
    --surface-container-lowest: #0e0e0e;
    --surface-container-low:    #1b1b1b;
    --surface-container:        #1f1f1f;
    --surface-container-high:   #2a2a2a;
    --surface-container-highest:#353535;
    --surface-bright:      #393939;

    --on-surface:          #e2e2e2;
    --on-surface-variant:  #d3c4b9;

    --primary:             #e7bf9c;
    --primary-container:   #ad8a6a;
    --on-primary:          #432b12;
    --on-primary-fixed:    #2b1702;

    --tertiary:            #3de273;
    --outline:             #9b8e84;
    --outline-variant:     #4f453d;

    --font-headline:       'Manrope', sans-serif;
    --font-body:           'Inter', sans-serif;

    --radius-sm:           2px;
    --radius-md:           4px;

    --transition-fast:     200ms ease;
    --transition-mid:      500ms ease;
}

/* ── RESET & BASE ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }

body {
    font-family: var(--font-body);
    background: var(--surface);
    color: var(--on-surface);
    line-height: 1.6;
    overflow-x: hidden;
}

h1, h2, h3, h4 { font-family: var(--font-headline); font-weight: 700; line-height: 1.1; }

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; height: auto; }

::selection { background: var(--primary); color: var(--on-primary); }

.desktop-only { display: none; }
@media (min-width: 768px) { .desktop-only { display: block; } }

.material-symbols-outlined {
    font-variation-settings: 'FILL' 0, 'wght' 300, 'GRAD' 0, 'opsz' 24;
}

/* ── LAYOUT ── */
.section-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
}
@media (min-width: 768px) { .section-container { padding: 0 48px; } }
.centered { text-align: center; }

/* ── BUTTONS ── */
.btn-primary {
    display: inline-block;
    background: var(--primary);
    color: var(--on-primary);
    font-family: var(--font-headline);
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    padding: 18px 40px;
    border-radius: var(--radius-sm);
    transition: opacity var(--transition-fast);
    cursor: pointer;
    border: none;
}
.btn-primary:hover { opacity: 0.9; }

.btn-outline {
    display: inline-block;
    border: 1px solid rgba(79, 69, 61, 0.3);
    color: var(--on-surface);
    font-family: var(--font-headline);
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    padding: 18px 40px;
    border-radius: var(--radius-sm);
    transition: background var(--transition-fast);
    cursor: pointer;
    background: transparent;
}
.btn-outline:hover { background: var(--surface-container); }

.btn-dark {
    display: inline-block;
    background: var(--on-primary);
    color: var(--primary);
    font-family: var(--font-headline);
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    padding: 24px 48px;
    border-radius: var(--radius-sm);
    transition: background var(--transition-fast);
    cursor: pointer;
    border: none;
    box-shadow: 0 25px 50px rgba(0,0,0,0.4);
}
.btn-dark:hover { background: var(--on-primary-fixed); }

.btn-sm { padding: 10px 24px; font-size: 0.65rem; }
.btn-lg { padding: 20px 48px; }

/* ── SECTION TAG ── */
.section-tag {
    display: block;
    color: var(--primary);
    font-family: var(--font-body);
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.25em;
    margin-bottom: 24px;
}
.section-tag.centered { text-align: center; }

/* ── NAV ── */
.main-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 48px;
    background: rgba(19, 19, 19, 0.6);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}
.nav-brand .nav-logo { height: 28px; width: auto; }
.nav-links { display: none; gap: 32px; align-items: center; }
.nav-link {
    font-family: var(--font-headline);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: rgba(226, 226, 226, 0.7);
    transition: color var(--transition-fast);
    padding-bottom: 4px;
}
.nav-link:hover, .nav-link.active {
    color: var(--primary);
}
.nav-link.active {
    border-bottom: 1px solid var(--primary);
}
@media (min-width: 768px) {
    .nav-links { display: flex; }
}

/* ── HERO ── */
.hero-section {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 128px 24px 80px;
}
@media (min-width: 768px) { .hero-section { padding: 128px 48px 80px; } }

.hero-video-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
}
.hero-video-bg video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.35;
    filter: grayscale(100%);
}
.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to right, var(--surface), rgba(19,19,19,0.8), transparent);
}

.hero-content {
    position: relative;
    z-index: 10;
    max-width: 1000px;
}
.hero-headline {
    font-size: clamp(2.5rem, 6vw, 5.5rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.05;
    margin-bottom: 40px;
}
.hero-ctas {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
@media (min-width: 768px) { .hero-ctas { flex-direction: row; gap: 24px; } }

/* ── PROBLEM ── */
.problem-section {
    background: var(--surface-container-low);
    padding: 128px 0;
}
.problem-header {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
    margin-bottom: 96px;
    align-items: end;
}
.problem-header h2 {
    font-size: clamp(2rem, 4vw, 3.5rem);
    letter-spacing: -0.02em;
    line-height: 1.15;
}
.problem-header p {
    color: var(--on-surface-variant);
    font-size: 1.1rem;
    font-weight: 300;
    line-height: 1.7;
    max-width: 480px;
}
@media (min-width: 1024px) {
    .problem-header { grid-template-columns: 1fr 1fr; gap: 80px; }
}

.problem-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1px;
    background: rgba(79, 69, 61, 0.1);
}
@media (min-width: 768px) { .problem-grid { grid-template-columns: repeat(3, 1fr); } }

.problem-card {
    background: var(--surface-container-low);
    padding: 48px;
    transition: background var(--transition-mid);
}
.problem-card:hover { background: var(--surface-container); }
.problem-number {
    display: block;
    color: var(--primary);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin-bottom: 32px;
}
.problem-card h3 {
    font-size: 1.5rem;
    margin-bottom: 16px;
}
.problem-card p {
    color: var(--on-surface-variant);
    line-height: 1.7;
}

/* ── APPROACH ── */
.approach-section {
    padding: 160px 0;
}
.approach-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    flex-direction: column;
    gap: 80px;
    align-items: center;
}
@media (min-width: 768px) {
    .approach-container {
        flex-direction: row;
        padding: 0 48px;
    }
}

.approach-image {
    width: 100%;
    flex-shrink: 0;
}
@media (min-width: 768px) { .approach-image { width: 50%; } }
.approach-image img {
    width: 100%;
    aspect-ratio: 4/5;
    object-fit: cover;
    filter: grayscale(100%) brightness(0.75);
    border-radius: var(--radius-sm);
}

.approach-content {
    width: 100%;
}
@media (min-width: 768px) { .approach-content { width: 50%; } }
.approach-content h2 {
    font-size: clamp(2rem, 4vw, 3.5rem);
    letter-spacing: -0.02em;
    margin-bottom: 32px;
    line-height: 1.1;
}
.approach-content > p {
    color: var(--on-surface-variant);
    font-size: 1.15rem;
    font-weight: 300;
    line-height: 1.7;
    margin-bottom: 40px;
    max-width: 560px;
}

.approach-features { display: flex; flex-direction: column; gap: 32px; }
.approach-feature {
    display: flex;
    gap: 24px;
    align-items: flex-start;
}
.feature-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(231, 191, 156, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--primary);
}
.feature-icon .material-symbols-outlined { font-size: 18px; }
.approach-feature h4 {
    font-size: 1.1rem;
    margin-bottom: 4px;
}
.approach-feature p {
    color: var(--on-surface-variant);
    font-size: 0.95rem;
}

/* ── NIVELES ── */
.niveles-section {
    background: var(--surface-container-lowest);
    padding: 128px 0;
}
.niveles-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 48px;
}
@media (min-width: 768px) { .niveles-grid { grid-template-columns: repeat(3, 1fr); } }

.nivel-card { display: flex; flex-direction: column; gap: 24px; }
.nivel-bar {
    width: 80px;
    height: 4px;
    background: var(--primary);
    margin-bottom: 24px;
}
.nivel-card h3 {
    font-size: 1.8rem;
}
.nivel-card p {
    color: var(--on-surface-variant);
    line-height: 1.7;
}
.nivel-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--primary);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.15em;
}
.nivel-link .material-symbols-outlined {
    transition: transform var(--transition-fast);
}
.nivel-link:hover .material-symbols-outlined {
    transform: translateX(8px);
}

/* ── DESARROLLO ── */
.desarrollo-section {
    padding: 128px 0;
}
.desarrollo-section h2 {
    font-size: clamp(2rem, 4vw, 3.5rem);
    letter-spacing: -0.02em;
    margin-bottom: 80px;
    line-height: 1.15;
}
.desarrollo-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 32px;
}
@media (min-width: 768px) { .desarrollo-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1200px) { .desarrollo-grid { grid-template-columns: repeat(4, 1fr); } }

.desarrollo-card { cursor: pointer; }
.desarrollo-img {
    aspect-ratio: 1;
    overflow: hidden;
    background: var(--surface-container);
    margin-bottom: 24px;
    border-radius: var(--radius-sm);
}
.desarrollo-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(100%);
    transition: transform 700ms ease;
}
.desarrollo-card:hover .desarrollo-img img {
    transform: scale(1.05);
}
.desarrollo-card h4 {
    font-size: 1.2rem;
    margin-bottom: 8px;
}
.desarrollo-card p {
    color: var(--on-surface-variant);
    font-size: 0.9rem;
    line-height: 1.6;
}

/* ── DIAGNOSTICO ── */
.diagnostico-section {
    background: var(--primary);
    padding: 128px 24px;
    position: relative;
    overflow: hidden;
}
@media (min-width: 768px) { .diagnostico-section { padding: 128px 48px; } }

.diagnostico-content {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    z-index: 10;
    color: var(--on-primary);
}
.diagnostico-content h2 {
    font-size: clamp(2.5rem, 5vw, 4.5rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: 32px;
    line-height: 1.05;
}
.diagnostico-content p {
    font-size: 1.15rem;
    font-weight: 500;
    line-height: 1.7;
    margin-bottom: 48px;
    opacity: 0.9;
}

/* ── CASOS ── */
.casos-section {
    padding: 128px 0;
    background: var(--surface);
}
.casos-header { margin-bottom: 96px; }
.casos-header h2 {
    font-size: clamp(2rem, 4vw, 3.5rem);
    letter-spacing: -0.02em;
    line-height: 1.15;
}
.casos-list { display: flex; flex-direction: column; gap: 160px; }

.caso-item {
    display: flex;
    flex-direction: column;
    gap: 48px;
    align-items: flex-start;
}
@media (min-width: 1024px) {
    .caso-item { flex-direction: row; gap: 64px; }
    .caso-reverse { flex-direction: row-reverse; }
}

.caso-image {
    width: 100%;
    flex-shrink: 0;
}
@media (min-width: 1024px) { .caso-image { width: 60%; } }
.caso-image img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    filter: grayscale(100%);
    transition: filter 1000ms ease;
    border-radius: var(--radius-sm);
}
.caso-image:hover img { filter: grayscale(0); }

.caso-info {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 32px;
}
@media (min-width: 1024px) { .caso-info { width: 40%; } }

.caso-field label {
    display: block;
    font-size: 0.6rem;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.2em;
    margin-bottom: 8px;
    color: var(--on-surface-variant);
}
.caso-field label:first-child { color: var(--primary); }
.caso-name { font-size: 1.5rem; font-weight: 700; }
.caso-field p {
    color: var(--on-surface-variant);
    line-height: 1.7;
}

.caso-result {
    padding-top: 24px;
    border-top: 1px solid rgba(79, 69, 61, 0.2);
}
.caso-result label {
    display: block;
    font-size: 0.6rem;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.2em;
    margin-bottom: 8px;
    color: var(--tertiary);
}
.caso-result p {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--on-surface);
}

/* ── CLIENTS / LOGOS MARQUEE ── */
.clients-section {
    padding: 96px 0 80px;
    background: var(--surface-container-low);
    overflow: hidden;
}

.logos-track-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 40px;
}

.logos-row-wrapper {
    overflow: hidden;
    width: 100%;
}

.logos-row {
    display: flex;
    width: max-content;
}

.logo-item {
    padding: 0 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.logo-item img {
    height: 104px;
    width: auto;
    object-fit: contain;
    filter: brightness(0) invert(1);
    opacity: 0.35;
    transition: opacity 0.3s ease;
}
.logo-item:hover img { opacity: 0.7; }

.scroll-right {
    animation: marqueeRight 17s linear infinite;
}

.scroll-left {
    animation: marqueeLeft 17s linear infinite;
}

.scroll-right.slow {
    animation-duration: 17s;
}

@keyframes marqueeRight {
    0% { transform: translateX(0); }
    100% { transform: translateX(-25%); }
}

@keyframes marqueeLeft {
    0% { transform: translateX(-25%); }
    100% { transform: translateX(0); }
}

/* ── FINAL CTA ── */
.final-cta-section {
    padding: 160px 0;
    background: var(--surface-container-low);
}
.final-cta-section h2 {
    font-size: clamp(2rem, 4vw, 3.5rem);
    letter-spacing: -0.02em;
    line-height: 1.15;
    max-width: 900px;
    margin: 0 auto 48px;
}
.final-cta-buttons {
    display: flex;
    justify-content: center;
    gap: 24px;
    flex-wrap: wrap;
}

/* ── FOOTER ── */
.footer-section {
    background: var(--surface);
    border-top: 1px solid rgba(79, 69, 61, 0.2);
    padding: 80px 0;
}
.footer-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 48px;
}
.footer-top {
    display: flex;
    flex-direction: column;
    gap: 48px;
    margin-bottom: 80px;
}
@media (min-width: 768px) {
    .footer-top {
        flex-direction: row;
        justify-content: space-between;
        align-items: flex-start;
    }
}
.footer-brand { max-width: 320px; }
.footer-logo { height: 30px; width: auto; margin-bottom: 24px; }
.footer-brand p {
    color: var(--on-surface-variant);
    font-size: 0.85rem;
    line-height: 1.7;
}
.footer-links-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 48px;
}
@media (min-width: 768px) { .footer-links-grid { grid-template-columns: repeat(3, 1fr); gap: 96px; } }
.footer-col { display: flex; flex-direction: column; gap: 16px; }
.footer-col h5 {
    color: var(--primary);
    opacity: 0.5;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin-bottom: 8px;
    font-family: var(--font-body);
}
.footer-col a {
    color: rgba(226, 226, 226, 0.4);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    transition: color var(--transition-fast);
}
.footer-col a:hover { color: var(--primary); }

.footer-bottom {
    padding-top: 32px;
    border-top: 1px solid rgba(79, 69, 61, 0.1);
    text-align: center;
}
.footer-bottom p {
    color: rgba(226, 226, 226, 0.4);
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
}
.footer-bottom a { color: var(--on-surface); transition: color var(--transition-fast); }
.footer-bottom a:hover { color: var(--primary); }

/* ── WHATSAPP FAB ── */
.whatsapp-fab {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 56px;
    height: 56px;
    background: #25d366;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 24px rgba(0,0,0,0.3);
    transition: transform var(--transition-fast);
    z-index: 90;
}
.whatsapp-fab:hover { transform: scale(1.1); }

/* ── SCROLL REVEAL ── */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}
.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* ── RESPONSIVE ── */
@media (max-width: 767px) {
    .main-nav { padding: 16px 24px; }
    .main-nav .btn-primary { display: none; }
    .problem-card { padding: 32px 24px; }
    .nivel-card { padding: 0 24px; }
}