    /* Thumbnail-wall gallery, built like a phone photo library: tight gutters,
       no labels on the cells, every fact living in the card that opens on tap.

       Unlike a phone's square-crop grid, each thumbnail keeps its native
       aspect ratio — 16:9 visualizers stay wide, 9:16 reels stay tall, the
       square stings stay square. Nothing is cropped. The layout is a masonry
       wall: a small packer places each tile in the shortest gap that fits it,
       choosing tiles out of sequence when that keeps the columns level. */

    :root {
      --bg: #000;
      --fg: #fff;
      --muted: #9c9c9c;
      --line: rgba(255, 255, 255, 0.14);
      --pad: clamp(20px, 2.75vw, 38px);
      --font: "Archivo", "Helvetica Neue", Arial, sans-serif;
      --display: "Public Sans", "Archivo", "Helvetica Neue", Arial, sans-serif;
      --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
      --gutter: 8px;
    }

    * { margin: 0; padding: 0; box-sizing: border-box; }
    html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

    body {
      background: var(--bg);
      color: var(--fg);
      font-family: var(--font);
      font-size: 16px;
      line-height: 1.5;
      -webkit-font-smoothing: antialiased;
      overflow-x: hidden;
    }

    ::selection { background: var(--fg); color: var(--bg); }

    :focus-visible { outline: 2px solid var(--fg); outline-offset: 4px; }

    /* ---------- Nav ----------
       Same fixed glass pill as the main site: the header markup, the styles
       below, and the vendored liquid-glass bundle are shared verbatim, so the
       nav behaves identically here. Only the link targets differ, because
       those sections live on index.html. */

    .skip-link {
      position: absolute;
      left: var(--pad);
      top: -64px;
      z-index: 200;
      background: var(--fg);
      color: var(--bg);
      padding: 10px 16px;
      font-size: 13px;
      font-weight: 600;
      letter-spacing: 0.03em;
      transition: top 0.25s ease;
    }

    .skip-link:focus-visible { top: 14px; outline: none; }

    .site-header {
      position: fixed;
      inset: 0 0 auto 0;
      z-index: 100;
      display: flex;
      justify-content: center;
      padding: 22px var(--pad);
      transition: background 0.35s ease, border-color 0.35s ease, padding 0.35s ease;
      border-bottom: 1px solid transparent;
    }

    .site-header.scrolled {
      background: rgba(0, 0, 0, 0.78);
      -webkit-backdrop-filter: blur(14px);
      backdrop-filter: blur(14px);
      border-bottom-color: var(--line);
      padding-top: 14px;
      padding-bottom: 14px;
    }

    /* The glass samples its backdrop, so the header's own translucent bar has
       to go or it flattens the refraction into a grey slab. */
    .site-header.liquid.scrolled {
      background: transparent;
      -webkit-backdrop-filter: none;
      backdrop-filter: none;
      border-bottom-color: transparent;
    }

    #liquidNavMount {
      position: absolute;
      top: 42.5px;   /* header padding 22 + half-pill 20.5 */
      left: 50%;
    }
    #liquidNavMount > *:not(.liquid-nav) {
      position: absolute !important;
      pointer-events: none !important;
      top: 0 !important;
      left: 0 !important;
    }
    #liquidNavMount .liquid-nav { pointer-events: auto; }
    .site-header.scrolled #liquidNavMount { top: 34.5px; }

    /* This page is near-black throughout, so the glass needs a tint to read as
       glass at all: backdrop-filter has nothing to blur over flat black. */
    .liquid-nav .glass {
      background: rgba(255, 255, 255, 0.1) !important;
    }

    .nav {
      display: flex;
      gap: clamp(20px, 3.2vw, 44px);
    }

    .nav-link {
      font-size: 13px;
      font-weight: 500;
      letter-spacing: 0.05em;
      opacity: 0.75;
      padding: 4px 2px;
      position: relative;
      transition: opacity 0.25s ease;
      color: inherit;
      text-decoration: none;
    }

    .nav-link::after {
      content: "";
      position: absolute;
      left: 0;
      right: 0;
      bottom: -2px;
      height: 1px;
      background: var(--fg);
      transform: scaleX(0);
      transform-origin: left;
      transition: transform 0.3s var(--ease-out);
    }

    .nav-link:hover,
    .nav-link.is-active { opacity: 1; }
    .nav-link:hover::after { transform: scaleX(1); }

    /* ---------- Page header ---------- */

    .demo-header {
      display: flex;
      align-items: flex-end;
      justify-content: space-between;
      gap: 24px;
      flex-wrap: wrap;
      max-width: 1560px;
      margin: 0 auto;
      /* Top padding clears the fixed nav pill. */
      padding: clamp(112px, 12vw, 168px) var(--pad) clamp(26px, 3.4vw, 44px);
      border-bottom: 1px solid var(--line);
    }

    /* Same optical nudge as .hero-title on the main site: Public Sans caps
       carry a side bearing that reads as an indent at display sizes. */
    .demo-title {
      margin-left: -0.0675em;
      font-family: var(--display);
      font-weight: 900;
      font-size: clamp(3.4rem, 7.5vw, 6.5rem);
      letter-spacing: -0.03em;
      line-height: 0.92;
    }

    .demo-kicker {
      font-size: clamp(0.8rem, 1vw, 0.92rem);
      font-weight: 500;
      color: var(--muted);
      letter-spacing: 0.02em;
      text-align: right;
      line-height: 1.6;
    }

    /* ---------- Wall ---------- */

    .gallery-container {
      max-width: 1560px;
      margin: 0 auto;
      padding: clamp(28px, 3.5vw, 48px) var(--pad) 0;
    }

    .wall { position: relative; }

    /* Positioning is switched on by JS once it has measured the wall. Without
       JS the tiles simply stack, so the page still reads. */
    .wall.is-masonry .wall-item {
      position: absolute;
      top: 0;
      left: 0;
    }

    .wall:not(.is-masonry) .wall-item { margin-bottom: var(--gutter); }

    .wall-item {
      display: block;
      padding: 0;
      border: 0;
      background: none;
      color: inherit;
      font: inherit;
      text-align: left;
      cursor: pointer;
    }

    /* The tile box is sized by JS to the media's true ratio, so the poster
       fills it exactly and object-fit never has to crop. */
    .work-media {
      position: relative;
      display: block;
      width: 100%;
      height: 100%;
      overflow: hidden;
      background: #0c0c0c;
    }

    .work-media img,
    .work-media video {
      position: absolute;
      inset: 0;
      width: 100%;
      height: 100%;
      object-fit: cover;
      display: block;
      transition: transform 0.9s var(--ease-out), opacity 0.4s ease, filter 0.5s ease;
    }

    /* The hover loop sits above the poster and fades in once it can play. */
    .work-media video {
      opacity: 0;
      pointer-events: none;
    }

    .wall-item.is-playing .work-media video { opacity: 1; }

    .wall-item:hover .work-media img,
    .wall-item:focus-visible .work-media img {
      transform: scale(1.045);
      filter: brightness(1.06);
    }

    /* ---------- Detail card ---------- */

    .detail {
      position: fixed;
      inset: 0;
      z-index: 500;
      display: none;
      place-items: center;
      padding: clamp(14px, 3vw, 40px);
      background: rgba(0, 0, 0, 0.9);
      -webkit-backdrop-filter: blur(18px);
      backdrop-filter: blur(18px);
      overflow-y: auto;
      overscroll-behavior: contain;
    }

    .detail.is-open { display: grid; }

    .detail-card {
      position: relative;
      /* Never derive this from viewport height: short landscape screens make
         that calculation negative and collapse the entire card. */
      width: min(1080px, 100%);
      max-height: calc(100dvh - 2 * clamp(14px, 3vw, 40px));
      display: flex;
      flex-direction: column;
      background: #0a0a0a;
      border: 1px solid var(--line);
    }

    /* Portrait cuts put the credit sheet BESIDE the video instead of under it.
       A 9:16 frame is tall and narrow, so stacking the text below forces a
       short, scrolling column; a side pane gives the description a readable
       measure and lets the whole card sit in one screen. Landscape, square and
       still cards keep the stacked layout. */
    .detail-card.is-portrait {
      flex-direction: row;
      align-items: stretch;
      width: min(920px, 100%);
      /* A percentage height on the video needs a resolved card height, so the
         card is explicitly as tall as the viewport allows. */
      height: min(calc(100dvh - 2 * clamp(14px, 3vw, 40px)), 640px);
      max-height: calc(100dvh - 2 * clamp(14px, 3vw, 40px));
    }

    .detail-card.is-portrait .detail-video {
      aspect-ratio: 9 / 16;
      width: auto;
      height: 100%;
      flex: 0 0 auto;
    }

    .detail-card.is-portrait .detail-body {
      /* The pane is the scroll container in this mode. */
      flex: 1 1 auto;
      min-width: 0;
      display: flex;
      flex-direction: column;
      justify-content: center;
      /* Room for the close button, which overlays the top-right of the card. */
      padding-top: clamp(56px, 5vw, 68px);
    }

    /* In row mode the close button lands on the text pane, where it reads as
       part of the copy. Anchor it to the video's top-right instead. */
    .detail-card.is-portrait .detail-close {
      right: auto;
      left: calc(100% - 50px);
    }

    /* Landscape phones still need a useful video and a scrollable credit
       sheet. The card can exceed the viewport, but its media cannot. */
    @media (max-height: 600px) and (min-width: 761px) {
      .detail { place-items: start center; }
      .detail-card:not(.is-portrait) { max-height: none; }
      .detail-card:not(.is-portrait) .detail-video {
        max-height: calc(100dvh - 110px);
        object-fit: contain;
      }
    }

    /* Too narrow for two columns: fall back to the stacked layout. */
    @media (max-width: 760px) {
      .detail-card.is-portrait {
        flex-direction: column;
        width: min(420px, 100%);
        height: calc(100dvh - 2 * clamp(14px, 3vw, 40px));
      }
      .detail-card.is-portrait .detail-video {
        align-self: center;
        width: auto;
        max-width: 100%;
        height: min(60dvh, 640px);
      }
      .detail-card.is-portrait .detail-body {
        flex: 1 1 auto;
        justify-content: flex-start;
        overflow-y: auto;
      }
    }

    /* Stage content is 8:3 (2048x768), far wider than 16:9. Without its own
       rule the video would letterbox inside a 16:9 box with big empty bars. */
    .detail-card.is-ultrawide { width: min(1280px, 100%); }
    .detail-card.is-ultrawide .detail-video { aspect-ratio: 8 / 3; }

    .detail-card.is-square { width: min(680px, 100%); }

    .detail-card.is-square .detail-video { aspect-ratio: 1 / 1; }

    /* A still image opens at its own ratio, no video element at all. */
    .detail-card.is-still { width: min(760px, 100%); }

    .detail-card.is-still .detail-video { display: none; }

    .detail-image {
      display: block;
      width: 100%;
      height: auto;
      max-height: 62dvh;
      object-fit: contain;
      background: #000;
      flex: 0 0 auto;
    }

    .detail-image[hidden] { display: none; }

    .detail-video {
      display: block;
      width: 100%;
      height: auto;
      aspect-ratio: 16 / 9;
      background: #000;
      flex: 0 0 auto;
    }

    .detail-body {
      padding: clamp(20px, 2.6vw, 34px);
      overflow-y: auto;
      overscroll-behavior: contain;
      min-height: 0;
    }

    .detail-eyebrow {
      display: flex;
      align-items: baseline;
      gap: 8px;
      margin-bottom: 12px;
    }

    .detail-num {
      font-family: var(--display);
      font-weight: 900;
      font-size: clamp(1.2rem, 1.7vw, 1.55rem);
      line-height: 1;
      letter-spacing: -0.02em;
    }

    .detail-count {
      font-size: 12px;
      font-weight: 600;
      color: var(--muted);
      letter-spacing: 0.06em;
    }

    .detail-year {
      margin-left: auto;
      font-size: 12px;
      font-weight: 600;
      letter-spacing: 0.12em;
      text-transform: uppercase;
      color: var(--muted);
    }

    .detail-title {
      font-family: var(--display);
      font-weight: 900;
      font-size: clamp(1.5rem, 2.8vw, 2.2rem);
      letter-spacing: -0.025em;
      line-height: 1.05;
      margin-left: -0.0675em;
    }

    .detail-desc {
      margin-top: 14px;
      max-width: 62ch;
      font-size: clamp(0.92rem, 1.1vw, 1rem);
      line-height: 1.65;
      color: var(--muted);
      white-space: pre-line;
    }

    /* Tags as a plain text row, not pill chips: closer to a credit sheet. */
    .detail-tags {
      margin-top: 20px;
      list-style: none;
      padding: 0;
      font-size: 11.5px;
      font-weight: 600;
      letter-spacing: 0.06em;
      text-transform: uppercase;
      color: var(--fg);
      opacity: 0.85;
    }

    .detail-tags li { display: inline; }
    .detail-tags li:not(:last-child)::after { content: "·"; margin: 0 0.6em; color: var(--muted); }

    .detail-credits {
      margin-top: 18px;
      padding-top: 14px;
      border-top: 1px solid var(--line);
      font-size: 12px;
      line-height: 1.7;
      letter-spacing: 0.015em;
      color: var(--muted);
    }

    .detail-credit-row { display: block; }

    .detail-close {
      position: absolute;
      top: 12px;
      right: 12px;
      z-index: 3;
      background: rgba(0, 0, 0, 0.6);
      -webkit-backdrop-filter: blur(8px);
      backdrop-filter: blur(8px);
      border: 1px solid rgba(255, 255, 255, 0.35);
      border-radius: 50%;
      width: 44px;
      height: 44px;
      color: var(--fg);
      font-family: var(--font);
      font-size: 18px;
      line-height: 1;
      cursor: pointer;
      transition: background 0.25s ease, border-color 0.25s ease;
    }

    .detail-close:hover {
      background: rgba(255, 255, 255, 0.16);
      border-color: var(--fg);
    }

    /* ---------- Footer ---------- */

    .demo-footer {
      max-width: 1560px;
      margin: clamp(48px, 6vw, 80px) auto 0;
      padding: clamp(28px, 3vw, 40px) var(--pad);
      border-top: 1px solid var(--line);
      display: flex;
      justify-content: flex-end;
      font-size: 12px;
      color: var(--muted);
      letter-spacing: 0.015em;
    }

    .demo-footer a {
      display: inline-flex;
      align-items: center;
      min-height: 44px;
      color: var(--fg);
      text-decoration: underline;
      text-underline-offset: 3px;
    }

    /* ---------- Reveal ----------
       Opacity only. The packer owns each tile's transform, so a translateY
       reveal would fight the positioning. */
    .wall-item[data-reveal] {
      opacity: 0;
      transition: opacity 0.6s ease;
    }

    .wall-item[data-reveal].in-view { opacity: 1; }

    /* ---------- Responsive ---------- */

    @media (max-width: 900px) {
      .demo-kicker { text-align: left; }
    }

    @media (max-width: 760px), (pointer: coarse) {
      .wall-item[data-reveal] { opacity: 1; transition: none; }
    }

    @media (max-width: 760px), (pointer: coarse) {
      .nav-link {
        display: inline-flex;
        align-items: center;
        min-height: 44px;
        padding: 10px 4px;
        font-size: 12.5px;
      }
    }

    @media (max-width: 420px) {
      .nav { gap: 12px; }
      .nav-link { font-size: 12px; }
    }

    @media (prefers-reduced-motion: reduce) {
      html { scroll-behavior: auto; }
      .wall-item[data-reveal] { opacity: 1; transition: none; }
      .work-media img,
      .work-media video { transition: none; }
      .wall-item:hover .work-media img { transform: none; }
    }
