/* O programa: cartões presos no topo, um cobrindo o outro, cada um com a telinha do que o módulo entrega. */
.stack {
  display: grid;
  gap: 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.stack__card {
  position: sticky;
  top: calc(96px + var(--i) * 12px);
  display: grid;
  grid-template-columns: minmax(0, 6fr) minmax(0, 5fr);
  align-items: center;
  gap: clamp(1.5rem, 4vw, 3.5rem);
  padding: clamp(1rem, 2vw, 1.25rem) clamp(1rem, 2vw, 1.25rem) clamp(1rem, 2vw, 1.25rem) clamp(1.5rem, 3.5vw, 2.75rem);
  border-radius: var(--r-feature);
  background: linear-gradient(180deg, var(--superficie-alta), var(--ferro));
  box-shadow: var(--depth-card), var(--sombra-curta);
  transform-origin: 50% 0;
}

.stack__body {
  display: grid;
  gap: 0.75rem;
  max-width: 34rem;
}

/* Em que passo você está: número, total e uma barra de seis segmentos */
.stack__step {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--nevoa);
  font-size: var(--text-sm);
}

.stack__step b {
  display: grid;
  place-items: center;
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 50%;
  background: var(--brasa);
  color: var(--on-brasa);
  font-weight: 750;
}

.stack__bar {
  display: flex;
  gap: 3px;
  margin-left: 0.5rem;
}

.stack__bar i {
  width: 1.1rem;
  height: 4px;
  border-radius: 2px;
  background: var(--aco-claro);
}

.stack__bar i.is-on {
  background: var(--brasa);
}

.stack__body h3 {
  font-size: clamp(1.5rem, 1.1rem + 1.2vw, 2.1rem);
  font-weight: 800;
  font-stretch: 115%;
  letter-spacing: -0.03em;
  line-height: 1.08;
}

.stack__text {
  color: var(--nevoa);
  font-size: var(--text-base);
  line-height: 1.55;
}

.stack__ships {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.5rem;
  margin-top: 0.4rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--aco);
  font-size: var(--text-sm);
}

.stack__ships span {
  color: var(--incandescente);
  font-weight: 650;
}

/* ── A telinha ── */
.stack__visual {
  position: relative;
  display: grid;
  place-items: center;
  height: 15rem;
  padding: 1.25rem;
  overflow: hidden;
  border-radius: 20px;
  background:
    radial-gradient(80% 70% at 50% 120%, rgb(255 91 31 / 0.22), transparent 65%),
    radial-gradient(rgb(255 255 255 / 0.05) 1px, transparent 1.5px) 0 0 / 16px 16px,
    #0d0e10;
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.06);
  color: #ececee;
  font-size: 0.85rem;
}

.stack__visual svg {
  width: 0.9em;
  height: 0.9em;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* 1. Terminal */
.pg-win {
  display: grid;
  gap: 0.45rem;
  width: min(100%, 20rem);
  padding: 0.9rem 1rem 1rem;
  border-radius: 12px;
  background: #17181c;
  box-shadow: 0 1rem 2rem -1rem rgb(0 0 0 / 0.8);
}

.pg-dots {
  display: flex;
  gap: 5px;
  margin-bottom: 0.35rem;
}

.pg-dots i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #3a3d44;
}

.pg-win code {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  white-space: nowrap;
}

.pg-cmd {
  color: #ffc56b;
}

.pg-line {
  color: #4ade80;
}

/* 2. Escopo */
.pg-doc {
  display: grid;
  gap: 0.5rem;
  width: min(100%, 17rem);
  padding: 1rem;
  border-radius: 12px;
  background: #f4f1ea;
  color: #1b1916;
}

.pg-doc__title {
  margin-bottom: 0.25rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: #7c766c;
}

.pg-task {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 600;
}

.pg-task b {
  display: grid;
  place-items: center;
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 5px;
  background: #ff5b1f;
  color: #000;
}

/* 3. Página */
.pg-page {
  position: relative;
  display: grid;
  gap: 0.5rem;
  width: min(100%, 19rem);
  padding: 0.75rem;
  border-radius: 12px;
  background: #f4f4f6;
}

