/* =========================================================
   Screen 04 — «Витрина опыта» (light, asymmetric evidence gallery)
   ========================================================= */

.s04 {
  padding: clamp(44px, 4.2vw, 60px) 0 clamp(28px, 2.4vw, 34px);
  background: var(--paper-3);
  color: var(--ink-2);
}
.s04__rings {
  position: absolute;
  z-index: 0;
  inset: 0;
  pointer-events: none;
}
.s04__rings i {
  position: absolute;
  border: 1px solid rgba(217, 211, 203, .48);
  border-radius: 50%;
}
.s04__rings i:nth-child(1) { right: -84px; top: -42px; width: 328px; height: 328px; }
.s04__rings i:nth-child(2) { right: -126px; top: -84px; width: 412px; height: 412px; }
.s04__rings i:nth-child(3) { left: -110px; bottom: -145px; width: 360px; height: 360px; }

.s04__inner { position: relative; z-index: 1; }

/* — head + Yandex mark — */
.s04__head { position: relative; padding-right: clamp(0px, 24vw - 190px, 330px); }
.s04__title {
  margin: clamp(22px, 2.4vw, 34px) 0 clamp(16px, 1.9vw, 28px);
  max-width: 14em;
  font-size: clamp(34px, 3.75vw, 54px);
  line-height: 1.07;
  letter-spacing: -.03em;
}
.s04__lead { max-width: 640px; font-size: clamp(16px, .55vw + 12px, 20px); line-height: 1.38; }

.ya {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: 0;
  margin: 0;
  line-height: 1;
  white-space: nowrap;
}
.ya__y { font-size: 38px; font-weight: 800; color: #ef3124; letter-spacing: -.02em; }
.ya__word { font-size: 31px; font-weight: 700; color: #19191b; letter-spacing: -.01em; margin-left: 1px; }
.ya__channels {
  flex-basis: 100%;
  margin-top: 8px;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #6a6763;
}
.s04__head .ya { position: absolute; right: 0; top: -6px; }

/* — collage — */
.gallery {
  position: relative;
  margin-top: clamp(24px, 2.4vw, 34px);
  padding: 8.1% 0 1.6%;
}
.gallery__rail { display: none; }
.sheet {
  --rot: 0deg;
  position: absolute;
  box-sizing: border-box;
  padding: clamp(10px, 1vw, 14px);
  border-radius: 3px;
  background: #fffefa;
  color: var(--ink-2);
  transform: rotate(var(--rot));
  transform-origin: 50% 50%;
  box-shadow: 8px 13px 0 rgba(23, 23, 25, .16), 0 24px 50px -24px rgba(23, 23, 25, .28);
  transition: transform .18s ease, box-shadow .18s ease;
}
.sheet:hover,
.sheet:focus-within {
  transform: rotate(var(--rot)) translateY(-2px);
  box-shadow: 8px 15px 0 rgba(23, 23, 25, .18), 0 28px 56px -22px rgba(23, 23, 25, .34);
}
.sheet--doma { left: 0; top: 1.5%; width: 47.8%; --rot: -1.45deg; z-index: 1; }
.sheet--cruxa { position: relative; margin: 0 0 0 28.9%; width: 42.9%; --rot: 1.15deg; z-index: 2; }
.sheet--crm { left: 71.8%; top: 0; width: 28.2%; --rot: 1.75deg; z-index: 1; }
.sheet--doma .sheet__caption { max-width: 62%; }

.sheet__media {
  position: relative;
  overflow: hidden;
  border-radius: 2px;
  background: #ecebe7;
}
.sheet__media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.sheet--doma .sheet__media { aspect-ratio: 592 / 335; }
.sheet--doma .sheet__media img { object-position: 50% 0; }
.sheet--cruxa .sheet__media { aspect-ratio: 528 / 276; }
.sheet--crm .sheet__media { aspect-ratio: 332 / 340; }

.sheet__caption { margin-top: clamp(12px, 1.3vw, 18px); }
.sheet__caption::before {
  content: "";
  display: block;
  width: 42px;
  height: 3px;
  margin-bottom: clamp(10px, 1.1vw, 16px);
  background: var(--red);
}
.sheet__kicker {
  margin: 0;
  font-size: clamp(11.5px, .2vw + 10px, 13px);
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--red);
  white-space: nowrap;
}
.sheet__title {
  margin: 4px 0 0;
  font-size: clamp(15px, .6vw + 11px, 20px);
  font-weight: 700;
  line-height: 1.2;
  color: #18181a;
  text-wrap: pretty;
}
.sheet__caption--row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px 18px;
}
.sheet__caption--row::before { flex-basis: 100%; }
.sheet__caption--row .sheet__title { margin-top: 0; font-size: clamp(15px, .5vw + 11px, 18px); }
.sheet__caption .only-mobile { display: none; }

