/* =====================================================
   Motion FX — production
   ===================================================== */

/* ---------- H1 — Ink fill from cursor ---------- */
/* JS sets --ink-x / --ink-y on mouseenter; the ::before disc grows from there */
.fx-inkfill .home-teaser .teaser-head .cta,
.fx-inkfill .films-toolbar .filter,
.fx-inkfill .program .btn-book,
.fx-inkfill .booking button.primary,
.fx-inkfill .nav .lang button,
.fx-inkfill .teaser-cta-mobile a,
.fx-inkfill .show-list .btn {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  transition: color 0.35s ease;
}
.fx-inkfill .home-teaser .teaser-head .cta::before,
.fx-inkfill .films-toolbar .filter::before,
.fx-inkfill .program .btn-book::before,
.fx-inkfill .booking button.primary::before,
.fx-inkfill .nav .lang button::before,
.fx-inkfill .teaser-cta-mobile a::before,
.fx-inkfill .show-list .btn::before {
  content: '';
  position: absolute;
  left: var(--ink-x, 50%); top: var(--ink-y, 50%);
  width: 0; height: 0;
  background: var(--accent);             /* coral */
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.5s cubic-bezier(.7,0,.3,1),
              height 0.5s cubic-bezier(.7,0,.3,1);
  z-index: -1;
  pointer-events: none;
}
/* On dark/coral teasers, swap fill colour so it stays legible */
.fx-inkfill .home-teaser.coral .teaser-head .cta::before,
.fx-inkfill .home-teaser.ink   .teaser-head .cta::before { background: var(--ochre); }

/* Hover-only effects — gated to devices with real hover so they don't
   stick on touch where :hover persists after tap */
@media (hover: hover) {
  .fx-inkfill .home-teaser .teaser-head .cta:hover::before,
  .fx-inkfill .films-toolbar .filter:hover::before,
  .fx-inkfill .program .btn-book:hover::before,
  .fx-inkfill .booking button.primary:hover::before,
  .fx-inkfill .nav .lang button:hover::before,
  .fx-inkfill .teaser-cta-mobile a:hover::before,
  .fx-inkfill .show-list .btn:hover::before {
    width: var(--ink-size, 600px); height: var(--ink-size, 600px);
  }
  .fx-inkfill .home-teaser .teaser-head .cta:hover,
  .fx-inkfill .films-toolbar .filter:hover,
  .fx-inkfill .program .btn-book:hover,
  .fx-inkfill .booking button.primary:hover,
  .fx-inkfill .nav .lang button:hover,
  .fx-inkfill .teaser-cta-mobile a:hover,
  .fx-inkfill .show-list .btn:hover {
    color: var(--cream);
  }
  .fx-inkfill .home-teaser.coral .teaser-head .cta:hover,
  .fx-inkfill .home-teaser.ink   .teaser-head .cta:hover { color: var(--ink); }
}


/* ---------- H2 — Split-and-slide labels (nav hover) ---------- */
/* JS wraps the visible text in this stack (see ss-stack markup below) */
.fx-splitslide .ss-stack {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  height: 1em;
  line-height: 1;
  overflow: hidden;
  vertical-align: bottom;
}
.fx-splitslide .ss-half {
  display: block;
  height: 0.5em;
  overflow: hidden;
  position: relative;
  line-height: 1;
}
.fx-splitslide .ss-half span {
  display: block;
  transition: transform 0.32s cubic-bezier(.7,0,.3,1);
}
.fx-splitslide .ss-top span    { transform: translateY(0%); }
.fx-splitslide .ss-bottom span { transform: translateY(-50%); }
.fx-splitslide .ss-half.ss-replace { position: absolute; left: 0; right: 0; }
.fx-splitslide .ss-top.ss-replace    { top: 0; }
.fx-splitslide .ss-bottom.ss-replace { bottom: 0; }
.fx-splitslide .ss-top.ss-replace span    { transform: translateY(100%); }
.fx-splitslide .ss-bottom.ss-replace span { transform: translateY(-150%); }

@media (hover: hover) {
  .fx-splitslide .ss-host:hover .ss-top span    { transform: translateY(-100%); }
  .fx-splitslide .ss-host:hover .ss-bottom span { transform: translateY(50%); }
  .fx-splitslide .ss-host:hover .ss-top.ss-replace span    { transform: translateY(0%); }
  .fx-splitslide .ss-host:hover .ss-bottom.ss-replace span { transform: translateY(-50%); }
}


