
/* База */
:root {
  --resheno-black: #000000;
  --resheno-accent: #c4ff00;
  --resheno-accent-dark: #b2e702;
  --resheno-blue: #1558ff;
  --resheno-white: #ffffff;
  --resheno-edge: clamp(18px, 5vw, 72px);
  --resheno-text-width: min(818px, 90vw);
  --resheno-wide-width: min(1100px, 90vw);
  --resheno-feature-video-width: min(1100px, 90vw);
  --resheno-section-gap: clamp(72px, 9.72vw, 140px);
  --resheno-font: "ALS Enormous", Arial, Helvetica, sans-serif;
  --resheno-credits-font: Arial, Helvetica, sans-serif;
}


/* Обертка проекта */
.resheno-work {
  width: 100%;
  max-width: 100vw;
  overflow-x: clip;
  background: var(--resheno-black);
}

.resheno-wrapper {
  position: relative;
  width: 100%;
  background: var(--resheno-black);
}

.production-wrapper,
.reels-wrapper,
.graphics-wrapper {
  z-index: 4;
}

.resheno-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border: 0;
}


/* Заглавный блок */
.hero-wrapper {
  display: grid;
  min-height: calc(clamp(420px, 38.89vw, 560px) + 360px);
  isolation: isolate;
  overflow: visible;
}

.hero-video,
.hero-cubes,
.hero-copy {
  grid-area: 1 / 1;
}

.hero-video {
  z-index: 0;
  align-self: start;
  width: 100%;
  height: clamp(380px, 55.76vw, 804px);
  overflow: hidden;
  opacity: 0.86;
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  pointer-events: none;
}

.hero-video::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.08) 0%, rgba(0, 0, 0, 0.18) 42%, #000000 100%);
  pointer-events: none;
}

.hero-copy {
  z-index: 5;
  align-self: start;
  display: grid;
  gap: clamp(16px, 1.55vw, 22px);
  width: min(600px, 90vw);
  padding-top: calc(clamp(553px, calc(18vw + 321px), 579px) + (clamp(39px, 5vw, 72px) * 1.88) + 24px);
  text-align: center;
}

.hero-copy p {
  color: var(--resheno-accent-dark);
  font-family: var(--resheno-font) !important;
  font-size: clamp(17px, 1.6vw, 23px);
  font-weight: 130;
  font-variation-settings: "wght" 130;
  line-height: 1.08;
  letter-spacing: -0.04em;
}

.hero-video .resheno-video {
  object-position: center top;
}

.hero-cubes {
  z-index: 3;
  align-self: end;
  width: 100%;
  pointer-events: none;
  overflow: hidden;
}

.hero-cubes img {
  width: 100%;
  min-height: 360px;
  object-fit: cover;
  object-position: center bottom;
}

/* Ссылка на выпуск */
.production-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--resheno-section-gap) var(--resheno-edge) 0;
}

.production-lead {
  max-width: 818px;
}

.main-video {
  width: var(--resheno-feature-video-width);
  margin-top: clamp(28px, 2.2vw, 32px);
  aspect-ratio: 1920 / 1080;
  overflow: hidden;
}

.watch-links {
  display: grid;
  gap: clamp(14px, 1.25vw, 18px);
  width: var(--resheno-text-width);
  margin-top: clamp(28px, 2.1vw, 32px);
}

.watch-link {
  display: inline-flex;
  width: max-content;
  max-width: 100%;
  align-items: center;
  gap: clamp(12px, 1.38vw, 20px);
  color: var(--resheno-accent);
  font-size: clamp(18px, 1.665vw, 24px);
  font-weight: 130;
  font-variation-settings: "wght" 130;
  line-height: 1.2;
  letter-spacing: -0.02em;
  text-align: left;
}

.watch-link--vk:hover {
  color: var(--resheno-blue);
}

.watch-link--youtube:hover {
  color: var(--resheno-white);
}

.watch-icon {
  display: block;
  width: clamp(40px, 3.885vw, 56px);
  height: clamp(40px, 3.885vw, 56px);
  flex: 0 0 auto;
  transition: color 0.1s ease-in-out;
}

/* Вертикальные ролики */
.reels-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  /* padding-top: var(--resheno-section-gap); */
  padding-top: 0;
  padding-bottom: 0;
  /* overflow: visible; */
  overflow: hidden;
}

.reels-lead {
  max-width: 818px;
  margin-bottom: clamp(22px, 3vw, 42px);
}

.reels-cuboid-scroll {
  --reels-cuboid-width: min(80vw, 1500px, calc(83svh * 2.25));
  --reels-cuboid-height: calc(var(--reels-cuboid-width) / 2.25);
  --reels-cuboid-depth: calc(var(--reels-cuboid-height) * 1.12);
  --reels-cuboid-stage-height: min(clamp(420px, calc(var(--reels-cuboid-height) * 1.28), 680px), 82svh);
  --reels-cuboid-gap: clamp(5px, 0.58vw, 9px);
  --reels-cuboid-edge: #000000;
  position: relative;
  z-index: 1;
  width: 100%;
  min-height: var(--reels-cuboid-stage-height);
  /* margin-top: clamp(10px, 1.7vw, 24px); */
  margin-bottom: 0;
  padding-block: clamp(16px, 2.4vw, 34px);
  background: var(--resheno-black);
  overflow: visible;
}

