/* ══════════════════════════════════════════════════════════
   Страница кейса
   ══════════════════════════════════════════════════════════ */

/* ─── Хедер кейса ──────────────────────────────────────── */

.case-hero {
  position: relative;
  min-height: 78vh;
  min-height: 78svh;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}

.case-hero__bg { position: absolute; inset: 0; }

.case-hero__img {
  width: 100%; height: 100%;
  object-fit: cover;
  animation: hero-zoom 24s ease-in-out infinite alternate;
}

.case-hero__overlay {
  position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(11, 10, 8, 0.66) 0%, rgba(11, 10, 8, 0.2) 40%, rgba(11, 10, 8, 0.88) 92%, var(--bg) 100%);
}

.case-hero__content {
  position: relative;
  z-index: 2;
  padding-top: 160px;
  padding-bottom: clamp(48px, 7vw, 96px);
}

.crumbs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: clamp(28px, 4vw, 48px);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.crumbs__link { color: var(--muted); transition: color 0.3s ease; }
.crumbs__link:hover { color: var(--gold-bright); }
.crumbs__sep { color: var(--line); }
.crumbs__current { color: var(--text-soft); }

.case-hero__tag {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--gold-bright);
  margin-bottom: 18px;
}

.case-hero__title {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(38px, 6.6vw, 92px);
  line-height: 1.05;
  letter-spacing: 0.015em;
  text-transform: uppercase;
  max-width: 18ch;
}

.case-hero__intro {
  margin-top: 22px;
  max-width: 560px;
  font-size: clamp(15px, 1.4vw, 17px);
  font-weight: 300;
  line-height: 1.7;
  color: var(--text-soft);
}

/* ─── Мета ─────────────────────────────────────────────── */

.case-meta {
  border-bottom: 1px solid var(--line-soft);
  background: var(--bg-soft);
}

.case-meta__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}

.case-meta__item {
  padding: clamp(22px, 3vw, 36px) clamp(14px, 2vw, 28px);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.case-meta__item + .case-meta__item { border-left: 1px solid var(--line-soft); }

.case-meta__label {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--muted);
}

.case-meta__value {
  font-family: var(--font-display);
  font-size: clamp(19px, 2vw, 26px);
  font-weight: 400;
  letter-spacing: 0.04em;
  color: var(--text);
}

/* ─── Задача / Решение ─────────────────────────────────── */

.case-body { padding-top: clamp(56px, 7vw, 110px); }

.case-cols {
  display: grid;
  grid-template-columns: 1fr 1.35fr;
  gap: clamp(40px, 6vw, 96px);
  align-items: start;
}

.case-col .s-head { margin-bottom: 24px; }

.case-col__text {
  font-size: clamp(15px, 1.35vw, 17px);
  font-weight: 300;
  line-height: 1.8;
  color: var(--text-soft);
}

.case-col__text p + p { margin-top: 18px; }

.case-equipment {
  margin-top: clamp(48px, 6vw, 80px);
  padding-top: clamp(28px, 3.5vw, 44px);
  border-top: 1px solid var(--line-soft);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 20px;
}

.case-equipment__label {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--muted);
  margin-right: 8px;
}

.case-equipment__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.chip {
  padding: 11px 22px;
  border-radius: 100px;
  border: 1px solid var(--line);
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--text-soft);
  background: rgba(201, 163, 94, 0.04);
  transition: border-color 0.3s ease, color 0.3s ease;
}

.chip:hover { border-color: var(--gold); color: var(--gold-bright); }

/* ─── Видео ────────────────────────────────────────────── */

.case-video__frame {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line-soft);
}

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

.case-video__play {
  position: absolute; inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  background: rgba(11, 10, 8, 0.45);
  transition: background-color 0.4s ease, opacity 0.5s ease, visibility 0.5s;
}

.case-video__play:hover { background: rgba(11, 10, 8, 0.3); }

.case-video__play.is-hidden { opacity: 0; visibility: hidden; }

