/* ==========================================================================
   Directorio del equipo (equipo.html)
   --------------------------------------------------------------------------
   Se carga después de styles.css, ui.css y equipo.css. De ellos toma el
   navbar, el footer, los botones .btn-ld, el eyebrow, los skeletons y el
   avatar con iniciales. Aquí va solo lo propio del directorio, con prefijo
   eqd-:

     1  Hero        foto del equipo + overlay azul + red de nodos + copy
     2  Cifras      franja blanca que monta sobre el borde inferior del hero
     3  Grilla      una tarjeta por integrante (assets/js/equipo.js)
     4  Cierre      banda .ld-cta de ui.css con enlace al repositorio
   ========================================================================== */

:root {
    --eqd-navy: #072B57;
    --eqd-navy-deep: #041C3C;
    --eqd-border: #e3e8ef;
    --eqd-muted: #6b7f95;
    --eqd-green-text: #5A9E1E; /* verde de marca oscurecido para leerse sobre blanco */
    --eqd-radius: 20px;
    --eqd-ease: cubic-bezier(0.16, 1, 0.3, 1);
    --eqd-wrap: 1140px;
}

.eqd-wrap {
    width: 100%;
    max-width: var(--eqd-wrap);
    margin: 0 auto;
    padding: 0 20px;
}

/* --- 1 · Hero ------------------------------------------------------------ */

.eqd-hero {
    position: relative;
    isolation: isolate;
    min-height: clamp(500px, 62vh, 660px);
    padding: 140px 0 96px;
    display: flex;
    align-items: center;
    background: var(--eqd-navy);
    color: #fff;
    overflow: hidden;
}

.eqd-hero__media,
.eqd-hero__overlay,
.eqd-hero__network { position: absolute; inset: 0; }

.eqd-hero__media { z-index: 0; }
.eqd-hero__media img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* Aire por encima de las cabezas: la barra fija tapa los primeros 85 px. */
    object-position: 50% 42%;
    filter: saturate(0.92);
}

/* Opaco a la izquierda (texto), abierto a la derecha (personas). */
.eqd-hero__overlay {
    z-index: 1;
    pointer-events: none;
    background:
        linear-gradient(90deg,
            rgba(7, 43, 87, 0.96) 0%,
            rgba(7, 43, 87, 0.90) 34%,
            rgba(7, 43, 87, 0.70) 58%,
            rgba(7, 43, 87, 0.36) 82%,
            rgba(7, 43, 87, 0.44) 100%),
        linear-gradient(180deg,
            rgba(4, 28, 60, 0.72) 0%,
            rgba(4, 28, 60, 0.20) 30%,
            rgba(4, 28, 60, 0.10) 60%,
            rgba(4, 28, 60, 0.72) 100%);
}

.eqd-hero__network { z-index: 2; pointer-events: none; }
.eqd-hero__network canvas { display: block; width: 100%; height: 100%; }

.eqd-hero__inner {
    position: relative;
    z-index: 3;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 32px;
}

.eqd-hero__copy { max-width: 640px; }

.eqd-hero .eyebrow--light { color: var(--emerald); font-weight: 700; }

.eqd-hero__title {
    margin: 0 0 18px;
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
    font-size: clamp(2.4rem, 5vw, 3.6rem);
    line-height: 1.04;
    letter-spacing: -0.02em;
    color: #fff;
}

.eqd-hero__lead {
    margin: 0 0 14px;
    font-size: clamp(1rem, 1.2vw, 1.15rem);
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.86);
}

.eqd-hero__note {
    margin: 0;
    font-size: 1.02rem;
    font-weight: 600;
    line-height: 1.5;
    color: var(--emerald);
}

