/* =========================================================
   Team page — photo frame is a fixed-aspect-ratio container
   separate from the img/fallback styling, so real photos of
   any source size always crop cleanly instead of stretching
   or relying on a shared img+div rule. Cards stretch to equal
   height in a row regardless of bio length.
   ========================================================= */

.hero.team-hero {
    height: auto;
    min-height: 0;
    padding: clamp(90px, 16vh, 130px) 20px clamp(48px, 8vh, 72px);
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    text-align: center;
}

.team-hero .hero-inner {
    max-width: 740px;
    margin: 0 auto;
}

.team-hero .eyebrow {
    margin-bottom: 16px;
}

.team-hero h1 {
    font-size: clamp(30px, 5vw, 50px);
    color: var(--ink);
    margin-top: 12px;
}

.team-hero p {
    margin-top: 18px;
    color: var(--muted);
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    font-size: clamp(15px, 1.6vw, 17px);
}

.section.team-list {
    background: var(--paper);
    padding: 72px 20px 100px;
}

.team-list-head {
    max-width: 620px;
    margin: 0 auto 36px;
    text-align: center;
}

.team-list-head h2 {
    margin-top: 12px;
    font-size: clamp(24px, 3vw, 32px);
    font-weight: 800;
    color: var(--ink);
}

.team-list-head p {
    margin: 12px auto 0;
    color: var(--muted);
    line-height: 1.6;
}

/* ---------------------------------------------------------
   Grid — equal-height cards, balanced columns down to mobile.
   --------------------------------------------------------- */

/* ---------------------------------------------------------
   Grid — equal-height cards, fixed sensible size regardless
   of count. auto-fill (not auto-fit) keeps the browser's
   phantom empty tracks in the layout instead of collapsing
   them, so a lone card can't stretch to fill the whole row;
   the minmax cap plus justify-content: center keeps a partial
   row looking intentional instead of left-pinned with a gap.
   --------------------------------------------------------- */

.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 280px));
    justify-content: center;
    gap: 24px;
    align-items: stretch;
    max-width: 1120px;
    margin: 0 auto;
}

.team-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: linear-gradient(180deg, var(--surface), rgba(45, 125, 246, 0.02));
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

.team-card:hover {
    transform: translateY(-3px);
    border-color: rgba(45, 125, 246, 0.18);
    box-shadow: 0 18px 32px -24px rgba(27, 19, 48, 0.35);
}

/* Fixed-ratio frame: the <img> or fallback fills this exactly,
   so every card's photo area is identical regardless of the
   source image's real dimensions. */
.team-photo-frame {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 5;
    background: var(--tile-a);
    overflow: hidden;
}

.team-photo-frame .team-photo {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
}

img.team-photo {
    object-fit: cover;
    object-position: center top;
    transition: transform 0.35s ease;
}

.team-card:hover img.team-photo {
    transform: scale(1.03);
}

.team-photo--fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-size: 44px;
    font-weight: 700;
    color: var(--ink);
    background: var(--tile-a);
}

/* ---------------------------------------------------------
   Copy — bio clamped to a fixed number of lines so cards in
   the same row stay the same height even with mismatched bio
   lengths; links pinned to the bottom via margin-top: auto.
   --------------------------------------------------------- */

.team-copy {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    padding: 22px;
}

.team-copy h3 {
    margin: 0;
    font-size: 19px;
    font-weight: 700;
    color: var(--ink);
}

.team-role {
    margin: 6px 0 14px;
    color: var(--brand-red);
    font-weight: 700;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.team-bio {
    margin: 0 0 16px;
    color: var(--muted);
    line-height: 1.65;
    font-size: 14px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.team-bio.is-expanded {
    -webkit-line-clamp: unset;
    overflow: visible;
}

.team-bio-toggle {
    align-self: flex-start;
    margin: -10px 0 16px;
    padding: 0;
    border: none;
    background: none;
    color: var(--ink);
    font-size: 13px;
    font-weight: 700;
    text-decoration: underline;
    cursor: pointer;
}

.team-links {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: auto;
    padding-top: 4px;
}

.team-links a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--muted);
    text-decoration: none;
    font-weight: 600;
    font-size: 13px;
    transition: color 0.2s ease;
}

.team-links a:hover {
    color: var(--brand-blue);
}

.empty-state {
    color: var(--muted);
    text-align: center;
    margin-top: 40px;
}

/* ---------------------------------------------------------
   Scroll reveal (matches home.js pattern)
   --------------------------------------------------------- */

[data-reveal] {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

[data-reveal].is-visible {
    opacity: 1;
    transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
    [data-reveal] {
        opacity: 1;
        transform: none;
        transition: none;
    }
}

/* ---------------------------------------------------------
   Responsive
   --------------------------------------------------------- */

@media (max-width: 900px) {
    .team-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 240px));
        gap: 18px;
    }
    .team-photo-frame { aspect-ratio: 1 / 1; }
}

@media (max-width: 560px) {
    .section.team-list { padding: 56px 16px 72px; }
    .team-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }
    .team-copy { padding: 16px; }
    .team-copy h3 { font-size: 16px; }
    .team-bio {
        display: -webkit-box;
        display: block;
        -webkit-line-clamp: 3;
        line-clamp: 3;
        overflow: hidden;
    }
    .team-links { gap: 10px; }
}