/* ==========================================================================
   VARIABLES & PALETA DE COLORES
   ========================================================================== */
:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f9f9f9; 
    --text-primary: #1a1a1a; 
    --text-secondary: #5e5e5e; 
    --border-color: #e2e2e2;
    
    --brand-dark: #3d3e3c;   
    --brand-grey: #6c7676;   
    --brand-accent: #d6d2cb; 
    
    --font-main: 'Montserrat', sans-serif;
    
    --spacing-xs: 0.5rem;
    --spacing-sm: 1.5rem;
    --spacing-md: 3rem;
    --spacing-lg: 5rem;
    --spacing-xl: 8rem;
    --container-width: 1400px;
    
    --transition-smooth: 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { font-family: var(--font-main); background-color: var(--bg-primary); color: var(--text-primary); line-height: 1.7; -webkit-font-smoothing: antialiased; }
a { text-decoration: none; color: inherit; }
ul { list-style: none; }
.container { max-width: var(--container-width); margin: 0 auto; padding: 0 5%; }
.bg-secondary { background-color: var(--bg-secondary); }

h1, h2, h3 { font-weight: 200; line-height: 1.1; color: var(--brand-dark); letter-spacing: -1px; }
.section-title { font-size: clamp(2.5rem, 4vw, 3.5rem); margin-bottom: var(--spacing-md); position: relative; padding-bottom: var(--spacing-sm); }
.section-title::after { content: ''; position: absolute; bottom: 0; left: 0; width: 60px; height: 1px; background-color: var(--brand-grey); }
.text-center.section-title::after { left: 50%; transform: translateX(-50%); }
.text-center { text-align: center; }

/* ==========================================================================
   HEADER DINÁMICO & NAVEGACIÓN OVERLAY
   ========================================================================== */
.header { 
    position: fixed; 
    top: 0; 
    width: 100%; 
    background-color: transparent; 
    border-bottom: none; 
    z-index: 1000; 
    padding: 2.5rem 0; 
    transition: all 0.5s cubic-bezier(0.25, 1, 0.5, 1); 
}

.header.scrolled {
    background-color: var(--bg-primary);
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
}

.header-content { display: flex; justify-content: space-between; align-items: center; }
.header-controls { display: flex; align-items: center; gap: 1.5rem; position: relative; z-index: 1001; }

.logo { display: flex; align-items: center; position: relative; z-index: 1001; }

.logo-img { 
    height: 120px; 
    width: auto; 
    opacity: 0; 
    visibility: hidden;
    transition: all 0.4s ease; 
}

.header.scrolled .logo-img { 
    opacity: 1; 
    visibility: visible;
    height: 75px; 
}

