/* ---------- Film (reel, infinity, globe flight) ---------- */
#film { min-height: 100vh; min-height: 100svh; padding: 0; }
.film-cv { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 1; }

/* the words sit above the picture, never on top of the loop or the plane */
.film-text {
  position: fixed; z-index: 3; left: 0; right: 0; top: calc(env(safe-area-inset-top, 0px) + clamp(1.6rem, 9vh, 5.5rem));
  padding: 0 16px; margin: 0 auto; max-width: 34rem; pointer-events: none;
  display: flex; flex-direction: column; align-items: center; gap: .35rem; text-align: center;
  transition: opacity .55s ease;
}
.film-text.swap { opacity: 0; }
.film-text .eyebrow:empty, .film-sub:empty, .film-title:empty { display: none; }
/* a soft dark pool behind the closing line so it reads over the map */
.film-text::before {
  content: ""; position: absolute; z-index: -1; left: 50%; top: 50%; width: 150%; height: 190%;
  transform: translate(-50%, -50%); pointer-events: none; opacity: 0;
  background: radial-gradient(closest-side, rgba(22, 14, 34, .82), rgba(22, 14, 34, .5) 55%, rgba(22, 14, 34, 0));
}
.film-text.scrim::before { animation: filmscrim 1.2s ease both; }
@keyframes filmscrim { to { opacity: 1; } }
.film-title { max-width: 26rem; text-shadow: 0 2px 14px rgba(20, 12, 30, .7); }
.film-title .w { display: inline-block; animation: wordin .9s ease both; animation-delay: calc(var(--i) * .14s); }
.film-title .w.accent { color: var(--flame); }
@keyframes wordin { from { opacity: 0; transform: translateY(.5em); } to { opacity: 1; transform: none; } }
.film-sub { margin: 0; max-width: 26rem; text-wrap: balance; font-family: var(--hand); font-size: 1.6rem; line-height: 1.2; color: var(--rose); text-shadow: 0 2px 10px rgba(20, 12, 30, .8); animation: rise 1s ease 1s both; }

/* floating hearts behind the infinity */
.film-hearts { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; opacity: 0; transition: opacity 1.5s ease; }
#film.hearts-on .film-hearts { opacity: 1; }
.film-hearts span { position: absolute; bottom: -2rem; color: var(--rose); font-size: var(--s, 1rem); opacity: 0; animation: heartup var(--t, 9s) linear var(--d, 0s) infinite; }
@keyframes heartup { 0% { transform: translate(0, 0) rotate(-10deg); opacity: 0; } 15% { opacity: var(--o, .4); } 85% { opacity: var(--o, .4); } 100% { transform: translate(var(--x, 20px), -110vh) rotate(15deg); opacity: 0; } }

/* the little flight tracker during the flight (its opacity is driven from the story clock) */
.film-hud {
  position: fixed; z-index: 3; left: 50%; top: calc(env(safe-area-inset-top, 0px) + 14px); transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: .1rem; opacity: 0; pointer-events: none;
  padding: .5rem 1rem .35rem; border-radius: 1.2rem; background: rgba(29, 19, 39, .72); border: 1.5px solid var(--line);
}
.fh-row { display: flex; align-items: center; gap: .6rem; }
.fh-place { font: 800 .7rem var(--body); letter-spacing: .12em; text-transform: uppercase; color: var(--cream); white-space: nowrap; }
.fh-track { position: relative; width: clamp(4.5rem, 22vw, 8rem); height: 3px; border-radius: 3px; background: rgba(251, 239, 228, .18); }
.fh-fill { position: absolute; inset: 0; border-radius: 3px; background: linear-gradient(90deg, var(--rose), var(--flame)); transform-origin: 0 50%; transform: scaleX(0); }
.fh-heart { position: absolute; left: -.38rem; top: 50%; margin-top: -.55rem; font-style: normal; font-size: .9rem; line-height: 1.1rem; color: var(--rose); }
.fh-km { margin: 0; font: 700 1.15rem/1.2 var(--hand); color: var(--rose); }

/* on a laptop the title keeps the gallery header's one-line shape */
@media (min-width: 900px) {
  .film-text { max-width: 46rem; }
  .film-title { max-width: 42rem; }
}
