html:has(.hero-film) { scroll-padding-top: 0; }
main:has(> .hero-film) { --film-black: #020201; --film-tail: 0px; }
main:has(> .hero-film)::before {
  content: "";
  position: absolute;
  inset: calc(100svh + var(--film-tail)) 0 auto;
  height: clamp(250px, 56svh, 500px);
  background: linear-gradient(to bottom, var(--film-black) 12%, rgb(2 2 1 / .64) 55%, transparent);
  pointer-events: none;
}
@media (max-width: 767px), (pointer: coarse) and (max-height: 600px) {
  main:has(> .hero-film) { --film-tail: 48px; }
  .hero-film::before {
    content: "";
    position: absolute;
    z-index: 2;
    inset: auto 0 0;
    height: clamp(24px, 7svh, 64px);
    background: linear-gradient(transparent, #000 80%);
    pointer-events: none;
  }
  @supports (height: 100lvh) {
    main:has(> .hero-film) {
      --film-tail: max(36px, calc(100lvh - 100svh + max(18px, env(safe-area-inset-bottom))));
    }
  }
}

.hero-film { --edge: clamp(16px, 2.6vw, 44px); isolation: isolate; z-index: 1; }
.hero-film video:not([data-presented]) { visibility: hidden; }
.hero-film-toggle { position: absolute; inset: 0; z-index: 1; width: 100%; cursor: pointer; }
.hero-film-toggle:focus-visible { outline-offset: -5px; }
#product-video-title {
  font-size: var(--type-section);
  line-height: var(--leading-heading);
  letter-spacing: -.045em;
}

.hero-film {
  position: relative;
  box-sizing: border-box;
  height: calc(100svh + var(--film-tail));
  overflow: hidden;
  border-block-end: var(--film-tail) solid #000;
  background: var(--film-black);
}
.hero-film video, .hero-film-poster img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; background: var(--film-black); }

/* brand bar: logo bottom-left, Log In bottom-right */
.hero-film .brandbar { position: absolute; z-index: 2; left: var(--edge); right: var(--edge); bottom: max(var(--edge), env(safe-area-inset-bottom));
  display: flex; align-items: center; justify-content: space-between; pointer-events: none; }
.hero-film .brandbar a { pointer-events: auto; }
.hero-film .brandbar .logo .brand-mark { width: auto; height: clamp(18px, 1.7vw, 26px); display: block; filter: drop-shadow(0 1px 6px rgba(0,0,0,.6)); }
/* Log In: plain white capitals with wide tracking, no box; quiet next to the zamia wordmark */
.hero-film .brandbar .login { font: 400 clamp(12px, 1.05vw, 16px)/1 system-ui, -apple-system, "Helvetica Neue", Arial; letter-spacing: .16em; text-transform: uppercase;
  color: #fff; padding: 6px 0 6px 12px; filter: drop-shadow(0 1px 6px rgba(0,0,0,.6)); opacity: .92; }
.hero-film .brandbar .login:hover { opacity: 1; }

/* phone: column - dialogue zone, video, brand bar */
.hero-film[data-layout="mobile"] { display: flex; flex-direction: column; }
/* top to bottom: brand bar, dialogue zone, square video, lower floor. The two flexible zones share the leftover
   height almost equally, so the scene sits a little above the middle of the screen. */
.hero-film[data-layout="mobile"] .brandbar { position: relative; z-index: 2; left: auto; right: auto; bottom: auto; flex: none; order: -2;
  padding: max(14px, env(safe-area-inset-top)) 20px 0; }
.hero-film[data-layout="mobile"] .hero-messages { order: -1; flex: 1 1 0; min-height: calc(100vw * 470 / 1080); position: relative; z-index: 2; }
/* The film box. Phones: a square; its top and bottom edges dissolve into still continuations of the empty room
   (web/hero-mobile-top.png, -bottom.png, made by assemble.py), so the scene reads as one tall portrait picture.
   Stills, not live frames: wall and floor never move, and people walking past the edges must not smear outward. */
.hero-film .film { position: absolute; inset: 0; }
.hero-film[data-layout="mobile"] .film { position: relative; inset: auto; flex: none; aspect-ratio: 1 / 1; z-index: 1; }
.hero-film[data-layout="mobile"] :is(video, .hero-film-poster img) {
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 11%, #000 94%, transparent 100%);
          mask-image: linear-gradient(to bottom, transparent 0, #000 11%, #000 94%, transparent 100%); }
.hero-film[data-layout="mobile"] .film::before, .hero-film[data-layout="mobile"] .film::after {
  content: ""; position: absolute; left: 0; right: 0; height: 100svh; z-index: -1; background-repeat: no-repeat; background-size: 100% 100%; }
.hero-film[data-layout="mobile"] .film::before { bottom: 89%; background-image: url(hero-mobile-top.png); }
.hero-film[data-layout="mobile"] .film::after { top: 94%; background-image: url(hero-mobile-bottom.png); }
.hero-film[data-layout="mobile"]::after { content: ""; order: 1; flex: .6 1 0; min-height: 44px; padding-bottom: env(safe-area-inset-bottom); }