.reels-cuboid {
  position: relative;
  width: 100%;
  max-width: none;
  height: var(--reels-cuboid-stage-height);
  overflow: visible;
  background: var(--resheno-black);
  contain: none;
  isolation: isolate;
}

.reels-cuboid__scene {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  background: var(--resheno-black);
  perspective: clamp(980px, 100vw, 1720px);
  perspective-origin: 50% 50%;
  overflow: visible;
  user-select: none;
  touch-action: none;
  cursor: grab;
}

.reels-cuboid.is-dragging .reels-cuboid__scene {
  cursor: grabbing;
}

.reels-cuboid__shape {
  position: relative;
  width: var(--reels-cuboid-width);
  height: var(--reels-cuboid-height);
  transform: translate3d(0, 0, var(--reels-cuboid-camera, -120px)) rotateX(var(--reels-cuboid-rotate-x, -32deg)) rotateY(var(--reels-cuboid-rotate-y, 0deg));
  transform-style: preserve-3d;
  transform-origin: 50% 50%;
  will-change: transform;
  animation: resheno-cuboid-spin 28s linear infinite;
}

@keyframes resheno-cuboid-spin {
  from {
    transform: translate3d(0, 0, -120px) rotateX(-18deg) rotateY(0deg);
  }

  to {
    transform: translate3d(0, 0, -120px) rotateX(342deg) rotateY(0deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .reels-cuboid__shape {
    animation: none;
  }
}

.reels-cuboid__face {
  position: absolute;
  overflow: hidden;
  background: var(--reels-cuboid-edge);
  backface-visibility: hidden;
  box-shadow: 0 0 0 1px var(--reels-cuboid-edge);
}

.reels-cuboid__face--front,
.reels-cuboid__face--back {
  inset: 0;
}

.reels-cuboid__face--front {
  transform: translateZ(calc(var(--reels-cuboid-depth) / 2));
}

.reels-cuboid__face--back {
  transform: rotateY(180deg) translateZ(calc(var(--reels-cuboid-depth) / 2));
}

.reels-cuboid__face--top,
.reels-cuboid__face--bottom {
  left: 0;
  top: calc((var(--reels-cuboid-height) - var(--reels-cuboid-depth)) / 2);
  width: var(--reels-cuboid-width);
  height: var(--reels-cuboid-depth);
}

.reels-cuboid__face--top {
  transform: rotateX(90deg) translateZ(calc(var(--reels-cuboid-height) / 2));
}

.reels-cuboid__face--bottom {
  transform: rotateX(-90deg) translateZ(calc(var(--reels-cuboid-height) / 2));
}

.reels-cuboid__face--left,
.reels-cuboid__face--right {
  top: 0;
  left: calc((var(--reels-cuboid-width) - var(--reels-cuboid-depth)) / 2);
  width: var(--reels-cuboid-depth);
  height: var(--reels-cuboid-height);
}

.reels-cuboid__face--left {
  transform: rotateY(-90deg) translateZ(calc(var(--reels-cuboid-width) / 2));
}

.reels-cuboid__face--right {
  transform: rotateY(90deg) translateZ(calc(var(--reels-cuboid-width) / 2));
}

.reels-cuboid__slats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  width: 100%;
  height: 100%;
  gap: var(--reels-cuboid-gap);
  padding: calc(var(--reels-cuboid-gap) * 0.5);
  background: var(--reels-cuboid-edge);
}

.reels-cuboid__slats--side {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.reels-cuboid__slats span {
  display: block;
  min-width: 0;
  min-height: 0;
  background: var(--reels-cuboid-edge);
}

.reels-cuboid video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  image-rendering: auto;
  background: var(--reels-cuboid-edge);
  pointer-events: none;
}

.reels-cuboid__face--back video {
  transform: rotate(180deg);
}


/* Графика */
.graphics-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--resheno-section-gap) var(--resheno-edge) clamp(130px, 10vw, 160px);
}

.graphics-lead {
  display: grid;
  gap: clamp(14px, 1.25vw, 18px);
  max-width: 880px;
}

.graphics-lead p {
  max-width: min(660px, 100%);
}

.graphics-videos {
  display: grid;
  gap: clamp(22px, 2.2vw, 32px);
  width: var(--resheno-feature-video-width);
  margin-top: clamp(30px, 2.8vw, 40px);
}

.graphics-intro {
  margin-block: clamp(2px, 0.7vw, 10px);
}

.graphics-video {
  width: 100%;
  aspect-ratio: 1920 / 1080;
  overflow: hidden;
}