.case-video__play-ring {
  width: 96px; height: 96px;
  border-radius: 50%;
  border: 1px solid rgba(201, 163, 94, 0.6);
  background: rgba(11, 10, 8, 0.5);
  backdrop-filter: blur(8px);
  display: grid;
  place-items: center;
  color: var(--gold-bright);
  transition: transform 0.5s var(--ease-out), box-shadow 0.5s ease;
}

.case-video__play-ring svg { width: 30px; height: 30px; margin-left: 4px; }

.case-video__play:hover .case-video__play-ring {
  transform: scale(1.1);
  box-shadow: 0 0 48px rgba(201, 163, 94, 0.4);
}

.case-video__play-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--text-soft);
}

/* ─── Галерея ──────────────────────────────────────────── */

.case-gallery__grid {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: clamp(16px, 2vw, 28px);
}

/* Большая галерея (3+ фото): первые два кадра крупнее, дальше по три в ряд */
.case-gallery__grid.is-many {
  grid-template-columns: repeat(6, 1fr);
}

.case-gallery__grid.is-many .case-gallery__item {
  grid-column: span 2;
}

.case-gallery__grid.is-many .case-gallery__item:nth-child(1),
.case-gallery__grid.is-many .case-gallery__item:nth-child(2) {
  grid-column: span 3;
}

.case-gallery__item {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  cursor: zoom-in;
  border: 1px solid var(--line-soft);
}

.case-gallery__item img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 1s var(--ease-out), filter 0.6s ease;
}

.case-gallery__item:hover img {
  transform: scale(1.05);
  filter: brightness(1.08);
}

/* ─── Результат ────────────────────────────────────────── */

.case-result__stats { margin-top: 0; margin-bottom: clamp(40px, 5vw, 64px); }

.case-result__text {
  max-width: 720px;
  font-size: clamp(17px, 1.7vw, 21px);
  font-weight: 300;
  line-height: 1.75;
  color: var(--text-soft);
}

.case-quote {
  margin-top: clamp(48px, 6vw, 80px);
  padding: clamp(32px, 4vw, 56px) clamp(24px, 4vw, 64px);
  border-left: 2px solid var(--gold);
  background: var(--bg-soft);
}

.case-quote__text {
  font-family: var(--font-display);
  font-size: clamp(20px, 2.3vw, 27px);
  font-weight: 400;
  font-style: italic;
  line-height: 1.5;
  color: var(--text);
  margin-bottom: 20px;
}

.case-quote__author {
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
}

/* ─── Следующий кейс ───────────────────────────────────── */

.case-next {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 44vh;
  overflow: hidden;
  margin-top: calc(var(--section-gap) / 2);
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
}

.case-next__bg { position: absolute; inset: 0; }

.case-next__img {
  width: 100%; height: 100%;
  object-fit: cover;
  transform: scale(1.02);
  transition: transform 1.4s var(--ease-out), filter 0.8s ease;
  filter: brightness(0.5);
}

.case-next:hover .case-next__img {
  transform: scale(1.08);
  filter: brightness(0.72);
}

.case-next__overlay {
  position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(11, 10, 8, 0.85) 0%, rgba(11, 10, 8, 0.35) 100%);
}

.case-next__content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-block: 64px;
}

.case-next__label {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--gold-bright);
}

.case-next__title {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(30px, 5vw, 64px);
  line-height: 1.1;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  max-width: 18ch;
  transition: color 0.4s ease;
}

.case-next:hover .case-next__title { color: var(--gold-bright); }

.case-next__arrow {
  width: 54px; height: 54px;
  border-radius: 50%;
  border: 1px solid rgba(201, 163, 94, 0.5);
  display: grid;
  place-items: center;
  color: var(--gold-bright);
  margin-top: 10px;
  transition: background-color 0.4s ease, transform 0.4s var(--ease-out);
}

.case-next__arrow svg { width: 16px; height: 16px; }

.case-next:hover .case-next__arrow {
  background: rgba(201, 163, 94, 0.14);
  transform: translate(4px, -4px);
}

