/* ============ Страницы кейсов (Nomad) ============
   Подключается после styles.css, использует его переменные и компоненты. */

.case--nomad {
  --nomad-navy: #0b2b57;
  --nomad-teal: #1ed1c6;
  --nomad-teal-dark: #12a69c;
}
.case--nomad mark { background: rgba(30, 209, 198, .18); }
.case--nomad .h2 { margin-bottom: 22px; }
.case--nomad .fact__num,
.case--nomad .process__steps span { color: var(--nomad-teal-dark); }
.case--nomad .process__steps li::before { background: var(--nomad-teal); }
.case--nomad .topbar__nav { gap: 24px; font-size: 16px; }
.case--nomad .topbar__nav .btn { padding: 0 26px; }
.case--nomad .topbar__nav .btn--outline { margin-right: 0; margin-left: 8px; }

/* Обложка */
.case-hero-wrap { padding: 84px var(--page-pad) 0; }
.case-hero {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 18px;
  max-width: var(--frame);
  min-height: min(640px, 90svh);
  margin: 0 auto;
  padding: clamp(28px, 5vw, 64px) var(--gutter) clamp(24px, 3vw, 36px);
  border-radius: var(--radius);
  overflow: hidden;
  color: #fff;
  background:
    linear-gradient(180deg, rgba(11, 43, 87, .55) 0%, rgba(11, 43, 87, .08) 48%, rgba(11, 43, 87, .55) 100%),
    #0b2b57 url('assets/img/nomad-hero-bg.webp') center 64% / cover no-repeat;
}
.case-hero__eyebrow { font-size: 15px; color: rgba(255, 255, 255, .9); }
.case-hero__title {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 600;
  font-size: clamp(72px, 13vw, 190px);
  line-height: .9;
  letter-spacing: -0.02em;
}
.pills .pills__br { display: none; }
.case-hero__sub { max-width: 560px; font-size: clamp(17px, 1.6vw, 21px); line-height: 1.35; }
.pills--glass li {
  background: rgba(255, 255, 255, .2);
  color: #fff;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.case-hero__stats { display: flex; flex-wrap: wrap; gap: 8px; margin-top: clamp(12px, 3vw, 36px); }
.stat--glass { width: auto; max-width: 230px; padding: 12px 16px; }
.stat--glass b { font-size: clamp(20px, 2vw, 26px); }
.stat--glass span { font-size: 12px; line-height: 1.25; margin-top: 4px; }

/* Две колонки как на главной */
.case-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--aside);
  gap: var(--col-gap);
}
.case-split__main .h2 { margin-bottom: 22px; }
.quote-card .quote-card__label {
  margin-bottom: 12px;
  font-family: var(--sans);
  font-style: normal;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
}
.quote-card--wide { margin-top: 36px; max-width: 880px; }
.quote-card--wide p { font-size: clamp(18px, 1.7vw, 22px); }
.team .h3 { margin-bottom: 14px; }

.case-sub { margin: clamp(56px, 7vw, 96px) 0 24px; }
.note { margin-top: 18px; max-width: 720px; font-size: 14px; color: var(--muted); }

/* Опрос */
.survey {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr;
  gap: 32px;
  align-items: start;
  margin-top: 36px;
  padding: 32px;
  border-radius: var(--radius);
  background: var(--panel);
}
.survey__big b {
  display: block;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 600;
  font-size: clamp(72px, 9vw, 120px);
  line-height: .9;
  color: var(--nomad-navy);
}
.survey__big span { display: block; margin-top: 12px; max-width: 340px; font-size: 18px; line-height: 1.3; color: var(--ink); }
.survey__big small { display: block; margin-top: 10px; font-size: 13px; color: var(--muted); }
.survey__label { margin-bottom: 12px; font-size: 13px; color: var(--muted); }
.survey .pills li { font-size: 14px; padding: 6px 14px; }

