/* =========================================================
   TEAM PAGE
========================================================= */

#team,
.team-hero,
.team-intro {
    --team-dark: #082500;
    --team-light: #13330D;
    --team-circle: #406E09;
    --team-cream: #FFF4CF;
    --team-orange: #DB6912;
}

#team {
    width: 100%;
    margin: 0;
    padding: 0;
    background-color: var(--team-dark);
    color: var(--team-cream);
    font-family: "Poppins", sans-serif;

    /* stops the oversized frogs causing sideways scrolling */
    overflow-x: hidden;
    overflow-x: clip;
}

/* =========================================================
   TYPOGRAPHY
========================================================= */

#team h1,
#team h2 {
    font-family: "Calistoga", serif;
    font-weight: 400;
    color: var(--team-cream);
}

#team h3,
#team p,
#team a {
    font-family: "Poppins", sans-serif;
}

/* =========================================================
   TEAM HERO
========================================================= */

.team-hero {
    position: relative;
    width: 100%;
    height: 740px;
    background-color: var(--team-dark);
    overflow-x: clip;
    overflow-y: visible;
    z-index: 2;
}

.team-hero-content {
    position: relative;
    width: min(1600px, 100%);
    height: 100%;
    margin: 0 auto;
}

.team-hero-frog {
    position: absolute;
    left: -7%;
    top: 75px;
    width: 640px;
    height: 720px;
    transform: rotate(-20deg);
    transform-origin: center center;
    z-index: 5;
    pointer-events: none;
}

.team-hero-frog img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.team-hero-title {
    position: absolute;
    left: 32%;
    top: 52%;
    transform: translateY(-50%);
    margin: 0;
    font-family: "Calistoga", serif;
    font-size: clamp(120px, 13vw, 220px);
    font-weight: 400;
    right: 3%;
    line-height: 1;
    white-space: normal;
    color: var(--team-cream);
    z-index: 3;
}

/* =========================================================
   TEAM INTRODUCTION
========================================================= */

.team-intro {
    position: relative;
    width: 100%;
    margin: 0;
    padding: 125px 0 95px;
    background-color: var(--team-light);
    box-sizing: border-box;
    z-index: 1;
}

.team-intro-content {
    width: min(1250px, 86%);
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 0.9fr;
    align-items: center;
    gap: 90px;
}

.team-intro-text {
    min-width: 0;
}

.team-intro--text-only .team-intro-content {
    width: min(900px, 86%);
    grid-template-columns: 1fr;
}

.team-intro-text p {
    margin: 0;
    font-family: "Poppins", sans-serif;
    font-size: 22px;
    font-weight: 400;
    line-height: 1.7;
    color: var(--team-cream);
}

.team-intro-image {
    width: 100%;
}

.team-intro-image img {
    display: block;
    width: 100%;
    height: 390px;
    object-fit: cover;
    border-radius: 12px;
}

/* =========================================================
   EXECUTIVE TEAM / ACADEMIC ADVISORS
========================================================= */

.executive-team {
    width: 100%;
    margin: 0;
    padding: 95px 7% 115px;
    box-sizing: border-box;
    background-color: var(--team-dark);
}

.executive-team + .executive-team {
    background-color: var(--team-light);
}

#team .team-section-title {
    margin: 0 0 65px;
    text-align: center;
    font-family: "Calistoga", serif !important;
    font-size: 64px !important;
    font-weight: 400;
    line-height: 1.1;
    color: var(--team-cream);
}

/* Cards wrap and incomplete rows stay centred */
#team .executive-team .executive-grid {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    align-items: flex-start;
    grid-template-columns: none !important;
    width: min(1050px, 100%);
    margin-left: auto;
    margin-right: auto;
    column-gap: 80px;
    row-gap: 80px;
}

/* =========================================================
   PERSON CARDS
========================================================= */

.person-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

/* The grid sizes the wrapper around each card; the card fills it */
#team .executive-team .person-card-wrap {
    flex: 0 0 250px;
    width: 250px;
}

#team .executive-team .person-card {
    width: 100%;
}