/* Frase de marca a la derecha, manuscrita y ligeramente inclinada. */
.eqd-hero__tagline {
    align-self: end;
    margin: 0 8px 12px 0;
    font-family: 'Caveat', 'Segoe Script', cursive;
    font-size: clamp(1.9rem, 2.6vw, 2.5rem);
    line-height: 1.05;
    color: var(--emerald);
    text-align: right;
    transform: rotate(-6deg);
    white-space: nowrap;
}
.eqd-hero__tagline::after {
    content: '';
    display: block;
    width: 72%;
    height: 2px;
    margin: 6px 0 0 auto;
    background: var(--emerald);
    border-radius: 2px;
    opacity: 0.85;
}

/* --- 2 · Cifras ---------------------------------------------------------- */

.eqd-band {
    position: relative;
    z-index: 4;
    margin-top: -54px;
}

.eqd-band__box {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    background: #fff;
    border: 1px solid var(--eqd-border);
    border-radius: 22px;
    box-shadow: 0 18px 40px -22px rgba(7, 43, 87, 0.28), 0 2px 6px rgba(7, 43, 87, 0.05);
    padding: 22px 12px;
    list-style: none;
    margin: 0;
}

.eqd-stat {
    position: relative;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 6px 28px;
    min-width: 0;
}
.eqd-stat + .eqd-stat::before {
    content: '';
    position: absolute;
    left: 0;
    top: 12%;
    height: 76%;
    width: 1px;
    background: var(--eqd-border);
}

.eqd-stat__icon {
    flex: 0 0 auto;
    width: 54px;
    height: 54px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #eef4fb;
}
.eqd-stat__icon svg {
    width: 26px;
    height: 26px;
    fill: none;
    stroke: var(--primary-blue);
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.eqd-stat__value {
    display: block;
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
    font-size: clamp(1.7rem, 2vw, 2.05rem);
    line-height: 1;
    color: var(--eqd-green-text);
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
}
.eqd-stat__label {
    display: block;
    margin-top: 4px;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--primary-blue);
}
.eqd-stat__hint {
    margin: 0 0 0 auto;
    padding-left: 18px;
    border-left: 1px solid var(--eqd-border);
    max-width: 150px;
    font-size: 0.78rem;
    line-height: 1.4;
    color: var(--eqd-muted);
}

/* --- 4 · Grilla ---------------------------------------------------------- */

/* Las tarjetas van directamente bajo la franja de cifras. */
.eqd-members { padding-block: 64px 8px; }

.eqd-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 24px;
    padding-bottom: 8px;
}

.eqd-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    background: #fff;
    border: 1px solid var(--eqd-border);
    border-radius: var(--eqd-radius);
    box-shadow: 0 1px 2px rgba(7, 43, 87, 0.04);
    padding: 32px 24px 26px;
    text-decoration: none;
    color: inherit;
    min-height: 100%;
    transition: transform 0.45s var(--eqd-ease), box-shadow 0.45s var(--eqd-ease), border-color 0.3s ease;
}
.eqd-card:hover,
.eqd-card:focus-visible {
    transform: translateY(-5px);
    box-shadow: 0 22px 40px -22px rgba(7, 43, 87, 0.30), 0 2px 6px rgba(7, 43, 87, 0.05);
    border-color: rgba(0, 75, 135, 0.28);
}
.eqd-card:focus-visible { outline: 2px solid var(--accent-blue); outline-offset: 3px; }

.eqd-card__photo {
    width: 132px;
    height: 132px;
    border-radius: 50%;
    padding: 4px;
    background: linear-gradient(145deg, var(--emerald), var(--accent-blue));
    margin-bottom: 18px;
    flex-shrink: 0;
}
.eqd-card__photo img,
.eqd-card__photo .eq-avatar-initials {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    object-position: center top;
    background: var(--light-bg);
    border: 3px solid #fff;
    display: block;
    font-size: 2rem;
}

