/* Детальная страница проекта — хиро на базе .hero--service; НОВОЕ здесь:
   мета справа от заголовка (Figma 141:8914), аккордеон «Zakres prac»
   (148:2590), галерея (151:2609) и секция отзыва (181:904). */

/* Хиро: мета лок/год справа, крошки с усечённой серединой */

.project-hero__row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  width: 1264px;
  max-width: calc(100vw - 176px);
}

.project-hero__meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 16px;
  padding: 8px 0;
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 20px;
  letter-spacing: -0.56px;
  white-space: nowrap;
}

.project-hero__meta-row {
  display: flex;
  align-items: center;
  gap: 8px;
  text-transform: uppercase;
}

.project-hero__meta-label {
  margin: 0;
  font-size: 13px;
  font-weight: 400;
  color: var(--color-light-800);
}

.project-hero__meta-value {
  margin: 0;
  font-weight: 600;
  color: var(--color-light-1000);
}

.service-hero__crumb--truncated {
  max-width: 144.81px;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Zakres prac — аккордеон */

.project-scope {
  position: relative;
  z-index: 2;
  width: 100%;
  margin-top: -48px;
  padding: 88px;
  border-radius: 56px;
  background: var(--color-light-1000);
  display: flex;
  flex-direction: column;
  gap: 48px;
}

.project-scope__header {
  position: relative;
  display: flex;
  justify-content: center;
}

.project-scope__title {
  position: relative;
  margin: 0;
  font-family: var(--font-display);
  font-size: 48px;
  font-weight: 600;
  line-height: 56px;
  letter-spacing: -2.88px;
  text-transform: uppercase;
  text-align: center;
  color: var(--color-dark-700);
  white-space: nowrap;
}

.project-scope__title strong {
  font-weight: 600;
  color: var(--color-dark-1000);
}

.project-scope__title-underline {
  position: absolute;
  z-index: -1;
  left: 176.52px;
  top: 35.86px;
  width: 133.443px;
  height: 19.135px;
  background: var(--color-dark-100);
}

.project-scope__list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  max-width: 1264px;
  margin-inline: auto;
}

.scope-item {
  display: flex;
  align-items: stretch;
  cursor: pointer;
}

.scope-item__main {
  flex: 1 0 0;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 8px;
  background: var(--color-dark-50);
  border-radius: 32px 0 0 32px;
  transition: background-color 0.2s ease;
}

.scope-item__check {
  flex-shrink: 0;
  align-self: stretch;
  min-height: 80px;
  width: 80px;
  border-radius: 24px;
  background: var(--color-light-1000);
  display: flex;
  align-items: center;
  justify-content: center;
}

.scope-item__check img {
  width: 32px;
  height: 32px;
  display: block;
}

.scope-item__body {
  flex: 1 0 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 0;
}

.scope-item__name {
  margin: 0;
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  line-height: 32px;
  letter-spacing: -0.96px;
  text-transform: uppercase;
  color: var(--color-dark-1000);
}

.scope-item__desc {
  margin: 0;
  font-family: var(--font-display);
  font-size: 18px;
  line-height: 28px;
  letter-spacing: -0.72px;
  color: var(--color-dark-700);
  display: none;
}

.scope-item__desc strong {
  font-weight: 600;
  color: var(--color-dark-1000);
}

.scope-item.is-open .scope-item__desc {
  display: block;
}

.scope-item__side {
  flex-shrink: 0;
  width: 96px;
  padding: 8px 8px 8px 0;
  background: var(--color-dark-50);
  border-radius: 0 100px 100px 0;
  display: flex;
  align-items: center;
  /* кнопка прижата к правому паддингу: ровно 8px до грани */
  justify-content: flex-end;
  transition: border-radius 0.2s ease, background-color 0.2s ease;
}

/* Ховер строки: фон темнеет, кнопка подрастает */
.scope-item:hover .scope-item__main,
.scope-item:hover .scope-item__side {
  background: var(--color-dark-100);
}

