.suite-home {
  --suite-layer-platform: #1e8a88;
  --suite-layer-service: #278294;
  --suite-layer-agents: var(--suite-blue, #3977bb);
}

.suite-hero-stack {
  --stack-teal: var(--suite-layer-platform);
  --stack-middle: var(--suite-layer-service);
  --stack-blue: var(--suite-layer-agents);
  --stack-ink: #214651;
  --stack-icon-size: 48px;
  --stack-inset: 16px;
  --stack-step: 16px;
  --stack-gap: 10px;
  position: relative;
  isolation: isolate;
  align-self: center;
  justify-self: center;
  width: 95%;
  max-width: 610px;
  min-width: 0;
  color: var(--stack-ink);
  container-type: inline-size;
}

.suite-hero-stack::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -55px -40px;
  pointer-events: none;
  background: radial-gradient(ellipse 48% 46% at center, rgba(30, 138, 136, .12), rgba(57, 119, 187, .06) 52%, transparent 100%);
}

.hero-stack__layers {
  display: grid;
  grid-template-rows: repeat(3, 1fr);
  gap: var(--stack-gap);
  margin: 0;
  padding: 0;
  list-style: none;
}

.hero-stack__layer {
  --layer-step: 0;
  --layer-color: var(--stack-teal);
  position: relative;
  display: grid;
  grid-template-areas: "icon title" "icon chips";
  grid-template-columns: var(--stack-icon-size) minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-content: start;
  align-items: start;
  gap: 5px 13px;
  padding-block: var(--stack-inset);
  padding-inline: calc(var(--stack-inset) + 2 * var(--stack-step))
                  calc(var(--stack-inset) + (2 - var(--layer-step)) * var(--stack-step));
}

.hero-stack__layer:nth-child(2) {
  --layer-step: 1;
  --layer-color: var(--stack-middle);
}

.hero-stack__layer:nth-child(3) {
  --layer-step: 2;
  --layer-color: var(--stack-blue);
}

.hero-stack__layer::before {
  content: "";
  position: absolute;
  inset: 0 calc((2 - var(--layer-step)) * var(--stack-step)) 0 calc(var(--layer-step) * var(--stack-step));
  z-index: 0;
  border: 1px solid rgba(30, 138, 136, .14);
  border-radius: 14px;
  background: rgba(255, 255, 255, .62);
  box-shadow: 0 20px 40px -20px rgba(30, 138, 136, .25);
  backdrop-filter: blur(12px);
}

.hero-stack__layer--active::before {
  background: linear-gradient(115deg, rgba(237, 250, 248, .66), rgba(255, 255, 255, .63));
  box-shadow: 0 20px 40px -19px rgba(30, 138, 136, .29);
}

.hero-stack__axis {
  position: absolute;
  z-index: 1;
  pointer-events: none;
  top: calc(var(--stack-inset) + var(--stack-icon-size) / 2);
  left: calc(var(--stack-inset) + 2 * var(--stack-step) + var(--stack-icon-size) / 2 - .5px);
  width: 1px;
  /* Cover the first two equal-height rows and the two gaps between icons. */
  height: calc((100% - 2 * var(--stack-gap)) * 2 / 3 + 2 * var(--stack-gap));
  background: linear-gradient(rgba(30, 138, 136, .48), rgba(39, 130, 148, .48), rgba(57, 119, 187, .48));
}

.hero-stack__icon,
.hero-stack__title,
.hero-stack__chips {
  position: relative;
  z-index: 2;
}

.hero-stack__icon {
  grid-area: icon;
  display: grid;
  place-items: center;
  width: var(--stack-icon-size);
  aspect-ratio: 1;
  border-radius: 11px;
  color: white;
  background: var(--layer-color);
  box-shadow: 0 5px 14px -7px var(--layer-color);
}

.hero-stack__icon svg {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.hero-stack__layer--active .hero-stack__icon svg {
  fill: currentColor;
  stroke: none;
}

.suite-home .hero-stack__title {
  grid-area: title;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font: 700 17px/1.15 Poppins, Arial, sans-serif;
  letter-spacing: 0;
}

.hero-stack__activity {
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--suite-layer-platform);
  box-shadow: 0 0 0 3px rgba(30, 138, 136, .14);
}

