.flow {
  --flow-travel: clamp(420px, 74svh, 670px);
  --flow-tile-size: clamp(82px, 8.2vw, 114px);
  --flow-grid-gap: 12px;
  --flow-cut: 0%;
  --flow-frame-inset: 0%;
  position: relative;
  z-index: 2;
  background: #000;
  color: #fff;
  text-align: center;
}

.flow-scene {
  display: grid;
  min-height: 100svh;
  align-content: center;
  justify-items: center;
  gap: 2rem;
  padding: 3rem 1rem;
}

.flow-title {
  display: grid;
  width: max-content;
  justify-items: center;
  gap: .55rem;
  margin: 0;
  font-weight: 500;
  line-height: 1.25;
  white-space: nowrap;
}

.flow-erp {
  font-size: clamp(2.3rem, 6.2vw, 5.5rem);
  font-weight: 800;
  line-height: .95;
}

.flow-title-text { font-size: clamp(1rem, 3vw, 2.25rem); }

.flow-links, .flow-hand { display: none; }

.flow-modules {
  display: grid;
  grid-template-columns: repeat(3, var(--flow-tile-size));
  gap: var(--flow-grid-gap);
  margin: 0;
  padding: 0;
  list-style: none;
}

.flow-module {
  --flow-tile-shape: polygon(
    var(--flow-cut) var(--flow-frame-inset),
    calc(100% - var(--flow-cut)) var(--flow-frame-inset),
    100% 50%,
    calc(100% - var(--flow-cut)) calc(100% - var(--flow-frame-inset)),
    var(--flow-cut) calc(100% - var(--flow-frame-inset)),
    0 50%
  );
  position: relative;
  isolation: isolate;
  display: grid;
  width: var(--flow-tile-size);
  aspect-ratio: 1;
  justify-items: center;
  align-content: center;
  gap: .3rem;
  padding-inline: .65rem;
  font-size: clamp(.76rem, 1.25vw, 1rem);
  font-weight: 500;
  line-height: 1.2;
}

.flow-module::before, .flow-module::after {
  position: absolute;
  z-index: -1;
  inset: 0;
  clip-path: var(--flow-tile-shape);
  background: #8a8a8a;
  content: '';
}

.flow-module::after { inset: 1px; background: #000; }

.flow-icon {
  display: block;
  width: clamp(21px, 32%, 36px);
  aspect-ratio: 1;
}

.flow-icon :is(img, svg) {
  display: block;
  width: 100%;
  height: 100%;
}

.flow-icon img { filter: brightness(0) invert(1); }

.flow-icon svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.flow.is-diagram:not(.is-static) {
  min-height: calc(100svh + var(--flow-travel));
}

.flow.is-diagram .flow-scene {
  position: sticky;
  top: 0;
  display: block;
  height: 100svh;
  padding: 0;
  overflow: clip;
}

.flow.is-diagram .flow-scene::after {
  position: absolute;
  z-index: 4;
  top: var(--flow-center-y, 50%);
  left: 50%;
  width: clamp(52px, 7vw, 96px);
  aspect-ratio: 1;
  border: 1px solid #8ceaff;
  border-radius: 50%;
  background: radial-gradient(circle, #fff 0 4%, #8ceaff 6%, #25c9ff66 18%, #25c9ff00 62%);
  box-shadow: 0 0 14px #25c9ff80, inset 0 0 12px #25c9ff55;
  transform: translate(-50%, -50%) scale(var(--flow-touch-spread, .45));
  opacity: var(--flow-touch-light, 0);
  pointer-events: none;
  content: '';
}

.flow.is-diagram .flow-label {
  color: color-mix(in srgb, #fff, #81eaff calc(var(--flow-touch-light, 0) * 75%));
  text-shadow: 0 0 9px rgb(37 201 255 / var(--flow-touch-light, 0));
}

.flow.is-diagram .flow-title {
  position: absolute;
  z-index: 3;
  top: var(--flow-center-y, 50%);
  left: 50%;
  transform: translate(-50%, -50%);
  opacity: 0;
}

.flow.is-diagram .flow-links {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  fill: none;
  stroke: #bfbfbf;
  stroke-width: 1;
  opacity: 0;
  pointer-events: none;
}

.flow.is-diagram .flow-hand {
  position: absolute;
  z-index: 1;
  top: var(--flow-center-y, 50%);
  left: 50%;
  display: block;
  width: clamp(228px, 30vw, 384px);
  height: auto;
  transform-origin: 65% 2.6%;
  opacity: 0;
  pointer-events: none;
}

.flow.is-diagram .flow-modules { display: block; }

.flow.is-diagram .flow-module {
  position: absolute;
  z-index: 2;
  top: 0;
  left: 0;
}

@media (max-width: 759px) {
  .flow { --flow-tile-size: clamp(66px, 20vw, 82px); --flow-grid-gap: 8px; }
  .flow.is-diagram .flow-hand { width: clamp(176.4px, 56.4vw, 270px); }
}

@media (max-height: 420px) {
  .flow { --flow-tile-size: 64px; --flow-grid-gap: 8px; }
  .flow-module { gap: .2rem; }
}
