#team img {
    width: 100%;
}

#team .hero-background {
    border-top: 1px solid var(--secondary-border-color);
    background-image: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.9) 0%,
        rgba(0, 0, 0, 0.5) 18%,
        rgba(0, 0, 0, 0.6) 42%,
        rgba(0, 0, 0, 0.8) 55%,
        rgba(0, 0, 0, 0.9) 75%,
        rgba(0, 0, 0, 0.8) 90%,
        rgba(0, 0, 0, 1) 100%
    ), var(--hero-background);
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
}

#team .hero-background .hero {
    display: flex;
    min-height: clamp(420px, 55vw, 720px);
    flex-direction: column;
    justify-content: flex-end;
}

#team .hero-background .hero .hero-text {
    max-width: 760px;
    margin-bottom: 0;
}

#team .team-members-grid > *,
#team .team-board-grid > * {
    text-align: center;
}

#team .team-board-grid {
    row-gap: 90px;
}

#team .team-members-grid,
#team .team-board-grid {
    margin-top: 60px;
}

#team .team-members-grid img,
#team .team-board-grid img {
    display: block;
    width: 225px;
    height: 225px;
    max-width: 100%;
    margin: 0 auto 24px;
    object-fit: cover;
    border-radius: 50%;
    filter: grayscale(1);
}

#team .team-member-learn-more {
    display: block;
    margin: 24px auto 0;
    cursor: pointer;
}

body.team-member-modal-open {
    overflow: hidden;
}

.team-member-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgb(0 0 0 / 82%);
}

.team-member-modal[hidden] {
    display: none;
}

.team-member-modal-panel {
    position: relative;
    width: min(720px, 100%);
    max-height: calc(100vh - 48px);
    overflow-y: auto;
    padding: 48px;
    border: 1px solid var(--secondary-border-color);
    background: var(--secondary-background-color);
    color: var(--primary-text-color);
}

.team-member-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    display: grid;
    width: 40px;
    height: 40px;
    place-items: center;
    padding: 0;
    border: 1px solid var(--secondary-border-color);
    background: transparent;
    color: var(--heading-text-color);
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
}

.team-member-modal-close:hover,
.team-member-modal-close:focus-visible {
    border-color: var(--link-color);
    color: var(--heading-text-color);
    text-decoration: none;
}

.team-member-modal-image {
    display: block;
    width: 225px;
    height: 225px;
    margin: 0 auto 24px;
    object-fit: cover;
    border-radius: 50%;
    filter: grayscale(1);
}

.team-member-modal-name {
    margin: 0;
    color: var(--heading-text-color);
    text-align: center;
}

.team-member-modal-title {
    margin: 8px 0 32px;
    color: var(--accent-text-color);
    font-family: "Montserrat", sans-serif;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 2px;
    text-align: center;
    text-transform: uppercase;
}

.team-member-modal-description p {
    margin-top: 16px;
}

.team-member-modal-description p:first-child {
    margin-top: 0;
}

.team-member-modal-close:focus-visible {
    outline: 2px solid var(--link-color);
    outline-offset: 3px;
}

@media screen and (max-width: 599px) {
    .team-member-modal {
        padding: 16px;
    }

    .team-member-modal-panel {
        max-height: calc(100vh - 32px);
        padding: 48px 24px 32px;
    }

    .team-member-modal-image {
        width: 175px;
        height: 175px;
    }

    #team .team-members-grid img,
    #team .team-board-grid img {
        width: 175px;
        height: 175px;
    }
}

