/* ============================================================
   Страницы кейсов в UI-ките главной v3. Подключается после
   style.css (шрифт, токены, .foot). Классы v3-* — из разметки
   кейсов: их читают js/images.js, projects.js и jtbd-board.js.
   ============================================================ */

:root {
  --text-3: #85888f;
  --inset: clamp(18px, 3.4vw, 52px);   /* отступ текста внутри блока, как .copy */
  --space: clamp(64px, 8vw, 120px);    /* воздух вокруг текстовых блоков, как .exp */
  --bar: 76px;                         /* высота зоны фиксированных кнопок */
}

/* ── Кнопки сверху: liquid glass ── */
.bar { position: fixed; z-index: 100; top: 16px; left: 16px; right: 16px; display: flex; justify-content: space-between; gap: 8px; pointer-events: none; }
.glass {
  pointer-events: auto; display: inline-flex; align-items: center; height: 40px; padding: 0 18px; border-radius: 999px;
  font-size: 14px; line-height: 20px; font-weight: 500; letter-spacing: -0.01em;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0.22));
  -webkit-backdrop-filter: blur(16px) saturate(1.9) brightness(1.04); backdrop-filter: blur(16px) saturate(1.9) brightness(1.04);
  border: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.95), inset 0 -1px 0 rgba(0, 0, 0, 0.06), inset 0 0 14px rgba(255, 255, 255, 0.35), 0 10px 28px -10px rgba(10, 20, 40, 0.35), 0 0 0 0.5px rgba(0, 0, 0, 0.07);
  transition: transform 0.25s var(--ease);
}
.glass:hover { transform: translateY(-1px); }
.glass:focus-visible { border-radius: 999px; }
@media (max-width: 600px) { .bar { top: 10px; left: 10px; right: 10px; } }

/* ── Типографика ── */
.v3-h1, .v3-h2, .v3-h3 { font-weight: 500; letter-spacing: -0.04em; }
.v3-h2 { font-size: 40px; line-height: 40px; text-wrap: balance; }
.v3-h3 { font-size: 24px; line-height: 24px; }
.v3-body-l, .v3-body-l2, .v3-caption { font-size: 16px; line-height: 20px; }
/* Акцент в крупном заголовке: остальной текст приглушён */
.v3-h2:has(.v3-highlight) { color: var(--text-3); }
.v3-highlight { color: var(--text); }

/* ── Сетка ── */
.v3-case-hero, .v3-section { max-width: var(--max); margin-inline: auto; padding-inline: var(--pad); }
.v3-section { margin-block-start: var(--gap); }

