.avene-case {
  background: #f0f3f8;
  color: #000;
}

.scene-avene-hero .cian-followup-title { top: calc(806 * var(--follow-unit)); }

.scene-water-html .cian-followup-title {
  top: calc(806 * var(--follow-unit));
  left: 50%;
  transform: translate(-50%, -100%);
  text-align: center;
  white-space: nowrap;
}

.avene-hero-work .cian-followup-work {
  top: calc(712 * var(--follow-unit));
  border-color: #5e6a7d;
}

.avene-creative { left: calc(827 * var(--follow-unit)); }
.avene-production { right: calc(119 * var(--follow-unit)); }

.avene-hero-visual {
  --visual-unit: var(--follow-unit);
  position: absolute;
  top: calc(55 * var(--visual-unit));
  left: calc(120 * var(--visual-unit));
  width: calc(1560 * var(--visual-unit));
  height: calc(613 * var(--visual-unit));
}

.avene-hero-panel {
  position: absolute;
  inset: calc(65 * var(--visual-unit)) 0 0;
  border-radius: calc(28 * var(--visual-unit));
  background: #fff;
}

.avene-hero-presenter {
  position: absolute;
  top: 0;
  left: calc(377 * var(--visual-unit));
  width: calc(766 * var(--visual-unit));
  height: 100%;
}

.avene-products, .avene-card-board {
  position: absolute;
  top: calc(120 * var(--follow-unit));
  height: calc(650 * var(--follow-unit));
  overflow: hidden;
  border-radius: calc(28 * var(--follow-unit));
  background: #fff;
}

.avene-products {
  left: calc(120 * var(--follow-unit));
  width: calc(527 * var(--follow-unit));
}

.avene-products > img {
  position: absolute;
  top: -1.692%;
  left: 12.334%;
  width: 75.332%;
  height: 111.385%;
}

.avene-card-board {
  --card-unit: var(--follow-unit);
  --card-step: 5.2s;
  left: calc(672 * var(--follow-unit));
  width: calc(1008 * var(--card-unit));
}

/* One position per card in the loop. The depth changes happen between cards. */
.avene-carousel-card {
  position: absolute;
  top: 50%;
  left: 50%;
  width: calc(368 * var(--card-unit));
  height: auto;
  translate: -50% -50%;
  border-radius: calc(17 * var(--card-unit));
  background: #f7f6f6;
  animation-name: avene-card-orbit, avene-card-depth;
  animation-duration: calc(7 * var(--card-step));
  animation-delay: calc(-1 * var(--card-step) * var(--card-phase));
  animation-timing-function: linear, step-end;
  animation-iteration-count: infinite;
  animation-play-state: paused;
}

@media (prefers-reduced-motion: no-preference) {
  .scene-avene-gallery[data-active] .avene-carousel-card { animation-play-state: running; }
}

@keyframes avene-card-orbit {
  0%, 100% {
    transform: translateX(0) scale(1);
    opacity: 1;
    animation-timing-function: cubic-bezier(.37, .1, .65, .51);
  }

  7.142857% {
    transform: translateX(-47.5%) scale(.925);
    opacity: 1;
    animation-timing-function: cubic-bezier(.27, .63, .61, .9);
  }

  14.285714% {
    transform: translateX(-75%) scale(.794);
    opacity: 1;
    animation-timing-function: cubic-bezier(.32, .16, .64, .62);
  }

  21.428571% {
    transform: translateX(-89%) scale(.745);
    opacity: .5;
    animation-timing-function: cubic-bezier(.18, .66, .6, 1);
  }

  28.571429% {
    transform: translateX(-95%) scale(.71);
    opacity: 0;
  }

  71.428571% {
    transform: translateX(95%) scale(.71);
    opacity: 0;
    animation-timing-function: cubic-bezier(.4, 0, .82, .34);
  }

  78.571429% {
    transform: translateX(89%) scale(.745);
    opacity: .5;
    animation-timing-function: cubic-bezier(.36, .38, .68, .84);
  }

  85.714286% {
    transform: translateX(75%) scale(.794);
    opacity: 1;
    animation-timing-function: cubic-bezier(.39, .1, .73, .37);
  }

  92.857143% {
    transform: translateX(47.5%) scale(.925);
    opacity: 1;
    animation-timing-function: cubic-bezier(.35, .49, .63, .9);
  }
}

