/* team page only. colours, fonts, layout, labels and every scroll reveal
   come from site.css */

/* flex rather than grid so a part filled last row sits in the middle.
   --cols sets how many per row, the card width is worked out from it */
.tm-grid {
  --cols: 3;
  --col-gap: 24px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 32px var(--col-gap);
}
.tm-grid > .member {
  flex: 0 0 calc((100% - (var(--cols) - 1) * var(--col-gap)) / var(--cols));
  min-width: 0;
}
#sub-teams .tm-grid { --cols: 5; --col-gap: 20px; }

.member { cursor: pointer; }

.member-card {
  position: relative;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border: 1px solid var(--hair);
  border-radius: 3px;
  background:
    radial-gradient(ellipse 90% 45% at 50% 100%, rgba(141, 11, 18, 0.45), transparent 70%),
    var(--ink-1);
  transition: border-color 0.25s var(--ease);
}


.member.is-open .member-card { visibility: hidden; }

.member-face {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: var(--display);
  font-size: clamp(32px, 4vw, 60px);
  line-height: 1;
  color: rgba(243, 238, 238, 0.14);
  user-select: none;
}
#sub-teams .member-face { font-size: clamp(26px, 2.8vw, 42px); }

.member-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 25%;
}


.member-card::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: var(--ember);
  transform: scaleX(0);
  transform-origin: left;
  pointer-events: none;
}
.member.in .member-card::after {
  animation: tm-sweep 1.4s var(--ease) both;
  animation-delay: calc(var(--i, 0) * 90ms + 250ms);
}
@keyframes tm-sweep {
  0%   { transform: scaleX(0); opacity: 1; }
  55%  { transform: scaleX(1); opacity: 1; }
  100% { transform: scaleX(1); opacity: 0; }
}


.member-open {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 1;
  width: 28px;
  height: 28px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 1px solid var(--hair);
  border-radius: 50%;
  background: #000;
  color: var(--bone);
  cursor: pointer;
  transition: background-color 0.25s var(--ease), border-color 0.25s var(--ease);
}
.member-open svg { width: 14px; height: 14px; }
.member-open:focus-visible { outline: 2px solid var(--ember); outline-offset: 2px; }

.member-tag { padding-top: 16px; }
.member-name {
  font-size: 18px;
  line-height: 1.2;
  transition: color 0.25s var(--ease);
}
.member-role {
  margin-top: 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  line-height: 1.5;
  text-transform: uppercase;
  color: var(--smoke-dim);
}

.member:hover .member-card,
.member:has(.member-open:focus-visible) .member-card { border-color: rgba(255, 43, 43, 0.6); }
.member:hover .member-name,
.member:has(.member-open:focus-visible) .member-name { color: var(--ember); }
.member:hover .member-open,
.member:has(.member-open:focus-visible) .member-open { background: var(--ember); border-color: var(--ember); }

.member-dialog {
  width: min(920px, 100% - 48px);
  max-width: none;
  max-height: none;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--bone);
  overflow: visible;
}
.member-dialog[open] {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1fr);
  min-height: min(520px, 100dvh - 48px);
}
.member-dialog::backdrop {
  background: rgba(4, 3, 3, 0.72);
  backdrop-filter: blur(6px);
}
.member-dialog[open]::backdrop { animation: md-fade-in 0.35s var(--ease); }
.member-dialog.closing::backdrop { animation: md-fade-out 0.4s var(--ease) forwards; }
@keyframes md-fade-in  { from { opacity: 0; } }
@keyframes md-fade-out { to   { opacity: 0; } }

.md-bg {
  position: absolute;
  inset: 0;
  border: 1px solid var(--hair);
  border-radius: 3px;
  background: #0b0809;
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.6);
}

.md-face {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--hair);
  border-radius: 3px 0 0 3px;
  background:
    radial-gradient(ellipse 90% 45% at 50% 100%, rgba(141, 11, 18, 0.45), transparent 70%),
    var(--ink-1);
  font-family: var(--display);
  font-size: 64px;
  line-height: 1;
  color: rgba(243, 238, 238, 0.14);
}
.md-face img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 25%;
}


.md-ghost {
  position: fixed;
  margin: 0;
  z-index: 2;
  border-radius: 3px;
  pointer-events: none;
}
.member-dialog.opening .md-face:not(.md-ghost),
.member-dialog.closing .md-face:not(.md-ghost) { visibility: hidden; }


