/* Страница кейса: одна колонка 800 по центру на фоне --bg, как главная */
.case-page { background: var(--bg); }

.cs {
  display: flex;
  flex-direction: column;
  gap: 56px;
  width: min(800px, 100% - 2 * var(--pad));
  margin: 0 auto;
  padding: 80px 0 148px;
  background: none;
  border-radius: 0;
  color: var(--ink);
  font-size: 18px;
  line-height: 28px;
}
.cs-head { display: flex; flex-direction: column; gap: 12px; }
.cs-title { font-family: var(--accent-font); font-size: clamp(36px, 4vw, 56px); font-weight: 500; line-height: 1.1; letter-spacing: -0.045em; text-wrap: balance; }
.cs-meta { color: var(--muted); line-height: 1.5; }
/* надзаголовок: компания слева, год справа, мелко над названием кейса */
.cs-eyebrow { display: flex; justify-content: space-between; gap: 16px; color: var(--muted); font-size: 16px; line-height: 24px; }
.cs-img { width: 100%; height: auto; border-radius: 24px; background: var(--bg); }
video.cs-img { display: block; }
.cs-img--empty { aspect-ratio: 800 / 553; }
/* картинка с подписью снизу; пока скриншотов нет, вместо картинки серая заглушка 960×600 */
.cs-fig { display: flex; flex-direction: column; gap: 16px; margin: 0; }
.cs-fig > .cs-img--empty { aspect-ratio: 960 / 600; background: var(--subtle); }
/* подписи к картинкам по центру (Дарья 27.10) */
.cs-cap { color: var(--muted); font-size: 16px; line-height: 24px; text-align: center; }
/* картинки кейса шире текста: 960×600, по центру колонки, выходят за неё на 80 с каждой стороны */
.case-page { overflow-x: clip; }
.cs > .cs-ba, .cs > .cmp, .cs-fig > .cs-img, .cs-sec > .cs-img, .cs-sub > .cs-img, .cs-gal > .cs-gal-stage { align-self: center; width: min(960px, 100vw - 2 * var(--pad)); max-width: none; }
.cs b { font-weight: 600; }

/* все карточки в кейсе одного стиля: плашка --card без обводки на фоне (Дарья 26.10), radius.m, отступ 24, зазор 8 */
.cs-card, .cs-insight, .cs-find, .cs-stats > div, .cs-refl-card { display: flex; flex-direction: column; gap: 8px; padding: 24px; border-radius: 24px; background: var(--card); font-size: 18px; line-height: 28px; }
/* Вертикальный ритм кейса (22.10, Дарья попросила больше воздуха):
   между разделами с h2 — 96 (72 на телефоне), между подразделами с h3 и прочими блоками — 56 (40),
   заголовок h2 → текст 20, h3 → текст 16, абзац → абзац 20, текст ↔ картинка или карточки 32 */
.cs-sec { display: flex; flex-direction: column; gap: 20px; }
.cs > .cs-sec { margin-top: 40px; }
.cs-sub > .cs-h3 { margin-bottom: -4px; }
.cs .cs-sec > :is(.cs-img, .cs-gal, .cs-insights, .cs-finds, .cs-stats, .cs-refl, .cs-notes, .cs-more),
.cs .cs-sub > :is(.cs-img, .cs-gal, .cs-insights, .cs-finds, .cs-stats, .cs-refl, .cs-notes, .cs-more) { margin-block: 12px; }
.cs .cs-sec > :last-child, .cs .cs-sub > :last-child { margin-bottom: 0; }
.cs-sec--wide { gap: 32px; }
.cs-sec--wide .cs-h2 { margin-bottom: 0; }
.cs-sub { display: flex; flex-direction: column; gap: 20px; }
.cs-h2 { font-family: var(--accent-font); font-size: 32px; font-weight: 600; line-height: 1.2; letter-spacing: -0.04em; }
.cs-h3 { font-family: var(--accent-font); font-size: 20px; font-weight: 600; line-height: 1.3; letter-spacing: -0.02em; }

.cs ul { list-style: disc; padding-left: 27px; margin: 0 0 8px; }
.cs ul:last-child { margin-bottom: 0; }
.cs p.gap { margin-top: 28px; }
.cs-points dt { font-weight: 600; }
.cs-points dd { margin: 0 0 12px; }
.cs-points dd:last-child { margin-bottom: 0; }

