/* ===================================================
   Dispositivos — "Sincronize com os principais dispositivos"
   O símbolo do RunEasy no centro recebe os dados de cada relógio:
   linhas finas ligam o centro aos cartões e pulsos sobem até ele.
   =================================================== */

.devices {
  position: relative;
  padding: 120px 0;
}

/* a soft shade under the section, so the background light never fights the text */
.devices::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(62% 58% at 50% 52%, rgba(7, 11, 20, 0.86) 0%, rgba(7, 11, 20, 0.55) 48%, rgba(7, 11, 20, 0) 100%);
  -webkit-mask-image: linear-gradient(transparent 0, #000 120px, #000 calc(100% - 120px), transparent 100%);
  mask-image: linear-gradient(transparent 0, #000 120px, #000 calc(100% - 120px), transparent 100%);
  pointer-events: none;
}

.devices > .section-container {
  position: relative;
}

.devices .section-header {
  margin-bottom: 48px;
}

.dv-stage {
  position: relative;
  max-width: 1100px;
  margin: 0 auto;
}

/* ---------- Hub ---------- */
.dv-hub {
  position: relative;
  z-index: 1;
  width: 84px;
  height: 84px;
  margin: 0 auto;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 35%, #12293a 0%, #0a1422 70%);
  box-shadow:
    inset 0 0 0 1px rgba(0, 212, 255, 0.4),
    0 0 36px rgba(0, 212, 255, 0.22),
    0 12px 30px rgba(0, 0, 0, 0.45);
}

.dv-hub svg {
  width: 44px;
  height: 24px;
  fill: var(--cyan);
  filter: drop-shadow(0 0 8px rgba(0, 212, 255, 0.55));
}

/* data arriving: a soft ring breathes out of the hub */
.dv-hub::before,
.dv-hub::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(0, 212, 255, 0.45);
  animation: dv-ring 2.8s ease-out infinite;
  pointer-events: none;
}

.dv-hub::after {
  animation-delay: 1.4s;
}

@keyframes dv-ring {
  0% { transform: scale(1); opacity: 0.9; }
  100% { transform: scale(1.9); opacity: 0; }
}

/* ---------- Wires from the hub to each card ---------- */
.dv-wires {
  display: block;
  width: 100%;
  height: 84px;
  margin-top: -4px;
  overflow: visible;
}

.dv-wires path {
  fill: none;
  stroke: rgba(0, 212, 255, 0.2);
  stroke-width: 1.5;
  vector-effect: non-scaling-stroke;
}

.dv-wires .dv-pulse {
  stroke: var(--cyan);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-dasharray: 0.08 1;
  stroke-dashoffset: -1;
  filter: drop-shadow(0 0 4px rgba(0, 212, 255, 0.9));
  animation: dv-flow 2.8s cubic-bezier(0.45, 0, 0.55, 1) infinite;
  animation-delay: calc(var(--i) * 0.7s);
}

/* each pulse leaves a card and climbs to the hub */
@keyframes dv-flow {
  0% { stroke-dashoffset: -1; opacity: 0; }
  12% { opacity: 1; }
  70% { stroke-dashoffset: 0.08; opacity: 1; }
  100% { stroke-dashoffset: 0.08; opacity: 0; }
}

/* ---------- Cards ---------- */
.dv-grid {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.dv-card {
  position: relative;
  height: 100%;
  min-height: 236px;
  display: flex;
  flex-direction: column;
  padding: 26px 22px 22px;
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.015)),
    rgba(9, 14, 26, 0.74);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  backdrop-filter: blur(14px) saturate(1.2);
  transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.35s, background-color 0.35s;
}

.dv-card:hover,
.dv-card:focus-visible {
  transform: translateY(-4px);
  box-shadow:
    inset 0 0 0 1px rgba(0, 212, 255, 0.4),
    0 18px 40px rgba(0, 0, 0, 0.35),
    0 0 30px rgba(0, 212, 255, 0.08);
}

.dv-card:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
}

.dv-logo {
  height: 34px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.dv-logo img {
  display: block;
  max-height: 34px;
  width: auto;
  object-fit: contain;
}

.dv-logo .dv-logo--wide {
  max-width: 110px;
  max-height: 20px;
}

/* the Polar file carries wide transparent margins around a thin wordmark */
.dv-logo .dv-logo--polar {
  max-height: none;
  height: 52px;
  margin-left: -6px;
}

.dv-logo i {
  width: 1px;
  height: 22px;
  background: var(--white-20);
}

.dv-chip {
  align-self: flex-start;
  margin-top: 24px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(0, 212, 255, 0.1);
  box-shadow: inset 0 0 0 1px rgba(0, 212, 255, 0.28);
  color: var(--cyan);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  line-height: 1.4;
  text-transform: uppercase;
  white-space: nowrap;
}

.dv-name {
  margin-top: 12px;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.dv-desc {
  margin-top: 8px;
  color: var(--white-60);
  font-size: 0.95rem;
  line-height: 1.55;
}

.dv-link {
  margin-top: auto;
  padding-top: 18px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--cyan);
  font-size: 0.9rem;
  font-weight: 600;
}

.dv-link svg {
  width: 15px;
  height: 15px;
  transition: transform 0.25s ease;
}

.dv-card:hover .dv-link svg {
  transform: translateX(3px);
}

/* ---------- Tablet: two by two, no wires ---------- */
@media (max-width: 1023px) {
  .devices {
    padding: 88px 0;
  }

  .dv-wires {
    display: none;
  }

  .dv-hub {
    width: 68px;
    height: 68px;
    margin-bottom: 32px;
  }

  .dv-hub svg {
    width: 36px;
    height: 20px;
  }

  .dv-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
  }
}

@media (max-width: 768px) {
  .dv-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }
}

/* ---------- Phones: one compact row per device ---------- */
@media (max-width: 560px) {
  .devices {
    padding: 72px 0;
  }

  .devices .section-header {
    margin-bottom: 32px;
  }

  .dv-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .dv-card {
    min-height: 0;
    display: grid;
    grid-template-columns: 76px 1fr;
    grid-template-rows: auto auto auto;
    column-gap: 14px;
    padding: 18px 18px 16px;
  }

  .dv-logo {
    grid-row: 1 / span 3;
    align-self: center;
    justify-content: center;
    height: auto;
    flex-direction: column;
    gap: 8px;
  }

  .dv-logo i {
    width: 22px;
    height: 1px;
  }

  .dv-logo img {
    max-height: 30px;
  }

  .dv-logo .dv-logo--wide {
    max-width: 72px;
    max-height: 16px;
  }

  .dv-logo .dv-logo--polar {
    height: auto;
    width: 80px;
    margin-left: 0;
  }

  .dv-chip {
    justify-self: start;
    grid-column: 2;
    grid-row: 1;
    margin-top: 0;
    font-size: 0.62rem;
  }

  .dv-name {
    grid-column: 2;
    margin-top: 8px;
    font-size: 1.05rem;
  }

  .dv-desc {
    grid-column: 2;
    margin-top: 4px;
    font-size: 0.88rem;
  }

  .dv-link {
    grid-column: 2;
    padding-top: 10px;
    font-size: 0.85rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .dv-hub::before,
  .dv-hub::after,
  .dv-wires .dv-pulse {
    animation: none;
  }

  .dv-wires .dv-pulse {
    opacity: 0;
  }
}
