/* Content-driven mosaic: six/four/three equal columns, consistent unit heights. */
.work .gallery-grid{--grid-columns:6;--grid-gap:8px;display:grid;grid-template-columns:repeat(var(--grid-columns),minmax(0,1fr));grid-auto-flow:dense;grid-auto-rows:calc((100vw - 7*var(--grid-gap))/6);gap:var(--grid-gap)}
.work .gallery-card:nth-child(n){grid-area:auto;grid-column:span var(--cols,1);grid-row:span var(--rows,1);min-width:0;min-height:0;overflow:hidden}
.card-button>img,.card-button>video{display:block;width:100%;height:100%;object-fit:cover}
.brand-logo{width:125px;height:40px;filter:grayscale(1) brightness(0) invert(.094);opacity:1}.brand-logo img{max-height:34px}.brand-tele2{width:90px}.brand-vozovoz{width:140px;filter:grayscale(1);mix-blend-mode:multiply}.brand-vozovoz img{width:252px;height:177px;max-width:none;max-height:none;filter:grayscale(1) contrast(10)}.brand-group{gap:60px;padding-right:60px}
.language-switch{font-size:12px;font-weight:700;letter-spacing:.05em;border:1px solid currentColor;border-radius:50%;width:34px;height:34px;margin-left:auto;margin-right:25px;flex-shrink:0;opacity:.8}.language-switch:hover{opacity:1}.menu nav{margin-left:0}
.language-ru .intro h1{font-size:8.2vw}.language-ru .skills{font-size:clamp(13px,1.2vw,18px)}
.project-view .case-media img,.project-view .case-media video{width:100%;height:100%;object-fit:contain}.project-view .case-story p{white-space:pre-wrap}
@media(max-width:1050px){.work .gallery-grid{--grid-columns:4;grid-auto-rows:calc((100vw - 5*var(--grid-gap))/4)}.language-switch{margin-right:15px}.language-ru .skills{font-size:13px}}
@media(max-width:700px){.work .gallery-grid{--grid-columns:3;--grid-gap:6px;grid-auto-rows:calc((100vw - 4*var(--grid-gap))/3)}.brand-logo{width:105px}.brand-tele2{width:75px}.brand-vozovoz{width:130px}.language-switch{width:27px;height:27px;margin-right:9px;font-size:10px}.language-ru .intro h1{font-size:15.5vw}.language-ru .skills{font-size:14px}.gallery-mode .language-switch{margin-right:8px}.gallery-mode .menu .gallery-close{left:37%;font-size:9px;padding:7px}.gallery-mode .menu nav{font-size:9px;gap:6px}.language-ru.gallery-mode .menu nav{font-size:8px;gap:5px}}

.case-project-asset{margin:32px 0}.case-project-asset img,.case-project-asset video{display:block;width:100%;height:auto;border-radius:8px}.case-project-asset figcaption{padding-top:14px;white-space:pre-wrap;line-height:1.5}

.fine-mosaic{grid-template-columns:repeat(1200,minmax(0,1fr))!important;grid-auto-rows:var(--fine-row)!important;gap:0!important;padding:calc(var(--fine-gap)/2)!important;grid-auto-flow:row!important}
.fine-mosaic>.mosaic-card,.work .fine-mosaic>.gallery-card:nth-child(n){grid-column:var(--tile-start)/span var(--tile-span)!important;grid-row:var(--tile-row)/span var(--tile-height)!important;margin:calc(var(--fine-gap)/2);width:auto;min-height:0}
.gallery-filters{position:sticky;top:var(--header);z-index:35;display:none;align-items:center;gap:8px;padding:12px;background:#181818f0;color:var(--paper);overflow-x:auto;scrollbar-width:none;min-height:56px;box-sizing:border-box}
.gallery-mode .gallery-filters{display:flex}.gallery-filters button{flex-shrink:0;padding:8px 16px;border:1px solid #FAF4E630;border-radius:30px;font-size:13px;line-height:1.2;font-weight:600;transition:color .2s,background .2s}
.gallery-filters button[aria-pressed=true]{background:var(--paper);color:var(--ink);border-color:var(--paper)}.gallery-filters button:hover{border-color:var(--paper)}
.gallery-card[hidden]{display:none!important}.work-caption{position:absolute;z-index:4;bottom:0;left:0;right:0;padding:38px 18px 18px;display:grid;gap:7px;color:#FAF4E6;background:linear-gradient(transparent,#181818dd);opacity:0;translate:0 8px;transition:opacity .25s,translate .25s;text-align:left;pointer-events:none}
.work-caption-title{font-size:clamp(15px,1.5vw,22px);line-height:1.15;font-weight:700;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.work-caption-description{font-size:14px;line-height:1.35;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.work-caption-more{justify-self:start;font-size:12px;border:1px solid #FAF4E670;border-radius:20px;padding:5px 10px;margin-top:2px}
.gallery-mode .gallery-card:hover .work-caption,.gallery-mode .gallery-card:focus-within .work-caption{opacity:1;translate:0}
@media(hover:none){.gallery-mode .work-caption{opacity:1;translate:0;padding:24px 10px 10px}.work-caption-description{display:none}.work-caption-title{font-size:14px}.work-caption-more{font-size:11px;padding:3px 8px}}
@media(prefers-reduced-motion:reduce){.work-caption{transition:none}}
