/* Shared CSS timing values; appearance and timings preserved. */
:root {
  --motion-p12s: 0.12s;
  --motion-p25s: 0.25s;
  --motion-p2s: 0.2s;
  --motion-p3s: 0.3s;
  --motion-p5s: 0.5s;
  --motion-500ms: 500ms;
}
/* Interaction layers preserve the resting paper, crop and typography. */
.film-poster{position:absolute!important;inset:0!important;width:100%!important;height:100%!important;background-size:cover;background-position:center;z-index:2;pointer-events:none}
#gallery .card .art{transition:scale var(--motion-medium,380ms) var(--motion-ease,ease),translate var(--motion-medium,380ms) var(--motion-ease,ease)}
#gallery .card .art-image {
  filter: grayscale(var(--desaturate, 1));
}
@media(hover:hover) and (pointer:fine){#gallery:not(.gallery-moving):not(.dragging) .card:not(.card-returned):hover .art{scale:1.02;translate:0 -3px}}
@media (max-width: 680px) {
  #gallery .card .art-image {
    --desaturate: 1;
    transition: filter var(--motion-medium) var(--motion-ease);
  }
  #gallery .mobile-current .art-image { --desaturate: 0; }
}
/* Native scroll timelines add no input listener or frame loop. The art's
   transform composes with the independent scale used by touch feedback. */
