/* 3D scroll gallery (из create-3d-scroll-site), только внутри .scroll-3d-section */

.scroll-3d-section {
  --scroll-3d-index: calc(1vw + 1vh);
  --scroll-3d-gutter: 30px;
  --scroll-3d-side-small: 26;
  --scroll-3d-side-big: 36;
  --scroll-3d-depth: 4000px;
  --scroll-3d-transition: 0.75s cubic-bezier(0.075, 0.5, 0, 1);
  position: relative;
  height: var(--scroll-3d-depth);
  margin: 0;
  background-color: #000;
  color: #fff;
  font-size: calc(var(--scroll-3d-index) * 0.8);
  font-family: raleway-gallery-3d, "Raleway", sans-serif;
  line-height: 1.75;
  font-weight: 300;
}

.scroll-3d-section * {
  box-sizing: border-box;
}

/* Блокировка вертикального скролла документа, пока активна «глубина» галереи */
html.scroll-3d-locked,
html.scroll-3d-locked body {
  overflow: hidden;
  overscroll-behavior: none;
}

@font-face {
  font-family: raleway-gallery-3d;
  src: url("../fonts/raleway/raleway-v22-cyrillic-300.woff2") format("woff2");
  font-weight: 300;
  font-display: swap;
}

@font-face {
  font-family: raleway-gallery-3d;
  src: url("../fonts/raleway/raleway-v22-cyrillic-regular.woff2") format("woff2");
  font-weight: 100;
  font-display: swap;
}

.scroll-3d-sticky {
  position: sticky;
  top: 4rem;
  height: calc(100vh - 4rem);
  overflow: visible;
  width: 100%;
}

.scroll-3d-container {
  width: 100%;
  height: 100%;
  perspective: 1500px;
}

.scroll-3d-gallery {
  transform-style: preserve-3d;
  height: 100%;
}

.scroll-3d-section .frame {
  width: 100%;
  height: 100%;
  position: absolute;
  left: 0;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--scroll-3d-transition), opacity 0.75s ease;
  will-change: transform;
  transform-style: preserve-3d;
}

.scroll-3d-section .frame h1,
.scroll-3d-section .frame h2,
.scroll-3d-section .frame h3,
.scroll-3d-section .frame h4 {
  font-weight: 100;
  text-transform: uppercase;
  width: min-content;
  line-height: 1;
}

.scroll-3d-section .frame h2 {
  text-align: center;
  font-size: calc(var(--scroll-3d-index) * 3.3);
}

.scroll-3d-section .frame-media {
  position: relative;
  width: calc(var(--scroll-3d-index) * var(--scroll-3d-side-small));
  height: calc(var(--scroll-3d-index) * var(--scroll-3d-side-big));
  background-position: center;
  background-size: cover;
}

.scroll-3d-section .frame-media_left {
  right: calc(var(--scroll-3d-side-small) / 2 * var(--scroll-3d-index) + var(--scroll-3d-gutter));
}

.scroll-3d-section .frame-media_right {
  left: calc(var(--scroll-3d-side-small) / 2 * var(--scroll-3d-index) + var(--scroll-3d-gutter));
}

.scroll-3d-section .frame_bg {
  background-color: rgb(0 0 0 / 0.87);
}

.scroll-3d-section video.frame-media {
  width: calc(var(--scroll-3d-index) * var(--scroll-3d-side-big));
  height: calc(var(--scroll-3d-index) * var(--scroll-3d-side-small));
  object-fit: cover;
}

.scroll-3d-section video.frame-media_right {
  left: calc(var(--scroll-3d-side-big) / 2 * var(--scroll-3d-index) + var(--scroll-3d-gutter));
}

.scroll-3d-section video.frame-media_left {
  right: calc(var(--scroll-3d-side-big) / 2 * var(--scroll-3d-index) + var(--scroll-3d-gutter));
}

.scroll-3d-section .scroll-3d-text-right > * {
  position: relative;
  left: 18vw;
}

.scroll-3d-section .scroll-3d-text-left > * {
  position: relative;
  right: 18vw;
}

/* Финальный кадр как «© WebDesign Master» в эталоне: без text-left/right, по центру */
.scroll-3d-section .frame__content.scroll-3d-endcard {
  text-align: center;
  max-width: min(90vw, 42rem);
}

.scroll-3d-section .frame__content.scroll-3d-endcard h3,
.scroll-3d-section .frame__content.scroll-3d-endcard p {
  margin-left: auto;
  margin-right: auto;
}

.scroll-3d-section .frame__content.scroll-3d-endcard p {
  max-width: 36rem;
}

.scroll-3d-section .frame h3 {
  font-size: calc(var(--scroll-3d-index) * 3);
}

.scroll-3d-section .frame p {
  max-width: 30vw;
  margin-top: 3vh;
}

.scroll-3d-soundbutton {
  position: absolute;
  bottom: 5vh;
  right: 5vw;
  cursor: pointer;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 18px;
  line-height: 1;
  transition: 0.25s ease;
  z-index: 20;
}

.scroll-3d-soundbutton.paused {
  opacity: 0.35;
}

.scroll-3d-soundbutton:focus {
  outline: 2px solid rgba(255, 255, 255, 0.5);
  outline-offset: 2px;
}

@media (max-width: 768px) {
  .scroll-3d-section .frame p {
    max-width: 85vw;
  }

  .scroll-3d-section .scroll-3d-text-right > * {
    left: 6vw;
  }

  .scroll-3d-section .scroll-3d-text-left > * {
    right: 6vw;
  }
}
