/* ==========================================================================
   Hero: the party reel from the live site, played once behind the real HTML
   headline and buttons. On wide screens it fills the right of the hero and
   fades into plum behind the copy; on portrait phones it fills the screen.

   Layers, back to front:
     .hero__frame--end    the film's last frame. The resting state, and all that
                          no-JS, reduced-motion and data-saver visitors ever see.
     .hero__frame--start  the film's first frame, shown while the film loads so the
                          resting frame is never painted and then wiped.
     .hero__video         the film. Hidden until it is actually playing.
     .hero__film::after   shade that keeps the copy readable.
   js/hero.js decides whether the film plays at all.
   ========================================================================== */

.hero {
  --head: 34px;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  overflow: clip;
  display: flex;
  flex-direction: column;
  min-height: clamp(580px, 92svh, 980px);
  color: var(--cream);
  background: var(--plum);
}

/* ---------------------------------------------------------------- film */
.hero__film {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: var(--plum);
}
.hero__frame,
.hero__frame img,
.hero__video {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}
.hero__frame img,
.hero__video {
  object-fit: cover;
  object-position: 50% 50%;
}
/* Wide screens: the reel (a landscape band cut from portrait footage) sits on the right
   three-quarters, so the faces on deck stay clear of the copy, and fades in from the left.
   The width is set outright, not left to "auto": a <video> sized "auto" takes its own shape
   (height x 1.35) instead of reaching the right edge, so on wide, short screens it stopped short
   and the still frame behind showed as a strip. The box is held to the right edge, 74% of the hero
   wide, but no wider than 2200px, so on ultra-wide screens the film is not blown up until only
   the tops of heads show. The crop keeps the left of the frame (0%), so the faces stay where they
   were framed, clear of the headline; film and stills share the rule, so the handover matches. */
@media (min-width: 861px) {
  .hero__frame,
  .hero__video {
    left: auto;
    right: 0;
    width: min(74%, 2200px);
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 32%);
    mask-image: linear-gradient(90deg, transparent 0, #000 32%);
  }
  .hero__frame img,
  .hero__video {
    object-position: 0% 50%;
  }
}
.hero__frame--start {
  opacity: 0;
  transition: opacity 0.6s ease;
}
.hero__video {
  opacity: 0;
  background: transparent;
}

/* While the film is due (head script) or running, the first frame stands in for it.
   Until js/hero.js knows that frame has loaded, the resting frame stays hidden behind it. */
.intro-pending .hero__frame--start,
.hero--intro .hero__frame--start {
  opacity: 1;
  transition: none;
}
.intro-pending .hero__frame--end {
  visibility: hidden;
}
/* Once the film has a frame on screen it covers everything. The last frame waits
   behind it, so when the film ends and hides there is nothing to swap. */
.hero--playing .hero__video,
.hero--frozen .hero__video {
  opacity: 1;
}
.hero--playing .hero__frame--start {
  opacity: 0;
  transition: none;
}

/* Shade: a little plum from the left where the copy runs onto the footage, more at the top
   behind the header, and a light fade at the foot into the sunset stripes. The footage itself
   is left as bright as it was shot. The side shade is held to the copy's right edge at every
   width: --copy-r repeats the .hero__inner sums (1320px max, centred; its left padding; the
   620px copy column), so keep the two in step. It stays dark to just short of the headline's
   right end, then fades out over the footage. */
.hero__film::after {
  --copy-r: calc(max(0px, (100% - 1320px) / 2) + max(20px, env(safe-area-inset-left, 0px), min(4vw, 56px)) + 620px);
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(29, 10, 38, 0.68) 0, rgba(29, 10, 38, 0.5) 90px, rgba(29, 10, 38, 0) 190px),
    linear-gradient(0deg, rgba(43, 15, 58, 0.4) 0, rgba(43, 15, 58, 0) 18%),
    linear-gradient(90deg, rgba(43, 15, 58, 0.6) 0, rgba(43, 15, 58, 0.55) calc(var(--copy-r) - 80px), rgba(43, 15, 58, 0) calc(var(--copy-r) + 200px));
}

/* A soft halo keeps the header and small type crisp over the brightest sky. */
.hero .site-nav a {
  text-shadow: 0 1px 2px rgba(29, 10, 38, 0.85), 0 0 12px rgba(29, 10, 38, 0.6);
}
.hero .site-head__brand {
  text-shadow: 2px 2px 0 var(--ink), 0 0 12px rgba(29, 10, 38, 0.6);
}

/* ---------------------------------------------------------------- copy */
.hero__inner {
  position: relative;
  z-index: 2;
  flex: 1;
  display: grid;
  align-items: center;
  width: 100%;
  max-width: 1320px;
  margin-inline: auto;
  padding-left: max(20px, env(safe-area-inset-left, 0px), min(4vw, 56px));
  padding-right: max(20px, env(safe-area-inset-right, 0px), min(5vw, 72px));
  padding-top: calc(var(--head) + clamp(48px, 7vw, 96px));
  padding-bottom: clamp(72px, 9vw, 120px);
}
.hero__copy {
  position: relative;
  container-type: inline-size;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(14px, 1.6vw, 22px);
  justify-items: start;
  width: min(100%, 620px);
  min-width: 0;
}
/* Stand-ins for Anton while it loads (or if it is blocked), scaled to Anton's width so the
   headline keeps its two lines and nothing jumps when Anton arrives. Measured on
   "LONDON BOAT PARTY": Impact 7% wider, DIN Condensed 14% narrower, Arial Narrow 21% wider. */