@keyframes avene-card-depth {
  0%, 92.857143%, 100% { z-index: 3; }
  7.142857%, 78.571429% { z-index: 2; }
  21.428571%, 71.428571% { z-index: 1; }
}

.water-case {
  container-type: size;
  background: linear-gradient(125.122deg, #229bf8 5.09%, #71befb 99.13%);
  color: #fff;
}

#water-cover-title {
  position: absolute;
  top: calc(236 * var(--cian-unit));
  left: calc(132 * var(--cian-unit));
  margin: 0;
  font-size: calc(160 * var(--cian-unit));
  font-weight: 500;
  line-height: .9;
  letter-spacing: -.025em;
}

.scene-water-cover .cian-description { top: calc(584 * var(--cian-unit)); }

.water-bottle {
  position: absolute;
  top: calc(160.25 * var(--cian-unit));
  left: calc(867.08 * var(--cian-unit));
  width: calc(328.22 * var(--cian-unit));
  height: calc(557.99 * var(--cian-unit));
}

.water-bottle > :is(img, canvas, video) {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.water-bottle > :is(canvas, video) { visibility: hidden; }
.water-bottle[data-video-visible] > img { visibility: hidden; }
.water-bottle[data-video-visible] > canvas { visibility: visible; }

.scene-water-cover .cian-tags {
  top: calc(472 * var(--cian-unit));
  left: auto;
  right: calc(113 * var(--cian-unit));
  width: max-content;
}

.scene-water-cover .cian-tag-row { justify-content: center; }
.scene-water-cover .cian-tag { padding-inline: calc(20 * var(--cian-tag-unit)); }

.scene-water-campaign { --note-unit: min(100cqw / 1800, 100cqh / 890); }

.water-campaign-backdrop {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.water-campaign-backdrop > :is(img, video) {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 40% center;
}

.water-campaign-backdrop > video { opacity: 0; }
.water-campaign-backdrop[data-video-visible] > video { opacity: 1; }

.water-campaign-note {
  position: absolute;
  right: calc(40 * var(--note-unit));
  bottom: calc(40 * var(--note-unit));
  display: grid;
  gap: calc(28 * var(--note-unit));
  width: calc(438 * var(--note-unit));
  padding: calc(48 * var(--note-unit));
  border-radius: calc(20 * var(--note-unit));
  background: rgb(0 0 0 / .5);
  backdrop-filter: blur(calc(30 * var(--note-unit)));
  -webkit-backdrop-filter: blur(calc(30 * var(--note-unit)));
}

.water-campaign-note h2 {
  margin: 0;
  font-size: calc(52 * var(--note-unit));
  line-height: 1.05;
  font-weight: 500;
  letter-spacing: -.02885em;
  white-space: nowrap;
}

.water-campaign-note p {
  margin: 0;
  font-size: calc(22 * var(--note-unit));
  line-height: 1.1;
  letter-spacing: -.03746em;
}

.water-kv-work { right: calc(120 * var(--follow-unit)); }

.water-gallery {
  --gallery-unit: var(--follow-unit);
  position: absolute;
  width: calc(var(--gallery-width) * var(--gallery-unit));
  height: calc(var(--gallery-height) * var(--gallery-unit));
}

.water-kv-gallery {
  --gallery-width: 1301;
  --gallery-height: 553.699;
  left: calc(249 * var(--follow-unit));
  top: calc(236 * var(--follow-unit));
}

.water-html-gallery {
  --gallery-width: 1560;
  --gallery-height: 585.357;
  left: calc(120 * var(--follow-unit));
  top: calc(120 * var(--follow-unit));
}

.water-gallery > :is(img, .water-html-video) {
  position: absolute;
  left: calc(var(--art-x) * var(--gallery-unit));
  top: calc(var(--art-y) * var(--gallery-unit));
  width: calc(var(--art-w) * var(--gallery-unit));
  height: calc(var(--art-h) * var(--gallery-unit));
}

.water-html-video {
  --art-y: 0;
  --art-h: 585.357;
  overflow: hidden;
  -webkit-mask: var(--art-mask) center / 100% 100% no-repeat;
  mask: var(--art-mask) center / 100% 100% no-repeat;
}

.water-html-left {
  --art-x: 0;
  --art-w: 827.691;
  --art-delay: 80ms;
  --art-mask: url("assets/ozon/final-cases/html-left-mask.png");
}

.water-html-right {
  --art-x: 738.309;
  --art-w: 821.691;
  --art-delay: 160ms;
  --art-mask: url("assets/ozon/final-cases/html-right-mask.png");
}

.water-html-video > :is(img, video) {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.water-html-video > video { opacity: 0; }
.water-html-video[data-video-visible] > video { opacity: 1; }

.water-kv-hero { border-radius: calc(30.976 * var(--gallery-unit)); }

@media (prefers-reduced-motion: no-preference) {
  .water-case[data-active] .water-gallery > :is(img, .water-html-video) {
    animation: water-gallery-entry 720ms cubic-bezier(.22,.72,.28,1) var(--art-delay) both;
  }

  @keyframes water-gallery-entry {
    from { opacity: 0; transform: translateY(calc(36 * var(--gallery-unit))); }
    to { opacity: 1; transform: translateY(0); }
  }
}

.scene-contacts {
  container-type: size;
  background: #f0f3f8;
  color: #000;
}

.presentation-viewport[data-scene="contacts"] { border-radius: 0; }

.contacts-artboard {
  --contact-unit: min(100cqw / 1920, 100cqh / 1080);
  position: absolute;
  top: 50%;
  left: 50%;
  width: calc(1920 * var(--contact-unit));
  height: calc(1080 * var(--contact-unit));
  transform: translate(-50%, -50%);
}

.contacts-sign {
  position: absolute;
  top: calc(-89 * var(--contact-unit));
  left: calc(166.48 * var(--contact-unit));
  width: calc(444.57 * var(--contact-unit));
  height: calc(1271 * var(--contact-unit));
}

.contacts-sign > img { display: block; width: 100%; height: 100%; }

.contacts-heart-shade {
  position: absolute;
  inset: 0;
  filter: brightness(.5);
  mask: url("assets/ozon/final-cases/contact-heart-mask.svg") center / 100% 100% no-repeat;
  opacity: 0;
  pointer-events: none;
}

@media (prefers-reduced-motion: no-preference) {
  .scene-contacts[data-active] .contacts-heart-shade {
    animation: contacts-heart-blink 7.6s ease-in-out infinite;
  }

  @keyframes contacts-heart-blink {
    0%, 24%, 100% { opacity: 0; }
    54%, 62% { opacity: 1; }
  }
}

.contacts-links {
  position: absolute;
  top: calc(346 * var(--contact-unit));
  left: calc(905 * var(--contact-unit));
  display: grid;
  justify-items: start;
  gap: calc(22 * var(--contact-unit));
}

.contacts-link {
  --contact-hover-motion: 260ms ease;
  display: flex;
  align-items: center;
  gap: calc(10 * var(--contact-unit));
  color: #fff;
  border-radius: calc(100 * var(--contact-unit));
  text-decoration: none;
}

.contacts-link-label {
  padding: calc(10 * var(--contact-unit)) calc(40 * var(--contact-unit)) calc(16 * var(--contact-unit));
  border-radius: inherit;
  background: #000;
  font-size: calc(76 * var(--contact-unit));
  line-height: 1;
  letter-spacing: -.04em;
  transition: background-color var(--contact-hover-motion), color var(--contact-hover-motion);
}

.contacts-link-icon {
  display: grid;
  width: calc(102 * var(--contact-unit));
}

.contacts-link-icon > img { grid-area: 1 / 1; width: 100%; height: auto; }
.contacts-link-icon > img:last-child { opacity: 0; transition: opacity var(--contact-hover-motion); }
.contacts-telegram > .contacts-link-icon {
  width: calc(113.781 * var(--contact-unit));
  margin: calc(-5.89 * var(--contact-unit));
}
.contacts-site { margin-left: calc(91 * var(--contact-unit)); }

.contacts-link:is(:hover, :focus-visible) .contacts-link-label {
  background: #c5f72c;
  color: #000;
}

.contacts-link:is(:hover, :focus-visible) .contacts-link-icon > img:last-child { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  .contacts-link { --contact-hover-motion: 0ms; }
}

.contacts-quote {
  position: absolute;
  left: calc(1069 * var(--contact-unit));
  top: calc(890 * var(--contact-unit));
  display: flex;
  align-items: center;
  gap: calc(22 * var(--contact-unit));
  margin: 0;
  font-size: calc(24 * var(--contact-unit));
  line-height: 1.1;
  letter-spacing: -.025em;
}

.contacts-quote img { width: calc(46 * var(--contact-unit)); height: auto; }

@media (orientation: portrait) {
  :is(.scene-avene-hero, .scene-avene-gallery, .scene-water-kv, .scene-water-html) .cian-followup-artboard {
    align-content: center;
    justify-items: stretch;
    gap: min(5cqw, 3cqh);
  }

  .avene-hero-visual {
    --visual-unit: min(88cqw / 890, 49cqh / 613);
    position: relative;
    inset: auto;
    width: calc(890 * var(--visual-unit));
    grid-row: 1;
    justify-self: center;
  }

  .avene-hero-presenter { left: calc(62 * var(--visual-unit)); }

  .scene-avene-hero .cian-followup-title,
  .avene-hero-work .cian-followup-work { position: static; }

  .scene-water-html .cian-followup-title {
    position: static;
    transform: none;
    white-space: normal;
  }

  .avene-hero-work { display: grid; gap: min(3cqw, 2cqh); }

  .avene-products, .avene-card-board {
    position: relative;
    inset: auto;
    justify-self: center;
    border-radius: min(5cqw, 20px);
  }

  .avene-products {
    width: min(88cqw, 45cqh);
    height: min(65cqw, 42cqh);
  }

  .avene-products > img { object-fit: contain; object-position: center bottom; }

  .avene-card-board {
    --card-unit: min(88cqw / 1008, 41cqh / 650);
    height: calc(650 * var(--card-unit));
  }

  #water-cover-title {
    position: static;
    font-size: min(15cqw, 9.5cqh, 125px);
  }

  .water-bottle {
    position: relative;
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
  }

  .scene-water-cover .cian-tags { position: static; }

  .scene-water-campaign {
    --note-unit: min(86cqw / 438, 40cqh / 354);
    --campaign-media-height: min(72cqh, 148cqw);
  }

  .water-campaign-backdrop { height: var(--campaign-media-height); }
  .water-campaign-backdrop > :is(img, video) {
    /* The billboard center is to the left of the source frame center. */
    object-position: calc(50% + .205 * var(--campaign-media-height)) 45%;
  }

  .water-campaign-note {
    right: 7cqw;
    bottom: min(7cqw, 4cqh);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .water-gallery {
    --gallery-unit: min(88cqw / var(--gallery-width), 47cqh / var(--gallery-height));
    position: relative;
    inset: auto;
    justify-self: center;
  }

  .water-kv-gallery { grid-row: 2; }

  .water-html-gallery {
    --video-gap: min(3cqw, 14px);
    grid-row: 1;
    display: grid;
    gap: var(--video-gap);
    width: min(88cqw, (60cqh - var(--video-gap)) * 960 / 1136);
    height: auto;
  }

  .water-html-gallery > .water-html-video {
    position: relative;
    inset: auto;
    width: 100%;
    height: auto;
    aspect-ratio: 960 / 568;
    border-radius: min(4cqw, 20px);
    -webkit-mask: none;
    mask: none;
  }

  .contacts-artboard {
    --contact-unit: min(85cqw / 722, 29cqh / 350);
    inset: 0;
    width: auto;
    height: auto;
    display: grid;
    justify-items: center;
    align-content: center;
    gap: min(5cqw, 3cqh);
    padding: min(6cqw, 4cqh);
    transform: none;
  }

  .contacts-sign {
    position: relative;
    inset: auto;
    width: auto;
    max-width: 72cqw;
    height: min(98cqw, 48cqh);
    aspect-ratio: 769 / 2200;
  }

  .contacts-links, .contacts-quote { position: static; }
  .contacts-link-label { font-size: max(16px, 76 * var(--contact-unit)); }
  .contacts-quote { font-size: max(12px, 24 * var(--contact-unit)); }
}