.person-photo {
    width: 205px;
    height: 205px;
    margin: 0 0 22px;
    flex-shrink: 0;
    border-radius: 50%;
    background-color: var(--team-circle);
    overflow: hidden;
}

.person-photo img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.person-name {
    margin: 0;
    font-family: "Poppins", sans-serif;
    font-size: 20px;
    font-weight: 600;
    line-height: 1.3;
    color: var(--team-cream);
}

.person-role {
    margin: 6px 0 0;
    font-family: "Poppins", sans-serif;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.4;
    color: var(--team-cream);
}

.person-link {
    display: block;
    color: var(--team-cream);
    text-decoration: none;
}

.person-link:hover {
    text-decoration: underline;
}

/* =========================================================
   DEPARTMENT SECTIONS
========================================================= */

.department-section {
    position: relative;
    width: 100%;
    margin: 0;
    padding: 95px 7% 110px;
    box-sizing: border-box;
    background-color: var(--team-dark);
}

.department-section:nth-of-type(odd) {
    background-color: var(--team-dark);
}

.department-section:nth-of-type(even) {
    background-color: var(--team-light);
}

.department-team {
    width: min(1100px, 100%);
    margin: 0 auto;
}

.department-image {
    display: block;
    width: 100%;
    height: 480px;
    margin: 0 0 40px;
    object-fit: cover;
    border-radius: 12px;
}

.team-leads {
    margin: 0 0 28px;
}

.department-label {
    margin: 0 0 10px;
    font-family: "Poppins", sans-serif;
    font-size: 20px;
    font-weight: 750;
    line-height: 1.4;
    color: var(--team-cream);
}

.team-leads p {
    margin: 0;
    font-family: "Poppins", sans-serif;
    font-size: 16px;
    font-weight: 400;
    line-height: 1.55;
    color: var(--team-cream);
}

.department-members {
    width: 100%;
}

.members-grid {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    column-gap: 45px;
    row-gap: 3px;
}

.members-grid p,
.team-name {
    margin: 0;
    font-family: "Poppins", sans-serif;
    font-size: 16px;
    font-weight: 400;
    line-height: 1.55;
    color: var(--team-cream);
}

/* =========================================================
   JOIN THE TEAM SECTION
========================================================= */

/*  Every size below is "desktop value OR the same proportion of the
    screen width, whichever is smaller". So on smaller screens the whole
    section shrinks as one piece and keeps the desktop layout
    (text left, frog right) instead of stacking. Designed at 1280px wide. */

.team-join-section {
    position: relative;
    width: 100%;
    margin: 0;
    padding: 0;
    background-color: #0C2103;
    overflow: hidden;
    box-sizing: border-box;
}

.team-wave-wrapper {
    position: relative;
    width: 100%;
    height: min(180px, 14vw);
    margin: 0;
    padding: 0;
    overflow: hidden;
    line-height: 0;
    background-color: #0C2103;
}

.team-wave {
    display: block;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
}

.team-wave-orange {
    fill: #DB6912;
}

.team-wave-cream {
    fill: #FFF4CF;
}

.team-join-content {
    position: relative;
    width: min(1450px, 90%);
    min-height: min(650px, 50.8vw);
    margin: 0 auto;
    padding: min(15px, 1.2vw) 0 min(60px, 4.7vw);
    box-sizing: border-box;
}

.team-join-text {
    position: relative;
    width: 56%;
    margin: 0;
    padding: 0;
    z-index: 5;
}

.team-join-heading {
    margin: 0 0 min(28px, 2.2vw);
    font-family: "Calistoga", serif !important;
    font-size: min(66px, 5.2vw);
    font-weight: 400;
    line-height: 1;
    color: #FFF4CF;
}

.team-join-logo-row {
    display: flex;
    align-items: center;
    width: 100%;
}

/* biom-text.png has empty space around the word. The negative margins
   trim it so the "?" sits right next to "BiOM". Change --logo-w to resize. */
.team-join-biom-logo {
    --logo-w: 92%;
    display: block;
    width: var(--logo-w);
    height: auto;
    object-fit: contain;
    margin:
        calc(var(--logo-w) * -0.135)
        calc(var(--logo-w) * -0.163)
        calc(var(--logo-w) * -0.145)
        calc(var(--logo-w) * -0.165);
}