@font-face {
  font-family: "Anton Fallback";            /* Mac and Windows */
  src: local("Impact");
  size-adjust: 92%;
}
@font-face {
  font-family: "Anton Fallback Condensed";  /* iPhone and iPad */
  src: local("DIN Condensed Bold"), local("DINCondensed-Bold");
  size-adjust: 114%;
}
@font-face {
  font-family: "Anton Fallback Narrow";     /* everything else, Android included */
  src: local("Arial Narrow Bold"), local("ArialNarrow-Bold"), local("Roboto Condensed Bold"), local("RobotoCondensed-Bold");
  size-adjust: 81%;
}
/* Headline: a two-line poster lockup in Anton (tall condensed caps), cream over sun yellow.
   Sized off the column width (cqi), so "LONDON BOAT PARTY" fills the column at every screen size.
   Line 1 is set 6% larger so both lines end at the same right edge. If the words change, re-check
   that: the 12.9cqi and 1.06em suit these words in Anton. If no stand-in below is on the device
   either, the lines wrap rather than overflow. */
.hero__title {
  margin: 0;
  font-family: "Anton", "Anton Fallback", "Anton Fallback Condensed", "Anton Fallback Narrow", sans-serif;
  font-weight: 400;
  font-size: clamp(1.25rem, 12.9cqi, 5.6rem);   /* the column width decides; the floor only matters below a 155px column */
  line-height: 0.95;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  color: var(--cream);
  text-wrap: balance;
}
.hero__line {
  display: block;
  font-size: 1.06em;
  /* a flat ink offset, like a slightly misregistered print, keeps the edges sharp over the bright footage */
  text-shadow: 0.04em 0.045em 0 var(--ink);
}
.hero__line--2 {
  font-size: 1em;
  color: var(--sun);
}
.hero__lede {
  margin: 0;
  max-width: 26em;   /* keeps the line ends over the plum, clear of the brightest footage */
  font-size: clamp(1.05rem, 1.45vw, 1.32rem);
  line-height: 1.45;
  text-wrap: pretty;
  text-shadow: 0 1px 2px rgba(29, 10, 38, 0.75);
}
.hero__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 14px;
  align-items: center;
  margin-top: 4px;
}

/* ------------------------------------------------------------ controls */
.hero__controls {
  position: absolute;
  right: max(14px, env(safe-area-inset-right, 0px));
  bottom: 14px;
  z-index: 7;
  display: flex;
  gap: 8px;
}
.hero__ctl {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 44px;
  min-height: 44px;
  padding: 0 14px;
  border: 2px solid var(--cream);
  border-radius: 999px;
  background: rgba(29, 10, 38, 0.55);
  color: var(--cream);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.8rem;
  line-height: 1;
  cursor: pointer;
}
.hero__ctl:hover {
  background: rgba(29, 10, 38, 0.8);
}
.hero__ctl-icon {
  width: 18px;
  height: 18px;
  flex: none;
}
.hero__ctl-icon--play,
.hero__ctl[data-on="1"] .hero__ctl-icon--pause {
  display: none;
}
.hero__ctl[data-on="1"] .hero__ctl-icon--play {
  display: block;
}

/* Header lines up with the hero copy */
.hero .site-head__bar {
  max-width: 1320px;
  padding-left: max(20px, env(safe-area-inset-left, 0px), min(4vw, 56px));
  padding-right: max(20px, env(safe-area-inset-right, 0px), min(5vw, 72px));
}

/* ------------------------------------------ portrait phones: the tall cut */
/* Keep this query in step with the <source> media in index.html and TALL in js/hero.js. */
@media (max-width: 860px) and (max-aspect-ratio: 1/1) {
  /* The reel fills the top of the screen and fades out behind the copy, so the people
     and the bridge (in the middle of the portrait frame) sit above the text, not under it. */
  .hero__frame,
  .hero__video {
    bottom: auto;
    height: 64%;
    -webkit-mask-image: linear-gradient(180deg, #000 70%, transparent 100%);
    mask-image: linear-gradient(180deg, #000 70%, transparent 100%);
  }
  .hero__frame img,
  .hero__video {
    object-position: 50% 56%;
  }
}

/* ------------------------------------------- narrow: copy sits on the water */
@media (max-width: 860px) {
  .hero {
    min-height: max(560px, 88svh);
  }
  .hero__inner {
    align-items: end;
    padding-top: calc(var(--head) + 40px);
    padding-bottom: 28px;
  }
  .hero__copy {
    gap: 12px;
  }
  /* The copy carries its own shade, so it stays readable however tall the hero is. */
  .hero__copy::before {
    content: "";
    position: absolute;
    inset: -44px -40px -40px;
    z-index: -1;
    background: linear-gradient(180deg, rgba(43, 15, 58, 0) 0, rgba(43, 15, 58, 0.84) 52px, rgba(43, 15, 58, 0.9) 100%);
  }
  .hero__film::after {
    background:
      linear-gradient(180deg, rgba(29, 10, 38, 0.68) 0, rgba(29, 10, 38, 0.45) 70px, rgba(29, 10, 38, 0) 140px),
      linear-gradient(0deg, rgba(43, 15, 58, 0.92) 0, rgba(43, 15, 58, 0) 40%);
  }
  /* on a phone the two film controls are icon buttons, top right, clear of the ticket buttons,
     and above the transparent header bar they share the top of the screen with */
  .hero__controls {
    top: 6px;
    bottom: auto;
    gap: 6px;
    z-index: 25;
  }
  .hero__ctl {
    padding: 0;
    width: 44px;
  }
  .hero__ctl-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
}

/* very narrow phones: keep the wordmark clear of the two film buttons */
@media (max-width: 350px) {
  .hero .site-head__brand {
    font-size: 0.86rem;
  }
}
