/* The start page's film plays by itself (assets/film/auto.js). During the film one row sits at the top right: play/pause, Sound,
   the round X to close it. It leaves as the header arrives (film.js, setNav). "Watch the film again" is on the landing. Added 2026-10-07 on Alex's feedback (scrolling through the film takes too long; serve it like a
   commercial that can be closed with an X). The film itself is the scroll film, untouched (film.css, film.js). */

@layer sections {
  .film-auto-ui[hidden] { display: none; }
  .film-chrome {
    position: fixed; z-index: 80; top: calc(env(safe-area-inset-top, 0px) + 18px); right: max(18px, env(safe-area-inset-right, 0px));
    display: flex; align-items: center; gap: 10px; transition: opacity 400ms var(--ease-out);
  }
  html.film-auto:not(.film-veil) .film-chrome { pointer-events: none; }   /* the film has landed: the row has faded, and must not catch clicks */
  .film-x, .film-pp {
    position: relative; display: grid; place-items: center; width: 48px; height: 48px; padding: 0; border: 0; border-radius: 50%;
    background: color-mix(in srgb, var(--color-night) 55%, transparent); color: var(--color-snow); cursor: pointer;
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--color-snow) 28%, transparent);
    -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
    transition: background-color var(--duration-hover) var(--ease-hover), box-shadow var(--duration-hover) var(--ease-hover), color var(--duration-hover) var(--ease-hover), transform var(--duration-press) var(--ease-out);
    -webkit-tap-highlight-color: transparent;
  }
  .film-pp[hidden] { display: none; }
  /* Skip film: a pill with the words, not a bare cross */
  .film-x { display: inline-flex; width: auto; gap: 8px; padding: 0 18px 0 20px; border-radius: var(--radius-pill); }
  .film-x-txt { font: 500 0.9375rem/1 var(--font-text); letter-spacing: 0.01em; white-space: nowrap; }
  .film-chrome .film-x svg { width: 18px; height: 18px; }
  .film-x svg, .film-pp svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  .film-pp .i-play { display: none; }
  .film-pp[data-state="paused"] .i-play { display: block; }
  .film-pp[data-state="paused"] .i-pause { display: none; }
  .film-x:active, .film-pp:active { transform: scale(var(--motion-press-scale)); }
  .film-x:focus-visible, .film-pp:focus-visible { outline: var(--line-focus) solid var(--color-lime); outline-offset: 3px; }
  @media (hover: hover) and (pointer: fine) {
    .film-x:hover, .film-pp:hover { background: var(--color-snow); color: var(--color-night); box-shadow: none; }
  }

  /* the line that says what the film waits for (auto.js): low in the middle, over the film, quiet; it is there only when it speaks */
  .film-note {
    position: fixed; z-index: 80; left: 50%; bottom: calc(env(safe-area-inset-bottom, 0px) + 112px); translate: -50% 0; margin: 0;   /* above "Scroll for more" */
    max-width: calc(100vw - 2 * var(--gutter)); width: max-content; padding: 10px 18px; border-radius: var(--radius-pill);
    background: color-mix(in srgb, var(--color-night) 72%, transparent); color: var(--color-snow);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--color-snow) 18%, transparent);
    -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
    font: 500 0.875rem/1.35 var(--font-text); text-align: center; text-wrap: balance;
    opacity: 0; visibility: hidden; pointer-events: none;
    transition: opacity var(--duration-exit, 200ms) var(--ease-out), visibility 0s linear var(--duration-exit, 200ms);
  }
  .film-note.is-on { opacity: 1; visibility: visible; transition: opacity 300ms var(--ease-out), visibility 0s; }
  @media (prefers-reduced-transparency: reduce) { .film-note { background: var(--color-night); -webkit-backdrop-filter: none; backdrop-filter: none; } }


  @media (prefers-reduced-transparency: reduce) {
    .film-x, .film-pp { background: var(--color-night); -webkit-backdrop-filter: none; backdrop-filter: none; }
  }
  /* phones and tablets: Sound is a round button with the speaker, a stroke across it while it is off */
  @media (max-width: 1023.98px) {
    .film-chrome .film-sound { width: 48px; height: 48px; min-height: 48px; padding: 0; justify-content: center; border-radius: 50%; }
    .film-chrome .film-sound .eq { display: none; }
    .film-chrome .film-sound .t { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; } /* the state stays in the accessible name ("Sound off") */
    .film-chrome .film-sound .speaker { display: block; }
  }

  /* "Watch the film": on the landing, for whoever closed it or arrives again. It is a .btn.btn-ghost since the review pass
     (site.css); this is only what belongs to the film. */
  .film.is-acting .film-about .film-replay { pointer-events: auto; }   /* film.css lets only links through on the landing */
  /* the static page (reduced motion, Save-Data, a small window) has no film to play */
  .film:not(.is-live) .film-replay { display: none; }
}
