/* =========================================================
   Кейс Wildberries — фрейм 105:5
   Дополняет styles.css: токены, шрифты, .nav, .footer оттуда.
   ========================================================= */

.case-page { --cshell: 1280px; }
.case-page #top { scroll-margin-top: 0; }

/* ---------- Шапка кейса ---------- */
.chero {
  background: var(--black);
  color: var(--white);
  text-align: center;
  padding: 348px 20px 179px;   /* блок поднят на 50px, низ добран — полотно осталось на месте */
}
.chero__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 85px;
  line-height: 1.1;
}
.chero__sub {
  margin-top: 8px;
  font-size: 42px;
  line-height: 1.1;
}
.chero__claim {
  max-width: 835px;
  margin: 53px auto 0;
  font-size: 32px;
  line-height: 1.15;
}

/* ---------- Полотно ---------- */
.csheet { padding-bottom: 135px; }

.cwrap {
  max-width: var(--cshell);
  margin: 130px auto 0;
  padding: 0 20px;
}
.cwrap:first-child { margin-top: 100px; }

.ctitle {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 48px;
  line-height: 1.1;
  color: var(--black);
}
.cbody {
  margin-top: 30px;
  font-size: 28px;
  line-height: 1.17;
  color: var(--black);
}
.cbody + .cbody { margin-top: 40px; }

.clink { text-decoration: underline; text-underline-offset: 3px; }
.clink:hover { color: var(--green-text); }

.csub { font-weight: 500; font-size: 32px; line-height: 1.15; color: var(--black); }

.ccols {
  display: grid;
  grid-template-columns: 521px 521px;
  gap: 128px;
  margin-top: 81px;
}
.ccol { display: flex; flex-direction: column; gap: 20px; }

.clist { list-style: disc; padding-left: 36px; font-size: 24px; line-height: 1.17; color: var(--black); }
.clist li + li { margin-top: 6px; }

/* находки интервью / решения */
.findings { display: flex; flex-direction: column; gap: 45px; margin-top: 55px; }
.findings--tight { gap: 35px; }
.finding__name { font-weight: 500; font-size: 28px; line-height: 1.15; color: var(--black); }
.finding__text { margin-top: 9px; font-size: 24px; line-height: 1.17; color: var(--black); }

.cfigure { margin: 55px 0 0; }
.cfigure img { width: 100%; max-width: 727px; height: auto; border-radius: 20px; }

/* image 27 / image 28 — по макету стоят справа от текста интервью
   и уходят за правый край полотна, как в Figma */
.cwrap--research { position: relative; }
/* текст держим в колонке 958px, иначе он уезжает под картинки */
.research__text { width: 958px; max-width: 100%; }
/* image 27 / image 28 — от текста до самого края экрана, без скруглений */
.research {
  position: absolute;
  left: 994px;
  right: calc(640px - 50vw);
  top: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 33px;
}
.research img {
  display: block;
  width: 100%;
  max-width: 900px;
  height: auto;
  border-radius: 0;
}

/* ---------- вводные + видео ---------- */
.intro {
  display: grid;
  grid-template-columns: 848px 312px;
  gap: 120px;
  align-items: start;
}
/* «Проблемы пользователей» идут под «вводными», видео стоит справа от обоих */
.ctitle--next { margin-top: 181px; }
.cwrap--cols { margin-top: 81px; }
.intro__video { position: relative; margin: 0; width: 312px; }

/* корпус телефона: рамка 10px, скругления как у мокапов в макете */
.phone {
  position: relative;
  width: 100%;
  padding: 10px;
  border-radius: 44px;
  background: var(--black);
  box-shadow: 0 22px 50px rgba(0, 0, 0, .28), inset 0 0 0 1px rgba(255, 255, 255, .08);
}
.phone video {
  display: block;
  width: 100%;
  aspect-ratio: 624 / 1352;
  object-fit: cover;
  border-radius: 34px;
  background: var(--black);
}

