/* ==========================================================================
   Hero film (Home only, loaded through pageCss). Added 24 Oct 2026.
   A silent looping preview fills the hero image column; a gold play button
   opens the full film with sound in a dialog with branded controls.
   Uses only the tokens in site.css. See DESIGN.md "Hero film".
   ========================================================================== */

/* --- the hero column ---------------------------------------------------- */
.hero__media {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  background-color: var(--green-mid);
  background-image: var(--hero-img);
  background-size: cover;
  background-position: 50% 50%;
}
.hero__loop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}
/* a soft forest-green veil so the button reads on any frame */
.hero__media::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(ellipse 60% 45% at 50% 52%, rgba(0, 35, 20, 0.34), rgba(0, 35, 20, 0) 100%),
    linear-gradient(0deg, rgba(0, 35, 20, 0.42) 0%, rgba(0, 35, 20, 0) 38%);
}

/* play button: gold disc, centred, icon only (its name is read by screen readers, not shown) */
.hero__watch {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 2;
  transform: translate(-50%, -50%);
  display: block;
  padding: 10px;
  border-radius: 50%;
  color: var(--off-white);
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}
.hero__watch-icon {
  position: relative;
  display: grid;
  place-items: center;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: var(--gold);
  color: var(--green);
  box-shadow: 0 0 0 8px rgba(201, 160, 86, 0.26), 0 14px 34px rgba(0, 0, 0, 0.28);
  transition: background-color 0.3s, transform 0.3s, box-shadow 0.3s;
}
.hero__watch-icon svg { width: 34px; height: 34px; margin-left: 5px; } /* optical centre of the triangle */
.hero__watch:hover .hero__watch-icon,
.hero__watch:focus-visible .hero__watch-icon {
  background: var(--gold-hover);
  transform: scale(1.05);
  box-shadow: 0 0 0 12px rgba(201, 160, 86, 0.3), 0 16px 38px rgba(0, 0, 0, 0.32);
}
.hero__watch:focus { outline: none; }
.hero__watch:focus-visible .hero__watch-icon { outline: 3px solid var(--cream); outline-offset: 6px; }

/* pause/play for the silent loop (WCAG 2.2.2: moving content over 5 seconds needs a pause) */
.hero__loop-toggle {
  position: absolute;
  right: 26px;
  bottom: 26px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid rgba(201, 160, 86, 0.75);
  background: rgba(0, 35, 20, 0.62);
  color: var(--cream);
  cursor: pointer;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  transition: background-color 0.3s, border-color 0.3s;
}
.hero__loop-toggle[hidden] { display: none; }
.hero__loop-toggle:hover { background: rgba(0, 35, 20, 0.88); border-color: var(--gold); }
.hero__loop-toggle:focus-visible { outline: 2px solid var(--cream); outline-offset: 2px; }
.hero__loop-toggle .icon-play,
.hero__loop-toggle.is-paused .icon-pause { display: none; }
.hero__loop-toggle.is-paused .icon-play { display: block; }

@media (max-width: 980px) {
  .hero__watch-icon { width: 76px; height: 76px; }
  .hero__watch-icon svg { width: 28px; height: 28px; margin-left: 4px; }
  .hero__loop-toggle { right: 18px; bottom: 18px; }
}

/* --- the film dialog ------------------------------------------------------ */
.film {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--cream);
  overflow: hidden;
}
.film[open] { display: grid; place-items: center; }
.film::backdrop {
  background: rgba(0, 20, 11, 0.9);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}