.menu-toggle { background: none; border: none; cursor: pointer; color: #ffffff; display: flex; transition: color 0.3s, opacity 0.3s; }
.header.scrolled .menu-toggle { color: var(--brand-dark); }
.menu-toggle:hover { opacity: 0.6; }

.overlay-menu { position: fixed; top: 0; left: 0; width: 100%; height: 100vh; background-color: var(--bg-primary); z-index: 999; display: flex; align-items: center; justify-content: center; opacity: 0; pointer-events: none; transition: opacity 0.5s ease-in-out; }
.overlay-menu.active { opacity: 1; pointer-events: all; }
.overlay-nav { display: flex; flex-direction: column; gap: 2.5rem; text-align: center; }
.overlay-nav a { font-size: clamp(2rem, 5vw, 4rem); font-weight: 200; text-transform: uppercase; letter-spacing: 4px; color: var(--text-primary); transition: color var(--transition-smooth), transform var(--transition-smooth); }
.overlay-nav a:hover { color: var(--brand-grey); transform: scale(1.05); }

/* ==========================================================================
   HERO SECTION (Slider con Efecto Ken Burns)
   ========================================================================== */
.hero { position: relative; height: 100vh; min-height: 700px; display: flex; align-items: center; overflow: hidden; padding-top: 0; }
.hero-slider { position: absolute; inset: 0; z-index: 0; width: 100%; height: 100%; }
.slide { position: absolute; inset: 0; background-size: cover; background-position: center; opacity: 0; transition: opacity 1.5s ease-in-out; transform: scale(1); will-change: transform, opacity; }
.slide.active { opacity: 1; animation: kenBurns 8s ease-out forwards; }
@keyframes kenBurns { 0% { transform: scale(1); } 100% { transform: scale(1.1); } }

.hero-overlay { position: absolute; inset: 0; background: linear-gradient(to right, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.2) 100%); z-index: 1; }
.hero-content { position: relative; z-index: 2; max-width: 800px; color: #ffffff; }
.hero-kicker { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 6px; color: var(--brand-accent); margin-bottom: 1.5rem; font-weight: 400; }
.hero-title { font-size: clamp(3.5rem, 7vw, 5.5rem); font-weight: 200; color: #ffffff; margin-bottom: 2rem; letter-spacing: -2px; }
.hero-subtitle { font-size: 1.1rem; font-weight: 300; margin-bottom: 3rem; color: #e0e0e0; line-height: 1.8; max-width: 600px; }

.hero-actions { display: flex; gap: 1.5rem; }
.btn { display: inline-block; padding: 1rem 2.5rem; font-size: 0.75rem; font-weight: 500; text-transform: uppercase; letter-spacing: 2px; cursor: pointer; border: 1px solid transparent; transition: all var(--transition-smooth); }
.btn-primary { background-color: var(--brand-dark); color: #ffffff; } 
.btn-primary:hover { background-color: var(--brand-grey); transform: translateY(-2px); }
.btn-secondary { background-color: transparent; color: #ffffff; border-color: #ffffff; }
.btn-secondary:hover { background-color: #ffffff; color: #1a1a1a; }
.link-arrow { display: inline-block; margin-top: 1.5rem; font-size: 0.85rem; font-weight: 500; text-transform: uppercase; letter-spacing: 1px; color: var(--brand-grey); }
.link-arrow:hover { color: var(--brand-dark); }

/* ==========================================================================
   SECCIONES Y LAYOUTS (Asimetría)
   ========================================================================== */
.section { padding: var(--spacing-xl) 0; }

.split-layout { display: flex; align-items: center; position: relative; justify-content: space-between; gap: 4rem; }
.split-text { flex: 0 0 45%; padding: 5rem 4rem; background: var(--bg-primary); position: relative; z-index: 2; margin-right: -10%; box-shadow: 0 20px 40px rgba(0,0,0,0.05); }
.split-image { flex: 1; height: 75vh; min-height: 500px; background-size: cover; background-position: center; position: relative; z-index: 1; }
.split-text p { color: var(--text-secondary); margin-bottom: 1.5rem; font-size: 1.05rem; }

/* ==========================================================================
   NUEVO LAYOUT: SOCIOS ESTRATÉGICOS (FORMATO REEL/TIKTOK ESTRICTO)
   ========================================================================== */
.split-video-wrapper {
    flex: 0 0 360px; 
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 30px 60px rgba(0,0,0,0.15);
    background-color: var(--brand-dark); 
    height: 640px; /* Altura estricta 16:9 para desktop (360x640) */
}

.split-video { 
    position: absolute; /* Extrae el video del flujo natural */
    top: 0; 
    left: 0;
    width: 100%; 
    height: 100%; /* Lo obliga a rellenar el marco estricto */
    object-fit: cover; 
    display: block; 
}

.socios-text { background: transparent; box-shadow: none; padding: 2rem 0; margin: 0; flex: 1; }
.socios-text .section-title { font-size: clamp(3rem, 5vw, 4.5rem); margin-bottom: 2.5rem; line-height: 1.1; }
.socios-text .section-title::after { width: 50px; height: 1px; background-color: var(--border-color); }

.socios-list { margin-top: 2.5rem; }
.socios-item { margin-bottom: 2rem; }
.socios-item strong { display: block; color: var(--brand-dark); margin-bottom: 0.5rem; font-weight: 600; }
.socios-item p { margin: 0; font-size: 1.05rem; }

.mute-toggle-btn {
    position: absolute;
    bottom: 20px;
    right: 20px;
    background-color: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
}

.mute-toggle-btn:hover { background-color: rgba(255, 255, 255, 0.4); transform: scale(1.05); }

/* ==========================================================================
   TARJETAS DE PROCESOS (Efecto Flip 3D)
   ========================================================================== */
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: var(--spacing-md); margin-top: var(--spacing-lg); }

.process-grid { perspective: 1000px; }
.process-card { background-color: transparent; height: 380px; cursor: pointer; }
.process-card-inner { position: relative; width: 100%; height: 100%; text-align: center; transition: transform 0.8s cubic-bezier(0.25, 1, 0.5, 1); transform-style: preserve-3d; }
.process-card:hover .process-card-inner { transform: rotateY(180deg); }

.process-card-front, .process-card-back {
    position: absolute;
    inset: 0;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 3rem 2rem;
    border: 1px solid var(--border-color);
    background-color: var(--bg-primary);
}

.process-card-front { z-index: 2; }
.process-card-front .card-icon-svg { color: var(--brand-dark); margin-bottom: 1.5rem; }
.process-num { font-size: 0.85rem; font-family: monospace; color: var(--brand-grey); letter-spacing: 2px; margin-bottom: 1rem; }
.process-card-front h3 { font-size: 1.8rem; font-weight: 300; }

.process-card-back {
    background-color: var(--brand-dark);
    color: #ffffff;
    transform: rotateY(180deg);
    text-align: left;
    justify-content: flex-start;
    align-items: flex-start;
    padding: 3rem;
}

.process-card-back h3 { font-size: 1.5rem; font-weight: 300; color: #ffffff; margin-bottom: 1.5rem; position: relative; padding-bottom: 0.8rem; }
.process-card-back h3::after { content: ''; position: absolute; bottom: 0; left: 0; width: 40px; height: 1px; background-color: var(--brand-accent); }
.process-card-back p { font-size: 0.95rem; color: #d0d0d0; line-height: 1.8; }

/* ==========================================================================
   CARRUSEL DE PROYECTOS
   ========================================================================== */
.projects-carousel-wrapper { position: relative; width: 100%; margin-top: 3rem; }
.projects-carousel { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 2rem; padding-bottom: 3rem; scrollbar-width: thin; scrollbar-color: var(--brand-grey) var(--bg-primary); }
.projects-carousel::-webkit-scrollbar { height: 6px; }
.projects-carousel::-webkit-scrollbar-track { background: var(--bg-primary); }
.projects-carousel::-webkit-scrollbar-thumb { background: var(--brand-grey); }

.project-card { 
    min-width: 400px; max-width: 400px; 
    scroll-snap-align: start; 
    background: var(--bg-primary); 
    flex-shrink: 0; 
    transition: transform 0.3s, box-shadow 0.3s; 
    cursor: pointer; 
    border: 1px solid var(--border-color); 
}
.project-card:hover { transform: translateY(-5px); box-shadow: 0 15px 30px rgba(0,0,0,0.08); }

.project-img-slider { position: relative; width: 100%; height: 320px; overflow: hidden; }
.project-img-slide { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 0.8s ease; }
.project-img-slide.active { opacity: 1; }

.project-info { padding: 1.5rem; }
.project-info h3 { font-size: 1.3rem; margin-bottom: 0.5rem; font-weight: 400; }
.project-info p { font-size: 0.95rem; color: var(--text-secondary); }

/* ==========================================================================
   MODAL / GALERÍA LIGHTBOX
   ========================================================================== */
.modal-overlay { 
    position: fixed; top: 0; left: 0; width: 100%; height: 100%; 
    background: rgba(0,0,0,0.95); 
    z-index: 2000; 
    display: flex; align-items: center; justify-content: center; 
    opacity: 0; pointer-events: none; 
    transition: opacity 0.4s ease; 
    backdrop-filter: blur(5px); 
    -webkit-backdrop-filter: blur(5px);
}
.modal-overlay.active { opacity: 1; pointer-events: all; }

.modal-content { position: relative; max-width: 90%; max-height: 80vh; display: flex; flex-direction: column; align-items: center; }
.modal-content img { max-width: 100%; max-height: 75vh; object-fit: contain; border-radius: 4px; box-shadow: 0 10px 40px rgba(0,0,0,0.5); }

.modal-caption { color: #ffffff; margin-top: 1.5rem; font-size: 1.2rem; font-weight: 300; letter-spacing: 1px; text-align: center;}
.modal-counter { color: var(--brand-grey); font-size: 0.85rem; margin-top: 0.5rem; letter-spacing: 2px; font-family: monospace; }

.modal-close { position: absolute; top: 30px; right: 40px; background: transparent; border: none; color: #ffffff; font-size: 3rem; cursor: pointer; transition: color 0.3s, transform 0.3s; line-height: 1; font-weight: 200; }
.modal-close:hover { color: var(--brand-accent); transform: scale(1.1); }

.modal-nav { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1); color: #ffffff; font-size: 1.5rem; width: 60px; height: 60px; border-radius: 50%; cursor: pointer; transition: all 0.3s; display: flex; justify-content: center; align-items: center; backdrop-filter: blur(5px); }
.modal-nav:hover { background: rgba(255,255,255,0.2); border-color: rgba(255,255,255,0.5); }
.modal-prev { left: 40px; }
.modal-next { right: 40px; }

/* ==========================================================================
   FORMULARIO DE CONTACTO
   ========================================================================== */
.contact-wrapper { display: grid; grid-template-columns: 1fr 1.5fr; gap: var(--spacing-lg); }
.contact-details { margin-top: 2rem; }
.contact-details li { margin-bottom: 1rem; color: var(--text-secondary); font-size: 0.95rem; }
.contact-details strong { color: var(--brand-dark); display: block; font-weight: 500; margin-bottom: 0.2rem; }
.form-group { margin-bottom: 3rem; }
.form-group label { display: block; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 2px; margin-bottom: 0.8rem; color: var(--text-secondary); }
.form-group input, .form-group textarea { width: 100%; padding: 1rem 0; background: transparent; border: none; border-bottom: 1px solid var(--border-color); color: var(--text-primary); font-family: inherit; font-size: 1.2rem; transition: border-color var(--transition-smooth); }
.form-group input:focus, .form-group textarea:focus { outline: none; border-bottom-color: var(--brand-grey); }
.btn-block { width: 100%; }

/* ==========================================================================
   FOOTER IMPRESIONANTE Y ELEGANTE
   ========================================================================== */
.footer { 
    padding: var(--spacing-xl) 0 var(--spacing-md); 
    background-color: var(--brand-dark);
    color: #ffffff; 
    text-align: center; 
}
.footer-content { display: flex; flex-direction: column; align-items: center; }
.footer-brand { display: flex; flex-direction: column; align-items: center; margin-bottom: 2.5rem; }
.footer-logo-main { font-size: clamp(2rem, 5vw, 3.5rem); font-weight: 300; letter-spacing: 8px; line-height: 1; margin-bottom: 0.5rem; color: #ffffff; }
.footer-logo-sub { font-size: 0.75rem; font-weight: 400; letter-spacing: 6px; color: var(--brand-accent); text-transform: uppercase; }
.footer-divider { width: 1px; height: 60px; background-color: rgba(255, 255, 255, 0.2); margin-bottom: 2.5rem; }
.footer-bottom { display: flex; flex-direction: column; gap: 0.5rem; align-items: center; }
.footer p { font-size: 0.85rem; color: #a0a0a0; margin: 0; letter-spacing: 1px; }

.developer-credit a { color: #ffffff; font-weight: 500; position: relative; display: inline-block; padding-bottom: 2px; }
.developer-credit a::after { content: ''; position: absolute; left: 0; bottom: 0; width: 100%; height: 1px; background-color: var(--brand-accent); transform: scaleX(0); transition: transform var(--transition-smooth); transform-origin: right; }
.developer-credit a:hover::after { transform: scaleX(1); transform-origin: left; }

.fade-in { opacity: 0; transform: translateY(40px); transition: opacity 1s cubic-bezier(0.25, 1, 0.5, 1), transform 1s cubic-bezier(0.25, 1, 0.5, 1); }
.fade-in.is-visible { opacity: 1; transform: translateY(0); }

/* ==========================================================================
   RESPONSIVE (Control estricto de Video 9:16 en Móvil)
   ========================================================================== */
@media (max-width: 992px) {
    .split-layout { flex-direction: column !important; }
    .split-text { margin-right: 0 !important; margin-left: 0 !important; margin-bottom: -15%; padding: 3rem 2rem; width: 90%; align-self: center; }
    .split-image { width: 100%; height: 50vh; }
    .contact-wrapper { grid-template-columns: 1fr; }
    
    .split-video-wrapper { 
        width: 100%; 
        max-width: 360px; 
        height: 640px; /* Anclado a 16:9 matemático (360x640) */
        margin: 0 auto 2rem auto; 
    }
    .socios-text { padding: 1rem 0 0 0; width: 100%; text-align: center; }
    .socios-text .section-title::after { left: 50%; transform: translateX(-50%); }
}

@media (max-width: 768px) {
    .header { padding: 1.5rem 0; }
    .logo-img { height: 85px; } 
    .header.scrolled .logo-img { height: 55px; }
    .hero-actions { flex-direction: column; }
    .section { padding: var(--spacing-lg) 0; }
    
    .project-card { min-width: 300px; max-width: 300px; }
    .project-img-slider { height: 240px; }
    .projects-carousel-wrapper { padding-left: 0 !important; }
    
    /* El candado definitivo para móviles para que NO sea cuadrado */
    .split-video-wrapper { 
        max-width: 300px; 
        height: 533px; /* Obligado a mantener 9:16 (300px * 16 / 9 = 533px) */
    } 
    
    .modal-nav { width: 45px; height: 45px; font-size: 1.2rem; }
    .modal-prev { left: 10px; }
    .modal-next { right: 10px; }
    .modal-close { top: 15px; right: 20px; font-size: 2.5rem; }
    .modal-content img { max-height: 60vh; }

    .footer-logo-main { letter-spacing: 5px; }
    .footer-logo-sub { letter-spacing: 4px; }
}

@media (max-width: 400px) {
    /* Ajuste para pantallas muy pequeñas (Ej. iPhone SE) */
    .split-video-wrapper { 
        max-width: 270px; 
        height: 480px; 
    } 
}