/* ==========================================================================
   Team: three portraits, the ring around the selected one fills up and moves the
   focus on (until someone clicks); a moving zoom grid sits behind the others.
   ========================================================================== */

.tm-panel[hidden] { display: none !important; }
.main--team { padding-bottom: 96px; }
.main--team .tm { margin-top: 56px; padding-right: var(--gutter); }

/* names: first name and surname set apart, role in normal case */
.tm-name { margin: 0; font-size: 17px; line-height: 1.25; font-weight: 500; letter-spacing: -0.01em; }
.tm-first { display: block; color: var(--c-text); font-weight: 400; }
.tm-last { display: block; color: var(--c-text-strong); }
.tm-role { margin: 6px 0 0; font-size: 13px; line-height: 1.3; color: var(--c-accent); }

/* copy and logos */
.tm-text { margin: 0; font-size: 16px; line-height: 1.55; color: var(--c-text-soft); max-width: 640px; }
.tm-logos { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 18px 40px; max-width: 640px; margin: 28px 0 0; padding: 0; list-style: none; }
.tm-logo { display: block; width: auto; filter: var(--logo-filter); opacity: 0.88; }
.tm-logo--mckinsey { height: 34px; }
.tm-logo--bain { height: 30px; }
.tm-logo--tum { height: 25px; }
.tm-logo--oxford { height: 39px; }
.tm-logo--rwth { height: 33px; }
.tm-logo--uc-davis { height: 50px; }
.tm-logo--ucl { height: 30px; }
.tm-panel { animation: tmin .55s ease both; }
@keyframes tmin { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* layout U1 */
.u1-picks { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 28px 40px; }
.u1-item { display: flex; flex-direction: column; gap: 14px; }
.u1-label { transition: opacity .5s ease; }
.u1-item .tp[aria-pressed="false"] + .u1-label { opacity: .6; }
.u1-stage { margin-top: 32px; min-height: 190px; }

/* portrait with ring */
.tp { display: block; padding: 0; border: 0; background: none; cursor: pointer; border-radius: 50%; }
.tp-wrap { position: relative; display: block; padding: 9px; --d: 112px; }
.tp[aria-pressed="true"] .tp-wrap { --d: 148px; }
.tp-ring { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; transform: rotate(-90deg); }
.tp-track { fill: none; stroke: var(--c-line-strong); stroke-width: .8; stroke-dasharray: 1.2 2.6; }
.tp-prog { fill: none; stroke: var(--c-accent); stroke-width: 1.6; stroke-dasharray: 1.02; stroke-dashoffset: 1.02; }
/* the selected portrait: the ring fills up, then the next person follows */
.tm.is-auto .tp[aria-pressed="true"] .tp-prog { animation: tpfill var(--rotate, 6s) linear forwards; }
.tm:not(.is-auto) .tp[aria-pressed="true"] .tp-prog { stroke-dashoffset: 0; }
@keyframes tpfill { from { stroke-dashoffset: 1.02; } to { stroke-dashoffset: 0; } }

.tp-disc {
  position: relative; display: block;
  width: var(--d); aspect-ratio: 1;
  border-radius: 50%; overflow: hidden;
  background: color-mix(in srgb, var(--c-text-strong) 6%, var(--c-bg));
  transition: width .5s cubic-bezier(.2, .7, .2, 1);
}
.tp-grid { position: absolute; inset: 0; width: 100%; height: 100%; transition: opacity .6s ease; }
.tp-accent { position: absolute; inset: 0; background: var(--c-accent); opacity: 0; transition: opacity .6s ease; }
/* the person is always fully opaque; others in black and white */
.tp-img {
  position: absolute; left: 0; top: 0; width: 100%; height: 100%;
  filter: grayscale(1);
  transform: translateY(5%) scale(.94);
  transition: filter .6s ease, transform .6s cubic-bezier(.2, .7, .2, 1);
}
.tp[aria-pressed="true"] .tp-accent { opacity: 1; }
.tp[aria-pressed="true"] .tp-grid { opacity: 0; }
.tp[aria-pressed="true"] .tp-img { filter: none; transform: none; }
.tp:hover .tp-img { filter: grayscale(.4); }
.tp[aria-pressed="true"]:hover .tp-img { filter: none; }
.tp:focus-visible { outline: none; }
.tp:focus-visible .tp-disc { outline: 2px solid var(--c-text-strong); outline-offset: 3px; }

@media (max-width: 760px) {
  .main--team { padding-bottom: 64px; }
  .main--team .tm { margin-top: 36px; padding-right: 16px; }
  .u1-picks { flex-wrap: nowrap; gap: 10px; justify-content: space-between; align-items: flex-start; }
  .u1-item { flex: 1 1 0; min-width: 0; align-items: center; text-align: center; }
  .tp-wrap { padding: 6px; --d: 21vw; }
  .tp[aria-pressed="true"] .tp-wrap { --d: 26vw; }
  .u1-picks { align-items: flex-end; }
  .tm-name { font-size: 13px; }
  .tm-role { font-size: 11px; }
  .u1-stage { margin-top: 24px; min-height: 280px; }
  .tm-text { font-size: 15px; }
  .tm-logos { gap: 14px 28px; }
}

@media (prefers-reduced-motion: reduce) {
  .tm-panel { animation: none; }
  .tp-disc, .tp-img { transition: none; }
}

/* only the selected portrait keeps the dotted ring */
.tp-track { transition: opacity .5s ease; }
.tp-track { display: none; }   /* no dotted ring at all, only the filling one */

/* wider screens: the three profiles stay side by side in equal columns that spread across the width */
/* wider screens: the whole block centred in the content column, like the framework;
   portraits grow with the screen width */
@media (min-width: 761px) {
  .u1-picks {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 32px clamp(24px, 4vw, 72px);
    max-width: 1000px;
    margin-inline: auto;
    align-items: end;
  }
  .u1-item { min-width: 0; align-items: center; text-align: center; }
  .tp-wrap { --d: clamp(112px, 10.5vw, 180px); padding: clamp(9px, .7vw, 12px); }
  .tp[aria-pressed="true"] .tp-wrap { --d: clamp(148px, 14vw, 236px); }
  .tm-name { font-size: clamp(17px, 1.3vw, 21px); }
  .tm-role { font-size: clamp(13px, .95vw, 15px); }
  .u1-stage { text-align: center; }
  .tm-text { margin-inline: auto; max-width: 828px; }   /* 15 % wider than the earlier 720 px */
  .tm-logos { margin-inline: auto; max-width: 828px; }
}
/* the ring hugs the portrait, never the whole column */
.tp { width: fit-content; }
.tp-wrap { width: fit-content; }

/* symmetric column padding (the old logo band needed none on the right), so the block sits in the true middle */
.main--team { padding-right: var(--gutter); }
.main--team .tm { padding-right: 0; }
@media (max-width: 760px) { .main--team { padding-right: 16px; } }

/* switching people: all texts share one grid cell, so the block keeps the height of the longest text
   and nothing below moves; the texts cross-fade instead of popping in */
.u1-stage { display: grid; min-height: 0; }
.u1-stage .tm-panel,
.u1-stage .tm-panel[hidden] { display: block !important; grid-area: 1 / 1; animation: none; transition: opacity .5s ease, transform .5s ease, visibility 0s linear 0s; }
.u1-stage .tm-panel[hidden] { visibility: hidden; opacity: 0; transform: translateY(6px); transition: opacity .35s ease, transform .35s ease, visibility 0s linear .35s; }

/* steady row while the focus moves: every portrait slot is as tall as the selected one,
   so the growing and shrinking circles never change the row height (no bounce of photos and names) */
.u1 { --dn: 112px; --ds: 148px; --pad: 9px; }
@media (min-width: 761px) { .u1 { --dn: clamp(112px, 10.5vw, 180px); --ds: clamp(148px, 14vw, 236px); --pad: clamp(9px, .7vw, 12px); } }
@media (max-width: 760px) { .u1 { --dn: 21vw; --ds: 26vw; --pad: 6px; } }
.u1 .tp-wrap { --d: var(--dn); padding: var(--pad); }
.u1 .tp[aria-pressed="true"] .tp-wrap { --d: var(--ds); }
.u1 .tp { height: calc(var(--ds) + 2 * var(--pad)); display: flex; align-items: flex-end; justify-content: center; }

/* one shared label above the three profiles instead of a role under each name */
.tm-group-label { margin: 0 0 28px; font-size: 22px; line-height: 1.25; font-weight: 500; letter-spacing: -0.01em; color: var(--c-accent); text-align: center; }
@media (max-width: 760px) { .tm-group-label { font-size: 18px; margin-bottom: 20px; } }