/* ─── CTA ──────────────────────────────────────────────── */

.case-cta {
  padding-block: clamp(72px, 10vw, 140px);
  text-align: center;
}

.case-cta__title {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(36px, 5.5vw, 72px);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  margin-bottom: 20px;
}

.case-cta__title .word { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: 0.08em; margin-bottom: -0.08em; }
.case-cta__title .word-inner { display: inline-block; }

.case-cta__text {
  font-size: 16px;
  font-weight: 300;
  color: var(--muted);
  margin-bottom: 36px;
}

.case-cta__actions {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

/* Кнопка возврата к проектам */
.case-hero__back {
  display: inline-flex;
  margin-top: 30px;
}

.btn__arrow--back { order: -1; }
.btn:hover .btn__arrow--back { transform: translateX(-3px); }

/* ─── Лайтбокс ─────────────────────────────────────────── */

.lightbox {
  position: fixed; inset: 0;
  z-index: 9500;
  background: rgba(11, 10, 8, 0.94);
  backdrop-filter: blur(12px);
  display: grid;
  place-items: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.45s ease, visibility 0.45s;
}

.lightbox.is-open { opacity: 1; visibility: visible; }

.lightbox__img {
  max-width: min(1200px, 92vw);
  max-height: 84vh;
  object-fit: contain;
  border: 1px solid var(--line);
  transform: scale(0.96);
  transition: transform 0.45s var(--ease-out);
}

.lightbox.is-open .lightbox__img { transform: scale(1); }

.lightbox__close {
  position: absolute;
  top: 24px; right: 24px;
  width: 54px; height: 54px;
  border-radius: 50%;
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  color: var(--text-soft);
  transition: border-color 0.3s ease, color 0.3s ease, transform 0.3s ease;
}

.lightbox__close svg { width: 18px; height: 18px; }

.lightbox__close:hover {
  border-color: var(--gold);
  color: var(--gold-bright);
  transform: rotate(90deg);
}

.lightbox__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 58px; height: 58px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(11, 10, 8, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: grid;
  place-items: center;
  color: var(--text-soft);
  transition: border-color 0.3s ease, color 0.3s ease, background-color 0.3s ease, transform 0.3s var(--ease-out);
}

.lightbox__nav--prev { left: clamp(14px, 3vw, 40px); }
.lightbox__nav--next { right: clamp(14px, 3vw, 40px); }

.lightbox__nav svg { width: 20px; height: 20px; }

.lightbox__nav:hover {
  border-color: var(--gold);
  color: var(--gold-bright);
  background: rgba(201, 163, 94, 0.12);
  transform: translateY(-50%) scale(1.08);
}

.lightbox__counter {
  position: absolute;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.22em;
  color: var(--text-soft);
}

@media (max-width: 640px) {
  .lightbox__nav { width: 46px; height: 46px; }
  .lightbox__close { top: 14px; right: 14px; width: 46px; height: 46px; }
}

/* ─── Адаптив ──────────────────────────────────────────── */

@media (max-width: 1024px) {
  .case-cols { grid-template-columns: 1fr; gap: 40px; }
  .case-meta__grid { grid-template-columns: repeat(2, 1fr); }
  .case-meta__item:nth-child(3) { border-left: none; }
  .case-meta__item:nth-child(1), .case-meta__item:nth-child(2) { border-bottom: 1px solid var(--line-soft); }
  .case-gallery__grid.is-many .case-gallery__item { grid-column: span 3; }
}

@media (max-width: 640px) {
  .case-gallery__grid,
  .case-gallery__grid.is-many { grid-template-columns: 1fr; }
  .case-gallery__grid.is-many .case-gallery__item { grid-column: auto; }
  .case-meta__grid { grid-template-columns: 1fr 1fr; }
  .case-hero { min-height: 64vh; min-height: 64svh; }
  .case-hero__content { padding-top: 130px; }
  .case-video__play-ring { width: 72px; height: 72px; }
}