/* паспорт под заголовком */
/* три колонки под линией: подпись серым, значение под ней */
.cs-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px 24px; margin: 20px 0 0; padding-top: 20px; border-top: 1px solid var(--line); font-size: 16px; line-height: 24px; }
.cs-facts dt { font-size: 14px; line-height: 20px; color: var(--muted); }
.cs-facts dd { margin: 4px 0 0; }

/* карточки инсайтов с цитатой продавца */
.cs-insights { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.cs-insight-num, .cs-find-num { font-family: var(--accent-font); font-weight: 700; font-size: 14px; color: var(--muted); }
.cs-insight-title { font-size: 18px; line-height: 26px; font-weight: 600; }
/* цитата респондента: полоска слева вместо иконки кавычек */
.cs-insight blockquote { margin: auto 0 0; padding: 2px 0 2px 14px; border-left: 2px solid var(--ink); font-size: 15px; line-height: 22px; }
.cs-insights .cs-insight p + blockquote { margin-top: 8px; }
.cs-finds { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
/* пять выводов: три в первом ряду и два пошире во втором, без пустого места */
.cs-find { grid-column: span 2; }
.cs-find:nth-child(n+4):nth-last-child(-n+2) { grid-column: span 3; }

/* скриншот с номерами и пояснения под ним */
.cs-anno { position: relative; }
.cs-pin { position: absolute; translate: -50% -50%; display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--on-image-ink); color: var(--on-image); font-size: 11px; font-weight: 600; line-height: 1; box-shadow: 0 0 0 3px var(--on-image); }
.cs-notes, .cs .cs-notes { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; margin: 0; padding: 0; list-style: none; counter-reset: note; font-size: 18px; line-height: 28px; }
/* пояснения списком друг под другом, без номеров: цифры на скриншоте мешали читать интерфейс (решение Дарьи 20.10) */
.cs-notes b { display: block; margin-bottom: 2px; }

/* полоса цифр в результате */
.cs-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.cs-stats--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cs-stat { font-family: var(--accent-font); font-weight: 600; font-size: 40px; line-height: 1; letter-spacing: -0.04em; }
.cs-stats span:not(.cs-stat) { font-size: 15px; line-height: 21px; color: var(--muted); }

/* раскрывашка для подробностей */
.cs-more { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.cs-more summary { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 16px 0; cursor: pointer; list-style: none; font-weight: 500; }
.cs-more summary::-webkit-details-marker { display: none; }
.cs-more summary::after { content: "+"; font-size: 24px; line-height: 1; transition: rotate 0.2s ease; }
.cs-more[open] summary::after { rotate: 45deg; }
.cs-more > p, .cs-more > ul { margin-bottom: 16px; }

/* рефлексия карточками */
/* рефлексия: три карточки друг под другом, в две колонки третья висела бы одна */
.cs-refl { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }

/* В конце кейса две простые ссылки под линией: «Назад» слева, «Следующий кейс» справа (Дарья 27.10) */
.cs-next { display: flex; justify-content: space-between; align-items: center; gap: 24px; margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--line); }
.cs-next-link { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; transition: opacity 0.2s ease; }
.cs-next-link .icon { transition: translate 0.2s ease; }
.cs-next-link:hover { opacity: 0.6; }
.cs-next-link:first-child:hover .icon { translate: -3px 0; }
.cs-next-link:last-child:hover .icon { translate: 3px 0; }

@media (prefers-reduced-motion: reduce) { .cs-next-link, .cs-next-link .icon { transition: none; } }


@media (max-width: 640px) {
  .cs { gap: 40px; padding: 40px 0 120px; font-size: 16px; line-height: 24px; }
  .cs > .cs-sec { margin-top: 32px; }
  .cs-title { font-size: 32px; }
  .cs-h2 { font-size: 24px; }
  .cs-h3 { font-size: 18px; }
  .cs-img { border-radius: 16px; }
  .cs-card, .cs-insight, .cs-find, .cs-stats > div, .cs-refl-card { padding: 20px; font-size: 16px; line-height: 24px; }
  .cs-notes, .cs .cs-notes { font-size: 16px; line-height: 24px; }
  .cs-facts, .cs-insights, .cs-finds, .cs-notes, .cs-stats, .cs-refl { grid-template-columns: minmax(0, 1fr); }
  .cs-stat { font-size: 32px; }
  .cs-find, .cs-find:nth-child(n+4):nth-last-child(-n+2) { grid-column: auto; }
  .cs-pin { width: 16px; height: 16px; font-size: 10px; box-shadow: 0 0 0 2px var(--on-image); }
}

/* До/после: картинка «после» снизу, «до» сверху обрезана по --pos; тянуть можно за любое место */
.cs-ba { position: relative; overflow: hidden; border-radius: 24px; user-select: none; touch-action: pan-y; }
.cs-ba .cs-img { display: block; width: 100%; border-radius: 0; }
.cs-ba-before { position: absolute; inset: 0; clip-path: inset(0 calc(100% - var(--pos)) 0 0); }
.cs-ba-label { position: absolute; top: 16px; left: 16px; padding: 4px 12px; border-radius: 999px; background: var(--cursor-bg); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); color: var(--on-image); font-size: 14px; font-weight: 500; line-height: 20px; pointer-events: none; }
.cs-ba-label--after { left: auto; right: 16px; }
/* на десктопе подписей «До/После» нет: выглядели как кнопки, но не нажимались (решение Дарьи 20.10); на телефоне остаются */
@media (min-width: 641px) { .cs-ba-label { display: none; } }
.cs-ba-handle { position: absolute; top: 0; bottom: 0; left: var(--pos); width: 2px; translate: -1px 0; background: var(--on-image); box-shadow: 0 0 0 1px var(--ink-10); pointer-events: none; }
.cs-ba-handle .icon { position: absolute; top: 50%; left: 50%; translate: -50% -50%; box-sizing: content-box; width: 20px; height: 20px; padding: 10px; border-radius: 50%; background: var(--on-image); color: var(--on-image-ink); box-shadow: var(--shadow-handle); }
/* range остаётся для клавиатуры и скринридера; мышь и палец тянут шторку через pointer-события в anim.js */
.cs-ba { cursor: ew-resize; }
.cs-ba-range { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; pointer-events: none; }

