/* ==========================================
   CONFIGURACIÓN BASE Y VARIABLES
   ========================================== */
:root {
    --gold: #FFD700;
    --gold-glow: rgba(255, 215, 0, 0.6);
    --white: #ffffff;
    --black: #050505;
    --speed: 0.8s;
    --header-gap: 2.25rem;
    --header-horizontal: 1.5rem;
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Helvetica Neue', Arial, sans-serif; }

body { background: var(--black); color: var(--white); overflow: hidden; width: 100vw; height: 100vh; }

/* ==========================================
   CONTROL ESTRICTO DE CAPAS
   ========================================== */
.stage {
    position: absolute; inset: 0; width: 100vw; height: 100vh;
    transition: opacity var(--speed) ease-in-out, visibility var(--speed);
}

.active-stage { opacity: 1; visibility: visible; z-index: 50; }
.hidden-stage { opacity: 0; visibility: hidden; z-index: 0; pointer-events: none; }

/* ==========================================
   SECCIÓN 1: INICIO (SPLASH SCREEN)
   ========================================== */
.parallax-bg { position: absolute; inset: -5%; background-size: cover; background-position: center; z-index: 1; }

#stage-1::before {
    content: ''; position: absolute; inset: 0;
    background-color: rgba(0, 0, 0, 0.2); 
    background-image: radial-gradient(circle, rgba(0,0,0,0) 30%, rgba(0,0,0,0.8) 100%); 
    z-index: 2; pointer-events: none; 
}

.logo-header-container {
    position: fixed; top: 0; left: 0; z-index: 101; display: flex;
    align-items: flex-start; justify-content: flex-start;
    padding-top: 2rem; padding-left: 2rem; width: auto; height: auto; background: none;
}

.top-left-logo {
    position: static;
    top: calc(var(--header-gap) + env(safe-area-inset-top, 0));
    left: calc(var(--header-horizontal) + env(safe-area-inset-left, 0));
    width: clamp(90px, 8vw, 150px);
    height: auto; max-height: 80px; z-index: 100; display: block; object-fit: contain;
    filter: drop-shadow(0 6px 15px rgba(0,0,0,0.8)) drop-shadow(0 0 8px rgba(255,215,0,0.2));
    transition: transform 0.25s ease, opacity 0.25s ease;
    will-change: transform, opacity;
    transform: translateY(-1px);
}

.top-right-nav {
    position: fixed;
    top: calc(var(--header-gap) + env(safe-area-inset-top, 0));
    right: calc(var(--header-horizontal) + env(safe-area-inset-right, 0));
    z-index: 100; display: flex; gap: 2rem; align-items: center; 
}
.top-right-nav a {
    color: var(--white); text-decoration: none; font-size: 0.9rem;
    letter-spacing: 2px; text-transform: uppercase; transition: color 0.3s;
    text-shadow: 0 2px 5px rgba(0,0,0,0.8); 
}
.top-right-nav a:hover { color: var(--gold); }

.splash-center-content {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    text-align: center; z-index: 60; width: 100%;
}
.intro-text {
    font-size: 1.5rem; font-weight: 300; letter-spacing: 6px;
    margin-bottom: 0.5rem; text-transform: uppercase; opacity: 0.9;
    text-shadow: 0 2px 8px rgba(0,0,0,0.8); 
}
.main-title { 
    font-size: 5rem; font-weight: 900; margin-bottom: 3rem; 
    text-shadow: 0 6px 18px rgba(0,0,0,0.9); text-transform: uppercase; letter-spacing: 2px;
}

.btn-pulse {
    background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.1); 
    color: var(--white); padding: 1rem 3rem; font-size: 1rem; font-weight: 300; 
    letter-spacing: 2px; cursor: pointer; border-radius: 30px; 
    animation: pulse 2s infinite; transition: all 0.4s ease;
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); 
}
.btn-pulse:hover { 
    background: rgba(255, 255, 255, 0.05); border-color: var(--gold); 
    backdrop-filter: blur(15px); -webkit-backdrop-filter: blur(15px); animation: none; 
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(255,255,255,0.1); }
    70% { box-shadow: 0 0 0 20px rgba(255,255,255,0); }
    100% { box-shadow: 0 0 0 0 rgba(255,255,255,0); }
}

/* ==========================================
   SECCIÓN 2 & 3: SPLIT VIEW (PANTALLA DIVIDIDA)
   ========================================== */
.top-center-question {
    position: absolute; top: 3rem; width: 100%; text-align: center;
    z-index: 60; pointer-events: none; transition: opacity 0.5s ease;
}
.top-center-question h2 { font-size: 1.5rem; font-weight: 400; letter-spacing: 2px; text-shadow: 0 2px 10px rgba(0,0,0,0.8); }

/* CLASE NUEVA PARA OCULTAR PREGUNTA AL SELECCIONAR */
.hidden-question { opacity: 0 !important; visibility: hidden; }

.split-wrapper { display: flex; width: 100vw; height: 100vh; }

