/* ===== Screenshot section ===== */

/* Desktop — wider container */
.section-screenshots .container {
  max-width: 100%;
  padding: 0 156px;
}

.screenshots-frame {
  background: var(--grey-surface);
  border-radius: 32px;
  overflow: hidden;
  padding: 56px 80px 0;
  position: relative;
}

.screenshots-slider {
  position: relative;
  width: 100%;
}

.screenshot {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 16px 16px 0 0;
  border: 1px solid var(--border);
  border-bottom: none;
  opacity: 0;
  transition: opacity 1.2s ease;
}

.screenshot:first-child {
  position: relative;
}

.screenshot:last-child {
  position: absolute;
  top: 0;
  left: 0;
}

.screenshot.active {
  opacity: 1;
}

/* Wide screens — cap width */
@media (min-width: 2000px) {
  .section-screenshots .container {
    max-width: 1608px;
    margin: 0 auto;
  }
}

/* ≤1280px — cropped state begins */
@media (max-width: 1280px) {
  .section-screenshots .container {
    padding: 0;
  }

  .screenshots-frame {
    border-radius: 0;
    padding: 56px 0 0 80px;
  }

  .screenshots-slider {
    overflow: hidden;
  }

  .screenshot {
    width: 150%;
    max-width: none;
  }

}

/* ≤708px — zoom increases */
@media (max-width: 708px) {
  .screenshots-frame {
    padding: 32px 0 0 48px;
  }

  .screenshot {
    width: 170%;
  }

}

/* ≤425px — bottom cropping begins */
@media (max-width: 425px) {
  .screenshots-slider {
    max-height: 55vh;
  }

  .screenshot {
    width: 200%;
  }

}

/* ===== Progress bars ===== */

.screenshots-progress {
  display: flex;
  gap: 8px;
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  padding: 16px 0;
  z-index: 2;
}

.progress-bar {
  width: 128px;
  height: 8px;
  background: rgba(0, 0, 0, 0.3);
  border: none;
  border-radius: 8px;
  padding: 0;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  outline-offset: 4px;
}

.progress-bar:focus-visible {
  outline: 2px solid var(--blue);
}

.progress-fill {
  position: absolute;
  inset: 0;
  background: var(--blue);
  border-radius: 2px;
  transform: scaleX(0);
  transform-origin: left;
}

.progress-bar.active .progress-fill {
  animation: progressFill 4s linear forwards;
}

@keyframes progressFill {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}

@media (prefers-reduced-motion: reduce) {
  .screenshot {
    transition: none;
  }

  .progress-bar.active .progress-fill {
    animation: none;
    transform: scaleX(1);
  }
}
