/* zoominside.xyz long film (film.js): the Film overlay on a scene’s explorer. Full screen, one dark glass
   pill of controls, the film's own poster (blurred) wherever the picture leaves room. */
.film {
  --fg: max(var(--gutter, clamp(16px, 3.4vw, 56px)), env(safe-area-inset-left));
  position: fixed; inset: 0; z-index: 40; overflow: hidden; background: var(--night); color: #fff; font-family: var(--font);
  -webkit-tap-highlight-color: transparent;
}
.film[hidden] { display: none; }
.film[data-mode="overlay"] { opacity: 0; transition: opacity 0.35s linear; }
.film[data-mode="overlay"].is-open { opacity: 1; }
html.film-on, html.film-on body { overflow: hidden; }

/* the poster: sharp and full-bleed until the film starts, then a soft blurred ground around it */
.film-bg { position: absolute; inset: 0; }
.film-bg img {
  position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover;
  transition: filter 0.6s var(--ease-out), transform 0.8s var(--ease-out);
}
.film.is-started .film-bg img { filter: blur(32px) saturate(1.15) brightness(0.5); transform: scale(1.12); }
.film-video {
  position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: contain; background: transparent;
  opacity: 0; transition: opacity 0.4s linear;
}
.film.is-started .film-video { opacity: 1; }
.film:not(.is-started) .film-video { pointer-events: none; }
.film-foot {
  position: absolute; inset: 42% 0 0; pointer-events: none; transition: opacity 0.4s linear;
  background: linear-gradient(to top, rgba(17, 22, 29, 0.62), rgba(17, 22, 29, 0));
}
.film.is-started .film-foot { opacity: 0; }

/* before the film: the title and one blue button, where the home page puts them */
.film-ui {
  position: absolute; z-index: 2; left: var(--fg); bottom: max(var(--gutter, clamp(16px, 3.4vw, 56px)), env(safe-area-inset-bottom));
  display: grid; justify-items: start; gap: clamp(16px, 2.6vh, 28px); transition: opacity 0.35s linear;
}
.film.is-started .film-ui { opacity: 0; pointer-events: none; visibility: hidden; transition: opacity 0.35s linear, visibility 0s 0.35s; }
.film-name {
  margin: 0; font: 800 clamp(40px, 5.2vw, 76px)/1 var(--font); letter-spacing: -0.02em; color: #fff; text-wrap: balance;
  max-width: min(78vw, 16ch); text-shadow: 0 2px 18px rgba(17, 22, 29, 0.45);
}
.film-big {
  display: inline-flex; align-items: center; gap: 12px; height: 58px; padding: 0 30px 0 22px; border: 0; border-radius: 999px; cursor: pointer;
  background: var(--blue); color: #fff; font: 800 18px/1 var(--font); box-shadow: 0 10px 30px rgba(17, 22, 29, 0.22);
  transition: background 0.2s linear, transform 0.4s var(--ease-out);
}
.film-big:hover { background: var(--blue-deep); }
.film-big:active { transform: scale(0.97); }
.film-big:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.film-big .ico { width: 18px; height: 18px; }