.scope-item:hover .scope-item__toggle {
  transform: scale(1.06);
}

.scope-item.is-open .scope-item__side {
  border-radius: 0 48px 32px 0;
  align-items: flex-start;
}

.scope-item__toggle {
  width: 80px;
  height: 80px;
  border: none;
  border-radius: var(--radius-lg);
  background: var(--color-dark-1000);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  outline: none;
  position: relative;
  transition: background-color 0.2s ease, transform 0.2s ease;
  flex-shrink: 0;
}

.scope-item__toggle:hover {
  transform: scale(1.06);
}

.scope-item__toggle::before,
.scope-item__toggle::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 16px;
  height: 2px;
  transform: translate(-50%, -50%);
  background: var(--color-light-1000);
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.scope-item__toggle::after {
  transform: translate(-50%, -50%) rotate(90deg);
}

.scope-item.is-open .scope-item__toggle {
  background: var(--color-light-1000);
}

.scope-item.is-open .scope-item__toggle::before,
.scope-item.is-open .scope-item__toggle::after {
  background: var(--color-dark-1000);
}

.scope-item.is-open .scope-item__toggle::after {
  transform: translate(-50%, -50%) rotate(0deg);
}

/* Галерея */

.project-gallery {
  position: relative;
  z-index: 1;
  width: 100%;
  margin-top: -48px;
  padding: 136px 88px 88px;
  border-radius: 0 0 56px 56px;
  background: var(--color-dark-1000);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
}

.project-gallery__header {
  position: relative;
}

.project-gallery__title {
  position: relative;
  margin: 0;
  font-family: var(--font-display);
  font-size: 48px;
  font-weight: 600;
  line-height: 56px;
  letter-spacing: -2.88px;
  text-transform: uppercase;
  text-align: center;
  color: var(--color-light-700);
  white-space: nowrap;
}

.project-gallery__title strong {
  font-weight: 600;
  color: var(--color-light-1000);
}

.project-gallery__title-underline {
  position: absolute;
  z-index: -1;
  right: -8px;
  top: 34.86px;
  width: 153.901px;
  height: 19.135px;
  background: var(--color-light-200);
}

.project-gallery__stage {
  display: flex;
  align-items: stretch;
  width: 100%;
  max-width: 1264px;
  margin-inline: auto;
  height: 640px;
}

.project-gallery__nav {
  flex-shrink: 0;
  width: 80px;
  border: none;
  border-radius: 32px;
  background: var(--color-light-50);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  outline: none;
  transition: background-color 0.2s ease;
}

.project-gallery__nav:hover:not(:disabled) {
  background: var(--color-light-100);
}

.project-gallery__nav:disabled {
  opacity: 0.4;
  cursor: default;
}

.project-gallery__nav img {
  width: 32px;
  height: 32px;
  display: block;
}

.project-gallery__nav--next img {
  transform: rotate(180deg);
}

.project-gallery__frame {
  flex: 1 0 0;
  min-width: 0;
  border-radius: 24px;
  overflow: hidden;
  background: var(--color-dark-1100);
  transition: opacity 0.35s ease, filter 0.35s ease;
}

.project-gallery__frame.is-transitioning {
  opacity: 0;
  filter: blur(10px);
}

.project-gallery__frame img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.project-gallery__caption-row {
  width: 100%;
  max-width: 1264px;
  margin-inline: auto;
  padding: 0 80px;
  /* встык к кадру, как в макете */
  margin-top: -32px;
}

.project-gallery__caption {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 24px;
  border-radius: 24px;
  background: var(--color-light-50);
}

.project-gallery__caption-text {
  margin: 0;
  max-width: 481.566px;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  line-height: 24px;
  letter-spacing: -0.64px;
  text-align: center;
  color: var(--color-light-1000);
}

.project-gallery__counter {
  position: absolute;
  right: 24px;
  top: 50%;
  margin: 0;
  transform: translateY(-50%);
  height: 40px;
  display: flex;
  align-items: center;
  padding: 0 16px;
  border-radius: 16px;
  background: var(--color-dark-1100-800);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 500;
  color: var(--color-light-1000);
  white-space: nowrap;
}

