/* Staff directory. Loaded only on /sotrudniki.html */

.staff-page { padding: 28px 0 72px; }
@media (max-width: 768px) { .staff-page { padding: 18px 0 48px; } }

.staff-intro { max-width: 760px; }

.staff-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
    margin-top: 24px;
}
@media (min-width: 640px) {
    .staff-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
}
@media (min-width: 1024px) {
    .staff-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; }
}

html.js .staff-card { display: none; }
html.js .staff-card.is-shown { display: flex; }
#staffMenuDivider[hidden],
#staffMenuPhone[hidden],
#staffFooterHot[hidden] { display: none !important; }
html:not(.js) .staff-pager,
html:not(.js) .staff-card__more { display: none; }
html.js .staff-card__meta { display: none; }

/* ---------------------- card ---------------------- */
.staff-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-width: 0;
    padding: 0 16px 16px;
    background: var(--surface);
    border: 1px solid var(--ink-200);
    border-radius: 26px;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: transform .35s var(--ease), box-shadow .35s var(--ease), border-color .35s var(--ease);
}
.staff-card:hover {
    transform: translateY(-6px);
    border-color: #cfc9ff;
    box-shadow: 0 28px 56px rgba(59, 40, 204, 0.18);
}

/* Dark header: same language as the hero block on the landing page. */
.staff-card__top {
    position: relative;
    height: 96px;
    margin: 0 -16px 52px;
    background-image:
        linear-gradient(105deg, transparent 32%, rgba(255, 255, 255, 0.18) 50%, transparent 68%),
        radial-gradient(110% 130% at 0% 0%, rgba(124, 110, 255, 0.8), transparent 60%),
        radial-gradient(80% 90% at 100% 110%, rgba(91, 78, 255, 0.85), transparent 62%),
        linear-gradient(135deg, #1a1a2e 0%, var(--primary-dark) 100%);
    background-size: 240% 100%, auto, auto, auto;
    background-repeat: no-repeat;
    background-position: 220% 0, 0 0, 0 0, 0 0;
    transition: background-position 1s var(--ease);
}
.staff-card:hover .staff-card__top { background-position: -220% 0, 0 0, 0 0, 0 0; }
.staff-card__top::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255, 255, 255, 0.18) 1px, transparent 1.4px);
    background-size: 14px 14px;
    -webkit-mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.9), transparent 90%);
    mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.9), transparent 90%);
    pointer-events: none;
}
.staff-card__top::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.35), transparent);
}

.staff-photo {
    position: absolute;
    z-index: 1;
    left: 50%;
    bottom: 0;
    transform: translate(-50%, 50%);
    width: 92px;
    height: 92px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: #fff;
    background: linear-gradient(160deg, #8b7cff 0%, #4a3ed9 100%);
    box-shadow:
        0 0 0 4px #fff,
        0 0 0 6px rgba(91, 78, 255, 0.28),
        0 14px 30px rgba(91, 78, 255, 0.35);
    transition: transform .35s var(--ease), box-shadow .35s var(--ease);
}
.staff-card:hover .staff-photo {
    transform: translate(-50%, 50%) scale(1.05);
    box-shadow:
        0 0 0 4px #fff,
        0 0 0 7px rgba(91, 78, 255, 0.42),
        0 18px 38px rgba(91, 78, 255, 0.45);
}
.staff-photo__icon {
    width: 54%;
    height: 54%;
    filter: drop-shadow(0 4px 10px rgba(17, 12, 80, 0.3));
}

.staff-card__name {
    margin: 0;
    min-height: 2.7em;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.35;
    letter-spacing: -0.01em;
    color: var(--ink-900);
    text-align: center;
    text-wrap: balance;
    overflow-wrap: anywhere;
}
@media (min-width: 1024px) {
    .staff-card__name { font-size: 14px; }
}

.staff-card__meta {
    display: grid;
    gap: 8px;
    margin: 0;
}
.staff-card__meta div {
    padding: 10px 12px;
    border-radius: 12px;
    background: var(--surface-2);
}
.staff-card__meta dt {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--ink-500);
}
.staff-card__meta dd {
    margin: 4px 0 0;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    color: var(--ink-900);
}

