/* ==========================================================================
   FILM — the product video (portal/public/video/), on / and /die-app
   ==========================================================================
   After /landing.css. The source is the latest /brag render
   (brag.mp4 in the newest brag-output-… folder, Hyperframes, 1920×1080),
   re-encoded for the web:
   1080p and 720p, H.264 with the moov atom up front so it starts before it
   has finished loading.

   How it behaves (js/film.js):
     · on screen, it plays muted and looping — a preview, so the page moves
       (only the window data-preview-from … data-preview-to, when set);
     · "Mit Ton ansehen" starts it from the top (or from ?t=), with sound, once;
     · chapter buttons ([data-film-chapter data-t]) start it at their time;
       the clock fills their hairline, and ticks mark them on the bar;
     · off screen or in a hidden tab it pauses; with prefers-reduced-motion
       or Save-Data it never starts by itself, the poster and the play
       button stand;
     · the controls are the page's: play, time, a scrubbable bar, sound,
       fullscreen. Space and K toggle, M mutes, F goes fullscreen.

   Prefix `fm-`. Greys only; the video brings its own colour.
   ========================================================================== */

[data-i="play"] { --m: url("/app/vendor/lucide/play.svg"); }
[data-i="pause"] { --m: url("/app/vendor/lucide/pause.svg"); }
[data-i="volume-2"] { --m: url("/app/vendor/lucide/volume-2.svg"); }
[data-i="volume-x"] { --m: url("/app/vendor/lucide/volume-x.svg"); }
[data-i="maximize"] { --m: url("/app/vendor/lucide/maximize.svg"); }
[data-i="rotate-ccw"] { --m: url("/app/vendor/lucide/rotate-ccw.svg"); }

.fm-section { width: min(100% - var(--ln-gut) * 2, var(--ln-max)); margin: 0 auto; padding-top: 120px; }
.fm-section .ln-section-head .ln-kicker .ln-i { --ln-i: 15px; }
.fm-muted { color: var(--ln-slate); }

.fm { --fm-glide: cubic-bezier(0.32, 0.72, 0, 1); position: relative; max-width: 1000px; margin: 44px auto 0; }
.fm-glow {
  position: absolute;
  left: 8%;
  right: 8%;
  top: -8%;
  height: 70%;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgb(var(--ln-tint) / 0.16), transparent);
  filter: blur(60px);
  pointer-events: none;
  transition: opacity 800ms ease;
}
.fm.is-playing .fm-glow { animation: fm-breathe var(--fm-bar, 2.98s) ease-in-out infinite; } /* one bar of the track; --fm-bar on .fm */
@keyframes fm-breathe { 50% { opacity: .65; } }