.hero-stack__chips {
  grid-area: chips;
  display: grid;
  gap: 4px;
}

.hero-stack__chip-row {
  display: flex;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.hero-stack__chips li {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2.5px 7px;
  border-radius: 999px;
  background: rgba(30, 138, 136, .07);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.2;
}

.hero-stack__chips svg {
  width: 14px;
  height: 14px;
  flex: none;
  fill: none;
  stroke: #177a77;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@media (prefers-reduced-motion: no-preference) {
  .suite-hero-stack {
    --stack-cycle: 3.6s;
    --stack-cycle-start: .7s;
  }

  /* Animate the surface and content separately so the axis stays behind the icons. */
  .hero-stack__layer::before,
  .hero-stack__icon,
  .hero-stack__title {
    animation: hero-stack-enter .45s ease-out calc(var(--layer-step) * 130ms) backwards;
  }

  .hero-stack__chip-row {
    animation: hero-stack-enter .4s ease-out calc(110ms + var(--layer-step) * 130ms) backwards;
  }

  .hero-stack__chip-row:nth-child(2) {
    animation-delay: calc(160ms + var(--layer-step) * 130ms);
  }

  .hero-stack__axis::after {
    content: "";
    position: absolute;
    left: 50%;
    width: 4px;
    height: 20px;
    transform: translate(-50%, -50%);
    border-radius: 999px;
    background: linear-gradient(transparent, #21a89d 30%, #80e5db 50%, #21a89d 70%, transparent);
    box-shadow: 0 2px 8px rgba(5, 139, 138, .45);
    animation: hero-stack-flow var(--stack-cycle) ease-in-out var(--stack-cycle-start) infinite backwards;
  }

  .hero-stack__icon::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    background: rgba(255, 255, 255, .16);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, .5) inset, 0 0 16px var(--layer-color);
    animation: hero-stack-highlight var(--stack-cycle) ease-in-out var(--stack-cycle-start) infinite backwards;
  }

  /* Plataforma lights up at the turnaround. Servicio lights up on both passes. */
  .hero-stack__layer:first-child .hero-stack__icon::after {
    animation-delay: calc(var(--stack-cycle-start) - var(--stack-cycle) / 2);
  }

  .hero-stack__layer:nth-child(2) .hero-stack__icon::after {
    animation-duration: calc(var(--stack-cycle) / 2);
  }

  .hero-stack__activity {
    animation: hero-stack-pulse var(--stack-cycle) ease-out var(--stack-cycle-start) infinite;
  }
}

@keyframes hero-stack-enter {
  from { opacity: 0; transform: translateY(4px); }
}

@keyframes hero-stack-pulse {
  0%, 49%, 63%, 100% { box-shadow: 0 0 0 3px rgba(30, 138, 136, .14); }
  50% { box-shadow: 0 0 0 3px rgba(30, 138, 136, .35); }
  60% { box-shadow: 0 0 0 9px rgba(30, 138, 136, 0); }
}

@keyframes hero-stack-flow {
  0%, 100% { top: 0; }
  50% { top: 100%; }
}

@keyframes hero-stack-highlight {
  0%, 39%, 61%, 100% { opacity: 0; }
  50% { opacity: 1; }
}

@media (max-width: 860px) {
  .suite-hero-stack {
    --stack-step: 10px;
    width: 100%;
  }

  .suite-hero-stack::before { inset: -38px 0; }
}

@media (max-width: 560px) {
  .suite-hero-stack {
    --stack-step: 4px;
    --stack-icon-size: 37px;
  }

  .hero-stack__axis { z-index: 0; }
  .hero-stack__layer::before { z-index: 1; }
}

@container (max-width: 470px) {
  .hero-stack__layer {
    grid-template-areas: "icon title" "chips chips";
    gap: 6px 9px;
  }

  .suite-home .hero-stack__title { align-self: center; }
}

@container (max-width: 330px) {
  .hero-stack__chips li { padding-inline: 5px; font-size: 12px; }
}
