.box {
  width: 100%;
  min-height: 600px;
  height: clamp(45vh, 55vh, 70vh);
  perspective: 1000px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--color-blue-grey-900);
}

.box h1 {
  color: var(--blue-grey-50);
  font-family: var(--font-heading);
}
.box p {
  color: var(--blue-grey-50);
}
.box h1,
.box p {
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.35), 0 0 2px rgba(0, 0, 0, 0.5);
}

.rotator {
  width: 100%;
  max-width: 1440px;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
}

.layer {
  position: absolute;
  transform-style: preserve-3d;
  transition: transform 0.6s cubic-bezier(0.15, 2.5, 0.25, 1);
  will-change: transform;
}

/* ================= LAYERS ================= */
.back {
  width: fit-content;
  height: 100%;
  right: 5%;
  transform: translateZ(-140px);
}
.back::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to right,
    rgba(21, 29, 32, 0.55),
    rgba(21, 29, 32, 0.15)
  );
  pointer-events: none;
}
.mid {
  width: 50%;
  top: 40%;
  display: flex;
  flex-direction: column;
  text-align: end;
}

.hero-button {
  width: fit-content;
  color: #ffffffb0;
  margin-left: auto;
  transition: var(--transition);
  position: relative;
}

.hero-button::after {
  content: "›";
  display: inline-block;
  font-size: clamp(1.4rem, 0.9rem + 0.5vw, 1.6rem);
  margin-left: 6px;
  transition: var(--transition);
}

.hero-button:hover {
  cursor: pointer;
  color: var(--blue-grey-50);
  scale: 1.1;
}

.hero-button:hover::after {
  transform: translateX(4px); /* efekt przesunięcia strzałki przy hover */
}

/* ================= MOBILE ================= */
@media (max-width: 976px) {
  .mid {
    width: 60%;
    top: 35%;
  }
}
@media (max-width: 768px) {
  .box {
    padding: 2rem 1rem;
    align-items: flex-start;
  }

  .rotator {
    width: 100%;
    max-width: 100%;
    height: 100%;
  }

  /* TŁO / OBRAZ – spokojny, głęboki */
  .back {
    height: 100%;
    top: 0;
    opacity: 0.45;
    transform: translateZ(-60px);
    pointer-events: none;
  }

  /* TREŚĆ */
  .mid {
    position: relative;
    width: 100%;
    height: auto;

    left: 0;
    top: 15%;
    bottom: auto;
    transform: unset;

    margin-top: auto;
    margin-bottom: 10vh;

    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.75rem;
  }
  .hero-button {
    margin-left: auto;
    margin-right: auto;
  }
  .mid p {
    font-size: 0.85rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    opacity: 0.7;
  }

  .mid h1 {
    font-size: clamp(2.2rem, 6vw, 2.9rem);
    line-height: 1.2;
    max-width: 18ch;
    text-wrap: balance;
  }
}
