/* ---------------------------------------------------------------------------
   feature-hub — product image in the middle, capability cards either side,
   connectors drawn into .fh-routes by the component script.

   Loaded by resources/views/components/sections/feature-hub.blade.php.
   Plain CSS — no Tailwind @apply here.
   Bump the ?v in that component's <link> whenever this file changes.

   The two-column hub needs ~1070px of content width, more than the site's lg
   step (998px) gives, so it switches at 1100px instead.
--------------------------------------------------------------------------- */

.section-feature-hub {
  --fh-line: rgb(120 155 229);
  --fh-line-strong: rgb(53 113 222);
  --fh-flow: rgb(249 252 255);
  --fh-flow-glow: rgb(177 205 255 / 0.9);
  --fh-card-bg: rgb(247 250 255);
  --fh-card-border: rgb(185 205 244);
  --fh-icon-border: rgb(199 217 251);
  --fh-muted: rgb(83 100 126);
  --fh-shadow: rgb(29 74 163 / 0.04);
}

.section-feature-hub .fh-wrap {
  max-width: 1290px;
}

.section-feature-hub .fh-title {
  max-width: 800px;
  margin: 0 auto 38px;
  text-align: center;
}

/* ---- hub grid: tablet default (image on top, two card columns) ---- */
.section-feature-hub .fh-hub {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  max-width: 750px;
  margin: auto;
}

.section-feature-hub .fh-pair {
  display: contents;
}

.section-feature-hub .fh-routes {
  display: none;
}

.section-feature-hub .fh-device {
  position: relative;
  grid-column: 1 / -1;
  width: 100%;
  max-width: 340px;
  height: 220px;
  margin: 0 auto 10px;
}

.section-feature-hub .fh-device img {
  position: absolute;
  top: -50px;
  left: 50%;
  z-index: 1;
  display: block;
  width: min(272px, 64vw);
  max-width: none;
  height: auto;
  transform: translateX(-50%);
  filter: drop-shadow(0 18px 28px var(--fh-shadow));
}

.section-feature-hub .fh-card {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 15px;
  min-width: 0;
  padding: 20px;
  border: 1px solid var(--fh-card-border);
  border-radius: 17px;
  background: var(--fh-card-bg);
  box-shadow: 0 7px 20px var(--fh-shadow);
  text-align: left;
}

.section-feature-hub .fh-icon {
  display: grid;
  flex: 0 0 43px;
  place-items: center;
  width: 43px;
  height: 43px;
  border: 1px solid var(--fh-icon-border);
  border-radius: 13px;
  background: var(--color-white);
  color: var(--color-primary);
}

.section-feature-hub .fh-icon svg {
  width: 24px;
  height: 24px;
  stroke-width: 1.8;
}

.section-feature-hub .fh-card h3 {
  margin: 0 0 6px;
  font-size: 16px;
  line-height: 1.18;
  letter-spacing: -0.02em;
}

.section-feature-hub .fh-card p {
  margin: 0;
  color: var(--fh-muted);
  font-size: 13.5px;
  line-height: 1.45;
}

.section-feature-hub .fh-cta {
  display: flex;
  justify-content: center;
  margin-top: 27px;
}

