.team-page {
    padding-bottom: 4rem;
    background: #ffffff;
    color: #14213d;
}

.team-shell {
    display: grid;
    gap: 1.5rem;
}

.team-hero {
    padding: clamp(2.5rem, 5vw, 4.5rem) 0 2rem;
}

.team-hero .team-shell {
    align-items: start;
}

.team-hero-banner {
    display: grid;
    gap: 1.4rem;
    padding: 0;
}

.team-kicker {
    display: inline-flex;
    align-items: center;
    padding: 0.45rem 0.85rem;
    border: 1px solid rgba(20, 33, 61, 0.1);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.78);
    color: #6b7280;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.team-kicker--muted {
    background: rgba(15, 23, 42, 0.04);
}

.team-hero__copy {
    display: grid;
    gap: 1rem;
    justify-items: center;
    text-align: center;
}

.team-hero__copy h1 {
    margin: 0;
    max-width: 11ch;
    font-size: clamp(2.8rem, 6vw, 5rem);
    line-height: 0.95;
    letter-spacing: -0.05em;
    font-weight: 900;
    color: #0f172a;
}

.team-lead {
    margin: 0;
    max-width: 42rem;
    color: #475569;
    font-size: clamp(1rem, 2vw, 1.18rem);
    line-height: 1.7;
}

.team-hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem;
    justify-content: center;
}

.team-hero-banner__content {
    display: grid;
    grid-template-columns: minmax(0, 1.12fr) minmax(320px, 0.88fr);
    gap: 1.2rem;
    /* Выравниваем левый и правый столбец по одной горизонтальной линии. */
    align-items: center;
}

.team-hero-banner__story {
    display: grid;
    gap: 0.85rem;
    padding: 1.15rem 1.2rem;
    border: 1px solid rgba(20, 33, 61, 0.08);
    border-radius: 24px;
    background: #f8fafc;
}

.team-hero-banner__story h2 {
    margin: 0;
    max-width: 24ch;
    color: #0f172a;
    font-size: clamp(1.6rem, 3vw, 2.35rem);
    line-height: 1.08;
    letter-spacing: -0.04em;
    font-weight: 900;
}

.team-hero-banner__story p {
    margin: 0;
    max-width: 62ch;
    color: #475569;
    font-size: 1rem;
    line-height: 1.8;
}

.team-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0.85rem 1.25rem;
    border: 1px solid #0f172a;
    border-radius: 999px;
    text-decoration: none;
    font-weight: 700;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.team-btn:hover,
.team-btn:focus {
    transform: translateY(-1px);
    text-decoration: none;
}

.team-btn--solid {
    color: #ffffff;
    background: linear-gradient(135deg, #233a63, #0f172a);
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.16);
}

.team-btn--solid:hover,
.team-btn--solid:focus {
    color: #ffffff;
    background: linear-gradient(135deg, #2d497b, #16243a);
}

a.team-btn--solid,
a.team-btn--solid:hover,
a.team-btn--solid:active,
a.team-btn--solid:visited,
body[data-bs-theme="light"] a.team-btn--solid,
body[data-bs-theme="light"] a.team-btn--solid:hover,
body[data-bs-theme="light"] a.team-btn--solid:active,
body[data-bs-theme="light"] a.team-btn--solid:visited {
    color: #ffffff;
}

.team-btn--ghost {
    background: rgba(255, 255, 255, 0.26);
    color: #0f172a;
}

.team-btn--ghost:hover,
.team-btn--ghost:focus {
    background: #ffffff;
    color: #0f172a;
}

a.team-btn--ghost,
a.team-btn--ghost:hover,
a.team-btn--ghost:active,
a.team-btn--ghost:visited,
body[data-bs-theme="light"] a.team-btn--ghost,
body[data-bs-theme="light"] a.team-btn--ghost:hover,
body[data-bs-theme="light"] a.team-btn--ghost:active,
body[data-bs-theme="light"] a.team-btn--ghost:visited,
body[data-bs-theme="dark"] a.team-btn--ghost,
body[data-bs-theme="dark"] a.team-btn--ghost:hover,
body[data-bs-theme="dark"] a.team-btn--ghost:active,
body[data-bs-theme="dark"] a.team-btn--ghost:visited {
    color: #0f172a;
}

.team-panel,
.team-card {
    border: 1px solid rgba(20, 33, 61, 0.1);
    border-radius: 28px;
    background: #ffffff;
    box-shadow: 0 22px 60px rgba(15, 23, 42, 0.08);
}

.team-section {
    padding: 0 0 1rem;
}

.team-value-banner__notes {
    display: grid;
    gap: 0.85rem;
    /* Если левый блок выше, группа карточек не прилипает к верху, а центрируется. */
    align-content: center;
}

.team-value-note {
    display: grid;
    gap: 0.45rem;
    padding: 1rem 1.05rem;
    border: 1px solid rgba(20, 33, 61, 0.08);
    border-radius: 22px;
    background: #ffffff;
}

.team-value-note strong {
    color: #0f172a;
    font-size: 0.95rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.team-value-note span {
    color: #64748b;
    font-size: 0.92rem;
    line-height: 1.55;
}

.team-group {
    display: grid;
    gap: 1rem;
}

.team-group + .team-group {
    margin-top: 2rem;
}

.team-group__head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 1rem;
}

.team-group__head h2 {
    margin: 0.4rem 0 0;
    font-size: clamp(1.6rem, 3vw, 2.35rem);
    line-height: 1;
    letter-spacing: -0.04em;
    font-weight: 900;
    color: #0f172a;
}

.team-group__count {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 0.45rem 0.9rem;
    border: 1px solid rgba(20, 33, 61, 0.08);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.85);
    color: #64748b;
    font-size: 0.88rem;
    font-weight: 700;
}

