/* Homepage team showcase. Palette, radii, type and shadow follow theme-minimal.css. */
.team-showcase,
.team-showcase * {
  box-sizing: border-box;
}

.team-showcase {
  padding: clamp(88px, 10vw, 144px) clamp(24px, 5vw, 64px);
  background: var(--paper);
}

.team-showcase__inner {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
}

.team-showcase__header {
  max-width: 800px;
  margin: 0 auto 56px;
  text-align: center;
}

.team-showcase__header h2 {
  margin: 0 0 24px;
  text-wrap: balance;
}

.team-showcase__header > p {
  max-width: 650px;
  margin: 0 auto;
  font-weight: 400;
  line-height: 1.7;
  text-wrap: pretty;
}

/* The mobile/no-script layout is the default: all five stories remain available. */
.team-showcase__tabs {
  display: none;
}

.team-showcase__panels {
  display: grid;
  gap: 64px;
}

.team-showcase__panel {
  display: flex;
  flex-direction: column;
  gap: 28px;
  min-width: 0;
  text-align: left;
}

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

.team-showcase__team {
  margin: 0 0 16px;
  color: var(--ink-3);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  line-height: 1.5;
  text-transform: uppercase;
}

.team-showcase__copy h3 {
  max-width: 16ch;
  margin: 0 0 20px;
  font-size: clamp(1.75rem, 2.6vw, 2.5rem);
  line-height: 1.12;
  text-wrap: balance;
}

.team-showcase__description {
  max-width: 35ch;
  margin: 0;
  font-size: 1.06rem;
  font-weight: 400;
  line-height: 1.7;
  text-wrap: pretty;
}

.team-showcase__image {
  order: -1;
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  object-position: 50% 50%;
  border-radius: var(--radius-img);
  /* Existing card-hover shadow, reused as the photo's contact shadow. */
  box-shadow: 0 14px 34px rgba(10, 10, 11, 0.07);
  /* One treatment across the original photos; crop overrides protect the task. */
  filter: saturate(0.65);
}

#team-panel-training .team-showcase__image { object-position: 50% 42%; }
#team-panel-assembly .team-showcase__image { object-position: 50% 70%; }
#team-panel-quality .team-showcase__image { object-position: 50% 55%; }
#team-panel-maintenance .team-showcase__image { object-position: 50% 75%; }

.team-showcase__cta {
  margin-top: 48px;
  text-align: center;
}

.team-showcase__cta .button-primary {
  gap: 24px;
  text-decoration: none;
}

@media (min-width: 768px) {
  .team-showcase__panel {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
    align-items: center;
    gap: 32px;
    padding: 24px;
    border-radius: var(--radius-card);
    background: var(--paper-2);
  }

  .team-showcase__copy {
    padding: 24px clamp(8px, 2.2vw, 32px);
  }

  .team-showcase__image {
    order: 0;
  }

  .team-showcase.is-enhanced .team-showcase__tabs {
    position: relative;
    display: grid;
    grid-template-columns: 1.4fr 0.85fr 0.85fr 1fr 1fr;
    margin-bottom: 32px;
  }

  /* One uninterrupted source line, including the spaces between labels. */
  .team-showcase__tabs::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    height: 1px;
    background: var(--line-strong);
  }

  .team-showcase__tabs [data-team-tab] {
    position: relative;
    min-height: 60px;
    padding: 0 4px 16px;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--ink-2);
    font-size: clamp(0.8125rem, 1.1vw, 0.9375rem);
    font-weight: 500;
    line-height: 1.4;
    white-space: nowrap;
    cursor: pointer;
  }

  .team-showcase__tab-label {
    display: inline-block;
    padding: 10px 14px;
    border-radius: var(--radius-pill);
  }

  .team-showcase__tabs [data-team-tab]:hover .team-showcase__tab-label {
    background: var(--paper-2);
    color: var(--ink);
  }

  .team-showcase__tabs [aria-selected="true"] {
    font-weight: 650;
  }

  /* Selection stays obvious even when the independent timer line is empty. */
  .team-showcase__tabs [aria-selected="true"] .team-showcase__tab-label,
  .team-showcase__tabs [aria-selected="true"]:hover .team-showcase__tab-label {
    background: var(--ink);
    color: var(--on-fill);
  }

  /* A visible track gives the moving fill a clear start and finish. The
     original 1px source spine still runs continuously beneath every tab. */
  .team-showcase__tabs [aria-selected="true"]::before {
    content: "";
    position: absolute;
    z-index: 1;
    right: 0;
    bottom: 0;
    left: 0;
    height: 3px;
    border-radius: var(--radius-pill);
    background: var(--line-strong);
  }

  .team-showcase__progress {
    position: absolute;
    z-index: 2;
    right: 0;
    bottom: 0;
    left: 0;
    height: 3px;
    border-radius: var(--radius-pill);
    background: var(--ink);
    transform: scaleX(0);
    transform-origin: left;
  }

  [aria-selected="true"] .team-showcase__progress {
    /* Updated every animation frame by the same clock that switches teams. */
    transform: scaleX(var(--team-progress, 0));
  }

  .team-showcase.is-enhanced .team-showcase__panels {
    /* All panels share a grid cell and reserve height, even while inactive. */
    gap: 0;
    min-height: 340px;
    border-radius: var(--radius-card);
    background: var(--paper-2);
  }

  .team-showcase.is-enhanced .team-showcase__panel {
    grid-area: 1 / 1;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    background: transparent;
    transform: scale(0.98);
    transition: opacity 450ms ease-out, transform 450ms ease-out, visibility 450ms;
  }

  .team-showcase.is-enhanced .team-showcase__panel.is-active {
    z-index: 1;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .team-showcase.is-enhanced .team-showcase__panel {
    transition: none;
    transform: none;
  }
}
