/* Film flagships (2026-11-19, inc/flagship-film.php): an opening film the guest starts with a tap, ending on the very
   frame the cover's loop starts from; the names over the calm part of the cover. Shared layout here; each design sets
   its palette on .film.{slug} in assets/css/flagship-{slug}.css:
     --fm-bg    the backdrop (page edges, before the films load)   --fm-shade  the wash under the words (an rgb triple)
     --fm-name  the names   --fm-ink  the other words on the cover   --fm-acc  the rule and the time
     --fm-wish  the wish over the opening   --fm-flood  the light of the hand-over (a colour)
   plus the shared sections' palette (--dk, --lt, --iv, --gd …: flagship-sections.css).
   assets/js/flagship-film.js sets on .fm-open: --cl/--ct the cover's top-left corner on screen, --cw/--ch its size. */

.film { font-variant-numeric: lining-nums; color: var(--iv);
  --fd: "Cormorant Garamond", Georgia, serif; --fb: "Cormorant Garamond", Georgia, serif; --fs: "Great Vibes", "Cormorant Garamond", cursive; }
.film .ip-h, .film .ip-ev-t, .film .inv-h { font-weight: 400; }
.film .ip-h { font-size: 38px; }
.film .ip-letter-text { font-size: 26px; }

/* ================= the cover ================= */
.fm-cover { position: relative; height: 100svh; min-height: 600px; max-height: 1000px; overflow: hidden; background: var(--fm-bg); isolation: isolate; container-type: size; }
.fm-scene { position: absolute; inset: 0; }
.fm-still, .fm-film { position: absolute; inset: 0; width: 100%; height: 100%; display: block; object-fit: cover; object-position: 50% 50%; }
.fm-film { opacity: 0; transition: opacity .9s ease; }
.fm-film.is-on { opacity: 1; }
/* the wash under the words: from the foot, or from the top */
.fm-cover::after { content: ""; position: absolute; left: 0; right: 0; height: 58%; z-index: 1; pointer-events: none; }
.fm-cover--bottom::after { bottom: 0; background: linear-gradient(180deg, rgb(var(--fm-shade) / 0), rgb(var(--fm-shade) / .55) 30%, rgb(var(--fm-shade) / .88) 62%, rgb(var(--fm-shade))); }
.fm-cover--top::after { top: 0; height: 54%; background: linear-gradient(0deg, rgb(var(--fm-shade) / 0), rgb(var(--fm-shade) / .6) 34%, rgb(var(--fm-shade) / .9) 70%, rgb(var(--fm-shade))); }
.fm-text { position: absolute; left: 0; right: 0; z-index: 2; padding: 0 24px; display: flex; flex-direction: column; align-items: center; text-align: center; color: var(--fm-ink); }
.fm-cover--bottom .fm-text { bottom: 0; padding-bottom: max(30px, calc(env(safe-area-inset-bottom) + 18px)); }
.fm-cover--top .fm-text { top: 0; padding-top: max(34px, calc(env(safe-area-inset-top) + 22px)); }
.film:has(> .demo-bar, > .inv-music) .fm-cover--bottom .fm-text { padding-bottom: max(84px, calc(env(safe-area-inset-bottom) + 72px)); }
.fm-intro { margin: 0 0 8px; max-width: 26ch; font: italic 400 20px/1.3 var(--fb); text-wrap: balance; }
.fm-names { --ns: min(clamp(50px, 15vw, 72px), 7.4cqh); margin: 0; font: 400 var(--ns)/.98 var(--fs); color: var(--fm-name); overflow-wrap: anywhere; }
.fm-names--m { --ns: min(clamp(44px, 13vw, 60px), 6.6cqh); }
.fm-names--l { --ns: min(clamp(38px, 11.4vw, 50px), 5.8cqh); }
.fm-names > span { display: block; }
.fm-and { font-size: .5em; line-height: 1; margin: .04em 0 .06em; color: var(--fm-ink); }
/* a birthday's age under the name */
.fm-sub { margin-top: .12em; font: 500 .34em/1.1 var(--fb); letter-spacing: .14em; text-transform: uppercase; color: var(--fm-acc); }
.fm-rule { display: block; width: 160px; height: 12px; margin: 14px 0 10px; position: relative;
  background: linear-gradient(90deg, transparent, var(--fm-acc) 30%, var(--fm-acc) 43%, transparent 43% 57%, var(--fm-acc) 57%, var(--fm-acc) 70%, transparent) 0 50% / 100% 1px no-repeat; }
