/* =====================================================================================================================================
   THE FILM, IN A WINDOW: "Kino". Prototype, 24 Nov 2026 (Luka: "optimizovano, high end premium"; first on Stratum).
   Loaded after footer.css; public/assets/film.js runs it (CWKino.init). The kit's player (UI.film) still plays the film: this file only
   gives it its room.

   The idea: the film's own frame grows out of the button that opened it to the middle of the screen while the page steps back into the
   night; once it has settled, one band of light runs its foot and only then is play offered. The film is the one lit thing: no sheet, no
   border, no head. Under it the film's length as one rail cut into its chapters, the light growing along it as far as it has played; the
   chapters as quiet words under it. Playing and left alone, everything but the film steps away. At the end the frame turns to night and
   the film's last line rises in it, with the next step.

   Cost: transforms and opacity only; no blur, no backdrop filter, no blend mode, no mask; gradients with five stops at least and no
   color-mix (the hero lights' rule, so no shader of its own); one requestAnimationFrame only while the film plays.

   1 the window · 2 the frame · 3 the light on its foot · 4 the rail · 5 the words and the chapters · 6 the end · 7 left alone · 8 phones
   ===================================================================================================================================== */

:root { --fm-ice: #BFE9FA; --fm-ice-rgb: 191 233 250;--fm-veil-rgb: 4 10 26; --fm-ease: cubic-bezier(.16, 1, .3, 1); --fm-cut: cubic-bezier(.6, 0, .2, 1);
  --fm-w: min(1180px, calc(100vw - 2 * var(--co-margin, 24px)), calc((100svh - 370px) * 16 / 9)) }

