/* ---------- Наши работы: список кейсов и страница кейса ---------- */
.case-page { background: var(--white); }
.case-hero { position: relative; padding: 118px 0 clamp(48px, 6vw, 88px); }
.case-hero .crumbs { margin-bottom: 18px; }

/* переключатель кейсов */
.case-nav { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding-bottom: 28px; margin-bottom: clamp(28px, 4vw, 48px); border-bottom: 2px solid var(--eye); }
.case-nav__all { display: inline-flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 600; color: var(--muted); text-decoration: none; padding: 10px 4px; }
.case-nav__all::before { content: ''; width: 9px; height: 9px; border-left: 2.5px solid currentColor; border-bottom: 2.5px solid currentColor; transform: rotate(45deg); margin-right: 2px; }
.case-nav__all:hover { color: var(--blue); }
.case-nav__chips { display: flex; gap: 8px; flex-wrap: wrap; flex: 1; min-width: 0; }
.case-chip { display: inline-flex; align-items: center; gap: 10px; padding: 6px 18px 6px 6px; border-radius: 999px; background: var(--eye); color: var(--ink); font-family: var(--font-head); font-weight: 600; font-size: 15px; text-decoration: none; transition: background .25s, color .25s, transform .35s var(--ease-bounce); }
.case-chip img { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; background: #000; }
.case-chip:hover { transform: translateY(-2px); }
.case-chip.is-active { background: var(--blue); color: var(--white); }
.case-nav__arrows { display: flex; gap: 8px; margin-left: auto; }
.case-arrow { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; background: var(--eye); color: var(--blue); transition: background .25s, color .25s, transform .35s var(--ease-bounce); }
.case-arrow svg { width: 22px; height: 22px; }
.case-arrow--prev svg { transform: scaleX(-1); }
.case-arrow:hover { background: var(--blue); color: var(--white); transform: scale(1.06); }

/* первый экран кейса */
.case-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 700px); grid-template-areas: 'head duo' 'body duo'; grid-template-rows: 1fr 1fr; column-gap: clamp(24px, 3vw, 48px); }
.case-head { grid-area: head; align-self: end; }
.case-body { grid-area: body; align-self: start; }
.duo { grid-area: duo; align-self: center; }
.case-kicker { font-size: 16px; font-weight: 600; color: var(--muted); }
.case-h1 { font-size: clamp(40px, 5.4vw, 80px); font-weight: 800; color: var(--blue); line-height: 1; margin-top: 12px; letter-spacing: -0.03em; }
.case-task { margin-top: 22px; font-size: clamp(18px, 1.5vw, 21px); line-height: 1.5; max-width: 34ch; }
.case-hero .hero__actions { margin-top: 32px; }


/* истории */
.case-stories { position: relative; background: var(--blue); color: var(--white); padding: clamp(56px, 7vw, 104px) 0; overflow: hidden; }
.case-stories__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.case-stories h2 { font-size: clamp(30px, 3.6vw, 52px); font-weight: 700; color: var(--white); max-width: 16ch; }
.case-stories__note { font-size: 16px; color: rgba(255,255,255,.82); max-width: 36ch; }

/* следующий кейс */
.case-next { padding: 0 0 clamp(48px, 6vw, 80px); }
.case-next__link { display: flex; align-items: center; gap: 16px; padding: 28px 32px; border-radius: var(--radius); background: var(--eye); text-decoration: none; color: var(--ink); }
.case-next__link span { color: var(--muted); font-size: 15px; }
.case-next__link b { font-family: var(--font-head); font-size: clamp(22px, 2.4vw, 32px); color: var(--blue); }
.case-next__link svg { width: 28px; height: 28px; margin-left: auto; color: var(--blue); }

