/* ==========================================================================
   Team, "x people, multiplied". Everything sits on the registration-mark
   lattice: the hero photo clears tile by tile from the centre, the people
   cells are born ring by ring on scroll, and each mark turns from + to x as
   its cells arrive. Page blocks only; tokens and primitives in ../styles.css.
   ========================================================================== */

/* one registration mark, placed by team.js (left/top), turned by transform */
.team-mark {
  position: absolute;
  width: 13px;
  height: 13px;
  margin: -6.5px 0 0 -6.5px;
  background:
    linear-gradient(var(--white-60), var(--white-60)) center / 1px 100% no-repeat,
    linear-gradient(var(--white-60), var(--white-60)) center / 100% 1px no-repeat;
  pointer-events: none;
  will-change: transform;
}

/* Hero
   ========================================================================== */
.team-hero {
  padding: calc(var(--nav-height) + clamp(3rem, 9vh, 6.5rem)) var(--gutter) clamp(3rem, 6vw, 5rem);
}
.team-hero-top {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(2rem, 5vw, 6rem);
  align-items: end;
  margin-bottom: clamp(2.5rem, 5vw, 4.5rem);
}
.team-hero-eyebrow {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 1.6rem;
  font: 500 0.72rem/1 var(--font-mono);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--white-60);
}
.team-hero-eyebrow::before {
  content: "";
  width: 2.25rem;
  height: 1px;
  background: var(--white-40);
}
.team-hero-title {
  max-width: 11em;
  font: 600 clamp(2.4rem, 6.6vw, 8rem)/0.92 var(--font-display);
  letter-spacing: -0.048em;
}
.team-hero-sub {
  font: 400 clamp(1.02rem, 0.35vw + 0.95rem, 1.2rem)/1.6 var(--font-display);
  color: var(--white-75);
}

.team-hero-photo { aspect-ratio: 2.3; }
.team-hero-tiles {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: grid;
  pointer-events: none;
}
.team-hero-tile {
  background: var(--night);
  box-shadow: 0 0 0 1px var(--night); /* no seams between tiles */
}
.team-hero-marks {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}
/* once the photo is clear the marks fade, so no x sits on a face */
.team-hero-marks--done { opacity: 0; transition: opacity 1.2s var(--ease) 0.3s; }

@media (max-width: 900px) {
  .team-hero-top { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 700px) {
  .team-hero-photo { aspect-ratio: 4 / 3; }
}

/* Belief: the one-line conviction
   ========================================================================== */
.team-belief-eyebrow {
  margin-bottom: clamp(1.25rem, 2.5vw, 2rem);
  font: 500 0.72rem/1.5 var(--font-mono);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--white-60);
}
.team-belief-title {
  max-width: 17ch;
  font: 600 clamp(2.3rem, 5.6vw, 6.4rem)/0.98 var(--font-display);
  letter-spacing: -0.046em;
  text-wrap: balance;
}

/* People: the lattice
   ========================================================================== */
.team-people-title { max-width: 18ch; font-size: clamp(2.1rem, 4vw, 4.4rem); }

.team-lattice { position: relative; margin-top: clamp(3rem, 6vw, 5rem); }
.team-lattice-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: var(--line);
  border-left: var(--line);
}
/* centre and founders hold the middle row; the six roles fill the ring */
.team-cell--center { grid-area: 2 / 2; }
.team-cell--josh { grid-area: 2 / 1; }
.team-cell--brendan { grid-area: 2 / 3; }

.team-cell {
  position: relative;
  display: grid;
  min-height: clamp(10rem, 15vw, 13.5rem);
  border-right: var(--line);
  border-bottom: var(--line);
}
.team-cell-body {
  position: relative;
  z-index: 1;
  display: grid;
  padding: clamp(1.1rem, 2vw, 1.75rem);
  will-change: opacity, transform;
}
.team-lattice-marks {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

/* hover: the corner marks run in to the centre, a full x through the card */
.team-cell-x {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}
.team-cell-x path {
  fill: none;
  stroke: var(--white-40);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
  transform-box: view-box;
  transform: scale(0);
  transition: transform 0.75s var(--ease);
}
.team-cell-x path:nth-child(1) { transform-origin: 0 0; }
.team-cell-x path:nth-child(2) { transform-origin: 100px 0; transition-delay: 0.04s; }
.team-cell-x path:nth-child(3) { transform-origin: 100px 100px; transition-delay: 0.08s; }
.team-cell-x path:nth-child(4) { transform-origin: 0 100px; transition-delay: 0.12s; }
.team-cell--center .team-cell-x path { stroke: var(--indigo-soft); }
@media (hover: hover) {
  .team-cell:hover .team-cell-x path { transform: scale(1); }
}

.team-cell--role .team-cell-body { align-content: end; }
.team-cell--role p {
  font: 400 clamp(0.95rem, 0.2vw + 0.92rem, 1.05rem)/1.45 var(--font-display);
  color: var(--white-60);
}
.team-cell--role strong {
  font: 600 clamp(1.3rem, 1.4vw + 0.7rem, 2rem)/1.35 var(--font-display);
  letter-spacing: -0.03em;
  color: var(--paper);
}

.team-cell--person .team-cell-body { align-content: start; }
.team-person-photo {
  aspect-ratio: 5 / 4;
  overflow: hidden;
  border: var(--line);
  background: var(--night-2);
}
.team-person-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 7%;
  transition: transform 0.9s var(--ease);
}
@media (hover: hover) {
  .team-cell--person:hover .team-person-photo img { transform: scale(1.04); }
}
.team-person-name {
  margin-top: 1.35rem;
  font: 600 clamp(1.35rem, 1.3vw + 0.8rem, 2rem)/1.05 var(--font-display);
  letter-spacing: -0.035em;
}
.team-person-title {
  margin-top: 0.7rem;
  font: 500 0.7rem/1.3 var(--font-mono);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--indigo-soft);
}
.team-person-tagline {
  margin-top: 0.9rem;
  font: 400 0.98rem/1.5 var(--font-display);
  color: var(--white-75);
}

