/* ==========================================================================
   HERO — label, title, text, actions + connection diagram
   The diagram (.net) is HTML nodes over an SVG of paths drawn in a 0–100
   coordinate space: a node's --y and a path's y value are the same number.
   ========================================================================== */

.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: min(max(72rem, 100svh), 96rem);
  padding-top: calc(var(--nav-height) + var(--space-8));
  padding-bottom: var(--space-9);
  background-color: var(--bg1);
  color: var(--color1);
  overflow-x: clip;
}

.hero__grid {
  flex: 1;
  align-items: center;
  row-gap: var(--space-8);
}

.hero__content {
  grid-column: 1 / span 7;
}

.hero__label {
  flex-wrap: wrap;
  margin-bottom: var(--space-6);
}

.hero__label-brand {
  color: var(--color1);
}

.hero__desc {
  max-width: 54rem;
  margin-top: var(--space-6);
  color: var(--muted);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-top: var(--space-7);
}

/* ---- Connection diagram ------------------------------------------------- */
.net {
  position: relative;
  grid-column: 8 / span 5;
  justify-self: end;
  width: 100%;
  max-width: 64rem;
  aspect-ratio: 1;
  container-type: inline-size;
}

.net__svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.net__svg pattern circle {
  fill: var(--ink-700);
}

.net__paths path,
.net__ring {
  fill: none;
  stroke: var(--ink-700);
  stroke-width: .3;
}

.net__packets path {
  fill: none;
  stroke: var(--color-accent);
  stroke-width: .8;
  stroke-linecap: round;
  stroke-dasharray: .07 1.2;
  stroke-dashoffset: .07;
  animation: net-travel 3.2s var(--ease-in-out-cubic) infinite;
  animation-delay: calc(var(--i, 0) * .8s);
}

.net__packets .net__out {
  animation-delay: calc(var(--i, 0) * .8s + 1.6s);
}

@keyframes net-travel {
  from { stroke-dashoffset: .07; }
  to { stroke-dashoffset: -1.2; }
}

.net__ring--pulse {
  stroke: var(--color-accent);
  opacity: 0;
  transform-box: fill-box;
  transform-origin: 50% 50%;
  animation: net-pulse 3.2s var(--ease-out-quart) infinite;
}

@keyframes net-pulse {
  0% { opacity: .8; transform: scale(.9); }
  70%, 100% { opacity: 0; transform: scale(1.7); }
}

.net__nodes {
  position: absolute;
  inset: 0;
}

.net__node {
  position: absolute;
  top: var(--y);
  display: flex;
  align-items: center;
  width: 30%;
  min-height: 4.4rem;
  padding: .6rem 2.4cqw;
  border: 1px solid var(--ink-700);
  border-radius: var(--radius-sm);
  background: var(--ink-900);
  color: var(--ink-400);
  font-size: clamp(1rem, 2.6cqw, 1.4rem);
  line-height: 1.15;
  transform: translateY(-50%);
}

.net__nodes--in .net__node {
  left: 0;
}

.net__nodes--out .net__node {
  right: 0;
  border-color: var(--ink-600);
  color: var(--white);
}

/* Small port where the connector meets the node */
.net__node::after {
  content: "";
  position: absolute;
  top: 50%;
  width: .6rem;
  height: .6rem;
  margin-top: -.3rem;
  background: var(--ink-500);
}

.net__nodes--in .net__node::after { right: -.35rem; }
.net__nodes--out .net__node::after { left: -.35rem; background: var(--color-accent); }

.net__hub {
  position: absolute;
  top: 42%;
  left: 42%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .6cqw;
  width: 16%;
  aspect-ratio: 1;
  border-radius: var(--radius-md);
  background: var(--color-accent);
  box-shadow: 0 0 0 1.6cqw rgba(245, 196, 0, .08), 0 0 12cqw rgba(245, 196, 0, .22);
  color: var(--ink-950);
}

.net__hub-tag {
  font-family: var(--font-display);
  font-stretch: var(--display-stretch);
  font-size: 6.4cqw;
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: .9;
}

.net__hub-label {
  font-family: var(--font-mono);
  font-size: max(.9rem, 1.9cqw);
  letter-spacing: var(--tracking-mono);
  text-transform: uppercase;
}

/* ---- Tablet: diagram below the text ---------------------------------------- */
@media (max-width: 1023px) {
  .hero {
    min-height: 0;
  }

  .hero__content {
    grid-column: 1 / span 11;
  }

  .net {
    grid-column: 2 / span 10;
    justify-self: center;
    max-width: 60rem;
  }
}

/* ---- Mobile --------------------------------------------------------------- */
@media (max-width: 767px) {
  .hero {
    padding-top: calc(var(--nav-height) + var(--space-7));
  }

  .hero__content,
  .net {
    grid-column: 1 / -1;
  }

  .hero__grid {
    row-gap: var(--space-7);
  }

  .hero__label {
    row-gap: var(--space-1);
    margin-bottom: var(--space-5);
  }

  .hero__label-sep {
    display: none;
  }

  .hero__label-brand {
    flex-basis: calc(100% - 2rem);
  }

  .hero__desc {
    margin-top: var(--space-5);
  }

  .hero__actions {
    margin-top: var(--space-6);
  }

  .hero__actions .btn {
    flex: 1 1 auto;
  }

  .net__node {
    min-height: 3.8rem;
  }

}
