.case-heading { margin: 12px 0 clamp(16px, 1.8vw, 27px); }
.case-heading .case-back { display: inline-block; margin-bottom: 9px; color: #9b3d00; font-weight: 730; font-size: .88rem; }
.portfolio-case .case-heading h1 { max-width: 31ch; font-size: clamp(1.8rem, 3.4vw, 3.7rem); line-height: 1.06; }
.case-tags { display: flex; flex-wrap: wrap; gap: 5px 7px; margin-top: 11px; }
.case-tags a, .portfolio-card__tags span { padding: 4px 9px; border-radius: 6px; background: #f1e8dd; text-decoration: none; color: #6c3d1b; font-weight: 680; font-size: .8rem; }
.case-tags a:hover { background: #f9d9bb; }
.case-gallery { display: grid; gap: 12px; align-items: start; }
.case-gallery--split { grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); max-width: 1200px; }
.case-gallery__stage { position: relative; width: fit-content; max-width: 100%; margin-inline: auto; touch-action: pan-y; }
.case-gallery__media > a, .case-gallery__companions a { display: block; width: auto; height: auto; }
.case-gallery__media img, .case-gallery__companions img { display: block; width: auto; max-width: 100%; height: auto; max-height: min(72svh, 740px); object-fit: contain; border-radius: 13px; }
.case-gallery:not(.case-gallery--split) .case-gallery__stage { margin-inline: 0; }
.case-gallery--split .case-gallery__stage { margin: 0; }
.case-gallery--split .case-gallery__media img { max-height: min(62svh, 650px); }
.case-gallery--split .case-gallery__media img { margin-inline: auto; }
.case-gallery__companions { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: clamp(8px, 1.3vw, 20px); align-self: start; padding-top: clamp(14px, 3vw, 42px); }
.case-gallery__companions:has(> :only-child) { grid-template-columns: minmax(0,1fr); }
.case-gallery__companions:has(> :only-child) img { max-height: min(53svh, 535px); }
.case-gallery__companions a { transition: opacity .2s ease; }
.case-gallery__companions a:hover { opacity: .87; }
.case-gallery__step, .case-gallery__rail button { border: 1px solid #d8dfe4; border-radius: 50%; width: 41px; height: 41px; background: #fff; color: var(--pf-ink); font-size: 1.6rem; cursor: pointer; line-height: 1; }
.case-gallery__step { position: absolute; top: 50%; translate: 0 -50%; box-shadow: 0 3px 16px #10213430; }
.case-gallery__step--prev { left: 10px; }
.case-gallery__step--next { right: 10px; }
.case-gallery__tools { position: absolute; display: flex; align-items: center; right: 9px; bottom: 9px; border-radius: 8px; background: #122337ed; color: white; font-size: .85rem; }
.case-gallery__tools span { padding-left: 9px; font-variant-numeric: tabular-nums; }
.case-gallery__tools a { display: grid; place-items: center; min-width: 42px; min-height: 40px; color: #fff; }
.case-gallery__rail { grid-column: 1/-1; display: flex; align-items: center; gap: 8px; min-width: 0; }
.case-gallery__rail button { flex: 0 0 auto; }
.case-gallery__rail button:disabled { opacity: .35; cursor: default; }
.case-gallery__thumbs { display: flex; gap: 8px; overflow: auto; padding: 4px; min-width: 0; scrollbar-width: none; }
.case-gallery__thumbs::-webkit-scrollbar { display: none; }
.case-gallery__thumbs a { display: block; flex: 0 0 clamp(65px, 8vw, 107px); height: clamp(56px, 6.3vw, 85px); overflow: hidden; border: 2px solid transparent; border-radius: 8px; }
.case-gallery__thumbs img { width: 100%; height: 100%; object-fit: cover; }
.case-gallery__thumbs a[aria-current] { border-color: #de6009; }
.case-editorial :is(.case-description,.case-materials,.case-videos,.case-cta,.case-related,.case-comparison) h2 { font-size: clamp(1.39rem, 2.65vw, 2.65rem); margin: 0 0 10px; letter-spacing: -.045em; line-height: 1.08; }
.case-description,.case-materials,.case-videos,.case-comparison,.case-cta,.case-related { margin-top: clamp(25px, 4.4vw, 70px); }
.case-description { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); align-items: start; gap: clamp(19px, 4vw, 68px); }
.case-description__story:only-child, .case-description__facts:only-child { grid-column: 1/-1; max-width: 850px; }
.case-description__story { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); align-content: start; gap: 20px; }
.case-description__story section { padding: 13px 0 2px; border-top: 2px solid #e96e12; }
.case-description__story section:only-child, .case-description__story section:first-child:nth-last-child(3) { grid-column: 1/-1; max-width: 72ch; }
.case-description p, .case-videos p, .case-cta p { margin: 0; color: var(--pf-muted); line-height: 1.55; }
.case-story-photo { grid-column: 1/-1; margin: 0; width: min(100%, 560px); }
.case-story-photo img { display: block; width: 100%; height: clamp(155px, 31vw, 340px); object-fit: cover; border-radius: 10px; }
.case-story-photo figcaption, .case-materials figcaption { padding: 8px 0 0; font-size: .9rem; color: var(--pf-muted); }
.case-description__facts { display: grid; gap: 22px; padding: clamp(16px, 2vw, 28px); border: 1px solid #e5ded5; background: #fcf9f5; border-radius: 12px; }
.case-editorial .case-description__facts h2 { font-size: clamp(1.22rem, 1.7vw, 1.65rem); }
.case-description__facts ul { margin: 0; padding: 0; list-style: none; }
.case-description__facts li { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid #eae1d6; }
.case-description__facts li > svg,.case-description__facts a svg { width: 22px; height: 22px; flex: 0 0 auto; color: #b94b00; }
.case-description__facts li a { color: inherit; text-decoration: none; display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 5px; }
.case-description__facts li a:hover { text-decoration: underline; }
.case-description__facts dl { display: grid; gap: 8px; margin: 0; }
.case-description__facts dl div { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 9px; font-size: .9rem; }
.case-description__facts dt { color: var(--pf-muted); }
.case-description__facts dd { margin: 0; font-weight: 700; }
.case-materials { border-block: 1px solid #e4dacf; padding: clamp(18px, 2.6vw, 38px) 0; display: flex; flex-wrap: wrap; gap: 16px 32px; }
.case-materials ul { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 0; padding: 0; list-style: none; }
.case-materials li { border-radius: 5px; background: #f1e7d9; padding: 5px 10px; }
.case-materials__photos { flex: 1 1 440px; display: grid; grid-template-columns: repeat(auto-fit,minmax(min(130px,100%),1fr)); gap: 10px; max-width: 880px; min-width: 0; }
.case-materials figure { margin: 0; }
.case-materials figure img { width: 100%; aspect-ratio: 1.25; object-fit: cover; border-radius: 9px; }
.case-compare { --case-split: 50%; display: flex; align-items: stretch; justify-content: center; gap: clamp(8px, 1.7vw, 24px); max-width: 1050px; }
.case-compare figure { margin: 0; flex: 1 1 50%; min-width: 0; position: relative; background: #efebe5; border-radius: 11px; overflow: hidden; }
.case-compare figure img { display: block; width: 100%; height: clamp(160px, 38vw, 550px); object-fit: contain; }
.case-compare figcaption { position: absolute; top: 8px; padding: 4px 11px; border-radius: 5px; background: #122337ed; color: #fff; }
.case-compare__before { order: -1; }
.case-compare__before figcaption { left: 8px; }
.case-compare__after figcaption { right: 8px; }
.case-compare__split { display: none; }
.case-compare.is-enhanced { display: block; position: relative; height: clamp(230px, 40vw, 540px); }
.case-compare.is-enhanced figure { position: absolute; inset: 0; }
.case-compare.is-enhanced img { height: 100%; object-fit: cover; }
.case-compare.is-enhanced .case-compare__before { clip-path: inset(0 calc(100% - var(--case-split)) 0 0); }
.case-compare.is-enhanced .case-compare__split { position: absolute; display: grid; place-items: center; inset: 0 auto 0 var(--case-split); width: 2px; background: #fff; }
.case-compare__split > span { display: grid; place-items: center; width: 31px; height: 31px; border-radius: 50%; background: #ae4500; color: #fff; transform: translateX(-50%); }
.case-compare input { position: absolute; inset: 0; margin: 0; width: 100%; height: 100%; opacity: 0; cursor: ew-resize; touch-action: pan-y; }
.case-compare:focus-within { outline: 3px solid #ad4000; outline-offset: 3px; }
.case-videos { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: clamp(14px, 3vw, 45px); padding: clamp(17px, 3vw, 46px); border-radius: 14px; background: #102d46; color: #fff; }
.case-videos__intro { flex: 0 1 340px; }
.case-videos p,.case-cta p { color: #e5edf4; }
.case-videos__items { flex: 1 1 380px; display: flex; flex-wrap: wrap; align-items: start; justify-content: center; gap: 17px; min-width: 0; }
.case-clip { flex: 1 1 340px; max-width: 660px; min-width: 0; }
.case-clip--portrait { flex: 0 1 clamp(150px, 18vw, 305px); }
.case-clip__preview { display: block; position: relative; aspect-ratio: var(--clip-ratio); border-radius: 10px; overflow: hidden; background: #244660; }
.case-clip__preview img { display: block; width: 100%; height: 100%; object-fit: cover; }
.case-clip__preview .portfolio-play { position: absolute; inset: 50% auto auto 50%; transform: translate(-50%, -50%); width: 53px; height: 53px; }
.case-clip__duration { position: absolute; right: 9px; bottom: 9px; border-radius: 5px; background: #101a25e6; padding: 3px 7px; color: white; font-weight: 700; }
.case-clip h3 { margin: 8px 0 0; font-size: clamp(.91rem, 1.3vw, 1.13rem); color: #fff; line-height: 1.24; }
.case-cta { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, .65fr); align-items: stretch; background: #0b253c; color: #fff; border-radius: 13px; overflow: hidden; }
.case-cta > div { padding: clamp(18px, 3vw, 43px); }
.case-cta > div:only-child { grid-column: 1/-1; }
.case-cta .button { margin-top: 13px; }
.case-cta > img { width: 100%; height: 100%; max-height: 270px; object-fit: cover; }
.case-nav { display: grid; grid-template-columns: minmax(0,1fr) auto minmax(0,1fr); align-items: center; gap: 12px; margin-top: 20px; border-bottom: 1px solid #e4dacf; padding-bottom: 15px; }
.case-nav > div a { display: flex; align-items: center; gap: 10px; color: var(--pf-ink); text-decoration: none; overflow-wrap: anywhere; }
.case-nav__next { grid-column: 3; text-align: right; }
.case-nav__next a { flex-direction: row-reverse; }
.case-nav small, .case-nav strong { display: block; }
.case-nav small { color: #964107; margin-bottom: 4px; }
.case-nav img { flex: 0 0 auto; width: 58px; height: 58px; border-radius: 7px; object-fit: cover; }
.case-nav__all { grid-column: 2; grid-row: 1; color: #964107; padding: 8px 12px; border: 1px solid #cdb7a4; border-radius: 8px; font-weight: 700; }
.case-related .portfolio-grid { margin-top: 15px; }
.portfolio-card__tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 7px; }
.portfolio-card__tags span { font-size: .75rem; padding: 3px 7px; }
#case-work { scroll-margin-top: 105px; }
@media(max-width: 750px) {
    .case-description { grid-template-columns: 1fr; }
    .case-gallery--split { grid-template-columns: 1fr; }
    .case-gallery__companions { display: none; }
    .case-gallery__media img { max-height: 70svh; }
    .case-related .portfolio-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .case-nav { grid-template-columns: 1fr 1fr; }
    .case-nav__next { grid-column: 2; }
    .case-nav__all { grid-row: 2; grid-column: 1/-1; justify-self: center; }
}
@media(max-width: 470px) {
    .case-description__story { grid-template-columns: 1fr; gap: 13px; }
    .case-videos__items { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
    .case-clip:not(.case-clip--portrait) { grid-column: 1/-1; }
    .case-cta { grid-template-columns: 1fr; }
    .case-cta > img { height: 105px; }
    .case-nav img { display: none; }
    .case-nav strong { font-size: .89rem; }
}
