/* Team page: one editorial system for members, mentors, and contributors. */
:root {
    --team-canvas: var(--cream);
    --team-paper: #fffaf1;
    --team-ink: var(--dark-text);
    --team-muted: var(--body-text);
}

body:has(.team-page) {
    background: var(--team-canvas);
    color: var(--team-ink);
    overflow-x: hidden;
}

body:has(.team-page) > header.bg-hero {
    display: none;
}

body > .container:has(> .team-page) {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
}

.team-page {
    overflow-x: clip;
}

.team-eyebrow {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin: 0 0 1.1rem;
    color: var(--berry);
    font-size: 0.72rem;
    font-weight: 750;
    letter-spacing: 0.17em;
    line-height: 1.4;
    text-transform: uppercase;
}

.team-eyebrow::before {
    width: 2.6rem;
    height: 1px;
    flex: 0 0 auto;
    background: currentColor;
    content: "";
}

.team-hero {
    position: relative;
    min-height: min(50rem, calc(100svh - var(--nav-height)));
    display: grid;
    grid-template-columns: minmax(0, 0.95fr) minmax(24rem, 1.05fr);
    align-items: center;
    gap: clamp(3rem, 7vw, 8rem);
    isolation: isolate;
    padding: clamp(5rem, 9vw, 8rem) max(1.25rem, calc((100vw - 82rem) / 2));
    background: var(--team-canvas);
}

.team-hero::before,
.team-hero::after {
    position: absolute;
    z-index: -1;
    border-radius: 50%;
    content: "";
}

.team-hero::before {
    width: 15rem;
    aspect-ratio: 1;
    top: -5rem;
    left: -6rem;
    background: rgba(221, 175, 204, 0.62);
}

.team-hero::after {
    width: 11rem;
    aspect-ratio: 1;
    right: -4rem;
    bottom: -3rem;
    background: rgba(166, 184, 142, 0.62);
}

.team-hero__copy {
    position: relative;
    z-index: 2;
}

.team-hero h1 {
    max-width: 11ch;
    margin: 0;
    color: var(--team-ink);
    font: 400 clamp(4rem, 8.4vw, 8rem)/0.88 var(--font-brand);
    letter-spacing: 0;
}

.team-hero__intro {
    max-width: 39rem;
    margin: 2rem 0 0;
    color: var(--team-muted);
    font: clamp(1.05rem, 1.5vw, 1.28rem)/1.7 var(--font-display);
}

.team-jump-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
    margin-top: 2rem;
}

.team-jump-links a {
    display: inline-flex;
    align-items: center;
    min-height: 2.65rem;
    padding: 0.65rem 1rem;
    border: 1px solid rgba(47, 105, 117, 0.35);
    border-radius: 999px;
    color: var(--deep-teal);
    font-size: 0.78rem;
    font-weight: 750;
    letter-spacing: 0.055em;
    text-decoration: none;
    text-transform: uppercase;
    transition: background-color 180ms ease, border-color 180ms ease, color 180ms ease, transform 180ms ease;
}

.team-jump-links a:hover,
.team-jump-links a:focus-visible {
    border-color: var(--deep-teal);
    background: var(--deep-teal);
    color: var(--white);
    outline: none;
    transform: translateY(-0.15rem);
}

.team-hero__photo {
    position: relative;
    width: 100%;
    margin: 0;
}

.team-hero__photo::before {
    position: absolute;
    z-index: -1;
    width: 78%;
    aspect-ratio: 1;
    top: 50%;
    right: -7%;
    border: 1px solid rgba(170, 43, 98, 0.32);
    border-radius: 50%;
    box-shadow: 0 0 0 3rem rgba(170, 43, 98, 0.035), 0 0 0 6rem rgba(170, 43, 98, 0.025);
    content: "";
    transform: translateY(-50%);
}

.team-hero__photo-frame {
    position: relative;
    aspect-ratio: 4 / 3;
    display: grid;
    place-items: center;
    overflow: hidden;
    border: 0.65rem solid var(--team-paper);
    background: var(--deep-teal);
    box-shadow: 0 1.75rem 3.5rem rgba(31, 36, 33, 0.17);
    transform: rotate(2deg);
}

.team-hero__photo-frame > img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    object-position: center;
}

.team-hero__photo-frame::before,
.team-hero__photo-frame::after {
    position: absolute;
    border-radius: 50%;
    content: "";
}

.team-hero__photo-frame::before {
    width: 55%;
    aspect-ratio: 1;
    top: -17%;
    right: -8%;
    background: rgba(221, 175, 204, 0.82);
}

.team-hero__photo-frame::after {
    width: 68%;
    aspect-ratio: 1;
    left: -16%;
    bottom: -45%;
    background: rgba(166, 184, 142, 0.82);
}