.split {
    position: relative; width: 50%; height: 100%;
    display: flex; justify-content: center; align-items: center; text-align: center;
    transition: all var(--speed) cubic-bezier(0.25, 1, 0.5, 1); /* Actualizado a "all" para responder a altura en móvil */
    overflow: hidden;
}

.split-bg { position: absolute; inset: 0; background-size: cover; background-position: center; transition: transform var(--speed); z-index: 1;}
.split::after { content: ''; position: absolute; inset: 0; background: rgba(0,0,0,0.75); z-index: 2; transition: background var(--speed); }
.split:hover::after { background: rgba(0,0,0,0.5); }
.split:hover .split-bg { transform: scale(1.05); }

.split-content { position: relative; z-index: 10; width: 80%; max-width: 500px; display: flex; flex-direction: column; align-items: center;}
.split-title { font-size: 3rem; margin-bottom: 1rem; text-transform: uppercase; text-shadow: 0 4px 10px rgba(0,0,0,0.6); }
.subtitle { font-size: 1.2rem; margin-bottom: 2rem; color: var(--gold); }

/* Interacciones JS para expandir a 100% (Desktop) */
.hover-left .left { width: 100%; }
.hover-left .right { width: 0%; }
.hover-right .right { width: 100%; }
.hover-right .left { width: 0%; }

.btn-glass {
    background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--white); padding: 1rem 2rem; font-size: 1rem; border-radius: 8px;
    cursor: pointer; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); transition: all 0.3s;
}
.btn-glass:hover { background: rgba(255,215,0,0.1); border-color: var(--gold); color: var(--gold); }

/* ==========================================
   LISTADOS (SECCIÓN 3)
   ========================================== */
.hidden-list {
    max-height: 0; opacity: 0; overflow: hidden; transition: all var(--speed);
    display: flex; flex-direction: column; width: 100%;
}
.services-list.active {
    max-height: 70vh; opacity: 1; margin-top: 1rem; overflow-y: auto; padding-right: 10px;
}
.services-list.active::-webkit-scrollbar { width: 6px; }
.services-list.active::-webkit-scrollbar-thumb { background: var(--gold); border-radius: 10px; }

.service-item {
    display: flex; align-items: center; gap: 1rem; padding: 1rem; color: var(--white);
    text-decoration: none; border-bottom: 1px solid rgba(255,255,255,0.1); transition: all 0.3s;
}
.service-item:hover { color: var(--gold); padding-left: 15px; background: rgba(255,255,255,0.05); }

.btn-back {
    margin-top: 2rem; background: transparent; border: 1px solid var(--gold); color: var(--gold);
    padding: 1rem 2rem; border-radius: 30px; cursor: pointer; transition: 0.3s; align-self: center; width: fit-content;
}
.btn-back:hover { background: var(--gold); color: var(--black); }

.global-footer {
    position: fixed; bottom: 0; left: 0; width: 100%; text-align: center;
    padding: 10px; font-size: 0.7rem; color: var(--white); opacity: 0.4;
    z-index: 100; pointer-events: none;
}

/* ==========================================
   OPTIMIZACIÓN MÓVIL (RESPONSIVE DE ÉLITE)
   ========================================== */
@media (max-width: 768px) {
    /* 1. Logo y Navegación */
    .logo-header-container { padding-top: 1.5rem; padding-left: 1.5rem; }
    .top-left-logo { width: 85px !important; }
    .top-right-nav { top: 1.5rem; right: 1.5rem; gap: 1rem; }
    .top-right-nav a { font-size: 0.8rem; }

    /* 2. Tipografías Reducidas */
    .main-title { font-size: 2.8rem; }
    .intro-text { font-size: 1.1rem; }
    .split-title { font-size: 2rem; }
    .subtitle { font-size: 1rem; }
    .top-center-question { top: 6rem; }
    .top-center-question h2 { font-size: 1.2rem; }
    .agency-description { font-size: 0.85rem; line-height: 1.4; margin-bottom: 1rem; }

    /* 3. Transformación Split a Apilamiento Vertical */
    .split-wrapper { flex-direction: column; }
    .split { width: 100% !important; height: 50%; border-bottom: 1px solid rgba(255,255,255,0.1); }
    
    /* En móvil se expanden hacia arriba/abajo (height) en lugar de izquierda/derecha (width) */
    .hover-left .left { height: 100%; }
    .hover-left .right { height: 0%; }
    .hover-right .right { height: 100%; }
    .hover-right .left { height: 0%; }

    /* 4. Touch Targets (Botones amigables con el dedo) */
    .btn-glass { 
        padding: 1.2rem 2rem; 
        width: 90%; 
        max-width: 300px; 
        font-weight: bold;
    }
    .service-item { 
        padding: 1.2rem 1rem; /* Más área táctil para enlaces */
        font-size: 0.95rem;
    }
    .btn-pulse { width: 80%; padding: 1rem 1.5rem; font-size: 0.9rem; }
}