/* ── Хиро кейса ── */
.v3-case-hero-head { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 140px 0 72px; }
.v3-hero-icon { width: 96px; height: 96px; margin-block-end: 32px; overflow: hidden; flex: none; }
.v3-hero-icon.v3-ph { display: none; }
.v3-hero-icon .v3-slot-media { width: 100%; height: 100%; object-fit: contain; }
.v3-h1 {
  font-size: 80px; line-height: 80px; max-width: 18em; text-wrap: balance; padding: 0 0.08em 0.12em;
  background: radial-gradient(ellipse 75% 140% at 50% 62%, var(--text) 0%, var(--text) 22%, color-mix(in srgb, var(--text) 42%, var(--bg)) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.v3-case-hero-desc { max-width: 62ch; margin-block-start: 20px; }
.v3-tags { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-block-start: 32px; }
.v3-tag {
  display: inline-flex; align-items: center; height: 32px; padding: 0 14px; border-radius: 999px;
  background: var(--pill); font-size: 14px; line-height: 20px; font-weight: 500; box-shadow: 0 0 0 1px var(--hairline);
}

/* ── Медиа-слоты ── */
.v3-ph { background: var(--block); display: flex; align-items: center; justify-content: center; color: transparent; font-size: 0; }
.v3-slot-media { display: block; width: 100%; height: auto; border-radius: inherit; }
@keyframes v3-shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.v3-shimmer { background: linear-gradient(90deg, var(--block) 25%, var(--bg) 50%, var(--block) 75%); background-size: 200% 100%; animation: v3-shimmer 1.4s ease-in-out infinite; }

.v3-full-media > [data-slot] { position: relative; width: 100%; }

/* ── Текстовый блок: ярлык слева, содержимое справа (как Experience) ── */
.v3-section:has(> .v3-text-block, > .v3-text-block-group) { padding: var(--space) calc(var(--pad) + var(--inset)); margin-block: 0; }
.v3-section + .v3-section:has(> .v3-text-block, > .v3-text-block-group) { margin-block-start: 0; }
.v3-text-block-group { display: grid; grid-template-columns: minmax(0, 1fr); gap: 56px; }
.v3-text-block { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; align-items: start; }
.v3-text-block-label .v3-h3 { max-width: 16ch; text-wrap: balance; }
.v3-text-block-content { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.v3-text-block-content .v3-body-l { max-width: 62ch; }

/* ── Метрики ── */
.v3-text-block-content.v3-metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); }
.v3-metric-card { background: var(--block); min-height: 200px; padding: 24px; display: flex; flex-direction: column; justify-content: space-between; gap: 24px; }
.v3-metric-card .v3-h2 { font-size: clamp(32px, 4.6vw, 64px); line-height: 1; }

/* ── Отзывы ── */
.v3-testimonials { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap); }
.v3-testimonial-card { background: var(--block); padding: var(--inset); display: flex; flex-direction: column; gap: 24px; }
.v3-testimonial-company { color: var(--text-2); }
.v3-testimonial-author { display: flex; align-items: center; gap: 12px; margin-block-start: auto; }
.v3-testimonial-author .v3-caption + .v3-caption { color: var(--text-2); }
.v3-testimonial-avatar { width: 48px; height: 48px; border-radius: 999px; flex: none; overflow: hidden; }
.v3-testimonial-author-name { font-weight: 500; }

/* ── Блок «текст + экраны»: один серый прямоугольник ── */
.v3-split { display: grid; grid-template-columns: 1fr 1fr; background: var(--block); }
.v3-split-text { align-self: start; padding: var(--inset); display: flex; flex-direction: column; gap: 14px; }
.v3-split-text .v3-h2 { max-width: 15ch; margin-block-end: 0; }
.v3-split-text .v3-body-l2 { max-width: 46ch; }
.v3-split--sticky .v3-split-text { position: sticky; top: 0; padding-block-start: max(var(--inset), var(--bar)); }
.v3-split-media { min-width: 0; display: flex; flex-direction: column; }
.v3-inset-box { position: relative; height: 660px; display: flex; align-items: center; justify-content: center; }
.v3-inset-box > [data-slot] { height: 580px; max-width: 100%; aspect-ratio: 9 / 19.5; border-radius: 12px; }
.v3-inset-badge { position: absolute; z-index: 2; top: 40px; right: calc(50% + 150px); white-space: nowrap; }
@media (max-width: 1100px) { .v3-inset-badge { top: 12px; left: 12px; right: auto; } }
.v3-split-media > .v3-h2 { padding: 40px var(--inset) var(--space) 0; text-wrap: pretty; }
/* Веб-экраны: текст сверху, картинка по центру снизу (как Landa на главной) */
.v3-split:has(.v3-inset-box--web) { grid-template-columns: 1fr; }
.v3-split:has(.v3-inset-box--web) .v3-split-text .v3-h2 { max-width: 24ch; }
.v3-split:has(.v3-inset-box--web) .v3-split-text .v3-body-l2 { max-width: 76ch; }
.v3-inset-box--web { height: auto; padding: 0 var(--inset) var(--inset); }
.v3-inset-box--web > [data-slot] { width: min(100%, 1040px); height: auto; aspect-ratio: 740 / 428; }

