/* Case studies and side projects. These pages sit on css/site.css, so they
   share its tokens, type, tiles, windows, phones and reveals; this file adds
   only what a long page needs: a hero, chapters, a few kinds of figure, and
   the way a page opens and closes.
   A page sets its own colours on <html>:
     --pc   the page's deep colour (a case study's section colour, an app's)
     --pfg  text on it
     --acc  one bright accent */

.pg body { background: var(--pc); color: var(--pfg); }
.pg { --pfg: #ecebe6; --hd-bg: var(--pc); --hd-fg: var(--pfg); background: var(--pc); }
.pg ::selection { background: var(--pfg); color: var(--pc); }
.pg-main { position: relative; overflow: clip; }
.pg .dim { color: color-mix(in srgb, var(--pfg) 58%, transparent); }

/* header: the same bar as the portfolio, with a way back */
.hd-back { display: inline-flex; align-items: center; gap: 10px; white-space: nowrap; }
.hd-back .ic { width: 14px; height: 14px; transform: rotate(180deg); transition: transform .5s var(--ease); }
.hd-back:hover .ic { transform: rotate(180deg) translateX(4px); }

/* ---------- hero ---------- */
.ph { position: relative; padding: calc(var(--hd-h) + 12vh) var(--gut) 0; }
.ph-meta { display: flex; flex-wrap: wrap; gap: 4px 28px; padding-bottom: 14px; border-bottom: 1px solid color-mix(in srgb, var(--pfg) 18%, transparent); font-size: 13px; color: color-mix(in srgb, var(--pfg) 60%, transparent); font-variant-numeric: tabular-nums; }
.ph-meta span:first-child { color: var(--pfg); }
.ph-title { margin-top: 6vh; font-size: clamp(64px, 12.5vw, 240px); font-weight: 300; line-height: .88; letter-spacing: -.055em; }
.ph-title .ln { display: block; overflow: clip; padding: .1em .08em .24em; margin: -.1em -.08em -.24em; }
.ph-title .ln > span { display: inline-block; white-space: nowrap; }
/* the title is one line (js/page.js shrinks it if it would overflow). The lede
   fills the rest of the row: beside a short title (FitFare, Evolve), on the
   title's baseline; under a long one, across the full width */
.ph-head { display: flex; flex-wrap: wrap; align-items: last baseline; column-gap: calc(var(--gut) * 1.5); row-gap: 5vh; margin-top: 6vh; }
.ph-head .ph-title { flex: none; margin-top: 0; }
.ph-head .ph-lede { flex: 1 1 18em; max-width: none; margin-top: 0; text-wrap: pretty; }
.ph-lede { max-width: 30ch; margin-top: 5vh; font-size: clamp(22px, 2.2vw, 36px); font-weight: 300; line-height: 1.2; letter-spacing: -.02em; color: color-mix(in srgb, var(--pfg) 62%, transparent); text-wrap: balance; }
.ph-lede b { font-weight: 300; color: var(--pfg); }
.ph-shot { margin-top: 9vh; }
.ph-facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0 var(--gut); margin-top: 7vh; border-top: 1px solid color-mix(in srgb, var(--pfg) 24%, transparent); }
.ph-facts div { padding: 16px 0 18px; border-bottom: 1px solid color-mix(in srgb, var(--pfg) 12%, transparent); }
.ph-facts dt { font-size: 12.5px; color: color-mix(in srgb, var(--pfg) 55%, transparent); }
.ph-facts dd { margin-top: 6px; font-size: 15px; line-height: 1.45; }

/* ---------- chapters ---------- */
.ch { position: relative; display: grid; grid-template-columns: repeat(24, minmax(0, 1fr)); column-gap: var(--gut); padding: 18vh var(--gut) 0; }
.ch > * { grid-column: 1 / -1; }
.ch-n { display: flex; justify-content: space-between; gap: 24px; padding-top: 14px; border-top: 1px solid color-mix(in srgb, var(--pfg) 18%, transparent); font-size: 13px; color: color-mix(in srgb, var(--pfg) 58%, transparent); font-variant-numeric: tabular-nums; }
.ch-title { grid-column: 1 / 17; margin-top: 5vh; font-size: clamp(38px, 5vw, 92px); font-weight: 300; line-height: .98; letter-spacing: -.04em; text-wrap: balance; }
/* A quiet rule sits halfway between chapters; labels remain for the contents menu. */
.pg[data-kind="case"] .ch::before { content: ''; position: absolute; top: 9vh; left: var(--gut); right: var(--gut); height: 1px; background: color-mix(in srgb, var(--pfg) 18%, transparent); pointer-events: none; }
.pg[data-kind="case"] .ch > .ch-n { display: none; }
.pg[data-kind="case"] .ch > .ch-title { grid-column: 1 / -1; margin-top: 0; text-wrap: wrap; }
/* a short heading names the chapter; the one sentence under it says what it found */
.ch-sub { grid-column: 1 / 13; max-width: 30ch; margin-top: 3vh; font-size: clamp(20px, 1.75vw, 30px); font-weight: 300; line-height: 1.25; letter-spacing: -.015em; color: color-mix(in srgb, var(--pfg) 62%, transparent); text-wrap: pretty; }
/* Case-study copy fills the space its layout provides. */
.pg[data-kind="case"] .ch .ch-sub { max-width: none; text-wrap: wrap; }
.pg[data-kind="case"] .ch > .ch-sub, .pg[data-kind="case"] .ch > .ch-intro { grid-column: 1 / -1; }
.ch-intro { grid-column: 13 / -1; margin-top: 3vh; }
.ch-title + .ch-intro { margin-top: 5vh; }
.ch-intro p, .prose p { max-width: 54ch; font-size: 17px; line-height: 1.65; color: color-mix(in srgb, var(--pfg) 66%, transparent); text-wrap: pretty; }
.pg[data-kind="case"] .ch .ch-intro p, .pg[data-kind="case"] .ch .prose p, .pg[data-kind="case"] .ch .sec p { max-width: none; text-wrap: wrap; }
.ch-intro p + p, .prose p + p { margin-top: 1.1em; }
.ch-intro b, .prose b { font-weight: 400; color: var(--pfg); }
.say { grid-column: 1 / 20; margin-top: 12vh; font-size: clamp(30px, 3.6vw, 64px); font-weight: 300; line-height: 1.12; letter-spacing: -.035em; color: color-mix(in srgb, var(--pfg) 46%, transparent); text-wrap: balance; }
.pg[data-kind="case"] .ch > .say { grid-column: 1 / -1; text-wrap: wrap; }
.pg[data-kind="case"] .ch > .ch-n + .say { margin-top: 0; }
.say mark { color: var(--pfg); }
.blk { margin-top: 9vh; }
.cap { margin-top: 14px; font-size: 13px; line-height: 1.5; color: color-mix(in srgb, var(--pfg) 58%, transparent); }
.cap b { font-weight: 500; color: var(--pfg); margin-right: 8px; }