.staff-card__more {
    margin-top: auto;
    width: 100%;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 9px 12px 9px 18px;
    border-radius: 999px;
    background: var(--primary);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    box-shadow: var(--shadow-primary);
    transition: background .2s ease, transform .15s ease, box-shadow .2s ease;
}
.staff-card__more:hover {
    background: var(--primary-hover);
    box-shadow: 0 16px 34px rgba(91, 78, 255, 0.32);
}
.staff-card__more:active { transform: scale(0.985); }
.staff-card__arrow {
    flex: 0 0 auto;
    width: 26px;
    height: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.18);
    transition: transform .2s ease;
}
.staff-card__more:hover .staff-card__arrow { transform: translateX(3px); }

/* ---------------------- pager ---------------------- */
.staff-pager {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 32px;
}
.staff-pager__btn {
    min-width: 44px;
    min-height: 44px;
    padding: 0 16px;
    border: 1px solid var(--ink-200);
    border-radius: 999px;
    background: #fff;
    color: var(--ink-800);
    font-size: 14px;
    font-weight: 600;
    transition: background .2s ease, border-color .2s ease, color .2s ease, transform .15s ease;
}
.staff-pager__btn:hover:not([aria-current="page"]) {
    border-color: #d9d6fe;
    background: var(--primary-light);
    color: var(--primary-dark);
}
.staff-pager__btn:active { transform: scale(0.97); }
.staff-pager__btn[aria-current="page"] {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    box-shadow: var(--shadow-primary);
    cursor: default;
}

.staff-card__more:focus-visible,
.staff-pager__btn:focus-visible,
.staff-modal__x:focus-visible,
.staff-modal__done:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* ---------------------- modal ---------------------- */
.staff-modal[hidden] { display: none !important; }
.staff-modal {
    position: fixed;
    inset: 0;
    z-index: 120;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px;
    padding: max(14px, env(safe-area-inset-top)) 14px max(14px, env(safe-area-inset-bottom));
}
@media (min-width: 640px) {
    .staff-modal { padding: 24px; }
}
.staff-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(17, 24, 39, 0.5);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    animation: fadeIn .2s ease-out;
}
.staff-modal__dialog {
    --modal-photo: clamp(72px, 14vh, 128px);
    --modal-photo: clamp(72px, 14dvh, 128px);
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 480px;
    max-height: min(94vh, 780px);
    max-height: min(94dvh, 780px);
    overflow: auto;
    overscroll-behavior: contain;
    padding: 0 18px 18px;
    border: 1px solid var(--ink-200);
    border-radius: 26px;
    background: #fff;
    box-shadow: 0 24px 80px rgba(16, 24, 40, 0.22);
    animation: slideUp .3s ease-out;
}
@media (min-width: 640px) {
    .staff-modal__dialog { padding: 0 28px 24px; border-radius: 30px; }
}
.staff-modal__top {
    position: relative;
    flex: 0 0 auto;
    height: clamp(88px, 15vh, 128px);
    height: clamp(88px, 15dvh, 128px);
    margin: 0 -18px calc(var(--modal-photo) / 2 + 20px);
    margin: 0 -18px calc(var(--modal-photo) / 2 + clamp(14px, 2.4dvh, 22px));
    background-image:
        radial-gradient(120% 140% at 0% 0%, rgba(124, 110, 255, 0.75), transparent 58%),
        radial-gradient(90% 100% at 100% 100%, rgba(91, 78, 255, 0.55), transparent 62%),
        linear-gradient(135deg, #1a1a2e 0%, var(--primary-dark) 100%);
}
@media (min-width: 640px) {
    .staff-modal__top { margin-left: -28px; margin-right: -28px; }
}
.staff-modal__top::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255, 255, 255, 0.18) 1px, transparent 1.4px);
    background-size: 14px 14px;
    -webkit-mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.9), transparent 90%);
    mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.9), transparent 90%);
    pointer-events: none;
}
.staff-modal__x {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 2;
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    transition: background .2s ease;
}
.staff-modal__x:hover { background: rgba(255, 255, 255, 0.26); }
.staff-photo--modal {
    width: var(--modal-photo);
    height: var(--modal-photo);
    box-shadow:
        0 0 0 5px #fff,
        0 0 0 7px rgba(91, 78, 255, 0.28),
        0 18px 40px rgba(91, 78, 255, 0.4);
}
.staff-modal__kicker {
    margin-top: 0;
    text-align: center;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--primary);
}
.staff-modal__title {
    margin: 6px 0 0;
    margin: clamp(4px, 1dvh, 8px) 0 0;
    text-align: center;
    font-size: clamp(20px, 2.4vw, 26px);
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -0.01em;
    color: var(--ink-900);
    text-wrap: balance;
}
.staff-modal__facts {
    display: grid;
    gap: 8px;
    gap: clamp(6px, 1.4dvh, 10px);
    margin: 16px 0 0;
    margin: clamp(12px, 2.4dvh, 20px) 0 0;
}
.staff-modal__facts div {
    padding: 10px 14px;
    padding: clamp(8px, 1.7dvh, 12px) 14px;
    border: 1px solid var(--ink-100);
    border-radius: 16px;
    background: var(--surface-2);
}
.staff-modal__facts dt {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--ink-500);
}
.staff-modal__facts dd {
    margin: 4px 0 0;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.45;
    color: var(--ink-900);
}
.staff-modal__done {
    flex: 0 0 auto;
    width: 100%;
    min-height: 44px;
    min-height: clamp(42px, 6dvh, 48px);
    margin-top: 12px;
    margin-top: clamp(10px, 2dvh, 16px);
    border-radius: 999px;
    background: var(--ink-900);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    transition: background .2s ease;
}
.staff-modal__done:hover { background: var(--primary); }