/* — bottom chain — */
.chain {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: clamp(48px, 7vw, 100px);
  align-items: start;
  margin-top: clamp(30px, 3.4vw, 46px);
}
.chain__track {
  position: relative;
  height: 56px;
  margin-left: 6px;
}
.chain__track::before {
  content: "";
  position: absolute;
  left: -6px;
  right: calc(-1 * clamp(48px, 7vw, 100px) + 8px);
  top: 5px;
  height: 1.5px;
  background: #d7d1ca;
}
.chain__track::after {
  content: "";
  position: absolute;
  left: -6px;
  right: 0;
  top: 4.5px;
  height: 2.2px;
  background: var(--red);
  opacity: .82;
}
.chain__stop {
  position: absolute;
  top: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  transform: translateX(-50%);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #686460;
  white-space: nowrap;
}
.chain__stop::before {
  content: "";
  width: 12px;
  height: 12px;
  box-sizing: border-box;
  border: 2.2px solid var(--red);
  border-radius: 50%;
  background: var(--paper-3);
  position: relative;
  z-index: 1;
}
.chain__stop:nth-child(1) { left: 0; transform: none; align-items: flex-start; }
.chain__stop:nth-child(1)::before { margin-left: -6px; }
.chain__stop:nth-child(2) { left: 23.8%; }
.chain__stop:nth-child(3) { left: 49.2%; }
.chain__stop:nth-child(4) { left: 74.5%; }
.chain__stop:nth-child(5) { left: 100%; color: #18181a; }
.chain__note { margin: 0; padding-top: 2px; white-space: nowrap; }
.chain__note strong { display: block; font-size: 18px; font-weight: 700; color: #18181a; }
.chain__note span { display: block; margin-top: 4px; font-size: 15px; color: #686460; }
.chain--mobile { display: none; }

/* =========================================================
   Stacked / rail states
   ========================================================= */
@media (max-width: 899px) {
  .s04 { padding: clamp(40px, 6vw, 52px) 0 40px; }
  .s04__head { padding-right: 0; }
  .s04__title { font-size: clamp(34px, 6vw, 46px); }
  .s04__head .ya { position: static; margin-top: 26px; }
  .ya__channels { flex-basis: auto; margin: 0 0 0 16px; align-self: center; }

  .gallery {
    aspect-ratio: auto;
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 30px;
  }
  .gallery__rail {
    display: block;
    position: absolute;
    left: 0;
    top: -4px;
    width: 10px;
    height: calc(100% + 8px);
    overflow: visible;
    pointer-events: none;
  }
  .gallery__rail path { fill: none; stroke: var(--red); stroke-width: 2; opacity: .74; vector-effect: non-scaling-stroke; }
  .gallery { padding: 0 0 0 14px; }
  .sheet {
    --rail-dx: 0px;
    position: relative;
    left: auto;
    top: auto;
    width: auto;
    margin: 0;
    padding: 12px;
    box-shadow: 4px 6px 0 rgba(23, 23, 25, .15), 0 18px 36px -20px rgba(23, 23, 25, .25);
  }
  .sheet::before {
    content: "";
    position: absolute;
    left: calc(-14.5px - var(--rail-dx));
    top: calc(50% - 5.5px);
    width: 11px;
    height: 11px;
    box-sizing: border-box;
    border: 2.2px solid var(--red);
    border-radius: 50%;
    background: var(--paper-3);
  }
  .sheet--doma { --rot: -.8deg; }
  .sheet--cruxa { --rot: .75deg; margin-left: 6%; --rail-dx: 6vw; }
  .sheet--crm { --rot: -.7deg; }
  .sheet--doma .sheet__caption { max-width: none; }
  .sheet--doma .sheet__media { aspect-ratio: 326 / 101; }
  .sheet--cruxa .sheet__media { aspect-ratio: 305 / 98; }
  .sheet--crm .sheet__media { aspect-ratio: 326 / 96; }
  .sheet__caption { margin-top: 12px; display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 18px; }
  .sheet__caption::before { display: none; }
  .sheet__title { margin-top: 0; font-size: 15.5px; }
  .sheet__caption--row .sheet__title { font-size: 15px; }

  .chain { grid-template-columns: minmax(0, 1fr); row-gap: 22px; margin-top: 40px; }
  .chain__track { margin-right: 52px; }
  .chain__track::before { right: -52px; }
}

@media (max-width: 599px) {
  .s04 { padding: 34px 0 40px; }
  .s04__title { margin: 18px 0 14px; font-size: 34px; line-height: 1.15; letter-spacing: -.02em; }
  .s04__lead { font-size: 16px; }
  .s04__head .ya { margin-top: 22px; }
  .ya__y { font-size: 35px; }
  .ya__word { font-size: 27px; }
  .ya__channels { font-size: 11.5px; letter-spacing: .08em; margin-left: 12px; }
  .gallery { margin-top: 26px; gap: 8px; }
  .sheet--cruxa { --rail-dx: 21px; }
  .sheet__caption .only-desktop { display: none; }
  .sheet__caption .only-mobile { display: inline; }
  .chain { display: none; }
  .chain--mobile {
    display: block;
    margin: 30px 0 0;
    font-size: 16.5px;
    font-weight: 700;
    color: #18181a;
    text-wrap: balance;
  }
}