.eqd-card__name {
    margin: 0 0 6px;
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
    font-size: 1.08rem;
    line-height: 1.3;
    color: var(--primary-blue);
    text-wrap: balance;
}
.eqd-card__role {
    margin: 0 0 12px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--eqd-green-text);
}
.eqd-card__desc {
    margin: 0 0 20px;
    font-size: 0.92rem;
    line-height: 1.55;
    color: var(--gray-text);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.eqd-card__cta {
    position: relative;
    margin-top: auto;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--eqd-green-text);
    padding-bottom: 3px;
}
.eqd-card__cta::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 1.5px;
    background: currentColor;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s var(--eqd-ease);
}
.eqd-card__cta i { font-size: 0.8rem; transition: transform 0.4s var(--eqd-ease); }
.eqd-card:hover .eqd-card__cta::after,
.eqd-card:focus-visible .eqd-card__cta::after { transform: scaleX(1); }
.eqd-card:hover .eqd-card__cta i,
.eqd-card:focus-visible .eqd-card__cta i { transform: translateX(4px); }

/* Esqueleto mientras responde la API */
.eqd-card--skeleton { pointer-events: none; }
.eqd-card--skeleton .eqd-card__photo { background: #e9eef5; }
.eqd-card--skeleton .eq-skeleton--line { width: 70%; }
.eqd-card--skeleton .eq-skeleton--line.w-60 { width: 50%; }
.eqd-card--skeleton .eq-skeleton--line.w-40 { width: 35%; }

/* Estados: sin perfiles / error */
.eqd-state {
    text-align: center;
    background: #fff;
    border: 1px dashed var(--eqd-border);
    border-radius: var(--eqd-radius);
    padding: 48px 24px;
    color: var(--gray-text);
}
.eqd-state i { font-size: 2rem; color: var(--accent-blue); margin-bottom: 12px; }
.eqd-state h2 { color: var(--primary-blue); font-size: 1.3rem; margin: 0 0 8px; }
.eqd-state p { margin: 0 0 18px; }

/* --- Aparición al entrar en pantalla ------------------------------------- */

.eqd-reveal {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.8s var(--eqd-ease), transform 0.8s var(--eqd-ease);
    transition-delay: calc(var(--d, 0) * 90ms);
}
.eqd-reveal.is-in { opacity: 1; transform: none; }

/* --- Responsive ---------------------------------------------------------- */

@media (max-width: 1199px) {
    .eqd-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 1100px) {
    .eqd-hero__tagline { display: none; }
    .eqd-hero__inner { grid-template-columns: minmax(0, 1fr); }
    .eqd-stat__hint { display: none; }
}

@media (max-width: 900px) {
    .eqd-hero { min-height: 0; padding: 124px 0 88px; }
    .eqd-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
    .eqd-members { padding-block: 48px 8px; }
    .eqd-band__box { padding: 10px 16px; }
    .eqd-stat { padding: 16px 8px; }
    .eqd-stat__icon { width: 46px; height: 46px; }
    .eqd-stat__icon svg { width: 22px; height: 22px; }
}

@media (max-width: 640px) {
    .eqd-hero { padding: 116px 0 80px; }
    .eqd-hero__media img { object-position: 50% 58%; }
    /* El texto ocupa todo el ancho: overlay parejo y más cerrado. */
    .eqd-hero__overlay {
        background:
            linear-gradient(90deg, rgba(7, 43, 87, 0.90) 0%, rgba(7, 43, 87, 0.78) 100%),
            linear-gradient(180deg, rgba(4, 28, 60, 0.70) 0%, rgba(4, 28, 60, 0.10) 40%, rgba(4, 28, 60, 0.72) 100%);
    }
    .eqd-band { margin-top: -44px; }
    .eqd-band__box { grid-template-columns: 1fr; padding: 6px 18px; }
    .eqd-stat { padding: 16px 0; }
    .eqd-stat + .eqd-stat::before { left: 0; top: 0; width: 100%; height: 1px; }
    .eqd-grid { grid-template-columns: 1fr; }
    .eqd-card { padding: 28px 20px 22px; }
}

/* --- Movimiento reducido ------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
    .eqd-reveal { opacity: 1; transform: none; transition: none; }
    .eqd-card, .eqd-card__cta::after, .eqd-card__cta i { transition: none; }
    .eqd-card:hover, .eqd-card:focus-visible { transform: none; }
}
