/* The list film (app-list-film.js, app-list-film-stage.js): Marcus over "Build your own list" before its competitors
   come in. A modal dialog over the page holding a film frame in the intro film's look (app-intro.css `.if`: the night
   colours, the dotted floor, the title, the scenes' coming and going, the captions, the sound button, Marcus), so this
   file only adds the dialog, the Skip button and the list card's scenes. A 16:9 picture on a wide screen, the whole
   screen on a phone. Places come from the script as custom properties (stageLayout: --pad, --top, --foot, --hero-*). */
html.lf-open, html.lf-open body { overflow: hidden; }
.lf-dlg { position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: transparent;
  display: grid; place-items: center; animation: lf-in .3s ease both; }
.lf-dlg:not([open]) { display: none; }
.lf-dlg::backdrop { background: rgba(3, 10, 20, .74); animation: lf-in .3s ease both; }
.lf-dlg.is-out, .lf-dlg.is-out::backdrop { animation: lf-out .26s ease both; }
@keyframes lf-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes lf-out { from { opacity: 1; } to { opacity: 0; } }
.lf-dlg .if { width: min(92vw, 960px, calc((100vh - 48px) * 16 / 9)); width: min(92vw, 960px, calc((100dvh - 48px) * 16 / 9)); box-shadow: 0 24px 70px rgba(0, 0, 0, .45); }
/* Skip, top right; the sound button sits to its left, growing leftwards when it says "Tap for sound". */
.lf-skip { position: absolute; z-index: 7; top: var(--pad); right: var(--pad); width: 72px; height: 40px; padding: 0; border: 0; border-radius: 999px;
  background: var(--tile); color: #fff; font-size: .9rem; font-weight: 700; }
.lf-skip:hover { background: var(--tile-2); }
.lf .if-sound { right: calc(var(--pad) + 80px); }
/* ---------------------------------------------------------------- build, change: the list card */
.lf-stage:is([data-beat="build"], [data-beat="change"]) .lf-list { opacity: 1; visibility: visible; transform: none; transition: opacity .35s ease .1s, transform .45s ease .1s; }
.lf-card { display: grid; gap: 1.6cqmin; width: min(100%, 560px); max-height: 100%; overflow: hidden; box-sizing: border-box; padding: 2.2cqmin 2.6cqmin;
  border-radius: 16px; background: var(--deep); box-shadow: 0 0 0 2px var(--tile); }
.lf-head { display: flex; align-items: center; justify-content: space-between; gap: 2cqmin; }
.lf-head-t { font-size: clamp(13px, 3cqmin, 18px); font-weight: 800; letter-spacing: -.01em; }
.lf-dots { display: inline-flex; gap: 5px; flex: none; }
.lf-dot { width: 9px; height: 9px; box-sizing: border-box; border: 2px solid rgba(155, 192, 232, .35); border-radius: 50%;
  transition: background-color .2s ease calc(var(--i) * 110ms + 300ms), border-color .2s ease calc(var(--i) * 110ms + 300ms); }
.lf-stage:is([data-beat="build"], [data-beat="change"]) .lf-dot { background: var(--you); border-color: var(--you); }
/* The search: quiet until the change line says "add your own". */
.lf-search { display: flex; align-items: center; gap: .6em; padding: .55em .7em .55em .9em; border-radius: 999px; background: var(--tile-2); color: var(--quiet);
  font-size: clamp(11px, 2.5cqmin, 14px); font-weight: 600; opacity: .55; transition: opacity .25s ease, box-shadow .25s ease, color .25s ease; }
.lf-search-i { width: 1.2em; height: 1.2em; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.lf-search-t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lf-search-add { display: grid; place-items: center; width: 1.7em; height: 1.7em; flex: none; border-radius: 50%; background: var(--tile); color: #fff; font-weight: 800; transition: background-color .25s ease, color .25s ease; }
.lf-stage[data-step="3"] .lf-search { opacity: 1; color: #fff; box-shadow: 0 0 0 2px var(--you); }
.lf-stage[data-step="3"] .lf-search-add { background: var(--you); color: var(--night); }
/* The rows: in one after another, from above, as the page's own list comes in on a phone. */
.lf-rows { list-style: none; padding: 0; display: grid; gap: 1cqmin; }
.lf-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 1.8cqmin; max-height: 80px; padding: .9cqmin 1.2cqmin; border-radius: 10px;
  background: rgba(47, 88, 140, .38); opacity: 0; transform: translateY(-10px);
  transition: opacity .3s ease calc(var(--i) * 140ms + 200ms), transform .45s cubic-bezier(.2, 1.2, .3, 1) calc(var(--i) * 140ms + 200ms), box-shadow .25s ease; }
.lf-stage:is([data-beat="build"], [data-beat="change"]) .lf-row:not(.is-new) { opacity: 1; transform: none; }
.lf-stage[data-beat="change"] .lf-row { transition-delay: 0s; }
.lf-row-tile { width: max(16px, 3.6cqmin); height: max(16px, 3.6cqmin); border-radius: 6px; background: var(--tile); }
.lf-row-t { display: grid; gap: .7cqmin; min-width: 0; }
.lf-row-n { display: block; width: calc(var(--w) * 100%); height: max(7px, 1.5cqmin); border-radius: 99px; background: var(--bar-lit); opacity: .85; transform-origin: 0 50%; }
.lf-row-s { display: block; width: calc(var(--w) * 60%); height: max(5px, 1cqmin); border-radius: 99px; background: var(--bar); opacity: .45; }
.lf-act { display: grid; place-items: center; width: max(22px, 4.4cqmin); height: max(22px, 4.4cqmin); border-radius: 50%; background: var(--tile-2); color: var(--quiet);
  transition: background-color .2s ease, color .2s ease, transform .3s cubic-bezier(.2, 1.6, .4, 1); }
.lf-act-i { width: 60%; height: 60%; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
/* "remove any": a row's × pressed, and the row goes. */
.lf-stage:is([data-step="1"], [data-step="2"], [data-step="3"]) .lf-row.is-gone { animation: lf-gone .55s ease .3s both; }
.lf-stage:is([data-step="1"], [data-step="2"], [data-step="3"]) .lf-row.is-gone .lf-act { background: var(--behind); color: var(--night); transform: scale(1.15); }
@keyframes lf-gone { to { opacity: 0; transform: translateX(28px); max-height: 0; padding-block: 0; margin-block: -.5cqmin; } }
/* "swap them": the swap mark lit, and another company in that row's place. */
.lf-stage:is([data-step="2"], [data-step="3"]) .lf-row.is-swap { box-shadow: 0 0 0 2px var(--you); }
.lf-stage:is([data-step="2"], [data-step="3"]) .lf-row.is-swap .lf-act { background: var(--you); color: var(--night); transform: rotate(180deg); }
.lf-stage:is([data-step="2"], [data-step="3"]) .lf-row.is-swap .lf-row-n { animation: lf-swap .6s ease both; }
@keyframes lf-swap { 0% { transform: none; } 45% { transform: scaleX(0); opacity: .2; } 100% { transform: scaleX(.8); opacity: 1; background: var(--you); } }
/* "or add your own": one more, from the search, at the foot. */
/* Folded away until then, so it leaves no gap at the foot of the card. */
.lf-row.is-new { max-height: 0; padding-block: 0; margin-top: -1cqmin; overflow: hidden; box-shadow: 0 0 0 2px var(--you);
  transition: opacity .3s ease, transform .4s ease, max-height .35s ease, padding .35s ease, margin .35s ease; }
.lf-row.is-new .lf-row-n { background: var(--you); }
.lf-stage[data-step="3"] .lf-row.is-new { max-height: 80px; padding-block: .9cqmin; margin-top: 0; opacity: 1; transform: none; }
/* ---------------------------------------------------------------- a phone: the whole screen */
@media (max-width: 640px) {
  .lf-dlg .if { width: 100%; height: 100vh; height: 100dvh; aspect-ratio: auto; border-radius: 0; box-shadow: none; }
}
/* A phone on its side: as wide as the screen's height allows. */
@media (pointer: coarse) and (max-height: 500px) and (min-width: 641px) {
  .lf-dlg .if { width: min(100%, calc((100svh - 16px) * 16 / 9)); height: calc(100svh - 16px); aspect-ratio: auto; }
}
/* ---------------------------------------------------------------- still: no movement, the row simply gone */
.lf.is-reduced .lf-stage:is([data-step="1"], [data-step="2"], [data-step="3"]) .lf-row.is-gone { display: none; }
.lf.is-reduced .lf-stage:is([data-step="2"], [data-step="3"]) .lf-row.is-swap .lf-row-n { background: var(--you); }
@media (prefers-reduced-motion: reduce) {
  .lf-dlg, .lf-dlg::backdrop { animation: none; }
  .lf-stage:is([data-step="1"], [data-step="2"], [data-step="3"]) .lf-row.is-gone { display: none; }
  .lf-stage:is([data-step="2"], [data-step="3"]) .lf-row.is-swap .lf-row-n { background: var(--you); }
}
