/* Team directory & profiles */

.team-page,
.team-profile-page {
  --team-accent: var(--theme-teal);
  --team-accent-soft: color-mix(in srgb, var(--theme-teal) 10%, var(--color-bg));
  --team-line: color-mix(in srgb, var(--color-border) 62%, transparent);
}

#main-content:has(.team-page),
#main-content:has(.team-profile-page) {
  background:
    radial-gradient(ellipse 65% 45% at 5% 0%, rgba(var(--rgb-green), 0.07), transparent 52%),
    radial-gradient(ellipse 55% 40% at 95% 4%, rgba(var(--rgb-blue), 0.06), transparent 48%),
    linear-gradient(180deg, var(--team-accent-soft) 0%, var(--color-bg) 22%, var(--color-bg) 100%);
}

.team-page,
.team-profile-page {
  background: transparent;
  padding-bottom: 3rem;
}

/* —— List hero —— */
.team-hero {
  padding: clamp(2rem, 5vw, 3rem) 0 1rem;
}

.team-hero__label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--team-accent);
  margin-bottom: 0.6rem;
}

.team-hero__label::before {
  content: '';
  width: 1.75rem;
  height: 1px;
  background: currentColor;
  opacity: 0.5;
}

.team-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 4vw, 2.7rem);
  font-weight: 500;
  line-height: 1.1;
  margin: 0 0 0.55rem;
}

.team-hero__lead {
  margin: 0;
  max-width: 46ch;
  font-size: 1.05rem;
  line-height: 1.55;
  color: var(--color-text-soft);
}

.team-hero__meta {
  margin: 0.85rem 0 0;
  font-size: 0.9rem;
}

.team-hero__meta a {
  color: var(--team-accent);
  font-weight: 500;
  text-decoration: none;
}

.team-hero__meta a:hover {
  text-decoration: underline;
}

/* Filter chips */
.team-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 1.5rem 0 1.75rem;
  padding-bottom: 1.15rem;
  border-bottom: 1px solid var(--team-line);
}

.team-filter__chip {
  padding: 0.42rem 1rem;
  border-radius: 999px;
  font-size: 0.86rem;
  font-weight: 500;
  text-decoration: none;
  color: var(--color-text-soft);
  border: 1px solid var(--team-line);
  background: var(--color-surface);
  transition: color 0.15s, background 0.15s, border-color 0.15s, transform 0.15s;
}

.team-filter__chip:hover {
  border-color: color-mix(in srgb, var(--team-accent) 35%, var(--team-line));
  color: var(--color-text);
}

.team-filter__chip.is-active {
  color: var(--color-surface);
  background: var(--team-accent);
  border-color: var(--team-accent);
}

.team-filter__chip--engineer.is-active { background: var(--theme-green); border-color: var(--theme-green); }
.team-filter__chip--professor.is-active { background: #5b4d8a; border-color: #5b4d8a; }
.team-filter__chip--programmer.is-active { background: var(--theme-blue); border-color: var(--theme-blue); }
.team-filter__chip--researcher.is-active { background: var(--theme-teal); border-color: var(--theme-teal); }
.team-filter__chip--instructor.is-active { background: #9a6b2e; border-color: #9a6b2e; }

/* Section groups (All view) */
.team-section {
  margin-bottom: clamp(2rem, 4vw, 2.75rem);
}

.team-section__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.75rem 1.25rem;
  margin-bottom: 1.1rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--team-line);
}

.team-section__title {
  margin: 0 0 0.35rem;
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 2.5vw, 1.55rem);
  font-weight: 500;
  line-height: 1.2;
}

.team-section__title .team-role-tag {
  font-size: 0.78rem;
  padding: 0.35rem 0.75rem;
  vertical-align: middle;
}

.team-section__lead {
  margin: 0;
  max-width: 52ch;
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--color-text-soft);
}

.team-section__filter {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--team-accent);
  text-decoration: none;
  white-space: nowrap;
}

.team-section__filter:hover {
  text-decoration: underline;
}

