/* The artwork is already visible before its first movement. */
.work-art.scroll-study {
  display: grid;
  container-type: size;
  place-items: center;
  overflow: hidden;
}
.scroll-study > .study-window {
  position: relative;
  display: block;
  width: min(100cqw, calc(100cqh * var(--study-ratio)), var(--study-width));
  aspect-ratio: var(--study-ratio);
  transform-origin: var(--study-origin, 50% 50%);
  overflow: hidden;
}
.work-art.scroll-study .study-window img {
  position: absolute;
  display: block;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: contain;
  object-position: center;
  transform: none;
  transition: none;
  border: none;
  border-radius: 0;
}
.work-page > .work-thumbnail > .image-link:has(> .scroll-study) { height: auto; aspect-ratio: auto; }
.work-page .work-thumbnail .scroll-study {
  width: min(100%, var(--study-width));
  margin-inline: auto;
  height: auto;
  aspect-ratio: var(--study-ratio);
  container-type: normal;
}
.work-page .work-thumbnail .scroll-study > .study-window { width: 100%; }
.work-page > .work-thumbnail:has(.scroll-study[data-treatment="poster"]) {
  width: min(100%, var(--poster-width, 480px));
  margin-inline: auto;
}
.work-thumbnail:has([data-study="wired_lighting"]) { --poster-width: 410px; }
.work-thumbnail:has([data-study="tala_nachar_theatre_lighting"]) { --poster-width: 285px; }

[data-study="the_getaway"] { --study-origin: 49% 43%; --study-scale: 1.048; }
[data-study="balles_de_memoires"] { --study-origin: 23% 30%; --study-scale: 1.032; }
[data-study="chicago"] { --study-origin: 58% 68%; --study-scale: 1.036; }
[data-study="in_the_mood_for_love"] { --study-origin: 54% 47%; --study-scale: 1.054; }
[data-study="untitled_pia_maria_el_khoury"] { --study-origin: 63% 69%; --study-scale: 1.035; }
[data-study="alternative_facts_lighting"] { --study-origin: 51% 55%; --study-scale: 1.043; }
[data-study="mabnaa_khat_tamas"] { --study-origin: 48% 38%; --study-scale: 1.045; }
[data-study="passing"] { --study-origin: 42% 59%; --study-scale: 1.043; }
[data-study="rahaf_jammal_art_team_film"] { --study-origin: 47% 51%; --study-scale: 1.046; }
[data-study="loyac_clothing_photoshoot"] { --paper-x: -1.1%; --paper-y: .8%; }
[data-study="salzburg_online"] { --paper-x: 0%; --paper-y: 1.8%; }
[data-study="shafia_wa_elias"] { --paper-x: .65%; --paper-y: .7%; }
[data-study="wired_lighting"] { --paper-angle: -.9deg; }
[data-study="tala_nachar_theatre_lighting"] { --paper-angle: .7deg; }