.intro__sound {
  position: absolute;
  right: 22px;
  bottom: 22px;
  padding: 7px 14px 5px;
  border: 0;
  border-radius: 100px;
  background: rgba(18, 18, 18, .6);
  color: var(--white);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.2;
  cursor: pointer;
  backdrop-filter: blur(6px);
  transition: background-color .2s ease;
}
.intro__sound:hover { background: rgba(18, 18, 18, .85); }
.intro__sound[aria-pressed="true"] { background: var(--green-white); color: var(--black); }

/* =========================================================
   Карточка-карусель (121:2062 / 121:2171 / 121:2212)
   Внутренняя раскладка — в координатах макета 1280px,
   переведённых в container query units.
   ========================================================= */
.wcard {
  position: relative;
  width: min(100%, var(--cshell));
  margin: 30px auto 0;
  aspect-ratio: 1280 / var(--card-h);
  background: #f0f0f0;
  border-radius: 50px;
  overflow: hidden;
  container-type: inline-size;
  --px: 0.078125cqw;          /* 1px макета при ширине карточки 1280 */
}

.wcard__head {
  position: absolute;
  left: calc(50 * var(--px));
  top: calc(50 * var(--px));
  width: calc(877 * var(--px));
  color: var(--black);
}
.wcard__title { font-weight: 500; font-size: calc(28 * var(--px)); line-height: 1.15; }
.wcard__text  { margin-top: calc(23 * var(--px)); font-size: calc(24 * var(--px)); line-height: 1.17; }

.wcard__stage { position: absolute; inset: 0; }

.wshot {
  position: absolute;
  margin: 0;
  left: calc(var(--l) * var(--px));
  top: calc(var(--t) * var(--px));
  width: calc(var(--w) * var(--px));
}
.wshot img {
  width: 100%;
  height: calc(var(--h) * var(--px));
  object-fit: contain;
}
.wshot figcaption {
  margin-top: calc(18 * var(--px));
  font-family: var(--font-display);
  font-weight: 700;
  font-size: calc(24 * var(--px));
  line-height: 1.1;
  text-align: center;
  color: var(--black);
}

/* стрелка-указатель: переезжает между слайдами */
.wcard__pointer {
  position: absolute;
  left: calc(var(--l) * var(--px));
  top: calc(var(--t) * var(--px));
  width: calc(var(--w) * var(--px));
  height: calc(var(--h) * var(--px));
  transform: scaleX(var(--flip, 1));
  transition: left .55s cubic-bezier(.65, .05, .36, 1),
              top .55s cubic-bezier(.65, .05, .36, 1),
              width .55s cubic-bezier(.65, .05, .36, 1),
              height .55s cubic-bezier(.65, .05, .36, 1),
              transform .55s cubic-bezier(.65, .05, .36, 1),
              opacity .25s ease;
  pointer-events: none;
}

/* кнопки листания (121:2046 / 121:2105) */
.wnav {
  position: absolute;
  top: calc(var(--nav-t, 591) * var(--px));
  width: calc(50 * var(--px));
  height: calc(50 * var(--px));
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--white) no-repeat center / calc(11 * var(--px)) calc(21 * var(--px));
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 21' fill='none'%3E%3Cpath d='M1 1L9 10.5L1 20' stroke='%23121212' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  box-shadow: 0 4px 14px rgba(0, 0, 0, .12);
  cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease;
}
.wnav:hover { transform: scale(1.08); box-shadow: 0 6px 20px rgba(0, 0, 0, .18); }
.wnav--prev { left: calc(80 * var(--px)); rotate: 180deg; }
.wnav--next { left: calc(1200 * var(--px)); }

/* точки (121:2050) */
.wdots {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(53 * var(--px));
  display: flex;
  gap: calc(13 * var(--px));
}
.wdot {
  width: calc(15 * var(--px));
  height: calc(15 * var(--px));
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #d9d9d9;
  cursor: pointer;
  transition: background-color .3s ease, transform .3s ease;
}
.wdot[aria-selected="true"] { background: var(--green-white); transform: scale(1.05); }

.wcard.is-static + .wcard.is-static,
.wcard + .wcard.is-static { margin-top: 50px; }

/* карточка с одним слайдом — управление не нужно */
.wcard.is-static .wnav,
.wcard.is-static .wdots { display: none; }

