/* The article of a work: heading, cover with the summary, story blocks. One file for the public page
   and for the preview in the constructor, so both always look the same. Colours, type sizes and
   easing come from cases.css. Sizes follow the article's own width (container units), not the window. */
.case-preview{--case-accent:var(--lilac);--case-rgb:181,140,255;--g:clamp(20px,3vw,48px);--media-h:min(74svh,1100px);container-type:inline-size;text-align:left;color:var(--body)}
.case-preview[data-tone=digital]{--case-accent:var(--green);--case-rgb:46,230,168}

/* Heading */
.case-heading{max-width:1100px;margin-bottom:clamp(24px,3.2cqi,40px)}
.case-heading>.eyebrow{display:inline-flex;align-items:center;gap:8px;margin-bottom:16px;font-size:var(--fs-s);line-height:1.4;color:var(--case-accent)}
.case-heading>.eyebrow:before{content:'';width:7px;height:7px;border-radius:50%;background:currentColor}
.case-title{font-size:clamp(30px,5.6cqi,76px);font-weight:800;font-stretch:125%;line-height:.98;letter-spacing:-.02em;color:var(--white);text-wrap:balance}
.case-title[tabindex="-1"]{outline:none}
.dialog-meta{margin-top:16px;font-size:clamp(15px,1.5cqi,19px);line-height:1.4;color:var(--soft)}

/* Cover and summary. The page stands on three columns: the cover takes two, the summary the third;
   the story below uses the same columns, so its text starts on the cover's grid lines. */
.project-spread{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:var(--g);align-items:start}
.project-spread-media{grid-column:span 2;min-width:0;overflow:hidden;border-radius:16px}
.project-spread-copy{min-width:0}
.project-spread.is-solo>*{grid-column:1/-1}
.project-spread.is-solo .project-contact{margin-top:0}
.project-spread-copy>.eyebrow{margin-bottom:10px;font-size:var(--fs-s);color:var(--mid)}
.case-description{font-size:var(--fs-read);line-height:1.55;color:var(--body)}
.project-tags{display:flex;flex-wrap:wrap;gap:6px;margin-top:20px}
.project-tags span{max-width:100%;padding:5px 11px;border-radius:99px;box-shadow:inset 0 0 0 1px var(--w-12);font-size:var(--fs-xs);line-height:1.4;color:var(--soft);overflow-wrap:anywhere}
.project-contact{display:block;width:fit-content;margin-top:20px;font-size:var(--fs-s);font-weight:500;line-height:1.4;color:var(--soft);text-decoration:underline;text-decoration-color:var(--w-34);text-underline-offset:4px;transition:color .2s,text-decoration-color .2s}
.project-contact:hover{color:var(--white);text-decoration-color:currentColor}

/* Story: a section heading stands in the first column, its text in the other two, media run full width. */
.case-story{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:22px var(--g);align-items:baseline;margin-top:clamp(40px,5.4cqi,72px)}
.case-story>*{grid-column:1/-1;min-width:0}
.case-story>h1{font-size:clamp(26px,3.4cqi,44px);font-weight:700;line-height:1.08;letter-spacing:-.015em;color:var(--white);text-wrap:balance}
.case-story>h2{grid-column:1;margin-top:20px;font-size:clamp(21px,2.3cqi,30px);font-weight:600;line-height:1.15;letter-spacing:-.01em;color:var(--white);text-wrap:balance}
.case-story>:is(p,h3,.case-story-button){grid-column:2/-1;max-width:68ch}
.case-story>h2+:is(p,h3){margin-top:20px}
.case-story>h3{font-size:19px;font-weight:600;line-height:1.25;color:var(--white)}
.case-story>p{font-size:var(--fs-read);line-height:1.6;color:var(--body)}
.case-story-button{justify-self:start}

/* Media blocks */
.case-story-media{margin:10px 0}
/* One size rule for every picture of the story: as wide as the article, never taller than the screen
   (--media-h), centred. Proportions come from the media (--a, see blocks() and measure()). */