.scroll-study .study-following {
  position: absolute;
  display: block;
  inset: 0;
  opacity: 0;
  background: var(--study-matte, #201513);
}
[data-study="murray_cocktail"] { --study-matte: #d5cabe; }
.work-scroll-toggle {
  display: block;
  width: max-content;
  margin: .4rem 0 .8rem auto;
  padding: .32rem .15rem;
  border: 0;
  border-bottom: 1px solid currentColor;
  border-radius: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: .8rem;
  cursor: pointer;
}
.work-scroll-toggle[hidden], .work-scroll-toggle:disabled { display: none; }
.work-scroll-toggle:focus-visible { outline: 2px solid currentColor; outline-offset: 4px; }

@media screen and (prefers-reduced-motion: no-preference) {
  /* A one-time move leaves a settled photograph to inspect. No hover is required. */
  .scroll-study[data-treatment="still"] .study-window > img {
    transform-origin: var(--study-origin);
    animation: work-photo-look 2.2s cubic-bezier(.22,.6,.28,1) both;
    animation-play-state: var(--art-play-state, paused);
  }
  .scroll-study[data-treatment="print"] .study-window,
  .scroll-study[data-treatment="poster"] .study-window {
    animation: work-paper-settle 1.15s cubic-bezier(.18,.65,.3,1) both;
    animation-play-state: var(--art-play-state, paused);
  }
  .scroll-study[data-treatment="pair"] .study-following {
    animation: work-paired-stills 3.7s linear infinite;
    animation-play-state: var(--art-play-state, paused);
  }
  /* Restart a photographic entrance when the visitor scrolls back to it. */
  .scroll-study:not([data-motion-visible="true"]):is([data-treatment="print"],[data-treatment="poster"]) .study-window,
  .scroll-study[data-treatment="still"]:not([data-motion-visible="true"]) .study-window > img {
    animation-name: none;
  }
  /* Give a viewer enough time to see the next phase while the card is passing. */
  .work-art.thumb-cinema { --thumb-period: 4.5s !important; --thumb-delay: 0s !important; }
  .thumb-cinema.has-sequence .thumb-pane-1 { animation-name: work-cinema-cut; }
  .work-art.art-room-details .room-objects .room-first { animation-name: work-room-up; }
  .work-art.art-room-details .room-fabric .room-first { animation-name: work-room-down; animation-delay: .09s; }
  .work-art.art-room-details .room-texture .room-first { animation-name: work-room-up; animation-delay: .18s; }
  .work-art.art-room-details .room-window .room-first { animation-duration: 5.3s; }
  .work-art.mtr-signage-art :is(.mtr-track,.mtr-light) { animation-duration: 9.6s; }
  .mtr-signage-art .mtr-track { animation-delay: -.34s; }
  .work-art.thumb-jabbara-scene :is(.jabbara-room,.jabbara-room-darkness,.jabbara-figure,.jabbara-figure-darkness,.jabbara-void,.jabbara-feather-mid,.jabbara-feather-tail,.jabbara-drawing) { animation-duration: 8s; }
  .work-art.thumb-mining-pov .mining-pov-camera { animation-duration: 6s; }
  .work-art.thumb-mining-pov :is(.mining-pov-circle,.mining-pov-close) { animation-duration: 18s; }
  .work-art.thumb-passport-optical .passport-thumb-cover::after,
  .work-art.thumb-passport-optical :is(.passport-thumb-uv,.passport-thumb-light) { animation-duration: 5.8s; }
  .work-art.thumb-mirror-performance :is(.mirror-figure,.mirror-echo,.mirror-light) { animation-duration: 7.4s; }
  .work-art.art-broadcast .broadcast-layer { animation-duration: 9s; animation-delay: -1.4s; }
  .work-thumbnail .art-broadcast .broadcast-screen .broadcast-layer { animation-duration: 5.4s; }
  .work-thumbnail .art-broadcast .broadcast-room { animation-delay: -1.05s; }
  .work-thumbnail .art-broadcast .broadcast-news { animation-delay: -4.65s; }
  .work-thumbnail .art-broadcast .broadcast-interview { animation-delay: -2.85s; }
  .work-art.art-object > img, .work-art.art-portrait > img { animation-duration: 5.8s; }
  .work-art.art-book > img, .work-art.thumb-screen-studies .thumb-pane,
  .work-art.thumb-publication-set .thumb-pane, .work-art.thumb-double-exposure .thumb-pane-1 { animation-duration: 6.8s; }
  :is(.work-card,.person-work) .work-art.art-print .terminal-pigment > img { animation-duration: 11s; }
  .work-art.art-print .terminal-voice { animation-duration: 8.5s; }
  .work-art.art-letters .kelme-orb-source { animation-duration: 5.4s; }
  .work-art.art-letters .kelme-letter-field > span { animation-duration: 4.3s; }
}
@keyframes work-photo-look {
  from { transform: scale(1); }
  to { transform: scale(var(--study-scale, 1.035)); }
}
@keyframes work-paper-settle {
  from { transform: translate(var(--paper-x, -.7%),var(--paper-y, 1.3%)) rotate(var(--paper-angle, 0deg)) scale(.947); }
  to { transform: none; }
}
@keyframes work-paired-stills {
  0%,13% { opacity: 0; }
  21%,68% { opacity: 1; }
  78%,100% { opacity: 0; }
}
@keyframes work-cinema-cut {
  0%,11%,100% { opacity: 0; }
  18%,68% { opacity: 1; }
  78% { opacity: 0; }
}
@keyframes work-room-up {
  0%,9%,100% { transform: translateY(0); }
  23%,66% { transform: translateY(-101%); }
  83% { transform: translateY(0); }
}
@keyframes work-room-down {
  0%,9%,100% { transform: translateY(0); }
  23%,66% { transform: translateY(101%); }
  83% { transform: translateY(0); }
}
.work-grid.index .scroll-study .study-window,
.work-grid.index .scroll-study .study-window img,
.work-grid.index .scroll-study .study-following { animation: none; transform: none; }
@media print, (prefers-reduced-motion: reduce) {
  .scroll-study .study-following { display: none; }
}

/* Use the printed sheet proportions in browse cards. Compact index rows
   retain their own thumbnail aperture. */
.work-grid:not(.index) .work-card:nth-child(n) > .image-link:has(> [data-study="yara_nasrany_dance_lighting"]),
.related-grid .work-card > .image-link:has(> [data-study="yara_nasrany_dance_lighting"]) {
  aspect-ratio: 1424 / 2015;
}
.work-grid:not(.index) .work-card:nth-child(n) > .image-link:has(> [data-study="tala_nachar_theatre_lighting"]),
.related-grid .work-card > .image-link:has(> [data-study="tala_nachar_theatre_lighting"]) {
  width: min(100%, 285px);
  margin-inline: auto;
  aspect-ratio: 285 / 408;
}
