/* The case pages, the case studies hub and the articles of the Vix site (cases lane; docs/vix-site/standards/
   case-page.md and article-page.md). Loaded after site.css on those pages only. Flat; light by default, the
   dark pages ride the tokens. Round 4 (Anthony's 11/17 Tella, rows 27 to 40): the hub table, the hero's rhythm, the
   book cover in the story, one What we did with framed screens, the stat inside the story, the design case layout. */

/* green is for a result (row 38, "where it went green"; the homepage's row 15 asks the same). One token for the whole
   site, --gain in system/tokens.css (written by render.mjs flatTokens): 5.3 to 1 on the paper and 4.8 to 1 on the
   band, so marks, large figures and small text all use it; lifted at night. */

/* the rolled numbers keep their spaces ("99 to 487" read "99to487": row 21, "no spacing in these stats") */
.roll .dg { white-space: pre; }

/* ---------------------------------------------------------------- the case hero: H1, one lead number, the art slot
   Row 35: the left column on one rhythm: the headline, a rule, the number with its two lines, the summary, the button. */
/* fix 18: the hero closed on 86 px of blank paper at 1440 (the shared hero's bottom padding), which showed as an empty
   strip over the Partners and badges band; a case hero ends closer to the band under it */
.sec.case-hero { padding-bottom: clamp(28px, 3.2vw, 44px); }
.case-hero .ch-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: clamp(32px, 5vw, 80px); align-items: center; }
/* Dutch's QC (12/03): "our case study titles just need to be smaller". 76 px at 14ch ran five lines at 1440; the story
   and the number lead now, the title states it in two or three */