.md-info {
  position: relative;
  padding: 48px 44px 44px;
  max-height: calc(100dvh - 48px);
  overflow: auto;
}
.md-info:focus { outline: none; }
.md-close {
  position: absolute;  
  top: 16px;
  right: 16px;
  z-index: 3;
  width: 34px;
  height: 34px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 1px solid var(--hair);
  border-radius: 50%;
  background: #000;
  color: var(--bone);
  cursor: pointer;
  transition: border-color 0.2s var(--ease);
}
.md-close svg { width: 15px; height: 15px; }
.md-close:hover { border-color: var(--ember); }
.md-close:focus-visible { outline: 2px solid var(--ember); outline-offset: 2px; }

.md-role { margin-bottom: 10px; font-size: 11px; color: var(--ember); }
.md-name {
  padding: 0 40px 22px 0;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--hair);
  font-size: clamp(28px, 3.2vw, 40px);
  line-height: 1.05;
}
.md-body .label { margin: 22px 0 8px; font-size: 11px; }
.md-body .label:first-child { margin-top: 0; }
.md-body p:not(.label) {
  font-size: 15px;
  line-height: 1.7;
  color: var(--smoke);
}
.md-body p:not(.label) + p:not(.label) { margin-top: 12px; }
.md-body .md-empty { font-style: italic; color: var(--smoke-dim); }
.md-body a { color: var(--bone); }
.md-link[hidden] { display: none; }
.md-link {
  display: inline-flex;
  gap: 4px;
  margin-top: 24px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ember);
  text-decoration: none;
}


@media (max-width: 1000px) {
  #sub-teams .tm-grid { --cols: 3; }
}
@media (max-width: 700px) {
  .tm-grid,
  #sub-teams .tm-grid { --cols: 2; --col-gap: 14px; row-gap: 24px; }
  .member-name { font-size: 15px; }
  .member-tag { padding-top: 12px; }


  .member-dialog { width: calc(100% - 24px); }
  .member-dialog[open] { grid-template-columns: 1fr; min-height: 0; }
  .md-face { height: 190px; border-radius: 3px 3px 0 0; font-size: 48px; }
  .md-info { padding: 28px 22px 26px; max-height: calc(100dvh - 24px - 190px); }
}


/* the full width team photo. it fades into the page at the top and bottom,
   and the headline and button sit in the tarmac under everyone */
.tm-band {
  position: relative;
  display: flex;
  align-items: flex-end;
  min-height: clamp(460px, 46vw, 720px);
  overflow: hidden;
  isolation: isolate;
}
.tm-band-photo {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 30%;
}
.tm-band::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(
    180deg,
    var(--ink) 0,
    rgba(7, 5, 6, 0.35) 14%,
    rgba(7, 5, 6, 0.3) 45%,
    rgba(7, 5, 6, 0.86) 80%,
    var(--ink) 100%
  );
}
.tm-band-in {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  padding-bottom: clamp(48px, 6vw, 88px);
  text-align: center;
}
.tm-band-in .label { color: rgba(243, 238, 238, 0.82); }
.tm-band-in h2 {
  font-size: clamp(36px, 5vw, 64px);
  line-height: 1;
  text-shadow: 0 2px 24px rgba(7, 5, 6, 0.6);
}
.tm-band-in h2 .soft { color: var(--ember); }

/* for partners, under the photo */
.ww-left { max-width: 820px; }
.ww-left .head { margin-bottom: clamp(32px, 4vw, 48px); }

.ww-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.ww-item {
  display: grid;
  grid-template-columns: 64px 1fr;
  padding-block: 24px 26px;
  border-top: 1px solid var(--hair);
}
.ww-n {
  padding-top: 6px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--ember);
  font-variant-numeric: tabular-nums;
}
.ww-item h3 { margin-bottom: 8px; }
.ww-item p {
  max-width: 52ch;
  font-size: 15px;
  line-height: 1.65;
  color: var(--smoke);
}

@media (max-width: 700px) {
  /* taller than wide on phones, so the middle of the group fills the frame */
  .tm-band { min-height: 520px; }
  .tm-band-photo { object-position: 50% 48%; }
}
@media (max-width: 480px) {
  .ww-item { grid-template-columns: 44px 1fr; padding-block: 20px 22px; }
}


@media (prefers-reduced-motion: reduce) {
  /* site.css stops motion on elements, this covers the card sweep and popup backdrop */
  main *::before,
  main *::after,
  .member-dialog::backdrop {
    transition: none !important;
    animation: none !important;
  }
}
