/* The film theatre: a play button over a hero photograph that is a frame of
   the film, and the dialog that plays it. Shared by the homeschool homepage
   (/, /homeschool), /players, /clubs and /trainers, each with its own film;
   film.js drives it.
   Kept out of style.css so the pages without a film do not carry it. */
/* ── The hero photograph, as the film's poster ───────────────────────────── */
/* .photo already supplies overflow:hidden and a --border hairline, so the
   overlay clips to the frame for free and the five other pages using
   .photo--hero are untouched. The label pill is OPAQUE --accent-navy on
   purpose: a translucent pill over a daylight photograph has no provable
   contrast ratio, while white on #1a1a2e is 17:1 — and --accent-navy is
   declared once in the theme-invariant :root scales block, so a cinema
   affordance does not change colour with the theme. The only literals here
   are neutral rgba scrims, hairlines and shadows, which is what
   .detail-modal-overlay, .photo and .vf-hash already do. */
.hero-film { position: relative; }
.hero-film img { transition: transform .5s cubic-bezier(.2,.7,.2,1); }

.hero-film-scrim {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(42% 52% at 50% 64%, rgba(0,0,0,.30), rgba(0,0,0,0) 72%),
    linear-gradient(to top, rgba(0,0,0,.72) 0%, rgba(0,0,0,.26) 34%, rgba(0,0,0,0) 66%);
  transition: opacity .3s ease;
}

.hero-film-open {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: flex-end;
  gap: 14px; padding: 0 16px 22px;
  text-decoration: none; cursor: pointer;
}

.hero-film-disc {
  width: 64px; height: 64px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--primary); color: var(--on-primary);
  box-shadow: 0 14px 40px rgba(0,0,0,.45), inset 0 0 0 1px rgba(255,255,255,.16);
  transition: transform .28s cubic-bezier(.2,.7,.2,1);
}
.hero-film-disc svg { width: 28px; height: 28px; margin-left: 3px; }

.hero-film-pill {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 8px 8px 8px 14px;
  border-radius: var(--radius-pill);
  background: var(--accent-navy);
  border: 1px solid rgba(255,255,255,.14);
  box-shadow: 0 10px 28px rgba(0,0,0,.42);
  color: var(--on-primary);
  font-size: var(--text-sm); font-weight: 700; letter-spacing: -.1px;
}
.hero-film-time {
  padding: 3px 9px; border-radius: var(--radius-pill);
  background: rgba(255,255,255,.14);
  font-size: var(--text-2xs); font-weight: 600;
  font-variant-numeric: tabular-nums; opacity: .88;
}

/* Hover and keyboard focus are deliberately the same state. The scrim comes
   BEFORE the link in the DOM, so this reaches it from the figure rather than
   with a ~ sibling selector, which would not match. */
.hero-film:hover .hero-film-scrim,
.hero-film:focus-within .hero-film-scrim { opacity: 1; }
.hero-film:hover img { transform: scale(1.022); }
.hero-film-open:hover .hero-film-disc,
.hero-film-open:focus-visible .hero-film-disc { transform: scale(1.09); }

/* ── The disc pulses ──────────────────────────────────────────────────── */
/* The main landing pages only: /players, /clubs and /trainers, and the
   homepage once its film is finished (Terry, 2026-10-18; DESIGN.md → Motion).
   The same soft ring the homeschool homepage carries (style.css), and only
   that: a white ring keeps leaving the disc and fading. A page opts in with
   data-film-call on its .hero-film figure and film.js arms it (.film-live),
   so with the script off the hero is the still photograph whose link plays
   the .mp4. Stopped under reduced motion. */
.film-live .hero-film-disc { position: relative; }
.film-live .hero-film-disc::after {
  content: ''; position: absolute; inset: 0;
  border-radius: 50%; border: 2px solid var(--on-primary);
  opacity: 0; pointer-events: none;
}
@media (prefers-reduced-motion: no-preference) {
  .film-live .hero-film-disc::after { animation: film-ring 2.8s var(--ease-standard) infinite; }
}
@keyframes film-ring {
  0%   { transform: scale(1);   opacity: .6; }
  100% { transform: scale(1.8); opacity: 0; }
}

