:root {
    --bg-light: #f5f6f8;
    --red-fage: #e50914;
    --red-glow: rgba(229, 9, 20, 0.4);
    --text-dark: #111111;
    --text-muted: #666666;
    --card-bg: rgba(255, 255, 255, 0.9);
    --card-border: rgba(220, 225, 230, 0.9);
    --font-main: 'Montserrat', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-light);
    color: var(--text-dark);
    font-family: var(--font-main);
    min-height: 100vh;
    overflow-x: hidden;
}

#bg-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    background: linear-gradient(to bottom, rgba(245, 246, 248, 0.94) 0%, rgba(245, 246, 248, 0.98) 100%);
}

/* ENCABEZADO SUPERIOR CLARO */
.header-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 15px 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 500;
    background: rgba(245, 246, 248, 0.92) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(220, 225, 230, 0.6);
}

.brand-logo {
    display: flex;
    align-items: center;
    z-index: 600;
}

.logo-img {
    height: clamp(34px, 4.5vw, 48px);
    width: auto;
    object-fit: contain;
}

/* NAV ESCRITORIO */
.top-nav {
    display: flex;
    gap: 20px;
    align-items: center;
}

.nav-link {
    color: var(--text-muted) !important;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.2s ease, font-weight 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
    color: var(--text-dark) !important;
    font-weight: 800;
}

.btn-glow {
    background-color: var(--red-fage);
    color: #ffffff;
    padding: 12px 26px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 800;
    font-size: 0.8rem;
    letter-spacing: 1px;
    box-shadow: 0 4px 18px var(--red-glow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.btn-glow:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(229, 9, 20, 0.7);
}

/* BOTÓN HAMBURGUESA */
.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    padding: 8px;
    border: none;
    background: transparent;
    z-index: 600;
    outline: none;
}

.nav-toggle span {
    display: block;
    width: 26px;
    height: 2px;
    background: var(--text-dark);
    border-radius: 2px;
    transition: all 0.35s cubic-bezier(0.23, 1, 0.32, 1);
}

.nav-toggle.open span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
    background: var(--red-fage);
}

.nav-toggle.open span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.nav-toggle.open span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
    background: var(--red-fage);
}

/* MENÚ DESPLEGABLE MÓVIL */
.nav-dropdown {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    background: rgba(245, 246, 248, 0.98);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    z-index: 550;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    padding: 80px 10% 40px 10%;
    gap: 10px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-20px);
    transition: all 0.35s ease;
}

.nav-dropdown.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.mobile-nav-link {
    display: flex;
    align-items: center;
    gap: 15px;
    text-decoration: none;
    color: var(--text-muted);
    font-size: clamp(1.3rem, 4vw, 2.2rem);
    font-weight: 900;
    text-transform: uppercase;
    padding: 8px 0;
    width: 100%;
    transition: all 0.3s ease;
}

.mobile-nav-link:hover,
.mobile-nav-link.active {
    color: var(--red-fage);
    padding-left: 10px;
}

.mobile-nav-link .nav-num {
    font-size: 0.8rem;
    color: rgba(0, 0, 0, 0.3);
}

.mobile-nav-link:hover .nav-num,
.mobile-nav-link.active .nav-num {
    color: var(--red-fage);
}

/* CONTENEDOR PRINCIPAL */
.equipo-container {
    padding-top: 130px;
    padding-left: 2%;
    padding-right: 2%;
    padding-bottom: 60px;
    max-width: 1600px;
    margin: 0 auto;
}

.title-section {
    text-align: center;
    margin-bottom: 35px;
}

.page-title {
    font-size: clamp(1.8rem, 3vw, 2.5rem);
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-dark);
}

.red-highlight {
    color: var(--red-fage);
}

/* ORGANIGRAMA RESPONSIVO CON DESPLAZAMIENTO SUAVE */
.org-chart-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    overflow-x: auto;
    padding-bottom: 20px;
}

.level-director {
    display: flex;
    justify-content: center;
}

/* LÍNEAS ESTRUCTURALES */
.line-v-main {
    width: 2px;
    height: 20px;
    background-color: var(--red-fage);
}

.line-h-main {
    width: 82%;
    height: 2px;
    background-color: var(--red-fage);
    margin-bottom: 20px;
}

.level-departments {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    width: 100%;
    align-items: flex-start;
}

.org-column {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    min-width: 210px;
}

.line-v-sub {
    width: 2px;
    height: 18px;
    background-color: #cccccc;
}

.line-h-sub {
    width: 70%;
    height: 2px;
    background-color: #cccccc;
    margin-bottom: 15px;
}

.sub-group {
    display: flex;
    gap: 10px;
    justify-content: center;
    width: 100%;
}

/* TARJETAS DE INTEGRANTES */
.team-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 14px;
    padding: 18px 12px;
    text-align: center;
    width: 100%;
    max-width: 240px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.team-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.1);
    border-color: rgba(229, 9, 20, 0.3);
}

.team-card.director {
    border-top: 3px solid var(--red-fage);
    background: #ffffff;
    max-width: 280px;
}

.team-card.sub-card {
    padding: 14px 10px;
    font-size: 0.85rem;
}

/* ICONO CASCO CIRCULAR */
.helmet-icon {
    width: 40px;
    height: 40px;
    background-color: var(--red-fage);
    color: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 10px auto;
    font-size: 1.1rem;
    box-shadow: 0 3px 10px var(--red-glow);
}

.team-card h3 {
    font-size: 0.88rem;
    font-weight: 800;
    color: var(--text-dark);
    margin-bottom: 5px;
    line-height: 1.25;
}

.team-card h4 {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    line-height: 1.3;
}

/* ==========================================
   REGLAS RESPONSIVAS
   ========================================== */

@media (max-width: 900px) {
    .top-nav {
        display: none;
    }

    .nav-toggle {
        display: flex;
    }

    .btn-header-cta {
        display: none;
    }

    .line-h-main, .line-v-main, .line-h-sub, .line-v-sub {
        display: none; /* Oculta las líneas conectoras rigurosas en pantallas pequeñas */
    }

    .level-departments {
        flex-direction: column;
        align-items: center;
        gap: 25px;
    }

    .org-column {
        width: 100%;
        max-width: 320px;
    }

    .sub-group {
        flex-direction: column;
        align-items: center;
    }
}

@media (max-width: 480px) {
    .equipo-container {
        padding-top: 100px;
    }
}