.case-story-images img{display:block;width:100%;height:auto;max-width:100%;border-radius:12px}
.case-story-image .case-story-images>div{width:min(100%,calc(var(--media-h) * var(--a,1.6)));aspect-ratio:var(--a,1.6);margin-inline:auto;border-radius:12px;overflow:hidden}
.case-story-image .case-story-images img{height:100%;object-fit:contain;border-radius:0}
.case-story-collage .case-story-images{display:grid;grid-template-columns:repeat(var(--columns),minmax(0,1fr));gap:12px}
.case-story-collage .case-story-images>div{aspect-ratio:1;overflow:hidden;border-radius:12px}
.case-story-collage img{height:100%;object-fit:cover;border-radius:0}
.case-story-collage[data-ratio=landscape] .case-story-images>div{aspect-ratio:16/9}
.case-story-collage[data-ratio=portrait] .case-story-images>div{aspect-ratio:4/5}
/* Original proportions: justified rows. Every picture of a row has the row's height; a row is as wide as the
   article unless that would make it taller than the screen, then it is narrower and centred. */
.case-story-collage[data-ratio=auto] .case-story-images{display:flex;flex-direction:column;gap:12px}
.case-story-collage[data-ratio=auto] .case-story-images>.case-row{display:flex;gap:12px;width:min(100%,calc(var(--media-h) * var(--sum) + 12px * (var(--n) - 1)));margin-inline:auto;aspect-ratio:auto;overflow:visible;border-radius:0}
.case-row>div{flex:var(--a) 1 0;min-width:0;aspect-ratio:var(--a);overflow:hidden;border-radius:12px}
.case-story-collage[data-fit=contain] img{object-fit:contain}
.case-story-collage[data-fit=contain]:not([data-ratio=auto]) .case-story-images>div,.case-story-collage[data-fit=contain] .case-row>div{background:var(--tile)}
.case-story-gallery .case-story-images{display:flex;gap:12px;overflow-x:auto;scroll-snap-type:x mandatory;scrollbar-width:none;overscroll-behavior-x:contain;touch-action:pan-x pan-y pinch-zoom;border-radius:12px}
.case-story-gallery .case-story-images::-webkit-scrollbar{display:none}
.case-story-gallery .case-story-images>div{flex:0 0 100%;scroll-snap-align:start;height:min(var(--media-h),calc(100cqi / 1.5));display:grid;place-items:center}
.case-story-gallery img{width:auto;height:100%;max-height:var(--media-h);object-fit:contain}
.case-gallery-tools{display:flex;align-items:center;gap:12px;padding-top:12px;font-size:var(--fs-s);color:var(--soft)}
.case-gallery-tools span{font-variant-numeric:tabular-nums;margin-right:auto}
.case-gallery-tools button{order:1;min-height:40px;padding:0 16px;border-radius:99px;background:var(--w-075);box-shadow:inset 0 0 0 1px var(--w-12);font-size:var(--fs-s);font-weight:500;color:var(--white);transition:background-color .2s,scale .16s var(--ease)}
.case-gallery-tools button:hover{background:var(--w-13)}
.case-gallery-tools button:active{scale:.97}
.case-story figcaption{padding-top:10px;font-size:var(--fs-s);line-height:1.45;color:var(--mid);max-width:68ch}

/* Buttons of the article: the site's pill, tinted with the direction's colour */
.case-preview .button{display:inline-flex;align-items:center;min-height:48px;max-width:100%;padding:8px 24px;border-radius:99px;background:color-mix(in srgb,var(--case-accent) 26%,var(--w-06));box-shadow:inset 0 0 0 1px var(--w-12),inset 0 1px 0 var(--w-2);
 font-size:var(--fs-s);font-weight:500;line-height:1.3;color:var(--white);text-decoration:none;transition:background-color .2s,scale .16s var(--ease)}
.case-preview .button:hover{background:color-mix(in srgb,var(--case-accent) 40%,var(--w-1))}
.case-preview .button:active{scale:.97}
.case-footer{margin-top:clamp(40px,5.4cqi,72px);padding-top:24px;border-top:1px solid var(--w-1)}
.case-footer-actions{display:flex;flex-wrap:wrap;align-items:center;gap:16px 24px}
.case-footer .project-contact{margin:0}
.case-footer-actions:empty{display:none}
.case-footer:has(.case-footer-actions:empty){display:none}

@container(max-width:1000px){
 .project-spread{grid-template-columns:minmax(0,1fr);gap:24px}
 .project-spread-media{grid-column:auto}
}
@container(max-width:820px){
 .case-story{grid-template-columns:minmax(0,1fr);gap:18px}
 .case-story>:is(h2,p,h3,.case-story-button){grid-column:1}
 .case-story>h2+:is(p,h3){margin-top:0}
}
@media(max-width:640px){
 .case-preview{--fs-read:15px}
 .case-story-collage:not([data-ratio=auto]) .case-story-images{gap:6px;grid-template-columns:repeat(2,minmax(0,1fr))}
 .case-story-collage:not([data-ratio=auto]) .case-story-images>div:only-child{grid-column:1/-1}
 .case-story-collage[data-ratio=auto] .case-story-images,.case-row{gap:6px}
 .case-gallery-tools button{min-height:44px}
 .case-preview .button{min-height:44px;padding:8px 20px}
}