/* список кейсов */
.cases-list { padding: 0 0 clamp(64px, 8vw, 120px); }
.cases-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 520px), 1fr)); gap: 28px; }
.case-tile { display: flex; flex-direction: column; border-radius: var(--radius); overflow: hidden; background: var(--eye); color: var(--ink); text-decoration: none; transition: transform .4s var(--ease-bounce); }
.case-tile:hover { transform: translateY(-6px) rotate(-.6deg); }
.case-tile__img img { display: block; width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; }
.case-tile__body { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 6px 96px 30px 32px; }
.case-tile__body b { font-family: var(--font-head); font-weight: 700; font-size: clamp(24px, 2.4vw, 32px); color: var(--blue); line-height: 1.1; }
.case-tile__body > span { font-size: 16px; color: var(--muted); }
.case-tile__go { position: absolute; right: 28px; top: 50%; margin-top: -32px; width: 56px; height: 56px; border-radius: 50%; background: var(--blue); color: var(--white); display: grid; place-items: center; transition: transform .35s var(--ease-bounce); }
.case-tile__go svg { width: 24px; height: 24px; }
.case-tile:hover .case-tile__go { transform: translateX(6px); }

@media (max-width: 1000px) {
  .case-grid { grid-template-columns: 1fr; grid-template-areas: 'head' 'duo' 'body'; grid-template-rows: auto; row-gap: 36px; }
  .case-task { max-width: 46ch; }
  .duo { max-width: 640px; margin: 0 auto; width: 100%; }
}
@media (max-width: 900px) {
  .case-hero { padding-top: 100px; }
}
@media (max-width: 560px) {
  .case-nav { gap: 8px; padding-bottom: 20px; }
  .case-tile__body { padding: 4px 84px 24px 22px; }
  .case-tile__go { right: 20px; width: 48px; height: 48px; margin-top: -28px; }
  .case-hero .hero__actions .btn { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
}

/* один кейс в списке: широкая плитка */
@media (min-width: 901px) {
  .case-tile:only-child { flex-direction: row; align-items: stretch; grid-column: 1 / -1; }
  .case-tile:only-child .case-tile__img { flex: 0 0 62%; }
  .case-tile:only-child .case-tile__img img { height: 100%; }
  .case-tile:only-child .case-tile__body { justify-content: center; gap: 10px; padding: 40px 120px 40px 40px; }
  .case-tile:only-child .case-tile__body b { font-size: clamp(30px, 3vw, 44px); }
  .case-tile:only-child .case-tile__go { right: 40px; width: 64px; height: 64px; margin-top: -32px; }
}


/* ---------- v2: факты, до/после, истории, товары ---------- */
.case-facts { list-style: none; margin: 28px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; max-width: 560px; }
.case-facts li { padding: 9px 16px; border-radius: 999px; background: var(--eye); font-size: 15px; line-height: 1.3; }
.case-facts b { font-family: var(--font-head); font-weight: 700; color: var(--blue); margin-right: 4px; }
.case-hero .hero__actions { margin-top: 32px; }

.duo { position: relative; aspect-ratio: 700 / 760; }
.duo figure { margin: 0; position: absolute; }
.duo__before { left: 0; top: 17%; width: 62%; transform: rotate(-4deg); }
.duo__before picture img, .duo__before > picture > img { display: block; width: 100%; height: auto; border-radius: 18px; box-shadow: 0 0 0 2px var(--ink), 0 10px 0 var(--ink); background: #fff; }
.duo__after { right: 1%; top: 1%; width: 47%; transform: rotate(3deg); z-index: 2; }
.phone { background: #111; padding: 3.2%; border-radius: 13% / 6%; box-shadow: 0 18px 40px rgba(0,0,0,.28); }
.phone img { display: block; width: 100%; height: auto; border-radius: 10.5% / 4.9%; }
.duo__tag { position: absolute; z-index: 3; top: -14px; padding: 8px 16px; border-radius: 999px; font-family: var(--font-head); font-weight: 700; font-size: 15px; line-height: 1; box-shadow: 0 4px 0 var(--ink); }
.duo__tag--before { top: auto; bottom: -16px; left: 16px; background: var(--white); color: var(--ink); box-shadow: 0 0 0 2px var(--ink), 0 4px 0 2px var(--ink); }
.duo__tag--after { right: 18px; background: var(--yellow); color: var(--ink); box-shadow: 0 0 0 2px var(--ink), 0 4px 0 2px var(--ink); }

/* лента историй */
.case-stories { padding-bottom: clamp(48px, 6vw, 88px); }
.case-stories__head { align-items: flex-end; }
.case-stories__note { margin-right: auto; margin-left: 24px; padding-bottom: 6px; }
.stl__nav { display: flex; gap: 10px; }
.stl__btn { display: grid; place-items: center; width: 52px; height: 52px; border: 0; border-radius: 50%; background: var(--white); color: var(--blue); cursor: pointer; transition: transform .3s var(--ease-bounce), opacity .2s; }
.stl__btn svg { width: 24px; height: 24px; }
.stl__btn:hover { transform: scale(1.08); }
.stl__btn[disabled] { opacity: .35; cursor: default; transform: none; }
.stl { margin-top: clamp(28px, 3.5vw, 44px); overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain; }
.stl::-webkit-scrollbar { display: none; }
.stl__track { display: flex; gap: clamp(20px, 2.4vw, 36px); width: max-content; padding: 6px max(clamp(16px, 4vw, 48px), calc((100vw - var(--container)) / 2 + 48px)) 10px; }
.stl__group { scroll-snap-align: start; scroll-margin-left: max(clamp(16px, 4vw, 48px), calc((100vw - var(--container)) / 2 + 48px)); }
.stl__title { display: flex; align-items: center; gap: 10px; font-family: var(--font-head); font-weight: 600; font-size: 17px; color: var(--white); margin-bottom: 14px; }
.stl__title span { display: inline-grid; place-items: center; min-width: 26px; height: 26px; padding: 0 7px; border-radius: 999px; background: rgba(255,255,255,.18); font-size: 13px; }
.stl__slides { list-style: none; margin: 0; padding: 0; display: flex; gap: 10px; }
.stl__slide { display: block; width: clamp(150px, 15vw, 216px); aspect-ratio: 9 / 16; padding: 0; border: 0; border-radius: 18px; overflow: hidden; background: #000; cursor: zoom-in; box-shadow: 0 0 0 3px rgba(255,255,255,.0); transition: transform .35s var(--ease-bounce), box-shadow .25s; }
.stl__slide img { display: block; width: 100%; height: 100%; object-fit: cover; }
.stl__slide:hover { transform: translateY(-6px); box-shadow: 0 0 0 3px var(--yellow); }
.stl__slide:focus-visible { outline: 3px solid var(--yellow); outline-offset: 3px; }

/* просмотр историй */
.sv { position: fixed; inset: 0; z-index: 10000; display: grid; place-items: center; background: rgba(8, 10, 30, .92); opacity: 0; visibility: hidden; transition: opacity .25s, visibility .25s; }
.sv.is-open { opacity: 1; visibility: visible; }
.sv__stage { position: relative; height: min(88vh, 860px); aspect-ratio: 9 / 16; max-width: 94vw; border-radius: 22px; overflow: hidden; background: #000; touch-action: none; user-select: none; -webkit-user-select: none; }
.sv__stage img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.sv__bars { position: absolute; left: 12px; right: 12px; top: 12px; display: flex; gap: 4px; z-index: 2; }
.sv__bars i { flex: 1; height: 3px; border-radius: 3px; background: rgba(255,255,255,.35); overflow: hidden; }
.sv__bars i b { display: block; height: 100%; width: 0; background: #fff; }
.sv__bars i.is-done b { width: 100%; }
.sv__bars i.is-cur b { animation: svfill var(--dur, 5s) linear forwards; }
.sv.is-paused .sv__bars i.is-cur b { animation-play-state: paused; }
@keyframes svfill { from { width: 0; } to { width: 100%; } }
.sv__title { position: absolute; left: 16px; top: 26px; z-index: 2; font-family: var(--font-head); font-weight: 600; font-size: 15px; color: #fff; text-shadow: 0 1px 6px rgba(0,0,0,.6); }
.sv__zone { position: absolute; top: 0; bottom: 0; z-index: 1; width: 35%; border: 0; background: transparent; cursor: pointer; }
.sv__zone--prev { left: 0; } .sv__zone--next { right: 0; width: 65%; }
.sv__close { position: absolute; right: 18px; top: 18px; z-index: 3; width: 48px; height: 48px; border: 0; border-radius: 50%; background: rgba(255,255,255,.14); color: #fff; font-size: 26px; line-height: 1; cursor: pointer; }
.sv__close:hover { background: rgba(255,255,255,.26); }
.sv__arrow { position: absolute; top: 50%; z-index: 3; width: 56px; height: 56px; margin-top: -28px; border: 0; border-radius: 50%; background: #fff; color: var(--blue); cursor: pointer; display: grid; place-items: center; }
.sv__arrow svg { width: 26px; height: 26px; }
.sv__arrow--prev { left: max(16px, calc(50% - min(88vh, 860px) * 9 / 32 - 96px)); }
.sv__arrow--next { right: max(16px, calc(50% - min(88vh, 860px) * 9 / 32 - 96px)); }
.sv__arrow[disabled] { opacity: .3; cursor: default; }
@media (max-width: 700px) { .sv__arrow { display: none; } .sv__stage { height: 100%; max-height: 100dvh; max-width: 100vw; width: 100vw; aspect-ratio: auto; border-radius: 0; } .sv__stage img { object-fit: contain; } .sv__close { top: 28px; right: 10px; z-index: 4; } }
html.sv-lock, html.sv-lock body { overflow: hidden; }

/* товары */
.case-goods { padding: clamp(56px, 7vw, 104px) 0; }
.case-goods__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px 32px; flex-wrap: wrap; }
.case-goods h2 { font-size: clamp(28px, 3.2vw, 46px); font-weight: 700; color: var(--ink); max-width: 18ch; line-height: 1.1; }
.case-goods h2 span { display: block; font-size: clamp(64px, 8vw, 120px); font-weight: 800; color: var(--blue); line-height: .95; letter-spacing: -0.04em; }
.case-goods__note { font-size: 16px; color: var(--muted); max-width: 30ch; padding-bottom: 8px; }
.pgrid { list-style: none; margin: clamp(28px, 3.5vw, 48px) 0 0; padding: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 28px 18px; }
.pc { display: flex; flex-direction: column; gap: 6px; }
.pc img { display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; border-radius: 20px; margin-bottom: 6px; transition: transform .35s var(--ease-bounce); }
.pc:hover img { transform: translateY(-4px) rotate(-1deg); }
.pc b { font-family: var(--font-head); font-weight: 700; font-size: 16px; color: var(--ink); }
.pc span { font-size: 14px; line-height: 1.3; color: var(--muted); }

@media (max-width: 1100px) { .pgrid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 900px) {
  .case-stories__note { margin-left: 0; flex-basis: 100%; order: 3; }
  .stl__nav { display: none; }
  .pgrid { display: grid; grid-auto-flow: column; grid-template-rows: repeat(2, auto); grid-template-columns: none; grid-auto-columns: 42%; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; gap: 22px 14px; margin-left: calc(-1 * clamp(16px, 4vw, 48px)); margin-right: calc(-1 * clamp(16px, 4vw, 48px)); padding: 0 clamp(16px, 4vw, 48px) 6px; scroll-padding-left: clamp(16px, 4vw, 48px); }
  .pgrid::-webkit-scrollbar { display: none; }
  .pc { scroll-snap-align: start; }
}
@media (max-width: 560px) {
  .case-facts li { font-size: 14px; padding: 8px 13px; }
  .duo__tag { font-size: 13px; padding: 7px 13px; }
  .duo__tag--after { top: -10px; }
  .duo__tag--before { bottom: -12px; }
  .stl__slide { width: 140px; border-radius: 14px; }
  .stl__title { font-size: 15px; }
}

/* v3: «После» — светлый скрин карточки в той же рамке и масштабе, что «До» */
.duo { aspect-ratio: 700 / 720; }
.duo__before { left: 0; top: 30%; width: 60%; transform: rotate(-3deg); }
.duo__after { right: 0; top: 2%; width: 60%; transform: rotate(2.5deg); }
.duo__after picture img, .duo__after > picture > img { display: block; width: 100%; height: auto; border-radius: 18px; box-shadow: 0 0 0 3px var(--blue), 0 10px 0 3px var(--blue); background: #fff; }
.duo__tag--after { background: var(--blue); color: var(--white); box-shadow: 0 4px 0 var(--ink); }
