.filmstrip {
  --frame-min: calc(20rem + 200px);
  --frame-max: 56svh;
  --section-gap: clamp(24px, 6svh, 76px);
  --frame: clamp(var(--frame-min), calc(100svh - var(--edge) - var(--section-gap) - var(--gallery-surround, 0px)), var(--frame-max));
  --frame-radius: 1.5rem;
  --edge: clamp(20px, 3.125vw, 56px);
  --gutter: 16px;
  --gallery-muted: light-dark(#64645f, var(--muted));
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 100svh;
  gap: var(--section-gap);
  padding-top: var(--edge);
  font-size: calc(var(--text-base) - 2px);
  line-height: var(--leading-base);
}
.filmstrip-intro {
  display: grid;
  grid-template-rows: 0fr;
  max-width: 56ch;
  margin-inline: var(--edge);
}
.intro-portrait-slot {
  overflow: hidden;
  visibility: hidden;
  opacity: 0;
  transform: translateY(-12px);
}
.intro-portrait {
  display: block;
  border-radius: 50%;
  margin-bottom: var(--space-8);
}
@media (min-height: 1000px) {
  .filmstrip-intro { grid-template-rows: 1fr; }
  .intro-portrait-slot { visibility: visible; opacity: 1; transform: none; }
}
@media screen and (prefers-reduced-motion: no-preference) {
  .filmstrip-intro { transition: grid-template-rows 240ms cubic-bezier(.22, .8, .24, 1); }
  .intro-portrait-slot {
    transition: transform 240ms cubic-bezier(.22, .8, .24, 1), opacity 180ms ease-out, visibility 240ms;
  }
}
.filmstrip-intro .headline-text {
  font: inherit;
  color: inherit;
  letter-spacing: inherit;
  font-feature-settings: inherit;
}
.filmstrip-bio p { margin: var(--space-3) 0 0; }
.personal a { display: inline-flex; align-items: center; min-height: 44px; }

.filters {
  display: flex;
  gap: .75rem;
  font-weight: 400;
  margin: 0 var(--edge);
  padding: 0;
  min-width: 0;
  border: 0;
}
.filters label {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: light-dark(#737373, var(--muted));
  cursor: pointer;
}
.filters input { position: absolute; inset: 0 -.25rem; margin: 0; opacity: 0; width: calc(100% + .5rem); height: 100%; cursor: pointer; }
.filters input:checked + span { color: var(--ink); }
.filters input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 4px; }
:root, .strip {
  scrollbar-width: thin;
  scrollbar-color: var(--hairline) var(--surface);
}
.strip {
  display: flex;
  align-items: start;
  gap: var(--gutter);
  overflow: auto hidden;
  padding-block: .25rem var(--space-4);
  padding-inline: var(--edge);
  scroll-padding-inline: var(--edge);
  overscroll-behavior-x: contain;
  overflow-anchor: none;
}
.strip:focus-visible { outline: 2px solid var(--ink); outline-offset: -2px; }
.artifact { position: relative; min-width: 0; margin: 0; }
@media screen and (prefers-reduced-motion: no-preference) {
  body:not([data-drawing]) .artifact[data-awaiting-entry] { opacity: 0; }
}
.strip .artifact {
  --mat-y: calc(var(--frame) * .0484);
  --mat-x: calc(var(--frame) * .0645);
  --art-height: calc(var(--frame) - 2 * var(--mat-y));
  flex: 0 0 calc(var(--art-height) * var(--art-w) / var(--art-h) + 2 * var(--mat-x));
}
.strip .phone { --art-w: 1020; --art-h: 2139; }
.mount {
  position: relative;
  display: grid;
  grid-template: minmax(0, 1fr) / minmax(0, 1fr);
  place-items: center;
  isolation: isolate;
  overflow: hidden;
  border-radius: var(--frame-radius);
  background: light-dark(#efefee, #181818);
  box-shadow: var(--card-ring);
}
.strip .mount { height: var(--frame); padding: var(--mat-y) var(--mat-x); }
.capture, .player, .player video { width: 100%; height: 100%; min-height: 0; display: block; object-fit: contain; }
#work-bitgo .mount { padding-bottom: 0; }
#work-bitgo .capture {
  object-fit: cover;
  object-position: top;
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}
.strip .artifact:not(.phone) {
  container-type: inline-size;
  --mat-y: calc(var(--frame) * .092);
  /* The screen spans 22 of the case-study frame’s 24 columns. */
  --mat-x: max(.75rem, calc(var(--art-height) * var(--art-w) / var(--art-h) / 22));

  /* Match the case-study screenshot panel, scaled to the card width. */
  .screenshot-panel {
    --panel-unit: calc(100cqi / 1344);
  }
}
.strip .artifact.laptop, #osoto-taipei-codex { --mat-x: 0px; --mat-y: 0px; }
#osoto-taipei-codex { max-width: 100%; }
.laptop-screen {
  position: absolute;
  left: 13.9274%;
  top: 28.1016%;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #f9f9f8;
  mix-blend-mode: multiply;
  transform-origin: top left;
  /* Map the screenshot to the four display corners of the 16:10 photograph. */
  transform: perspective(100cqw) matrix3d(
    .576136, -.133158, -.084779, 0,
    .149553, .572878, -.067174, 0,
    0, 0, 1, 0,
    0, 0, 0, 1
  );
}
.player { position: relative; overflow: hidden; }
.strip figcaption {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: .125rem 1rem;
  padding-top: .5rem;
  font-size: var(--text-sm);
  line-height: var(--text-sm--line-height);
  letter-spacing: var(--text-sm--letter-spacing);
}
.caption { color: var(--ink); text-decoration: none; }
.caption strong { font-weight: var(--font-heading-weight); color: var(--ink); margin-right: .12em; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: var(--type-link-offset); }
.caption-label { display: inline-block; }
.strip .caption { color: var(--gallery-muted); }
.artifact .caption::after { content: ""; position: absolute; inset: 0; border-radius: var(--frame-radius); }
.artifact .caption:focus-visible { outline: none; }
.artifact:has(.caption:focus-visible) .mount { outline: 2px solid var(--ink); outline-offset: 2px; }

@media (min-width: 901px) and (hover: hover) and (pointer: fine) {
  .strip .caption-label { opacity: 0; }
  .strip .artifact:is(:hover, :focus-within) .caption-label { opacity: 1; }
  .filmstrip-intro a:hover, .caption:hover strong { text-decoration-thickness: 2px; }
  .filters label:hover { color: var(--gallery-muted); }
}
@media (min-width: 901px) and (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .strip .caption-label {
    transform: translateY(-.5rem);
    transition: opacity 200ms ease-out, transform 200ms ease-out;
  }
  .strip .artifact:is(:hover, :focus-within) .caption-label { transform: none; }
}
@media (hover: none) {
  .strip:not([data-wheel]) { scroll-snap-type: x mandatory; }
  .strip .artifact { scroll-snap-align: start; }
}
@media (max-width: 900px), (hover: none) and (pointer: coarse) {
  .filmstrip { --frame-max: min(60svh, 496px); }
}
@media (max-width: 680px) {
  .filmstrip { --gutter: 12px; }
}
@media (max-height: 52rem), (max-width: 680px) {
  .filmstrip { --section-gap: var(--space-4); }
  .intro-portrait { margin-bottom: var(--space-4); }
  .filmstrip-bio p { margin-top: var(--space-2); }
}
