.x5-case {
  container-type: size;
  background: #00ab44;
  color: #fff;
}

#x5-title {
  position: absolute;
  top: calc(278 * var(--cian-unit));
  left: calc(132 * var(--cian-unit));
  margin: 0;
  font-size: calc(180 * var(--cian-unit));
  font-weight: 500;
  line-height: .9;
  letter-spacing: -.02222em;
}

.x5-cover-visual {
  position: absolute;
  top: calc(143 * var(--cian-unit));
  left: calc(466 * var(--cian-unit));
  width: calc(812 * var(--cian-unit));
  aspect-ratio: 772 / 594;
  pointer-events: none;
}

.x5-cover-visual > :is(img, canvas) { object-fit: contain; }

.x5-cover-visual > canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  visibility: hidden;
}

.x5-cover-visual[data-video-visible] > canvas { visibility: visible; }
.x5-cover-visual[data-video-visible] > img { visibility: hidden; }
.x5-cover-visual[data-video-visible] > video { opacity: 0; }

.scene-x5 .cian-tags {
  top: calc(329 * var(--cian-unit));
  left: auto;
  right: calc(106 * var(--cian-unit));
  width: max-content;
}

.scene-x5 .cian-tag-row { justify-content: center; }
.scene-x5 .cian-tag { padding-inline: calc(20 * var(--cian-tag-unit)); }

.scene-x5-winter .cian-followup-title {
  top: calc(477 * var(--follow-unit));
  left: calc(1122 * var(--follow-unit));
}

.scene-x5-winter .cian-followup-work {
  top: calc(559 * var(--follow-unit));
  right: calc(119 * var(--follow-unit));
  min-height: calc(103 * var(--follow-unit));
}

.x5-winter-visual {
  position: absolute;
  top: calc(82 * var(--follow-unit));
  left: calc(160 * var(--follow-unit));
  width: calc(818 * var(--follow-unit));
  height: calc(875 * var(--follow-unit));
  overflow: hidden;
}

.x5-winter-visual img {
  display: block;
  width: 100.73%;
  height: 100%;
  margin-left: -.73%;
}

.scene-x5-bus { background: #0caeff; }
.x5-bus-media { position: absolute; inset: 0; overflow: hidden; }

.scene-x5-summer .cian-followup-title { top: calc(806 * var(--follow-unit)); }

.x5-summer-work .cian-followup-work {
  top: calc(724 * var(--follow-unit));
  min-height: calc(55 * var(--follow-unit));
}

.x5-summer-work-creative { right: calc(535 * var(--follow-unit)); }
.x5-summer-work-production { right: calc(120 * var(--follow-unit)); }

.x5-summer-visual {
  --summer-unit: var(--follow-unit);
  position: absolute;
  top: calc(20 * var(--follow-unit));
  left: calc(120 * var(--follow-unit));
  width: calc(1560 * var(--summer-unit));
  height: calc(648 * var(--summer-unit));
}

.x5-summer-frame {
  position: absolute;
  top: calc(100 * var(--summer-unit));
  width: 100%;
  height: calc(548 * var(--summer-unit));
  overflow: hidden;
  border-radius: calc(28 * var(--summer-unit));
  background: #70a3d8;
}

.x5-summer-frame img {
  position: absolute;
  /* Match the photographed sign to the cutout at the top edge of the frame. */
  top: calc(-191.835 * var(--summer-unit));
  left: calc(-4.843 * var(--summer-unit));
  width: calc(1569.144 * var(--summer-unit));
  height: calc(899.931 * var(--summer-unit));
  max-width: none;
}

.x5-summer-billboard {
  position: absolute;
  top: 0;
  left: calc(330.04 * var(--summer-unit));
  width: calc(920.921 * var(--summer-unit));
  height: calc(577 * var(--summer-unit));
}

.x5-summer-billboard > :is(img, video) { object-fit: fill; }

.x5-summer-billboard > video {
  /* Match the four inside corners of the bezel to the perspective-corrected video. */
  clip-path: polygon(1.194% 21.924%, 97.611% 2.253%, 97.883% 89.341%, .977% 97.920%);
}

@media (orientation: portrait) {
  #x5-title {
    position: static;
    font-size: min(16cqw, 11cqh, 125px);
  }

  .x5-cover-visual {
    position: relative;
    inset: auto;
    align-self: stretch;
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    aspect-ratio: auto;
  }

  .scene-x5 .cian-tags { position: static; }

  .scene-x5-winter .cian-followup-artboard {
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr);
    gap: min(4cqw, 3cqh);
    padding-bottom: 0;
  }

  .scene-x5-winter :is(.cian-followup-title, .cian-followup-work) { position: static; }

  .x5-winter-visual {
    position: static;
    width: 100%;
    height: 100%;
  }

  .x5-winter-visual img {
    width: 100%;
    margin: 0;
    object-fit: contain;
    object-position: center bottom;
  }

  .scene-x5-bus {
    display: grid;
    place-items: center;
    background: #293823;
  }

  .scene-x5-bus::before {
    content: '';
    position: absolute;
    inset: -20px;
    background: url('assets/ozon/x5/bus-station-poster.avif') center / cover no-repeat;
    filter: blur(20px) brightness(.66);
  }

  .x5-bus-media {
    position: relative;
    inset: auto;
    width: 100%;
    aspect-ratio: 1.18;
    max-height: 100%;
  }

  .scene-x5-summer .cian-followup-artboard {
    display: grid;
    align-content: center;
    justify-items: start;
    gap: min(5cqw, 4cqh);
  }

  .x5-summer-visual {
    --summer-unit: min(86cqw / 1120, 48cqh / 648);
    position: relative;
    inset: auto;
    width: calc(1120 * var(--summer-unit));
    grid-row: 1;
    justify-self: center;
  }

  .x5-summer-frame img { left: calc(-224.843 * var(--summer-unit)); }
  .x5-summer-billboard { left: calc(110.04 * var(--summer-unit)); }

  .scene-x5-summer .cian-followup-title,
  .x5-summer-work .cian-followup-work { position: static; }

  .x5-summer-work { display: grid; gap: min(3cqw, 2cqh); }
}