/* Карусель из нескольких до/после: слайды едут по --slide, переключаются только точками,
   без свайпа, чтобы горизонтальный жест на телефоне всегда тянул шторку */
.cs-carousel { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.cs-slides { display: flex; width: 100%; overflow: hidden; border-radius: 24px; }
.cs-slides .cs-ba { flex: 0 0 100%; border-radius: 0; translate: calc(-100% * var(--slide, 0)) 0; transition: translate 0.5s cubic-bezier(0.2, 0.8, 0.2, 1); }
.cs-dots { display: flex; gap: 0; }
.cs-dot { display: grid; place-items: center; width: 16px; height: 24px; padding: 0; border: 0; background: none; cursor: pointer; }
.cs-dot::before { content: ""; width: 6px; height: 6px; border-radius: 999px; background: var(--line-strong); transition: width 0.3s ease, background 0.3s ease; }
.cs-dot[aria-current="true"] { width: 24px; }
.cs-dot[aria-current="true"]::before { width: 14px; background: var(--ink); }
.cs-dot:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: 999px; }
@media (max-width: 640px) {
  .cs-ba, .cs-slides { border-radius: 16px; }
  .cs-ba-label { top: 10px; left: 10px; padding: 2px 10px; font-size: 13px; }
  .cs-ba-label--after { left: auto; right: 10px; }
  .cs-ba-handle .icon { width: 16px; height: 16px; padding: 8px; }
}
@media (prefers-reduced-motion: reduce) { .cs-slides .cs-ba, .cs-dot::before { transition: none; } }
.cs-ba-range:focus-visible ~ x, .cs-ba:has(.cs-ba-range:focus-visible) .cs-ba-handle .icon { outline: 2px solid var(--ink); outline-offset: 2px; }

/* Карусель состояний экрана по образцу ReUI c-carousel-1 (Carousel из shadcn/ui): картинки едут по --slide и тянутся
   мышью или пальцем, круглые белые стрелки с обводкой поверх картинки, снизу подпись к текущему состоянию и точки.
   Точки общие с каруселью до/после (.cs-dots, .cs-dot) */