.team-hero__photo-frame--has-photo::before,
.team-hero__photo-frame--has-photo::after {
    display: none;
}

.team-hero__photo-year {
    position: absolute;
    top: 1rem;
    right: 1.15rem;
    z-index: 2;
    color: rgba(255, 250, 241, 0.96);
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.55);
    font: 400 clamp(2.2rem, 4vw, 4rem)/1 var(--font-display);
}

.team-hero__photo-placeholder {
    position: relative;
    z-index: 2;
    display: grid;
    justify-items: center;
    gap: 0.45rem;
    padding: 2rem;
    color: var(--team-paper);
    text-align: center;
}

.team-hero__photo-placeholder span {
    font: 400 clamp(2rem, 4vw, 3.6rem)/1 var(--font-display);
}

.team-hero__photo-placeholder small,
.team-hero__photo figcaption {
    font-size: 0.63rem;
    font-weight: 750;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}

.team-hero__photo figcaption {
    margin: 1.25rem 0 0;
    color: var(--team-muted);
    text-align: right;
}

.team-hero__index {
    position: absolute;
    right: clamp(1.25rem, 3vw, 3rem);
    bottom: 1.5rem;
    margin: 0;
    color: rgba(31, 36, 33, 0.45);
    font-size: 0.62rem;
    font-weight: 750;
    letter-spacing: 0.16em;
}

.team-members,
.team-mentors {
    width: min(calc(100% - 2.5rem), 82rem);
    margin: 0 auto;
    padding: clamp(5rem, 9vw, 8rem) 0;
}

.team-section-heading {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(20rem, 0.75fr);
    align-items: end;
    gap: clamp(2rem, 7vw, 7rem);
    margin-bottom: clamp(2.5rem, 5vw, 4.5rem);
}

.team-section-heading h2,
.team-mentors h2,
.team-contributors h2 {
    margin: 0;
    color: var(--deep-teal);
    font: 400 clamp(3.2rem, 6.5vw, 6rem)/0.95 var(--font-display);
    letter-spacing: -0.055em;
}

.team-section-heading > p,
.team-mentors__intro > p:last-child,
.team-contributors__heading > p:last-child {
    margin: 0;
    color: var(--team-muted);
    font-size: clamp(1rem, 1.3vw, 1.1rem);
    line-height: 1.75;
}

.team-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: start;
    gap: clamp(1.25rem, 2vw, 2rem);
}

.member-card {
    min-width: 0;
    overflow: hidden;
    border: 1px solid rgba(47, 105, 117, 0.17);
    border-radius: 0.7rem;
    background: var(--team-paper);
    box-shadow: 0 1.25rem 2.8rem rgba(31, 36, 33, 0.08);
    transition: box-shadow 180ms ease, transform 180ms ease;
}

.member-card:hover,
.member-card:focus-within {
    box-shadow: 0 1.5rem 3.2rem rgba(31, 36, 33, 0.14);
    transform: translateY(-0.3rem);
}

.member-card__portrait {
    position: relative;
    aspect-ratio: 4 / 4.5;
    display: grid;
    place-items: center;
    overflow: hidden;
    background: var(--sage);
}

.member-card__portrait::before,
.member-card__portrait::after {
    position: absolute;
    border-radius: 50%;
    content: "";
}

.member-card__portrait::before {
    width: 54%;
    aspect-ratio: 1;
    top: 10%;
    background: rgba(255, 250, 241, 0.56);
}

.member-card__portrait::after {
    width: 105%;
    aspect-ratio: 1;
    bottom: -61%;
    background: rgba(47, 105, 117, 0.84);
}

.member-card--berry .member-card__portrait { background: rgba(170, 43, 98, 0.72); }
.member-card--rose .member-card__portrait { background: var(--dusty-rose); }
.member-card--teal .member-card__portrait { background: rgba(47, 105, 117, 0.72); }
.member-card--olive .member-card__portrait { background: rgba(136, 147, 78, 0.82); }
.member-card--sage .member-card__portrait { background: var(--sage); }

.member-card__portrait--has-photo::before,
.member-card__portrait--has-photo::after {
    display: none;
}