.team-section__head--engineer { border-bottom-color: color-mix(in srgb, var(--theme-green) 25%, var(--team-line)); }
.team-section__head--professor { border-bottom-color: color-mix(in srgb, #5b4d8a 25%, var(--team-line)); }
.team-section__head--programmer { border-bottom-color: color-mix(in srgb, var(--theme-blue) 25%, var(--team-line)); }
.team-section__head--researcher { border-bottom-color: color-mix(in srgb, var(--theme-teal) 25%, var(--team-line)); }
.team-section__head--instructor { border-bottom-color: color-mix(in srgb, #9a6b2e 25%, var(--team-line)); }

/* Role tags */
.team-role-tag {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  text-decoration: none;
  color: var(--color-text-soft);
  background: color-mix(in srgb, var(--color-border) 40%, transparent);
}

.team-role-tag--engineer { color: var(--theme-green-dark); background: color-mix(in srgb, var(--theme-green) 14%, transparent); }
.team-role-tag--professor { color: #5b4d8a; background: color-mix(in srgb, #5b4d8a 12%, transparent); }
.team-role-tag--programmer { color: var(--theme-blue-dark); background: color-mix(in srgb, var(--theme-blue) 12%, transparent); }
.team-role-tag--researcher { color: var(--theme-teal); background: color-mix(in srgb, var(--theme-teal) 12%, transparent); }
.team-role-tag--instructor { color: #9a3412; background: color-mix(in srgb, #9a6b2e 14%, transparent); }

.team-badge {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
}

.team-badge--featured {
  color: var(--theme-green-dark);
  background: color-mix(in srgb, var(--theme-green) 16%, var(--color-surface));
}

/* Spotlight */
.team-spotlight {
  display: grid;
  grid-template-columns: minmax(200px, 280px) minmax(0, 1fr);
  gap: clamp(1.25rem, 3vw, 2rem);
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--team-line);
}

.team-spotlight__media {
  display: block;
  border-radius: 14px;
  overflow: hidden;
  aspect-ratio: 4 / 5;
  max-height: 360px;
  background: var(--color-bg-alt);
  box-shadow: var(--color-shadow-lg);
}

.team-spotlight__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

.team-spotlight__body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.5rem;
}

.team-spotlight__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.team-spotlight h2 {
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 2.8vw, 1.85rem);
  margin: 0;
  line-height: 1.2;
}

.team-spotlight h2 a {
  color: inherit;
  text-decoration: none;
}

.team-spotlight__role {
  margin: 0;
  font-weight: 500;
  color: var(--team-accent);
}

.team-spotlight__summary {
  margin: 0;
  color: var(--color-text-soft);
  line-height: 1.55;
}

/* Card grid */
.team-catalog {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
  gap: clamp(1rem, 2.5vw, 1.5rem);
}

.team-catalog--compact {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr));
}

.team-card {
  height: 100%;
}

.team-card__link {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--color-surface);
  border: 1px solid var(--team-line);
  border-radius: 14px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

.team-card__link:hover {
  border-color: color-mix(in srgb, var(--team-accent) 35%, var(--team-line));
  box-shadow: var(--color-shadow-lg);
  transform: translateY(-3px);
}

.team-card__media {
  position: relative;
  aspect-ratio: 4 / 5;
  max-height: 280px;
  overflow: hidden;
  background: var(--color-bg-alt);
}

.team-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  transition: transform 0.35s ease;
}

.team-card__link:hover .team-card__media img {
  transform: scale(1.03);
}

.team-card__badge {
  position: absolute;
  top: 0.6rem;
  inset-inline-end: 0.6rem;
  padding: 0.22rem 0.5rem;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #fff;
  background: rgba(var(--rgb-text), 0.65);
  border-radius: 4px;
}

.team-card__body {
  padding: 1rem 1.1rem 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1;
}

.team-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.team-card__name {
  font-family: var(--font-display);
  font-size: 1.08rem;
  font-weight: 500;
  margin: 0;
  line-height: 1.25;
}

.team-card__role {
  margin: 0;
  font-size: 0.86rem;
  font-weight: 500;
  color: var(--team-accent);
}

.team-card__summary {
  margin: 0;
  flex: 1;
  font-size: 0.84rem;
  line-height: 1.45;
  color: var(--color-muted);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.team-card__foot {
  margin-top: 0.4rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--team-accent);
}

.team-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 2.5rem;
  color: var(--color-muted);
}

.team-related {
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--team-line);
}

.team-related h2 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  margin: 0 0 1.25rem;
}

/* —— Profile detail —— */
.team-profile-hero {
  display: grid;
  grid-template-columns: minmax(160px, 220px) minmax(0, 1fr);
  gap: clamp(1.5rem, 4vw, 2.75rem);
  align-items: start;
  padding: 1rem 0 2rem;
}