/* Цифры рынка */
.numbers { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.numbers li { padding: 22px; border-radius: 20px; background: var(--card); }
.numbers b { display: block; font-size: clamp(24px, 2.4vw, 32px); font-weight: 700; line-height: 1.05; color: var(--nomad-navy); }
.numbers span { display: block; margin-top: 8px; font-size: 14px; line-height: 1.35; color: var(--muted); }

/* Конкуренты */
.rivals { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--col-gap); border-top: 1px solid rgba(0, 0, 0, .12); }
.rivals li { display: flex; gap: 16px; align-items: baseline; padding: 16px 0; border-bottom: 1px solid rgba(0, 0, 0, .12); }
.rivals b { flex: 0 0 150px; font-size: 17px; font-weight: 600; color: var(--ink); }
.rivals span { font-size: 15px; color: var(--muted); }

/* Проблема → решение */
.compare {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr) minmax(0, 1.2fr);
  margin-top: 36px;
  padding: 8px 24px 12px;
  border-radius: var(--radius);
  background: var(--panel);
  font-size: 15px;
  line-height: 1.35;
  color: var(--text);
}
.compare > div { padding: 16px 16px 16px 0; border-bottom: 1px solid rgba(0, 0, 0, .1); }
.compare > div:nth-last-child(-n + 3) { border-bottom: 0; }
.compare__head { padding-bottom: 8px !important; font-size: 13px; color: var(--muted); }
.compare__head--accent { color: var(--nomad-teal-dark); font-weight: 600; }
.compare__who { font-weight: 600; color: var(--ink); }

/* Функции */
.features { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.features li { padding: 22px; border-radius: 20px; background: var(--card); font-size: 15px; line-height: 1.4; color: var(--muted); }
.features span { display: block; margin-bottom: 10px; font-family: var(--serif); font-style: italic; font-size: 15px; color: var(--nomad-teal-dark); }
.features b { display: block; margin-bottom: 6px; font-size: 18px; font-weight: 600; color: var(--ink); }

.case-process { margin-top: clamp(56px, 7vw, 96px); }
.process__steps--4 { grid-template-columns: repeat(4, 1fr); }
.process__steps--5 { grid-template-columns: repeat(5, 1fr); }
.case-process .note { margin-top: 24px; }

/* Айдентика и экраны */
.identity {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 32px;
  align-items: center;
  margin-top: 36px;
  padding: clamp(20px, 3vw, 36px);
  border-radius: var(--radius);
  background: var(--panel);
}
.identity__logo { width: 100%; max-width: 460px; margin: 0 auto; border-radius: 22px; }
.swatches { display: flex; flex-wrap: wrap; gap: 16px; }
.swatches li { display: flex; flex-direction: column; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.swatches span { width: 72px; height: 72px; border-radius: 50%; background: var(--c); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08); }
.identity__tag { margin-top: 24px; font-family: var(--serif); font-style: italic; font-weight: 500; font-size: clamp(20px, 2vw, 26px); color: var(--nomad-navy); }

/* Сценарий туриста: шаг + экран приложения */
.scenario { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 18px; }
.scenario li {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 22px;
  border-top: 1px solid rgba(0, 0, 0, .2);
}
.scenario li::before {
  content: '';
  position: absolute;
  top: -4px;
  left: 0;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--nomad-teal);
}
.scenario__num { font-family: var(--serif); font-style: italic; font-size: 15px; color: var(--nomad-teal-dark); }
.scenario p { min-height: 2.6em; font-size: 16px; font-weight: 500; line-height: 1.3; color: var(--ink); }
.scenario img { width: 100%; height: auto; margin-top: 8px; filter: drop-shadow(0 24px 36px rgba(11, 43, 87, .18)); }

.case-next__inner { display: flex; flex-wrap: wrap; gap: 12px; }