.cs-gal { display: flex; flex-direction: column; gap: 16px; }
.cs-gal-stage { position: relative; }
.cs-gal-view { overflow: hidden; border-radius: 24px; touch-action: pan-y; cursor: grab; user-select: none; }
.cs-gal-view.is-dragging { cursor: grabbing; }
.cs-gal-track { display: flex; translate: calc(-100% * var(--slide, 0) + var(--drag, 0px)) 0; transition: translate 0.5s cubic-bezier(0.2, 0.8, 0.2, 1); }
.cs-gal-view.is-dragging .cs-gal-track { transition: none; }
.cs-slide { flex: 0 0 100%; margin: 0; }
.cs-slide .cs-img { display: block; border-radius: 0; pointer-events: none; }
.cs-gal-bar { display: flex; align-items: center; justify-content: center; gap: 24px; text-align: center; }
.cs-gal-caps { margin: 0; color: var(--muted); font-size: 16px; line-height: 24px; }
.cs-gal-nav { display: flex; align-items: center; flex: none; }
/* стрелка как Button variant="outline" size="icon" rounded-full: 32 px, белая, тонкая обводка */
.cs-gal-arrow { position: absolute; top: 50%; translate: 0 -50%; display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: var(--card); color: var(--ink); cursor: pointer; transition: background 0.2s ease, opacity 0.2s ease; }
/* стрелки сидят на краях картинки, центром на её границе (решение Дарьи 22.10); на телефоне внутри, чтобы не упираться в край экрана */
.cs-gal-prev { left: 0; translate: -50% -50%; }
.cs-gal-next { right: 0; translate: 50% -50%; }
.cs-gal-arrow .icon { width: 16px; height: 16px; }
.cs-gal-arrow:hover:not(:disabled) { background: var(--subtle); }
.cs-gal-arrow:disabled { opacity: 0.5; cursor: default; }
.cs-gal-arrow:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
@media (max-width: 640px) {
  .cs-gal-view { border-radius: 16px; }
  .cs-gal-prev { left: 8px; translate: 0 -50%; }
  .cs-gal-next { right: 8px; translate: 0 -50%; }
  .cs-gal-bar { flex-direction: column; align-items: center; gap: 12px; }
  .cs-gal-caps { font-size: 15px; line-height: 22px; }
}
@media (prefers-reduced-motion: reduce) { .cs-gal-track { transition: none; } }

/* источник под результатом: мелко, серым, ссылка подчёркнута */
.cs-source { color: var(--muted); font-size: 14px; line-height: 20px; }
.cs-source a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.cs-source a:hover { color: var(--ink); }

/* ══ Image compare ════════════════════════════════════════
   Компонент Image compare из Bencho (bencho.dev, лицензия MIT), перенесён без React. Токены Bencho заменены нашими:
   --fill-on → --ink (тёмное на светлом), --fill-slab → --card (белая ручка), --font-ui → --onest, --signal → --ink
   (фокус у нас везде чёрной обводкой). Своих глобальных переменных не заводим. */
.cmp {
  position: relative;
  overflow: hidden;
  /* у Bencho touch-action: none, но тогда на телефоне через обложку нельзя пролистать страницу;
     pan-y отдаёт браузеру вертикальный жест, а горизонтальный остаётся линии */
  touch-action: pan-y;
  cursor: ew-resize;
  outline: none;
  user-select: none;
  -webkit-user-select: none;
  border-radius: 24px;
  background: var(--bg);}

.cmp:focus-visible { box-shadow: 0 0 0 2px var(--ink); }

/* картинка «после» лежит в потоке и задаёт высоту блока: у нас ширина резиновая, а не 270×360 */
.cmp-after { display: block; width: 100%; height: auto; border-radius: 0; -webkit-user-drag: none; }

.cmp-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 0;
  -webkit-user-drag: none;}

/* no drift now: two separate photographs have to stay exactly in
   register, or the x-ray stops lining up with the picture */
.cmp-before { position: absolute; inset: 0; }

.cmp-tag {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--cursor-bg);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  color: var(--on-image);
  font-family: var(--onest);
  font-size: 12px;
  font-weight: 500;
  pointer-events: none;
  letter-spacing: 0em;}

.cmp-tag.cmp-right { left: auto; right: 12px; }

/* the line is drawn, so it can bend: a 2px white curve with a
   soft glow, over the whole block */
/* у нас светлые скриншоты, и белое свечение на белом пропадает: вместо него тонкая тёмная тень, как была у прошлой шторки */
.cmp-line {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
  filter: var(--outline-on-image);}

.cmp-line path { fill: none; stroke: var(--on-image); stroke-width: 2; }

.cmp-grip { position: absolute; top: 0; bottom: 0; left: 50%; width: 0; pointer-events: none; }

.cmp-knob {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 36px;
  height: 36px;
  translate: -50% -50%;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--on-image);
  color: var(--on-image-ink);
  box-shadow: var(--shadow-control);
  transition: scale 220ms cubic-bezier(0.24, 1.34, 0.38, 1);}

.cmp:hover .cmp-knob { scale: 1.08; }

.cmp[data-held] .cmp-knob { scale: 0.9; }