.team-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
}

.team-grid--owner {
    grid-template-columns: repeat(auto-fit, minmax(240px, 320px));
}

.team-card {
    overflow: hidden;
    transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.team-card:hover,
.team-card:focus-within {
    transform: translateY(-3px);
    border-color: rgba(20, 33, 61, 0.18);
    box-shadow: 0 26px 60px rgba(15, 23, 42, 0.14);
}

.team-card__photo-wrap {
    position: relative;
    aspect-ratio: 4 / 4.6;
    overflow: hidden;
    background: #f8fafc;
}

.team-card__photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.28s ease;
}

.team-card:hover .team-card__photo,
.team-card:focus-within .team-card__photo {
    transform: scale(1.03);
}

.team-card__body {
    display: grid;
    gap: 0.45rem;
    padding: 1rem 1.05rem 1.15rem;
}

.team-card__body h3 {
    margin: 0;
    color: #0f172a;
    font-size: 1.08rem;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.team-card__body p {
    margin: 0;
    color: #64748b;
    font-size: 0.95rem;
    line-height: 1.45;
}

.team-card__badge {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    min-height: 32px;
    padding: 0.3rem 0.75rem;
    border-radius: 999px;
    background: #fff7e6;
    color: #9a6700;
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.team-empty {
    display: grid;
    gap: 0.75rem;
    padding: 1.6rem;
    text-align: center;
}

.team-empty h2 {
    margin: 0;
    font-size: clamp(1.45rem, 3vw, 2rem);
    font-weight: 900;
    letter-spacing: -0.04em;
}

.team-empty p {
    margin: 0;
    color: #64748b;
    font-size: 1rem;
}

body[data-bs-theme="dark"] .team-page {
    background: #0b1220;
    color: #e5eefc;
}

body[data-bs-theme="dark"] .team-kicker {
    border-color: rgba(148, 163, 184, 0.18);
    background: rgba(15, 23, 42, 0.82);
    color: #cbd5e1;
}

body[data-bs-theme="dark"] .team-hero__copy h1,
body[data-bs-theme="dark"] .team-hero-banner__story h2,
body[data-bs-theme="dark"] .team-group__head h2,
body[data-bs-theme="dark"] .team-card__body h3,
body[data-bs-theme="dark"] .team-value-note strong,
body[data-bs-theme="dark"] .team-empty h2 {
    color: #f8fafc;
}

body[data-bs-theme="dark"] .team-lead,
body[data-bs-theme="dark"] .team-hero-banner__story p,
body[data-bs-theme="dark"] .team-card__body p,
body[data-bs-theme="dark"] .team-value-note span,
body[data-bs-theme="dark"] .team-empty p,
body[data-bs-theme="dark"] .team-group__count {
    color: #cbd5e1;
}

body[data-bs-theme="dark"] .team-group__count {
    border-color: rgba(148, 163, 184, 0.22);
    background: rgba(255, 255, 255, 0.05);
    color: #f8fafc;
}

body[data-bs-theme="dark"] .team-panel,
body[data-bs-theme="dark"] .team-card,
body[data-bs-theme="dark"] .team-hero-banner__story,
body[data-bs-theme="dark"] .team-value-note {
    border-color: rgba(148, 163, 184, 0.16);
    background: #111827;
    box-shadow: 0 22px 60px rgba(2, 6, 23, 0.34);
}

body[data-bs-theme="dark"] .team-btn {
    border-color: rgba(226, 232, 240, 0.2);
}

body[data-bs-theme="dark"] .team-btn--solid {
    background: linear-gradient(135deg, #f8fafc, #dbe4f0);
    color: #0f172a;
    box-shadow: 0 14px 30px rgba(2, 6, 23, 0.28);
}

body[data-bs-theme="dark"] a.team-btn--solid,
body[data-bs-theme="dark"] a.team-btn--solid:hover,
body[data-bs-theme="dark"] a.team-btn--solid:active,
body[data-bs-theme="dark"] a.team-btn--solid:visited,
body[data-bs-theme="dark"] .team-btn--solid:hover,
body[data-bs-theme="dark"] .team-btn--solid:focus {
    background: linear-gradient(135deg, #ffffff, #e2e8f0);
    color: #0f172a;
}

body[data-bs-theme="dark"] .team-btn--ghost {
    background: rgba(255, 255, 255, 0.03);
    color: #f8fafc;
}

body[data-bs-theme="dark"] .team-btn--ghost:hover,
body[data-bs-theme="dark"] .team-btn--ghost:focus {
    background: #273449;
    color: #ffffff;
}

body[data-bs-theme="dark"] a.team-btn--ghost,
body[data-bs-theme="dark"] a.team-btn--ghost:hover,
body[data-bs-theme="dark"] a.team-btn--ghost:active,
body[data-bs-theme="dark"] a.team-btn--ghost:visited {
    color: #f8fafc;
}

body[data-bs-theme="dark"] .team-card__photo-wrap {
    background: #0f172a;
}

body[data-bs-theme="dark"] .team-card__badge {
    background: rgba(245, 158, 11, 0.14);
    color: #fbbf24;
}

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

@media (max-width: 991.98px) {
    .team-hero-banner__content {
        grid-template-columns: 1fr;
    }

    .team-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .team-group__head {
        align-items: start;
        flex-direction: column;
    }
}

@media (max-width: 575.98px) {
    .team-page {
        padding-bottom: 3rem;
    }

    .team-hero {
        padding-top: 2rem;
    }

    .team-hero__copy h1 {
        max-width: none;
    }

    .team-hero-banner__story {
        padding: 1rem;
    }

    .team-grid {
        grid-template-columns: 1fr;
    }

    .team-btn {
        width: 100%;
    }
}