.fm-rule::after { content: ""; position: absolute; left: 50%; top: 0; width: 12px; height: 12px; margin-left: -6px; background: var(--fm-acc);
  clip-path: polygon(50% 0, 64% 36%, 100% 50%, 64% 64%, 50% 100%, 36% 64%, 0 50%, 36% 36%); }
.fm-date { margin: 0; font: 500 21px/1.3 var(--fb); letter-spacing: .22em; text-transform: uppercase; }
.fm-when { margin: 4px 0 0; font: 500 12px/1.6 var(--fu); letter-spacing: .2em; text-transform: uppercase; color: var(--fm-acc); }
.js .fm-cover:not(.is-in) .fm-text > * { opacity: 0; }
@media (max-height: 640px) { .fm-intro { display: none; } }
/* «scroll down» (2026-11-22): the cover fills the screen, so a cue at its foot, level with the music button (its centre
   40px up) and above the demo bar; flagship-film.js adds .is-cue once the names are in, and the pill gently bobs */
.fm-more { position: absolute; z-index: 3; left: 50%; bottom: max(20px, calc(env(safe-area-inset-bottom) + 4px)); translate: -50% 0;
  display: inline-flex; align-items: center; gap: 8px; min-height: 40px; box-sizing: border-box; padding: 0 14px 0 18px; border-radius: 99px;
  white-space: nowrap; text-decoration: none; color: var(--fm-ink); font: 600 11px/1 var(--fu); letter-spacing: .18em; text-transform: uppercase;
  background: rgb(var(--fm-shade) / .8); border: 1px solid color-mix(in srgb, var(--fm-acc) 45%, transparent);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); box-shadow: 0 8px 24px -12px rgba(0, 0, 0, .45);
  -webkit-tap-highlight-color: transparent; transition: opacity .8s ease, transform .8s cubic-bezier(.22,.7,.18,1); }
.fm-more svg { width: 16px; height: 16px; color: var(--fm-acc); }
.fm-more:focus-visible { outline: 2px solid var(--fm-acc); outline-offset: 3px; }
.fm-cover.is-cue .fm-more { animation: fm-bob 2.2s ease-in-out 1s infinite; }
@keyframes fm-bob { 0%, 100% { transform: none; } 50% { transform: translateY(5px); } }
.js .fm-cover:not(.is-cue) .fm-more { opacity: 0; transform: translateY(10px); pointer-events: none; }
.film:has(> .demo-bar) .fm-more { bottom: max(80px, calc(env(safe-area-inset-bottom) + 68px)); }
/* the words at the foot (Göygöl, Bulud) stand clear of the cue */
.fm-cover--bottom:has(.fm-more) .fm-text { padding-bottom: max(76px, calc(env(safe-area-inset-bottom) + 60px)); }
.film:has(> .demo-bar) .fm-cover--bottom:has(.fm-more) .fm-text { padding-bottom: max(134px, calc(env(safe-area-inset-bottom) + 122px)); }
@media (max-width: 360px) { .fm-more { letter-spacing: .1em; padding: 0 12px 0 14px; } }
@media (prefers-reduced-motion: reduce) { .fm-cover.is-cue .fm-more { animation: none; } }
/* a cover wider than the film (a short desktop window): the film fits the height and its sides melt into the
   backdrop. 0.5625 = 9 / 16, the films' shape */