/* ---------- E6 — Stagger tilt-fall ---------- */
.fx-tiltfall .film-card,
.fx-tiltfall .film-row,
.fx-tiltfall .home-teaser .vitem,
.fx-tiltfall .about-poster-item,
.fx-tiltfall .guest,
.fx-tiltfall .gl-row,
.fx-tiltfall .program .slot {
  opacity: 0;
  transform: translateY(-32px) rotate(-4deg);
  transform-origin: center top;
  transition: opacity .7s cubic-bezier(.34,1.56,.64,1),
              transform .7s cubic-bezier(.34,1.56,.64,1);
  will-change: transform, opacity;
}
/* Enter via .in or .reveal-in (whichever your IntersectionObserver uses) */
.fx-tiltfall .reveal-in .film-card,
.fx-tiltfall .reveal-in .film-row,
.fx-tiltfall .reveal-in .home-teaser .vitem,
.fx-tiltfall .reveal-in .about-poster-item,
.fx-tiltfall .reveal-in .guest,
.fx-tiltfall .reveal-in .gl-row,
.fx-tiltfall .reveal-in .program .slot,
.fx-tiltfall .in .film-card,
.fx-tiltfall .in .film-row,
.fx-tiltfall .in .vitem,
.fx-tiltfall .in .about-poster-item,
.fx-tiltfall .in .guest,
.fx-tiltfall .in .gl-row,
.fx-tiltfall .in .slot {
  opacity: 1;
  transform: none;
}
/* Stagger the children inside containers tagged with .reveal-stagger or .in */
.fx-tiltfall .in > *:nth-child(1)  { transition-delay: 40ms; }
.fx-tiltfall .in > *:nth-child(2)  { transition-delay: 110ms; }
.fx-tiltfall .in > *:nth-child(3)  { transition-delay: 180ms; }
.fx-tiltfall .in > *:nth-child(4)  { transition-delay: 250ms; }
.fx-tiltfall .in > *:nth-child(5)  { transition-delay: 320ms; }
.fx-tiltfall .in > *:nth-child(6)  { transition-delay: 390ms; }
.fx-tiltfall .in > *:nth-child(7)  { transition-delay: 460ms; }
.fx-tiltfall .in > *:nth-child(8)  { transition-delay: 530ms; }
.fx-tiltfall .in > *:nth-child(9)  { transition-delay: 600ms; }
.fx-tiltfall .in > *:nth-child(10) { transition-delay: 670ms; }


/* ---------- Tilt + gleam — cursor-following 3D card hover ---------- */
/* JS (motion-fx.js bindTiltGleam) sets the transform + --gx/--gy/--gleam-op
   on any .fx-tilt element while the cursor is over it. */
@media (hover: hover) {
  .fx-tilt {
    position: relative;
    --gx: 50%; --gy: 50%; --gleam-op: 0;
    transition: transform 0.18s ease-out;
    will-change: transform;
  }
  .fx-tilt::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: radial-gradient(circle at var(--gx, 50%) var(--gy, 50%), rgba(255,255,255,0.4) 0%, transparent 60%);
    opacity: var(--gleam-op, 0);
    transition: opacity 0.25s;
    pointer-events: none;
    z-index: 2;
  }
}

/* ---------- Reduced motion fallback ---------- */
@media (prefers-reduced-motion: reduce) {
  .fx-tiltfall * { opacity: 1 !important; transform: none !important; transition: none !important; }
  .fx-tilt { transition: none !important; }
  .fx-tilt::after { display: none; }
}


/* ---------- Page transition — coral curtain wipe (desktop / hover devices only) ---------- */
@media (prefers-reduced-motion: no-preference) and (hover: hover) {
  html { overflow-x: clip; }
  body::after {
    content: "";
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    background: var(--accent);
    transform: translateX(100%);
    z-index: 9999;
    pointer-events: none;
    will-change: transform;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    animation: pgwipe-reveal 0.7s ease-out both;
  }
  body.is-leaving::after {
    /* ease-in: snaps to respond immediately to tap, rather than starting slow */
    animation: pgwipe-cover 0.4s ease-in both;
  }
}
@keyframes pgwipe-reveal {
  0%   { transform: translateX(0); }
  100% { transform: translateX(100%); }
}
@keyframes pgwipe-cover {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(0); }
}