.pg-blk {
  height: 1.5rem;
  border-radius: 6px;
  background: #ff5b1f;
}

.pg-blk--nav {
  height: 0.7rem;
  width: 45%;
  background: #121316;
}

.pg-blk--hero {
  height: 3.6rem;
  background: linear-gradient(120deg, #121316, #3a2a22);
}

.pg-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.4rem;
}

.pg-cards .pg-blk {
  height: 2.6rem;
  background: #e2ddd3;
}

.pg-cards .pg-blk:nth-child(2) {
  background: #ffc56b;
}

.pg-live {
  position: absolute;
  right: -0.6rem;
  top: -0.7rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  border-radius: 99px;
  background: #fff;
  color: #121316;
  font-weight: 700;
  box-shadow: 0 0.6rem 1.2rem -0.5rem rgb(0 0 0 / 0.6);
}

.pg-live i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
}

/* 4. Login */
.pg-auth {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0.5rem;
  width: min(100%, 20rem);
}

.pg-field,
.pg-btn {
  grid-column: 1;
  padding: 0.5rem 0.7rem;
  border-radius: 8px;
  background: #17181c;
  box-shadow: inset 0 0 0 1px #2c2f36;
  color: #8b8e96;
  font-size: 0.75rem;
}

.pg-btn {
  background: #ececee;
  color: #121316;
  font-weight: 700;
  text-align: center;
}

.pg-users {
  display: grid;
  grid-column: 2;
  grid-row: 1 / span 3;
  gap: 0.45rem;
  align-content: center;
}

.pg-user {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem;
  border-radius: 8px;
  background: #17181c;
}

.pg-user i {
  display: grid;
  place-items: center;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 50%;
  background: hsl(var(--h) 70% 55%);
  font-size: 0.6rem;
  font-style: normal;
  font-weight: 700;
}

.pg-user b {
  flex: 1;
  height: 6px;
  border-radius: 3px;
  background: #2c2f36;
}

/* 5. Pix */
.pg-pay {
  position: relative;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  border-radius: 14px;
  background: #17181c;
}

.pg-qr {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 3px;
  width: 4.6rem;
  padding: 0.4rem;
  border-radius: 8px;
  background: #fff;
}

.pg-qr i {
  aspect-ratio: 1;
  border-radius: 2px;
}

.pg-qr i.on {
  background: #121316;
}

.pg-pay__info {
  display: grid;
  gap: 0.1rem;
}

.pg-pay__info small {
  color: #8b8e96;
}

.pg-pay__info b {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.pg-paid {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  gap: 0.3rem;
  margin-top: 0.3rem;
  padding: 0.2rem 0.6rem;
  border-radius: 99px;
  background: #22c55e;
  color: #052e16;
  font-weight: 700;
}

.pg-total {
  position: absolute;
  right: -0.8rem;
  bottom: -1.6rem;
  padding: 0.35rem 0.75rem;
  border-radius: 99px;
  background: #ff5b1f;
  color: #000;
  font-weight: 700;
  white-space: nowrap;
}

/* 6. Operar */
.pg-ops {
  display: grid;
  gap: 0.8rem;
  width: min(100%, 20rem);
}

.pg-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.4rem;
}

.pg-step {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.5rem 0.3rem;
  border-radius: 8px;
  background: #17181c;
  box-shadow: inset 0 0 0 1px rgb(74 222 128 / 0.35);
  color: #4ade80;
  font-size: 0.75rem;
  font-weight: 650;
  white-space: nowrap;
}

.pg-uptime {
  width: 100%;
  height: 3.5rem;
  fill: none;
  stroke: #ffc56b;
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-dasharray: 1;
}

.pg-uptime__label {
  color: #8b8e96;
  font-size: 0.75rem;
}

/* ── Movimento: cada telinha roda em ciclo de 7 s quando a seção entra na tela ── */
.motion .program.is-in .stack__visual * {
  animation-duration: 7s;
  animation-iteration-count: infinite;
  animation-timing-function: var(--ease-out);
}

/* 1 */
.motion .program.is-in .pg-cmd { animation-name: pg-type; }
.motion .program.is-in .pg-line { animation-name: pg-appear; animation-delay: calc(var(--k) * 0.45s); }