.team-profile-hero__media {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.team-profile-hero__photo {
  width: clamp(140px, 28vw, 200px);
  height: clamp(140px, 28vw, 200px);
  border-radius: 50%;
  object-fit: cover;
  object-position: center top;
  border: 3px solid var(--team-line);
  box-shadow: var(--color-shadow-lg);
  background: var(--team-accent-soft);
}

.team-profile-hero__badge {
  margin-top: 0.75rem;
  padding: 0.3rem 0.7rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--theme-green-dark);
  background: color-mix(in srgb, var(--theme-green) 14%, var(--color-surface));
  border-radius: 999px;
}

.team-profile-hero__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.5rem;
}

.team-profile-back {
  display: inline-block;
  margin-bottom: 0.75rem;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--team-accent);
  text-decoration: none;
}

.team-profile-back:hover {
  text-decoration: underline;
}

.team-profile-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 500;
  line-height: 1.15;
  margin: 0 0 0.5rem;
}

.team-profile-hero__headline {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--team-accent);
}

.team-profile-hero .lead {
  margin: 0;
  color: var(--color-text-soft);
}

.team-profile-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.75rem;
  margin: 1.25rem 0 1.5rem;
}

.team-profile-stat__num {
  display: block;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 500;
}

.team-profile-stat__label {
  font-size: 0.8rem;
  color: var(--color-muted);
}

.team-profile-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.team-profile-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 300px);
  gap: clamp(2rem, 4vw, 3rem);
  align-items: start;
}

.team-profile-section {
  margin-bottom: 2.25rem;
}

.team-profile-section h2 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 500;
  margin: 0 0 0.85rem;
  padding-bottom: 0.45rem;
  border-bottom: 1px solid var(--team-line);
}

.team-prose {
  font-size: 1.02rem;
  line-height: 1.7;
  color: var(--color-text-soft);
}

.team-profile-section--video .media-player__frame {
  border-radius: 12px;
}

.team-profile-events {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.team-profile-event-card {
  display: block;
  padding: 1.1rem 1.2rem;
  background: var(--color-surface);
  border: 1px solid var(--team-line);
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.2s, transform 0.2s;
}

.team-profile-event-card:hover {
  box-shadow: var(--color-shadow);
  transform: translateY(-2px);
}

.team-profile-event-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}

.team-profile-event-card__keynote {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--theme-green-dark);
}

.team-profile-event-card h3 {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
}

.team-profile-event-card p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--color-text-soft);
}

.team-profile-event-card .meta {
  margin-top: 0.35rem;
  font-size: 0.82rem;
  color: var(--color-muted);
}

.team-profile-articles {
  list-style: none;
  padding: 0;
  margin: 0;
}

.team-profile-articles li + li {
  border-top: 1px solid var(--team-line);
}

.team-profile-articles a {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.85rem 0;
  text-decoration: none;
  color: var(--color-text);
}

.team-profile-articles a:hover .team-profile-articles__title {
  color: var(--team-accent);
}

.team-profile-articles__title {
  font-weight: 500;
}

.team-profile-articles__meta {
  font-size: 0.82rem;
  color: var(--color-muted);
}

.team-profile-aside-card {
  padding: 1.2rem;
  border-radius: 12px;
  border: 1px solid var(--team-line);
  background: var(--color-surface);
  margin-bottom: 1rem;
}

.team-profile-aside-card h2 {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-muted);
  margin: 0 0 0.75rem;
  padding: 0;
  border: 0;
}

.team-profile-tags {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.team-profile-tags li {
  padding: 0.3rem 0.6rem;
  font-size: 0.82rem;
  border-radius: 6px;
  background: var(--team-accent-soft);
  color: var(--color-text-soft);
}

.team-profile-aside-card--cta p {
  margin: 0 0 1rem;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--color-text-soft);
}

@media (max-width: 900px) {
  .team-spotlight,
  .team-profile-hero {
    grid-template-columns: 1fr;
  }

  .team-spotlight__media {
    max-width: 280px;
    margin: 0 auto;
    width: 100%;
  }

  .team-profile-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .team-card__media {
    max-height: 220px;
  }

  .team-catalog {
    grid-template-columns: 1fr;
  }
}
