/* Homepage section 3: Selected work, "Live device". Everything is scoped under .th-work; tokens come from
   tokens.css (shared, never redefined here). Sticky needs `html, body { overflow-x: clip }`, which tokens.css holds.

   The device is one CSS-built frame. --mx (0 = iPhone, 1 = laptop, eased by showcase.js) drives its size,
   radii, bezel, island/notch and base through container units of .th-work__device, so the morph is a
   measured size + radius tween with crisp bezels (no scale transform), and it adapts to any stage size. */

.th-work { position: relative; overflow-x: clip; background: var(--bg); color: var(--text); font-family: var(--f-body); scroll-margin-top: 0;
  --work-top: var(--sticky-top, var(--nav-h)); }   /* where pinned parts start: under the header, and under the chapter bar once tokens.css has one (--sticky-top) */
.th-work *, .th-work *::before, .th-work *::after { box-sizing: border-box; }
.th-work__wrap { position: relative; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }

/* thread anchors (contract in BRIEF.md): empty boxes the thread engine measures */
/* x = 0 / 1 are the middles of the left / right gutters (integration: the thread runs there, beside the device) */
.th-work__anchors { position: absolute; inset: 0 calc(-1 * ((100vw - min(100vw, var(--wrap))) / 4 + var(--gutter) / 2)); pointer-events: none; }
/* 2026-11-27: the gutters' middles from the section's own width (100cqw), as the hero and the rail measure theirs. 100vw
   includes a visible scrollbar (14px in the owner's browser), which put these points 3.5px outside the middles the other
   sections' gutter points use, so the line jogged here. The 100vw rule above stays for browsers without container units.
   The device's own cq units are unaffected: .th-work__device and .th-work__scene are their nearer containers. */
@supports (width: 1cqw) {
  .th-work { container-type: inline-size; }
  .th-work__anchors { inset: 0 calc(-1 * ((100cqw - min(100cqw, var(--wrap))) / 4 + var(--gutter) / 2)); }
}
.th-work .th-anchor { position: absolute; inset: 0; pointer-events: none; }

.th-work__sr { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- header ---------- */
.th-work__head { position: relative; padding: clamp(80px, 8.5vw, 124px) 0 clamp(36px, 4.5vw, 64px); }
/* v2: a sentence-case section label (no rule, no caps) and one solid heading */
/* 22:57, the owner: the cyan label with a rule read as AI slop. The quiet label every other section uses (home.css,
   .th-eyebrow): text-3, no rule. The title sits under the hero H1. */
.th-work__eyebrow { margin: 0 0 18px; font: 500 15px/1.4 var(--f-body); color: var(--text-3); }
.th-work__title { margin: 0; max-width: 15ch; font: 600 clamp(34px, 4.6vw, 64px)/1.02 var(--f-display); letter-spacing: -0.04em; color: var(--text); text-wrap: balance; }

/* ---------- chapters ---------- */
.th-work__grid { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); column-gap: clamp(40px, 5vw, 80px); }
/* the bottom padding keeps the stage pinned while the last chapter is read */
.th-work__chapters { position: relative; z-index: 1; margin: 0; padding: 0 0 30vh; padding-bottom: 30svh; list-style: none; }
.th-work__ch { display: flex; align-items: center; min-height: 82vh; min-height: 82svh; scroll-margin-top: 12px; }   /* + html's scroll-padding-top (the header) */
.th-work__ch-in { width: 100%; max-width: 520px; padding: 28px 0; }
.th-work--js .th-work__ch-in { opacity: .26; transition: opacity .5s var(--ease-out); }
.th-work--js .th-work__ch.is-active .th-work__ch-in, .th-work--js .th-work__ch:focus-within .th-work__ch-in { opacity: 1; }

/* the engagement type, set as the case-study pages set their metadata (mono, small caps) */
.th-work__meta { margin: 0 0 14px; font: 500 11px/1.4 var(--f-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--text-3); }
.th-work__client { margin: 0 0 12px; font: 500 17px/1.35 var(--f-display); letter-spacing: -0.005em; color: var(--text); }
.th-work__client span { color: var(--text-3); font-weight: 400; }
.th-work__out { margin: 0 0 16px; font: 600 clamp(32px, 3vw, 40px)/1.06 var(--f-display); letter-spacing: -0.035em; color: var(--text); text-wrap: balance; }
.th-work__ctx { margin: 0 0 24px; max-width: 46ch; font: 400 17px/1.6 var(--f-body); color: var(--text-2); }