/* экраны статичны — гаснет только подпись */
.wcard.is-swapping .wcard__head { opacity: 0; }
.wcard__head { transition: opacity .25s ease; }

/* =========================================================
   Подвал кейса
   ========================================================= */
.cfooter { padding-top: 112px; text-align: center; }

.cnext { display: inline-block; }
.cnext__label { display: block; font-size: 28px; line-height: 1.15; color: var(--green-white); }
.cnext__name {
  display: block;
  margin-top: 55px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 85px;
  line-height: 1.1;
}
.cnext__sub { display: block; margin-top: 8px; font-size: 42px; line-height: 1.1; }
.cnext:hover .cnext__name { color: var(--green-white); }
.cnext__name { transition: color .2s ease; }

.cfooter .footer__line { margin-top: 121px; }

/* =========================================================
   Адаптив
   ========================================================= */
@media (max-width: 1700px) {
  /* на узком экране картинки исследования уходят под текст */
  .research {
    position: static;
    align-items: stretch;
    margin-top: 55px;
  }
  .research img { max-width: none; }
  .research__text { width: 100%; }
}
@media (max-width: 1340px) {
  .chero { padding-top: 260px; }
  .intro { grid-template-columns: minmax(0, 1fr) 312px; gap: 60px; }
  .ccols { grid-template-columns: 1fr 1fr; gap: 60px; }
}
@media (max-width: 1000px) {
  .chero { padding: 200px 20px 90px; }
  .chero__title, .cnext__name { font-size: 56px; }
  .chero__sub, .cnext__sub { font-size: 30px; }
  .chero__claim { font-size: 24px; margin-top: 32px; }
  .ctitle { font-size: 36px; }
  .cbody, .finding__name { font-size: 22px; }
  .csub { font-size: 24px; }
  .clist, .finding__text { font-size: 19px; }
  .cwrap { margin-top: 80px; }
  .intro { grid-template-columns: 1fr; gap: 40px; }
  .ctitle--next { margin-top: 64px; }
  .cwrap--cols { margin-top: 48px; }
  .intro__video { width: 260px; }
  .phone { padding: 8px; border-radius: 38px; }
  .phone video { border-radius: 30px; }
  .ccols { grid-template-columns: 1fr; gap: 40px; margin-top: 48px; }
  .cnext__label { font-size: 20px; }
  .cnext__name { margin-top: 30px; }
  .cfooter { padding-top: 70px; }
  .cfooter .footer__line { margin-top: 60px; }
}
@media (max-width: 720px) {
  .wcard { border-radius: 28px; }
  .chero__title, .cnext__name { font-size: 40px; }
  .chero__sub, .cnext__sub { font-size: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  .wcard__pointer, .wcard__head, .wnav, .wdot { transition: none !important; }
}


/* =========================================================
   Поп-ап для фото и видео
   ========================================================= */
.wshot img,
.research img,
.phone video { cursor: zoom-in; }

body.has-lightbox { overflow: hidden; }

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 40px;
  background: rgba(18, 18, 18, .92);
  backdrop-filter: blur(6px);
}
.lightbox.is-open { display: flex; }

.lightbox__stage {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  overflow: auto;
}

.lightbox__stage img,
.lightbox__stage video {
  max-width: 100%;
  max-height: calc(100vh - 80px);
  width: auto;
  height: auto;
  border-radius: 12px;
  transition: transform .35s cubic-bezier(.22, .61, .36, 1);
}
.lightbox__media { cursor: zoom-in; }
.lightbox__media.is-zoomed { transform: scale(2.2); cursor: zoom-out; }

.lightbox__close {
  position: absolute;
  top: 20px;
  right: 24px;
  width: 48px;
  height: 48px;
  padding: 0 0 4px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .12);
  color: var(--white);
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
  transition: background-color .2s ease;
}
.lightbox__close:hover { background: rgba(255, 255, 255, .24); }

@media (max-width: 720px) {
  .lightbox { padding: 16px; }
  .lightbox__close { top: 10px; right: 12px; width: 40px; height: 40px; font-size: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  .lightbox__stage img, .lightbox__stage video { transition: none; }
}
