/* Case pages in the homepage look. Loaded after studio.css and portfolio-home.css on a body with
   class "portfolio-front case-front": the homepage supplies paper, ink, type, header and footer;
   this file only fits the case-page blocks to it. */
body.case-front { --paper:var(--front-paper); --ink:var(--front-ink); --violet:var(--front-purple); --rule:var(--front-rule); }
.case-front main { max-width:800px; margin-inline:auto; padding-inline:clamp(15px,3vw,40px); }
.case-front :is(.intro,.more,.flagship-cover,.flagship-group,.case-nav) { margin-inline:0; }
.case-front .intro { padding-inline:0; }
.case-front .intro { padding-block:clamp(18px,3vw,34px) 16px; }
.case-front .label { font:800 12px/1.35 "Helvetica Neue",Arial,sans-serif; letter-spacing:.065em; }
html[lang="th"] .case-front .label { letter-spacing:0; }
.case-front .intro h1 { font-size:clamp(34px,5.3vw,60px); letter-spacing:-.012em; line-height:1.06; margin:8px 0 12px; }
html[lang="th"] .case-front .intro h1 { letter-spacing:0; line-height:1.19; }
.case-front .intro p:last-child { max-width:56ch; font-size:16px; line-height:1.5; }
.case-front .flagship-group { border-top-color:var(--front-ink); }
.case-front .flagship-group h2 { font-size:clamp(27px,3.6vw,40px); letter-spacing:0; }
.case-front .flagship-group p, .case-front .flagship-plain { font-size:15px; }
.case-front .more { margin-block:26px 0; }
.case-front .more > .label { padding-bottom:8px; }
.case-front .more > h2, .case-front .more h3 { font:600 clamp(23px,3vw,32px)/1.12 Pridi,Georgia,serif; font-synthesis:none; letter-spacing:0; margin:10px 0 12px; text-wrap:balance; }
html[lang="th"] .case-front .more > h2 { line-height:1.25; }
.case-front .more > p:not(.label) { font-size:15px; }
.case-front .flagship-cover .tag { padding:0; background:none; color:inherit; }
.case-front .flagship-cover .tag::after { content:" · "; }
.case-front figcaption { color:#5b5064; font-size:12px; }
/* The "skills in use" sticker becomes a plain label over full-width text. */
.case-front .story-note { grid-template-columns:minmax(0,1fr); gap:6px; margin-top:16px; }
.case-front .story-note > p { max-width:60ch; font-size:15px; line-height:1.5; }
.case-front .skill-stamp { display:block; padding:0; margin:0; background:none; border:0; transform:none; color:var(--front-ink); }
.case-front .skill-stamp span { display:block; font-size:11px; letter-spacing:.065em; color:#5b5064; }
.case-front .skill-stamp strong { font-size:16px; font-weight:800; letter-spacing:0; line-height:1.3; }
.case-front .line-steps li { background:#f0e9df; color:var(--front-ink); }
.case-front .line-steps li::before { font:800 11px/1.3 "Helvetica Neue",Arial,sans-serif; }
.case-front .project-action, .case-front .case-nav a { font-size:14px; font-weight:800; text-underline-offset:4px; }
.case-front .case-nav { margin-block:26px 0; }
.case-front .caption-note { color:#5b5064; }
.case-front .front-footer { max-width:800px; margin-inline:auto; padding-inline:clamp(15px,3vw,40px); }
.case-front .zoom:hover { outline-color:var(--front-rule); }
.case-front .artwork-viewer { border-color:var(--front-rule); }
@media(min-width:600px) { body.case-front { max-width:1240px; } }

/* All case pages: one column edge, one heading face, no lime. */
body.case-front { --lime:#fff4e3; }
.case-front main > :is(section,figure,header,nav,dl,div,p,h1,form,a,button) { margin-inline:0; }
.case-front main > :is(.intro,.theft-intro) { padding-inline:0; }
.case-front :is(.hhh-section,.hhh-chapter-head) { margin-inline:0; }
.case-front main :is(h2,h3) { font-family:Pridi,Georgia,serif; font-weight:600; font-synthesis:none; letter-spacing:0; }
html[lang="th"] .case-front main :is(h2,h3) { line-height:1.25; }
.case-front .hhh-chapter-head { border-top-color:var(--front-ink); }
.case-front main.enquiry { padding-block:18px 24px; }
.case-front :is(.open-draft, .enquiry button[type="submit"]) { background:var(--front-purple); color:#fff; border-color:var(--front-purple); }
.case-front .case a { text-underline-offset:3px; }

/* Case system (body.case-sys): the homepage's rules on a project page.
   One measure, one gap between chapters, one label, one heading size, one frame (ink, padded,
   pictures centred), one button per chapter and plain links after it. */
body.case-sys { --case-gap:clamp(40px,6vw,76px); --case-pad:clamp(12px,3vw,36px); --case-shot:min(560px,72vh); }
.case-sys main, .case-sys .front-footer { max-width:1000px; }

/* Measure and labels */
.case-sys main :is(.intro,.more,.hhh-section,.hhh-chapter-head,.hhh-brand,.hhh-demo,.hhh-decision,.flagship-group,.story-note,.pinup-showcase,.theft-detail) > p:not(.label,.caption-note) { max-width:60ch; font-size:16px; line-height:1.5; }
.case-sys main :is(.label,.skill-stamp strong) { font:800 12px/1.35 "Helvetica Neue",Arial,sans-serif; letter-spacing:.065em; text-transform:uppercase; color:var(--front-ink); }
html[lang="th"] .case-sys main :is(.label,.skill-stamp strong) { letter-spacing:0; }
.case-sys .more > .label { border:0; padding:0; margin:0; }
.case-sys .skill-stamp span { display:none; }
.case-sys .story-note { margin-top:18px; gap:4px; }
.case-sys .caption-note, .case-sys figcaption { color:#5b5064; font-size:13px; }

/* One heading size for every chapter */
.case-sys main :is(.more > h2, .hhh-section > h3, .hhh-demo > h3, .hhh-decision > h3, .hhh-brand > h2, .pinup-book-header h2) { font-size:clamp(26px,3.1vw,40px); line-height:1.1; margin:6px 0 10px; color:inherit; }
html[lang="th"] .case-sys main :is(.more > h2, .hhh-section > h3, .hhh-demo > h3, .hhh-decision > h3, .hhh-brand > h2, .pinup-book-header h2) { line-height:1.25; }

/* One gap and one rule between chapters; a heavier rule between groups */
.case-sys main > :is(.case,.more,.pinup-showcase,.flagship-cover,.hhh-cover,.hhh-brand,.hhh-yearline,.hhh-chapter) { margin-top:var(--case-gap); }
.case-sys main > .more, .case-sys .hhh-section, .case-sys main > .hhh-brand { padding-top:clamp(14px,2.2vw,24px); border-top:1px solid var(--front-rule); }
.case-sys :is(.flagship-group,.hhh-chapter-head) { margin-top:var(--case-gap); padding-top:clamp(14px,2.2vw,24px); border-top:3px solid var(--front-ink); }
.case-sys .flagship-group + .more { margin-top:clamp(20px,3vw,32px); }
.case-sys .case-nav { margin-top:var(--case-gap); padding-top:clamp(14px,2.2vw,24px); border-top:1px solid var(--front-rule); }

/* One frame */
.case-sys .case { padding:var(--case-pad); background:var(--front-ink); border:0; }
.case-sys .case :is(.case-meta,.case-bottom) { display:none; }
.case-sys .case .evidence { display:flex; align-items:center; justify-content:center; gap:clamp(10px,3vw,36px); margin:0; padding:0; background:none; border:0; }
.case-sys .case .evidence figure { flex:0 1 auto; min-width:0; margin:0; padding:0; background:none; border:0; }
.case-sys .case .evidence figcaption { display:none; }
.case-sys .case .evidence img { display:block; width:auto; height:auto; max-width:100%; max-height:var(--case-shot); border:0; }
.case-sys :is(.more > a.zoom, .flagship-wide, .flagship-phone, .story-pair, .theft-landing figure > a, .pinup-before, .hhh-boards) { display:flex; align-items:center; justify-content:center; gap:clamp(10px,3vw,36px); max-width:none; margin:18px 0 0; padding:var(--case-pad); background:var(--front-ink); border:0; }
.case-sys :is(.more > a.zoom, .flagship-wide, .flagship-phone, .story-pair, .theft-landing figure > a, .pinup-before, .hhh-boards) img { display:block; width:auto; height:auto; max-width:100%; max-height:var(--case-shot); margin:0; border:0; }
.case-sys :is(.story-pair, .pinup-before, .hhh-boards) figure { flex:0 1 auto; min-width:0; margin:0; }
.case-sys :is(.story-pair, .pinup-before, .hhh-boards) figcaption { padding-top:8px; color:#d8cedd; }
.case-sys .flagship-wide img, .case-sys .theft-landing figure > a img { width:100%; max-height:none; }
.case-sys .story-pair + .story-pair { margin-top:clamp(10px,2vw,16px); }
.case-sys .flagship-cover img, .case-sys .hhh-cover img { display:block; width:100%; height:auto; }
.case-sys .zoom:hover { outline:0; }

/* One button per chapter, plain links after it */
.case-sys :is(.more,.hhh-section,.hhh-decision) > .project-action { display:inline-flex; align-items:center; min-height:46px; margin:18px 20px 0 0; color:var(--front-ink); font:800 14px/1.2 "Helvetica Neue",Arial,sans-serif; text-underline-offset:4px; }
.case-sys :is(.more,.hhh-section,.hhh-decision) > .project-action:not(.project-action ~ .project-action),
.case-sys .theft-actions .action, .case-sys .pinup-book-link { padding:0 18px; background:var(--front-purple); color:#fff; text-decoration:none; }

/* After Theft: the opening sits on the page paper like the homepage, its art stays */
.case-sys .theft-intro { background:none; border:0; padding-inline:0; }
.case-sys.after-theft-case main > :not(.theft-intro) { width:auto; }

/* Pinup: heading and controls on the paper, the book in the frame */
.case-sys .pinup-showcase { margin-inline:0; padding:0; background:none; color:inherit; }
.case-sys .pinup-spreads { padding:var(--case-pad); background:var(--front-ink); }
.case-sys .pinup-spreads figcaption { color:#d8cedd; }
.case-sys .pinup-case .pinup-story, .case-sys.pinup-case .pinup-story { margin-inline:0; }

/* Harlequins: demos and decisions in the same ink frame, at the column edge */
.case-sys :is(.hhh-cover,.hhh-demo,.hhh-decision) { margin-inline:0; background:var(--front-ink); }
.case-sys :is(.hhh-demo,.hhh-decision) { padding:var(--case-pad); margin-top:18px; }
.case-sys :is(.hhh-demo,.hhh-decision) :is(.label,h3,p) { color:#fff8e8; }
.case-sys .hhh-pitch { width:100%; max-width:none; }
.case-sys :is(.more > a.zoom, .flagship-wide, .flagship-phone, .story-pair, .theft-landing figure > a, .pinup-before, .hhh-boards) { width:auto; box-sizing:border-box; }
.case-sys main > .intro + :is(.case,.flagship-cover,.hhh-cover,.pinup-showcase) { margin-top:clamp(16px,2.4vw,28px); }
.case-sys .hhh-cover figcaption { color:#d8cedd; }
.case-sys .hhh-more { margin-inline:0; }
.case-sys .hhh-chapter-head + .hhh-section { border-top:0; padding-top:0; }
.case-sys .hhh-pitch { box-sizing:border-box; width:100%; max-width:none; margin:18px 0 0; padding:var(--case-pad) max(var(--case-pad), calc((100% - 640px) / 2)); background:linear-gradient(#193d34,#193d34) content-box, var(--front-ink); }
.case-sys .hhh-lesson-proof { display:flex; flex-direction:column; align-items:center; max-width:none; margin:18px 0 0; padding:var(--case-pad); background:var(--front-ink); }
.case-sys .hhh-lesson-proof a { display:block; width:min(100%,460px); }
.case-sys .hhh-lesson-proof img { display:block; width:100%; border:0; }
.case-sys .hhh-lesson-proof figcaption { color:#d8cedd; }
.case-sys .hhh-lesson-proof img { aspect-ratio:auto; object-fit:contain; }
.case-sys .pinup-spreads { max-width:none; width:auto; margin-inline:0; }
.case-sys main > .theft-intro + .case { margin-top:clamp(16px,2.4vw,28px); }
.case-sys :is(.pinup-before,.story-pair,.flagship-wide,.flagship-phone,.hhh-boards,.more > a.zoom) + :is(p,.story-note) { margin-top:18px; }
.case-sys :is(.flagship-wide,.flagship-phone) { flex-direction:column; }
.case-sys :is(.flagship-wide,.flagship-phone) > a { display:block; }
.case-sys .flagship-wide > a { width:100%; }
.case-sys :is(.flagship-wide,.flagship-phone) figcaption { padding-top:8px; color:#d8cedd; }
.case-sys :is(.more,.hhh-section,.hhh-decision) > .project-action ~ .project-action { margin-top:6px; }
@media (max-width:599px) {
  .case-sys .case .evidence { flex-direction:column; }
  .case-sys .case .evidence figure + figure img { max-height:min(460px,64vh); }
}
.case-sys .case .evidence figure { width:auto; align-self:center; }

/* Case system, website pages: a heading inside a frame, and lone figures, follow the same frame. */
.case-sys .case > h2 { margin:0 0 clamp(12px,2vw,20px); color:#fff8e8; font-size:clamp(26px,3.1vw,40px); line-height:1.1; }
.case-sys .more > figure:not(.flagship-wide,.flagship-phone) { margin:18px 0 0; max-width:none; width:auto; }
.case-sys .more > figure:not(.flagship-wide,.flagship-phone) > a.zoom { display:flex; align-items:center; justify-content:center; box-sizing:border-box; width:auto; padding:var(--case-pad); background:var(--front-ink); border:0; }
.case-sys .more > figure:not(.flagship-wide,.flagship-phone) > a.zoom img { display:block; width:auto; height:auto; max-width:100%; max-height:var(--case-shot); margin:0; border:0; }
.case-sys .more > figure.brand-shot > a.zoom img { max-height:min(300px,40vh); }
.case-sys .more > figure:not(.flagship-wide,.flagship-phone) > figcaption { padding-top:8px; }
.case-sys .more > figure:not(.flagship-wide,.flagship-phone) + .story-note { margin-top:18px; }
.case-sys .case .evidence figure, .case-sys .case .evidence figure + figure { display:block; }

/* Case system, opening button and Merch Desk panels. */
.case-sys main :is(.intro,.tool-actions) > a.action { display:inline-flex; align-items:center; min-height:46px; margin-top:16px; padding:0 18px; border:0; background:var(--front-purple); color:#fff; font:800 14px/1.2 "Helvetica Neue",Arial,sans-serif; text-decoration:none; }
.case-sys .tool-actions > a.action { margin-top:0; }
.case-sys .tool-actions { margin-top:16px; }
.case-sys .more + .line-steps, .case-sys .more > :is(a.zoom,figure,.story-pair) + .line-steps { margin-top:14px; }
.case-sys .more:is(.buying-board-proof,.merch-example,.merch-collection) { padding-inline:0; padding-bottom:0; background:none; border-inline:0; border-bottom:0; box-shadow:none; color:inherit; border-radius:0; }
.case-sys .buying-board-proof > .label { width:auto; padding:0; background:none; }
.case-sys .buying-board-phones { display:flex; align-items:flex-start; justify-content:center; gap:clamp(10px,3vw,36px); margin:18px 0 0; padding:var(--case-pad); background:var(--front-ink); }
.case-sys .buying-board-phones figure { flex:0 1 300px; width:auto; min-width:0; margin:0; }
.case-sys .buying-board-phones figcaption { margin:0 0 8px; color:#d8cedd; font-size:13px; font-weight:700; }
.case-sys .buying-board-phones .zoom { border:0; }
.case-sys .merch-example :is(h2,table,caption,legend,label,p) { color:var(--front-ink); }
.case-sys .merch-example table { background:#fff; }
.case-sys .merch-quantity label { border-color:var(--front-rule); background:#fff; }
.case-sys .merch-quantity label:has(:checked) { border-color:var(--front-ink); box-shadow:inset 0 0 0 1px var(--front-ink); }
.case-sys .merch-quantity input { accent-color:var(--front-purple); }
.case-sys .merch-collection > h2 { color:inherit; }
.case-sys .merch-collection figcaption { color:#5b5064; }
.case-sys .merch-collection .story-pair figcaption { color:#d8cedd; }
.case-sys .more.sourcing-case { margin-top:var(--case-gap); padding:var(--case-pad); border:0; border-radius:0; background:var(--front-ink); color:#fff8e8; }
.case-sys .sourcing-case :is(.label,h2,h3,p,legend) { color:#fff8e8; }
.case-sys .sourcing-case > .label { color:#d8cedd; }
.case-sys .sourcing-steps label { border-color:#6d6480; }
.case-sys .sourcing-steps label:has(:checked) { background:#fff8e8; color:var(--front-ink); border-color:#fff8e8; }
.case-sys .sourcing-steps input { accent-color:var(--front-purple); }
.case-sys .sourcing-panel :is(dl,blockquote) { background:#fff8e8; color:var(--front-ink); border-radius:0; }
.case-sys .sourcing-panel :is(dl,blockquote) :is(p,strong,dt,dd) { color:var(--front-ink); }
.case-sys .sourcing-panel a { color:#fff8e8; }
.case-sys .sourcing-panel h3 { font-size:clamp(20px,2.2vw,26px); }
.case-sys .more > figure > a.merch-cover { flex-direction:column; align-items:stretch; overflow:visible; border:0; color:#fff8e8; }
.case-sys .merch-cover .cover-title { padding:0 0 12px; }
.case-sys .more > figure > a.merch-cover img { width:100%; max-height:none; }

/* Hang Hound 3D model: tap-to-load frame and the facts row. */
.case-sys .model-frame { margin:clamp(16px,2.4vw,28px) 0 0; }
.case-sys .model-poster { position:relative; display:block; background:var(--front-ink); }
.case-sys .model-poster img { display:block; width:100%; height:auto; aspect-ratio:16 / 10; object-fit:cover; }
.case-sys .model-poster .home-btn { position:absolute; left:50%; bottom:clamp(14px,4vw,34px); transform:translateX(-50%); white-space:nowrap; box-shadow:0 0 0 3px rgba(255,248,232,.9); }
.case-sys .model-live { display:block; width:100%; height:min(82vh,720px); border:0; background:var(--front-ink); }
.case-sys .model-frame figcaption { padding-top:8px; }
.case-sys .model-facts { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:1px; margin:clamp(18px,3vw,30px) 0 0; background:var(--front-rule); border-block:1px solid var(--front-rule); }
.case-sys .model-facts div { padding:12px 10px 12px 0; background:var(--front-paper); }
.case-sys .model-facts div:nth-child(even) { padding-left:12px; }
.case-sys .model-facts dt { font:600 clamp(24px,3vw,34px)/1.05 Pridi,Georgia,serif; }
.case-sys .model-facts dd { margin:4px 0 0; font-size:13px; color:#5b5064; }
@media (min-width:740px) { .case-sys .model-facts { grid-template-columns:repeat(5,minmax(0,1fr)); } .case-sys .model-facts div, .case-sys .model-facts div:nth-child(even) { padding:14px 12px; } .case-sys .model-poster img { aspect-ratio:auto; } }
.case-sys .model-facts div:last-child:nth-child(odd) { grid-column:1 / -1; }
@media (min-width:740px) { .case-sys .model-facts div:last-child:nth-child(odd) { grid-column:auto; } }
.case-sys .view-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:clamp(8px,1.6vw,16px); margin:18px 0 0; padding:var(--case-pad); background:var(--front-ink); }
.case-sys .view-grid figure { margin:0; min-width:0; }
.case-sys .view-grid img { display:block; width:100%; height:auto; }
.case-sys .view-grid figcaption { padding-top:6px; color:#d8cedd; }
@media (min-width:740px) { .case-sys .view-grid { grid-template-columns:repeat(4,minmax(0,1fr)); } }

/* Roof study keeps the entire model capture; the own-tab link remains after loading. */
.case-sys .roof-model-frame .model-poster img { aspect-ratio:auto; height:auto; object-fit:contain; }
.case-sys .roof-model-frame .model-poster .home-btn { position:static; display:flex; justify-content:center; width:fit-content; max-width:100%; margin:12px auto 0; transform:none; box-shadow:none; white-space:normal; text-align:center; }
.case-sys .roof-model-frame .model-poster { padding-bottom:16px; }
.case-sys .roof-model-open { margin:14px 0; }
.case-sys .roof-project-context { color:#5b5064; font-size:14px; }

/* Chinese Poker: show the full table first; keep the tall coach capture in its own frame. */
.case-sys.poker-case .poker-opening .evidence { display:block; }
.case-sys.poker-case .poker-opening .evidence figure { width:100%; }
.case-sys.poker-case .poker-opening .evidence img { width:100%; max-height:none; height:auto; object-fit:contain; }
.case-sys.poker-case .poker-coach-phone { display:flex; flex-direction:column; align-items:center; gap:10px; margin:18px 0; padding:var(--case-pad); background:var(--front-ink); }
.case-sys.poker-case .poker-coach-phone .zoom { display:block; width:min(100%,390px); }
.case-sys.poker-case .poker-coach-phone img { display:block; width:100%; height:auto; object-fit:contain; }
.case-sys.poker-case .poker-coach-phone figcaption { color:#d8cedd; }