/* the stack: icon + name, in a plain row (v2: no chip boxes) */
.th-work__stack { display: flex; flex-wrap: wrap; gap: 12px 22px; margin: 0 0 30px; padding: 0; list-style: none; }
.th-work__chip { display: inline-flex; align-items: center; gap: 9px; font: 500 14px/1 var(--f-display); color: var(--text-2); white-space: nowrap; }
/* Icons (SP/icons/README.md): AWS icons whole, square and unmodified; brand marks white on a quiet tile;
   a technology with no icon is a mono text tile. */
.th-work__ic { flex: none; display: block; width: 24px; height: 24px; }
.th-work__ic--aws { border-radius: 0; }
.th-work__ic--tile { padding: 5px; border-radius: 6px; background: rgba(255, 255, 255, .07); object-fit: contain; }
.th-work__ic--mono { display: grid; place-items: center; border-radius: 6px; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .22); font: 600 7px/1 var(--f-mono); letter-spacing: 0; color: var(--text-2); }

.th-work__link { display: inline-flex; align-items: center; gap: 10px; padding: 8px 0 9px; border-bottom: 1px solid var(--line-2); font: 500 15px/1 var(--f-display); color: var(--text); text-decoration: none; transition: border-color .25s ease; }
.th-work__arrow { color: var(--text-2); transition: transform .25s var(--ease-out); }
.th-work__link:hover { border-color: var(--text-2); }
.th-work__link:hover .th-work__arrow { transform: translateX(4px); }
.th-work__link:focus-visible, .th-work__seg:focus-visible { outline: 2px solid var(--cyan); outline-offset: 4px; border-radius: 3px; }

/* ---------- stage ---------- */
.th-work__stagecol { position: relative; }
.th-work__stage { position: sticky; top: calc(var(--work-top) + 12px); height: calc(100vh - var(--work-top) - 24px); height: calc(100svh - var(--work-top) - 24px); min-height: 540px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px; }

