/* The film (Lunille 1.3): a screen on the night, lit from behind like a moon behind a ridge. A
   poster and a round moon of a play button; nothing is fetched or played until the visitor asks
   (film.js). The controls are the page's own, small, along the screen's lower edge. Scoped to .film. */
.film {
  position: relative; isolation: isolate;
  padding: clamp(4rem, 8vw, 7rem) var(--sc-gutter) clamp(4.5rem, 8vw, 7.5rem);
  background:
    radial-gradient(56% 42% at 50% 62%, rgb(255 211 161 / 0.07), transparent 72%),
    radial-gradient(70% 50% at 50% 60%, rgb(60 72 140 / 0.2), transparent 75%),
    var(--sc-canvas);
}
.film__inner { max-width: 66rem; margin: 0 auto; display: grid; justify-items: center; gap: clamp(1.75rem, 3vw, 2.5rem); }
.film__head { display: grid; gap: 14px; justify-items: center; text-align: center; }
.film__eyebrow { margin: 0; font-size: 14px; font-weight: 600; color: var(--sc-accent); letter-spacing: 0.01em; }
.film__lede { max-width: 44ch; font-size: var(--sc-t-base); line-height: 1.55; }

.film__frame {
  /* As wide as the column, but never taller than the window leaves room for under the heading. */
  position: relative; width: min(100%, max(34rem, (100vh - 21rem) * 16 / 9)); aspect-ratio: 16 / 9; border-radius: clamp(14px, 2vw, 24px); overflow: hidden;
  background: #000;
  box-shadow: 0 0 0 1px rgb(255 255 255 / 0.1), 0 0 0 6px rgb(255 255 255 / 0.025),
    0 40px 90px -30px rgb(0 0 0 / 0.8), 0 0 140px -30px rgb(255 211 161 / 0.22);
}
.film__video, .film__poster, .film__poster img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.film__video { object-fit: contain; background: #000; }
.film__poster img { object-fit: cover; }
.film__poster { transition: opacity 400ms ease; }
.film__poster::after { content: ""; position: absolute; inset: 0; background: radial-gradient(60% 60% at 50% 55%, rgb(8 10 22 / 0.28), rgb(8 10 22 / 0.5)); }
.film__frame.is-started .film__poster { opacity: 0; pointer-events: none; }

/* The play button: a small full moon in the middle of the screen. */
.film__play {
  position: absolute; left: 50%; top: 50%; width: clamp(76px, 9vw, 104px); aspect-ratio: 1; transform: translate(-50%, -50%);
  display: grid; place-items: center; padding: 0; border: 0; border-radius: 50%; cursor: pointer;
  color: var(--sc-accent-ink); background: radial-gradient(circle at 36% 30%, #FFF1DC, var(--sc-accent) 62%, #E9B67E);
  box-shadow: 0 0 0 10px rgb(255 211 161 / 0.16), 0 0 60px rgb(255 211 161 / 0.5), 0 12px 30px rgb(0 0 0 / 0.45);
  transition: transform 220ms var(--sc-ease-out, ease-out), box-shadow 220ms ease, opacity 300ms ease;
}
.film__play i { font-size: clamp(28px, 3.4vw, 38px); margin-left: 4px; }
.film__play:hover { transform: translate(-50%, -50%) scale(1.06); box-shadow: 0 0 0 14px rgb(255 211 161 / 0.2), 0 0 80px rgb(255 211 161 / 0.6), 0 12px 30px rgb(0 0 0 / 0.45); }
.film__play:active { transform: translate(-50%, -50%) scale(0.97); }
.film__play:focus-visible { outline: 3px solid #fff; outline-offset: 6px; }
.film__play::before { content: ""; position: absolute; inset: -10px; border-radius: 50%; border: 1px solid rgb(255 211 161 / 0.55); animation: film-ring 2.8s ease-out infinite; }
@keyframes film-ring { from { transform: scale(1); opacity: 0.7; } to { transform: scale(1.55); opacity: 0; } }
.film__length { position: absolute; left: 50%; top: calc(50% + clamp(58px, 7vw, 78px)); transform: translateX(-50%); margin: 0; font-size: 13px; font-weight: 600; letter-spacing: 0.04em; color: #fff; text-shadow: 0 1px 8px rgb(0 0 0 / 0.6); white-space: nowrap; transition: opacity 300ms ease; }
.film__frame.is-started .film__play, .film__frame.is-started .film__length { opacity: 0; pointer-events: none; }

/* The controls: along the lower edge once the film has started; they step back while it plays
   and nobody is near (never on touch, and never while a control has the keyboard). */
.film__bar {
  position: absolute; left: 0; right: 0; bottom: 0; display: flex; align-items: center; gap: 10px;
  padding: 28px clamp(10px, 1.6vw, 18px) clamp(8px, 1.2vw, 12px);
  background: linear-gradient(180deg, rgb(0 0 0 / 0), rgb(0 0 0 / 0.72));
  opacity: 0; pointer-events: none; transition: opacity 240ms ease;
}
.film__frame.is-started .film__bar { opacity: 1; pointer-events: auto; }
@media (hover: hover) and (pointer: fine) {
  .film__frame.is-playing:not(:hover):not(:focus-within) .film__bar { opacity: 0; }
}
.film__bar button {
  flex: none; display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 0; border-radius: 50%; cursor: pointer;
  color: #fff; background: rgb(255 255 255 / 0.12); transition: background-color 160ms ease, transform 160ms ease;
}
.film__bar button:hover { background: rgb(255 255 255 / 0.22); }
.film__bar button:active { transform: scale(0.94); }
.film__bar button:focus-visible, .film__seek:focus-visible { outline: 2px solid var(--sc-accent); outline-offset: 2px; }
.film__bar i { font-size: 18px; }
.film__seek { flex: 1 1 auto; min-width: 40px; height: 24px; margin: 0; background: transparent; accent-color: var(--sc-accent); cursor: pointer; }
.film__time { flex: none; font-size: 12px; font-variant-numeric: tabular-nums; color: rgb(255 255 255 / 0.85); }
.film__note { margin: 0; text-align: center; font-size: var(--sc-t-sm); color: var(--sc-ink-soft); max-width: 60ch; text-wrap: balance; }

/* A phone gets the film's own upright cut. */
@media (max-width: 640px) {
  .film__frame { aspect-ratio: 9 / 16; width: min(100%, 21rem); max-height: 78vh; max-height: 78svh; }
  .film__time { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .film__play::before { animation: none; opacity: 0.5; }
  .film__play, .film__poster, .film__bar { transition: none; }
}