.fm-frame {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  background: #0a0b0d;
  box-shadow:
    0 0 0 1px rgb(0 0 0 / 0.6),
    0 1px 0 rgb(var(--ln-tint) / 0.08) inset,
    0 60px 120px -40px rgb(0 0 0 / 0.9);
  isolation: isolate;
  transform: translateZ(0);
}
.fm-frame::after { /* a hairline of light along the top edge */
  content: "";
  position: absolute;
  z-index: 3;
  left: 15%;
  right: 15%;
  top: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgb(var(--ln-tint) / 0.5), transparent);
  pointer-events: none;
}
.fm-video { display: block; width: 100%; height: 100%; object-fit: cover; background: #0a0b0d; }
.fm-frame:fullscreen { border-radius: 0; border: 0; }
.fm-frame:fullscreen .fm-video { object-fit: contain; }

/* The big button: in the middle while nothing plays, a pill in the corner
   while the muted preview runs. Same element, it only moves. */
.fm-cta {
  position: absolute;
  z-index: 4;
  left: 50%;
  top: 50%;
  display: inline-flex;
  align-items: center;
  gap: 14px;
  height: 64px;
  padding: 0 26px 0 10px;
  border: 1px solid rgb(255 255 255 / 0.18);
  border-radius: 999px;
  background: rgb(14 17 21 / 0.55);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  backdrop-filter: blur(20px) saturate(160%);
  color: #fff;
  font: inherit;
  font-size: 16px;
  font-weight: var(--w-semi);
  white-space: nowrap; /* left: 50% caps the shrink-to-fit width at half the frame; one line, always */
  cursor: pointer;
  box-shadow: 0 20px 50px -10px rgb(0 0 0 / 0.7);
  transform: translate(-50%, -50%);
  transition: transform 600ms var(--fm-glide), opacity 300ms ease, background 200ms ease, height 600ms var(--fm-glide), padding 600ms var(--fm-glide), font-size 600ms var(--fm-glide);
}
.fm-cta-disc { display: grid; flex: none; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: #fff; color: #0a0b0d; transition: width 600ms var(--fm-glide), height 600ms var(--fm-glide); }
.fm-cta-disc .ln-i { --ln-i: 20px; margin-left: 2px; }
.fm-cta small { color: rgb(255 255 255 / 0.6); font-size: .8em; font-weight: var(--w-medium); font-variant-numeric: tabular-nums; }
.fm-cta:active { transform: translate(-50%, -50%) scale(.97); }
.fm-cta .fm-cta-play, .fm-cta .fm-cta-sound { display: contents; }
.fm-cta .fm-cta-sound { display: none; }
@media (hover: hover) and (pointer: fine) {
  .fm-cta:hover { background: rgb(14 17 21 / 0.72); }
  .fm-cta:hover .fm-cta-disc { width: 48px; height: 48px; }
}
/* Preview: down to the lower left, smaller, and it offers the sound. */
.fm.is-preview .fm-cta { left: 24px; top: auto; bottom: 24px; height: 48px; padding: 0 18px 0 6px; font-size: 14px; transform: none; }
.fm.is-preview .fm-cta:active { transform: scale(.97); }
.fm.is-preview .fm-cta-disc { width: 36px; height: 36px; }
.fm.is-preview .fm-cta-play { display: none; }
.fm.is-preview .fm-cta .fm-cta-sound { display: contents; }
.fm.is-watching .fm-cta { opacity: 0; pointer-events: none; transform: translate(-50%, -50%) scale(.9); }
/* Without JS the native controls stay (film.js removes them); a button with
   no handler would only cover their tap-to-play area. <html class="js"> is
   set inline in the head of / and /die-app. */
html:not(.js) .fm-cta { display: none; }

/* The bar: shown while watching, on hover, on focus, and when paused. */
.fm-bar {
  position: absolute;
  z-index: 5;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 40px 14px 12px;
  background: linear-gradient(transparent, rgb(0 0 0 / 0.65));
  color: #fff;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 300ms ease, transform 400ms var(--fm-glide);
  pointer-events: none;
}
.fm.is-watching.is-idle .fm-bar { opacity: 0; transform: translateY(8px); }
.fm.is-watching .fm-bar,
.fm.is-watching.is-paused .fm-bar,
.fm.is-watching:focus-within .fm-bar { opacity: 1; transform: none; pointer-events: auto; }
.fm.is-watching.is-idle:not(.is-paused):not(:focus-within) .fm-bar { opacity: 0; transform: translateY(8px); pointer-events: none; }
.fm.is-watching.is-idle:not(.is-paused) .fm-frame { cursor: none; }
.fm-btn {
  display: grid;
  place-items: center;
  flex: none;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #fff;
  cursor: pointer;
  transition: background 150ms ease, transform 120ms var(--ease-out);
}
.fm-btn .ln-i { --ln-i: 18px; }
.fm-btn:active { transform: scale(.92); }
.fm-btn:focus-visible { outline: 2px solid #fff; outline-offset: -2px; }
@media (hover: hover) and (pointer: fine) { .fm-btn:hover { background: rgb(255 255 255 / 0.14); } }
.fm-time { flex: none; min-width: 84px; padding: 0 6px; font: 500 12px/1 var(--font-mono); font-variant-numeric: tabular-nums; color: rgb(255 255 255 / 0.85); }
.fm-track {
  position: relative;
  flex: 1;
  height: 28px;
  cursor: pointer;
  touch-action: none;
}
.fm-track::before, .fm-fill, .fm-buf {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 4px;
  margin-top: -2px;
  border-radius: 2px;
  transform-origin: 0 50%;
  transition: height 150ms ease, margin 150ms ease;
}
.fm-track::before { background: rgb(255 255 255 / 0.22); }
.fm-buf { background: rgb(255 255 255 / 0.3); transform: scaleX(var(--b, 0)); }
.fm-fill { background: #fff; transform: scaleX(var(--p, 0)); }
.fm-knob {
  position: absolute;
  top: 50%;
  left: calc(var(--p, 0) * 100%);
  width: 14px;
  height: 14px;
  margin: -7px 0 0 -7px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 8px rgb(0 0 0 / 0.5);
  transform: scale(0);
  transition: transform 200ms var(--fm-glide);
}
.fm-track:hover .fm-knob, .fm-track.is-drag .fm-knob, .fm-track:focus-visible .fm-knob { transform: scale(1); }
.fm-track:hover::before, .fm-track:hover .fm-fill, .fm-track:hover .fm-buf,
.fm-track.is-drag::before, .fm-track.is-drag .fm-fill, .fm-track.is-drag .fm-buf { height: 6px; margin-top: -3px; }
.fm-track:focus-visible { outline: none; }
.fm-track:focus-visible::before { box-shadow: 0 0 0 2px #fff; }

/* The end: replay and the next step. */
.fm-end {
  position: absolute;
  z-index: 6;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  background: rgb(8 10 12 / 0.72);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 500ms ease;
}
.fm-end > * { transform: translateY(10px); transition: transform 600ms var(--fm-glide); }
.fm.is-ended .fm-end { opacity: 1; pointer-events: auto; }
.fm.is-ended .fm-end > * { transform: none; }
.fm-end strong { font-size: clamp(20px, 2.4vw, 30px); font-weight: var(--w-semi); letter-spacing: -0.03em; color: #fff; }
.fm-end .ln-cta { margin: 0; }

/* Chapters under the frame, and the transcript. Inert until the markup has
   them (.fm-chapters, .fm-transcript). */
.fm-chapters { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 22px 0 0; padding: 0; list-style: none; }
.fm-chapter { position: relative; display: flex; align-items: baseline; gap: 10px; width: 100%; padding: 12px 2px 10px; border: 0; background: none; color: var(--ink-muted); font: inherit; font-size: var(--t-md); text-align: left; cursor: pointer; transition: color var(--d-fast) ease, transform 120ms var(--ease-out); }
.fm-chapter .mono { color: var(--ink-faint); font-size: 12px; font-variant-numeric: tabular-nums; }
.fm-chapter[aria-current="true"] { color: var(--ink); }
.fm-chapter-bar { position: absolute; left: 0; right: 0; top: 0; height: 2px; overflow: hidden; background: rgb(255 255 255 / .14); }
.fm-chapter-bar::after { content: ""; position: absolute; inset: 0; background: var(--ink); transform: scaleX(var(--cp, 0)); transform-origin: 0 50%; }  /* the video clock drives it: no transition */
.fm-chapter:active { transform: scale(.98); }
.fm-chapter:focus-visible { outline: 2px solid var(--line-focus); outline-offset: 2px; border-radius: var(--r-sm); }
.fm-tick { position: absolute; left: var(--x); top: 50%; width: 2px; height: 8px; margin: -4px 0 0 -1px; background: rgb(255 255 255 / .5); pointer-events: none; }
.fm-transcript { max-width: 62ch; margin: 18px auto 0; color: var(--ink-muted); font-size: 15px; }
.fm-transcript summary { display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--ink-faint); cursor: pointer; list-style: none; }
.fm-transcript summary::-webkit-details-marker { display: none; }
.fm-transcript ol { display: grid; gap: 8px; margin-top: 12px; padding-left: 1.2em; line-height: 1.6; }
/* The music credit (CC BY 4.0: title, author, source, licence). Last and quietest. */
.fm-credit { margin-top: 14px; color: var(--ink-faint); font-size: 12px; line-height: 1.5; text-align: center; text-wrap: balance; }
.fm-credit a { text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; transition: color var(--d-fast) ease, text-decoration-color var(--d-fast) ease; }
.fm-credit a:focus-visible { outline: 2px solid var(--line-focus); outline-offset: 2px; border-radius: var(--r-xs); }
@media (hover: hover) and (pointer: fine) {
  .fm-chapter:hover { color: var(--ink); }
  .fm-credit a:hover { color: var(--ink-muted); text-decoration-color: currentColor; }
}
@media (max-width: 640px) {
  .fm-chapters { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 62%; margin: 22px calc(var(--ln-gut) * -1) 0; padding: 0 var(--ln-gut); scroll-padding-inline: var(--ln-gut); overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain; scrollbar-width: none; }
  .fm-chapters li { scroll-snap-align: start; }
}

@media (max-width: 640px) {
  .fm-section { padding-top: 100px; }
  .fm { margin-top: 36px; }
  .fm-frame { border-radius: 14px; }
  .fm-cta { height: 54px; font-size: 15px; gap: 10px; padding-right: 20px; }
  .fm-cta-disc { width: 38px; height: 38px; }
  .fm.is-preview .fm-cta { left: 12px; bottom: 12px; height: 40px; font-size: 13px; padding-right: 14px; }
  .fm.is-preview .fm-cta-disc { width: 30px; height: 30px; }
  .fm-time { display: none; }
  .fm-bar { padding: 30px 8px 6px; gap: 2px; }
  .fm-end .ln-cta { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  .fm.is-playing .fm-glow { animation: none; }
  .fm-cta, .fm-bar, .fm-end > * { transition: opacity 200ms ease; }
}