@media (max-width: 640px) { .cmp { border-radius: 16px; } }
@media (prefers-reduced-motion: reduce) { .cmp-knob { transition: none; } }

/* цитата в подразделе и простой список (новые тексты кейсов 27.10) */
.cs-list { display: grid; gap: 8px; padding-left: 20px; list-style: disc; }

/* Кейс промокодов по макету Дарьи 01.11 (Figma WpXhmcmDLEoLI0z7KaWnzd, узел 52174-329253).
   Колонка 1200, разделы в две колонки: слева заголовок 32/600, справа текст 680; между разделами 80. */
.pc { display: flex; flex-direction: column; gap: 80px; width: min(1200px, 100% - 2 * var(--pad)); margin: 0 auto; padding: 80px 0 148px; color: var(--ink); font-size: 20px; line-height: 1.55; }
.pc-head { display: flex; flex-direction: column; gap: 12px; }
.pc-eyebrow { color: var(--muted); font-size: 16px; line-height: 24px; }
.pc-title { font-size: clamp(40px, 4.4vw, 56px); font-weight: 500; line-height: 1.1; letter-spacing: -0.03em; }
.pc-sec { display: grid; grid-template-columns: minmax(0, 1fr) 680px; gap: 20px; }
.pc-h2 { font-size: 32px; font-weight: 600; line-height: 1.2; letter-spacing: -0.02em; }
.pc-h3 { font-size: 24px; font-weight: 600; line-height: 1.5; letter-spacing: -0.01em; }
.pc-side { display: flex; flex-direction: column; gap: 8px; }
.pc-body { display: flex; flex-direction: column; gap: 40px; min-width: 0; }
.pc-body--tight { gap: 24px; }
.pc-item { display: flex; flex-direction: column; gap: 8px; }
.pc-item p + p { margin-top: 0; }
.pc-label { color: var(--muted); font-size: 18px; font-weight: 400; line-height: 1.5; }
.pc-group { display: flex; flex-direction: column; gap: 48px; }
.pc-group--sm { gap: 56px; }
.pc-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.pc-card { display: flex; flex-direction: column; gap: 8px; padding: 24px; border-radius: 24px; background: var(--card); }
.pc-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.pc-stat { font-size: 32px; font-weight: 600; line-height: 1; letter-spacing: -0.02em; }
.pc-stat-cap { color: var(--muted); }
.pc-source { color: var(--muted); font-size: 15px; line-height: 1.4; }
.pc-source a { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line-strong); transition: color 0.2s ease; }
.pc-source a:hover { color: var(--ink); }
/* картинки из Figma: на фоне --card, углы скругляем кодом; «вайб» уже с отступами на фоне страницы */
.pc-img { display: block; width: 100%; height: auto; border-radius: 32px; background: var(--card); }
.pc-img--flat { border-radius: 0; background: none; }
.pc-cmp { border-radius: 32px; background: var(--card); }
@media (max-width: 1024px) {
  .pc-sec { grid-template-columns: 1fr; gap: 16px; }
  .pc-body { gap: 32px; }
}
@media (max-width: 640px) {
  .pc { gap: 56px; padding: 40px 0 120px; font-size: 18px; }
  .pc-h2 { font-size: 26px; }
  .pc-h3 { font-size: 22px; }
  .pc-label { font-size: 16px; }
  .pc-cards, .pc-stats { grid-template-columns: 1fr; }
  .pc-card { padding: 20px; border-radius: 20px; }
  .pc-img, .pc-cmp { border-radius: 16px; }
  .pc-group { gap: 32px; }
}
/* Vega 01.11: карусели на всю колонку, заглушка под видео каталога (чёрный фрейм «Анимация») и под скриншот кабинета */
.pc .cs-gal > .cs-gal-stage { width: 100%; }
.pc .cs-gal-view { border-radius: 32px; background: var(--card); }
.pc-video-stub { display: grid; place-items: center; aspect-ratio: 1200 / 690; border-radius: 32px; background: var(--video-stub); color: var(--muted); font-size: 18px; }
.pc-stub--grey { background: var(--card); }
.pc-card--wide { grid-column: 1 / -1; }
@media (max-width: 640px) {
  .pc .cs-gal-view, .pc-video-stub { border-radius: 16px; }
}
/* между заголовком кейса и до/после 40 (Дарья 01.11), а не 80, как между разделами */
.pc-head + .pc-cmp { margin-top: -40px; }
@media (max-width: 640px) { .pc-head + .pc-cmp { margin-top: -16px; } }