.hero-film-open:focus-visible {
  outline: 3px solid var(--on-primary); outline-offset: -5px;
  border-radius: var(--radius);
}

/* 320px: the photo is only ~278 CSS px wide there (its own `sizes` says so),
   which is not room for a 64px disc stacked over a full-size pill. */
@media (max-width: 480px) {
  .hero-film-open { gap: 10px; padding: 0 12px 14px; }
  .hero-film-disc { width: 46px; height: 46px; }
  .hero-film-disc svg { width: 20px; height: 20px; }
  .hero-film-pill { padding: 6px 6px 6px 11px; font-size: var(--text-xs); }
  .hero-film-time { font-size: 11px; padding: 2px 7px; }
}

/* ── The theatre ─────────────────────────────────────────────────────────── */
.film-theatre {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  padding: 22px 16px;
  background: rgba(8,9,14,.88);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  animation: film-fade .24s ease both;
}
/* display:flex above would otherwise beat the [hidden] attribute's UA rule. */
.film-theatre[hidden] { display: none; }

.film-stage {
  position: relative; width: 100%; max-width: 1180px;
  display: flex; flex-direction: column; gap: 14px;
  animation: film-rise .3s cubic-bezier(.2,.7,.2,1) both;
}
.film-stage::before {
  content: ''; position: absolute; inset: -12% -8%; z-index: -1;
  pointer-events: none;
  background: radial-gradient(58% 54% at 50% 46%, var(--primary-glow), transparent 70%);
}

.film-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.film-kicker {
  margin: 0; color: var(--on-primary); opacity: .72;
  font-size: var(--text-xs); font-weight: 700;
  letter-spacing: .6px; text-transform: uppercase;
}
.film-close {
  flex: none; width: 40px; height: 40px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.10); border: 1px solid rgba(255,255,255,.18);
  color: var(--on-primary); cursor: pointer;
  transition: background .2s ease, transform .2s ease;
}
.film-close svg { width: 19px; height: 19px; }
.film-close:hover { background: rgba(255,255,255,.2); transform: scale(1.06); }
.film-close:focus-visible { outline: 3px solid var(--on-primary); outline-offset: 2px; }

/* Width is bounded by the room left over vertically, so the bar, the film and
   the CTA all stay on screen on a laptop in landscape. 16/9 then gives the
   height. dvh second, so a browser without it keeps the vh answer. */
.film-frame {
  width: min(100%, calc((100vh - 230px) * 16 / 9));
  width: min(100%, calc((100dvh - 230px) * 16 / 9));
  aspect-ratio: 16 / 9; margin: 0 auto;
  border-radius: var(--radius-lg); overflow: hidden;
  background: var(--accent-navy);
  box-shadow: 0 40px 100px -28px rgba(0,0,0,.85), 0 0 0 1px rgba(255,255,255,.10);
}
.film-video { display: block; width: 100%; height: 100%; background: var(--accent-navy); }
.film-video::cue { background: rgba(8,9,14,.82); line-height: 1.4; }

.film-foot {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
  gap: 10px 16px; text-align: center;
}
.film-foot p {
  margin: 0; color: var(--on-primary); opacity: .78; font-size: var(--text-sm);
}

@keyframes film-fade { from { opacity: 0 } to { opacity: 1 } }
@keyframes film-rise { from { opacity: 0; transform: translateY(14px) scale(.985) } to { opacity: 1; transform: none } }

@media (max-width: 640px) {
  .film-theatre { padding: 14px 12px; }
  .film-frame {
    width: min(100%, calc((100vh - 200px) * 16 / 9));
    width: min(100%, calc((100dvh - 200px) * 16 / 9));
  }
  .film-kicker { font-size: 11px; letter-spacing: .4px; }
  .film-foot p { font-size: var(--text-xs); }
}

@media (prefers-reduced-motion: reduce) {
  .hero-film img, .hero-film-disc, .hero-film-scrim, .film-close { transition: none; }
  .hero-film:hover img,
  .hero-film-open:hover .hero-film-disc,
  .hero-film-open:focus-visible .hero-film-disc,
  .film-close:hover { transform: none; }
  .film-theatre, .film-stage { animation: none; }
}