.project-gallery__counter span {
  color: var(--color-light-500);
}

/* Отзыв */

.project-review {
  position: relative;
  width: 100%;
  padding: 136px 88px;
  background: var(--color-light-1000);
  overflow: hidden;
  display: flex;
  justify-content: center;
}

.project-review__circle {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 682.008px;
  height: 682.008px;
  pointer-events: none;
  animation: project-review-pulse 5s ease-in-out infinite;
}

.project-review__circle--left {
  animation-delay: 2.5s;
}

@keyframes project-review-pulse {
  0%, 100% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
  50% {
    transform: translate(-50%, -50%) scale(1.08);
    opacity: 0.6;
  }
}

@media (prefers-reduced-motion: reduce) {
  .project-review__circle {
    animation: none;
  }
}

.project-review__circle--right {
  left: calc(50% + 737.53px);
}

.project-review__circle--left {
  left: calc(50% - 744.5px);
}

.project-review__content {
  position: relative;
  z-index: 1;
  width: 842px;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
  text-align: center;
}

.project-review__quote {
  margin: 0;
  font-family: var(--font-display);
  font-size: 48px;
  font-weight: 600;
  line-height: 56px;
  letter-spacing: -2.88px;
  color: var(--color-dark-1000);
}

.project-review__attribution {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.project-review__name {
  margin: 0;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  line-height: 28px;
  letter-spacing: -0.9px;
  color: var(--color-dark-1000);
}

.project-review__location {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 500;
  color: var(--color-dark-700);
}

/* ============ Mobile ≤767px ============ */
@media (max-width: 767px) {
  .project-hero__row {
    max-width: 100%;
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .project-hero__meta {
    align-items: flex-start;
    padding: 0;
  }

  .project-scope {
    margin-top: -34px;
    border-radius: 40px;
    padding: 48px 16px;
    gap: 32px;
  }

  .project-scope__title {
    font-size: 32px;
    line-height: 40px;
    letter-spacing: -2.24px;
  }

  .project-scope__title-underline {
    left: auto;
    right: -6px;
    top: 24px;
    width: 96px;
    height: 13.973px;
  }

  .scope-item__main {
    gap: 16px;
    border-radius: 24px 0 0 24px;
  }

  .scope-item__check {
    width: 48px;
    min-height: 48px;
    border-radius: 16px;
  }

  .scope-item__check img {
    width: 24px;
    height: 24px;
  }

  .scope-item__name {
    font-size: 16px;
    line-height: 24px;
    letter-spacing: -0.64px;
  }

  .scope-item__desc {
    font-size: 14px;
    line-height: 20px;
    letter-spacing: -0.56px;
  }

  .scope-item__side {
    width: 64px;
  }

  .scope-item__toggle {
    width: 48px;
    height: 48px;
  }

  .project-gallery {
    margin-top: -34px;
    border-radius: 0 0 40px 40px;
    padding: 88px 16px 48px;
    gap: 24px;
  }

  .project-gallery__title {
    font-size: 32px;
    line-height: 40px;
    letter-spacing: -2.24px;
  }

  .project-gallery__stage {
    height: 260px;
  }

  .project-gallery__nav {
    width: 40px;
    border-radius: 16px;
  }

  .project-gallery__nav img {
    width: 24px;
    height: 24px;
  }

  .project-gallery__caption-row {
    padding: 0;
  }

  .project-gallery__caption {
    flex-direction: column;
    gap: 12px;
    padding: 16px;
  }

  .project-gallery__counter {
    position: static;
    transform: none;
  }

  .project-review {
    padding: 88px 16px;
  }

  .project-review__quote {
    font-size: 24px;
    line-height: 32px;
    letter-spacing: -1.44px;
  }
}

/* Хиро проекта: контент прижат к низу — 80px до начала следующего
   блока (белая секция наезжает на хиро на 48px, отсюда 80 + 48) */
.hero--service .service-hero__head:has(.project-hero__row) {
  top: auto;
  bottom: 128px;
}

/* Параллакс цитаты: текст мягко тянется за курсором, когда он рядом */
.project-review__quote {
  position: relative;
  transform: translate(var(--px, 0px), var(--py, 0px));
  will-change: transform;
}

.scope-item {
  cursor: pointer;
}

/* ============ Mobile ≤767px — детальная по нодам 304:5825 / 304:5868 /
   304:6293 / 305:6355 (уточнение раннего мобильного слоя) ============ */
@media (max-width: 767px) {
  /* Хиро: контент у низа, крошки в одну строку с усечённой серединой */
  .hero--service .service-hero__head:has(.project-hero__row) {
    left: 16px;
    right: 16px;
    top: auto;
    /* 48px видимых до белой части: секция ниже наезжает на 34 */
    bottom: 82px;
    gap: 12px;
  }

  .project-hero__row {
    gap: 24px;
  }

  .project-hero__meta {
    gap: 4px;
    text-transform: uppercase;
  }

  .project-hero__meta-row {
    gap: 8px;
  }

  .service-hero__crumbs {
    width: 100%;
  }

  .service-hero__crumb--truncated {
    flex: 1 1 0;
    min-width: 0;
    max-width: none;
  }

  /* Zakres prac: чек-плитка 56, заголовок 16/28, текст 14/20 */
  .project-scope__title-underline {
    left: 50%;
    right: auto;
    top: 24.01px;
    width: 121.212px;
    height: 13.973px;
    margin-left: -21px;
    transform: none;
  }

  .scope-item__check {
    width: 56px;
    min-height: 56px;
    border-radius: 16px;
  }

  .scope-item__check img {
    width: 24px;
    height: 24px;
  }

  .scope-item__name {
    font-size: 16px;
    line-height: 28px;
    letter-spacing: -0.64px;
  }

  .scope-item__desc {
    font-size: 14px;
    line-height: 20px;
    letter-spacing: -0.56px;
  }

  /* Галерея: кадр 240, подпись под ним, две кнопки-половинки внизу
     встык к плашке */
  .project-gallery {
    position: relative;
    /* низ: 48 паддинга + ряд кнопок 56, зазора над кнопками нет */
    padding: 88px 16px 104px;
  }

  /* Кнопки абсолютные от низа секции, а stage — их предок с reveal-блюром:
     не-none filter делает stage containing block'ом, и на время анимации
     кнопки прибиты к кадру, а по её окончании прыгают вниз — scroll
     anchoring от этого скачка возвращает страницу к блоку. Оставляем
     stage только fade по opacity (opacity containing block не создаёт). */
  .project-gallery__stage[data-reveal] {
    filter: none;
  }

  .project-gallery__title-underline {
    right: -6px;
    top: 24.01px;
    width: 103.212px;
    height: 13.973px;
  }

  .project-gallery__stage {
    height: 240px;
  }

  .project-gallery__nav {
    position: absolute;
    bottom: 48px;
    height: 56px;
    width: auto;
    border-radius: 16px;
  }

  .project-gallery__nav--prev {
    left: 16px;
    right: 50%;
  }

  .project-gallery__nav--next {
    left: 50%;
    right: 16px;
  }

  .project-gallery__caption {
    flex-direction: column;
    gap: 16px;
    padding: 24px;
  }

  .project-gallery__caption-text {
    max-width: 295px;
  }

  /* Отзыв: 28/38, паддинги из ноды */
  .project-review {
    padding: 96px 15px;
  }

  .project-review__quote {
    font-size: 28px;
    line-height: 38px;
    letter-spacing: -1.68px;
  }
}

/* Mobile: хвост аккордеона со скруглением как слева, кнопка по центру */
@media (max-width: 767px) {
  .scope-item__side,
  .scope-item.is-open .scope-item__side {
    border-radius: 0 24px 24px 0;
    align-items: center;
  }
}