#team .team-story {
    overflow: hidden;
    background: #020d22;
    color: #c7cfdf;
}
#team .team-story h2 {
    margin: 0;
    color: #fff;
}
#team .team-story-header {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 32px;
    margin-bottom: 32px;
}
#team .team-story-header .caption {
    margin-bottom: 12px;
}
#team .team-story-header p {
    flex: 0 0 auto;
    margin: 0;
    color: #7e8ba5;
    font-size: 16px;
    letter-spacing: 2px;
}
#team .team-story-scroll {
    width: 100vw;
    margin-left: calc(50% - 50vw);
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}
#team .team-story-scroll::-webkit-scrollbar {
    display: none;
}
#team .team-story-track {
    position: relative;
    display: flex;
    width: max-content;
    min-width: 100%;
    padding: 32px 48px;
}
#team .team-story-track::before {
    position: absolute;
    top: 50%;
    right: 0;
    left: 0;
    height: 1px;
    background: rgba(199, 207, 223, 0.2);
    content: "";
}
#team .team-story-event {
    position: relative;
    display: grid;
    flex: 0 0 380px;
    grid-template-rows: 1fr 96px 1fr;
    min-height: 600px;
}
#team .team-story-event + .team-story-event {
    margin-left: 96px;
}
#team .team-story-content {
    position: relative;
    z-index: 1;
    grid-row: 1;
    align-self: end;
}
#team .team-story-event--bottom .team-story-content {
    grid-row: 3;
    align-self: start;
}
#team .team-story-marker {
    position: relative;
    z-index: 2;
    grid-row: 2;
    align-self: center;
    justify-self: center;
    color: #2f6bff;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 24px rgba(47, 107, 255, 0.6);
}
#team .team-story-event:nth-child(even) .team-story-marker {
    color: rgba(199, 207, 223, 0.35);
    box-shadow: none;
}
#team .team-story-event--top .team-story-marker::before,
#team .team-story-event--bottom .team-story-marker::after {
    position: absolute;
    left: 50%;
    width: 1px;
    height: 32px;
    background: currentColor;
    content: "";
    transform: translateX(-50%);
}
#team .team-story-event--top .team-story-marker::before {
    bottom: 100%;
}
#team .team-story-event--bottom .team-story-marker::after {
    top: 100%;
}
#team .team-story-year {
    display: block;
    color: #2f6bff;
    font-size: clamp(4.5rem, 8vw, 8rem);
    font-weight: 800;
    letter-spacing: -0.08em;
    line-height: 0.85;
}
#team .team-story-kicker {
    display: block;
    margin-top: 20px;
    color: #c7cfdf;
    font-family: "Montserrat", sans-serif;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 3px;
    line-height: 1.5;
    text-transform: uppercase;
}
#team .team-story-copy {
    max-width: 340px;
}
#team .team-story-copy p,
#team .team-story-event > .team-story-content > p {
    margin: 24px 0 0;
    color: #c7cfdf;
    font-size: 18px;
    line-height: 1.6;
}
#team .team-story-rule {
    display: block;
    width: 32px;
    height: 4px;
    margin-top: 20px;
    background: #2f6bff;
}
#team .team-story-polaroid {
    width: 360px;
    margin: 0;
    padding: 20px 20px 28px;
    transform: rotate(-2deg);
    background: #eee9dd;
    box-shadow: 0 24px 50px rgba(0, 0, 0, 0.35);
}
#team .team-story-polaroid img {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
}
#team .team-story-polaroid figcaption {
    padding-top: 32px;
    color: #55565c;
    font-family: "Montserrat", sans-serif;
    font-size: 16px;
    font-style: italic;
    text-align: center;
}

@media screen and (max-width: 599px) {
    #team .team-story-header {
        display: block;
    }
    #team .team-story-header p {
        margin-top: 24px;
    }
    #team .team-story-track {
        padding: 24px;
    }
    #team .team-story-event {
        flex-basis: min(78vw, 320px);
        grid-template-rows: 1fr 80px 1fr;
        min-height: 520px;
    }
    #team .team-story-event + .team-story-event {
        margin-left: 56px;
    }
    #team .team-story-year {
        font-size: clamp(4rem, 18vw, 6rem);
    }
    #team .team-story-polaroid {
        width: min(78vw, 320px);
        padding: 14px 14px 22px;
    }
    #team .team-story-polaroid figcaption {
        padding-top: 24px;
        font-size: 14px;
    }
}