/* three or four columns of short pieces, each under a hairline */
.cols { display: grid; grid-template-columns: repeat(var(--n, 3), minmax(0, 1fr)); gap: 6vh var(--gut); }
.col { padding-top: 16px; border-top: 1px solid color-mix(in srgb, var(--pfg) 24%, transparent); }
.col-k { font-size: 12.5px; color: color-mix(in srgb, var(--pfg) 55%, transparent); font-variant-numeric: tabular-nums; }
.col h3 { margin-top: 18px; font-size: clamp(22px, 1.9vw, 30px); font-weight: 300; line-height: 1.1; letter-spacing: -.025em; }
.col p { margin-top: 12px; font-size: 15px; line-height: 1.6; color: color-mix(in srgb, var(--pfg) 62%, transparent); text-wrap: pretty; }

/* a small picture above a column: a white panel on the page's tile, sized in cqw
   so it reads the same at any column width */
.col-v { container-type: inline-size; display: grid; place-items: center; aspect-ratio: 4 / 3; margin-bottom: 22px; padding: 0 9%; border-radius: clamp(12px, 1.2vw, 20px); background: var(--tile-bg); }
.cols.has-v .col { padding-top: 0; border-top: 0; }
.vp { position: relative; width: 100%; padding: 4.5cqw; border-radius: 3cqw; background: #fff; color: #333; font-size: 4.3cqw; line-height: 1.3; box-shadow: 0 3cqw 8cqw -3cqw rgb(var(--sh) / .7); }
.vp > * + * { margin-top: 2.6cqw; }
.vp-pill { display: inline-flex; align-items: center; gap: 1.4cqw; padding: 1.1cqw 2.6cqw; border-radius: 99px; font-size: 3.8cqw; font-style: normal; font-weight: 500; white-space: nowrap; }
.vp-pill::before { content: ''; width: 1.6cqw; aspect-ratio: 1; border-radius: 50%; background: currentColor; }
.vp-pill s { text-decoration: none; font-weight: 400; opacity: .72; }
.vp-pills { display: flex; flex-wrap: wrap; gap: 2.2cqw; }
.vp-pills.is-col { flex-direction: column; align-items: flex-start; }
.vp-r { display: flex; align-items: center; gap: 2cqw; min-width: 0; }
.vp-r > span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vp-ic { flex: none; display: grid; place-items: center; width: 7cqw; aspect-ratio: 1; border-radius: 1.6cqw; font-size: 2.1cqw; font-style: normal; font-weight: 700; color: #3d5bd9; background: #eaf0ff; }
.vp-tag { flex: none; padding: .8cqw 2cqw; border-radius: 1.2cqw; font-size: 3.2cqw; font-weight: 600; text-decoration: none; }
.vp-n { display: inline-grid; place-items: center; min-width: 4.6cqw; margin-left: 1.2cqw; padding: 0 1.2cqw; border-radius: 99px; font-size: 2.8cqw; font-style: normal; font-weight: 600; color: #fff; background: #e8913f; }
.vp-tabs { display: flex; gap: 4cqw; padding-bottom: 2.4cqw; border-bottom: 1px solid #e3e6ec; color: #717789; }
.vp-tabs b { position: relative; font-weight: 600; color: #333; }
.vp-tabs b::after { content: ''; position: absolute; left: 0; right: 0; bottom: -2.6cqw; height: .6cqw; border-radius: 1cqw; background: #0084ef; }
.vp-h { font-size: 2.9cqw; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: #8a90a0; }
.vp-li { display: flex; align-items: center; gap: 2.2cqw; padding: 1.2cqw 2cqw; margin-left: -2cqw; margin-right: -2cqw; border-radius: 1.6cqw; }
.vp > .vp-li { margin-top: .6cqw; }
.vp > .vp-h:not(:first-child) { margin-top: 3.6cqw; }
.vp-li.is-on { background: #eef4ff; color: #1d5fc4; font-weight: 500; }
.vp-li svg { flex: none; width: 4cqw; height: 4cqw; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.vp-chips { display: flex; flex-wrap: wrap; gap: 1.6cqw; }
.vp-chips > * { padding: .9cqw 2.2cqw; border-radius: 1.2cqw; font-size: 3.2cqw; font-weight: 500; color: #41424a; background: #f2f5f8; }
.vp-chips s { color: #a3a8b5; background: none; box-shadow: inset 0 0 0 1px #e3e6ec; }
.vp-chips b { color: #0b66c3; background: #e8f1fd; box-shadow: inset 0 0 0 1px #9cc6f3; }
.vp-split { display: grid; grid-template-columns: 38fr 62fr; gap: 3.5cqw; align-items: start; }
.vp-split > * + * { margin-top: 0; }
.vp-lines { display: grid; gap: 2cqw; padding-top: 1cqw; }
.vp-lines i { height: 5.4cqw; border-radius: 1.2cqw; background: #f0f2f6; }
.vp-lines i.is-on { background: #fdeee2; box-shadow: inset .7cqw 0 0 #e8913f; }
.vp-panel { padding-left: 3.5cqw; border-left: 1px solid #e3e6ec; }
.vp-panel > * + * { margin-top: 1.8cqw; }
.vp-ch { display: flex; align-items: center; gap: 2cqw; font-size: 3.4cqw; }
.vp-av { flex: none; display: grid; place-items: center; width: 6cqw; aspect-ratio: 1; border-radius: 50%; font-size: 2.2cqw; font-style: normal; font-weight: 650; color: #2f6a43; background: #d9efe0; }
.vp-ch b { margin-left: auto; color: #2f7a46; }
.vp-ch.is-you { font-weight: 600; }
.vp-ch.is-you .vp-av { color: #8a4a12; background: #f9cf9e; box-shadow: 0 0 0 .5cqw #fff, 0 0 0 .9cqw #e8913f; }
.vp-ch.is-next { opacity: .55; } .vp-ch.is-next .vp-av { color: #5a6378; background: #e6eaf2; }
.vp-btn { display: block; padding: 1.4cqw 0; border-radius: 1.4cqw; font-size: 3.2cqw; font-weight: 600; text-align: center; color: #fff; background: #0084ef; }
.vp-ck { flex: none; display: grid; place-items: center; width: 3.8cqw; aspect-ratio: 1; border-radius: .9cqw; box-shadow: inset 0 0 0 1.5px #c5cad4; font-size: 2.8cqw; font-style: normal; color: #fff; }
.vp-ck.is-on { background: #0084ef; box-shadow: none; }
.vp-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 1.2cqw 3.4cqw; padding: 2.4cqw 3.4cqw; border-radius: 2cqw; font-size: 3.2cqw; color: rgba(255, 255, 255, .78); background: #1f2533; }
.vp-bar b { width: 100%; font-weight: 600; color: #fff; }
.vp-sk { flex: 1; height: 2.6cqw; border-radius: 1cqw; background: #eceef2; }
.vp-rows > * + * { margin-top: 2cqw; }
.vp-foot { display: flex; align-items: center; gap: 2.6cqw; padding-top: 2.6cqw; border-top: 1px solid #e3e6ec; font-size: 3.4cqw; color: #41424a; }
.vp-foot s { color: #c0383c; }
.vp-foot b { font-weight: 600; color: #2f7a46; }

/* findings → what got built: one row each, the list dims around the row you're on */
.finds { border-top: 1px solid color-mix(in srgb, var(--pfg) 26%, transparent); }
.find { display: grid; grid-template-columns: 56px minmax(0, 1fr) 40px minmax(0, 1fr); gap: var(--gut); align-items: baseline; padding: 30px 0; border-bottom: 1px solid color-mix(in srgb, var(--pfg) 12%, transparent); transition: opacity .5s var(--ease); }
.finds:hover .find { opacity: .4; }
.finds .find:hover { opacity: 1; }
.find-n { font-size: 13px; color: color-mix(in srgb, var(--pfg) 50%, transparent); font-variant-numeric: tabular-nums; }
.find-a { font-size: clamp(17px, 1.35vw, 21px); line-height: 1.45; color: color-mix(in srgb, var(--pfg) 62%, transparent); }
.find-to { align-self: center; height: 1px; background: color-mix(in srgb, var(--pfg) 40%, transparent); position: relative; }
.find-to::after { content: ''; position: absolute; right: -1px; top: -3.5px; border: 4px solid transparent; border-left: 6px solid color-mix(in srgb, var(--pfg) 40%, transparent); border-right: 0; }
.find-b { font-size: clamp(17px, 1.35vw, 21px); line-height: 1.45; }
.find-b i { display: block; margin-bottom: 6px; font-size: 12px; color: var(--acc); }
.find-a i { display: block; margin-bottom: 6px; font-size: 12px; color: color-mix(in srgb, var(--pfg) 45%, transparent); }
.find-b s { text-decoration: none; font-size: .78em; color: color-mix(in srgb, var(--pfg) 50%, transparent); white-space: nowrap; }

/* a statement set large (.say), with a small label above it */
.say-k { display: block; margin-bottom: 2.6vh; font-size: 13px; letter-spacing: 0; color: var(--acc); }

/* a user flow, one step per column across the page (down it on smaller
   screens). Each step: who, what they do, where it happens, and either the
   pain it causes (.jr-p, numbered to the list below it) or what was built (.jr-f) */
.jr-wrap { padding: 0; }
.jr-h { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 24px; margin-bottom: 30px; font-size: 13px; color: color-mix(in srgb, var(--pfg) 58%, transparent); }
.jr-h b { font-weight: 500; color: var(--pfg); }
.jr { display: grid; grid-template-columns: repeat(var(--n, 6), minmax(0, 1fr)); gap: 0 16px; }
.jr-s { position: relative; padding-top: 40px; }
/* each step opens on a round icon of who does it, joined to the next by a line */
.jr-ic { position: absolute; top: 0; left: 0; display: block; font-size: 22px; line-height: 1; color: color-mix(in srgb, var(--pfg) 80%, transparent); }
.jr.is-new .jr-ic { color: var(--acc); }
.jr-s::after { content: ''; position: absolute; top: 11px; left: 36px; right: 4px; height: 1px; background: color-mix(in srgb, var(--pfg) 22%, transparent); }
.jr-s:last-child::after { display: none; }
.jr-who { display: block; font-size: 12.5px; color: color-mix(in srgb, var(--pfg) 55%, transparent); }
.jr-s h3 { margin-top: 6px; font-size: clamp(17px, 1.3vw, 21px); font-weight: 400; line-height: 1.25; letter-spacing: -.01em; }
.jr-via { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.jr-via span { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 99px; font-size: 12px; color: color-mix(in srgb, var(--pfg) 72%, transparent); background: rgba(255, 255, 255, .06); }
.jr-s > p { margin-top: 10px; font-size: 13.5px; line-height: 1.5; color: color-mix(in srgb, var(--pfg) 64%, transparent); }
.jr-p, .jr-f { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 8px; margin-top: 12px; padding: 10px 12px; border-radius: 10px; font-size: 13px; line-height: 1.42; }
.jr-p { color: #ffd9cc; background: rgba(255, 128, 96, .1); }
.jr-p i { display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; font-size: 10.5px; font-style: normal; font-weight: 600; color: #241a17; background: #ff9b80; }
.jr-f { grid-template-columns: minmax(0, 1fr); color: var(--pfg); background: color-mix(in srgb, var(--acc) 13%, transparent); }
.jr-f small { display: block; margin-top: 4px; font-size: 11.5px; color: color-mix(in srgb, var(--pfg) 58%, transparent); }
.jr-end { margin-top: 26px; padding-top: 16px; border-top: 1px solid color-mix(in srgb, var(--pfg) 14%, transparent); font-size: 14px; line-height: 1.5; color: color-mix(in srgb, var(--pfg) 70%, transparent); }
.jr-end b { font-weight: 500; color: var(--pfg); }
.jr-end .ico { margin-right: 6px; font-size: 17px; color: var(--acc); }

/* sources under a chapter: small, with real links */
.src { max-width: 90ch; font-size: 12.5px; line-height: 1.6; color: color-mix(in srgb, var(--pfg) 50%, transparent); }
.src a { color: color-mix(in srgb, var(--pfg) 72%, transparent); text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--pfg) 30%, transparent); text-underline-offset: 3px; }
.src a:hover { color: var(--pfg); }
.mx.is-cmp table { min-width: 980px; }
.mx.is-cmp th[scope="row"] small { display: block; margin-top: 4px; font-size: 12px; font-weight: 400; color: color-mix(in srgb, var(--pfg) 55%, transparent); }

/* ---------- visual pieces for the case studies ---------- */
/* line icons from assets/icons.svg; they take the text colour */
.ico { display: inline-block; flex: none; width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; vertical-align: -.14em; }
.ico-t { display: inline-grid; place-items: center; font-size: 22px; color: var(--acc); }
.ico-t.is-warm { color: #ff9b80; }
.col > .ico-t { margin: 6px 0 18px; }
.term .ico-t, .pp-c .ico-t { width: auto; height: auto; place-items: start; border-radius: 0; font-size: 26px; background: none; }
.cols.is-ico .col { border-top: 0; padding-top: 0; }
.cols.is-ico .col h3 { margin-top: 12px; }

/* what a module holds, as a row of labelled icons */
.holds { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.holds > .ico { font-size: 16px; color: color-mix(in srgb, var(--pfg) 40%, transparent); }
.duo .say { margin-top: 0; font-size: clamp(26px, 2.7vw, 46px); }
.hold { display: inline-flex; align-items: center; gap: 10px; padding: 11px 18px 11px 14px; border-radius: 99px; font-size: 14.5px; color: color-mix(in srgb, var(--pfg) 86%, transparent); background: rgba(255, 255, 255, .045); }
.hold .ico { font-size: 18px; color: var(--acc); }

/* a section inside a chapter: a hairline, a quiet label on the left and one
   line on the right. The visual it introduces follows close, so the two read
   as one thing */
.sec { display: grid; grid-template-columns: repeat(24, minmax(0, 1fr)); column-gap: var(--gut); margin-top: 11vh; padding-top: 16px; border-top: 1px solid color-mix(in srgb, var(--pfg) 16%, transparent); }
.pg .sec h3 { grid-column: 1 / 12; font-size: 13px; font-weight: 400; letter-spacing: 0; color: color-mix(in srgb, var(--pfg) 58%, transparent); }
.sec p { grid-column: 13 / -1; max-width: 52ch; font-size: 16px; line-height: 1.6; color: color-mix(in srgb, var(--pfg) 74%, transparent); }
.sec + * { margin-top: 4.5vh; }
.sec p b { font-weight: 500; color: var(--pfg); }

/* a labelled list: the label on the left, rows under the intro on the right,
   so everything in a chapter reads down one line */
.kv { display: grid; grid-template-columns: repeat(24, minmax(0, 1fr)); column-gap: var(--gut); padding-top: 16px; border-top: 1px solid color-mix(in srgb, var(--pfg) 16%, transparent); }
.kv.blk { margin-top: 11vh; }
.kv-k { grid-column: 1 / 12; font-size: 13px; color: color-mix(in srgb, var(--pfg) 58%, transparent); }
.kv-v { grid-column: 13 / -1; }
.kv-r { display: grid; grid-template-columns: 26px minmax(0, 1fr); column-gap: 16px; padding: 18px 0; border-top: 1px solid color-mix(in srgb, var(--pfg) 12%, transparent); }
.kv-r:first-child { padding-top: 0; border-top: 0; }
.kv-r .ico { margin-top: 1px; font-size: 20px; color: var(--acc); }
.kv-r b { font-size: 17px; font-weight: 500; }
.kv-r span { display: block; margin-top: 4px; font-size: 15px; line-height: 1.5; color: color-mix(in srgb, var(--pfg) 62%, transparent); }
.kv.is-terms .kv-r { grid-template-columns: minmax(0, 11em) minmax(0, 1fr); }
.kv.is-terms .kv-r span { margin-top: 0; }

/* who uses it: three roles in a row, each an icon beside a short heading */
.roles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4vh var(--gut); }
.role { display: grid; grid-template-columns: 26px minmax(0, 1fr); column-gap: 14px; }
.role .ico { grid-row: span 2; margin-top: 2px; font-size: 24px; color: var(--acc); }
.role h3 { font-size: clamp(20px, 1.6vw, 26px); font-weight: 300; line-height: 1.15; letter-spacing: -.02em; }
.role p { margin-top: 8px; font-size: 15px; line-height: 1.55; color: color-mix(in srgb, var(--pfg) 62%, transparent); text-wrap: pretty; }

/* a glossary: icon, term, one line */
.terms { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 12px; }
.terms.is-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.term { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 6px 16px; align-items: start; padding: 22px; border-radius: 18px; background: rgba(255, 255, 255, .05); }
.term .ico-t { grid-row: span 2; }
.term b { font-size: 18px; font-weight: 400; letter-spacing: -.01em; }
.term > span:last-child { font-size: 13.5px; line-height: 1.45; color: color-mix(in srgb, var(--pfg) 62%, transparent); }

/* two halves: a picture and what it says */
.duo { display: grid; grid-template-columns: repeat(24, minmax(0, 1fr)); column-gap: var(--gut); row-gap: 6vh; align-items: center; }
.duo > :first-child { grid-column: 1 / 14; }
.duo > :last-child { grid-column: 15 / -1; }

/* big numbers */
.stat + .stat { margin-top: 5vh; padding-top: 5vh; border-top: 1px solid color-mix(in srgb, var(--pfg) 14%, transparent); }
.stat .stat-n { max-width: none; margin-top: 0; color: var(--pfg); font-family: var(--fh); font-size: clamp(64px, 7.4vw, 132px); font-weight: 300; line-height: .9; letter-spacing: -.05em; }
.stat-n small { font-size: .42em; letter-spacing: -.02em; color: color-mix(in srgb, var(--pfg) 60%, transparent); }
.stat p { max-width: 34ch; margin-top: 14px; font-size: 16px; line-height: 1.5; color: color-mix(in srgb, var(--pfg) 66%, transparent); }
.bar { display: flex; height: 12px; margin-top: 18px; border-radius: 99px; overflow: hidden; background: rgba(255, 255, 255, .08); }
.bar i { width: var(--w); background: var(--c, var(--acc)); }
.stat .bar-k, .bar-k { display: flex; max-width: none; flex-wrap: wrap; gap: 6px 18px; margin-top: 10px; font-size: 12.5px; color: color-mix(in srgb, var(--pfg) 60%, transparent); }
.bar-k span::before { content: ''; display: inline-block; width: 8px; height: 8px; margin-right: 7px; border-radius: 50%; background: var(--c, var(--acc)); }

/* an illustration: a canvas of HTML, sized in cqw so it scales as one picture */
.ill { position: relative; overflow: hidden; container-type: inline-size; aspect-ratio: 4 / 3.3; border-radius: clamp(14px, 1.8vw, 30px); background: var(--tile-bg); }
.ill-sheet { position: absolute; width: 36cqw; aspect-ratio: 1 / 1.3; padding: 2.6cqw; border-radius: 1.6cqw; background: #fff; color: #333; box-shadow: 0 2cqw 5cqw -1.5cqw rgb(var(--sh) / .7); }
.ill-sheet svg { display: block; width: 100%; aspect-ratio: 1; fill: none; stroke: #9aa3b5; stroke-width: 1.2; }
.ill-sheet b { display: block; margin-top: 2.2cqw; overflow: hidden; font-size: 2.6cqw; font-weight: 600; white-space: nowrap; text-overflow: ellipsis; }
.ill-sheet span { display: block; margin-top: .6cqw; font-size: 2.2cqw; color: #8a90a0; }
.ill-bub { position: absolute; max-width: 40cqw; padding: 2cqw 2.8cqw; border-radius: 2.6cqw 2.6cqw 2.6cqw .6cqw; font-size: 3cqw; line-height: 1.3; color: #26313a; background: #fff; box-shadow: 0 2cqw 5cqw -2cqw rgb(var(--sh) / .7); }
.ill-bub small { display: block; margin-bottom: .5cqw; font-size: 2.2cqw; font-weight: 600; color: #8a90a0; }
.ill-bub.is-me { border-radius: 2.6cqw 2.6cqw .6cqw 2.6cqw; background: #dcf8c6; }
.ill-bub.is-bad { color: #8a2f19; background: #ffe2d8; }
.ill-q { position: absolute; display: grid; place-items: center; width: 9cqw; aspect-ratio: 1; border-radius: 50%; font-size: 5cqw; color: #241a17; background: #ff9b80; box-shadow: 0 1.5cqw 4cqw -1cqw rgb(var(--sh) / .6); }
.ill-q .ico { stroke-width: 2; }

/* the margin, leaking: one bar per stage, the margin shrinking as it goes */
.lk { display: grid; align-content: center; gap: 3.2cqw; height: 100%; padding: 7cqw; }
.lk-r { display: grid; grid-template-columns: 30cqw minmax(0, 1fr); align-items: center; gap: 3cqw; font-size: 2.9cqw; color: color-mix(in srgb, var(--pfg) 74%, transparent); }
.lk-r b { font-weight: 500; color: var(--pfg); }
.lk-b { position: relative; display: flex; height: 5.4cqw; border-radius: 1.2cqw; overflow: hidden; background: rgba(255, 255, 255, .1); }
.lk-b i { flex: none; width: var(--w); }
.lk-b .c { background: rgba(255, 255, 255, .22); }
.lk-b .l { background: repeating-linear-gradient(135deg, #ff9b80 0 .8cqw, rgba(255, 155, 128, .45) .8cqw 1.6cqw); }
.lk-b .m { background: var(--acc); }
.lk-r.is-leak { font-size: 2.7cqw; }
.lk-r.is-leak .lk-b { height: 3cqw; background: none; }
.lk-r.is-leak .lk-b::before { content: ''; flex: none; width: var(--x); }
.lk-r.is-leak .lk-b .l { border-radius: .8cqw; }
.lk-r .ico { margin-right: 1.4cqw; font-size: 3.6cqw; color: #ff9b80; }
.lk-k { display: flex; flex-wrap: wrap; gap: 1.4cqw 4cqw; margin-top: 1cqw; font-size: 2.5cqw; color: color-mix(in srgb, var(--pfg) 60%, transparent); }
.lk-k span::before { content: ''; display: inline-block; width: 2cqw; height: 2cqw; margin-right: 1.2cqw; border-radius: .5cqw; vertical-align: -.3cqw; background: var(--c); }

/* pain points as cards: the problem, then what was built, then when */
.pp { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.pp-c { display: flex; flex-direction: column; padding: 22px; border-radius: 20px; background: rgba(255, 255, 255, .05); }
.pp-top { display: flex; align-items: center; justify-content: space-between; }
.pp-n { font-size: 13px; color: color-mix(in srgb, var(--pfg) 45%, transparent); font-variant-numeric: tabular-nums; }
.pp-a { margin-top: 20px; font-size: clamp(18px, 1.4vw, 22px); font-weight: 300; line-height: 1.25; letter-spacing: -.015em; }
.pp-b { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 10px; margin-top: 14px; font-size: 14.5px; line-height: 1.45; color: color-mix(in srgb, var(--pfg) 80%, transparent); }
.pp-b .ico { margin-top: 2px; font-size: 18px; color: var(--acc); }
.pp-v { align-self: flex-start; margin-top: auto; padding-top: 16px; font-size: 12px; color: var(--acc); }

/* a comparison: options down the side, capabilities across, a mark in each cell */
.cm { overflow-x: auto; }
.cm table { width: 100%; min-width: 780px; border-collapse: collapse; }
.cm thead th { padding: 0 10px 18px; vertical-align: bottom; font-size: 12.5px; font-weight: 400; line-height: 1.3; color: color-mix(in srgb, var(--pfg) 62%, transparent); }
.cm thead th .ico { display: block; margin: 0 auto 10px; font-size: 22px; color: var(--pfg); }
.cm tbody th { padding: 14px 12px 14px 4px; text-align: left; white-space: nowrap; }
/* the first and last columns sit 20px in from the edges, so a highlighted row has even padding */
.cm thead th:first-child, .cm tbody th { padding-left: 20px; }
.cm thead th:last-child, .cm td:last-child { padding-right: 20px; text-align: right; }
.cm thead th:last-child .ico { margin: 0 0 10px auto; }
.cm td { padding: 14px 10px; text-align: center; vertical-align: middle; }
.cm tbody tr + tr > * { border-top: 1px solid rgba(255, 255, 255, .07); }
.cm-o { display: flex; align-items: center; gap: 12px; }
.cm-o i { display: none; place-items: center; width: 34px; height: 34px; border-radius: 10px; font-size: 13px; font-style: normal; font-weight: 600; color: var(--pfg); background: rgba(255, 255, 255, .09); }
.cm-o b { display: block; font-size: 15px; font-weight: 500; }
.cm-o small { display: block; margin-top: 2px; font-size: 12px; color: color-mix(in srgb, var(--pfg) 52%, transparent); }
.cm tr.is-us > * { background: color-mix(in srgb, var(--acc) 12%, transparent); }
.cm tr.is-us > :first-child { border-radius: 14px 0 0 14px; }
.cm tr.is-us > :last-child { border-radius: 0 14px 14px 0; }
.cm tr.is-us .cm-o i { color: #111; background: var(--acc); }
.dot { display: inline-block; width: 16px; height: 16px; border-radius: 50%; vertical-align: middle; }
.dot.y { background: var(--acc); }
.dot.h { background: linear-gradient(90deg, var(--acc) 50%, transparent 50%); box-shadow: inset 0 0 0 1.5px var(--acc); }
.dot.n { box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--pfg) 30%, transparent); }
.cm td small { display: block; margin-top: 6px; font-size: 11.5px; line-height: 1.3; color: color-mix(in srgb, var(--pfg) 55%, transparent); }
.cm-tag { display: inline-block; padding: 4px 10px; border-radius: 99px; font-size: 12px; line-height: 1.3; color: color-mix(in srgb, var(--pfg) 80%, transparent); background: rgba(255, 255, 255, .06); }
tr.is-us .cm-tag { color: var(--pfg); }
.cm-key { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 18px; font-size: 12.5px; color: color-mix(in srgb, var(--pfg) 60%, transparent); }
.cm-key .dot { width: 12px; height: 12px; margin-right: 8px; }

/* a timeline you can drag or scroll sideways */
.tl { display: flex; gap: var(--gut); overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: var(--gut); padding: 4px var(--gut) 24px; margin: 0 calc(-1 * var(--gut)); scrollbar-width: none; cursor: grab; }
.tl::-webkit-scrollbar { display: none; }
.tl.is-drag { cursor: grabbing; scroll-snap-type: none; }
.tl-i { flex: none; width: clamp(280px, 30vw, 460px); scroll-snap-align: start; }
.tl-i .shot-in { aspect-ratio: 16 / 11; }
.tl-i .win { left: 7cqw; top: 9cqw; width: 100cqw; }
.tl-y { margin-top: 22px; font-size: 13px; color: var(--acc); font-variant-numeric: tabular-nums; }
.tl-i h3 { margin-top: 8px; font-size: clamp(24px, 2vw, 32px); font-weight: 300; letter-spacing: -.03em; }
.tl-i p { margin-top: 10px; font-size: 15px; line-height: 1.55; color: color-mix(in srgb, var(--pfg) 62%, transparent); }
.tl-c { margin-top: 12px; font-size: 12.5px; color: color-mix(in srgb, var(--pfg) 48%, transparent); }
.tl-hint { display: flex; justify-content: space-between; margin-top: 8px; font-size: 12.5px; color: color-mix(in srgb, var(--pfg) 48%, transparent); }

/* a figure on its own canvas, with notes beside it */
.fig { display: grid; grid-template-columns: repeat(24, minmax(0, 1fr)); column-gap: var(--gut); align-items: start; }
.fig > .shot { grid-column: 1 / 16; }
.fig-notes { grid-column: 17 / -1; counter-reset: note; }
.fig.is-flip > .shot { grid-column: 10 / -1; grid-row: 1; }
.fig.is-flip .fig-notes { grid-column: 1 / 9; grid-row: 1; }
.fig-notes h3 { font-size: clamp(26px, 2.4vw, 40px); font-weight: 300; line-height: 1.05; letter-spacing: -.03em; }
.fig-notes > p { margin-top: 14px; font-size: 15.5px; line-height: 1.6; color: color-mix(in srgb, var(--pfg) 62%, transparent); }
.fig-notes ol { margin-top: 22px; border-top: 1px solid color-mix(in srgb, var(--pfg) 20%, transparent); }
.fig-notes li { counter-increment: note; display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 8px; padding: 13px 0; border-bottom: 1px solid color-mix(in srgb, var(--pfg) 10%, transparent); font-size: 14.5px; line-height: 1.5; color: color-mix(in srgb, var(--pfg) 74%, transparent); }
.fig-notes li::before { content: counter(note, decimal-leading-zero); font-size: 12px; color: var(--acc); font-variant-numeric: tabular-nums; padding-top: 2px; }
.shot .win.is-full { left: 6cqw; top: 6cqw; width: 88cqw; }
.shot .win.is-bleed { left: 7cqw; top: 8cqw; width: 106cqw; }

/* a gallery of screens in a row, each on its own small canvas */
.gal { display: grid; grid-template-columns: repeat(var(--n, 3), minmax(0, 1fr)); gap: 4vh var(--gut); }
.gal .shot-in { aspect-ratio: 4 / 3; }
.gal .win { left: 8cqw; top: 9cqw; width: 104cqw; }
.gal .win.is-fit { left: 8cqw; right: 8cqw; top: 8cqw; width: auto; }

/* before / after: drag the line */
.cmp { position: relative; overflow: hidden; border-radius: clamp(14px, 1.8vw, 30px); container-type: inline-size; touch-action: pan-y; }
.cmp img { display: block; width: 100%; height: auto; }
.cmp-b { position: absolute; inset: 0; clip-path: inset(0 0 0 var(--at, 50%)); }
.cmp-line { position: absolute; top: 0; bottom: 0; left: var(--at, 50%); width: 2px; margin-left: -1px; background: #fff; box-shadow: 0 0 0 1px rgba(0, 0, 0, .2); pointer-events: none; }
.cmp-knob { position: absolute; top: 50%; left: 50%; width: 44px; height: 44px; margin: -22px 0 0 -22px; border-radius: 50%; background: #fff; box-shadow: 0 6px 20px rgba(0, 0, 0, .35); }
.cmp-knob::before, .cmp-knob::after { content: ''; position: absolute; top: 50%; margin-top: -5px; border: 5px solid transparent; }
.cmp-knob::before { left: 9px; border-right: 6px solid #222; border-left: 0; }
.cmp-knob::after { right: 9px; border-left: 6px solid #222; border-right: 0; }
.cmp-tag { position: absolute; top: 14px; padding: 5px 10px; border-radius: 99px; font-size: 12px; font-weight: 500; color: #fff; background: rgba(10, 10, 12, .65); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); pointer-events: none; }
.cmp-tag.is-a { left: 14px; } .cmp-tag.is-b { right: 14px; }
.cmp input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: ew-resize; margin: 0; }
.cmp-wrap { padding: clamp(14px, 2vw, 32px); border-radius: clamp(16px, 2vw, 34px); background: var(--tile-bg); }

/* a table of rules, set like the guardrails */
.mx { overflow-x: auto; border-radius: clamp(14px, 1.8vw, 30px); background: var(--tile-bg); padding: clamp(16px, 2.4vw, 36px); }
.mx table { width: 100%; min-width: 860px; border-collapse: separate; border-spacing: 8px; font-size: 13.5px; line-height: 1.42; }
.mx th { padding: 0 12px 6px; font-size: 12.5px; font-weight: 400; text-align: left; color: color-mix(in srgb, var(--pfg) 60%, transparent); }
.mx th[scope="row"] { padding: 10px 12px 10px 0; vertical-align: top; color: var(--pfg); font-size: 15px; font-weight: 500; }
.mx td { padding: 11px 13px; vertical-align: top; border-radius: 11px; color: color-mix(in srgb, var(--pfg) 74%, transparent); background: rgba(255, 255, 255, .035); }
.mx td.is-na { color: color-mix(in srgb, var(--pfg) 25%, transparent); text-align: center; background: none; }
.mx td.is-key { color: #fff; background: color-mix(in srgb, var(--acc) 16%, transparent); }

/* a palette and chips drawn from a product's own system */
.sw { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.sw div { padding: 12px; border-radius: 14px; background: rgba(255, 255, 255, .04); font-size: 12.5px; color: color-mix(in srgb, var(--pfg) 70%, transparent); }
.sw i { display: block; height: 54px; margin-bottom: 10px; border-radius: 9px; background: var(--c); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .1); }
.sw b { display: block; font-weight: 500; color: var(--pfg); }
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 10px; border-radius: 99px; font-size: 13px; color: var(--t); background: var(--b); }
.chip::before { content: ''; width: 7px; aspect-ratio: 1; border-radius: 50%; background: currentColor; }

/* ---------- the end of a page: what's next ---------- */
/* the next case study: its cover, laid out like the splash that opens it. It stays in
   this page's colour: two dark colours blended on scroll went muddy, so the next one's
   colour arrives only with the curtain when you click (--nx feeds data-color) */
.pg-next { --nx: #222; --na: var(--acc); display: grid; place-content: center; justify-items: center; min-height: 100vh; margin-top: 10vh; padding: 34vh var(--gut) 14vh; text-align: center; color: var(--pfg); }
.pg-next-k { display: flex; justify-content: center; gap: 10px; font-size: 13px; color: color-mix(in srgb, var(--pfg) 55%, transparent); font-variant-numeric: tabular-nums; }
.pg-next-k span + span::before { content: '·'; margin-right: 10px; }
.pg-next-t { display: block; margin-top: 3vh; font-family: var(--fh); font-size: clamp(56px, 11vw, 200px); font-weight: 300; line-height: .9; letter-spacing: -.055em; transition: color .6s var(--ease); }
.pg-next-a { display: grid; justify-items: center; }
.pg-next-a:hover .pg-next-t { color: var(--na); }
.pg-next-s { display: block; max-width: 64ch; margin-top: 4vh; font-size: 15px; line-height: 1.5; color: color-mix(in srgb, var(--pfg) 66%, transparent); text-wrap: balance; }
.pg-next-s .ic { width: 16px; height: 16px; margin-left: 10px; vertical-align: -3px; transition: transform .6s var(--ease); }
.pg-next-a:hover .pg-next-s .ic { transform: translateX(6px); }
.pg-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px; padding: 4vh var(--gut) 5vh; border-top: 1px solid color-mix(in srgb, var(--pfg) 14%, transparent); font-size: 13px; color: color-mix(in srgb, var(--pfg) 55%, transparent); }
.pg-foot a:hover { color: var(--pfg); }
.pg-foot a[data-email] { color: var(--pfg); text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--pfg) 35%, transparent); text-underline-offset: 3px; }

/* ---------- opening and closing ----------
   The overlays (.pt) live in site.css, because the portfolio plays them too.
   A side project's page is wrapped in .pg-win, which grows out of the dock. */
.pg-win { transform-origin: 50% 100%; }

/* ---------- side projects: a product page ---------- */
.pg-app { --pc: #0e0e0d; }
.ap-hero { position: relative; display: grid; grid-template-columns: repeat(24, minmax(0, 1fr)); column-gap: var(--gut); align-items: center; min-height: 100svh; padding: calc(var(--hd-h) + 5vh) var(--gut) 7vh; }
.ap-copy { grid-column: 1 / 12; }
.ap-art { grid-column: 13 / -1; }
.ap-badge { display: inline-flex; align-items: center; gap: 12px; font-size: 14px; color: color-mix(in srgb, var(--pfg) 70%, transparent); }
.ap-ico { display: grid; place-items: center; width: 44px; aspect-ratio: 1; overflow: hidden; border-radius: 22%; background: var(--tile, transparent); box-shadow: 0 6px 18px rgba(0, 0, 0, .35); }
.ap-ico img { width: 100%; height: 100%; object-fit: cover; }
.ap-title { margin-top: 3.6vh; font-size: clamp(52px, 6.4vw, 124px); font-weight: 300; line-height: .9; letter-spacing: -.05em; }
.ap-title .ln { display: block; overflow: clip; padding: .1em .08em .24em; margin: -.1em -.08em -.24em; }
.ap-title .ln > span { display: inline-block; white-space: nowrap; }
.ap-lede { max-width: 34ch; margin-top: 3vh; font-size: clamp(18px, 1.5vw, 23px); line-height: 1.5; color: color-mix(in srgb, var(--pfg) 66%, transparent); text-wrap: pretty; }
.ap-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px; margin-top: 3.6vh; }
.btn { display: inline-flex; align-items: center; gap: 10px; padding: 14px 22px; border-radius: 99px; font-size: 15px; font-weight: 500; color: #111; background: var(--acc); transition: transform .4s var(--ease), box-shadow .4s; }
.btn:hover { transform: translateY(-2px); box-shadow: 0 10px 30px -10px var(--acc); }
.btn .ic { width: 15px; height: 15px; }
.btn.is-ghost { color: var(--pfg); background: transparent; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--pfg) 30%, transparent); }
.ap-note { width: 100%; font-size: 13px; color: color-mix(in srgb, var(--pfg) 50%, transparent); }
.feat { display: grid; grid-template-columns: repeat(24, minmax(0, 1fr)); column-gap: var(--gut); align-items: center; padding: 18vh var(--gut) 0; }
.feat-copy { grid-column: 1 / 10; }
.feat-art { grid-column: 12 / -1; }
.feat.is-flip .feat-copy { grid-column: 16 / -1; grid-row: 1; }
.feat.is-flip .feat-art { grid-column: 1 / 14; grid-row: 1; }
.feat-k { font-size: 13px; color: var(--acc); font-variant-numeric: tabular-nums; }
.feat h2 { margin-top: 16px; font-size: clamp(34px, 4vw, 72px); font-weight: 300; line-height: 1; letter-spacing: -.04em; text-wrap: balance; }
.feat-copy > p { max-width: 42ch; margin-top: 20px; font-size: 17px; line-height: 1.6; color: color-mix(in srgb, var(--pfg) 64%, transparent); }
.code { position: relative; margin-top: 4vh; padding: 20px 22px; border-radius: 16px; background: #0a0a09; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08); font: 13.5px/1.75 ui-monospace, 'SF Mono', Menlo, monospace; color: rgba(255, 255, 255, .78); white-space: pre; overflow-x: auto; }
.code-copy { position: absolute; top: 12px; right: 12px; padding: 6px 12px; border-radius: 99px; font: 500 12px var(--f); color: var(--pfg); background: rgba(255, 255, 255, .08); }
.code-copy.is-done { color: #111; background: var(--acc); }

@media (max-width: 1100px) {
  .ch-title { grid-column: 1 / -1; }
  .ch-sub { grid-column: 1 / -1; }
  .ch-intro { grid-column: 1 / -1; }
  .fig > .shot, .fig.is-flip > .shot { grid-column: 1 / -1; grid-row: auto; }
  .fig-notes, .fig.is-flip .fig-notes { grid-column: 1 / -1; grid-row: auto; margin-top: 5vh; }
  .ap-copy, .ap-art, .feat-copy, .feat-art, .feat.is-flip .feat-copy, .feat.is-flip .feat-art { grid-column: 1 / -1; grid-row: auto; }
  .ap-art, .feat-art { margin-top: 7vh; }
  .ph-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kv-k { grid-column: 1 / -1; margin-bottom: 14px; }
  .pg .sec h3, .sec p { grid-column: 1 / -1; }
  .sec p { margin-top: 8px; }
  .kv-v { grid-column: 1 / -1; }
  .cols.has-v { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .duo > :first-child, .duo > :last-child { grid-column: 1 / -1; }
  .pp { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .terms.is-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  /* the flow turns: one step under another, on a line down the left */
  .jr { grid-template-columns: minmax(0, 1fr); max-width: 640px; }
  .jr-s { padding: 0 0 30px 40px; }
  .jr-s::after { top: 32px; left: 10.5px; right: auto; bottom: 8px; width: 1px; height: auto; }
}
@media (max-width: 760px) {
  /* 23 gutters don't fit a phone: everything spans the width anyway */
  .ch, .fig, .feat, .ap-hero, .duo { column-gap: 0; }
  .ph { padding-top: calc(var(--hd-h) + 9vh); }
  .ph-facts, .cols, .cols.has-v, .gal { grid-template-columns: minmax(0, 1fr); }
  .col-v { aspect-ratio: 16 / 11; }
  .pp { grid-template-columns: minmax(0, 1fr); }
  .terms.is-3 { grid-template-columns: minmax(0, 1fr); }
  .roles { grid-template-columns: minmax(0, 1fr); }
  .kv { column-gap: 0; }
  .kv-k, .kv-v { grid-column: 1 / -1; }
  .sec { column-gap: 0; }
  .pg .sec h3, .sec p { grid-column: 1 / -1; }
  .sec p { margin-top: 8px; }
  .kv.is-terms .kv-r { grid-template-columns: minmax(0, 1fr); }
  .kv.is-terms .kv-r span { margin-top: 4px; }
  .ill { aspect-ratio: 4 / 3.6; }
  .lk-r, .lk-r.is-leak { grid-template-columns: 40cqw minmax(0, 1fr); font-size: 3.7cqw; }
  .lk-r .ico { font-size: 4.4cqw; }
  .lk-k { font-size: 3.4cqw; }
  .ill-bub { font-size: 3.6cqw; }
  .ill-sheet b { font-size: 3cqw; }
  .ch { padding-top: 16vh; }
  .pg[data-kind="case"] .ch::before { top: 8vh; }
  .say { grid-column: 1 / -1; margin-top: 8vh; }
  .find { grid-template-columns: 32px minmax(0, 1fr); row-gap: 12px; padding: 24px 0; }
  .find-to { display: none; }
  .find-b { grid-column: 2; }
  .ap-hero { min-height: auto; padding-top: calc(var(--hd-h) + 7vh); }
  /* the hero tile turns portrait, as on the portfolio: the window runs off the
     right edge and the lifted detail sits over it (beats the page's inline spots) */
  .ph-shot .shot-in { aspect-ratio: 4 / 5 !important; }
  .ph-shot .win { left: 7cqw !important; top: 8cqw !important; width: 128cqw !important; padding: 1cqw; border-radius: 2.6cqw; }
  .ph-shot .win img { border-radius: 1.8cqw; }
  .ph-shot .float { left: 49cqw !important; top: 46cqw !important; width: 44cqw !important; border-radius: 2.6cqw; }
  .ph-shot .phone { left: 64cqw !important; top: 9.94cqw !important; width: 32cqw !important; }
  /* a window with a phone beside it keeps the desktop layout instead, as on
     the portfolio: the tile as tall as the window, the phone on the right at
     the window's full height */
  .ph-shot .shot-in:has(> .win + .phone) { aspect-ratio: auto !important; }
  .ph-shot .shot-in:has(> .win + .phone) > .win { position: relative; left: 0 !important; top: 0 !important; margin: 8cqw 0 8cqw 7cqw; width: 112cqw !important; }
  .ph-shot .shot-in:has(> .win + .phone) > .phone { left: auto !important; right: 6cqw; top: 8cqw !important; bottom: 8cqw; width: auto !important; min-height: 0; aspect-ratio: .4825; }
  .feat { padding-top: 13vh; }
}

/* without scripts there is no curtain to lift */
html:not(.js) .pt[data-boot] { display: none; }

/* ---------- contents (case studies; built in js/page.js) ----------
   A pill at the bottom names the chapter you're in. It opens a list of the
   chapters, with their headings, and the five case studies. */
.toc { position: fixed; left: 50%; bottom: max(18px, env(safe-area-inset-bottom)); z-index: 40; width: min(440px, calc(100vw - 2 * var(--gut))); display: flex; flex-direction: column; align-items: center; pointer-events: none; opacity: 0; visibility: hidden; transform: translate(-50%, 16px); transition: opacity .5s var(--ease), transform .7s var(--ease), visibility 0s linear .7s; }
.toc.is-on { opacity: 1; visibility: visible; transform: translate(-50%, 0); transition-delay: 0s; }
.toc > * { pointer-events: auto; }
.toc-btn { display: inline-flex; align-items: center; gap: 10px; max-width: 100%; height: 44px; padding: 0 16px 0 18px; border: 0; border-radius: 999px; font: inherit; font-size: 13.5px; color: var(--pfg); background: color-mix(in srgb, var(--pc) 82%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--pfg) 18%, transparent), 0 14px 34px -14px rgba(0, 0, 0, .7); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); cursor: pointer; transition: box-shadow .4s; }
.toc-btn:hover, .toc.is-open .toc-btn { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--pfg) 34%, transparent), 0 14px 34px -14px rgba(0, 0, 0, .7); }
.toc-btn .toc-n { color: var(--acc, var(--pfg)); }
.toc-cur { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.toc-of { color: color-mix(in srgb, var(--pfg) 45%, transparent); font-variant-numeric: tabular-nums; }
.toc-chev { flex: none; width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; opacity: .7; transition: transform .5s var(--ease); }
.toc.is-open .toc-chev { transform: rotate(180deg); }
.toc-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.toc-n { flex: none; font-variant-numeric: tabular-nums; color: color-mix(in srgb, var(--pfg) 48%, transparent); }

.toc-panel { order: -1; width: 100%; max-height: min(64vh, 640px); overflow-y: auto; overscroll-behavior: contain; margin-bottom: 10px; padding: 16px 8px 8px; border-radius: 18px; background: color-mix(in srgb, var(--pc) 90%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--pfg) 16%, transparent), 0 28px 70px -24px rgba(0, 0, 0, .75); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); opacity: 0; visibility: hidden; transform: translateY(10px) scale(.98); transform-origin: 50% 100%; transition: opacity .35s var(--ease), transform .5s var(--ease), visibility 0s linear .5s; }
.toc.is-open .toc-panel { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
.toc-k { padding: 0 12px 8px; font-size: 12px; color: color-mix(in srgb, var(--pfg) 50%, transparent); }
.toc-k.is-sep { margin-top: 10px; padding-top: 14px; border-top: 1px solid color-mix(in srgb, var(--pfg) 12%, transparent); }
.toc-list a, .toc-cases a, .toc-cases .is-here { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; align-items: baseline; gap: 4px 8px; padding: 9px 12px; border-radius: 10px; color: color-mix(in srgb, var(--pfg) 72%, transparent); transition: background .3s, color .3s; }
.toc-list a:hover, .toc-cases a:hover { color: var(--pfg); background: color-mix(in srgb, var(--pfg) 7%, transparent); }
.toc-list a.is-on { color: var(--pfg); background: color-mix(in srgb, var(--pfg) 10%, transparent); }
.toc-list a.is-on .toc-n { color: var(--acc, var(--pfg)); }
.toc-t { min-width: 0; }
.toc-t b { display: block; font-size: 14px; font-weight: 400; color: inherit; }
.toc-t span { display: block; margin-top: 2px; overflow: hidden; font-size: 12.5px; white-space: nowrap; text-overflow: ellipsis; color: color-mix(in srgb, var(--pfg) 46%, transparent); }
.toc-sw { align-self: center; width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.toc-cases .is-here { grid-template-columns: 30px minmax(0, 1fr) auto auto; color: var(--pfg); }
.toc-cases .is-here small { align-self: center; font-size: 11.5px; color: color-mix(in srgb, var(--pfg) 50%, transparent); }
.toc-cases .is-here { background: color-mix(in srgb, var(--pfg) 6%, transparent); }
.toc a:focus-visible, .toc-btn:focus-visible { outline: 1px solid var(--pfg); outline-offset: 2px; }
/* ---------- product films: one short, specific demonstration per project ---------- */
.project-film { margin: 18vh var(--gut) 0; padding-top: 16px; border-top: 1px solid color-mix(in srgb, var(--pfg) 20%, transparent); }
.project-film-k { display: flex; justify-content: space-between; gap: 24px; font-size: 13px; color: color-mix(in srgb, var(--pfg) 62%, transparent); font-variant-numeric: tabular-nums; }
.project-film h2 { max-width: 18ch; margin-top: 4vh; font-family: var(--fh); font-size: clamp(34px, 4vw, 72px); font-weight: 300; line-height: 1; letter-spacing: -.04em; text-wrap: balance; }
.project-film video { display: block; width: 100%; aspect-ratio: 16 / 9; margin-top: 5vh; background: #0c0c0b; color-scheme: dark; box-shadow: 0 0 0 1px color-mix(in srgb, var(--pfg) 12%, transparent), 0 32px 80px -38px rgba(0, 0, 0, .75); }
.project-film video:focus-visible { outline: 1px solid var(--acc, var(--pfg)); outline-offset: 5px; }
.project-film-cap { margin-top: 14px; max-width: 78ch; font-size: 13px; line-height: 1.55; color: color-mix(in srgb, var(--pfg) 62%, transparent); }
.project-film-cap a { text-decoration: underline; text-underline-offset: 3px; }
.project-film-cap a:hover { color: var(--pfg); }
@media (max-width: 760px) {
  .project-film { margin-top: 12vh; }
  .project-film h2 { margin-top: 3vh; font-size: 34px; }
  .project-film video { margin-top: 4vh; }
}

/* a small label over a block */
.lbl { margin-bottom: 18px; font-size: 13px; color: color-mix(in srgb, var(--pfg) 58%, transparent); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
