.case-hero .facts{grid-template-columns:repeat(5,minmax(0,1fr))}
.case-behance{display:inline-flex;align-items:center;gap:12px;color:var(--accent)}
.case-behance img{flex:none;object-fit:contain}
.case-behance:hover span{text-decoration:underline;text-underline-offset:4px}
html[data-theme="dark"] .case-behance img{filter:invert(1)}
.case-summary-panel .hero-summary{margin:0;max-width:none}
.case-time{display:flex;align-items:center;gap:16px;margin-top:28px;padding:20px 24px;border:1px solid var(--line);border-radius:20px;background:var(--panel)}
.case-time>svg{width:28px;height:28px;flex:none;color:var(--accent)}
.case-time span{display:block;font-size:12px;color:var(--muted)}
.case-time strong{display:block;margin-top:4px;font-size:24px;line-height:1.2;font-weight:600;color:var(--text)}
.contents>span{font-size:16px;font-weight:600;color:var(--text);margin-bottom:22px}
.image-slot[role="button"]{cursor:zoom-in}
.image-slot:focus-visible{outline:3px solid var(--accent);outline-offset:5px}
dialog.case-lightbox{width:min(1440px,calc(100vw - 48px));max-width:none;max-height:calc(100dvh - 48px);padding:24px;border:1px solid var(--line);border-radius:24px;background:var(--bg);color:var(--text);overflow:auto}
.case-lightbox::backdrop{background:rgba(5,9,16,.85);backdrop-filter:blur(8px)}
.case-lightbox-bar{display:flex;align-items:center;justify-content:space-between;gap:24px;margin-bottom:20px}
.case-lightbox-bar h2{font:600 18px/1.4 'Google Sans',sans-serif;margin:0;color:var(--text)}
.case-lightbox-close{display:grid;place-items:center;flex:none;width:40px;height:40px;border:1px solid var(--line);border-radius:50%;background:var(--panel);color:var(--text);font:24px/1 sans-serif}
.case-lightbox-content .image-slot{width:100%;max-width:none;margin:0;min-height:min(560px,65vh);aspect-ratio:16/9;pointer-events:none}
.case-lightbox-content img{display:block;max-width:100%;max-height:76vh;object-fit:contain;margin:auto}
@media(max-width:800px){.case-hero .facts{grid-template-columns:repeat(2,minmax(0,1fr))}.case-hero .facts>div:last-child{grid-column:auto}.case-time{max-width:480px;margin-top:24px}}
@media(max-width:540px){.case-summary-panel{margin-top:24px}.case-lightbox-content .image-slot{min-height:300px;aspect-ratio:auto}.case-lightbox-content .slot-center{padding:64px 16px}.case-lightbox-content .slot-spec{display:none}dialog.case-lightbox{width:calc(100vw - 24px);padding:16px;max-height:calc(100dvh - 24px)}.case-behance{align-items:start;gap:8px}.case-lightbox-bar h2{font-size:16px}}

