/* O site de vendas (108): o terceiro desenho da IA: as características do imóvel seguem por uma rua
   até a IA, o endereço, o proprietário, a chave e a comissão ficam atrás da linha tracejada (decisão
   5 da 105), e a descrição volta para você aceitar. Nenhum desenho é captura de tela (CA-005); o
   estado parado é o desenho completo, com uma característica a caminho da IA. */

/* Tudo se mede do alto da ficha: no desenho largo ela desce, para a composição ficar no meio. */
.cena-ia-dados {
  container-type: inline-size;
}

.cena-ia-dados > * {
  --alto: 8%;
}

@container (min-width: 30rem) {
  .cena-ia-dados > * {
    --alto: 17%;
  }
}

.ficha-do-imovel {
  position: absolute;
  left: 6%;
  top: var(--alto);
  z-index: 1;
  display: grid;
  gap: 0.3em;
  width: 46%;
  padding: 0.7em 0.8em 0.8em;
  border: 1.5px solid var(--tinta);
  border-radius: 0.9em;
  background: var(--rua);
  box-shadow: 0 10px 22px rgb(27 27 24 / 14%);
}

.vai {
  display: flex;
  gap: 0.5em;
  justify-content: space-between;
  padding-bottom: 0.25em;
  border-bottom: 1.5px solid var(--tinta);
}

.vai small,
.fica small {
  color: var(--tinta-fraca);
}

/* O que fica: atrás da linha tracejada, com os valores escondidos. */
.fica {
  position: relative;
  display: grid;
  gap: 0.35em;
  margin-top: 0.8em;
  padding: 1em 0.6em 0.55em;
  border: 2px dashed var(--tinta);
  border-radius: 0.6em;
  background: rgb(27 27 24 / 5%);
}

.fica em {
  position: absolute;
  left: 0.5em;
  top: 0;
  padding: 0.1em 0.55em;
  border-radius: 999px;
  background: var(--tinta);
  color: var(--rua);
  font-size: 0.78em;
  font-weight: 700;
  white-space: nowrap;
  transform: translateY(-50%);
}

.fica > span {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.5em;
  align-items: center;
}

.fica i {
  height: 0.45em;
  border-radius: 999px;
  background: rgb(27 27 24 / 18%);
}

/* A rua: sai da ficha, à altura das características, e chega na IA. */
.estrada {
  position: absolute;
  left: 46%;
  right: 16%;
  top: calc(var(--alto) + 3.4em);
  height: 2.4em;
  overflow: hidden;
  border-block: 1.5px solid var(--tinta);
  background: var(--rua);
  transform: translateY(-50%);
}

.estrada::before {
  content: '';
  position: absolute;
  inset: 50% 0 auto;
  border-top: 2px dashed rgb(27 27 24 / 30%);
}

.estrada i {
  position: absolute;
  left: 50%;
  top: 50%;
  padding: 0.1em 0.5em;
  border: 1.5px solid var(--tinta);
  border-radius: 999px;
  background: var(--praca);
  font-size: 0.82em;
  font-weight: 700;
  white-space: nowrap;
  transform: translate(-50%, -50%);
  animation: seguir-a-rua 6s linear calc(var(--d) * 2s) infinite both;
}

/* Parado, só uma característica fica na rua: a do meio do caminho. */
.estrada i + i {
  opacity: 0;
}

@keyframes seguir-a-rua {
  0% {
    left: 0%;
    opacity: 0;
    transform: translate(-60%, -50%);
  }

  6%,
  42% {
    opacity: 1;
  }

  50%,
  100% {
    left: 100%;
    opacity: 0;
    transform: translate(0, -50%);
  }
}

/* A IA: o ponto de chegada, cheio de tinta. */
.a-ia {
  position: absolute;
  right: 6%;
  /* A mesma linha da rua, na letra maior da IA (1.6 vezes). */
  top: calc(var(--alto) + 3.4em / 1.6);
  z-index: 1;
  display: grid;
  place-items: center;
  width: 2.5em;
  height: 2.5em;
  border-radius: 50%;
  background: var(--tinta);
  color: var(--rua);
  font: 700 1.6em/1 var(--placa);
  box-shadow:
    0 0 0 0.2em var(--rua),
    0 6px 14px rgb(27 27 24 / 30%);
  transform: translateY(-50%);
}

/* O que a IA devolve: a descrição, que só entra no imóvel quando você aceita. */
.texto-da-ia {
  position: absolute;
  right: 6%;
  top: calc(var(--alto) + 6.6em);
  width: 40%;
  padding: 0.6em 0.7em 0.7em;
  border: 1.5px solid var(--tinta);
  border-radius: 0.8em;
  background: var(--rua);
}

/* Da IA até o texto: o caminho de volta, tracejado. */
.texto-da-ia::before {
  content: '';
  position: absolute;
  right: calc(2em - 1px);
  bottom: 100%;
  height: 1.4em;
  border-left: 2px dashed var(--tinta);
}

.texto-da-ia small {
  font-size: 0.85em;
  font-weight: 700;
}

.texto-da-ia i {
  height: 0.35em;
  margin-top: 0.4em;
  border-radius: 999px;
  background: rgb(27 27 24 / 22%);
}

.texto-da-ia i:nth-of-type(3) {
  width: 55%;
}

.texto-da-ia em {
  width: fit-content;
  margin-top: 0.6em;
  padding: 0.2em 0.6em;
  border-radius: 999px;
  background: var(--tinta);
  color: var(--rua);
  font-size: 0.78em;
  font-weight: 700;
  white-space: nowrap;
}