.member-card__headshot {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.member-card__number {
    position: relative;
    z-index: 1;
    color: rgba(255, 250, 241, 0.92);
    font: 400 clamp(3rem, 5vw, 4.8rem)/1 var(--font-display);
}

.member-card__photo-note {
    position: absolute;
    right: 1rem;
    bottom: 0.85rem;
    z-index: 2;
    color: var(--team-paper);
    font-size: 0.6rem;
    font-weight: 750;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}

.member-card__body {
    padding: 1.35rem 1.35rem 1.5rem;
}

.member-card__group,
.mentor-card__label {
    margin: 0 0 0.4rem;
    color: var(--berry);
    font-size: 0.63rem;
    font-weight: 750;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.member-card h3,
.mentor-card h3 {
    margin: 0;
    color: var(--deep-teal);
    font: 400 clamp(1.45rem, 2vw, 1.8rem)/1.1 var(--font-display);
}

.member-card__role {
    min-height: 2.9rem;
    margin: 0.45rem 0 0;
    color: var(--team-muted);
    line-height: 1.45;
}

.team-tags {
    display: flex;
    flex-wrap: wrap;
    align-content: flex-start;
    gap: 0.4rem;
    margin: 1rem 0 0;
    padding: 0;
    list-style: none;
}

.member-card .team-tags {
    min-height: 4.6rem;
}

.team-tag {
    display: inline-flex;
    align-items: center;
    min-height: 1.7rem;
    padding: 0.32rem 0.62rem;
    border: 1px solid rgba(47, 105, 117, 0.36);
    border-radius: 999px;
    background: var(--cream);
    color: var(--deep-teal);
    font-size: 0.6rem;
    font-weight: 750;
    letter-spacing: 0.055em;
    line-height: 1.1;
    text-transform: uppercase;
}

.team-tag--leadership,
.team-tag--communications,
.team-tag--project-administration { background: var(--berry); color: var(--white); }
.team-tag--wet-lab,
.team-tag--wiki { background: var(--deep-teal); color: var(--white); }
.team-tag--modeling,
.team-tag--project-design,
.team-tag--conceptualization { background: var(--olive-green); color: var(--white); }
.team-tag--software,
.team-tag--safety { background: var(--forest-green); color: var(--white); }
.team-tag--human-practices,
.team-tag--design { background: var(--dusty-rose); color: var(--dark-text); }
.team-tag--education,
.team-tag--outreach,
.team-tag--public-engagement { background: var(--sage); color: var(--dark-text); }
.team-tag--entrepreneurship,
.team-tag--implementation,
.team-tag--fundraising { background: #d8c078; color: var(--dark-text); }
.team-tag--measurement,
.team-tag--data-analysis,
.team-tag--photography,
.team-tag--analysis,
.team-tag--other {
    border-color: rgba(47, 105, 117, 0.36);
    background: var(--cream);
    color: var(--deep-teal);
}

.member-card__details {
    margin-top: 1rem;
    border-top: 1px solid rgba(47, 105, 117, 0.16);
}

.member-card__details summary {
    position: relative;
    padding: 0.9rem 2rem 0 0;
    color: var(--deep-teal);
    cursor: pointer;
    font-size: 0.73rem;
    font-weight: 750;
    letter-spacing: 0.055em;
    list-style: none;
    text-transform: uppercase;
}

.member-card__details summary::-webkit-details-marker {
    display: none;
}

.member-card__details summary::after {
    position: absolute;
    top: 0.72rem;
    right: 0;
    content: "+";
    font: 400 1.35rem/1 var(--font-display);
}

.member-card__details[open] summary::after {
    content: "−";
}

.member-card__details summary:focus-visible {
    outline: 2px solid var(--berry);
    outline-offset: 0.3rem;
}

.member-card__details p {
    margin: 0.8rem 0 0;
    color: var(--team-muted);
    font-size: 0.92rem;
    line-height: 1.65;
}

.team-mentors {
    display: grid;
    grid-template-columns: minmax(18rem, 0.68fr) minmax(0, 1.32fr);
    align-items: start;
    gap: clamp(3rem, 8vw, 8rem);
    border-top: 1px solid rgba(47, 105, 117, 0.2);
}

.team-mentors__intro {
    position: sticky;
    top: calc(var(--nav-height) + 2rem);
}

.team-mentors__intro > p:last-child {
    margin-top: 1.5rem;
}

.mentor-list {
    display: grid;
    gap: 1rem;
}

.mentor-card {
    display: grid;
    grid-template-columns: 7.5rem minmax(0, 1fr);
    align-items: center;
    gap: 1.5rem;
    padding: 1rem;
    border: 1px solid rgba(47, 105, 117, 0.17);
    border-radius: 0.7rem;
    background: rgba(255, 250, 241, 0.72);
}

.mentor-card__portrait {
    aspect-ratio: 1;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--deep-teal);
    color: var(--team-paper);
    font: 400 2rem/1 var(--font-display);
}

.mentor-card:nth-child(2) .mentor-card__portrait { background: var(--berry); }
.mentor-card:nth-child(3) .mentor-card__portrait { background: var(--olive-green); }

.mentor-card__role {
    margin: 0.35rem 0 0;
    color: var(--team-muted);
    font-size: 0.9rem;
    font-weight: 700;
}

.mentor-card .team-tags {
    margin-top: 0.8rem;
}

.mentor-card p:last-child {
    margin: 0.55rem 0 0;
    color: var(--team-muted);
    font-size: 0.93rem;
    line-height: 1.6;
}

.team-contributors {
    width: min(calc(100% - 2.5rem), 82rem);
    margin: 0 auto;
    padding: clamp(5rem, 9vw, 8rem) 0;
    border-top: 1px solid rgba(47, 105, 117, 0.2);
    background: var(--team-canvas);
    color: var(--team-ink);
}

.team-contributors .team-eyebrow {
    color: var(--berry);
}

.team-contributors h2,
.team-contributors h3 {
    color: var(--deep-teal);
}

.team-contributors__heading {
    max-width: 52rem;
}

.team-contributors__heading > p:last-child {
    max-width: 43rem;
    margin-top: 1.5rem;
    color: var(--team-muted);
}

.contributor-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
    gap: 1rem;
    margin-top: clamp(2.75rem, 5vw, 4.5rem);
}

.contributor-card {
    padding: clamp(1.5rem, 3vw, 2.4rem);
    border: 1px solid rgba(47, 105, 117, 0.17);
    border-radius: 0.7rem;
    background: rgba(255, 250, 241, 0.72);
}

.contributor-card:last-child:nth-child(odd) {
    grid-column: 1 / -1;
}

.contributor-card__header {
    display: block;
}

.contributor-card h3 {
    margin: 0;
    font: 400 clamp(1.45rem, 2vw, 1.8rem)/1.15 var(--font-display);
}

.contributor-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem 1.5rem;
    margin-top: 0.65rem;
}