@media (min-width: 750px) {
  /* Заглавный блок */
  .hero-wrapper {
    min-height: calc(clamp(420px, 47.22vw, 680px) + 560px);
  }

  /* Заглавный блок */
  .hero-cubes {
    align-self: start;
    margin-top: calc(clamp(420px, 47.22vw, 680px) + 300px);
  }

  /* Заглавный блок */
  .hero-copy p {
    font-size: clamp(18px, 1.665vw, 24px);
  }

  /* Вертикальные ролики */
  .reels-cuboid-scroll {
    --reels-cuboid-width: min(80vw, 1500px, calc(86svh * 2.25));
    --reels-cuboid-stage-height: min(clamp(420px, calc(var(--reels-cuboid-height) * 1.28), 680px), 82svh);
    min-height: var(--reels-cuboid-stage-height);
    /* margin-top: clamp(72px, 5.85vw, 84px); */
    margin-bottom: 0;
  }
}

@media (min-width: 1600px) {
  /* Общие отступы: на большом стационарном Mac блоки разводим шире, 1440 не трогаем */
  :root {
    --resheno-section-gap: 180px;
  }

  /* Заглавный блок: только на большом стационарном экране поднимаем кубы вместе со следующим потоком */
  .hero-wrapper {
    min-height: calc(clamp(420px, 38.89vw, 560px) + 560px);
  }

  .hero-cubes {
    margin-top: calc(clamp(120px, calc(38.89vw - 300px), 260px) + 300px);
  }
}

@media (max-width: 749px) {

  /* Заглавный блок */
  .hero-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 0;
  }

  .hero-video,
  .hero-cubes,
  .hero-copy {
    grid-area: auto;
  }

  .hero-video {
    order: 1;
    height: clamp(360px, 108vw, 520px);
    opacity: 1;
    -webkit-mask-image: linear-gradient(
      180deg,
      #000000 0%,
      #000000 42%,
      rgba(0, 0, 0, 0.74) 55%,
      rgba(0, 0, 0, 0) 78%,
      rgba(0, 0, 0, 0) 100%
    );
    mask-image: linear-gradient(
      180deg,
      #000000 0%,
      #000000 42%,
      rgba(0, 0, 0, 0.74) 55%,
      rgba(0, 0, 0, 0) 78%,
      rgba(0, 0, 0, 0) 100%
    );
    -webkit-mask-size: 100% 100%;
    mask-size: 100% 100%;
  }

  /* Заглавный блок: плавный переход без черной плашки поверх видео */
  .hero-video::before,
  .hero-video::after {
    display: none;
    content: none;
    background: none;
  }

  .hero-copy {
    order: 2;
    width: calc(100vw - (var(--resheno-edge) * 2));
    max-width: 342px;
    grid-template-columns: minmax(0, 1fr);
    margin-top: calc(clamp(375px, 101vw, 472px) - clamp(360px, 108vw, 520px));
    padding-top: 0;
  }

  .hero-copy p {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    font-size: clamp(15px, 4.15vw, 19px);
  }

  .hero-cubes::before {
    display: none;
    content: none;
    background: none;
  }

  .hero-cubes {
    order: 3;
    align-self: stretch;
    margin-top: clamp(24px, 6vw, 44px);
  }

  .hero-cubes img {
    width: 180%;
    max-width: none;
    margin-left: -40%;
  }

  /* Ссылка на выпуск */
  .production-wrapper {
    padding-top: var(--resheno-section-gap);
  }

  .watch-link {
    width: 100%;
  }

  /* Вертикальные ролики */
  .reels-wrapper {
    margin-top: 0;
    /* padding-top: var(--resheno-section-gap); */
    padding-top: 0;
    padding-bottom: 0;
    background: var(--resheno-black);
    transform: translateZ(0);
  }

  .reels-lead {
    margin-bottom: clamp(11px, 1.5vw, 21px);
  }

  .reels-cuboid-scroll {
    --reels-cuboid-width: min(96vw, calc(88svh * 1.72));
    --reels-cuboid-height: calc(var(--reels-cuboid-width) / 1.72);
    --reels-cuboid-depth: calc(var(--reels-cuboid-height) * 0.82);
    --reels-cuboid-stage-height: min(clamp(285px, calc(var(--reels-cuboid-height) * 1.28), 420px), 70svh);
    min-height: var(--reels-cuboid-stage-height);
    /* margin-top: clamp(5px, 1.6vw, 9px); */
    margin-bottom: 0;
    padding-block: clamp(8px, 1.2vw, 17px);
  }

  @media (min-width: 400px) {
    .reels-cuboid-scroll {
      --reels-cuboid-width: min(92vw, calc(88svh * 1.72));
    }
  }

  @media (min-width: 600px) {
    .reels-cuboid-scroll {
      --reels-cuboid-width: min(88vw, calc(88svh * 1.72));
    }
  }

  @media (min-width: 700px) {
    .reels-cuboid-scroll {
      --reels-cuboid-width: min(84vw, calc(88svh * 1.72));
    }
  }

  .reels-cuboid {
    width: 100%;
    height: var(--reels-cuboid-stage-height);
  }

  .reels-cuboid__scene {
    perspective: clamp(720px, 180vw, 980px);
  }


  /* Графика */
  .graphics-wrapper {
    padding-top: var(--resheno-section-gap);
  }
}