/* ── JTBD-канвас ── */
.v3-jtbd-board {
  display: flex; align-items: flex-start; gap: var(--gap); height: min(90svh, 820px); padding: var(--gap);
  background: var(--block); overflow-x: auto; overflow-y: hidden; scroll-snap-type: x proximity; scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.v3-jtbd-board::-webkit-scrollbar { display: none; }
.v3-jtbd-col { flex: 0 0 340px; scroll-snap-align: center; display: flex; flex-direction: column; gap: var(--gap); content-visibility: auto; contain-intrinsic-size: 340px 800px; }
.v3-jtbd-col-head { background: var(--text); color: #fff; padding: 16px; display: flex; flex-direction: column; gap: 4px; }
.v3-jtbd-col-num { font-size: 14px; color: #9a9da3; }
.v3-jtbd-col-title { font-size: 20px; line-height: 24px; font-weight: 500; letter-spacing: -0.02em; }
.v3-jtbd-col-desc { font-size: 14px; line-height: 18px; color: #c9cbd0; }
.v3-jtbd-job { background: #fff; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.v3-jtbd-job-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.v3-jtbd-job-title { font-size: 15px; line-height: 19px; font-weight: 500; }
.v3-jtbd-field { display: flex; flex-direction: column; gap: 2px; }
.v3-jtbd-field-label { font-size: 12px; line-height: 16px; color: var(--text-3); }
.v3-jtbd-field-value { font-size: 13px; line-height: 17px; }
.v3-jtbd-sev { flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 3px 8px 3px 6px; border-radius: 999px; font-size: 12px; line-height: 16px; font-weight: 500; }
.v3-jtbd-sev::before { content: ""; width: 6px; height: 6px; border-radius: 50%; }
.v3-jtbd-sev--high { background: #fde7e7; color: #c22222; } .v3-jtbd-sev--high::before { background: #e5484d; }
.v3-jtbd-sev--mid { background: #fcefdb; color: #8f5200; } .v3-jtbd-sev--mid::before { background: #f5a623; }
.v3-jtbd-sev--low { background: #e1f5ea; color: #16794a; } .v3-jtbd-sev--low::before { background: #30a46c; }
.v3-jtbd-sev--none { background: var(--block); color: var(--text-2); } .v3-jtbd-sev--none::before { background: var(--text-3); }

.v3-body--case .foot { margin-block-start: var(--space); }

@media (min-width: 641px) { .v3-hide-desktop { display: none !important; } }

@media (max-width: 960px) { .v3-text-block { grid-template-columns: minmax(0, 1fr); gap: 16px; } }
@media (max-width: 820px) {
  .v3-case-hero-head { padding: 104px 0 48px; }
  .v3-h1 { font-size: clamp(36px, 9vw, 64px); line-height: 1; }
  .v3-h2 { font-size: 32px; line-height: 32px; }
  .v3-testimonials { grid-template-columns: minmax(0, 1fr); }
  .v3-split { grid-template-columns: minmax(0, 1fr); }
  .v3-metric-card .v3-h2 { font-size: clamp(32px, 11vw, 64px); }
  .v3-split--sticky .v3-split-text { position: static; padding-block-start: var(--inset); }
  .v3-inset-box { height: 600px; }
  .v3-inset-box > [data-slot] { height: 540px; }
  .v3-inset-box--web { height: auto; }
  .v3-inset-box--web > [data-slot] { height: auto; }
  .v3-split-media > .v3-h2 { padding: 24px var(--inset) var(--inset); }
}
@media (max-width: 640px) {
  .v3-h2 { overflow-wrap: break-word; }
  .v3-h1 br { display: none; }
  .v3-hide-mobile { display: none !important; }
  /* Широкие картинки на телефоне листаются по горизонтали */
  .v3-full-media:not(.v3-full-media--fit) { display: flex; height: 340px; overflow-x: auto; scrollbar-width: none; }
  .v3-full-media:not(.v3-full-media--fit)::-webkit-scrollbar { display: none; }
  .v3-full-media:not(.v3-full-media--fit) > [data-slot] { flex: none; height: 100%; width: auto; }
  .v3-full-media:not(.v3-full-media--fit) .v3-slot-media { height: 100%; width: auto; max-width: none; }
  .v3-metric-card { min-height: 150px; padding: 16px; }
  .v3-metric-card .v3-h2 { font-size: clamp(28px, 10vw, 40px); }
  .v3-jtbd-col { flex-basis: 260px; contain-intrinsic-size: 260px 800px; }
}
@media (max-width: 360px) { .v3-text-block-content.v3-metrics { grid-template-columns: minmax(0, 1fr); } .v3-h2 { font-size: 28px; line-height: 28px; } .glass { padding: 0 14px; } }
@media (prefers-reduced-motion: reduce) { .v3-shimmer { animation: none; } .glass { transition: none; } }
