*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  width: 100%;
  height: 100%;
}

body {
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  color: #fff;
  background: #0a0a0a;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

img {
  display: block;
  max-width: none;
}

.layered-slider {
  color: #fff;
  -webkit-user-select: none;
  user-select: none;
  position: relative;
  overflow: clip;
  width: 100%;
  height: 100%;
  height: 100dvh;
}

.layered-slider__container {
  width: 100%;
  height: 100%;
  position: relative;
}

.layered-slider__bg-collection {
  z-index: 0;
  position: absolute;
  inset: 0;
  overflow: clip;
}

.layered-slider__bg-list {
  width: 100%;
  height: 100%;
  position: relative;
}

.layered-slider__bg-item {
  width: 100%;
  height: 100%;
  position: absolute;
  inset: 0;
  opacity: 0;
  will-change: opacity, transform;
  background: #1a1a1a;
}

.layered-slider__bg-img {
  object-fit: cover;
  -webkit-user-select: none;
  user-select: none;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
  position: relative;
}

.layered-slider__bg-dark {
  z-index: 2;
  background-color: rgba(0, 0, 0, 0.15);
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.layered-slider__text-collection {
  z-index: 3;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 100%;
  display: flex;
  position: relative;
}

.layered-slider__text-list {
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 100%;
  display: flex;
  position: relative;
}

.layered-slider__text-item {
  text-align: center;
  cursor: pointer;
  max-width: 80%;
  position: absolute;
  will-change: transform, opacity;
}

.layered-slider__text-title {
  letter-spacing: -0.05em;
  color: inherit;
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  font-size: 4em;
  font-weight: 500;
  line-height: 0.8;
  text-decoration: none;
  white-space: nowrap;
  display: block;
  position: relative;
}

.layered-slider__mask-collection {
  z-index: 3;
  aspect-ratio: 4 / 3;
  border-radius: 0.85em;
  width: min(18em, 42vw);
  position: absolute;
  bottom: clamp(5.5rem, 10vh, 7.5rem);
  left: 50%;
  overflow: hidden;
  transform: translateX(-50%);
  box-shadow:
    0 20px 48px rgba(0, 0, 0, 0.35),
    0 0 0 1px rgba(255, 255, 255, 0.08);
}

.layered-slider__mask-list {
  position: relative;
  width: 100%;
  height: 100%;
}

.layered-slider__mask-item {
  flex: none;
  width: 100%;
  height: 100%;
  position: absolute;
  inset: 0;
  overflow: hidden;
  will-change: transform;
  background: #222;
}

.layered-slider__mask-img {
  pointer-events: none;
  object-fit: cover;
  -webkit-user-select: none;
  user-select: none;
  width: 100%;
  height: 100%;
  display: block;
  position: relative;
  background: #222;
}

.layered-slider__overlay {
  z-index: 4;
  pointer-events: none;
  flex-flow: column;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  max-width: 120em;
  margin-left: auto;
  margin-right: auto;
  padding: 2em;
  display: flex;
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
}

.layered-slider__overlay-top {
  gap: 0.5em;
  pointer-events: auto;
  justify-content: center;
  align-items: center;
  display: flex;
  position: relative;
}

.layered-slider__counter {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 1.75em;
}

.layered-slider__counter-window {
  --counter-line: 1.1em;
  position: relative;
  overflow: hidden;
  height: var(--counter-line);
  width: 1.75em;
  mask-image: linear-gradient(
    to bottom,
    transparent 0%,
    #000 22%,
    #000 78%,
    transparent 100%
  );
  -webkit-mask-image: linear-gradient(
    to bottom,
    transparent 0%,
    #000 22%,
    #000 78%,
    transparent 100%
  );
}

.layered-slider__counter-reel {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  will-change: transform;
  transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
}

.layered-slider__counter-item {
  flex: 0 0 var(--counter-line);
  height: var(--counter-line);
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
  color: rgba(255, 255, 255, 0.9);
  line-height: 1;
  user-select: none;
  white-space: nowrap;
}

.layered-slider__span {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  font-variant-numeric: tabular-nums;
  color: rgba(255, 255, 255, 0.85);
  min-width: 1.5em;
  text-align: center;
  display: inline-block;
  line-height: 1.15;
  position: relative;
}

.layered-slider__progress {
  background-color: rgba(255, 255, 255, 0.25);
  border-radius: 10em;
  width: 6em;
  height: 2px;
  overflow: hidden;
  position: relative;
}

.layered-slider__progress-inner {
  transform-origin: 0% 50%;
  width: 100%;
  height: 100%;
  background-color: #fff;
  transform: scale3d(0, 1, 1);
  position: relative;
}

.layered-slider__overlay-btm {
  justify-content: flex-end;
  align-items: center;
  width: 100%;
  display: flex;
  position: relative;
}

.layered-slider__nav {
  gap: 0.5em;
  pointer-events: auto;
  justify-content: center;
  align-items: center;
  display: flex;
  position: relative;
}

.layered-slider__nav-button {
  background-color: transparent;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 100em;
  justify-content: center;
  align-items: center;
  width: 3em;
  height: 3em;
  padding: 0.75em;
  display: flex;
  position: relative;
  transition:
    background-color 0.25s ease,
    border-color 0.25s ease;
}

.layered-slider__nav-button:hover {
  background-color: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.5);
}

.layered-slider__nav-button:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.7);
  outline-offset: 3px;
}

.layered-slider__nav-icon {
  width: 100%;
  height: 100%;
  display: block;
  position: relative;
}

@media screen and (max-width: 767px) {
  .layered-slider__text-title {
    font-size: 2.5em;
  }

  .layered-slider__overlay {
    padding: 1em;
  }

  .layered-slider__overlay-btm {
    justify-content: center;
    align-items: center;
  }

  .layered-slider__nav {
    justify-content: space-between;
    align-items: center;
    width: 100%;
  }

  .layered-slider__mask-collection {
    bottom: 5.5rem;
    width: min(14em, 58vw);
  }
}

@media screen and (max-width: 479px) {
  .layered-slider__mask-collection {
    width: min(12.5em, 58vw);
  }
}
