/* ==========================================================================
   KINGSLAND — THE CINEMATIC HERO
   A slow tour of the building: five scenes, each with its own photograph and
   its own words, cross-fading in step.

   THREE DECISIONS THAT MATTER

   1. THE BUTTONS NEVER MOVE. Photographs change, headlines change, the
      call-to-action does not. Nothing is worse than a button sliding out
      from under a thumb mid-tap. Everything above the buttons is stacked in
      a single CSS grid cell, so the block is always as tall as its tallest
      scene and nothing below it ever shifts.

   2. SLOW. Six seconds a scene, 1.6s to cross-fade, and a ken-burns drift
      slow enough that you notice it only if you look for it. Fast carousels
      feel like advertising; slow ones feel like film.

   3. IT STOPS WHEN IT SHOULD. Hidden tab, reduced-motion preference, or a
      visitor who presses pause — the tour holds still and the music stops.
   ========================================================================== */

.hero--cine {
  position: relative;
  min-height: 88svh;
  overflow: hidden;
}

/* ---------- the stage ---------- */
.cine__stage {
  position: absolute;
  inset: 0;
  background: #140c07;
}

.cine__slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 1.6s cubic-bezier(.4, 0, .2, 1);
  will-change: opacity;
}
.cine__slide.is-on { opacity: 1; }

.cine__slide img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.06);
  filter: saturate(1.05) contrast(1.04);
}

/* the drift only runs on the scene you are actually looking at, so the
   browser is never animating five images at once */
.cine__slide.is-on img { animation: kbIn 8.4s linear forwards; }
.cine__slide:nth-child(even).is-on img { animation-name: kbOut; }

@keyframes kbIn  { from { transform: scale(1.06) translate3d(0, 0, 0); }
                   to   { transform: scale(1.15) translate3d(-1.4%, -1.2%, 0); } }
@keyframes kbOut { from { transform: scale(1.15) translate3d(1.2%, 1%, 0); }
                   to   { transform: scale(1.06) translate3d(0, 0, 0); } }

/* ---------- the words ---------- */
/* every scene occupies the same grid cell, so the block is as tall as its
   tallest member and the buttons underneath never jump */
.cine__text {
  display: grid;
  margin-bottom: 26px;
}
.cine__scene {
  grid-area: 1 / 1;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .9s cubic-bezier(.22, .61, .36, 1),
              transform .9s cubic-bezier(.22, .61, .36, 1);
  pointer-events: none;
}
.cine__scene.is-on {
  opacity: 1;
  transform: none;
  pointer-events: auto;
  transition-delay: .35s;      /* let the photograph lead, words follow */
}
.cine__scene h1 { margin-bottom: 16px; }
.cine__scene .hero__lede { margin-bottom: 0; }

/* ---------- progress rail ---------- */
/* NOTE: lux.css puts .scrollcue dead centre at bottom:16px. The rail is also
   centred, so it has to sit clear above it or the two overlap. */
.cine__rail {
  position: absolute;
  left: 0; right: 0;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 54px);
  z-index: 3;
  display: flex;
  gap: 7px;
  justify-content: center;
  padding: 0 20px;
}
.cine__seg {
  position: relative;
  flex: 0 1 46px;
  height: 2px;
  border: 0;
  padding: 0;
  background: rgba(255, 251, 243, .26);
  border-radius: 999px;
  overflow: hidden;
  cursor: pointer;
}
.cine__seg::after {
  content: "";
  position: absolute;
  inset: 0;
  transform-origin: left center;
  transform: scaleX(0);
  background: var(--gold-light);
}
.cine__seg.is-done::after { transform: scaleX(1); }
.cine__seg.is-live::after { animation: segFill var(--hold, 6s) linear forwards; }
.cine__seg.is-held::after { animation-play-state: paused; }
@keyframes segFill { to { transform: scaleX(1); } }

/* ---------- controls ---------- */
.cine__ctrls {
  position: absolute;
  top: clamp(18px, 3vw, 28px);
  right: clamp(14px, 4vw, 26px);
  bottom: auto;
  left: auto;
  z-index: 4;
  display: flex;
  gap: 9px;
}

.cine__btn {
  width: 44px; height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(227, 197, 141, .42);
  background: rgba(14, 9, 5, .42);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--gold-light);
  cursor: pointer;
  transition: background .35s, border-color .35s, transform .25s;
}
.cine__btn:hover {
  background: rgba(227, 197, 141, .2);
  border-color: var(--gold-light);
}
.cine__btn:active { transform: scale(.93); }
.cine__btn svg { width: 17px; height: 17px; pointer-events: none; }
.cine__btn .ic-off { display: none; }
.cine__btn.is-off .ic-on  { display: none; }
.cine__btn.is-off .ic-off { display: block; }

/* a soft ring while music is playing, so the control explains itself */
.cine__btn--sound.is-live {
  border-color: var(--gold-light);
  box-shadow: 0 0 0 0 rgba(227, 197, 141, .5);
  animation: soundRing 2.6s ease-out infinite;
}
@keyframes soundRing {
  70%  { box-shadow: 0 0 0 12px rgba(227, 197, 141, 0); }
  100% { box-shadow: 0 0 0 0 rgba(227, 197, 141, 0); }
}

/* the first-time nudge — audio cannot start on its own, so say so once */
.cine__hint {
  position: absolute;
  top: 52px;
  right: 0;
  bottom: auto;
  left: auto;
  white-space: nowrap;
  font-size: .64rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(255, 251, 243, .62);
  background: rgba(14, 9, 5, .5);
  backdrop-filter: blur(6px);
  padding: 7px 11px;
  border-radius: 999px;
  border: 1px solid rgba(227, 197, 141, .24);
  opacity: 0;
  transform: translateY(4px);
  transition: opacity .6s, transform .6s;
  pointer-events: none;
}
.cine__hint.is-on { opacity: 1; transform: none; }

/* ---------- small screens ---------- */
@media (max-width: 619px) {
  .hero--cine { min-height: 92svh; }
  /* Reserve a clean lane for the persistent "Your order" companion. This
     keeps it away from the two hero actions on short phone screens. */
  .hero--cine .hero__in {
    padding-bottom: calc(148px + env(safe-area-inset-bottom, 0px));
  }
  .cine__seg { flex: 1 1 auto; max-width: 54px; }
  .cine__rail  { bottom: calc(env(safe-area-inset-bottom, 0px) + 50px); }
  .cine__ctrls {
    top: 14px;
    right: 14px;
    bottom: auto;
    left: auto;
  }
}

/* ---------- respect the setting ---------- */
@media (prefers-reduced-motion: reduce) {
  .cine__slide { transition: opacity .01s; }
  .cine__slide.is-on img { animation: none; transform: scale(1.02); }
  .cine__scene { transition: none; transform: none; }
  .cine__seg::after { animation: none; }
  .cine__btn--sound.is-live { animation: none; }
}
