/* Case study page — Figma 706:2014 */
.page--case {
  --font-case: Arial, Helvetica, sans-serif;
  padding-bottom: 0;
}

/* Full-width cover, 60px side gutters */
.case-hero-wrap {
  box-sizing: border-box;
  margin-bottom: 120px;
  margin-top: 0;
  padding: 0 var(--pad-x);
  width: 100%;
}

.case-hero {
  aspect-ratio: 1024 / 334;
  border-radius: 12px;
  overflow: hidden;
  width: 100%;
}

.case-hero__cover {
  display: block;
  height: 100%;
  max-width: none;
  object-fit: cover;
  width: 100%;
}

/* Scroll boundary: nav fixed until bottom of next-case card */
.case-nav-container {
  position: relative;
  width: 100%;
}

/* Layout */
.case-layout {
  box-sizing: border-box;
  padding: 0 var(--pad-x);
  width: 100%;
}

.case-content__inner {
  font-family: var(--font-case);
  font-size: 20px;
  font-weight: 400;
  line-height: 1.2;
  max-width: 950px;
  width: 100%;
}

/* Intro */
.case-intro {
  display: flex;
  flex-direction: column;
  gap: 60px;
  margin-bottom: 160px;
}

.case-intro__head {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.case-tag {
  align-items: center;
  display: inline-flex;
  flex-wrap: wrap;
  font-family: var(--font-case);
  font-size: 16px;
  font-weight: 400;
  gap: 4px;
  letter-spacing: -0.32px;
  line-height: 1.2;
}

.case-tag__dot {
  background: var(--color-text);
  border-radius: 50%;
  height: 2px;
  width: 2px;
}

.case-intro__title {
  font-family: var(--font-case);
  font-size: 40px;
  font-weight: 700;
  line-height: 1.2;
}

.case-intro__lead {
  font-family: var(--font-case);
  font-size: 20px;
  font-weight: 400;
  line-height: 1.2;
}

.case-meta {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.case-meta__row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.case-meta__label {
  color: #a7a7a7;
  font-family: var(--font-case);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.163;
}

.case-meta__value {
  font-family: var(--font-case);
  font-size: 20px;
  font-weight: 400;
  line-height: 1.163;
}

/* Sections */
.case-section {
  display: flex;
  flex-direction: column;
  gap: 40px;
  margin-bottom: 160px;
  scroll-margin-top: 100px;
}

.case-section:last-child {
  margin-bottom: 0;
}

.case-section__title {
  font-family: var(--font-case);
  font-size: 40px;
  font-weight: 700;
  line-height: 1.2;
}

/* 160px от предыдущего блока до заголовка подсекции (gap секции 40px + 120px) */
.case-section > .case-section__title:not(:first-child) {
  margin-top: 120px;
}

/* 160px внутри case-block (gap 32px + 128px) */
.case-block > .case-section__title {
  margin-top: 128px;
}

.case-block > .case-section__title:first-child {
  margin-top: 0;
}

.case-block {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.case-block__text {
  font-family: var(--font-case);
  font-size: 20px;
  font-weight: 400;
  line-height: 1.2;
}

.case-block__text strong {
  font-family: var(--font-case);
  font-weight: 700;
}

.case-figure {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin: 0;
}

.case-figure__media {
  border-radius: 12px;
  overflow: hidden;
}

.case-figure img {
  border-radius: 12px;
  display: block;
  height: auto;
  max-width: none;
  width: 100%;
}

/* Скрыть встроенную подпись в PNG — показываем только figcaption */
.case-figure--crop-caption .case-figure__media {
  border-radius: 12px;
}

.case-figure--crop-caption .case-figure__media img {
  border-radius: 0;
  margin-bottom: -52px;
}

.case-figure__caption {
  color: #a7a7a7;
  font-family: var(--font-case);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.163;
}

.case-list {
  font-family: var(--font-case);
  font-size: 20px;
  font-weight: 400;
  line-height: 1.163;
  list-style: disc;
  padding-left: 30px;
}

.case-list--emoji {
  list-style: none;
  padding-left: 0;
}

.case-list--emoji li {
  display: flex;
  align-items: flex-start;
  gap: 0.25em;
  padding-left: 0;
}

.case-list--emoji .case-list__marker {
  flex-shrink: 0;
  line-height: 1.163;
}

.case-list li + li {
  margin-top: 0.25em;
}

/* Results card — ссылка поверх превью, 20px от низа карточки */
.case-results-card {
  display: block;
  line-height: 0;
  position: relative;
}

.case-results-card__img {
  border-radius: 12px;
  display: block;
  height: auto;
  max-width: none;
  width: 100%;
}

/* Текст с переносом; стрелка inline у последнего слова */
.case-results-card__link.btn-link {
  align-items: unset;
  bottom: 20px;
  box-sizing: border-box;
  color: var(--color-text);
  display: block;
  font-family: var(--font-mono);
  height: auto;
  left: 24px;
  line-height: 1.45;
  min-height: 0;
  padding: 0;
  position: absolute;
  right: 24px;
  text-align: center;
  transform: none;
  transition: color 0.2s ease;
  white-space: normal;
  width: auto;
  z-index: 1;
}

.case-results-card__link-text {
  display: inline;
}

.case-results-card__link-text img {
  display: inline-block;
  height: 1em;
  margin-left: 4px;
  transition: opacity 0.2s ease;
  vertical-align: middle;
  width: 1em;
}

.case-results-card__link.btn-link:hover {
  background-color: transparent;
  color: #8a8a8a;
  opacity: 1;
}

.case-results-card__link.btn-link:hover .case-results-card__link-text img {
  filter: none;
  opacity: 0.55;
}

.case-results-card--phones {
  background: #f8f8f8;
  border: 1px solid #eaeaea;
  border-radius: 12px;
  overflow: hidden;
}

.case-results-card__phones {
  align-items: flex-end;
  display: flex;
  gap: 24px;
  justify-content: center;
  padding: 31px 40px 72px;
}

.case-results-card__phones img {
  border-radius: 24px;
  display: block;
  flex: 0 1 206px;
  height: auto;
  max-width: 33%;
  width: 100%;
}

.case-figure--pair {
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr 1fr;
}

.case-figure--pair img {
  width: 100%;
}

.case-figure--pair .case-figure__caption {
  grid-column: 1 / -1;
}

/* Fixed navigation — 60px right, 40px bottom; clamps at next-case card */
.case-nav {
  bottom: 40px;
  opacity: 0;
  pointer-events: none;
  position: fixed;
  right: 60px;
  transition: opacity 0.65s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.65s;
  visibility: hidden;
  z-index: 20;
}

.case-nav.is-visible {
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
}

.case-nav.is-clamped {
  bottom: 0;
  position: absolute;
  right: 60px;
}

.case-nav__inner {
  align-items: flex-end;
  display: flex;
  flex-direction: column;
  position: relative;
  transform: translateY(20px);
  transition: transform 0.65s cubic-bezier(0.16, 1, 0.3, 1);
}

.case-nav.is-visible .case-nav__inner {
  transform: translateY(0);
}

.case-nav__indicator {
  align-items: center;
  display: flex;
  height: 15px;
  justify-content: center;
  left: calc(100% + 5px);
  pointer-events: none;
  position: absolute;
  top: 0;
  transition: transform 0.55s cubic-bezier(0.33, 1, 0.68, 1);
  width: 15px;
  will-change: transform;
}

.case-nav__indicator img {
  display: block;
  flex-shrink: 0;
  height: 15px;
  max-width: none;
  transform: rotate(-90deg) translateY(0.5px);
  width: 15px;
}

.case-nav__list {
  align-items: flex-end;
  display: flex;
  flex-direction: column;
  gap: 23px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.case-nav__list li {
  display: flex;
  justify-content: flex-end;
  line-height: 1.2;
}

.case-nav__btn {
  background: none;
  border: none;
  color: #a7a7a7;
  cursor: pointer;
  display: block;
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 500;
  letter-spacing: -0.32px;
  line-height: 1.2;
  padding: 0;
  text-align: right;
  text-transform: uppercase;
  transition: color 0.35s ease;
  white-space: nowrap;
}

.case-nav__btn:hover,
.case-nav__btn.is-active {
  color: var(--color-text);
}

.page--case .footer {
  margin-top: 140px;
}

@media (max-width: 1200px) {
  .case-nav {
    display: none;
  }

  .case-hero {
    aspect-ratio: auto;
    height: auto;
    overflow: visible;
    padding-bottom: 20px;
  }

  .case-hero__cover {
    border-radius: 12px;
    height: auto;
    object-fit: contain;
    object-position: center top;
    width: 100%;
  }

  .case-hero-wrap {
    margin-bottom: 80px;
  }
}

@media (max-width: 768px) {
  .case-intro__title,
  .case-section__title {
    font-size: 28px;
  }

  .case-block__text,
  .case-intro__lead,
  .case-list,
  .case-meta__value {
    font-size: 16px;
  }

  .case-results-card__link.btn-link {
    bottom: 20px;
    font-size: 14px;
    left: 16px;
    letter-spacing: -0.28px;
    right: 16px;
  }
}