/* ---- connectors (shared by the desktop and phone drawings) ---- */
.section-feature-hub .fh-routes {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.section-feature-hub .fh-routes path {
  fill: none;
  stroke: var(--fh-line);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.section-feature-hub .fh-routes circle {
  fill: var(--color-primary);
  stroke: var(--color-white);
  stroke-width: 2;
}

.section-feature-hub .fh-routes .fh-flow-soft,
.section-feature-hub .fh-routes .fh-flow {
  stroke-dasharray: 13 100;
  stroke-dashoffset: 13;
  animation: fh-travel 6s linear var(--fh-delay) infinite;
}

.section-feature-hub .fh-routes .fh-flow-soft {
  stroke: var(--fh-flow-glow);
  stroke-width: 5;
  filter: blur(1.7px);
}

.section-feature-hub .fh-routes .fh-flow {
  stroke: var(--fh-flow);
  stroke-width: 2.35;
}

@keyframes fh-travel {
  0% {
    stroke-dashoffset: 13;
    opacity: 0;
  }

  4% {
    opacity: 1;
  }

  30% {
    stroke-dashoffset: -100;
    opacity: 1;
  }

  35%,
  100% {
    stroke-dashoffset: -100;
    opacity: 0;
  }
}

@keyframes fh-phone-loop {
  to {
    stroke-dashoffset: -32;
  }
}

/* ---- desktop hub ---- */
@media (min-width: 1100px) {
  .section-feature-hub .fh-hub {
    grid-template-columns: minmax(270px, 1fr) minmax(420px, 530px) minmax(270px, 1fr);
    grid-template-rows: repeat(var(--fh-rows), minmax(122px, auto));
    gap: 16px 32px;
    align-items: stretch;
    max-width: none;
  }

  .section-feature-hub .fh-routes {
    display: block;
  }

  .section-feature-hub .fh-device {
    z-index: 2;
    grid-row: 1 / -1;
    grid-column: 2;
    align-self: stretch;
    max-width: none;
    height: auto;
    margin: 0;
  }

  .section-feature-hub .fh-device::before {
    content: "";
    position: absolute;
    bottom: 39px;
    left: 50%;
    width: 440px;
    max-width: 100%;
    height: 84px;
    border-radius: 50%;
    background: radial-gradient(rgb(29 74 163 / 0.055), rgb(29 74 163 / 0) 72%);
    filter: blur(20px);
    transform: translateX(-50%);
    pointer-events: none;
  }

  .section-feature-hub .fh-device img {
    top: 50%;
    width: min(528px, 36.8vw);
    transform: translate(-50%, -50%);
  }

  .section-feature-hub .fh-card {
    grid-row: var(--fh-row);
  }

  .section-feature-hub .fh-card h3 {
    font-size: 18px;
  }

  .section-feature-hub .fh-card > div {
    flex: 1 1 0%;
    min-width: 0;
  }

  .section-feature-hub .fh-card--left {
    grid-column: 1;
    flex-direction: row-reverse;
    text-align: right;
  }

  .section-feature-hub .fh-card--right {
    grid-column: 3;
  }
}

/* ---- phones: one column, a running connector between the cards ---- */
@media (max-width: 767px) {
  .section-feature-hub .fh-title {
    margin-bottom: 8px;
  }

  .section-feature-hub .fh-title span {
    display: block;
  }

  .section-feature-hub .fh-hub {
    display: flex;
    flex-direction: column;
    gap: 0;
  }

  .section-feature-hub .fh-routes {
    display: block;
  }

  .section-feature-hub .fh-routes .fh-source {
    stroke: var(--fh-line-strong);
    stroke-width: 4;
  }

  .section-feature-hub .fh-routes .fh-flow-soft,
  .section-feature-hub .fh-routes .fh-flow {
    stroke-dasharray: 8 24;
    stroke-dashoffset: 0;
    animation: fh-phone-loop 2.4s linear infinite;
  }

  .section-feature-hub .fh-routes .fh-flow-soft {
    stroke: rgb(217 233 255);
    stroke-width: 7;
    filter: blur(1.4px);
  }

  .section-feature-hub .fh-routes .fh-flow {
    stroke: var(--color-white);
    stroke-width: 3.2;
    filter: drop-shadow(0 0 2px rgb(28 96 213));
  }

  .section-feature-hub .fh-device {
    z-index: 1;
    order: -1;
    max-width: none;
    height: 212px;
    margin: 0;
  }

  .section-feature-hub .fh-device::before {
    content: "";
    position: absolute;
    top: 206px;
    left: 50%;
    width: 300px;
    max-width: 80vw;
    height: 52px;
    border-radius: 50%;
    background: radial-gradient(rgb(29 74 163 / 0.043), rgb(29 74 163 / 0) 72%);
    filter: blur(15px);
    transform: translateX(-50%);
    pointer-events: none;
  }

  .section-feature-hub .fh-device img {
    top: -58px;
    width: min(337px, 86.4vw);
  }

  .section-feature-hub .fh-pair {
    display: grid;
    gap: 14px;
    padding-bottom: 14px;
  }

  .section-feature-hub .fh-pair:last-child {
    padding-bottom: 0;
  }

  .section-feature-hub .fh-card {
    padding: 16px 15px;
  }

  .section-feature-hub .fh-card p {
    font-size: 13px;
  }

  .section-feature-hub .fh-icon {
    flex-basis: 36px;
    width: 36px;
    height: 36px;
    border-radius: 11px;
  }

  .section-feature-hub .fh-cta {
    margin-top: 19px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .section-feature-hub .fh-routes .fh-flow-soft,
  .section-feature-hub .fh-routes .fh-flow {
    display: none;
    animation: none;
  }
}