.case-hero h1 { font-size: clamp(32px, 3.6vw, 52px); line-height: 1.05; max-width: 18ch; }
.ch-words { display: grid; gap: 0; align-content: center; justify-items: start; }
.ch-words > * { order: 6; } /* anything another lane adds to the hero column (badges, a second button) follows the button */
.ch-words > h1 { order: 1; justify-self: stretch; }
.ch-lead { order: 3; justify-self: stretch; display: grid; gap: 12px; margin-top: clamp(24px, 2.6vw, 34px); padding-top: clamp(20px, 2.2vw, 28px); border-top: 1px solid var(--line); }
.ch-lead .num.xl { font-size: clamp(64px, 7.4vw, 112px); }
.case-hero .num.up::before { background: var(--gain); }
.ch-lead-l { display: grid; gap: 3px; max-width: 46ch; }
.ch-lead-l b { font: 600 15px/1.4 var(--body); color: var(--ink); }
.ch-lead-l span { font-size: 14px; line-height: 1.45; color: var(--muted); }
.ch-deck { order: 4; margin-top: clamp(18px, 2vw, 24px); font-size: clamp(17px, 1.3vw, 19px); line-height: 1.5; max-width: 44ch; }
.ch-words > .acts { order: 5; margin-top: clamp(22px, 2.4vw, 30px); }
.ch-art { min-width: 0; }
.case-art { margin: 0; position: relative; aspect-ratio: 4 / 5; max-height: 640px; width: 100%; border-radius: var(--r); overflow: hidden; background: var(--surface); }
.case-art > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.case-art.work { aspect-ratio: 4 / 3; background: #fff; }
.case-art.work > img { object-fit: cover; object-position: 50% 42%; transform: scale(1.5); transform-origin: 50% 42%; } /* a detail of the work sheet; the whole sheet opens the page below */
.case-art[data-art="stage"] { background: none; overflow: visible; aspect-ratio: auto; max-height: none; }
.case-art[data-art="stage"] .gl-stage { margin: 0; }
/* row 33: the lit dots sit on things in the photograph (cases.js places them from the case's own points) */
.ch-lights { position: absolute; inset: 0; z-index: 2; pointer-events: none; overflow: hidden; }
.ch-lights i { position: absolute; border-radius: 50%; background: #ffd98a; box-shadow: 0 0 0 1px rgba(255, 217, 138, .3), 0 0 10px 3px rgba(255, 196, 110, .7); opacity: 0; transform: translate(-50%, -50%) scale(.2); transition: opacity .2s linear, transform .2s linear; }
.story-part.on .ch-lights i { opacity: 1; transform: translate(-50%, -50%) scale(1); transition: opacity .5s var(--ease), transform .8s var(--ease); transition-delay: calc(.55s + var(--i) * .12s); }
@media (prefers-reduced-motion: reduce) { .ch-lights i, .story-part.on .ch-lights i { transition: none; } }

.sec#byline.ch-facts-sec { padding-block: clamp(32px, 3.6vw, 52px) clamp(8px, 1vw, 16px); } /* its own band under the trust band (beats Lock 2's flush .sec#byline) */
.ch-facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0 clamp(16px, 2.4vw, 36px); margin: 0; border-top: 1px solid var(--ink); }
.ch-facts.n3 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 2fr); }
.ch-facts.n2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ch-facts > div { padding-top: 14px; display: grid; gap: 6px; align-content: start; min-width: 0; }
.ch-facts dt { font: 600 11px/1.2 var(--body); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.ch-facts dd { margin: 0; font-size: 15px; line-height: 1.45; overflow-wrap: anywhere; }

/* ---------------------------------------------------------------- frames: a browser, a phone, a plain sheet (row 38)
   Drawn here, flat, one hairline. Every screen of the work sits in one. */
.frame { --fr: color-mix(in srgb, var(--ink) 32%, transparent); display: block; border: 1px solid var(--fr); border-radius: 10px; overflow: hidden; background: var(--bg); min-width: 0; }
.fr-bar { display: flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-bottom: 1px solid var(--fr); }
.fr-bar i { width: 7px; height: 7px; border-radius: 50%; border: 1px solid var(--fr); flex: none; }
.fr-bar b { margin-left: 8px; min-width: 0; max-width: 70%; height: 18px; padding: 0 9px; border: 1px solid var(--fr); border-radius: 999px; font: 600 10px/16px var(--body); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fr-bar b.fr-url { width: 46%; height: 12px; }
.fr-screen { position: relative; overflow: hidden; background: var(--surface); }
.fr-screen > img { display: block; width: 100%; height: auto; }
.frame.phone { border-radius: 28px; padding: 9px 9px 11px; }
.fr-ear { display: block; width: 30%; height: 5px; margin: 3px auto 9px; border: 1px solid var(--fr); border-radius: 999px; }
.frame.phone .fr-screen { border: 1px solid var(--fr); border-radius: 19px; }
.frame.plain { border-radius: var(--r); background: #fff; }
.frame.plain .fr-screen { background: #fff; }

/* ---------------------------------------------------------------- a design case opens on the work (row 40) */
.sec.ch-show { padding-block: clamp(40px, 5vw, 80px); }
.ch-show-fig { margin: 0; }
.ch-show-fig.duo { display: grid; grid-template-columns: minmax(0, 1fr) clamp(150px, 19.5%, 236px); gap: clamp(18px, 3vw, 48px); align-items: end; }
.ch-show-fig.solo .frame.plain { padding: clamp(12px, 3vw, 44px); }

/* ---------------------------------------------------------------- the goal (or the brief), the book cover beside it (row 33) */
.ch-open-grid { display: grid; grid-template-columns: minmax(0, 1fr) clamp(260px, 31vw, 460px); gap: clamp(32px, 5vw, 80px); align-items: center; }
.ch-open.solo .ch-open-grid { grid-template-columns: minmax(0, 1fr); }
.ch-open-words { display: grid; gap: clamp(16px, 1.8vw, 22px); align-content: center; min-width: 0; }
.ch-open-words h2 { font: 600 12px/1.2 var(--body); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin: 0; max-width: none; }
.ch-open-p { font: 400 clamp(26px, 2.9vw, 42px)/1.14 var(--display); letter-spacing: -.01em; max-width: 24ch; text-wrap: balance; }
.ch-open-words p + p { font-size: 18px; max-width: 54ch; color: var(--muted); }
.ch-cover { margin: 0; width: 100%; justify-self: end; }
/* Fix 22 (Anthony, 11/17: "full height and width cover story, not with whatever you tried to inlay here"): the book
   cover is the whole painting. It fills the cover edge to edge at its own shape (802 by 1100), with no lavender ground,
   no dashed inner border and no square inlay. The masthead sits over its sky and the label over its foot, in the light
   color, as on the homepage's case cards (.case .art .cover-ln: 7% in from the sides, a soft shadow under the words);
   the only thing laid over the painting besides them is a faint dark-to-clear ground under the label. It stays a
   book: the ink spine on the left and the thin offset shadow. */
.ch-cover .cover.painted { display: block; position: relative; aspect-ratio: 802 / 1100; padding: 0; background: var(--deep); color: #fbf9f4; box-shadow: 6px 6px 0 -1px var(--bg), 7px 7px 0 0 var(--ink); }
.ch-cover .cover.painted::before { display: none; }
.ch-cover .cover.painted .cv-img { position: absolute; inset: 0; width: 100%; height: 100%; max-height: none; aspect-ratio: auto; object-fit: cover; border-radius: 0; }
.ch-cover .cover.painted .cv-mast { position: absolute; left: 7%; right: 7%; top: 5%; z-index: 1; color: #fbf9f4; text-shadow: 0 1px 12px rgba(10, 6, 30, .38); }
.ch-cover .cover.painted .cv-mast b { font-size: clamp(52px, 6.2vw, 92px); }
.ch-cover .cover.painted .cv-line { position: absolute; left: 0; right: 0; bottom: 0; z-index: 1; display: grid; gap: 4px; padding: clamp(44px, 6vw, 84px) 7% 6%; color: #fff; text-shadow: 0 1px 10px rgba(0, 0, 0, .5); background: linear-gradient(to top, rgba(12, 8, 30, .5), rgba(12, 8, 30, 0)); }
.ch-cover .cover.painted .cv-line b { font-size: clamp(30px, 3vw, 44px); }

/* ---------------------------------------------------------------- what we did: one numbered sequence (rows 37, 38)
   A step with a picture is a row of two columns, words and a framed screen, sides alternating down the page; a step
   with none is its title beside its words. The other list's lines open the section, unnumbered. */
.ws-top { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 12px clamp(32px, 6vw, 96px); align-items: end; }
.ws-top h2 { margin: 0; }
.ws-intro { font-size: 18px; line-height: 1.5; max-width: 52ch; }
.ws-fold { list-style: none; margin: clamp(28px, 3.4vw, 44px) 0 0; padding: clamp(18px, 2vw, 24px) 0; border-block: 1px solid color-mix(in srgb, var(--ink) 18%, transparent); display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px clamp(24px, 3.4vw, 48px); }
.ws-fold li { font-size: 15px; line-height: 1.5; color: var(--muted); }
.ws-fold li b { font-weight: 600; color: var(--ink); }
.ws-list { list-style: none; margin: clamp(44px, 6vw, 88px) 0 0; padding: 0; display: grid; gap: clamp(44px, 6.4vw, 96px); }
.ws { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); column-gap: clamp(32px, 6vw, 96px); row-gap: 16px; align-items: start; min-width: 0; }
.ws:not(.has-vis) { padding-top: clamp(20px, 2.2vw, 28px); border-top: 1px solid color-mix(in srgb, var(--ink) 18%, transparent); }
.ws.has-vis { grid-template-areas: ". vis" "head vis" "body vis" ". vis"; grid-template-rows: 1fr auto auto 1fr; align-items: center; }
.ws.has-vis.flip { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); grid-template-areas: "vis ." "vis head" "vis body" "vis ."; }
.ws.has-vis .ws-head { grid-area: head; align-self: end; }
.ws.has-vis .ws-body { grid-area: body; align-self: start; }
.ws-vis { grid-area: vis; margin: 0; min-width: 0; }
/* 12/04 (David, manufacturing on a phone): an empty visual slot in a step without has-vis named an area the grid
   didn't define, so the browser added implicit columns and the heading got a 0 px one, spilling over the text. */
.ws:not(.has-vis):not(.has-stage) > .ws-vis:empty { display: none; }
.ws-head { display: grid; gap: 12px; min-width: 0; }
.ws-no { font: 400 clamp(20px, 1.8vw, 24px)/1 var(--display); color: var(--muted); }
.ws-head h3 { font-size: clamp(26px, 2.7vw, 38px); line-height: 1.06; max-width: 16ch; }
.ws-body { display: grid; gap: 16px; min-width: 0; }
.ws-body p { font-size: 17px; line-height: 1.55; max-width: 46ch; }
/* fix 17 (Anthony, 11/17: "green numbers in full is too much... just do a green arrow?"): a step's one-line result is
   ink, behind a small green arrow; the green rule over it is gone */
.ws-result { position: relative; padding-left: 20px; color: var(--ink); font-weight: 600; font-size: 15px !important; line-height: 1.45 !important; }
.ws-result::before { content: ""; position: absolute; left: 0; top: .42em; width: 10px; height: 9px; background: var(--gain); clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.ws-vis .ch-charts.solo { display: block; }
.ws-vis .ch-chart { background: var(--bg); border-radius: 0; padding: clamp(20px, 3.4vw, 44px); gap: 18px; }
.ws-vis .ch-chart figcaption { min-height: 0; }
.ws-vis .fr-screen > img[style] { will-change: auto; }

/* ---------------------------------------------------------------- what happened: the numbers, with room between them */
.ch-nums { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(36px, 4vw, 56px) clamp(24px, 4vw, 64px); }
.ch-nums.n2, .ch-nums.n4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ch-nums.n1 { grid-template-columns: minmax(0, 1fr); }
.ch-nums li { display: grid; gap: 12px; align-content: start; padding-top: clamp(18px, 2vw, 24px); border-top: 1px solid var(--ink); min-width: 0; }
.ch-n { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; max-width: none; }
.ch-n .num { font-size: clamp(44px, 4.6vw, 68px); }
.ch-from { font: 400 clamp(22px, 2vw, 28px)/1 var(--display); color: var(--muted); letter-spacing: -.02em; }
.ch-to { font: 500 13px/1 var(--body); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.ch-nums li > p:not(.ch-n) { font-size: 16px; line-height: 1.5; max-width: 40ch; }
.ch-note { margin-top: clamp(28px, 3vw, 40px); color: var(--muted); }
/* the performance of a design case: its figures in one row, the source said once under them */
.ch-perf .ch-nums.n4 { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 32px clamp(20px, 2.6vw, 40px); }
.ch-perf .ch-nums.n5 { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 32px clamp(18px, 2.2vw, 32px); }
.ch-perf .ch-n .num { font-size: clamp(34px, 3.3vw, 48px); overflow-wrap: anywhere; }
.ch-perf .ch-nums li > p:not(.ch-n) { font-size: 15px; }
.ch-perf .ch-note { font-size: 14px; max-width: 72ch; }

/* ---------------------------------------------------------------- where it stands; a lone stat sits in the story (row 39) */
.ch-out-grid { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); gap: 20px clamp(32px, 6vw, 96px); align-items: start; }
.ch-out-grid h2 { margin: 0; }
.ch-out-body { min-width: 0; }
.ch-out.has-stat .ch-out-body { display: grid; grid-template-columns: minmax(150px, auto) minmax(0, 1fr); gap: clamp(24px, 3vw, 44px); align-items: start; }
.ch-out-words { display: grid; gap: 18px; min-width: 0; }
.ch-out-words p { font-size: 18px; line-height: 1.55; max-width: 54ch; }
.ch-stat { display: grid; gap: 8px; align-content: start; max-width: 230px; padding-right: clamp(20px, 2.6vw, 40px); border-right: 1px solid var(--line); }
.ch-stat .num { font-size: clamp(56px, 5.6vw, 84px); }
.ch-stat > span { font: 600 15px/1.4 var(--body); }
.ch-stat > small { font-size: 12.5px; line-height: 1.45; color: var(--muted); }

/* ---------------------------------------------------------------- the story: the numbers drawn to scale */
.ch-story-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px 48px; align-items: end; margin-bottom: clamp(28px, 3.4vw, 48px); }
.ch-story-head h2 { margin: 0; }
.ch-story-head p { color: var(--muted); font-size: 15px; justify-self: end; max-width: 46ch; }
.ch-charts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(20px, 3vw, 40px); }
.ch-charts.n2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ch-charts.n1 { grid-template-columns: minmax(0, 1fr); max-width: 760px; }
.ch-chart { margin: 0; padding: clamp(20px, 2.4vw, 28px); background: var(--surface); border-radius: var(--r); display: grid; gap: 14px; align-content: start; min-width: 0; }
.ch-chart figcaption { display: grid; gap: 4px; min-height: 3.2em; }
.ch-chart figcaption b { font-weight: 600; font-size: 15px; line-height: 1.35; }
.ch-chart figcaption span { font-size: 13px; color: var(--muted); }
.ch-bar { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; align-items: center; gap: 12px; }
.ch-bar span { font: 600 11px/1 var(--body); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.ch-bar i { display: block; height: 14px; width: var(--w); border-radius: 2px; background: color-mix(in srgb, var(--ink) 22%, transparent); transform-origin: 0 50%; }
.ch-bar.after i { background: var(--ink); height: 22px; } /* fix 17: a block of green is too much; the after bar is ink, the thin sparks and the arrows carry the green */
.ch-bar b { font: 400 clamp(20px, 1.8vw, 26px)/1 var(--display); letter-spacing: -.02em; min-width: 3ch; text-align: right; }
.ch-bar.before b { color: var(--muted); }
@media (prefers-reduced-motion: no-preference) {
  .ch-charts:not(.drawn) .ch-bar i { transform: scaleX(0); }
  .ch-bar i { transition: transform 1s var(--ease); }
  .ch-bar.after i { transition-delay: .35s; }
}
.ch-part { margin: clamp(28px, 3vw, 40px) 0 0; display: grid; gap: 10px; }
.ch-part img { width: 100%; height: auto; border-radius: var(--r); display: block; background: var(--surface); }
.ch-part figcaption { font-size: 14px; color: var(--muted); }

/* ---------------------------------------------------------------- the index: the hub's table, and More cases on a case
   Rows 27 to 30. One filter line (three dropdowns and a search), five rows a page, and one grid for every row:
   number, visual, industry and type over the headline, the growth with its from and to, the link. The headline and
   the growth figure share a baseline; at 1440 a headline sits on one line where it fits. */
.hub-find .hf-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px 48px; align-items: end; margin-bottom: clamp(24px, 3vw, 36px); }
.hub-find .hf-head h2 { margin: 0; }
.hub-find .hf-head p { color: var(--muted); max-width: 52ch; }
.hf-panel { border: 1px solid var(--ink); border-radius: var(--r); background: var(--bg); overflow: hidden; }
.hf-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.hf-filters { --hf-edge: color-mix(in srgb, var(--ink) 26%, transparent); display: grid; grid-template-columns: auto auto auto minmax(180px, 1fr); gap: 10px; align-items: center; margin: 0; padding: 14px clamp(14px, 2vw, 24px); background: var(--surface); border-bottom: 1px solid var(--ink); }
.hf-sel, .hf-search { position: relative; display: flex; align-items: center; min-width: 0; height: 44px; border: 1px solid var(--hf-edge); border-radius: 999px; background: var(--bg); transition: border-color .2s var(--ease); }
.hf-sel:hover, .hf-search:hover, .hf-sel:focus-within, .hf-search:focus-within { border-color: var(--ink); }
.hf-sel:focus-within, .hf-search:focus-within { outline: 2px solid var(--orb); outline-offset: 2px; }
.hf-sel > span { padding-left: 16px; font: 600 11px/1 var(--body); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); pointer-events: none; }
.hf-sel select { appearance: none; -webkit-appearance: none; min-width: 0; height: 100%; margin: 0; padding: 0 36px 0 8px; border: 0; border-radius: 999px; background: transparent; color: var(--ink); font: 600 14px/1 var(--body); cursor: pointer; outline: none; text-overflow: ellipsis; }
.hf-sel::after { content: ""; position: absolute; right: 16px; top: 50%; width: 7px; height: 7px; border-right: 1.5px solid var(--ink); border-bottom: 1.5px solid var(--ink); transform: translateY(-70%) rotate(45deg); pointer-events: none; }
.hf-search::before { content: ""; position: absolute; left: 16px; top: 50%; width: 11px; height: 11px; border: 1.5px solid var(--muted); border-radius: 50%; transform: translateY(-60%); pointer-events: none; }
.hf-search::after { content: ""; position: absolute; left: 27px; top: 50%; width: 6px; height: 1.5px; background: var(--muted); transform: translateY(4px) rotate(45deg); transform-origin: 0 50%; pointer-events: none; }
.hf-search input { width: 100%; min-width: 0; height: 100%; margin: 0; padding: 0 16px 0 42px; border: 0; border-radius: 999px; background: transparent; color: var(--ink); font: 500 16px/1 var(--body); outline: none; appearance: none; -webkit-appearance: none; }
.hf-search input::placeholder { color: var(--muted); opacity: 1; }
.hf-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px clamp(14px, 2vw, 24px) 10px; border-bottom: 1px solid var(--line); }
.hf-count { font-size: 14px; color: var(--muted); max-width: none; }
.hf-count b { color: var(--ink); font-weight: 600; }
.hf-table { list-style: none; margin: 0; padding: 0; }
.hf-row[hidden] { display: none; }
.hf-row a { display: grid; grid-template-columns: 28px 96px minmax(0, 1fr) minmax(190px, 232px) auto; grid-template-areas: "no vis ind what go" "no vis title fig go" "no vis title line go"; grid-template-rows: auto auto auto; column-gap: clamp(12px, 1.5vw, 22px); row-gap: 5px; align-items: baseline; padding: clamp(16px, 1.7vw, 22px) clamp(14px, 2vw, 24px); color: inherit; text-decoration: none; border-bottom: 1px solid var(--line); transition: background .2s var(--ease); }
.hf-row:last-child a, .hf-row.last a { border-bottom: 0; }
.hf-row a:hover { background: var(--surface); }
.hf-row a:focus-visible { outline: 2px solid var(--orb); outline-offset: -2px; }
.hf-no { grid-area: no; align-self: center; font: 400 17px/1 var(--display); color: var(--muted); }
.hf-vis { grid-area: vis; align-self: center; display: block; position: relative; width: 100%; aspect-ratio: 4 / 3; border-radius: var(--r); overflow: hidden; background: var(--surface); }
.hf-vis img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 62%; }
.hf-vis.screen { display: grid; grid-template-rows: 9px minmax(0, 1fr); border: 1px solid color-mix(in srgb, var(--ink) 32%, transparent); border-radius: 4px; background: #fff; }
.hf-vis.screen i { display: block; position: relative; border-bottom: 1px solid color-mix(in srgb, var(--ink) 32%, transparent); }
.hf-vis.screen i::before { content: ""; position: absolute; left: 5px; top: 3px; width: 3px; height: 3px; border-radius: 50%; background: color-mix(in srgb, var(--ink) 38%, transparent); box-shadow: 5px 0 0 color-mix(in srgb, var(--ink) 38%, transparent), 10px 0 0 color-mix(in srgb, var(--ink) 38%, transparent); }
.hf-vis.screen img { object-position: 50% 0; }
.hf-ind { grid-area: ind; font: 600 11px/1.3 var(--body); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.hf-ind small { font: inherit; }
.hf-ind small::before { content: " \00b7  "; white-space: pre; }
.hf-title { grid-area: title; align-self: baseline; font: 400 clamp(18px, 1.36vw, 19.5px)/1.22 var(--display); letter-spacing: -.01em; text-wrap: balance; }
.hf-lead { display: contents; }
.hf-what { grid-area: what; font: 600 11px/1.3 var(--body); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.hf-fig { grid-area: fig; align-self: baseline; display: flex; align-items: center; gap: 12px; min-width: 0; }
.hf-num { font: 400 clamp(28px, 2.4vw, 34px)/1 var(--display); letter-spacing: -.03em; display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.hf-num.up::before { content: ""; width: 10px; height: 9px; flex: none; background: var(--gain); clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.hf-line { grid-area: line; align-self: start; font-size: 13px; line-height: 1.4; color: var(--muted); }
.hf-row.no-num .hf-line { grid-row: fig / line; grid-column: what; align-self: baseline; font-size: 14px; color: var(--ink); }
.hf-spark { display: grid; gap: 3px; flex: 1; max-width: 84px; min-width: 40px; }
.hf-spark i { display: block; height: 4px; width: var(--w); border-radius: 2px; background: color-mix(in srgb, var(--ink) 22%, transparent); }
.hf-spark i + i { background: var(--gain); }
.hf-go { grid-area: go; align-self: center; font: 600 11px/1 var(--body); letter-spacing: .1em; text-transform: uppercase; text-decoration: underline; text-underline-offset: 4px; white-space: nowrap; }
.hf-none { padding: 26px clamp(14px, 2vw, 24px); color: var(--muted); max-width: none; }
.hf-clear { min-height: 44px; background: none; border: 0; padding: 0 2px; font: inherit; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.hf-pages { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 6px; padding: 12px clamp(14px, 2vw, 24px); border-top: 1px solid var(--ink); background: var(--bg); }
.hf-pages[hidden] { display: none; }
.hf-pg { min-width: 44px; height: 44px; padding: 0 6px; border: 1px solid color-mix(in srgb, var(--ink) 26%, transparent); border-radius: var(--r); background: var(--bg); color: var(--ink); font: 600 14px/1 var(--body); cursor: pointer; transition: border-color .2s var(--ease), background .2s var(--ease), color .2s var(--ease); }
.hf-pg:hover:not(:disabled) { border-color: var(--ink); }
.hf-pg[aria-current="page"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.hf-pg.step { padding: 0 16px; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; }
.hf-pg:disabled { opacity: .38; cursor: default; }
.hf-pg:focus-visible, .hf-clear:focus-visible { outline: 2px solid var(--orb); outline-offset: 2px; }
.hf-pages .hf-gap { flex: 1; }
.hf-table.compact { border-top: 1px solid var(--ink); }
.hf-table.compact .hf-row a { grid-template-columns: 96px minmax(0, 1fr) minmax(190px, 232px) auto; grid-template-areas: "vis ind what go" "vis title fig go" "vis title line go"; padding-inline: 0; }
.hf-table.compact .hf-row a:hover { background: none; }
.hf-table.compact .hf-row a:hover .hf-title { text-decoration: underline; text-underline-offset: .14em; text-decoration-thickness: 1px; }
.ch-more .hf-table + .ch-close, .ch-more .hf-table + .acts { margin-top: clamp(32px, 4vw, 48px); }
.ch-close { display: grid; gap: 10px; }
.ch-close h3 { font-size: clamp(26px, 2.6vw, 34px); }
.ch-close + .acts { margin-top: 18px; }

/* ---------------------------------------------------------------- narrower screens, tablets, phones (cases and the hub) */
@media (max-width: 1180px) {
  .hf-go { display: none; }
  .hf-row a { grid-template-columns: 26px 88px minmax(0, 1fr) minmax(170px, 220px); grid-template-areas: "no vis ind what" "no vis title fig" "no vis title line"; }
  .hf-table.compact .hf-row a { grid-template-columns: 88px minmax(0, 1fr) minmax(170px, 220px); grid-template-areas: "vis ind what" "vis title fig" "vis title line"; }
  .ch-perf .ch-nums.n5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  /* row 35: on a phone the order is the headline, the picture, then the number and the facts */
  .case-hero .ch-grid { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .ch-words { display: contents; }
  .ch-art { order: 2; margin-top: clamp(20px, 5vw, 28px); }
  .case-art { aspect-ratio: 16 / 11; }
  .ch-lead { margin-top: clamp(22px, 5vw, 28px); padding-top: 0; border-top: 0; }
  .ch-facts, .ch-facts.n3 { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 18px; }
  .ch-facts.n3 > div:last-child { grid-column: 1 / -1; } /* three facts on two columns: the long one takes the row, never one alone */
  .ch-open-grid { grid-template-columns: minmax(0, 1fr); align-items: start; }
  .ch-cover { justify-self: stretch; max-width: none; } /* fix 22: under the headline at the full column width */
  .ws-top { grid-template-columns: minmax(0, 1fr); align-items: start; }
  .ws-fold { grid-template-columns: minmax(0, 1fr); }
  .ws, .ws.has-vis, .ws.has-vis.flip { grid-template-columns: minmax(0, 1fr); grid-template-areas: "head" "vis" "body"; grid-template-rows: auto; align-items: start; row-gap: 18px; }
  .ws:not(.has-vis) { grid-template-areas: none; }
  .ws.has-vis .ws-head, .ws.has-vis .ws-body { align-self: start; }
  .ch-nums, .ch-nums.n2, .ch-nums.n4 { grid-template-columns: minmax(0, 1fr); }
  .ch-perf .ch-nums.n4, .ch-perf .ch-nums.n2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ch-perf .ch-nums.n3, .ch-perf .ch-nums.n5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ch-out-grid { grid-template-columns: minmax(0, 1fr); }
  .ch-charts, .ch-charts.n2 { grid-template-columns: minmax(0, 1fr); }
  .ch-story-head, .hub-find .hf-head { grid-template-columns: minmax(0, 1fr); }
  .ch-story-head p { justify-self: start; }
  .hf-filters { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hf-search { grid-column: 1 / -1; grid-row: 1; }
  .hf-sel select { flex: 1; }
}
@media (max-width: 600px) {
  .case-hero h1 { font-size: clamp(30px, 8.4vw, 38px); }
  .ch-show-fig.duo { grid-template-columns: minmax(0, 1fr); justify-items: center; }
  .ch-show-fig.duo .frame.browser { width: 100%; }
  .ch-show-fig.duo .frame.phone { width: 58%; }
  .ch-out.has-stat .ch-out-body { grid-template-columns: minmax(0, 1fr); }
  .ch-stat { max-width: none; padding: 0 0 18px; border-right: 0; border-bottom: 1px solid var(--line); }
  .ch-perf .ch-nums.n2, .ch-perf .ch-nums.n3, .ch-perf .ch-nums.n4, .ch-perf .ch-nums.n5 { grid-template-columns: minmax(0, 1fr); }
  .ch-bar { grid-template-columns: 46px minmax(0, 1fr) auto; }
  .hf-filters { grid-template-columns: minmax(0, 1fr); }
  .hf-search { grid-row: auto; }
  .hf-sel select { flex: 1; }
  .hf-no { display: none; }
  .hf-row a, .hf-table.compact .hf-row a { grid-template-columns: 72px minmax(0, 1fr); grid-template-areas: "vis ind" "vis title" "fig fig" "what what" "line line"; grid-template-rows: auto; column-gap: 14px; row-gap: 6px; }
  .hf-vis { align-self: start; }
  .hf-title { font-size: 19px; }
  .hf-fig { margin-top: 8px; }
  .hf-row.no-num .hf-what { margin-top: 8px; }
  .hf-row.no-num .hf-line { grid-row: auto; grid-column: 1 / -1; grid-area: line; }
  .hf-pages { justify-content: center; flex-wrap: nowrap; padding-inline: 10px; }
  .hf-pg.step { padding: 0 10px; letter-spacing: .06em; }
  .hf-pages .hf-gap { display: none; }
  /* round 6, the phone lane: a field set under 16 px makes iOS zoom the whole page when it takes focus, and the
     sentences under a figure hold the identity's 14 px floor (qc-phone.mjs part F) */
  .hf-sel select { font-size: 16px; }
  .hf-line, .ch-chart figcaption span { font-size: 14px; }
}

/* ---- T4 [895, 892], the case studies (archive: scripts/templates-t1-t4.mjs). The hub's list (.hf-table.hf-cards): each case a
   card that leads with its own cover art (Wolf with its showreel's first frame), clean: the industry tag on its corner,
   the number under it in the case's own words. The filter, the count and the pages work as before (cases.js). The case
   page's hero leads with the same cover art, alone (.case-art.cover-art); the section that carried it lets its words
   take the row (.solo). */
.hf-table.hf-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(14px, 1.6vw, 22px); padding: clamp(14px, 1.6vw, 22px); }
.hf-cards > .hf-row { min-width: 0; }
.hf-cards > .hf-row > a { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-areas: "vis" "title" "lead"; grid-template-rows: auto auto 1fr; gap: 0; height: 100%; padding: 0; border: 1px solid var(--line); border-bottom: 1px solid var(--line); border-radius: var(--r); background: color-mix(in srgb, var(--bg) 55%, #fff); overflow: hidden; }
:root[data-theme="dark"] .hf-cards > .hf-row > a { background: var(--surface); }
.hf-cards > .hf-row > a:hover { background: color-mix(in srgb, var(--bg) 55%, #fff); border-color: var(--ink); }
:root[data-theme="dark"] .hf-cards > .hf-row > a:hover { background: var(--surface); }
.hf-cards .hf-no, .hf-cards .hf-go, .hf-cards .hf-spark { display: none; }
.hf-cards .hf-vis.art { grid-area: vis; align-self: stretch; aspect-ratio: 4 / 4.4; border-radius: 0; background: var(--deep); }
.hf-cards .hf-vis.art img { object-position: 50% 50%; transition: transform .5s var(--ease); }
.hf-cards a:hover .hf-vis.art img { transform: scale(1.03); }
.hf-cards .hf-ind { position: absolute; left: 12px; top: 12px; z-index: 1; display: inline-flex; align-items: center; gap: 0; max-width: calc(100% - 24px); padding: 8px 10px 8px 24px; border-radius: 999px; background: rgba(255, 253, 248, .94); color: #121212; font: 600 11px/1 var(--body); letter-spacing: .1em; }
.hf-cards .hf-ind::before { content: ""; position: absolute; left: 10px; top: 50%; width: 7px; height: 7px; margin-top: -3.5px; border-radius: 50%; background: #5b2fe6; }
.hf-reel { position: absolute; left: 12px; bottom: 12px; display: inline-flex; align-items: center; gap: 10px; padding: 6px 14px 6px 6px; border-radius: 999px; background: #f8f6f1; color: #121212; font: 600 12px/1 var(--body); letter-spacing: .1em; text-transform: uppercase; }
.hf-reel b { position: relative; width: 26px; height: 26px; border-radius: 50%; background: #121212; }
.hf-reel b::after { content: ""; position: absolute; left: 10px; top: 8px; border-left: 8px solid #f8f6f1; border-top: 5px solid transparent; border-bottom: 5px solid transparent; }
.hf-cards .hf-title { grid-area: title; padding: 16px 18px 0; font-size: clamp(21px, 1.7vw, 25px); line-height: 1.14; }
.hf-cards .hf-lead { grid-area: lead; display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "fig what" "fig line"; align-content: start; align-items: center; gap: 3px 14px; margin: 14px 18px 18px; padding-top: 12px; border-top: 1px solid var(--line); }
.hf-cards .hf-what { grid-area: what; align-self: end; font: 600 12.5px/1.3 var(--body); letter-spacing: 0; text-transform: none; color: var(--ink); }
.hf-cards .hf-fig { grid-area: fig; }
.hf-cards .hf-num { font-size: 34px; }
.hf-cards .hf-line { grid-area: line; font-size: 12.5px; line-height: 1.35; }
.hf-cards .hf-row.no-num .hf-lead { grid-template-columns: minmax(0, 1fr); grid-template-areas: "what" "line"; gap: 6px; }
.hf-cards .hf-row.no-num .hf-what { font: 600 11px/1 var(--body); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.hf-cards .hf-row.no-num .hf-line { grid-row: auto; grid-column: auto; font-size: 14.5px; line-height: 1.45; color: var(--ink); }
@media (max-width: 1000px) { .hf-table.hf-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) {
  .hf-table.hf-cards { grid-template-columns: minmax(0, 1fr); }
  .hf-cards > .hf-row > a { grid-template-columns: minmax(0, 1fr); grid-template-areas: "vis" "title" "lead"; column-gap: 0; row-gap: 0; }
  .hf-cards .hf-vis.art { aspect-ratio: 4 / 3.6; }
  .hf-cards .hf-title { font-size: 22px; }
}
/* the case hero: the cover art alone, with the stage's corner marks */
.case-art.cover-art { background: var(--deep); }
.case-art.cover-art::before, .case-art.cover-art::after { content: ""; position: absolute; z-index: 2; width: 18px; height: 18px; border: 1px solid rgba(233, 228, 255, .5); pointer-events: none; }
.case-art.cover-art::before { top: 12px; left: 12px; border-right: 0; border-bottom: 0; }
.case-art.cover-art::after { bottom: 12px; right: 12px; border-left: 0; border-top: 0; }
@media (max-width: 900px) { .case-art.cover-art { aspect-ratio: 4 / 4.2; } }

/* a problem card's picture: a house-art scene above the words (case QC 12/03: every problem gets a visual) */
.card > .case-prob { margin: 0; aspect-ratio: 3 / 2; overflow: hidden; border-radius: var(--r, 2px); background: var(--surface); }
.card > .case-prob img { display: block; width: 100%; height: 100%; object-fit: cover; }