@supports (animation-timeline: view()) {
  @media (max-width: 680px) and (prefers-reduced-motion: no-preference) {
    html:not(.motion-lite) #gallery .card.mobile-scroll-near .art {
      animation-name: mobile-card-view;
      animation-duration: auto;
      animation-timing-function: var(--motion-mobileScrollEase, linear);
      animation-fill-mode: both;
      animation-timeline: view();
      animation-range: entry 10% exit 90%;
      view-timeline-name: --mobile-card-view;
      view-timeline-axis: block;
    }
    html:not(.motion-lite) #gallery .card.mobile-scroll-near .art-image {
      animation-name: mobile-cover-view;
      animation-duration: auto;
      animation-timing-function: var(--motion-mobileScrollEase, linear);
      animation-fill-mode: both;
      /* .art clips its media and is itself a scroll container. Inherit its
         named view timeline so the image follows the gallery, not that clip. */
      animation-timeline: --mobile-card-view;
      animation-range: entry 10% exit 90%;
    }
  }
}
@keyframes mobile-card-view {
  0%, 100% {
    transform: scale(var(--motion-mobileScrollScale, .94));
    opacity: var(--motion-mobileScrollOpacity, .55);
  }
  50% { transform: scale(1); opacity: 1; }
}
@keyframes mobile-cover-view {
  from {
    transform: translateY(calc(-1 * var(--motion-mobileScrollTravel, 5%))) scale(var(--motion-mobileScrollOverscan, 1.12));
  }
  50% { transform: translateY(0) scale(1); }
  to {
    transform: translateY(var(--motion-mobileScrollTravel, 5%)) scale(var(--motion-mobileScrollOverscan, 1.12));
  }
}
@media(prefers-reduced-motion:reduce){#gallery .card .art{scale:1!important;translate:none!important;transition:none!important}}
.caption-mask{display:block;overflow:hidden;padding:8px;margin:-8px}
.caption-line{display:block;transform:translateY(calc((1 - var(--caption-opacity,1))*105%))}
.card .caption-line {
  transform: translate3d(var(--caption-shift, 0px), calc((1 - var(--caption-opacity, 0)) * 105%), 0);
}
@media (prefers-reduced-motion:no-preference) {
  html:not(.motion-lite) .card .card-artist .caption-line {
    transform: translate3d(var(--caption-shift, 0px), calc((var(--caption-opacity, 0) - 1) * var(--motion-titleTravel, 105%)), 0);
  }
}
.caption-ink { display: block; }
@media (min-width: 681px) and (prefers-reduced-motion: no-preference) {
  #gallery.gallery-moving .gallery-card-visible.caption-active .caption-line { will-change: transform; }
}
nav button,nav a,.work-filters button{position:relative}
nav button::after,nav a::after{content:"";position:absolute;left:0;right:0;bottom:3px;height:1px;background:currentColor;transform:scaleX(0);transform-origin:right;transition:transform var(--motion-micro,160ms) var(--motion-ease,ease)}
nav button:hover::after,nav a:hover::after,nav button:focus-visible::after,nav a:focus-visible::after{transform:scaleX(1);transform-origin:left}
@media(prefers-reduced-motion:reduce){.caption-line,.card .caption-line,.card .card-artist .caption-line{transform:none}.caption-mask{overflow:visible}nav button::after,nav a::after{transition:none}}

.counter-window {
  display: inline-block;
  overflow: hidden;
  vertical-align: top;
  font-variant-numeric: tabular-nums;
}
.counter-track { display: block; position: relative; }
.counter-previous { position: absolute; inset: 0; }
#counter { font-variant-numeric: tabular-nums; }

.roll-mask, .roll-track { display: inline-block; }
.roll-track { position: relative; }
.roll-copy { display: none; }
nav :is(.roll-mask, .roll-track, .roll-copy) { padding-left: 0; }
@media (hover:hover) and (prefers-reduced-motion:no-preference) {
  html:not(.motion-lite) .roll-mask {
    overflow: hidden;
    overflow: clip;
  }
  html:not(.motion-lite) .roll-track {
    display: block;
    transition: transform var(--motion-roll) var(--motion-rollCurve);
  }
  html:not(.motion-lite) .roll-copy {
    display: block;
    position: absolute;
    inset: 100% 0 auto;
    pointer-events: none;
  }
  html:not(.motion-lite) :is(a, button):hover .roll-track { transform: translateY(-100%); }
}

@media (min-width:681px) and (prefers-reduced-motion:no-preference) {
  html:not(.motion-lite) #cards[data-depth-active] .gallery-card-visible .art-image {
    translate: calc(-1 * var(--gallery-speed, 0) * var(--motion-depthShift)) 0;
    scale: calc(1 + max(var(--gallery-speed, 0), -1 * var(--gallery-speed, 0)) * var(--gallery-overscan, 0));
  }
}
.settle-accent {
  position: absolute;
  display: block;
  width: 2em;
  height: 1px;
  left: 0;
  bottom: -.22em;
  opacity: 0;
  background: currentColor;
  pointer-events: none;
}
.credit-text { display: block; }
#project .film-text-moving .credit-line { overflow: hidden; }
#project .film-text-outgoing {
  position: fixed;
  z-index: 3;
  transform: none;
  right: auto;
  bottom: auto;
  margin: 0;
  pointer-events: none;
}
/* A single paper plane is shared with the transparent top-layer player. */
html.film-active #project,html.film-active #project::backdrop{background:transparent!important;background-image:none!important;backdrop-filter:none}
html.film-active #project::backdrop { animation: none; }
html.film-active:not(.film-returning, .film-gallery-motion) .canvas > :is(#gallery, header, .work-filters, .edition) { opacity: 0; }
#gallery .film-source { visibility: hidden; }
#project #detail-art,#project .film-neighbour{transform-origin:0 0;overflow:hidden}
.neighbour-photo{display:block;position:absolute;inset:0;background-size:cover;background-position:center}

/* Allocate the shared paper plane only while the entrance is moving. */
html.opening .vellum-ground{will-change:transform}

@media(max-width:680px){#project .film-previous{display:none!important}}

/* Adjacent-film strips belong only to the player, never the returning gallery. */
html.film-returning #project .film-neighbour {
  visibility: hidden !important;
  pointer-events: none !important;
}

#gallery .art { background-color: var(--cover-placeholder, var(--paper)); }
@media (min-width: 681px) {
  #gallery:not(.gallery-moving) .art-image { transition: transform var(--motion-medium) var(--motion-ease); }
}
@media (hover:hover) and (pointer:fine) {
  html:not(.motion-lite) #gallery:not(.gallery-moving):not(.dragging) .card:not(.card-returned):hover .art-image {
    transform: scale(var(--motion-hoverCrop));
  }
}
.work-filters button[aria-pressed="true"] { text-decoration: none; }
.filter-line {
  position: absolute;
  left: 0;
  bottom: 3px;
  width: 1px;
  height: 1px;
  background: var(--ink);
  pointer-events: none;
  transform-origin: left center;
  transition: transform var(--motion-medium) var(--motion-ease);
}
@media (max-width: 680px) {
  .filter-line { top: var(--filter-line-top); bottom: auto; }
}
:is(#project-title, .film-title-snapshot) .caption-mask { padding-block: 0; margin-block: 0; }
:is(#project-title, .film-title-snapshot) :is(.caption-mask, .caption-line) {
  font-size: inherit;
  color: inherit;
  letter-spacing: inherit;
  line-height: inherit;
  font-weight: inherit;
}
@media (hover:none) and (prefers-reduced-motion:no-preference) {
  #gallery .card .art {
    transition: scale var(--motion-touchPress) var(--motion-ease);
  }
  #gallery .card.touch-pressed .art {
    scale: var(--motion-dragScale);
  }
}
.film-outgoing {
  z-index: 4;
  overflow: hidden;
  background: #080808;
}
.film-outgoing :is(iframe, video) { position:absolute; inset:0; width:100%; height:100%; border:0; }
.film-outgoing video { object-fit:contain; background:#000; }
.player-controls button:is([data-action="play"],[data-action="sound"]) { position: relative; }
.player-controls .icon-leaving { position:absolute; inset:0; margin:auto; pointer-events:none; }
.player-seek::-webkit-slider-thumb { transition:transform var(--motion-thumb) var(--motion-ease); }
.player-seek::-moz-range-thumb { transition:transform var(--motion-thumb) var(--motion-ease); }
.player-seek:is(:hover,:active):enabled::-webkit-slider-thumb { transform:scale(var(--motion-thumbScale)); }
.player-seek:is(:hover,:active):enabled::-moz-range-thumb { transform:scale(var(--motion-thumbScale)); }
@media (prefers-reduced-motion: reduce) {
  .filter-line, #gallery .card .art-image { transition:none; }
  .player-seek::-webkit-slider-thumb { transition:none; transform:none!important; }
  .player-seek::-moz-range-thumb { transition:none; transform:none!important; }
}

:is(#project, #info) .close {
  position: relative;
  border: 0;
  border-radius: 0;
  background: transparent;
}
:is(#project, #info) .close:focus-visible { outline: none; }
:is(#project, #info) .close:focus-visible::after {
  content: "";
  position: absolute;
  width: 14px;
  height: 2px;
  bottom: 8px;
  left: calc(50% - 7px);
  background: currentColor;
  pointer-events: none;
}

#project[data-preparing-opening] :is(.project-meta, .project-header, .player-controls, .player-status, .film-neighbour) { opacity: 0; }
#project .film-strip-source { visibility: hidden; }

/* Transient flight details leave every resting style unchanged. */
@media (hover:hover) and (pointer:fine) and (prefers-reduced-motion:no-preference) {
  html:not(.motion-lite) #gallery .card.mouse-pressed .art {
    scale: var(--motion-dragScale) !important;
    transition-duration: var(--motion-cardPress);
  }
}
.film-credit-rule {
  position: absolute;
  left: 0;
  top: var(--motion-filmRuleTop);
  width: var(--motion-filmRuleWidth);
  height: 1px;
  background: currentColor;
  transform-origin: left center;
  pointer-events: none;
  opacity: 0;
}