.team-join-question {
    display: block;
    flex-shrink: 0;
    align-self: flex-end;
    margin-left: min(8px, 0.6vw);
    font-family: "Calistoga", serif;
    font-size: min(77px, 6vw);
    font-weight: 400;
    line-height: 1;
    color: #FFF4CF;
}

#team .team-join-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: min(410px, 32vw);
    max-width: 100%;
    height: min(100px, 7.8vw);
    margin-top: min(20px, 1.6vw);
    border: none;
    border-radius: min(55px, 4.3vw);
    background-color: #13330D;
    font-family: "Poppins", sans-serif;
    font-size: min(42px, 3.3vw);
    font-weight: 700;
    color: #DB6912 !important; /* beats a { color: ... !important } in fonts.css */
    text-decoration: none;
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.18);
    cursor: pointer;
    transition:
        transform 0.2s ease,
        background-color 0.2s ease,
        color 0.2s ease;
}

#team .team-join-button:hover {
    transform: translateY(-4px);
    background-color: #406E09;
    color: #FFF4CF !important;
    text-decoration: none;
}

.team-join-frog {
    position: absolute;
    right: max(-30px, -2.3vw);
    bottom: max(-35px, -2.7vw);
    width: min(780px, 53vw);
    z-index: 4;
    pointer-events: none;
    transform: scaleX(-1) rotate(-10deg);
}

.team-join-frog img {
    display: block;
    width: 100%;
    height: auto;
    object-fit: contain;
    transform: scaleX(-1) rotate(-10deg);
}

/* Very small phones: give the text a bit more room so the button
   label and "Interested in" stay readable */
@media (max-width: 480px) {

    .team-join-text {
        width: 60%;
    }

    .team-join-heading {
        font-size: 22px;
    }

    .team-join-question {
        font-size: 26px;
    }

    #team .team-join-button {
        width: 140px;
        height: 40px;
        border-radius: 22px;
        font-size: 15px;
    }
}

/* =========================================================
   REUSABLE FLIPPING ROLE CARDS
========================================================= */

.role-flip-card {
    width: 100%;
    max-width: 300px;
    height: 210px;
    perspective: 1000px;
}

.role-flip-inner {
    position: relative;
    display: block;
    width: 100%;
    height: 100%;
    padding: 0;
    border: none;
    border-radius: 24px;
    background: transparent;
    cursor: pointer;
    transform-style: preserve-3d;
    transition: transform 0.65s ease;
    font-family: "Poppins", sans-serif;
    color: inherit;
}

.role-flip-inner.is-flipped {
    transform: rotateY(180deg);
}

.role-flip-front,
.role-flip-back {
    position: absolute;
    inset: 0;
    border-radius: 24px;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    overflow: hidden;
}

.role-flip-front {
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #4C7F0A;
    color: #FFF4CF;
    padding: 20px;
    box-sizing: border-box;
}

.role-flip-front h3 {
    margin: 0;
    font-family: "Calistoga", serif;
    font-size: 24px;
    font-weight: 400;
    text-align: center;
    color: #FFF4CF;
}

.role-flip-back {
    display: flex;
    align-items: flex-start;
    background-color: #FFF4CF;
    color: #0C2103;
    transform: rotateY(180deg);
    padding: 16px;
    box-sizing: border-box;
    text-align: left;
}

.role-flip-details {
    width: 100%;
    max-height: 100%;
    overflow-y: auto;
    scrollbar-width: thin;
}

.role-flip-details h4 {
    margin: 0 0 3px;
    font-family: "Poppins", sans-serif;
    font-size: 13px;
    font-weight: 700;
}

.role-flip-details ul {
    margin: 0 0 10px;
    padding-left: 18px;
}

.role-flip-details li {
    font-family: "Poppins", sans-serif;
    font-size: 12px;
    line-height: 1.4;
}

.role-flip-description {
    margin: 8px 0 0;
    font-family: "Poppins", sans-serif;
    font-size: 11px;
    line-height: 1.4;
}