/* Video follows the same media geometry; covers in the catalog stay poster images. */
/* Video and the site's player. The clip stands in .vp-stage at its own proportions; the strip (.vp) is
   attached under it and covers nothing. Where the box has fixed proportions (a cover, a collage cell, a screen
   of a built cover) there is no room under the clip: the strip lies over its lower edge and shows on hover,
   on focus and while paused. */
.case-video{position:relative;display:flex;flex-direction:column;width:100%;background:var(--tile);border-radius:12px;overflow:hidden;isolation:isolate}
.vp-stage{position:relative;flex:1;min-height:0;aspect-ratio:var(--video-ratio,16/9)}
.case-video video{display:block;width:100%;height:100%;max-width:100%;object-fit:contain;background:#000}
.has-player video{cursor:pointer}
.case-video-error{position:absolute;inset:auto 8px 52px;z-index:3;padding:8px 10px;border-radius:8px;background:rgba(5,6,8,.92);color:var(--soft);font-size:var(--fs-xs);line-height:1.4}
/* The strip: the home page's player, smaller */
.vp{flex:none;display:flex;align-items:center;gap:10px;height:44px;padding:0 8px 0 6px;background:#10131a;box-shadow:inset 0 1px 0 var(--w-06);font-size:12px;font-variant-numeric:tabular-nums;color:var(--soft);user-select:none;-webkit-user-select:none}
.vp button{flex:none;display:grid;place-items:center;width:32px;height:32px;border-radius:50%;color:var(--white);transition:background-color .2s,scale .16s var(--ease)}
.vp button:hover{background:var(--w-1)}
.vp button:active{scale:.92}
.vp .vp-play{background:var(--w-1);box-shadow:inset 0 0 0 1px var(--w-12)}
.vp svg{width:16px;height:16px;fill:currentColor}
.vp-mute svg{fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.vp-mute svg .f{fill:currentColor;stroke:none}
.i-pause,.is-playing .i-play,.i-off,.is-muted .i-on{display:none}
.is-playing .i-pause,.is-muted .i-off{display:block}
.vp-full svg{fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.vp-full .i-out,.is-full .vp-full .i-in{display:none}.is-full .vp-full .i-out{display:block}
.vp .vp-q{width:auto;min-width:32px;height:22px;padding:0 6px;border-radius:6px;font:600 10.5px/1 inherit;letter-spacing:.04em;color:var(--soft);box-shadow:inset 0 0 0 1px var(--w-12)}
.vp .vp-q:hover{color:var(--white)}
.vp [hidden]{display:none}
/* Full screen: the clip fills the screen, the strip stays under it. */
.case-video:is(:fullscreen,:-webkit-full-screen){display:flex;flex-direction:column;width:100%;height:100%;max-width:none;background:#000;border-radius:0}
.case-video:is(:fullscreen,:-webkit-full-screen) .vp-stage{flex:1;min-height:0;aspect-ratio:auto;border-radius:0}
.case-video:is(:fullscreen,:-webkit-full-screen) video{width:100%;height:100%;object-fit:contain!important;object-position:center!important}
.case-video:is(:fullscreen,:-webkit-full-screen) .vp{position:static;opacity:1;background:#10131a;padding-bottom:env(safe-area-inset-bottom)}
.vp-now,.vp-dur{flex:none;min-width:3ch}
.vp-bar{position:relative;flex:1;min-width:40px;height:28px;cursor:pointer;touch-action:none;outline:none}
.vp-bar:before,.vp-buf,.vp-fill{content:'';position:absolute;left:0;right:0;top:50%;height:3px;margin-top:-1.5px;border-radius:2px;transform-origin:0 50%;transition:height .15s,margin .15s}
.vp-bar:before{background:var(--w-16)}
.vp-buf{background:var(--w-34);transform:scaleX(0)}
.vp-fill{background:var(--white);transform:scaleX(0)}
.vp-knob{position:absolute;top:50%;left:0;width:12px;height:12px;margin:-6px 0 0 -6px;border-radius:50%;background:var(--white);box-shadow:0 1px 4px rgba(0,0,0,.4);scale:.7;transition:scale .15s}
.vp-bar:is(:hover,:focus-visible) :is(.vp-buf,.vp-fill),.vp-bar:hover:before,.is-seeking .vp-bar:before,.is-seeking :is(.vp-buf,.vp-fill){height:5px;margin-top:-2.5px}
.vp-bar:is(:hover,:focus-visible) .vp-knob,.is-seeking .vp-knob{scale:1}
.vp-bar:focus-visible{box-shadow:0 0 0 2px var(--blue);border-radius:6px}
.vp-tip{position:absolute;bottom:calc(100% + 4px);left:0;translate:-50% 0;padding:3px 7px;border-radius:6px;background:rgba(5,6,8,.9);color:var(--white);font-size:11.5px;white-space:nowrap;opacity:0;pointer-events:none;transition:opacity .15s}
.vp-bar:hover .vp-tip,.is-seeking .vp-tip{opacity:1}
/* Over the clip: a big play before the first start, and a spinner while it waits for data */
.vp-big{position:absolute;left:50%;top:50%;z-index:2;display:grid;place-items:center;width:64px;height:64px;margin:-32px 0 0 -32px;border-radius:50%;color:var(--white);
 background:rgba(12,14,20,.55);-webkit-backdrop-filter:blur(12px);backdrop-filter:blur(12px);box-shadow:inset 0 0 0 1px var(--w-2);transition:scale .25s var(--ease),background-color .2s}
.vp-big svg{width:24px;height:24px;fill:currentColor;margin-left:3px}
.vp-big:hover{scale:1.06;background:rgba(12,14,20,.7)}
.is-playing .vp-big{display:none}
.vp-wait{position:absolute;left:50%;top:50%;z-index:2;width:36px;height:36px;margin:-18px 0 0 -18px;border-radius:50%;border:2.5px solid var(--w-2);border-top-color:var(--white);animation:vp-spin .8s linear infinite;pointer-events:none}
@keyframes vp-spin{to{rotate:1turn}}
/* Narrow players drop the clock; the progress line stays */
.case-video{container-type:inline-size}
@container (max-width:340px){.vp-now,.vp-dur{display:none}.vp{gap:6px}}
@container (max-width:240px){.vp .vp-q{display:none}}
@container (max-width:200px){.vp-big{width:44px;height:44px;margin:-22px 0 0 -22px}.vp-big svg{width:18px;height:18px}}
/* Boxes with fixed proportions: the strip lies over the clip */
:is(.case-cover-image,.cover-screen)>.case-video,.case-story-collage:not([data-ratio=auto]) .case-video,.case-row .case-video{height:100%;border-radius:0}
:is(.case-cover-image,.cover-screen)>.case-video .vp-stage,.case-story-collage:not([data-ratio=auto]) .vp-stage,.case-row .vp-stage{aspect-ratio:auto;height:100%}
:is(.case-cover-image,.cover-screen,.case-story-collage:not([data-ratio=auto]),.case-row) .vp{position:absolute;inset:auto 0 0;z-index:3;background:linear-gradient(transparent,rgba(5,6,8,.78));box-shadow:none;opacity:0;transition:opacity .25s}
:is(.case-cover-image,.cover-screen,.case-story-collage:not([data-ratio=auto]),.case-row) .case-video:is(:hover,:focus-within,:not(.is-playing)) .vp{opacity:1}
.cover-screen .vp{display:none}
/* The single clip of a story: its own proportions, as wide as the article allows under the screen's height */
.case-story-image .case-story-images>div:has(.case-video){aspect-ratio:auto;overflow:visible;width:min(100%,calc(var(--media-h) * var(--a,1.7778)))}
.case-video.is-missing .vp,.case-video.is-missing .vp-big,.case-video.is-missing .vp-wait{display:none!important}
.case-story-image .case-video .vp-stage{aspect-ratio:var(--video-ratio,16/9)}
.case-story-gallery .case-video{height:100%;width:auto;max-width:100%;aspect-ratio:auto}
.case-story-gallery .case-video .vp-stage{aspect-ratio:var(--video-ratio,16/9);height:auto;max-height:calc(100% - 44px)}
@media(prefers-reduced-motion:reduce){.vp-wait{animation-duration:2s}}
.case-story-collage[data-fit=cover] video{object-fit:cover!important}
.case-story-collage[data-fit=contain] video{object-fit:contain!important}

