/* Our Team (Figma Team 2838:31825, pop-up 2839:32200). Sizes and colours only from tokens (npm run lint:tokens). The grid collapses like
   the product listing grids (docs/responsive-spec.md section B rows 3 and 4: 4 per row from 1024, 3 from 768, 2 below). Plan: docs/team-plan.md. */

/* Title band: the lead is a Headline/lg line in black (Figma), not the narrow paragraph lead of the photo heroes. */
.team .listing-hero__lead { max-width: none; color: var(--color-text-primary); }

/* Grid: 60 under the 12px rule (Figma Grid pt gap/3xl), 60 + 120 under the last row (Products pb section/sm, Main Content pb inset/4xl). */
.team__body { padding: var(--space-gap-3xl) var(--gutter) calc(var(--space-section-sm) + var(--space-inset-4xl)); }
.team-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-gap-xl); margin: 0; padding: 0; list-style: none; }

/* Card (Figma TeamCard): a square photo, then the name (Label/2xl) and the job title (Paragraph/large/emphasis) 20 above and below. */
.team-card { display: block; color: inherit; text-decoration: none; }
.team-card__media { display: block; aspect-ratio: 1; overflow: hidden; background: var(--color-bg-surface); }
.team-card__media .media-cover { display: block; transition: transform 500ms ease; }
.team-card__text { display: block; padding-block: var(--space-inset-sm); }
.team-card__name,
.team-card__role { margin: 0; }
.team-card__name { text-wrap: balance; }
.team-card:hover .wipe-text,
.team-card:focus-visible .wipe-text { background-size: 100% var(--border-2-pixel); animation: link-wipe var(--wipe-ms, 400ms) ease-out; }
@media (prefers-reduced-motion: no-preference) {
  .team-card:hover .media-cover,
  .team-card:focus-visible .media-cover { transform: scale(1.03); }
}

/* Bio (the pop-up's content, Figma Panel 2838:32168): the photo and the text in two equal columns from 768 (Figma 576 + 48 + 576), stacked
   below. The photo is square. The text is centred on the photo: the name, the job title in capitals over a 3px rule, then the bio. */
.team-bio { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-gap-lg); }
.team-bio__photo { aspect-ratio: 1; overflow: hidden; background: var(--color-bg-surface); }
.team-bio__content { display: grid; align-content: center; row-gap: var(--space-inset-md); }
.team-bio__head { display: grid; row-gap: var(--space-gap-xs); padding-bottom: var(--space-gap-sm); border-bottom: var(--border-3-pixel) solid var(--color-border-rule); }
.team-bio__name { margin: 0; text-box: trim-both cap alphabetic; text-wrap: balance; }
.team-bio__role { margin: 0; }
.team-bio__text { display: grid; row-gap: var(--space-gap-xs); }
.team-bio__text p { margin: 0; color: var(--color-text-primary); }

/* Without scripts (and before the script runs, for browsers that report it): the pop-up is an ordinary list of bios under the grid. */
.team-modal { position: static; inset: auto; display: block; width: 100%; height: auto; max-width: none; max-height: none; margin: 0; padding: 0 var(--gutter) var(--space-inset-4xl); border: 0; background: none; color: inherit; }
.team-modal__panel { display: grid; row-gap: var(--space-section-sm); }
.team-modal__slides { display: grid; row-gap: var(--space-section-sm); }
.team-modal__close,
.team-modal__nav { display: none; }

@media (min-width: 768px) {
  .team-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .team-bio { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--space-gap-2xl); }
  .team-bio__content { padding-inline: var(--space-gap-xl); }
}
@media (min-width: 1024px) {
  .team-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* With scripts: the dialog is the scrim (50% black, full window) and scrolls when the panel is taller than the window; the panel is the
   white box on it (Figma Panel: 60 inside on every side at 1440, on the page margins) with the close button, one bio at a time and the
   arrows 24 apart. The page behind cannot scroll while it is open (html.team-lock). */
@media (scripting: enabled) {
  .team-modal { position: fixed; inset: 0; display: none; width: 100%; height: 100%; max-height: none; padding: var(--space-gap-md) var(--gutter); overflow-y: auto; overscroll-behavior: contain; background: var(--color-bg-alpha-50); color: var(--color-text-primary); }
  .team-modal[open] { display: flex; }
  .team-modal::backdrop { background: transparent; }
  .team-modal__panel { position: relative; flex: 1 1 100%; width: 100%; align-self: center; row-gap: var(--space-gap-sm); justify-items: center; margin-block: auto; padding: var(--space-inset-3xl); background: var(--color-bg-canvas); }
  .team-modal__slides { width: 100%; padding-top: var(--space-inset-xs); padding-bottom: var(--space-gap-2xs); }
  .team-bio { display: none; }
  .team-bio.is-active { display: grid; }
  /* Close: the 28px X at the top right of the panel, in a tap-sized box that sits on the same corner. */
  .team-modal__close { position: absolute; top: var(--space-inset-md); right: var(--space-inset-md); z-index: 1; display: grid; place-items: center; min-width: var(--tap-min); min-height: var(--tap-min); padding: 0; border: 0; background: none; color: var(--color-text-primary); cursor: pointer; }
  .team-modal__close .icon { width: var(--close-box); height: var(--close-box); }
  .team-modal__nav { display: flex; justify-content: center; gap: var(--space-gap-md); }
}
/* Pop-up size: from 768 the panel is 90% of the page width (--team-modal-scale, Lance 2026-11-26: "decrease the size of the modal by 10%"); the
   photo, text and arrows scale with it. Phones keep the full width. Set the scale to 1 to go back. */
@media (scripting: enabled) and (min-width: 768px) {
  .team-modal { --team-modal-scale: 0.9; }
  .team-modal__panel { flex: 0 1 auto; width: calc(100% * var(--team-modal-scale)); margin-inline: auto; }
}
html.team-lock { overflow: hidden; }