.role-flip-inner:focus-visible {
    outline: 3px solid #DB6912;
    outline-offset: 5px;
}

@media (prefers-reduced-motion: reduce) {
    .role-flip-inner {
        transition: none;
    }
}

/* =========================================================
   TABLET (≤ 1000px)
========================================================= */

@media (max-width: 1000px) {

    .team-hero {
        height: clamp(230px, 56vw, 580px);
    }

    .team-hero-frog {
        left: -8vw;
        top: 4vw;
        width: 46vw;
        height: 52vw;
    }

    .team-hero-title {
        left: 38vw;
        top: 50%;
        font-size: 11vw;
    }

    .team-intro {
        padding-top: 105px;
    }

    .team-intro-content {
        width: 88%;
        gap: 55px;
    }

    .team-intro-text p {
        font-size: 19px;
    }

    .team-intro-image img {
        height: 340px;
    }

    #team .team-section-title {
        font-size: 54px !important;
    }

    #team .executive-team .executive-grid {
        width: min(850px, 100%);
        column-gap: 40px;
    }

    #team .executive-team .person-card-wrap {
        flex-basis: 210px;
        width: 210px;
    }

    .person-photo {
        width: 175px;
        height: 175px;
    }

    .person-name {
        font-size: 18px;
    }

    .person-role {
        font-size: 13px;
    }

    .department-image {
        height: 390px;
    }

    .members-grid {
        grid-template-columns: repeat(3, 1fr);
        column-gap: 30px;
    }

}

/* =========================================================
   MOBILE (≤ 768px)
========================================================= */

@media (max-width: 768px) {

    .team-intro {
        padding: 70px 0 55px;
    }

    .team-intro-content {
        width: 86%;
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .team-intro-text p {
        font-size: 16px;
    }

    .team-intro-image img {
        height: auto;
        max-height: 360px;
    }

    .executive-team {
        padding: 60px 5% 75px;
    }

    #team .team-section-title {
        margin-bottom: 40px;
        font-size: 40px !important;
    }

    /* 3 cards per row */
    #team .executive-team .executive-grid {
        column-gap: 16px;
        row-gap: 40px;
    }

    #team .executive-team .person-card-wrap {
        flex: 0 0 calc(33.333% - 11px);
        width: calc(33.333% - 11px);
        max-width: 170px;
    }

    .person-photo {
        width: min(130px, 100%);
        height: auto;
        aspect-ratio: 1 / 1;
        margin-bottom: 12px;
    }

    .person-name {
        font-size: 15px;
    }

    .person-role {
        margin-top: 4px;
        font-size: 12px;
    }

    .department-section {
        padding: 60px 7% 75px;
    }

    .department-image {
        height: auto;
        max-height: 300px;
        margin-bottom: 28px;
    }

    .department-label {
        font-size: 17px;
    }

    .team-leads p,
    .members-grid p,
    .team-name {
        font-size: 14px;
    }

    .members-grid {
        grid-template-columns: repeat(2, 1fr);
        column-gap: 20px;
        row-gap: 4px;
    }
}

/* =========================================================
   SMALL MOBILE (≤ 480px)
========================================================= */

@media (max-width: 480px) {

    .team-intro {
        padding-top: 55px;
    }

    .team-intro-text p {
        font-size: 15px;
    }

    #team .team-section-title {
        font-size: 32px !important;
    }

    /* 2 cards per row */
    #team .executive-team .executive-grid {
        column-gap: 20px;
        row-gap: 34px;
    }

    #team .executive-team .person-card-wrap {
        flex: 0 0 calc(50% - 10px);
        width: calc(50% - 10px);
        max-width: 160px;
    }

    .person-photo {
        width: min(115px, 100%);
    }

    .person-name {
        font-size: 14px;
    }

    .person-role {
        font-size: 12px;
    }

    .department-label {
        font-size: 16px;
    }

    .team-leads p,
    .members-grid p,
    .team-name {
        font-size: 13px;
    }

    .members-grid {
        column-gap: 14px;
    }

    .role-flip-card {
        max-width: 100%;
        height: 200px;
    }

    .role-flip-front h3 {
        font-size: 20px;
    }
}