/* The big screen, shared by Videos and the Gallery albums (/js/stage.js runs it).
   Kept apart from the page stylesheets because both pages use exactly the same frame, layers, teal line,
   progress track and full-screen behaviour; each page adds its own layout and item styles.
   The stage is a calm dark-brown surface so films and photographs read well. It is not a prop. */

.st-screen { position: relative; overflow: hidden; isolation: isolate; background: var(--st-bg); border-radius: var(--radius-media);
  box-shadow: 0 28px 56px -34px rgba(31, 20, 7, .9), 0 0 0 1px rgba(31, 20, 7, .35); container-type: size; }
.st-layer { position: absolute; inset: 0; isolation: isolate; display: grid; place-items: center; background: var(--st-bg); }
.st-layer.is-incoming { z-index: 2; }

/* the moving teal line at the edge of the wipe */
.st-line { position: absolute; z-index: 6; top: 0; bottom: 0; left: 0; width: 3px; margin-left: -2px; background: var(--st-line);
  box-shadow: -2px 0 0 rgba(243, 236, 214, .55), 0 0 0 1px rgba(31, 20, 7, .25); pointer-events: none; }

/* a softly blurred, darkened enlargement of the picture itself, so the stage is full without stretching the picture */
.st-ground { position: absolute; inset: -6%; width: 112%; height: 112%; max-width: none; object-fit: cover;
  filter: blur(26px) saturate(1.05) brightness(.42); transform: translateZ(0); pointer-events: none; user-select: none; }

/* the progress track along the bottom edge of the stage, with the small bike riding through the programme */
.st-track { position: relative; height: 26px; margin: 2px 4px 0; pointer-events: none; }
.st-track::before, .st-track::after { content: ''; position: absolute; left: 0; top: 50%; border-top: 2px dotted rgba(41, 30, 12, .3); }
.st-track::before { right: 0; }
/* the stretch already ridden is inked a little darker */
.st-track::after { width: calc(var(--p, 0) * (100% - 40px) + 12px); border-top-color: rgba(41, 30, 12, .62); transition: width 1s var(--ease); }
.st-bike { position: absolute; top: 50%; left: calc(var(--p, 0) * (100% - 40px)); width: 22px; height: 40px; margin-top: -20px; margin-left: 9px;
  background: url('/media/site/bike-top.svg') center / contain no-repeat; transform: rotate(90deg);
  filter: drop-shadow(2px 2px 1.5px rgba(31, 20, 7, .45)); transition: left 1s var(--ease); }

/* swipe */
.st-screen.is-swipe { touch-action: pan-y pinch-zoom; }
.st-screen.is-dragging, .st-screen.is-dragging * { user-select: none; -webkit-user-select: none; }
.st-screen.is-dragging .st-layer { will-change: transform; }

/* full screen: the real thing, or a fixed overlay where the browser has none (iPhone) */
.st:fullscreen { background: var(--st-bg); display: grid; grid-template-rows: minmax(0, 1fr) auto; width: 100%; height: 100%; max-width: none; padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }
.st.is-fullscreen { position: fixed; inset: 0; z-index: 90; display: grid; grid-template-rows: minmax(0, 1fr) auto; width: 100%; height: 100%; height: 100dvh;
  max-width: none; margin: 0; padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  background: var(--st-bg); color: var(--cream); }
.st.is-fullscreen .st-screen { width: 100%; height: 100%; max-width: none; max-height: none; aspect-ratio: auto; border-radius: 0; box-shadow: none; margin: 0; }
.st.is-fullscreen .st-track { display: none; }
html.stage-fs { overflow: hidden; }
html.stage-fs .site-header { visibility: hidden; }

/* reduced motion: the bike jumps, the layers cross-fade (stage.js) */
@media (prefers-reduced-motion: reduce) {
  .st-bike, .st-track::after { transition: none; }
}

/* A solid stage remains clear when translucent surfaces are unwelcome. */
@media (prefers-reduced-transparency: reduce) {
  .st-ground { display: none; }
}