.case-video-cover.image-slot{display:block;aspect-ratio:16/9;min-height:0;border:0;background:var(--panel);overflow:hidden}
.case-video-cover video{display:block;width:100%;height:100%;object-fit:contain}
.case-video-toggle{position:absolute;right:16px;bottom:16px;display:grid;place-items:center;width:40px;height:40px;border:1px solid #ffffff50;border-radius:50%;background:#101214b3;color:#fff;font:18px/1 sans-serif;cursor:pointer;backdrop-filter:blur(8px)}
.case-video-toggle:hover{background:#101214e6}

/* Display supplied case artwork in full at its original aspect ratio. */
figure.case-image.image-slot{display:block;aspect-ratio:auto;min-height:0;align-self:start;border:0;background:transparent;padding:0}
figure.case-image>img{display:block;width:100%;height:auto;max-width:100%;margin:0}
.case-image-caption{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}
.case-lightbox-content>img{width:100%;height:auto;max-height:none;object-fit:contain}
.case-lightbox-bar{position:sticky;top:-24px;z-index:1;padding:12px 0;background:var(--bg)}
@media(max-width:540px){.case-lightbox-bar{top:-16px}}

/* A restrained browser frame for the video cover. */
figure.case-video-cover.image-slot{aspect-ratio:auto;border:1px solid var(--line);border-radius:22px;box-shadow:0 4px 24px #091e420a;background:var(--bg)}
.case-video-cover video{width:100%;height:auto;aspect-ratio:16/9}
.case-browser-bar{display:flex;align-items:center;justify-content:space-between;gap:20px;padding:10px 16px;background:var(--panel);border-bottom:1px solid var(--line)}
.case-browser-dots,.case-browser-spacer{width:48px;flex:0 0 48px}
.case-browser-dots{display:flex;gap:6px}.case-browser-dots i{width:9px;height:9px;background:var(--muted);opacity:.3;border-radius:50%}
.case-browser-address{font-size:11px;line-height:1.5;color:var(--muted);background:var(--bg);padding:4px 32px;border:1px solid var(--line);border-radius:14px;min-width:180px;text-align:center}
/* Keep light artwork distinct from the surrounding page. */
figure.case-image.image-slot{border:1px solid var(--line);border-radius:18px;box-shadow:0 2px 12px #091e4208;background:var(--panel);transition:border-color .3s ease,box-shadow .3s ease}
figure.case-image>img{transition:transform .5s cubic-bezier(.2,.65,.3,1);transform-origin:center}
@media(hover:hover) and (pointer:fine){figure.case-image:hover{border-color:color-mix(in srgb,var(--accent) 35%,transparent);box-shadow:0 6px 22px #091e4212}figure.case-image:hover>img{transform:scale(1.015)}}
/* The header stays separate from the scrollable artwork, with no empty gutter. */
dialog.case-lightbox{padding:0;overflow:hidden}
dialog.case-lightbox[open]{display:flex;flex-direction:column}
.case-lightbox-bar{position:static;flex:none;margin:0;padding:16px 24px;background:var(--bg);border-bottom:1px solid var(--line)}
.case-lightbox-content{min-height:0;overflow:auto;overscroll-behavior:contain;padding:0;margin:0;background:var(--bg)}
.case-lightbox-content>img{display:block;width:100%;height:auto;max-height:none;margin:0;border:0;border-radius:0}
.case-lightbox-content>.image-slot{margin:20px;width:calc(100% - 40px)}
@media(max-width:540px){dialog.case-lightbox{padding:0}.case-lightbox-bar{padding:12px 16px}.case-browser-bar{padding:8px 12px;gap:8px}.case-browser-dots,.case-browser-spacer{width:36px;flex-basis:36px}.case-browser-dots{gap:4px}.case-browser-dots i{width:7px;height:7px}.case-browser-address{min-width:0;padding:3px 24px;font-size:10px}}
@media(prefers-reduced-motion:reduce){figure.case-image,figure.case-image>img{transition:none}figure.case-image:hover>img{transform:none}}

/* Captions remain visible in the article as well as in the image viewer. */
figure.case-image.image-slot{border:0;box-shadow:none;background:transparent;overflow:visible}
figure.case-image>img{border:1px solid var(--line);border-radius:18px;box-shadow:0 2px 12px #091e4208}
figure.case-image .case-image-caption{position:static;width:auto;height:auto;margin:14px 0 0;padding:0 2px;overflow:visible;clip-path:none;white-space:normal;color:var(--muted);font-size:13px;line-height:1.5}
.case-image-caption strong{font-weight:500}
@media(hover:hover) and (pointer:fine){figure.case-image:hover{box-shadow:none}figure.case-image:hover>img{border-color:color-mix(in srgb,var(--accent) 35%,transparent);box-shadow:0 6px 22px #091e4212}}

/* Standard case media card: title above the full, uncropped artwork. */
figure.case-image.image-slot{display:flex;flex-direction:column;overflow:hidden;border:1px solid var(--line);border-radius:20px;background:var(--panel);box-shadow:0 2px 12px #091e4208}
figure.case-image .case-image-caption{order:0;margin:0;padding:16px 20px;font-size:14px;line-height:1.5;color:var(--text);border-bottom:1px solid var(--line);background:var(--panel)}
.case-image-caption strong{font-weight:500}
.case-image-art{overflow:hidden;width:100%;background:var(--bg)}
.case-image-art>img{display:block;width:100%;height:auto;margin:0;border:0;border-radius:0;transition:transform .5s cubic-bezier(.2,.65,.3,1)}
@media(hover:hover) and (pointer:fine){figure.case-image:hover{border-color:color-mix(in srgb,var(--accent) 35%,transparent);box-shadow:0 6px 22px #091e4212}figure.case-image:hover .case-image-art>img{transform:scale(1.015)}}
@media(max-width:540px){figure.case-image .case-image-caption{padding:12px 16px;font-size:13px}}
@media(prefers-reduced-motion:reduce){.case-image-art>img{transition:none}figure.case-image:hover .case-image-art>img{transform:none}}

figure.case-image.image-slot{align-items:stretch;justify-content:flex-start}figure.case-image .case-image-caption{width:100%;text-align:left}

.case-media-stack{display:flex;flex-direction:column;gap:24px}
.case-media-stack>figure.case-image{width:100%}
.case-embed{margin-top:24px;padding-top:56px;border-top:1px solid var(--line)}
.case-embed-heading{display:flex;align-items:center;justify-content:space-between;gap:24px;margin-bottom:24px}
.case-embed-heading h2{font-size:32px;line-height:1.2;letter-spacing:-.6px;margin:0;color:var(--text)}
.case-embed-heading a{font-size:14px;color:var(--accent);white-space:nowrap}
.case-embed-heading a:hover{text-decoration:underline;text-underline-offset:4px}
.case-embed-frame{width:100%;border:1px solid var(--line);border-radius:20px;overflow:hidden;background:var(--panel)}
.case-embed iframe{display:block;width:100%;height:clamp(480px,75vh,900px);border:0}
@media(max-width:650px){.case-embed{padding-top:32px}.case-embed-heading{align-items:flex-start;flex-direction:column;gap:16px}.case-embed-heading h2{font-size:28px}.case-embed iframe{height:560px}.case-media-stack{gap:20px}}

/* Compact chapter rhythm; scroll scaling is capped to avoid empty trailing space. */
.case-layout{padding-top:56px}
.chapter{padding-bottom:48px;row-gap:24px}
.chapter:last-child{padding-bottom:0}
.case-embed{margin-top:24px;padding-top:32px}
@media(max-width:540px){.case-layout{padding-top:40px}.chapter{padding-bottom:40px}.chapter:last-child{padding-bottom:0}.case-embed{margin-top:24px;padding-top:24px}}

.case-figma{display:inline-flex;align-items:center;gap:12px;color:var(--accent)}.case-figma img{flex:none;object-fit:contain}.case-figma:hover span{text-decoration:underline;text-underline-offset:4px}@media(max-width:1100px) and (min-width:801px){.case-hero .facts{grid-template-columns:repeat(3,minmax(0,1fr))}}@media(max-width:540px){.case-figma{align-items:start;gap:8px}}

.case-figma img{filter:brightness(0)}html[data-theme="dark"] .case-figma img{filter:brightness(0) invert(1)}

/* Matched comparison canvases; the image viewer keeps original proportions. */
#chapter-2 .media-grid .case-image-art{aspect-ratio:2/1}
#chapter-3 .media-grid .case-image-art{aspect-ratio:2/3}
:is(#chapter-2,#chapter-3) .media-grid .case-image-art>img{width:100%;height:100%;object-fit:cover;object-position:top center}

/* Shared case-video playback affordances. */
.case-video-cover,.case-inline-video .case-image-art{position:relative}
.case-video-controls{position:absolute;right:16px;bottom:16px;display:flex;align-items:center;gap:8px;z-index:2}
.case-video-controls .case-video-toggle{position:static;flex:none}
.case-video-restart{display:inline-flex;align-items:center;justify-content:center;gap:7px;height:40px;padding:0 12px;border:1px solid #ffffff50;border-radius:30px;background:#101214b3;color:#fff;font:500 12px/1.2 'Google Sans',sans-serif;cursor:pointer;backdrop-filter:blur(8px)}
.case-video-restart svg{width:18px;height:18px;flex:none}
.case-video-restart:hover{background:#101214e6}
.case-video-hint{position:absolute;left:14px;bottom:17px;display:none;align-items:center;gap:7px;max-width:calc(100% - 220px);padding:8px 10px;border:1px solid #ffffff50;border-radius:28px;background:#101214a6;color:#fff;font:500 12px/1.3 'Google Sans',sans-serif;backdrop-filter:blur(8px);pointer-events:none;transition:opacity .2s}
.case-video-hint svg{width:17px;height:17px;flex:none}
@media(min-width:651px) and (hover:hover) and (pointer:fine){.case-video-hint{display:flex}.is-video-playing .case-video-hint{opacity:0}}
.case-image-art:focus-visible{outline:3px solid var(--accent);outline-offset:-3px}
@media(max-width:540px){.case-video-controls{right:10px;bottom:10px;gap:6px}.case-video-restart{padding:0 10px}}

/* Clickable case media use a hand pointer and a shared video-capable viewer. */
.case-lightbox-trigger,.image-slot[role="button"],.case-inline-video .case-image-art,.case-video-cover.case-lightbox-trigger{cursor:pointer}
.case-lightbox-trigger img,.case-lightbox-trigger video{cursor:inherit}
.case-lightbox-video{width:100%;background:#101113}
.case-lightbox-video>video{display:block;width:100%;height:auto;aspect-ratio:16/9;max-height:calc(100dvh - 200px);object-fit:contain;background:#101113}
.case-lightbox-video-controls{display:flex;justify-content:flex-end;align-items:center;gap:8px;padding:10px 16px;background:var(--panel)}
.case-lightbox-video-controls .case-video-toggle{position:static}
.case-lightbox.has-video .case-lightbox-content{overflow:auto}