@media (max-width: 1100px) {
  .features { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .numbers { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .scenario { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 40px; }
  .process__steps--5 { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 900px) {
  .case-hero-wrap { padding: 76px 12px 0; }
  .case-split, .identity, .survey { grid-template-columns: 1fr; }
  .rivals { grid-template-columns: 1fr; }
  .process__steps--4 { grid-template-columns: repeat(2, 1fr); row-gap: 32px; }
}
@media (max-width: 700px) {
  .compare { grid-template-columns: 1fr 1fr; padding: 8px 18px 12px; }
  .compare__head:first-child { display: none; }
  .compare__who { grid-column: 1 / -1; padding-bottom: 0 !important; border-bottom: 0 !important; }
  .compare > div:nth-last-child(-n + 3) { border-bottom: 1px solid rgba(0, 0, 0, .1); }
  .compare > div:last-child, .compare > div:nth-last-child(2) { border-bottom: 0; }
}
@media (max-width: 640px) {
  .numbers, .features { grid-template-columns: 1fr; }
  .process__steps--5 { grid-template-columns: repeat(2, 1fr); row-gap: 32px; }
  .case-hero { min-height: 560px; }
  .swatches { gap: 12px; }
  .swatches span { width: 60px; height: 60px; }
  /* плашки обложки: «5 место» и «моя роль» в ряд, «результат» на всю ширину */
  .case-hero__stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat--glass { max-width: none; width: auto; }
  .stat--glass b, .stat--glass span { white-space: normal; }
  .stat--blue { grid-column: 1 / -1; }
  /* заголовок ближе к описанию */
  .case-hero__sub { margin-top: -10px; }
  /* «исследования» — на вторую строку */
  .pills--glass .pills__br { display: block; flex-basis: 100%; height: 0; padding: 0; margin: -6px 0 0; background: none; backdrop-filter: none; -webkit-backdrop-filter: none; }
  .scenario {
    display: flex;
    gap: 14px;
    margin-right: -16px;
    padding-right: 16px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
  }
  .scenario li { flex: 0 0 66%; scroll-snap-align: start; }
}


/* Плашки обложки: regular, свой оттенок у каждой */
.stat--glass b,
.stat--glass span { font-weight: 400; }
.stat--gold { background: rgba(168, 112, 24, .5); }
.stat--gold b { color: #ffe3a0; }
.stat--teal { background: rgba(14, 116, 112, .5); }
.stat--teal b { color: #aef5ee; }
.stat--blue { background: rgba(38, 78, 156, .5); }
.stat--blue b { color: #cfe0ff; }

/* Переносы строк — только на десктопе */
@media (max-width: 640px) { .br-d { display: none; } }

/* Айдентика: доска целиком */
.identity-board { margin: 36px 0 0; max-width: 860px; }
.identity-board img { display: block; width: 100%; height: auto; border-radius: 28px; box-shadow: 0 24px 60px rgba(11, 43, 87, .12); }

/* Фото команды — под плашкой команды, в правой колонке */
.team-photos { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; }
.team-photos img { display: block; width: 100%; height: auto; border-radius: 22px; }

/* Айдентика: на десктопе — по сетке сайта, без фона; на мобильном — цельная доска */
.identity-board { display: none; }
.ident-top { display: grid; align-items: start; }
.ident-top > * { grid-area: 1 / 1; }
.ident-top__text { position: relative; z-index: 2; max-width: 46%; padding-top: clamp(8px, 2vw, 28px); }
.ident-top__img { display: block; width: 100%; height: auto; }
.ident-bottom { display: block; width: 100%; height: auto; margin-top: clamp(8px, 2vw, 28px); }
@media (max-width: 900px) {
  .ident-top__img, .ident-bottom { display: none; }
  .ident-top__text { max-width: none; }
  .identity-board { display: block; }
}

/* Визуал в блоке «результат» */
.result-visual { margin: clamp(28px, 4vw, 44px) 0 0; max-width: 960px; }
.result-visual img { display: block; width: 100%; height: auto; border-radius: 28px; box-shadow: 0 24px 60px rgba(11, 43, 87, .14); }

/* Мокапы в блоке айдентики */
.mockups { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: clamp(28px, 4vw, 56px); max-width: none; }
.mockups figure { margin: 0; overflow: hidden; border-radius: 24px; background: var(--panel); }
.mockups img { display: block; width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 640px) { .mockups { grid-template-columns: 1fr; } }

/* Команда: «продакт + UIX-дизайнер — я» */
.pills li.pills__plus, .pills li.pills__note { background: none; padding: 0 2px; color: var(--muted); font-weight: 600; box-shadow: none; }
.pills li.pills__plus { font-size: 18px; line-height: 1; }


/* ============ Кейс G3 ============ */
.case--g3 {
  --g3-green: #1f8f3f;
  --g3-green-dark: #1a6b34;
  --g3-ink: #0e342e;
}
.case--g3 mark { background: rgba(214, 164, 0, .24); }
.case--g3 .h2 { margin-bottom: 22px; }
.case--g3 .fact__num { color: #b88f00; }
.case--g3 .topbar__nav { gap: 24px; font-size: 16px; }
.case--g3 .topbar__nav .btn { padding: 0 26px; }
.case--g3 .topbar__nav .btn--outline { margin-right: 0; margin-left: 8px; }
.case--g3 .case-hero {
  background:
    linear-gradient(230deg, rgba(0, 0, 0, 0) 10%, rgba(0, 0, 0, .55) 74%),
    #2a2a24 url('assets/img/g3-hero-bg.webp') center / cover no-repeat;
}
.case--g3 .case-hero__sub { max-width: 520px; }
.case--g3 .stat--glass { max-width: none; }
.case--g3 .stat--glass b { font-size: clamp(16px, 1.6vw, 20px); line-height: 1.1; }
.g3-h2-wide { max-width: 720px; }
.case--g3 .lead { max-width: 720px; }

/* Ряды изображений: одинаковая высота в ряду, ширина — по пропорциям кадра */
.g3-row { display: flex; gap: 16px; margin-top: 16px; }
.g3-row figure {
  flex: var(--ar, 1.4) 1 0;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  border-radius: 20px;
  background: var(--panel);
}
.g3-row img { display: block; width: 100%; height: auto; aspect-ratio: var(--ar, 1.4); object-fit: cover; }
.g3-gallery { margin-top: clamp(28px, 4vw, 48px); }
.g3-gallery .g3-row:first-child { margin-top: 0; }
#mihalevich > .container:last-child .g3-row,
#corporate .g3-row { margin-top: clamp(28px, 4vw, 48px); }

/* Исходники: логотип + буклеты на бежевой плашке */
.g3-source {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
  align-items: stretch;
  margin-top: clamp(28px, 4vw, 44px);
  padding: 16px;
  border-radius: var(--radius);
  background: var(--panel);
}
.g3-source figure { margin: 0; overflow: hidden; border-radius: 16px; }
.g3-source img { width: 100%; height: 100%; object-fit: cover; }
.g3-source__logo { display: flex; flex-direction: column; overflow: visible !important; }
.g3-source__logo-box { flex: 1; display: grid; place-items: center; padding: 24px; }
.g3-source__logo-box img { width: min(100%, 333px); height: auto; object-fit: contain; }
.g3-source figcaption, .g3-source__cap, .g3-logos figcaption, .g3-video figcaption { font-size: 14px; color: var(--muted); }
.g3-source figcaption { text-align: center; padding-top: 4px; }
.g3-source__cap { grid-column: 2 / -1; margin-top: -4px; text-align: center; }

/* Михалевич: было / стало */
.g3-logos { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 32px; }
.g3-logos figure { flex: 1 1 220px; max-width: 320px; margin: 0; }
.g3-logos__box {
  display: grid;
  place-items: center;
  min-height: 110px;
  padding: 24px;
  border-radius: 20px;
  background: var(--panel);
}
.g3-logos__box img { width: min(100%, 230px); height: auto; }
.g3-logos figcaption { margin-top: 8px; text-align: center; }
.g3-claim { margin-top: clamp(28px, 4vw, 44px); font-size: 20px; }

/* Корпоративное оформление */
.g3-facts { max-width: 861px; margin-top: 8px; }
.g3-video { margin: clamp(32px, 4vw, 52px) 0 0; }
.g3-video video { display: block; width: 100%; height: auto; max-height: 82vh; border-radius: 28px; background: #111; box-shadow: 0 24px 60px rgba(14, 52, 46, .16); }
.g3-video figcaption { margin-top: 10px; }

/* Орнамент: вывеска справа от текста */
.g3-orn-card { margin: 0; overflow: hidden; border-radius: 20px; background: var(--panel); }
.g3-orn-card img { width: 100%; height: auto; }

/* Ребрендинг: логотип на светлой плашке */
.g3-rebrand__logo { display: grid; place-items: center; aspect-ratio: var(--ar); background: var(--panel) !important; }
.g3-rebrand__logo img { width: 42%; height: auto; aspect-ratio: auto; object-fit: contain; }
@media (min-width: 701px) { .g3-rebrand__logo { aspect-ratio: auto; } }

/* Результат */
.g3-results { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: clamp(24px, 3vw, 36px); }
.g3-results li {
  padding: clamp(24px, 3vw, 40px);
  border-radius: var(--radius);
  background: var(--panel);
  font-family: var(--serif);
  font-style: italic;
  font-weight: 500;
  font-size: clamp(20px, 2.1vw, 28px);
  line-height: 1.3;
  letter-spacing: -0.02em;
  color: var(--g3-ink);
}
.g3-results span { display: block; margin-bottom: 14px; font-size: 18px; color: #b88f00; }

/* Подписи к мокапам */
.g3-row--cap { align-items: flex-start; }
.g3-row--cap figure { overflow: visible; background: none; border-radius: 0; }
.g3-row--cap img { border-radius: 20px; background: var(--panel); }
.g3-row--cap figcaption { margin-top: 10px; padding: 0 4px; font-size: 14px; color: var(--muted); }

/* Отзывы: карусель одной высоты */
.carousel { --h: 520px; position: relative; margin-top: clamp(28px, 4vw, 44px); }
.carousel__track {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.carousel__track::-webkit-scrollbar { display: none; }
.carousel__track figure { flex: 0 0 auto; height: var(--h); margin: 0; overflow: hidden; border-radius: 20px; background: #111; scroll-snap-align: start; }
.carousel__track img, .carousel__track video { display: block; height: 100%; width: auto; max-width: none; }
.carousel__btn {
  position: absolute;
  top: 50%;
  z-index: 2;
  width: 48px;
  height: 48px;
  margin-top: -24px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .92);
  box-shadow: 0 6px 20px rgba(0, 0, 0, .25);
  font: 28px/1 var(--sans);
  color: var(--ink);
  cursor: pointer;
}
.carousel__btn--prev { left: 12px; }
.carousel__btn--next { right: 12px; }
.carousel__btn[disabled] { opacity: 0; pointer-events: none; }

/* Просмотр картинок на весь экран */
.case--g3 main img[src$=".webp"], .case--g3 main img[src$=".svg"] { cursor: zoom-in; }
.zoom { width: 100vw; max-width: 100vw; height: 100vh; max-height: 100vh; margin: 0; padding: 0; border: 0; background: transparent; overflow: hidden; }
.zoom::backdrop { background: rgba(20, 18, 15, .92); }
.zoom__img { position: absolute; inset: 0; margin: auto; max-width: 94vw; max-height: 92vh; width: auto; height: auto; border-radius: 12px; }
.zoom__img--svg { width: min(80vw, 900px); padding: 5vw; background: #f6f2ed; }
.zoom__btn {
  position: absolute;
  z-index: 2;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .92);
  font: 28px/1 var(--sans);
  color: var(--ink);
  cursor: pointer;
}
.zoom__btn--close { top: 16px; right: 16px; }
.zoom__btn--prev { left: 16px; top: 50%; margin-top: -24px; }
.zoom__btn--next { right: 16px; top: 50%; margin-top: -24px; }
.zoom__count { position: absolute; bottom: 14px; left: 0; right: 0; text-align: center; font-size: 14px; color: #fff; }

@media (max-width: 900px) {
  .g3-source { grid-template-columns: 1fr 1fr; }
  .g3-source__logo { grid-column: 1 / -1; }
  .g3-source__cap { grid-column: 1 / -1; }
  .g3-text2, .g3-results { grid-template-columns: 1fr; }
  .g3-orn-side { max-width: 460px; }
}
@media (max-width: 700px) {
  .g3-row { flex-direction: column; }
  .g3-row figure { flex: none; }
  .g3-reviews { flex-direction: row; flex-wrap: wrap; }
  .g3-reviews figure { flex: 1 1 100%; }
  .g3-reviews figure:first-child, .g3-reviews figure:nth-child(2) { flex: 1 1 calc(50% - 8px); }
  .g3-rebrand__logo img { width: 30%; }
}
.g3-rebrand { margin-top: clamp(28px, 4vw, 44px); }
@media (max-width: 700px) { .g3-reviews { align-items: flex-start; } }


/* Обложка G3: заголовок на той же высоте, что у Nomad; плашки прижаты к низу */
@media (min-width: 901px) {
  .case--g3 .case-hero { justify-content: flex-start; padding-top: 106px; }
  .case--g3 .case-hero__stats { margin-top: auto; padding-top: 24px; }
}