.contributor-card__meta p {
    margin: 0;
    color: var(--team-muted);
    font-size: 0.82rem;
    font-weight: 650;
}

.contributor-card__meta span {
    display: block;
    margin-bottom: 0.15rem;
    color: var(--berry);
    font-size: 0.56rem;
    font-weight: 750;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.contributor-card__section-label {
    margin: 1.4rem 0 0;
    color: var(--berry);
    font-size: 0.6rem;
    font-weight: 750;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.contributor-card .team-tags {
    margin-top: 0.55rem;
}

.contributor-card__details {
    margin-top: 0.55rem;
    padding-top: 1.2rem;
    border-top: 1px solid rgba(47, 105, 117, 0.16);
}

.contributor-card__details p {
    margin: 0;
    color: var(--team-muted);
    font-size: 0.92rem;
    line-height: 1.65;
}

.contributor-card__details p + p {
    margin-top: 0.9rem;
}

.contributor-card__details strong {
    color: var(--berry);
}

@media (max-width: 991.98px) {
    .team-hero {
        min-height: auto;
        grid-template-columns: 1fr;
        gap: 2.5rem;
        padding-top: 5rem;
        padding-bottom: 5rem;
    }

    .team-hero__copy {
        max-width: 43rem;
    }

    .team-hero__photo {
        width: min(100%, 42rem);
        margin-inline: auto;
    }

    .team-hero__index {
        display: none;
    }

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

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

    .contributor-card:last-child:nth-child(odd) {
        grid-column: auto;
    }

    .team-mentors {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }

    .team-mentors__intro {
        position: static;
        max-width: 46rem;
    }
}

@media (max-width: 680px) {
    .team-hero {
        padding-top: 4rem;
        padding-bottom: 4rem;
    }

    .team-hero h1 {
        max-width: 100%;
        font-size: clamp(3.2rem, 14vw, 4.3rem);
    }

    .team-hero__copy {
        min-width: 0;
    }

    .team-hero__photo-frame {
        transform: rotate(1deg);
    }

    .team-section-heading {
        grid-template-columns: 1fr;
        align-items: start;
        gap: 1.5rem;
    }

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

    .member-card {
        display: grid;
        grid-template-columns: minmax(9rem, 0.85fr) minmax(0, 1.15fr);
    }

    .member-card__portrait {
        height: 100%;
        min-height: 18rem;
        aspect-ratio: auto;
    }

    .member-card__role {
        min-height: 0;
    }

    .member-card .team-tags {
        min-height: 0;
    }

    .mentor-card {
        grid-template-columns: 5.5rem minmax(0, 1fr);
        gap: 1rem;
    }

}

@media (max-width: 440px) {
    .team-jump-links {
        display: grid;
    }

    .team-jump-links a {
        justify-content: center;
    }

    .member-card {
        display: block;
    }

    .member-card__portrait {
        width: 100%;
        height: auto;
        min-height: 0;
        aspect-ratio: 4 / 3.4;
    }

    .mentor-card {
        grid-template-columns: 1fr;
    }

    .mentor-card__portrait {
        width: 5rem;
    }

}

@media (prefers-reduced-motion: reduce) {
    .member-card,
    .team-jump-links a {
        transition: none;
    }
}

.mentor-card__headshot {
    display: block;
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    object-position: center;
    border-radius: 50%;
}