/* ---------- 1 · the window: the whole screen, the page stepping back under the night ---------- */
.fm { position: fixed; inset: 0; z-index: 1000; box-sizing: border-box; width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; padding: 0;
  border: 0; background: transparent; color: var(--white, #fff); overflow: hidden auto; overscroll-behavior: contain; scrollbar-width: none }
.fm::-webkit-scrollbar { display: none }
.fm::backdrop { background: transparent }
.fm:focus { outline: none }
.fm__veil { position: fixed; inset: 0; background: rgb(var(--fm-veil-rgb) / .985) }
html.fm-lock { overflow: hidden; padding-right: var(--fm-sb, 0px) }

.fm__stage { position: relative; display: grid; justify-items: center; align-content: center; min-height: 100%; box-sizing: border-box;
  padding: 60px var(--co-margin, 24px) 32px }
.fm__film { width: var(--fm-w); gap: 0 }

/* the close: two lines, top right of the screen */
.fm__x { position: fixed; z-index: 2; top: 20px; right: 20px; display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0;
  border-radius: 12px; background: rgb(var(--white-rgb) / .06); color: var(--white, #fff); cursor: pointer;
  transition: background-color .2s var(--ease-soft, ease), rotate .35s var(--fm-ease) }
.fm__x svg { width: 18px; height: 18px }
@media (hover: hover) { .fm__x:hover { background: rgb(var(--white-rgb) / .12); rotate: 90deg } }
.fm__x:focus-visible { outline: 2px solid var(--white, #fff); outline-offset: 2px }

/* ---------- 2 · the frame: the film whole, lifted off the night ---------- */
.fm__frame { position: relative; transform-origin: 0 0 }
.fm .fm__screen { --film-bezel: 0px; padding: 0; border: 0; border-radius: 14px; background: #0B1730; overflow: hidden; isolation: isolate;
  box-shadow: 0 0 0 1px rgb(var(--white-rgb) / .07), 0 30px 80px -24px rgb(0 0 0 / .7) }
.fm .cw-film__video { border-radius: 0; background: #0B1730 }

/* play, offered only once the frame has settled: a ring and its triangle */
.fm .fm__big { width: 84px; border: 0; background: rgb(var(--fm-veil-rgb) / .62); color: var(--white, #fff); box-shadow: inset 0 0 0 1.5px rgb(var(--white-rgb) / .55);
  transition: opacity .3s var(--ease-soft, ease), scale .45s var(--fm-ease), box-shadow .25s var(--ease-soft, ease), background-color .25s var(--ease-soft, ease) }
.fm .fm__big svg { width: 30px; height: 30px; margin-left: 4px }
@media (hover: hover) { .fm .fm__big:hover { scale: 1.06; background: rgb(var(--fm-veil-rgb) / .5); box-shadow: inset 0 0 0 1.5px var(--white, #fff) } }
.fm .fm__big:focus-visible { outline: 2px solid var(--white, #fff); outline-offset: 4px }
.fm[data-arriving] .fm__big { opacity: 0; scale: .86 }
.fm .cw-film[data-started] .fm__big { display: grid; opacity: 0; scale: .9; pointer-events: none }

/* ---------- 3 · the light on its foot: one band runs the frame's lower edge once it has settled, then the edge glows once ---------- */
.fm__edge { position: absolute; left: 14px; right: 14px; bottom: -1px; height: 12px; margin-bottom: -6px; overflow: hidden; pointer-events: none }
.fm__edge::before { content: ""; position: absolute; left: 0; right: 0; top: 5.5px; height: 1px; opacity: 0;
  background: linear-gradient(to right, rgb(var(--cyan-rgb) / 0) 0%, rgb(var(--cyan-rgb) / .55) 18%, rgb(var(--cyan-rgb) / .7) 50%, rgb(var(--cyan-rgb) / .55) 82%, rgb(var(--cyan-rgb) / 0) 100%) }
.fm__edge::before { transition: opacity .9s var(--ease-soft, ease) }
.fm__edge.is-lit::before { opacity: 1; transition-duration: .25s }
.fm__band { position: absolute; left: 0; top: 0; width: 42%; height: 12px; translate: -100% 0 }
.fm__band::before, .fm__band::after { content: ""; position: absolute; left: 0; right: 0 }
.fm__band::before { top: 2px; height: 8px; border-radius: 50%; opacity: .45;
  background: linear-gradient(to right, rgb(var(--cyan-rgb) / 0) 0%, rgb(var(--cyan-rgb) / .15) 40%, rgb(var(--cyan-rgb) / .6) 80%, rgb(var(--cyan-rgb) / .9) 96%, rgb(var(--cyan-rgb) / 0) 100%) }
.fm__band::after { top: 5px; height: 2px; border-radius: 1px;
  background: linear-gradient(to right, rgb(var(--cyan-rgb) / 0) 0%, rgb(var(--cyan-rgb) / .5) 45%, rgb(var(--cyan-rgb) / .95) 78%, var(--fm-ice) 92%, rgb(var(--white-rgb) / .999) 97%, rgb(var(--white-rgb) / 0) 100%) }

/* ---------- 4 · the rail: the film's length cut into its chapters; the light grows along it as far as it has played ---------- */
.fm__bar { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-auto-columns: auto; grid-auto-flow: column; align-items: center; gap: 14px; margin-top: 22px }
.fm .fm__tog { width: 40px; height: 40px; min-height: 0; border: 0; border-radius: 10px; background: transparent; color: var(--white, #fff); box-shadow: none }
@media (hover: hover) { .fm .fm__tog:hover { background: rgb(var(--white-rgb) / .08) } }
.fm .fm__tog:focus-visible { outline: 2px solid var(--white, #fff); outline-offset: 0 }
.fm__track { position: relative; display: grid; align-items: center; height: 44px; cursor: pointer; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent }
.fm__segs { grid-area: 1 / 1; display: flex; gap: 3px; height: 3px; pointer-events: none; transition: scale .25s var(--fm-ease) }
.fm__segs > i { position: relative; flex: var(--g) 1 0; min-width: 0; height: 100%; border-radius: 1.5px; background: rgb(var(--white-rgb) / .16); overflow: hidden }
.fm__segs > i > b { position: absolute; inset: 0; background: rgb(var(--cyan-rgb) / .999); transform-origin: 0 50%; transform: scaleX(0) }
.fm__segs > i[data-past] { background: rgb(var(--white-rgb) / .22) }
.fm__head { grid-area: 1 / 1; position: relative; align-self: center; width: 0; height: 0; pointer-events: none }
.fm__head::before, .fm__head::after { content: ""; position: absolute; top: 50% }
.fm__head::before { left: -34px; width: 40px; height: 14px; margin-top: -7px; border-radius: 50%; opacity: .55;
  background: linear-gradient(to right, rgb(var(--cyan-rgb) / 0) 0%, rgb(var(--cyan-rgb) / .1) 35%, rgb(var(--cyan-rgb) / .5) 75%, rgb(var(--fm-ice-rgb, 191 233 250) / .8) 92%, rgb(var(--cyan-rgb) / 0) 100%) }
.fm__head::after { left: -14px; width: 15px; height: 3px; margin-top: -1.5px; border-radius: 1.5px;
  background: linear-gradient(to right, rgb(var(--cyan-rgb) / 0) 0%, rgb(var(--cyan-rgb) / .6) 30%, var(--fm-ice) 70%, rgb(var(--white-rgb) / .999) 92%, rgb(var(--white-rgb) / .999) 100%) }
.fm__film:not([data-started]) .fm__head::before, .fm__film:not([data-started]) .fm__head::after { opacity: 0 }
.fm .fm__seek { grid-area: 1 / 1; position: relative; z-index: 1; height: 44px; opacity: 0; pointer-events: none }   /* the keyboard's; the hand holds the rail itself (film.js 2) */
.fm .fm__seek:focus-visible { opacity: 1; outline: 2px solid var(--white, #fff); outline-offset: 0; border-radius: 6px }
.fm .fm__seek:focus-visible::-webkit-slider-runnable-track { background: transparent }
.fm .fm__seek:focus-visible::-webkit-slider-thumb { opacity: 0 }
.fm__track[data-hover] .fm__segs, .fm[data-scrub] .fm__segs { scale: 1 1.75 }
/* the grip: a short upright line at the light's end, while the rail is pointed at or held */
.fm__head > i { position: absolute; left: -1px; top: -8px; width: 2px; height: 16px; border-radius: 1px; background: rgb(var(--white-rgb) / .999);
  opacity: 0; transform: scaleY(.35); transition: opacity .2s var(--ease-soft, ease), transform .3s var(--fm-ease) }
.fm__track[data-hover] .fm__head > i, .fm[data-scrub] .fm__head > i { opacity: 1; transform: none }
.fm[data-scrub] .fm__head > i { transform: scaleY(1.15) }
.fm[data-scrub], .fm[data-scrub] * { cursor: grabbing }
/* held while it played: the film stands still underneath, but the toggle keeps saying it plays */
.fm[data-hold] .fm__tog [data-film-icon="pause"] { display: inline-flex !important }
.fm[data-hold] .fm__tog [data-film-icon="play"] { display: none !important }
/* where the pointer is: the time and the chapter, over the rail */
.fm__tip { position: absolute; left: 0; bottom: 38px; translate: var(--x, 0px) 0; padding: 6px 10px; border-radius: 8px; background: rgb(var(--white-rgb) / .999);
  color: var(--navy, #07122A); font: 600 12px/1.2 var(--font-sans); white-space: nowrap; pointer-events: none; opacity: 0; transition: opacity .15s var(--ease-soft, ease) }
.fm__tip > span { margin-right: 8px; font: 500 12px/1.2 var(--font-mono); color: #4A5A73; font-variant-numeric: tabular-nums }
.fm__track[data-hover] .fm__tip, .fm[data-scrub] .fm__tip { opacity: 1 }
.fm .fm__time { min-width: 11ch; text-align: right; font: 500 12px/1 var(--font-mono); letter-spacing: .02em; color: rgb(var(--white-rgb) / .62); font-variant-numeric: tabular-nums }

/* ---------- 5 · the words and the chapters ---------- */
.fm__foot { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 8px 32px; margin-top: 20px; padding: 0 2px }
.fm__title { margin: 0; font: 500 clamp(22px, 1.4vw + 10px, 30px)/1.12 var(--font-display); letter-spacing: -0.02em; color: var(--white, #fff); text-wrap: balance }
.fm__meta { margin: 8px 0 0; max-width: 52em; font: 500 13px/1.55 var(--font-sans); color: rgb(var(--white-rgb) / .62) }
.fm__meta b { font-weight: 600; color: rgb(var(--white-rgb) / .86) }
.fm .fm__now { font: 500 12px/1.3 var(--font-mono); color: rgb(var(--white-rgb) / .62); white-space: nowrap }
.fm__chs { display: flex; flex-wrap: wrap; gap: 2px 4px; margin: 18px 0 0; padding: 14px 0 0; list-style: none; border-top: 1px solid rgb(var(--white-rgb) / .1) }
.fm .fm__ch { position: relative; display: inline-flex; align-items: baseline; gap: 8px; min-height: 36px; margin: 0; padding: 8px 10px 10px; border: 0; border-radius: 8px;
  background: transparent; color: rgb(var(--white-rgb) / .62); font: 500 13px/1.2 var(--font-sans); cursor: pointer; transition: color .2s var(--ease-soft, ease), background-color .2s var(--ease-soft, ease) }
.fm .fm__ch > span { font: 500 11px/1 var(--font-mono); color: rgb(var(--white-rgb) / .42); font-variant-numeric: tabular-nums }
.fm .fm__ch::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: 3px; height: 1.5px; border-radius: 1px; background: rgb(var(--cyan-rgb) / .999);
  transform: scaleX(0); transform-origin: 0 50%; transition: transform .45s var(--fm-ease) }
@media (hover: hover) { .fm .fm__ch:hover { color: var(--white, #fff); background: rgb(var(--white-rgb) / .05) } }
.fm .fm__ch[aria-current="true"] { color: var(--white, #fff); background: transparent; border: 0 }
.fm .fm__ch[aria-current="true"] > span { color: rgb(var(--white-rgb) / .62) }
.fm .fm__ch[aria-current="true"]::after { transform: scaleX(1) }
.fm .fm__ch:focus-visible { outline: 2px solid var(--white, #fff); outline-offset: 0 }

/* the sound (a film with sound only): says what it will do */
.fm__sound { min-width: 76px; min-height: 36px; padding: 0 12px; border: 0; border-radius: 8px; background: transparent; box-shadow: inset 0 0 0 1px rgb(var(--white-rgb) / .22);
  color: var(--white, #fff); font: 600 13px/1 var(--font-sans); cursor: pointer; transition: background-color .2s var(--ease-soft, ease), opacity .6s var(--ease-soft, ease) }
@media (hover: hover) { .fm__sound:hover { background: rgb(var(--white-rgb) / .08) } }
.fm__sound:focus-visible { outline: 2px solid var(--white, #fff); outline-offset: 2px }
.fm[data-idle] .fm__sound { opacity: 0 }
/* what the film shows, in words (a film's text alternative where the page has one) */
.fm__text { margin: 10px 0 0 }
.fm__text > summary { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 2px; list-style: none; font: 600 13px/1.2 var(--font-sans); color: rgb(var(--white-rgb) / .72); cursor: pointer; border-radius: 6px }
.fm__text > summary::-webkit-details-marker { display: none }
.fm__text > summary .cw-nav__caret { border-color: currentColor }
.fm__text[open] > summary .cw-nav__caret { transform: translateY(2px) rotate(225deg) }
@media (hover: hover) { .fm__text > summary:hover { color: var(--white, #fff) } }
.fm__text > summary:focus-visible { outline: 2px solid var(--white, #fff); outline-offset: 2px }
.fm__text p, .fm__shows { margin: 8px 0 0; max-width: 64em; font: 400 14px/1.6 var(--font-sans); color: rgb(var(--white-rgb) / .72); text-wrap: pretty }
.fm__shows { display: grid; gap: 10px; padding: 0; list-style: none }
.fm__shows > li > span { display: inline-block; min-width: 3.4em; font: 500 12px/1 var(--font-mono); color: rgb(var(--white-rgb) / .45); font-variant-numeric: tabular-nums }
.fm__shows > li > b { font-weight: 600; color: var(--white, #fff) }
.fm[data-idle] .fm__text { opacity: 0 }
.fm__text { transition: opacity .6s var(--ease-soft, ease) }

/* ---------- 6 · the end: the frame turns to night and the film's last line rises in it ---------- */
.fm__end { position: absolute; inset: 0; z-index: 2; display: grid; place-content: center; justify-items: center; gap: 24px; padding: 24px; text-align: center;
  background: rgb(var(--fm-veil-rgb) / .86) }
.fm__end[hidden] { display: none }
.fm__end-t { margin: 0; max-width: 16em; font: 500 clamp(24px, 2.6vw + 8px, 44px)/1.08 var(--font-display); letter-spacing: -0.03em; color: var(--white, #fff); text-wrap: balance }
.fm__end-a { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px }
.fm__end-a .cw-btn { min-height: 44px }
.fm .fm__again { border: 0; background: rgb(var(--white-rgb) / .08); color: var(--white, #fff); box-shadow: inset 0 0 0 1px rgb(var(--white-rgb) / .22) }
@media (hover: hover) { .fm .fm__again:hover { background: rgb(var(--white-rgb) / .14) } }

/* ---------- 7 · left alone: while the film plays and nothing is touched, everything but the film steps away ---------- */
.fm__x, .fm__foot, .fm__chs, .fm .fm__tog, .fm .fm__time { transition: opacity .6s var(--ease-soft, ease) }
.fm__segs { transition: scale .25s var(--fm-ease), opacity .6s var(--ease-soft, ease) }
.fm[data-idle] .fm__x, .fm[data-idle] .fm__foot, .fm[data-idle] .fm__chs, .fm[data-idle] .fm__tog, .fm[data-idle] .fm__time { opacity: 0 }
.fm[data-idle] .fm__segs { opacity: .5 }
.fm[data-idle], .fm[data-idle] .cw-film__video { cursor: none }

/* ---------- 8 · phones: the frame the screen's width, the words under it ---------- */
@media (max-width: 599px) {
  .fm__stage { padding: 72px 16px 28px; align-content: start }
  .fm__veil { background: rgb(var(--fm-veil-rgb) / .995) }
  .fm { --fm-w: calc(100vw - 32px) }
  .fm .fm__screen { border-radius: 10px }
  .fm .fm__big { width: 64px } .fm .fm__big svg { width: 24px; height: 24px }
  .fm__foot { grid-template-columns: minmax(0, 1fr) } .fm .fm__now { display: none }
  .fm__x { top: 12px; right: 12px } }

@media print { .fm { display: none !important } }
@media (forced-colors: active) { .fm__segs > i { background: GrayText } .fm__segs > i > b { background: Highlight } .fm .fm__seek { opacity: 1 } }
