/* Backlab v2 · LP de Desenvolvimento e Integrações. Reaproveita a base de sales.css (hero, cabeçalhos, bento, jornada).
   Hero "Sistemas que se conectam": sem JS = tudo conectado e completo (data-state 3). Nada com opacity:0 em repouso. */

.bl-v2-dh__title { max-inline-size: 15ch; font-size: clamp(2.5rem, 1.1rem + 3.6vw, 4.6rem); }

.dh-flow { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); align-items: center; padding: clamp(1.25rem, 5cqi, 2.25rem); background: linear-gradient(180deg, #fff, var(--bl-v2-mist, #f3f6f5)); }

/* Sistemas de origem + linhas */
.bl-v2-dh .dh-src { position: relative; display: grid; grid-template-columns: max-content minmax(1rem, 1fr); align-items: center; gap: .75rem 0; margin: 0; padding: 0; list-style: none; }
.dh-src li { display: contents; }
.dh-chip { flex: none; display: flex; align-items: center; gap: .55rem; block-size: 2.75rem; padding-inline: .85rem; font-size: .9rem; font-weight: 600; color: var(--bl-v2-ink); background: #fff; border: 1px solid var(--bl-v2-line); border-radius: .75rem; box-shadow: 0 10px 24px -18px rgba(13, 20, 19, .35); }
.dh-chip i { flex: none; inline-size: .5rem; block-size: .5rem; border-radius: 50%; background: #3dbfb0; transition: background-color .4s; }
.dh-wire, .dh-stub { position: relative; display: block; background: repeating-linear-gradient(90deg, #cfd8d6 0 5px, transparent 5px 10px); }
.dh-wire { block-size: 2px; }
.dh-wire::before, .dh-stub::before, .dh-src::after { content: ""; position: absolute; inset: 0; background: #3dbfb0; transform-origin: 0 50%; transition: transform .6s cubic-bezier(.3, .7, .2, 1); }
.dh-wire::before { transition-delay: calc(var(--k) * .12s); }
/* Barramento vertical que junta as quatro linhas */
.dh-src::before, .dh-src::after { inset: 1.375rem 0 1.375rem auto; inline-size: 2px; }
.dh-src::before { content: ""; position: absolute; background: repeating-linear-gradient(180deg, #cfd8d6 0 5px, transparent 5px 10px); }
.dh-src::after { transform-origin: 50% 0; transition-delay: .45s; }

/* Ferramenta sob medida */
.dh-tool { position: relative; margin-inline-start: 1.5rem; padding: 1.1rem 1.15rem .6rem; background: #fff; border: 1px solid var(--bl-v2-line); border-radius: 1rem; box-shadow: 0 30px 60px -40px rgba(13, 20, 19, .45); }
.dh-stub { position: absolute; inset-inline-start: -1.5rem; inset-block-start: 50%; inline-size: 1.5rem; block-size: 2px; }
.dh-stub::before { transition-delay: .7s; }
.dh-tool__head { display: flex; align-items: center; gap: .7rem; padding-block-end: .8rem; }
.dh-tool__logo { display: grid; place-items: center; flex: none; inline-size: 2.4rem; block-size: 2.4rem; border-radius: .7rem; color: #fff; background: linear-gradient(135deg, #5ad8ca, #23877d); }
.dh-tool__logo svg { inline-size: 1.2rem; block-size: 1.2rem; fill: currentColor; }
.dh-tool__head span { display: grid; line-height: 1.25; }
.dh-tool__head b { font-size: 1rem; font-weight: 700; }
.dh-tool__head small { font-size: .78rem; color: var(--bl-v2-muted); }
.bl-v2-dh .dh-res { display: grid; margin: 0; padding: 0; list-style: none; }
.dh-res li { display: flex; align-items: center; gap: .65rem; padding-block: .6rem; font-size: .9rem; font-weight: 600; line-height: 1.3; color: var(--bl-v2-ink); border-block-start: 1px solid var(--bl-v2-line); transition: color .4s; }
.dh-res i { display: grid; place-items: center; flex: none; inline-size: 1.35rem; block-size: 1.35rem; border-radius: 50%; color: #fff; background: #3dbfb0; transition: background-color .4s, color .4s, box-shadow .4s; }
.dh-res svg { inline-size: .8rem; block-size: .8rem; }

/* Pontos de dados correndo (só com JS e com o hero na tela) */
.dh-wire b, .dh-stub b { display: none; position: absolute; z-index: 1; inset-block-start: 50%; inset-inline-start: 0; inline-size: 7px; block-size: 7px; border-radius: 50%; background: #1f7d73; box-shadow: 0 0 0 3px rgba(61, 191, 176, .25); transform: translate(-50%, -50%); }
.bl-v2-dh.is-live.is-visible:not([data-state="0"]) .dh-wire b { display: block; animation: dh-run 1.8s linear infinite; animation-delay: calc(var(--k) * .4s); }
.bl-v2-dh.is-live.is-visible:not([data-state="0"]) .dh-stub b { display: block; animation: dh-run 1.2s linear .9s infinite; }
@keyframes dh-run { from { inset-inline-start: 0; } to { inset-inline-start: 100%; } }

/* Estado 0: sistemas soltos (só com JS) */
.bl-v2-dh[data-state="0"] .dh-wire::before, .bl-v2-dh[data-state="0"] .dh-stub::before { transform: scaleX(0); transition-delay: 0s; }
.bl-v2-dh[data-state="0"] .dh-src::after { transform: scaleY(0); transition-delay: 0s; }
.bl-v2-dh[data-state="0"] .dh-chip i { background: #e0913f; }
.bl-v2-dh[data-state="0"] [data-dh-res],
.bl-v2-dh[data-state="1"] [data-dh-res="2"], .bl-v2-dh[data-state="1"] [data-dh-res="3"],
.bl-v2-dh[data-state="2"] [data-dh-res="3"] { color: #9aa3a1; }
.bl-v2-dh[data-state="0"] [data-dh-res] i,
.bl-v2-dh[data-state="1"] [data-dh-res="2"] i, .bl-v2-dh[data-state="1"] [data-dh-res="3"] i,
.bl-v2-dh[data-state="2"] [data-dh-res="3"] i { color: transparent; background: #fff; box-shadow: inset 0 0 0 1.5px #cfd8d6; }
.bl-v2-dh.is-live[data-state="1"] [data-dh-res="1"] i, .bl-v2-dh.is-live[data-state="2"] [data-dh-res="2"] i, .bl-v2-dh.is-live[data-state="3"] [data-dh-res="3"] i { animation: dh-pop .45s var(--bl-v2-ease, ease) both; }
.bl-v2-dh.is-live[data-state="1"] [data-dh-res="1"] i { animation-delay: .9s; }
@keyframes dh-pop { from { transform: scale(.6); } 60% { transform: scale(1.15); } to { transform: none; } }

@media (max-width: 600px) {
  /* Celular: sistemas em 2×2 e uma linha descendo até a ferramenta */
  .dh-flow { grid-template-columns: 1fr; }
  .bl-v2-dh .dh-src { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
  .dh-src li { display: block; }
  .dh-src::before, .dh-src::after, .dh-wire { display: none; }
  .dh-chip { inline-size: 100%; block-size: 2.6rem; font-size: .85rem; }
  .dh-tool { margin: 2rem 0 0; }
  .dh-stub { inset-inline-start: 50%; inset-block-start: -2rem; inline-size: 2px; block-size: 2rem; background: repeating-linear-gradient(180deg, #cfd8d6 0 5px, transparent 5px 10px); }
  .dh-stub::before { transform-origin: 50% 0; transition-delay: .2s; }
  .bl-v2-dh[data-state="0"] .dh-stub::before { transform: scaleY(0); }
  .dh-stub b { inset-inline-start: 50%; inset-block-start: 0; }
  .bl-v2-dh.is-live.is-visible:not([data-state="0"]) .dh-stub b { animation: dh-drop 1.2s linear .3s infinite; }
  @keyframes dh-drop { from { inset-block-start: 0; } to { inset-block-start: 100%; } }
}
@media (prefers-reduced-motion: reduce) {
  .bl-v2-dh *, .bl-v2-dh *::before, .bl-v2-dh *::after { transition: none !important; animation: none !important; }
}
