/* Заставка перед складом. Без JavaScript звичайний склад одразу видно. */
.team-section { position: relative; }

.team-intro {
  position: absolute;
  inset: 0 0 auto;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  gap: 18px;
  padding: 10px 0 30px;
  overflow: hidden;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity .6s ease, visibility .6s;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}

/* Стрічки фото */
.team-intro__lane { overflow: hidden; }
.team-intro__strip {
  display: flex;
  gap: 14px;
  width: max-content;
  animation: team-strip 26s linear infinite;
}
.team-intro__lane--reverse .team-intro__strip { animation-direction: reverse; }
.team-intro__tile {
  flex: none;
  width: clamp(80px, 7.5vw, 108px);
  aspect-ratio: 3 / 4;
  border-radius: 16px;
  overflow: hidden;
  background: #e2e2e2;
  box-shadow: 0 10px 30px -18px rgba(0,0,0,.45);
  opacity: 0;
  transform: translateY(18px) scale(.94);
  transition: opacity .6s ease, transform .8s var(--ease);
  transition-delay: calc(var(--i) * 35ms);
}
.team-intro__lane--reverse .team-intro__tile { transform: translateY(-18px) scale(.94); }
.team-intro__tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
@keyframes team-strip { to { transform: translateX(-50%); } }

/* Картка з лічильником */
.team-intro__card {
  position: relative;
  z-index: 2;
  align-self: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: min(420px, 86vw);
  padding: 26px 34px 24px;
  border-radius: 28px;
  background: rgba(255,255,255,.86);
  border: 1px solid rgba(255,255,255,.95);
  box-shadow: 0 30px 80px -30px rgba(0,0,0,.35);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  text-align: center;
  transform: scale(.9);
  opacity: 0;
  transition: opacity .5s ease .15s, transform .8s var(--ease) .15s;
}
.team-intro__eyebrow { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.team-intro__title { margin-top: 6px; font-family: var(--font-display); font-size: clamp(18px, 2vw, 24px); font-weight: 600; letter-spacing: -.02em; }
.team-intro__count {
  font-family: var(--font-display);
  font-size: clamp(76px, 10vw, 128px);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -.05em;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.team-intro__caption { font-size: 13px; color: var(--muted); }

/* Стадії */
.team-section[data-team-stage="playing"] .team-intro,
.team-section[data-team-stage="leaving"] .team-intro { opacity: 1; visibility: visible; }
.team-section[data-team-stage="playing"] .team-intro__tile,
.team-section[data-team-stage="leaving"] .team-intro__tile { opacity: 1; transform: none; }
.team-section[data-team-stage="playing"] .team-intro__card { opacity: 1; transform: scale(1); }
.team-section[data-team-stage="leaving"] .team-intro { opacity: 0; transition-duration: .7s; }
.team-section[data-team-stage="leaving"] .team-intro__card { opacity: 0; transform: translateY(-12px) scale(.96); transition-delay: 0s; }

/* Поки йде заставка — ховаємо склад */
.team-section.is-team-animated .team-heading { transition: opacity .6s ease, transform .8s var(--ease); }
.team-section.is-team-animated:is([data-team-stage="waiting"], [data-team-stage="playing"]) .team-heading { opacity: 0; transform: translateY(18px); }
.team-section.is-team-animated .team-track { transition: opacity .7s ease, transform .9s var(--ease); }
.team-section.is-team-animated:is([data-team-stage="waiting"], [data-team-stage="playing"]) .team-track { opacity: 0; transform: translateY(24px); pointer-events: none; }

/* Поява фото в каруселі */
.team-track.has-photo-reveals .member__photo { opacity: 0; transform: translateX(var(--reveal-x, 24px)) scale(.96); transition: opacity .65s ease, transform .85s var(--ease); }
.team-track.has-photo-reveals .member.is-photo-visible .member__photo { opacity: 1; transform: translateX(0) scale(1); }
.team-track.has-photo-reveals .member:focus-within .member__photo { opacity: 1; transform: none; }

.team-status { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

@media (max-width: 600px) {
  .team-intro { gap: 14px; padding-top: 4px; }
  .team-intro__tile { width: 82px; border-radius: 12px; }
  .team-intro__strip { gap: 10px; animation-duration: 20s; }
  .team-intro__card { padding: 18px 22px 16px; border-radius: 22px; min-width: 0; width: calc(100% - 2 * var(--gutter)); }
  .team-intro__count { font-size: 72px; }
}

@media (prefers-reduced-motion: reduce), print {
  .team-intro { display: none !important; }
  .team-section.is-team-animated .team-heading,
  .team-section.is-team-animated .team-track,
  .team-track.has-photo-reveals .member__photo { opacity: 1 !important; transform: none !important; pointer-events: auto !important; transition: none !important; }
}