.film__frame {
  position: relative;
  width: min(1200px, calc(100vw - 48px), calc((100vh - 150px) * 16 / 9));
  aspect-ratio: 16 / 9;
  border-radius: var(--r-panel);
  overflow: hidden;
  background: #000;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(201, 160, 86, 0.35);
}
.film__frame:fullscreen { width: 100%; height: 100%; border-radius: 0; box-shadow: none; }
.film__video { display: block; width: 100%; height: 100%; object-fit: contain; background: #000; }
.film__video::cue {
  font-family: var(--font-sans);
  font-weight: 700;
  color: var(--off-white);
  background: rgba(0, 20, 11, 0.8);
}

/* big gold play disc, shown before the film starts and after it ends */
.film__big-play {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  width: 88px;
  height: 88px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--gold);
  color: var(--green);
  cursor: pointer;
  box-shadow: 0 0 0 8px rgba(201, 160, 86, 0.26), 0 14px 34px rgba(0, 0, 0, 0.3);
  transition: background-color 0.3s;
}
.film__big-play[hidden] { display: none; }
.film__big-play svg { margin-left: 4px; }
.film__big-play:hover { background: var(--gold-hover); }
.film__big-play:focus-visible { outline: 3px solid var(--cream); outline-offset: 6px; }

/* control bar */
.film__controls {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 48px 16px 12px;
  background: linear-gradient(0deg, rgba(0, 20, 11, 0.88) 0%, rgba(0, 20, 11, 0.55) 55%, rgba(0, 20, 11, 0) 100%);
  transition: opacity 0.35s;
}
.film.is-idle .film__controls { opacity: 0; }
.film.is-idle .film__frame { cursor: none; }
.film .film__controls:focus-within { opacity: 1; }
.film__btn {
  flex: none;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--cream);
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s;
}
.film__btn:hover { background: rgba(244, 242, 228, 0.14); }
.film__btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; }
.film__btn[aria-pressed="true"] { color: var(--gold); }
.film__btn .icon-play,
.film__btn .icon-muted,
.film__btn.is-paused .icon-pause,
.film__btn.is-muted .icon-sound { display: none; }
.film__btn.is-paused .icon-play,
.film__btn.is-muted .icon-muted { display: block; }
.film__time {
  flex: none;
  padding: 0 10px 0 6px;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  color: var(--cream);
}

/* seek bar: gold progress on a faint cream track, cream thumb with a gold edge */
.film__seek {
  --p: 0%;
  flex: 1;
  min-width: 60px;
  height: 44px;
  margin: 0 8px;
  background: transparent;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}
.film__seek:focus { outline: none; }
.film__seek::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(to right, var(--gold) var(--p), rgba(244, 242, 228, 0.32) var(--p));
}
.film__seek::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  margin-top: -6px;
  border-radius: 50%;
  background: var(--cream);
  border: 2px solid var(--gold);
  transition: box-shadow 0.2s;
}
.film__seek::-moz-range-track { height: 4px; border-radius: 2px; background: rgba(244, 242, 228, 0.32); }
.film__seek::-moz-range-progress { height: 4px; border-radius: 2px; background: var(--gold); }
.film__seek::-moz-range-thumb { width: 12px; height: 12px; border-radius: 50%; background: var(--cream); border: 2px solid var(--gold); }
.film__seek:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 4px rgba(201, 160, 86, 0.55); }
.film__seek:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 4px rgba(201, 160, 86, 0.55); }

.film__close {
  position: fixed;
  top: 20px;
  right: 20px;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--cream);
  color: var(--green);
  cursor: pointer;
  transition: background-color 0.3s;
}
.film__close:hover { background: var(--gold); }
.film__close:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }

@media (max-width: 767px) {
  .film__frame { width: calc(100vw - 24px); border-radius: 20px; }
  .film__controls { gap: 0; padding: 36px 6px 4px; }
  .film__time { font-size: 13px; padding: 0 4px; }
  .film__seek { margin: 0 4px; }
  .film__close { top: 14px; right: 14px; width: 44px; height: 44px; }
}
@media (max-width: 420px) {
  .film__time { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .hero__watch-icon, .film__controls, .hero__loop-toggle { transition: none; }
  .hero__watch:hover .hero__watch-icon,
  .hero__watch:focus-visible .hero__watch-icon { transform: none; }
}
