/* Homepage motion and layout. Scoped to body.page-home. */

body.page-home {
  --home-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------- Hero diagram ----------
   Base routes stay solid. A short overlay dash travels each path.
   The loop starts after the hero fade-up so the first paint is complete. */

body.page-home section.hero .hero-graphic svg {
  display: block;
  overflow: visible;
}

body.page-home section.hero .hero-graphic svg .route {
  opacity: 0.55;
  stroke-dasharray: none;
  stroke-dashoffset: 0;
  stroke-linecap: round;
}

body.page-home section.hero .hero-graphic svg .signal {
  stroke: #C73E52;
  stroke-width: 2.3;
  fill: none;
  stroke-linecap: round;
  stroke-dasharray: 10 90;
  stroke-dashoffset: 0;
  opacity: 1;
}

body.page-home section.hero .hero-graphic svg .nodes circle {
  transform-box: fill-box;
  transform-origin: center;
  opacity: 1;
}

@media (prefers-reduced-motion: no-preference) {
  body.page-home section.hero .hero-graphic svg {
    animation: home-graphic-float 12s ease-in-out infinite;
    animation-delay: 700ms;
  }

  body.page-home section.hero .hero-graphic svg .signal {
    animation: home-signal-travel 10s linear infinite;
  }

  body.page-home section.hero .hero-graphic svg .signal:nth-child(1) { animation-delay: 0.7s; }
  body.page-home section.hero .hero-graphic svg .signal:nth-child(2) { animation-delay: 1.5s; }
  body.page-home section.hero .hero-graphic svg .signal:nth-child(3) { animation-delay: 2.3s; }
  body.page-home section.hero .hero-graphic svg .signal:nth-child(4) { animation-delay: 3.1s; }
  body.page-home section.hero .hero-graphic svg .signal:nth-child(5) { animation-delay: 3.9s; }

  body.page-home section.hero .hero-graphic svg .nodes circle {
    animation: home-node-pulse 10s linear infinite;
  }

  body.page-home section.hero .hero-graphic svg .nodes circle:nth-child(1) { animation-delay: 0.7s; }
  body.page-home section.hero .hero-graphic svg .nodes circle:nth-child(2) { animation-delay: 1.5s; }
  body.page-home section.hero .hero-graphic svg .nodes circle:nth-child(3) { animation-delay: 2.3s; }
  body.page-home section.hero .hero-graphic svg .nodes circle:nth-child(4) { animation-delay: 3.1s; }
  body.page-home section.hero .hero-graphic svg .nodes circle:nth-child(5) { animation-delay: 3.9s; }
}

@keyframes home-signal-travel {
  from { stroke-dashoffset: 0; }
  to { stroke-dashoffset: -100; }
}

@keyframes home-node-pulse {
  0% {
    transform: scale(1);
    animation-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
  }

  7% {
    transform: scale(1.2);
    animation-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
  }

  16% {
    transform: scale(1);
    animation-timing-function: linear;
  }

  100% {
    transform: scale(1);
  }
}

@keyframes home-graphic-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

/* Pointer tilt sits on the stage so it does not replace the route or float animations. */
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  body.page-home section.hero .hero-graphic {
    perspective: 980px;
  }

  body.page-home section.hero .hero-graphic-stage {
    --tilt-x: 0deg;
    --tilt-y: 0deg;
    transform: rotateX(var(--tilt-x)) rotateY(var(--tilt-y));
    transform-origin: center center;
    transform-style: preserve-3d;
    transition: transform 520ms var(--home-ease);
  }

  body.page-home section.hero .hero-graphic.is-hot .hero-graphic-stage {
    transition-duration: 80ms;
    transition-timing-function: linear;
  }

  body.page-home section.hero .hero-graphic svg .nodes circle {
    transition: fill 320ms var(--home-ease), filter 320ms var(--home-ease), r 320ms var(--home-ease);
  }

  body.page-home section.hero .hero-graphic svg .nodes circle.is-near {
    fill: #C73E52;
    r: 7px;
    filter: drop-shadow(0 0 5px rgba(199, 62, 82, 0.6));
  }
}

/* ---------- Industries: full content width ---------- */

body.page-home section.industries .industry-strip {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  width: 100%;
  max-width: none;
}

body.page-home section.industries .industry-item {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 16px;
  width: 100%;
  min-width: 0;
  max-width: none;
  overflow: visible;
  padding: 18px 24px;
}

body.page-home section.industries .industry-item .icon {
  margin: 0;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

body.page-home section.industries .industry-item h4 {
  flex: 1 1 auto;
  min-width: 0;
  max-width: none;
  margin: 0;
  overflow: visible;
  text-overflow: unset;
  white-space: normal;
  overflow-wrap: normal;
  word-break: normal;
  font-size: 16.5px;
  line-height: 1.35;
}

body.page-home section.industries .industry-note {
  display: block;
  width: 100%;
  max-width: none;
  margin: 22px 0 0;
}

@media (max-width: 480px) {
  body.page-home section.industries .industry-item {
    padding: 16px 14px;
    gap: 12px;
  }

  body.page-home section.industries .industry-item h4 {
    font-size: 14.5px;
  }
}

/* ---------- Restrained hover and micro-motion ---------- */

@media (prefers-reduced-motion: no-preference) {
  body.page-home.js-reveal .service-card[data-reveal].is-visible,
  body.page-home.js-reveal .audience-card[data-reveal].is-visible,
  body.page-home.js-reveal .industry-item[data-reveal].is-visible,
  body.page-home.js-reveal .service-lead[data-reveal].is-visible {
    transition:
      opacity 640ms var(--ease) var(--d, 0ms),
      transform 640ms var(--ease) var(--d, 0ms),
      box-shadow 420ms var(--ease),
      border-color 420ms var(--ease);
  }

  body.page-home .service-card:hover,
  body.page-home .audience-card:hover,
  body.page-home .industry-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 36px rgba(14, 35, 64, 0.09);
  }

  body.page-home .service-lead:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 32px rgba(14, 35, 64, 0.07);
  }

  body.page-home .hero a.btn-primary,
  body.page-home .final-cta a.btn-primary,
  body.page-home .audience-card a.btn-secondary {
    transition:
      background-color 320ms var(--home-ease),
      border-color 320ms var(--home-ease),
      color 320ms var(--home-ease),
      transform 420ms var(--home-ease),
      box-shadow 420ms var(--home-ease);
  }

  body.page-home .hero a.btn-primary:hover,
  body.page-home .final-cta a.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(14, 35, 64, 0.18);
  }

  body.page-home .audience-card a.btn-secondary:hover,
  body.page-home section.how a.btn-secondary:hover {
    transform: translateX(3px);
  }

  body.page-home section.how a.btn-secondary {
    transition: color 280ms var(--home-ease), border-color 280ms var(--home-ease), transform 420ms var(--home-ease);
  }
}

@media (prefers-reduced-motion: reduce) {
  body.page-home section.hero .hero-graphic svg,
  body.page-home section.hero .hero-graphic svg .route,
  body.page-home section.hero .hero-graphic svg .signal,
  body.page-home section.hero .hero-graphic svg .nodes circle {
    animation: none;
    transform: none;
  }

  body.page-home section.hero .hero-graphic svg .route {
    stroke-dasharray: none;
    stroke-dashoffset: 0;
    opacity: 0.55;
  }

  body.page-home section.hero .hero-graphic svg .signal {
    opacity: 0;
    stroke-dasharray: none;
    stroke-dashoffset: 0;
  }

  body.page-home section.hero .hero-graphic svg .nodes circle {
    opacity: 1;
  }
}