/* Short viewports (e.g. landscape phones): compress hard so the dialog fits
   fully without any inner scroll. */
@media (max-height: 480px) {
    .staff-modal { padding: 6px; }
    .staff-modal__dialog { padding: 0 16px 10px; border-radius: 22px; }
    .staff-modal__top {
        height: 50px;
        margin: 0 -16px 32px;
    }
    .staff-photo--modal {
        width: 52px;
        height: 52px;
        box-shadow:
            0 0 0 4px #fff,
            0 0 0 6px rgba(91, 78, 255, 0.28),
            0 10px 22px rgba(91, 78, 255, 0.35);
    }
    .staff-modal__x { top: 8px; right: 8px; width: 32px; height: 32px; border-radius: 10px; }
    .staff-modal__kicker { font-size: 10px; letter-spacing: 0.12em; }
    .staff-modal__title { margin-top: 2px; font-size: 17px; line-height: 1.2; }
    .staff-modal__facts { gap: 4px; margin-top: 7px; }
    .staff-modal__facts div { padding: 4px 12px; border-radius: 12px; }
    .staff-modal__facts dt { font-size: 10px; }
    .staff-modal__facts dd { margin-top: 1px; font-size: 13px; line-height: 1.25; }
    .staff-modal__done { min-height: 36px; margin-top: 6px; font-size: 14px; }
}

.staff-sr {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ---------------------- phones: horizontal card ---------------------- */
@media (max-width: 639px) {
    .staff-card,
    html.js .staff-card.is-shown {
        display: grid;
        grid-template-columns: 112px minmax(0, 1fr);
        grid-template-areas:
            "top name"
            "top more";
        align-items: center;
        column-gap: 16px;
        row-gap: 10px;
        padding: 14px 14px 14px 0;
        border-radius: 22px;
    }
    .staff-card:hover { transform: none; }
    html:not(.js) .staff-card__meta { grid-column: 1 / -1; }
    .staff-card .staff-card__top {
        grid-area: top;
        align-self: stretch;
        height: auto;
        min-height: 124px;
        margin: -14px 0;
    }
    .staff-card .staff-card__top::after { display: none; }
    .staff-card .staff-photo {
        top: 50%;
        bottom: auto;
        transform: translate(-50%, -50%);
        width: 70px;
        height: 70px;
        box-shadow:
            0 0 0 3px rgba(255, 255, 255, 0.9),
            0 0 0 5px rgba(139, 124, 255, 0.5),
            0 12px 26px rgba(0, 0, 0, 0.35);
    }
    .staff-card:hover .staff-photo { transform: translate(-50%, -50%); }
    .staff-card__name { grid-area: name; min-height: 0; align-self: center; font-size: 16px; }
    .staff-card__more { grid-area: more; align-self: start; min-height: 42px; }
}

@media (prefers-reduced-motion: reduce) {
    .staff-modal__backdrop,
    .staff-modal__dialog,
    .staff-card,
    .staff-card__top,
    .staff-photo,
    .staff-card__more,
    .staff-card__arrow,
    .staff-pager__btn { animation: none; transition: none; }
    .staff-card:hover { transform: none; }
    .staff-card:hover .staff-photo { transform: translate(-50%, 50%); }
}
