/* Кейс 24QW (fix_2225_24qw, 29.11): заход с паками, экраны аппа, контент-завод, лента вертикалок с линзой, россыпь виджетов.
   Только страница cases/24qw.html. Всё анимированное — transform/rotate, раскладка не прыгает: у медиа заданы пропорции. */

/* ---------- заход ---------- */
.qw-hero { position: relative; margin: calc(var(--u) * 7) var(--m) 0; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--g); align-items: start; }
.qw-hero-v { grid-column: 1 / 7; position: relative; width: 100%; max-width: 540px; } /* 1080 px ролика = 2x */
.qw-hero-f { position: relative; z-index: 1; }
.qw-hero-f .box { border-radius: 6px; overflow: hidden; }
.qw-hero-t { grid-column: 7 / 12; padding-top: calc(var(--u) * 1); }
.qw-hero-t p { max-width: 34em; }
.qw-hero-t p + p { margin-top: .8em; }
.qw-auth { margin-top: 1.6em !important; padding-top: .9em; border-top: 1px solid #e6e6e6; }

.qw-pk { position: absolute; z-index: 2; pointer-events: auto; }
.qw-pk .qp-pack__img { filter: drop-shadow(0 18px 22px rgba(0, 30, 80, .28)); }
.qw-pk-a { width: 190px; top: -46px; right: -96px; rotate: -11deg; }           /* лимитка на углу ролика, поверх */
.qw-pk-m { display: none; }
.qw-pk-b { width: 210px; right: 9%; bottom: -40px; rotate: 9deg; }             /* core под текстом */
.qw-pk-c { width: 170px; right: calc(var(--m) * -1 - 46px); top: -10px; rotate: 14deg; } /* physiq уходит за правый край */
.qw-pk-c .qp-pack__img { filter: saturate(.7) drop-shadow(0 18px 22px rgba(0, 30, 80, .28)); }

/* ---------- приложение ---------- */
.qw-app { position: relative; }
.qw-ph-row { position: relative; z-index: 1; display: flex; justify-content: center; gap: clamp(14px, 4.4vw, 76px); align-items: flex-start; padding-bottom: calc(var(--u) * 4); }
.qw-ph { flex: 0 0 clamp(140px, 18.5vw, 266px); margin: 0; }
.qw-ph1 { margin-top: 72px; } .qw-ph2 { margin-top: 24px; } .qw-ph3 { margin-top: 96px; }
.qw-ph-s { position: relative; overflow: hidden; border-radius: 13% / 6%; background: #8cc7f5; box-shadow: 0 0 0 5px #111, 0 24px 40px -18px rgba(0, 30, 80, .35); }
.qw-ph-s img, .qw-ph-s video { width: 100%; height: 100%; object-fit: cover; cursor: zoom-in; }
.qw-ph figcaption { margin-top: 14px; color: var(--mute); max-width: 22em; }
.qw-fw { position: absolute; z-index: 2; height: auto; pointer-events: none; animation: qw-float 5s ease-in-out infinite; filter: drop-shadow(0 14px 18px rgba(0, 30, 80, .22)); }
.qw-fw-a1 { width: 150px; left: -40px; top: 120px; rotate: -12deg; }
.qw-fw-a2 { width: 110px; left: calc(75% - 34px); top: -28px; rotate: 9deg; animation-delay: -1.7s; }
.qw-fw-a3 { width: 170px; right: -50px; top: 40%; rotate: 11deg; animation-delay: -3.1s; }
@keyframes qw-float { 0%, 100% { translate: 0 0; } 50% { translate: 0 -10px; } }

/* ---------- контент-завод ---------- */
.qw-fx-g { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--g); align-items: start; }
.qw-fx-v { grid-column: 1 / 10; }
.qw-fx-v .box { border-radius: 6px; overflow: hidden; box-shadow: 0 0 0 1px #ececec; background: #fff; }
.qw-fx-v figcaption { margin-top: 10px; color: var(--mute); }
.qw-fx-t { grid-column: 10 / 13; }
.qw-ol { list-style: none; margin: 1.4em 0 0; padding: 0; counter-reset: q; }
.qw-ol li { counter-increment: q; position: relative; padding: .55em 0 .55em 2.1em; border-top: 1px solid #ececec; }
.qw-ol li::before { content: counter(q, decimal-leading-zero); position: absolute; left: 0; top: .7em; font-size: var(--fs-tag); color: var(--mute); }
.qw-ol b { font-weight: 500; }

/* ---------- лента вертикалок на небе ---------- */
.qw-rb { --h: clamp(360px, 43vw, 620px); position: relative; margin-top: calc(var(--u) * 12); padding: 56px 0 0;
  background: #67b4f2 url(media/24qw/qw/sky.webp) 50% 50% / cover no-repeat; }
.qw-rb-l { margin: 0 var(--m) 22px; color: #fff; text-shadow: 0 1px 6px rgba(0, 40, 100, .45); }
.qw-rb-v { position: relative; overflow: hidden; padding: 72px 0 132px; } /* запас под раздутие карточек у краёв (линза) и подписи целиком */
.qw-rb-gl { position: absolute; left: 0; top: 0; z-index: 1; display: block; }
.qw-gl .qw-rb-l { position: relative; z-index: 2; }
.qw-gl .qw-rb-v { z-index: 2; pointer-events: none; }
.qw-gl .qw-c .box { opacity: 0; box-shadow: none; } /* картинку рисует WebGL-линза, DOM-карточка — для раскладки, загрузки видео и лайтбокса */
.qw-rb-t { display: flex; width: max-content; will-change: transform; }
.qw-c { flex: 0 0 auto; width: calc(var(--h) * 9 / 16); margin-right: clamp(14px, 1.8vw, 28px); }
.qw-c .box { border-radius: 18px; overflow: hidden; background: #9fd0f7; box-shadow: 0 22px 36px -20px rgba(0, 30, 90, .45); }
.qw-c video { cursor: zoom-in; }
.qw-c figcaption { will-change: transform; margin-top: 10px; color: #fff; min-height: 1.3em; text-shadow: 0 1px 2px rgba(0, 35, 90, .75), 0 0 10px rgba(0, 40, 100, .55); }
.qw-pk-r { width: 170px; top: -64px; right: 6%; rotate: 10deg; z-index: 3; }
.qw-st { position: absolute; z-index: 3; width: 130px; height: auto; left: 7%; bottom: -44px; rotate: -10deg; pointer-events: none; animation: qw-float 4.5s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) { .qw-rb-v { overflow-x: auto; padding: 18px 0 60px; } }

/* ---------- ролики X ---------- */
.qw-x { position: relative; }
.qw-x .jr { position: relative; z-index: 1; }
.qw-fw-x1 { width: 160px; right: -46px; top: -70px; rotate: 13deg; z-index: 2; }
.qw-fw-x2 { width: 140px; left: -44px; bottom: -64px; rotate: -9deg; z-index: 2; animation-delay: -2.4s; }

/* ---------- виджеты россыпью ---------- */
.qw-wd-f { position: relative; height: clamp(440px, 40vw, 600px); }
.qw-wi { position: absolute; left: var(--x); top: var(--y); width: calc(var(--s) * clamp(104px, 15.5vw, 230px)); margin: 0; rotate: var(--r);
  animation: qw-float 4.8s ease-in-out infinite; animation-delay: calc(var(--i) * -.9s); }
.qw-wi img { width: 100%; height: auto; aspect-ratio: 1 / 1; cursor: zoom-in; filter: drop-shadow(0 14px 20px rgba(0, 30, 80, .2)); transition: scale .3s var(--ease); }
.qw-wi:hover img { scale: 1.06; }

/* ---------- нижние этажи: свободная сетка (bento) вместо одинаковых рядов ---------- */
.qw-po, .qw-ar { position: relative; }
.qw-bn { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--g); align-items: start; }
.qw-bn + .qw-bn { margin-top: calc(var(--u) * 9); }
.qw-gi { grid-column: var(--c); grid-row: var(--rw); margin-top: var(--mt); rotate: var(--r); min-width: 0; }
.qw-gi .m { margin: 0; }
.qw-ar .qw-gi .box { border-radius: 4px; }
.qw-bn--fl .qw-gi .box { box-shadow: 0 18px 30px -18px rgba(0, 30, 80, .35); }
.qw-bn--fl .qw-gi:nth-child(3) { align-self: center; z-index: 1; }
.qw-gf { position: relative; z-index: 2; pointer-events: none; }   /* вырезанный виджет висит в просвете сетки */
.qw-gf img { display: block; width: 100%; height: auto; animation: qw-float 5s ease-in-out infinite; animation-delay: -1.2s; filter: drop-shadow(0 14px 18px rgba(0, 30, 80, .22)); }
.qw-fw-p2 { width: 120px; right: -36px; top: -58px; rotate: 12deg; animation-delay: -2.6s; }

@media (prefers-reduced-motion: reduce) { .qw-fw, .qw-wi, .qw-st, .qw-gf img { animation: none; } }

/* ---------- планшет ---------- */
@media (max-width: 1100px) {
  .qw-fx-v { grid-column: 1 / 13; }
  .qw-fx-t { grid-column: 1 / 13; display: grid; grid-template-columns: 1fr 1fr; gap: var(--g); }
  .qw-ol { margin-top: 0; }
}

/* ---------- телефон ---------- */
@media (max-width: 760px) {
  .qw-hero { display: block; margin-top: calc(var(--u) * 5); }
  .qw-hero-v { max-width: none; }
  .qw-hero-t { padding-top: calc(var(--u) * 3); }
  .qw-pk-a { width: 108px; top: -30px; right: -6px; }
  .qw-pk-m { display: block; width: 100px; left: -8px; bottom: 14px; rotate: -8deg; }
  .qw-pk-b, .qw-pk-c { display: none; }
  .qw-ph-row { display: grid; grid-template-columns: 1fr 1fr; gap: 26px 14px; }
  .qw-ph { flex: none; }
  .qw-ph1 { margin-top: 40px; } .qw-ph2 { margin-top: 0; } .qw-ph3 { margin-top: 40px; }
  .qw-ph-s { box-shadow: 0 0 0 3px #111, 0 16px 26px -14px rgba(0, 30, 80, .35); }
  .qw-fw-a1 { width: 80px; left: -26px; top: 22%; }
  .qw-fw-a2 { width: 72px; left: auto; right: -10px; top: -62px; }
  .qw-fw-a3 { width: 84px; right: -22px; bottom: auto; top: 62%; }
  .qw-fx-t { display: block; margin-top: calc(var(--u) * 2); }
  .qw-ol { margin-top: 1.2em; }
  .qw-rb { --h: 400px; padding: 40px 0 10px; margin-top: calc(var(--u) * 9); }
  .qw-rb-v { padding: 44px 0 84px; }
  .qw-pk-r { width: 96px; top: -40px; right: 4%; }
  .qw-st { width: 84px; bottom: -30px; }
  .qw-fw-x1 { width: 90px; right: -18px; top: -46px; }
  .qw-fw-x2 { width: 80px; left: -18px; bottom: -44px; }
  .qw-wd-f { height: 580px; }
  .qw-wi { left: var(--mx); top: var(--my); width: 118px; }
  .qw-bn { grid-template-columns: 1fr 1fr; gap: 10px; }
  .qw-gi { grid-column: var(--mc); grid-row: auto; margin-top: var(--mmt); rotate: calc(var(--r) * .6); }
  .qw-bn--fl .qw-gi:nth-child(3) { order: -1; }
  .qw-bn + .qw-bn { margin-top: calc(var(--u) * 5); }
  .qw-gf { display: none; }
  .qw-fw-p2 { width: 70px; right: -8px; top: -44px; }
  .qw-fx-v .box { aspect-ratio: 1 / 1 !important; } /* на телефоне квадратная версия ролика: камера идёт за курсором, текст админки читается */
}

/* выступающие за край паки и виджеты режем по краю экрана, документ не шире окна */
.p-case main { overflow-x: clip; }