/* one pill of controls along the bottom */
.film .ctl {
  display: inline-flex; align-items: center; justify-content: center; flex: none; width: 44px; height: 44px; padding: 0;
  border: 0; border-radius: 999px; background: none; color: inherit; cursor: pointer; font: 800 15px/1 var(--font);
  transition: background 0.18s linear, color 0.18s linear, opacity 0.3s linear;
}
.film .ctl[hidden] { display: none; }
.film .ctl:hover { background: rgba(255, 255, 255, 0.14); }
.film .ctl:active { background: rgba(255, 255, 255, 0.22); }
.film .ctl:focus-visible { outline: 2px solid #fff; outline-offset: -3px; }
.film-bar {
  position: absolute; z-index: 3; left: 50%; bottom: max(16px, env(safe-area-inset-bottom)); transform: translateX(-50%);
  display: flex; align-items: center; gap: 2px; width: min(760px, calc(100% - 32px)); padding: 2px 6px 2px 2px; border-radius: 999px;
  transition: opacity 0.35s linear, visibility 0s;
}
.film:not(.is-started) .film-bar, .film.is-idle .film-bar { opacity: 0; visibility: hidden; transition: opacity 0.5s linear, visibility 0s 0.5s; }
.film.is-idle, .film.is-idle .film-video { cursor: none; }
.f-play .i-pause, .f-play.is-on .i-play, .f-sound .i-off, .f-sound.is-muted .i-on, .f-full .i-exit, .f-full.is-full .i-full { display: none; }
.f-play.is-on .i-pause, .f-sound.is-muted .i-off, .f-full.is-full .i-exit { display: block; }
.f-sound.is-muted { color: var(--orange-night); }
.film .f-q { width: auto; padding: 0 11px; font-size: 12.5px; letter-spacing: 0.04em; color: rgba(255, 255, 255, 0.62); }
.film .f-q[aria-pressed="true"] { color: var(--orange-night); }
.film-time { flex: none; padding: 0 8px 0 4px; font: 800 13px/1 var(--font); font-variant-numeric: tabular-nums; color: rgba(255, 255, 255, 0.86); white-space: nowrap; }

.film-seek {
  --p: 0%; flex: 1; min-width: 48px; height: 32px; margin: 0 6px; padding: 0; background: transparent; cursor: pointer;
  -webkit-appearance: none; appearance: none;
}
.film-seek:focus-visible { outline: 2px solid #fff; outline-offset: 2px; border-radius: 6px; }
.film-seek::-webkit-slider-runnable-track {
  height: 4px; border-radius: 4px; background: linear-gradient(to right, var(--orange-night) var(--p), rgba(255, 255, 255, 0.3) var(--p));
}
.film-seek::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 14px; height: 14px; margin-top: -5px; border: 0; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 5px rgba(17, 22, 29, 0.5);
}
.film-seek::-moz-range-track { height: 4px; border-radius: 4px; background: rgba(255, 255, 255, 0.3); }
.film-seek::-moz-range-progress { height: 4px; border-radius: 4px; background: var(--orange-night); }
.film-seek::-moz-range-thumb { width: 14px; height: 14px; border: 0; border-radius: 50%; background: #fff; box-shadow: 0 1px 5px rgba(17, 22, 29, 0.5); }

.film-close {
  position: absolute; z-index: 4; top: max(16px, env(safe-area-inset-top)); right: max(16px, env(safe-area-inset-right));
  transition: opacity 0.35s linear, visibility 0s;
}
.film.is-idle .film-close { opacity: 0; visibility: hidden; transition: opacity 0.5s linear, visibility 0s 0.5s; }

/* ---------------------------------------------------------------------------------- a film scene's own page */
html.film-doc, body.film-page { height: 100%; overflow: hidden; background: var(--bg, var(--night)); }
body.film-page .topbar {
  position: fixed; z-index: 50; left: 0; right: 0; top: 0; display: flex; align-items: flex-start; pointer-events: none;
  padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left));
  transition: opacity 0.5s linear;
}
body.film-page .topbar > * { pointer-events: auto; }
body.film-page .back { position: relative; display: block; flex: none; width: 156px; height: 40px; margin-top: 2px; border-radius: 10px; }
body.film-page .back img { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; filter: drop-shadow(0 1px 6px rgba(17, 22, 29, 0.55)); }
body.film-page .back:focus-visible { outline: 3px solid var(--blue-night); outline-offset: 4px; }
html.film-idle .topbar { opacity: 0; pointer-events: none; }
body.film-page .film::before {        /* a soft head under the logo */
  content: ""; position: absolute; inset: 0 0 auto; height: clamp(120px, 20vh, 200px); z-index: 1; pointer-events: none;
  background: linear-gradient(to bottom, rgba(17, 22, 29, 0.55), rgba(17, 22, 29, 0)); transition: opacity 0.5s linear;
}
body.film-page .film.is-idle::before { opacity: 0; }

@media (max-width: 820px), (orientation: portrait) {
  .film-ui { bottom: calc(max(16px, env(safe-area-inset-bottom)) + 24px); }
  .film-name { font-size: clamp(34px, 10vw, 52px); }
  .film-big { height: 54px; font-size: 17px; }
  .film-bar { width: calc(100% - 24px); bottom: max(12px, env(safe-area-inset-bottom)); }
  .film .f-q { display: none; }
  body.film-page .back { width: 133px; height: 34px; margin-top: 7px; }
  .film-close { top: max(12px, env(safe-area-inset-top)); right: max(12px, env(safe-area-inset-right)); }
}
@media (max-width: 420px) { .film-time { display: none; } }
@media (prefers-reduced-motion: reduce) { .film-bg img { transition: none; } }
