.team-page {
    padding-block: clamp(2rem, 4vw, 4rem) clamp(4rem, 7vw, 7rem);
    color: var(--color-paper, #fff);
}

.team-intro > .home-eyebrow {
    margin-bottom: 1.25rem;
    color: var(--color-brand-text);
    font-size: .75rem;
}

.team-page__title {
    max-width: 26ch;
    margin: 0 0 1.5rem;
    font-size: clamp(2.25rem, 4.5vw, 4rem);
    line-height: 1.06;
    letter-spacing: -0.04em;
    text-wrap: balance;
}

.team-page__intro {
    max-width: 50rem;
    margin: 0 0 2rem;
    color: var(--color-muted);
    font-size: 1.06rem;
    line-height: 1.65;
}

.team-group {
    margin-block: 0 clamp(2.5rem, 5vw, 4rem);
}

.team-group__title {
    margin: 0 0 1.25rem;
    color: var(--color-paper, #fff);
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.4;
    letter-spacing: -0.025em;
    overflow-wrap: anywhere;
}

.team-group__grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: clamp(0.85rem, 1.6vw, 1.5rem);
    align-items: stretch;
}

.team-person {
    min-width: 0;
    margin: 0;
    overflow: hidden;
    border: 1px solid var(--color-border);
    border-radius: 1rem;
    color: var(--color-paper, #fff);
    background: var(--color-card);
}

.team-person--company .team-person__image { padding: 1.5rem; object-fit: contain; object-position: center; background: #fff; }

.team-person__image,
.team-person__placeholder {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 1;
    object-fit: cover;
    object-position: center 30%;
}

.team-person__placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--color-surface);
    font-size: 0.8rem;
    text-align: center;
}

.team-person__placeholder > img {
    filter: brightness(0) invert(1);
    opacity: 0.8;
}

.team-person__body {
    padding: clamp(0.9rem, 1.5vw, 1.25rem);
}

.team-person__name {
    margin: 0 0 0.55rem;
    color: inherit;
    font-size: 1.06rem;
    font-weight: 700;
    line-height: 1.35;
    letter-spacing: -0.02em;
    overflow-wrap: anywhere;
}

.team-person__role {
    margin: 0;
    color: var(--color-muted);
    font-size: 0.9rem;
    line-height: 1.6;
    overflow-wrap: anywhere;
}


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

@media (max-width: 47.99rem) {
    .team-group__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 29.99rem) {
    .team-group__grid { grid-template-columns: 1fr; }
}

/* Only cards with a profile opener or destination respond to hover. */
.team-page .team-person {
    position: relative;
    display: flex;
    flex-direction: column;
    transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}
.team-page .team-person:has(:focus-visible) {
    border-color: var(--color-focus);
    box-shadow: 0 0 0 2px var(--color-focus), 0 .6rem 1.8rem #95269525;
}
@media (hover: hover) {
    .team-page .team-person:where(:has(.team-person__open, .team-person__link)):hover {
        transform: translateY(-4px);
        border-color: #af83c2;
        box-shadow: 0 .75rem 2rem #95269528;
    }
}
.team-person__details { margin-top: auto; }
.team-person__open, .team-person__link {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    min-height: 0;
    margin: 0;
    padding: 0;
    border: 0;
    color: var(--color-brand-text);
    background: transparent;
    list-style: none;
    cursor: pointer;
}
.team-person__open::-webkit-details-marker { display: none; }
.team-person__open:focus-visible, .team-person__link:focus-visible { outline: 2px solid var(--color-focus); outline-offset: -5px; border-radius: 1rem; }

.home-dialog.team-profile-dialog {
    width: min(64rem, calc(100% - 2rem));
    max-width: none;
    max-height: calc(100svh - 2rem);
    padding: 0;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    scrollbar-color: var(--color-control-border) var(--color-card);
}
html:has(.team-profile-dialog[open]) { overflow: hidden; }
.home-dialog.team-profile-dialog .team-profile-dialog__close {
    position: sticky;
    z-index: 2;
    top: .75rem;
    right: auto;
    display: flex;
    justify-content: flex-end;
    height: 0;
    margin: 0;
    padding: 0 .75rem;
    pointer-events: none;
}
.team-profile-dialog__close button {
    display: grid;
    place-items: center;
    width: 2.75rem;
    height: 2.75rem;
    padding: 0;
    border: 1px solid var(--color-control-border);
    border-radius: 50%;
    color: var(--color-paper);
    background: var(--color-surface);
    cursor: pointer;
    pointer-events: auto;
}
.team-profile-dialog__close svg { display: block; width: 1.25rem; height: 1.25rem; }
.team-profile-dialog__close button:hover { background: #95269530; border-color: #af83c2; }
.team-profile-dialog__close button:focus-visible,
.team-profile__links a:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 4px; }
.team-profile {
    padding: clamp(1.25rem, 3vw, 2.75rem);
}
.team-profile__portrait img { display: block; width: 100%; height: auto; max-height: 15rem; object-fit: contain; border-radius: 1rem; }
.team-profile__content { min-width: 0; }
.team-profile__header { display: grid; grid-template-columns: minmax(0,10rem) minmax(0,1fr); gap: clamp(1.25rem,3vw,2.5rem); align-items: center; margin-bottom: 2rem; padding: 1rem 1rem 2rem 0; border-bottom: 1px solid var(--color-border); }
.team-profile__identity { min-width: 0; }
.team-profile .team-profile__eyebrow { margin: 0 0 .75rem; color: var(--color-brand-text); font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; }
.team-profile__header h3 { margin: 0 0 .75rem; color: var(--color-paper); font-size: clamp(1.6rem, 3vw, 2.35rem); line-height: 1.15; letter-spacing: -.035em; overflow-wrap: anywhere; }
.team-profile .team-profile__role { margin: 0; color: var(--color-muted); font-size: .95rem; line-height: 1.6; }
.team-profile__biography { max-width: 78ch; margin-inline: auto; color: var(--color-paper); font-size: 1rem; line-height: 1.8; overflow-wrap: anywhere; }
.team-profile .team-profile__biography p { max-width: none; margin: 0 0 1.25rem; color: inherit; }
.team-profile__links { margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid var(--color-border); }
.team-profile__links h4 { margin: 0 0 .75rem; font-size: 1rem; }
.team-profile__links ul { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .75rem; margin: 0; padding: 0; list-style: none; }
.team-profile__links li { min-width: 0; }
.team-profile__links a { display: flex; align-items: center; gap: .85rem; height: 100%; padding: 1rem; border: 1px solid var(--color-border); border-radius: .85rem; color: var(--color-paper); background: var(--color-surface); font-size: .88rem; line-height: 1.5; text-decoration: none; overflow-wrap: anywhere; }
.team-profile__links a:hover { border-color: var(--color-brand-text); background: #95269515; }
.team-profile__link-icon { flex: 0 0 2.4rem; display: grid; place-items: center; width: 2.4rem; height: 2.4rem; border-radius: .7rem; color: var(--color-brand-text); background: #d88bea10; }
.team-profile__link-icon svg { width: 1.25rem; height: 1.25rem; }
.team-profile__link-copy { min-width: 0; }
.team-profile__link-copy small { display: block; margin-top: .3rem; color: var(--color-muted); font-size: .73rem; }

/* Native details remains usable when scripts are unavailable. */
.team-page .team-person:has(> details[open]) { grid-column: 1 / -1; transform: none; }
.team-person:has(> details[open]) > .team-person__image { max-width: 15rem; }
.team-person__details[open] > .team-profile { position: relative; z-index: 1; border-top: 1px solid var(--color-border); }
@media (max-width: 39.99rem) {
    .home-dialog.team-profile-dialog { width: calc(100% - 1rem); max-height: calc(100svh - 1rem); border-radius: 1.1rem; }
    .team-profile__header { grid-template-columns: 5.5rem minmax(0,1fr); gap: 1rem; align-items: start; padding-top: 2rem; padding-right: 0; }
    .team-profile__header h3 { font-size: 1.45rem; }
    .team-profile .team-profile__role { font-size: .8rem; }
    .team-profile__biography { font-size: .95rem; line-height: 1.75; }
    .team-profile__links ul { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
    .team-page .team-person { transition: none; }
    .team-page .team-person:where(:has(.team-person__open, .team-person__link)):hover { transform: none; }
}