.team-cell--center { background: var(--night-2); }
.team-cell--center .team-cell-body {
  align-content: center;
  justify-items: center;
  gap: 1.1rem;
  text-align: center;
}
.team-center-brand {
  font: 500 0.68rem/1 var(--font-mono);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--white-60);
}
.team-center-x {
  width: clamp(4rem, 6.5vw, 6.5rem);
  height: auto;
  margin: 0.4rem 0 0.6rem;
  fill: var(--indigo);
}
.team-center-title {
  font: 600 clamp(1.7rem, 2.5vw, 2.8rem)/1 var(--font-display);
  letter-spacing: -0.04em;
}
.team-center-text {
  max-width: 18rem;
  font: 400 1rem/1.5 var(--font-display);
  color: var(--white-75);
}

@media (max-width: 900px) {
  .team-lattice-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .team-cell--center,
  .team-cell--josh,
  .team-cell--brendan { grid-area: auto; }
  .team-cell--center { grid-column: 1 / -1; min-height: 20rem; }
  .team-person-photo { aspect-ratio: 4 / 5; }
}
@media (max-width: 560px) {
  .team-cell-body { padding: 1rem; }
  .team-cell--role strong { font-size: 1.2rem; }
  .team-person-name { margin-top: 1rem; font-size: 1.2rem; }
  .team-person-tagline { font-size: 0.9rem; }
}

/* coda: what unites us, beside the team film */
.team-coda {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(2.5rem, 6vw, 7rem);
  align-items: center;
  margin-top: clamp(4rem, 8vw, 7rem);
}
.team-coda-copy { display: grid; gap: 2rem; justify-items: start; }
.team-coda-text {
  font: 500 clamp(1.3rem, 1.2vw + 0.95rem, 2.1rem)/1.3 var(--font-display);
  letter-spacing: -0.025em;
  text-wrap: pretty;
}
.team-coda-video { aspect-ratio: 1; }
.team-coda-video video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: var(--night);
}

@media (max-width: 900px) {
  .team-coda { grid-template-columns: minmax(0, 1fr); }
  .team-coda-video { width: 100%; max-width: 30rem; }
}

/* Founders
   ========================================================================== */
.team-story-lede {
  max-width: 22ch;
  margin-bottom: clamp(3rem, 6vw, 5rem);
  font: 600 clamp(2rem, 4.2vw, 4.6rem)/1.02 var(--font-display);
  letter-spacing: -0.042em;
  text-wrap: balance;
}
.team-story-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(1.5rem, 3vw, 3.5rem);
  max-width: 62rem;
  margin-left: auto;
  padding-top: clamp(1.5rem, 3vw, 2.5rem);
  border-top: var(--line);
}
.team-story-col { display: grid; align-content: start; gap: 1.4rem; }
.team-story-col p {
  font: 400 clamp(1rem, 0.3vw + 0.95rem, 1.15rem)/1.65 var(--font-display);
  color: var(--white-75);
}

@media (max-width: 900px) {
  .team-story-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
  .team-story-lede { font-size: 1.65rem; line-height: 1.08; }
}

/* Experience (paper): the client marks on the lattice
   ========================================================================== */
.team-experience-top {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(2rem, 5vw, 6rem);
  align-items: end;
  margin-bottom: clamp(3rem, 6vw, 5rem);
}
.team-experience-thin { font-weight: 300; }
.team-experience-top p {
  font: 400 clamp(1.05rem, 0.4vw + 0.95rem, 1.25rem)/1.55 var(--font-display);
  color: var(--black-75);
}
.team-logos {
  --logo-unit: min(1.1px, calc((100vw - 2 * var(--gutter)) / 1332));
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  border-top: var(--line);
  border-left: var(--line);
}
.team-logo {
  position: relative;
  display: grid;
  place-items: center;
  height: clamp(6rem, 10vw, 9rem);
  border-right: var(--line);
  border-bottom: var(--line);
}
.team-logo::before {
  content: "";
  position: absolute;
  top: -7px;
  left: -7px;
  width: 13px;
  height: 13px;
  background:
    linear-gradient(var(--black-40), var(--black-40)) center / 1px 100% no-repeat,
    linear-gradient(var(--black-40), var(--black-40)) center / 100% 1px no-repeat;
}
.team-logo img {
  width: calc(var(--w) * var(--logo-unit));
  max-width: 72%;
  height: auto;
  mix-blend-mode: multiply; /* drops the white box behind one mark */
  opacity: 0.7;
  transition: opacity var(--dur) var(--ease);
}
.team-logo:hover img { opacity: 1; }

@media (max-width: 900px) {
  .team-experience-top { grid-template-columns: minmax(0, 1fr); }
  .team-logos {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    --logo-unit: calc((100vw - 2 * var(--gutter)) / 666);
  }
}
