/* ОСЬ — слоистая глубина. Кадр во всю ширину, текст между планами. */

.section--depth { padding-left: 0; padding-right: 0; }

.depth__stage {
  position: relative;
  height: clamp(540px, 86vh, 920px);
  overflow: hidden;
  isolation: isolate;
  background: var(--ink);
}
.depth--tall .depth__stage { height: clamp(600px, 100vh, 1040px); }

.depth__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.depth__back {
  position: absolute;
  inset: -14% 0;
  z-index: 0;
  will-change: transform;
}

/* Подложка под текст: без неё серебро теряется на светлых местах кадра. */
.depth__veil {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(8, 8, 9, 0.92) 0%, rgba(8, 8, 9, 0.78) 26%, rgba(8, 8, 9, 0.34) 52%, rgba(8, 8, 9, 0) 76%),
    linear-gradient(180deg, rgba(8, 8, 9, 0.5) 0%, rgba(8, 8, 9, 0) 34%, rgba(8, 8, 9, 0.72) 100%);
}

.depth__type {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  align-content: center;
  will-change: transform;
}
.depth__type .wrap { width: 100%; }
.depth__type .section__head { max-width: 34ch; }

/* Передний слой — разметка бренда: круг, ось и волосяная линия. Она идёт
   быстрее всего и перекрывает заголовок, за счёт этого и читается объём.
   Фотография в этой роли двоилась: внизу кадра те же объекты, что в центре. */
.depth__mark {
  position: absolute;
  inset: -12% -8%;
  z-index: 3;
  color: var(--white);
  pointer-events: none;
  will-change: transform;
  mix-blend-mode: screen;
}
.depth__mark svg { width: 100%; height: 100%; display: block; }

/* Настоящий ближний план: предмет, снятый отдельно на ровном фоне и
   вырезанный. Он идёт быстрее всех и перекрывает заголовок — именно это
   даёт объём, которого не добиться копией самого кадра. */
.depth__plate {
  position: absolute;
  left: 50%;
  width: var(--plate-zoom, 118%);
  translate: -50% 0;
  z-index: 4;
  pointer-events: none;
  will-change: transform;
}
.depth__plate--bottom { bottom: calc(-1 * var(--plate-offset, 10%)); }
.depth__plate--top { top: calc(-1 * var(--plate-offset, 10%)); }
.depth__plateimg { width: 100%; height: auto; display: block; }
.depth__plate--bottom .depth__plateimg { filter: drop-shadow(0 -18px 34px rgba(0, 0, 0, 0.45)); }
.depth__plate--top .depth__plateimg { filter: drop-shadow(0 18px 34px rgba(0, 0, 0, 0.45)); }

/* --- появление заголовка --------------------------------------------------- */

.depth .section__head > * {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.8s var(--ease-out), transform 0.9s var(--ease-out);
}
.depth.is-lit .section__head > * { opacity: 1; transform: none; }
.depth.is-lit .section__head > *:nth-child(2) { transition-delay: 0.08s; }
.depth.is-lit .section__head > *:nth-child(3) { transition-delay: 0.16s; }
.depth.is-lit .section__head > *:nth-child(4) { transition-delay: 0.24s; }

/* Тонкая ось прочерчивается под заголовком. */
.depth .section__head::after {
  content: '';
  display: block;
  height: 1px;
  margin-top: clamp(16px, 2vw, 28px);
  background: var(--sheen-edge);
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform 1.1s var(--ease-out) 0.3s;
}
.depth.is-lit .section__head::after { transform: scaleX(1); }

/* Тело секции под сценой живёт по обычным правилам страницы. */
.depth__body { padding-top: clamp(48px, 7vh, 96px); }

@media (max-width: 860px) {
  .depth__stage { height: clamp(460px, 72vh, 680px); }

  /* Край кадра растворяется, а не обрывается.
     На широком экране сцена — полоса во всю ширину, и резкая граница
     сверху и снизу читается как намеренная рамка. На телефоне та же
     граница легла поперёк узкого экрана и стала похожа на обрубок:
     чёрное поле, линейка, сразу люди. Растворяем края самого снимка —
     текст поверх него при этом остаётся плотным, маска на нём не лежит. */
  .depth__back {
    inset: -9% 0;
    -webkit-mask-image: linear-gradient(180deg,
      transparent 0%, #000 13%, #000 86%, transparent 100%);
            mask-image: linear-gradient(180deg,
      transparent 0%, #000 13%, #000 86%, transparent 100%);
  }
  .depth__veil {
    background: linear-gradient(180deg, rgba(8, 8, 9, 0.72) 0%, rgba(8, 8, 9, 0.25) 44%, rgba(8, 8, 9, 0.8) 100%);
  }
  .depth__mark { inset: -8% -14%; }
}

@media (prefers-reduced-motion: reduce) {
  .depth__back, .depth__type, .depth__mark, .depth__plate { transform: none !important; }
  .depth .section__head > * { opacity: 1; transform: none; }
  .depth .section__head::after { transform: scaleX(1); }
}