@container (aspect-ratio > 0.58) {
  .fm-still, .fm-film { object-fit: contain; --fm-b: calc((100cqw - 56.25cqh) / 2);
    -webkit-mask: linear-gradient(90deg, transparent var(--fm-b), #000 calc(var(--fm-b) + 56px), #000 calc(100% - var(--fm-b) - 56px), transparent calc(100% - var(--fm-b)));
    mask: linear-gradient(90deg, transparent var(--fm-b), #000 calc(var(--fm-b) + 56px), #000 calc(100% - var(--fm-b) - 56px), transparent calc(100% - var(--fm-b))); }
}

/* ================= the opening: the film over the cover's place ================= */
.fm-open { background: var(--fm-bg); }
.fm-open.is-play { cursor: default; }
.fm-reel { position: absolute; left: var(--cl, 0px); top: var(--ct, 0px); width: var(--cw, 100%); height: var(--ch, 100%); overflow: hidden; background: var(--fm-bg); container-type: size; }
.fm-reel-v { position: absolute; inset: 0; width: 100%; height: 100%; display: block; object-fit: cover; object-position: 50% 50%; }
@container (aspect-ratio > 0.58) {
  .fm-reel-v { object-fit: contain; --fm-b: calc((100cqw - 56.25cqh) / 2);
    -webkit-mask: linear-gradient(90deg, transparent var(--fm-b), #000 calc(var(--fm-b) + 56px), #000 calc(100% - var(--fm-b) - 56px), transparent calc(100% - var(--fm-b)));
    mask: linear-gradient(90deg, transparent var(--fm-b), #000 calc(var(--fm-b) + 56px), #000 calc(100% - var(--fm-b) - 56px), transparent calc(100% - var(--fm-b))); }
}
.fm-vignette { position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgb(var(--fm-shade) / .7), rgb(var(--fm-shade) / .2) 30%, transparent 46%, transparent 74%, rgb(var(--fm-shade) / .66)); }
.js .fm-open:not(.is-ready) .fm-reel { opacity: 0; }
.fm-wish { position: absolute; left: var(--cl, 0px); width: var(--cw, 100%); top: calc(var(--ct, 0px) + var(--ch, 100vh) * .25); margin: 0; padding: 0 22px;
  box-sizing: border-box; transform: translateY(-50%); pointer-events: none; z-index: 1; text-align: center;
  font: 400 clamp(46px, 13.5vw, 78px)/1.04 var(--fs); color: var(--fm-wish); text-wrap: balance; }
.js .fm-open:not(.is-ready) .fm-wish { opacity: 0; }
@media (max-height: 640px) { .fm-wish { font-size: clamp(38px, 11vw, 56px); } }
.fm-flood { position: absolute; inset: 0; opacity: 0; pointer-events: none; z-index: 1;
  background: radial-gradient(75% 60% at 50% 45%, var(--fm-flood), color-mix(in srgb, var(--fm-flood) 50%, transparent) 55%, transparent 85%); }
.fm-open .fx-open-t, .fm-open .fx-open-foot { z-index: 2; }
.fm-open .fx-open-t::before, .fm-open .fx-open-foot::before { content: ""; position: absolute; inset: -30px -16px; z-index: -1; pointer-events: none;
  background: radial-gradient(closest-side, rgb(var(--fm-shade) / .5), transparent); }

/* ================= a label printed on the cover's still («Qundaq»: the hospital band) =================
   FILM_FLAGSHIPS[…]['band'] gives the label's centre (--bx, --by) and width (--bw) as shares of the 9:16 picture and its
   turn (--ba); --pw is the picture's width as object-fit draws it (cover; contain on a wide window), so the print stays
   on the label at every screen shape. --n: the name's length, which sets its size. flagship-film.js types the lines in. */
.fm-band { --pw: max(100cqw, 56.25cqh); position: absolute; left: calc(50cqw + (var(--bx) - .5) * var(--pw)); top: calc(50cqh + (var(--by) - .5) * var(--pw) * 16 / 9);
  width: calc(var(--bw) * var(--pw)); aspect-ratio: 467 / 204; transform: translate(-50%, -50%) rotate(var(--ba)); box-sizing: border-box;
  padding: calc(var(--pw) * .011) calc(var(--pw) * .014) calc(var(--pw) * .009) calc(var(--pw) * .02);
  display: grid; grid-template-columns: 1fr auto; align-content: center; column-gap: calc(var(--pw) * .01);
  color: #2d2826; mix-blend-mode: multiply; pointer-events: none; font-family: "Onest", "Onest Fallback", system-ui, sans-serif; }
@container (aspect-ratio > 0.58) { .fm-band { --pw: 56.25cqh; } }
.fm-band-name { grid-column: 1 / -1; min-height: 1.15em; font-size: calc(var(--pw) * min(.029, .32 / var(--n))); line-height: 1.15; letter-spacing: .06em;
  white-space: nowrap; -webkit-text-stroke: .025em currentColor; }
.fm-band-day { align-self: end; min-height: 1.3em; font-size: calc(var(--pw) * .0165); line-height: 1.3; letter-spacing: .05em; white-space: nowrap; opacity: .86; }
.fm-band-code { align-self: end; width: calc(var(--pw) * .055); height: calc(var(--pw) * .028); opacity: .8; transition: opacity .6s ease;
  background: repeating-linear-gradient(90deg, currentColor 0 7%, transparent 7% 12%, currentColor 12% 15%, transparent 15% 21%, currentColor 21% 30%, transparent 30% 34%); }
.js .fm-band:not(.is-done) .fm-band-code { opacity: 0; }
