.scene-cian, .scene-baltika {
  container-type: size;
  background: #0054fd;
  color: #fff;
}
.scene-baltika { background: #0caeff; }

.cian-artboard {
  --cian-unit: min(100cqw / 1800, 100cqh / 890);
  --cian-tag-unit: var(--cian-unit);
  position: absolute;
  top: 50%;
  left: 50%;
  width: calc(1800 * var(--cian-unit));
  height: calc(890 * var(--cian-unit));
  transform: translate(-50%, -50%);
}

:is(#cian-headline, #baltika-headline) {
  position: absolute;
  left: calc(353.5 * var(--cian-unit));
  top: calc(278 * var(--cian-unit));
  transform: translateX(-50%);
  margin: 0;
  font-size: calc(180 * var(--cian-unit));
  font-weight: 500;
  line-height: .9;
  letter-spacing: -.02222em;
}
#baltika-headline {
  left: calc(132 * var(--cian-unit));
  transform: none;
}

.baltika-visual {
  position: absolute;
  left: calc(865 * var(--cian-unit));
  top: calc(122 * var(--cian-unit));
  width: calc(330 * var(--cian-unit));
  height: calc(695 * var(--cian-unit));
  pointer-events: none;
}

.baltika-visual :is(img, canvas) {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  /* The export keeps the full rotation inside the frame. Scale both axes equally to match the resting pose. */
  transform: scale(1.192);
}
.baltika-visual canvas,
.baltika-visual[data-render="canvas"] img { visibility: hidden; }
.baltika-visual[data-render="canvas"] canvas { visibility: visible; }

.scene-baltika .cian-tag { padding-inline: calc(20 * var(--cian-tag-unit)); }

.cian-description {
  position: absolute;
  left: calc(144 * var(--cian-unit));
  top: calc(500 * var(--cian-unit));
  margin: 0;
  font-size: calc(32 * var(--cian-unit));
  line-height: 1.1;
  letter-spacing: -.03125em;
}

.cian-visual {
  position: absolute;
  left: calc(610 * var(--cian-unit));
  top: calc(118 * var(--cian-unit));
  width: calc(581 * var(--cian-unit));
  height: calc(653 * var(--cian-unit));
  overflow: hidden;
  pointer-events: none;
}

.cian-visual img {
  position: absolute;
  inset: 2.12% 0 auto;
  width: 100%;
  height: 97.9%;
}

.cian-tags {
  position: absolute;
  left: calc(1202 * var(--cian-unit));
  top: calc(299 * var(--cian-unit));
  width: calc(505 * var(--cian-tag-unit));
  font-size: calc(32 * var(--cian-tag-unit));
  line-height: 1.1;
  letter-spacing: -.03125em;
}

.cian-tag-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--cian-tag-unit);
}

.cian-tag-row:nth-child(2) { justify-content: flex-start; }

.cian-tag, .cian-tag-icon {
  display: grid;
  place-items: center;
  flex: none;
  height: calc(47 * var(--cian-tag-unit));
}

.cian-tag, .cian-tag-branding {
  border: calc(2 * var(--cian-tag-unit)) solid currentColor;
  border-radius: 100px;
}

.cian-tag {
  padding-inline: calc(18 * var(--cian-tag-unit));
  white-space: nowrap;
}

.cian-tag-icon {
  position: relative;
  width: calc(47 * var(--cian-tag-unit));
}

.cian-tag-icon img {
  position: absolute;
  top: 0;
  left: 50%;
  width: calc(47 * var(--cian-tag-unit));
  height: auto;
  transform: translateX(-50%);
}

.cian-tag-branding img {
  position: static;
  width: calc(26 * var(--cian-tag-unit));
  transform: none;
}

.cian-tag-sign img { width: calc(60.2832 * var(--cian-tag-unit)); }

@media (orientation: portrait) {
  .cian-artboard {
    --cian-tag-unit: min(1.2px, 100cqw / 610, 100cqh / 770);
    inset: 0;
    width: auto;
    height: auto;
    transform: none;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    justify-items: center;
    gap: clamp(10px, 2.5cqh, 28px);
    padding: min(7cqw, 5cqh) 7cqw;
  }

  .cian-copy { justify-self: start; }
  :is(#cian-headline, #baltika-headline), .cian-description, .cian-visual, .cian-tags { position: static; }

  :is(#cian-headline, #baltika-headline) {
    transform: none;
    font-size: min(16cqw, 11cqh, 125px);
  }

  .cian-description {
    margin-top: clamp(8px, 1.8cqh, 24px);
    font-size: min(4.4cqw, 3.6cqh, 32px);
  }

  .cian-visual {
    width: min(100%, 660px);
    height: 100%;
  }

  .cian-visual img {
    position: static;
    height: 100%;
    object-fit: contain;
  }

  .baltika-visual {
    position: relative;
    inset: auto;
    width: 100%;
    height: 100%;
  }
}
