:root {
  --clr-1: #00b9f9;
  --clr-2: #0086ff;
  --clr-3: #ffffff;
  --card-size: clamp(320px, 30vmin, 420px);
  --card-size-b: clamp(290px, 28vmin, 380px);
}

.teamCards {
  /*height: 100svh;*/
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 96px 48px;
  background-color: #1c1c1c;
}

.teamCards__title, .teamCards__title .highlight {
  width: clamp(140px, 20vw, 320px);
  /* ancho “reservado” para cada título */
  font-size: clamp(32px, 3vw, 50px);
  font-weight: 800;
  text-align: center;
  flex: 1 1 auto;
  color: #fff;
  font-family: 'Bricolage Grotesque', sans-serif;
}

.teamCards__title .highlight {
  color: #00b9f9;
}

.teamCards__main {
  flex: 1 1 auto;
  /* el centro puede crecer/encoger */
  min-width: 0;
  /* IMPORTANTÍSIMO en flex para evitar overflow raro */
  display: flex;
  justify-content: center;
  align-items: center;
}

#teamCards__plane {
  display: grid;
  place-items: center;
  transform-style: preserve-3d;
  perspective: 1000px;
}

.teamCards__card {
  transform-style: preserve-3d;
  position: relative;
  height: var(--card-size);
  width: var(--card-size-b);
  grid-column-start: 1;
  grid-row-start: 1;
  transition: all 500ms ease-in-out;
  --local-rotation: 180deg;
  --local-scale: 0;
  transform: rotatey(var(--local-rotation)) scale(var(--local-scale));
}

/* --- SISTEMA DE LAYOUTS (Cámbialos aquí para que afecten a todos los asignados) --- */

/* Layout 1 */
.layout-1 .flying-card-one {
  left: -15%;
  top: 0%;
}

.layout-1 .flying-card-two {
  right: -5%;
  top: 10%;
}

.layout-1 .worker-description {
  right: -15%;
  bottom: 45%;
}

/* Layout 2 */
.layout-2 .flying-card-one {
  right: -15%;
  top: 0%;
}

.layout-2 .flying-card-two {
  left: -10%;
  top: 10%;
}

.layout-2 .worker-description {
  left: -10%;
  bottom: 45%;
}

/* Layout 3 */
.layout-3 .flying-card-one {
  left: -15%;
  top: 0%;
}

.layout-3 .flying-card-two {
  left: -10%;
  bottom: 20%;
}

.layout-3 .worker-description {
  right: -10%;
  bottom: 45%;
}

/* --- ESTILOS COMUNES OPTIMIZADOS --- */
.main-card {
  width: 100%;
  position: absolute;
  top: -5%;
  left: 50%;
  transform-style: preserve-3d;
  transform: translatex(-50%) translatez(1px);
  border-radius: 4vmin;
  background: var(--clr-1);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2vmin;
  font-size: 2vmin;
}

.main-card-worker-pic {
  width: 70%;
  border-radius: 9999px;
  margin: 3%;
  aspect-ratio: 1/1;
  background: #fff var(--pic) center/cover no-repeat;
}

.main-card-title {
  text-align: center;
  color: #fff;
  font-weight: 900;
  font-size: clamp(20px, 10vw, 30px);
  max-width: 70%;
  line-height: 1;
  margin: 3%;
}

/* --- ICONOS VOLADORES (BLOQUE RECUPERADO) --- */
.flying-card-one,
.flying-card-two {
  background-color: var(--clr-2);
  /* Color azul de fondo */
  position: absolute;
  background-position: center;
  background-repeat: no-repeat;
}

/* Estos dos de abajo son los que aplican la imagen específica de cada trabajador */
.flying-card-one {
  border-radius: 2vmin;
  width: clamp(60px, 25vw, 120px);
  height: clamp(60px, 25vw, 120px);
  background-size: 90%;
  transform: translatez(30px);
  background-image: var(--img3d);
  /* Aquí se inyecta la foto 3D del HTML */
}

.flying-card-two {
  border-radius: 200vmin;
  width: clamp(25px, 40vw, 50px);
  height: clamp(25px, 40vw, 50px);
  background-size: 60%;
  transform: translatez(20px);
  background-image: var(--imgDep);
  /* Aquí se inyecta el icono de depto del HTML */
}

.worker-description {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  transform: translatez(35px);
}

.worker-description-pill {
  padding: 0.5vmin 2vmin 0.7vmin;
  background: var(--clr-3);
  border-radius: 1vmin;
  color: var(--clr-1);
  font-weight: 700;
  font-size: clamp(14px, 1.2vw, 16px);
  white-space: nowrap;
}

/* ANIMATIONS */
.fadein {
  animation: fadein 500ms ease-out both;
}

@keyframes fadein {
  from {
    opacity: 0;
    scale: 0.8;
  }

  to {
    opacity: 1;
    scale: 1;
  }
}

@media (max-width: 768px) {
  .teamCards {
    flex-direction: column;
    justify-content: center;
    gap: 16px;
    padding: 48px 16px 16px;
  }

  .teamCards__title, .teamCards__title .highlight {
    width: 100%;
    text-align: center;
    margin-bottom: 48px;
  }

  .teamCards__main {
    width: 100%;
  }

  :root {
    --card-size: clamp(220px, 70vw, 360px);
    --card-size-b: clamp(200px, 60vw, 360px);
  }
}