.th-work__aura { position: absolute; left: 50%; top: 45%; z-index: 0; width: 150%; height: 112%; transform: translate(-50%, -50%); pointer-events: none;
  -webkit-mask-image: radial-gradient(closest-side, #000 30%, rgba(0, 0, 0, .6) 62%, transparent 100%); mask-image: radial-gradient(closest-side, #000 30%, rgba(0, 0, 0, .6) 62%, transparent 100%); }
.th-work__glow { position: absolute; inset: 0; opacity: 0; transition: opacity .9s var(--ease-out); }
.th-work__glow.is-on { opacity: .72; }
.th-work__glow img { display: block; width: 100%; height: 100%; object-fit: cover; }

/* the device box: a size container; the frame is drawn inside it */
.th-work__device { --mx: 0; position: relative; z-index: 1; width: 100%; height: min(640px, calc(100vh - var(--work-top) - 160px)); height: min(640px, calc(100svh - var(--work-top) - 160px)); min-height: 360px; margin: 0; container-type: size; display: grid; place-items: center; }

.th-work__frame {
  --k: var(--mx); --ik: calc(1 - var(--mx));
  --pw: min(47.85cqh, 100cqw);               /* iPhone 17 Pro body, 433 x 905 */
  --ph: calc(var(--pw) / .4785);
  --lw: min(90cqw, 140cqh);                  /* laptop lid */
  --lh: calc(var(--lw) * .64);
  --rt: calc(var(--pw) * .16 * var(--ik) + var(--lw) * .03 * var(--k));
  --rb: calc(var(--pw) * .16 * var(--ik) + var(--lw) * .012 * var(--k));
  --srt: calc(var(--pw) * .126 * var(--ik) + var(--lw) * .012 * var(--k));
  --srb: calc(var(--pw) * .126 * var(--ik) + var(--lw) * .004 * var(--k));
  --bz: calc(var(--pw) * .034 * var(--ik) + var(--lw) * .02 * var(--k));
  position: relative;
  width: calc(var(--pw) * var(--ik) + var(--lw) * var(--k));
  height: calc(var(--ph) * var(--ik) + var(--lh) * var(--k));
  padding: var(--bz) var(--bz) calc(var(--pw) * .034 * var(--ik) + var(--lw) * .032 * var(--k));
  border-radius: var(--rt) var(--rt) var(--rb) var(--rb);
  background: linear-gradient(150deg, #2c3342 0%, #121722 34%, #0a0d13 62%, #232a37 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .1), inset 0 0 0 calc(var(--bz) * .3) #06080c, 0 0 0 1px rgba(0, 0, 0, .7), 0 60px 110px -40px rgba(0, 0, 0, .95);
}
/* rim light: a 1.25px gradient border (white at the top left, cyan at the bottom right) */
.th-work__frame::after { content: ''; position: absolute; inset: 0; border-radius: inherit; padding: 1.25px; pointer-events: none;
  background: linear-gradient(155deg, rgba(255, 255, 255, .75) 0%, rgba(255, 255, 255, .12) 18%, rgba(255, 255, 255, 0) 42%, rgba(var(--cyan-rgb), 0) 64%, rgba(var(--cyan-rgb), .55) 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); mask-composite: exclude; }
/* phone side buttons */
.th-work__btns { position: absolute; inset: 0; pointer-events: none; opacity: calc(1 - var(--k) * 4); }
.th-work__btns::before, .th-work__btns::after { content: ''; position: absolute; width: 3px; background: linear-gradient(90deg, #171b23, #3b4251); }
.th-work__btns::before { left: -3px; top: 18%; height: 6.5%; border-radius: 3px 0 0 3px; box-shadow: 0 calc(var(--ph) * .09) 0 #2b313d, 0 calc(var(--ph) * -.07) 0 -1px #2b313d; }
.th-work__btns::after { right: -3px; top: 26%; height: 10.5%; border-radius: 0 3px 3px 0; background: linear-gradient(270deg, #171b23, #3b4251); }

/* clip-path as well as overflow: Safari doesn't always clip transformed children to a rounded overflow box */
.th-work__screen { position: relative; isolation: isolate; width: 100%; height: 100%; overflow: hidden; border-radius: var(--srt) var(--srt) var(--srb) var(--srb); clip-path: inset(0 round var(--srt) var(--srt) var(--srb) var(--srb)); background: #04060a; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .8); }
.th-work__island { position: absolute; left: 50%; z-index: 3; transform: translateX(-50%);
  top: calc(var(--pw) * .028 * var(--ik));
  width: calc(var(--pw) * .29 * var(--ik) + var(--lw) * .12 * var(--k));
  height: calc(var(--pw) * .075 * var(--ik) + var(--lw) * .022 * var(--k));
  border-radius: calc(var(--pw) * .0375 * var(--ik)) calc(var(--pw) * .0375 * var(--ik)) calc(var(--pw) * .0375 * var(--ik) + var(--lw) * .009 * var(--k)) calc(var(--pw) * .0375 * var(--ik) + var(--lw) * .009 * var(--k));
  background: #000; }
.th-work__island::after { content: ''; position: absolute; top: 50%; left: calc(76% * var(--ik) + 50% * var(--k)); width: calc(var(--pw) * .03 * var(--ik) + var(--lw) * .008 * var(--k)); aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 50%; background: radial-gradient(circle at 35% 35%, #2b3a5c, #0a0f1c 60%); }
.th-work__glare { position: absolute; inset: 0; z-index: 4; pointer-events: none; background: linear-gradient(118deg, rgba(255, 255, 255, .085) 0%, rgba(255, 255, 255, .02) 24%, rgba(255, 255, 255, 0) 40%); }

/* laptop deck */
.th-work__base { --b: clamp(0, calc((var(--k) - .55) * 2.3), 1); position: absolute; left: 50%; top: calc(100% - 1px); width: calc(var(--lw) * 1.1); height: calc(var(--lw) * .032); opacity: var(--b); transform: translateX(-50%) scaleX(calc(.9 + .1 * var(--b))); pointer-events: none;
  border-radius: 2px 2px calc(var(--lw) * .05) calc(var(--lw) * .05) / 2px 2px calc(var(--lw) * .03) calc(var(--lw) * .03);
  background: linear-gradient(180deg, #4a5262 0%, #262c38 30%, #141820 70%, #0b0e13 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .28), 0 24px 40px -18px rgba(0, 0, 0, .9); }
.th-work__base::before { content: ''; position: absolute; left: 50%; top: 0; width: 15%; height: 38%; transform: translateX(-50%); border-radius: 0 0 6px 6px; background: rgba(0, 0, 0, .45); box-shadow: inset 0 -1px 0 rgba(255, 255, 255, .08); }

/* scenes: one per screen, stacked; the current one is shown. Each is a size container. In laptop mode the screens
   sit below the notch strip, as a full-screen app does on a MacBook. */
.th-work__scene { position: absolute; inset: calc(var(--lw) * .026 * var(--k)) 0 0; container-type: size; overflow: hidden; opacity: 0; visibility: hidden; transform: scale(.98);
  transition: opacity .42s var(--ease-out), transform .42s var(--ease-out), visibility 0s linear .42s; }
.th-work__scene.is-current { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
.th-work__device.is-morph .th-work__scene { transition-duration: .18s, .18s, 0s; }
.th-work__device.is-morph .th-work__scene:not(.is-current) { transition-delay: 0s, 0s, .18s; }

/* Video (was showcase-video.css): the poster (frame 0) under the <video>, hidden until showcase-video.js marks the
   section (without JS, browsers force native controls onto a <video>). The device takes focus: its ring is the frame's. */
.th-work__poster, .th-work__video { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; margin: 0; object-fit: cover; object-position: 50% 50%; }
.th-work__poster { display: block; }
.th-work__video { display: none; background: transparent; }
.th-work[data-th-video] .th-work__video { display: block; }
.th-work__device:focus { outline: none; }
.th-work__device:focus-visible .th-work__frame { outline: 2px solid var(--cyan); outline-offset: 6px; }

/* Architecture: the case study's own drawing (styled by its attributes) and the trace's states (showcase-video.js,
   2026-11-28). While a trace runs ([data-trace]) the drawing rests dim but readable; the parts the dot has reached stay
   softly lit (.is-on), the one it has just reached in full (.is-now); the edge it runs is drawn lit behind it (.lt), and
   the edges it has run stay lit, their dashes flowing the way the arrows point. The trail fades back to the rest at the
   end of a lap (.is-fading): nothing ever lights all at once. */
.th-work__arch { position: absolute; inset: 0; width: 100%; height: 100%; background: #090f20; }
.th-work__arch .n, .th-work__arch .e, .th-work__arch .f { transition: opacity .45s ease; }
.th-work__arch .b { transition: fill .45s ease, stroke .45s ease; }
.th-work__arch[data-trace] .n { opacity: .55; }
.th-work__arch[data-trace] .e { opacity: .42; }
.th-work__arch .n.is-on, .th-work__arch .e.is-on, .th-work__arch .e.is-go { opacity: 1; }
.th-work__arch .is-on .b { fill: rgba(var(--ar), .07); stroke: rgba(var(--ar), .6); }
.th-work__arch .is-now .b { fill: rgba(var(--ar), .17); stroke: var(--a); }
.th-work__arch .lt { fill: none; stroke: var(--a); stroke-width: 2.2; opacity: 0; }
.th-work__arch .is-go .lt, .th-work__arch .is-on .lt { opacity: 1; }
.th-work__arch.is-fading .n, .th-work__arch.is-fading .e, .th-work__arch.is-fading .f, .th-work__arch.is-fading .lt { transition: opacity .9s ease; }
.th-work__arch.is-fading .b { transition: fill .9s ease, stroke .9s ease; }
.th-work__arch .f { opacity: 0; }
.th-work__arch.is-live .e.is-on .f { opacity: .75; stroke: rgba(255, 255, 255, .9); animation: thWorkFlow 1.6s linear infinite; }
/* as the trail fades, its dashes go on flowing, white, and fade with it (review 2026-11-29: they snapped to the edge's
   colour and stopped on the fade's first frame) */
.th-work__arch.is-live.is-fading .e .f { stroke: rgba(255, 255, 255, .9); animation: thWorkFlow 1.6s linear infinite; }
@keyframes thWorkFlow { to { stroke-dashoffset: -34; } }
/* the ring a part sends out as the dot reaches it */
.th-work__arch .rg { fill: none; stroke: var(--a); stroke-width: 2; opacity: 0; transform-box: fill-box; transform-origin: center; pointer-events: none; }
.th-work__arch .is-ping-a .rg { animation: thWorkRingA .8s ease-out; }
.th-work__arch .is-ping-b .rg { animation: thWorkRingB .8s ease-out; }
@keyframes thWorkRingA { from { opacity: .9; transform: none; } to { opacity: 0; transform: scale(1.09, 1.14); } }
@keyframes thWorkRingB { from { opacity: .9; transform: none; } to { opacity: 0; transform: scale(1.09, 1.14); } }
/* the dot: placed and faded frame by frame */
.th-work__arch .tr { opacity: 0; pointer-events: none; }
.th-work__arch.is-live .tr { filter: drop-shadow(0 0 8px rgba(var(--ar), .95)); }
/* a part pointed at (or picked with the arrow keys): it and its edges in full, a white outline; the trace runs on */
.th-work__arch .n.is-pick, .th-work__arch .e.is-near { opacity: 1; }
.th-work__arch .is-pick .b { fill: rgba(255, 255, 255, .08); stroke: rgba(255, 255, 255, .85); }
/* the panel's text fades in when it names another part */
.th-work__arch.is-cap-a .pn text { animation: thWorkCapA .35s ease-out; }
.th-work__arch.is-cap-b .pn text { animation: thWorkCapB .35s ease-out; }
@keyframes thWorkCapA { from { opacity: 0; } }
@keyframes thWorkCapB { from { opacity: 0; } }
/* at the end of a lap the panel's name dims with the trail, unless it names a part pointed at or picked (.is-picking);
   the next lap's entry name then fades in (review 2026-11-29: it stayed bright, naming a part no longer lit) */
.th-work__arch.is-fading:not(.is-picking) .pn text { opacity: .5; transition: opacity .9s ease; }
/* held (keyboard focus, or a click or tap): everything stops where it is */
.th-work__arch.is-held .f, .th-work__arch.is-held .rg { animation-play-state: paused; }   /* not the panel's fade: it answers a pointer or a key */
/* the panel: the figure's own (kicker and part name) with its foundation line; on phones the same panel twice the size */
.th-work__arch .pn--sm { display: none; }

/* Rebuilt in code: the shared host scales each page into its box, display-only (no "Try it" here). A box is its
   page's shape (--r) at the screen's width, from the top: the feed runs past the bottom, the forecast leaves a strip
   that continues its own columns. */
.th-work__rb { position: absolute; left: 0; top: 0; width: 100%; aspect-ratio: var(--r); }
.th-work .rb-try { display: none; }
/* a hidden scene's page stops drawing once its fade is over (the forecast's loop then pauses itself, in any browser) */
.th-work__scene:not(.is-current) .rb-frame { display: none; transition: display 0s .42s; transition-behavior: allow-discrete; }
.th-work__scene--feed { background: #141919; }
.th-work__scene--qs:has(.is-loaded) { background: linear-gradient(90deg, #fff 5.7%, #ddd 0 5.8%, #fff 0 25.1%, #ddd 0 25.2%, #f5f5f5 0); }
/* in the phone: below the status bar (47 of 846px, clear of the island) */
.th-work__rb--phone { top: calc(100cqw * 47 / 390); }
.th-work__scene[data-bp="sm"] { display: none; }
/* phones (the owner's mobile decision 4): The Capital in the phone; the forecast framed to its chart (x 396-1149,
   y 146-614 of 1280 x 627) */
@media (max-width: 640px) {
  .th-work__arch .pn--lg, .th-work__arch .fd { display: none; }
  .th-work__arch .pn--sm { display: inline; }
  .th-work__scene[data-bp="sm"] { display: block; }
  .th-work__scene[data-bp="lg"] { display: none; }
  .th-work__scene--qs .th-work__rb { --u: min(100cqw / 753, 100cqh / 468); width: calc(1280 * var(--u)); height: calc(627 * var(--u)); left: calc(50cqw - 772.5 * var(--u)); top: calc(50cqh - 380 * var(--u)); }
}

/* progress segments + what the screen is: a plain caption under the device (no pill, no dot) */
.th-work__segs { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; width: min(100%, 560px); }   /* 560: set for "Computer Vision" on one line (2026-11-28); the tab reads "AI/ML" since 2026-11-29 */
.th-work__seg { display: block; min-width: 0; padding: 2px 0; overflow: hidden; text-wrap: balance; text-decoration: none; font: 500 13px/1.2 var(--f-body); color: var(--text-3); transition: color .3s ease; }
.th-work__seg:hover, .th-work__seg[aria-current] { color: var(--text); }
.th-work__track { display: block; height: 2px; margin-bottom: 9px; overflow: hidden; border-radius: 2px; background: var(--line-2); }
.th-work__fill { display: block; height: 100%; background: var(--text-2); transform: scaleX(0); transform-origin: 0 50%; }
.th-work__pill { position: relative; z-index: 1; margin: 0; font: 400 13px/1.3 var(--f-body); color: var(--text-3); }
.th-work__pill.is-held::after { content: " · Paused"; }   /* the clip or the trace is held (showcase-video.js) */

/* ---------- tail ---------- */
.th-work__tail { position: relative; padding: 40px 0 clamp(80px, 9vw, 128px); }

/* 2026-11-27 mobile pass S2, S3 */
@media (max-width: 960px) {
  .th-work__head { padding-top: clamp(56px, 8.5vw, 80px); }
  .th-work__ctx { text-wrap: pretty; }
  .th-work__client { text-wrap: balance; }
}
/* ---------- stacked layout (tablets, phones): the stage pins at the top, each chapter card pins under it ---------- */
@media (max-width: 900px) {
  /* 2026-11-27 mobile pass W1 (a smaller band, a solid one, no empty room, a clean end), S4, S5 */
  .th-work { --stage-h: clamp(240px, 44vh, 470px); }
  @supports (height: 1svh) { .th-work { --stage-h: clamp(240px, 44svh, 470px); } }
  .th-work__head { padding-bottom: 28px; }
  .th-work__grid { display: flex; flex-direction: column; }
  .th-work__stagecol { order: -1; position: sticky; top: var(--work-top); z-index: 2; flex: none; height: var(--stage-h); margin: 0 calc(-1 * var(--gutter)); padding: 0 var(--gutter); background: var(--bg); }
  .th-work__stagecol::after { content: ''; position: absolute; left: 0; right: 0; top: 100%; height: 18px; background: linear-gradient(180deg, var(--bg), rgba(6, 11, 24, 0)); pointer-events: none; }
  .th-work__stage { position: relative; top: auto; height: 100%; min-height: 0; gap: 10px; padding: 6px 0 22px; }
  .th-work__aura { width: 130%; height: 130%; top: 44%; }
  .th-work__device { flex: 1 1 auto; height: auto; min-height: 0; }
  .th-work__frame { --lw: min(86cqw, 140cqh); }
  .th-work__segs { gap: 8px; width: min(100%, 420px); }
  .th-work__seg { padding: 12px 0 10px; margin: -12px 0 -10px; font-size: 12px; }   /* 44px (2026-11-27 mobile pass S4) */
  .th-work__track { margin-bottom: 7px; }
  .th-work__pill { font-size: 12px; }
  .th-work__chapters { padding-bottom: 0; margin-bottom: calc(-1 * var(--end, 0px)); }   /* --end: showcase.js */
  .th-work__ch { display: block; min-height: 86vh; min-height: 86svh; padding-top: 10px; scroll-margin-top: var(--stage-h); }
  .th-work:not(.th-work--pin) .th-work__ch { min-height: 0; padding-top: 16px; }
  /* a link focused with Tab or Shift+Tab stops below the sticky device and its segment bar, not under them */
  .th-work__ch a { scroll-margin-top: calc(var(--stage-h) + 8px); }
  .th-work__ch-in { position: relative; max-width: none; padding: 18px 0 20px; border-top: 1px solid var(--line); background: var(--bg); }
  /* showcase.js adds --pin only when every card fits under the pinned device (measured against 100svh) */
  .th-work--pin .th-work__ch-in { position: sticky; top: calc(var(--work-top) + var(--stage-h) + 4px); }
  .th-work__meta { margin-bottom: 8px; font-size: 11.5px; }
  .th-work__client { margin-bottom: 8px; font-size: 15px; }
  .th-work__out { margin-bottom: 10px; font-size: clamp(26px, 7.4vw, 32px); }
  .th-work__ctx { margin-bottom: 14px; font-size: 15.5px; line-height: 1.5; }
  /* v2 review: the 3-5 chips wrap (no clipped "FFmpe..." under the line in the right margin) */
  .th-work__stack { flex-wrap: wrap; gap: 10px 16px; margin: 0 0 16px; }
  .th-work__chip { gap: 7px; font-size: 13px; }
  .th-work__ic { width: 22px; height: 22px; }
  .th-work__ic--tile { padding: 5px; border-radius: 6px; }
  .th-work__ic--mono { font-size: 6.5px; border-radius: 6px; }
  .th-work__link { position: relative; padding: 6px 0 7px; font-size: 14.5px; }
  .th-work__link::after { content: ''; position: absolute; inset: -8px 0; }
  .th-work__tail { padding: calc(var(--end, 0px) + 8px) 0 40px; }
}
/* W3: on phones the laptop is about 12% larger, still inside the gutter */
@media (max-width: 640px) {
  .th-work__frame { --lw: min(96cqw, 150cqh); }
  .th-work__segs { gap: 6px; width: 100%; }
  .th-work__seg { font-size: 11px; }
}
/* H4: landscape phones scroll the device away with the cards */
@media (max-width: 900px) and (max-height: 500px) {
  .th-work__stagecol { position: relative; top: auto; }
}
/* engines without container query units: fixed device sizes (the morph still works) */
@supports not (width: 1cqh) {
  .th-work__frame { --pw: 290px; --lw: 500px; }
  @media (max-width: 900px) { .th-work__frame { --pw: 150px; --lw: 300px; } }
}
@media (max-width: 380px) {
  .th-work__chip { font-size: 12px; }
  .th-work__segs { gap: 5px; }
  .th-work__seg { letter-spacing: -.02em; }   /* tighter at 360px; a long name wraps to two lines */
}

@media (prefers-reduced-motion: reduce) {
  .th-work__scene, .th-work__glow, .th-work--js .th-work__ch-in, .th-work__arrow, .th-work__seg, .th-work__link, .th-work__arch * { transition: none !important; }
  .th-work__arch * { animation: none !important; }
  .th-work__scene { transform: none; }
}

/* Without JavaScript (2026-11-27 page review): no device column (it needs the script to change screens); each chapter
   shows its own still, a <noscript> image (never fetched with JS on), decided before first paint. */
.th-work__still { display: block; width: 100%; max-width: 560px; height: auto; margin: 22px 0 0; border: 1px solid var(--line-2); border-radius: 12px; background: var(--bg-2); }
.th-work__still--phone { max-width: 200px; border-radius: 22px; }
@media (scripting: none) {
  .th-work__grid { grid-template-columns: minmax(0, 1fr); }
  .th-work__stagecol { display: none; }
  .th-work__chapters { padding-bottom: 0; }
  .th-work__ch { min-height: 0; padding: 40px 0; }
}

/* BEGIN brand colour (v3/cta-card/core/tools/showcase-brand.mjs) */
/* brand marks on their own colour, as on the case studies (2026-11-27; icons/README.md "Brand colour") */
.th-work__ic--brand { padding: 5px; border-radius: 6px; background: var(--ic); object-fit: contain; }
.th-work__ic--edge { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .24); }
.th-work__ic--badge { padding: 0; border-radius: 0; background: none; }
.th-work__ic--round { border-radius: 6px; }
/* END brand colour */