@keyframes pg-type {
  0% { clip-path: inset(0 100% 0 0); }
  18%, 100% { clip-path: inset(0); }
}

@keyframes pg-appear {
  0%, 22% { opacity: 0; transform: translateY(6px); }
  30%, 90% { opacity: 1; transform: none; }
  100% { opacity: 0; }
}

/* 2 */
.motion .program.is-in .pg-task b { animation-name: pg-tick; animation-delay: calc(var(--k) * 0.5s); }
.motion .program.is-in .pg-task b svg { animation-name: pg-tick-mark; animation-delay: calc(var(--k) * 0.5s); }

@keyframes pg-tick {
  0%, 10% { background: transparent; box-shadow: inset 0 0 0 1.5px #c9c3b8; }
  16%, 92% { background: #ff5b1f; box-shadow: none; }
  100% { background: transparent; box-shadow: inset 0 0 0 1.5px #c9c3b8; }
}

@keyframes pg-tick-mark {
  0%, 12% { opacity: 0; transform: scale(0.4); }
  18%, 92% { opacity: 1; transform: none; }
  100% { opacity: 0; }
}

/* 3 */
.motion .program.is-in .pg-blk { animation-name: pg-fill; }
.motion .program.is-in .pg-cards .pg-blk { animation-delay: calc(0.6s + var(--k) * 0.2s); }
.motion .program.is-in .pg-live { animation-name: pg-pop; }

@keyframes pg-fill {
  0%, 8% { filter: grayscale(1) brightness(1.6) contrast(0.4); opacity: 0.6; }
  25%, 92% { filter: none; opacity: 1; }
  100% { filter: grayscale(1) brightness(1.6) contrast(0.4); opacity: 0.6; }
}

@keyframes pg-pop {
  0%, 38% { opacity: 0; transform: scale(0.7); }
  45%, 92% { opacity: 1; transform: none; }
  100% { opacity: 0; }
}

/* 4 */
.motion .program.is-in .pg-btn { animation-name: pg-press; }
.motion .program.is-in .pg-user { animation-name: pg-slide; animation-delay: calc(0.3s + var(--k) * 0.35s); }

@keyframes pg-press {
  0%, 20% { transform: none; }
  23% { transform: scale(0.94); }
  27%, 100% { transform: none; }
}

@keyframes pg-slide {
  0%, 25% { opacity: 0; transform: translateX(12px); }
  33%, 90% { opacity: 1; transform: none; }
  100% { opacity: 0; }
}

/* 5 */
.motion .program.is-in .pg-paid { animation-name: pg-pop; }
.motion .program.is-in .pg-total { animation-name: pg-pop; animation-delay: 0.5s; }
.motion .program.is-in .pg-qr { animation-name: pg-scan; }

@keyframes pg-scan {
  0%, 30% { box-shadow: 0 0 0 0 rgb(255 197 107 / 0); }
  34% { box-shadow: 0 0 0 4px rgb(255 197 107 / 0.8); }
  42%, 100% { box-shadow: 0 0 0 0 rgb(255 197 107 / 0); }
}

/* 6 */
.motion .program.is-in .pg-step { animation-name: pg-step; animation-delay: calc(var(--k) * 0.6s); }
.motion .program.is-in .pg-uptime path { animation-name: pg-draw; animation-delay: 1.6s; }

@keyframes pg-step {
  0%, 6% { color: #8b8e96; box-shadow: inset 0 0 0 1px #2c2f36; }
  14%, 92% { color: #4ade80; box-shadow: inset 0 0 0 1px rgb(74 222 128 / 0.35); }
  100% { color: #8b8e96; box-shadow: inset 0 0 0 1px #2c2f36; }
}

@keyframes pg-draw {
  0% { stroke-dashoffset: 1; }
  35%, 100% { stroke-dashoffset: 0; }
}

@media (max-width: 960px) {
  .stack__card {
    top: calc(76px + var(--i) * 10px);
    grid-template-columns: minmax(0, 1fr);
    padding: 1rem;
  }

  .stack__body {
    padding: 0.5rem 0.5rem 0;
  }

  .stack__visual {
    height: 12rem;
  }
}
