/* ============================================================
   Lipsmatch showcase — the reel gallery and the compare lightbox.

   This page rides the lipsmatch.com chrome: loader, mxd-header,
   overlay menu, grid container, buttons, footer, plus the .lm-*
   and .ls-* components from css/lipsmatch.css and
   css/lipsync-showcase.css. Nothing here re-declares a colour, a
   font or a button; everything below is only the two components
   this page owns and no other page has.

   Namespaced .lsx-* on purpose: css/lipsmatch.css already owns
   .lm, .lm-chip and .lm-chips, and this file loads after it.

   Theme-aware via the shared tokens. Template sets
   html { font-size: 62.5% }, so 1rem = 10px.
   ============================================================ */

.lsx,
.lsx-box {
  --lsx-radius: 24px;
  --lsx-radius-s: 14px;
  --lsx-screen: #0d0e11;         /* cinema-dark surfaces, fixed in both themes */
  font-family: var(--_font-default);
}
.lsx { position: relative; }
.lsx *,
.lsx-box * { box-sizing: border-box; }

/* .anim-uni-scale-in parks blocks at scale(1.2) before they reveal; on
   full-bleed blocks the overshoot spawns a horizontal scrollbar. Same
   guard css/lipsmatch.css uses for .lm. */
.mxd-section:has(.lsx) { overflow-x: clip; }

/* =========================================================
   Poster marquee — the hero's moving proof strip. Stills, not
   video, so the fold costs one decode instead of ten.
   ========================================================= */
.lsx-marquee {
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
}
.lsx-marquee__row {
  display: flex;
  gap: 1.2rem;
  width: max-content;
  animation: lsx-scroll 46s linear infinite;
}
.lsx-marquee:hover .lsx-marquee__row { animation-play-state: paused; }
.lsx-marquee__cell {
  flex: 0 0 auto;
  width: clamp(20rem, 24vw, 30rem);
  aspect-ratio: 16 / 9;
  border-radius: var(--lsx-radius-s);
  border: 1px solid var(--st-muted);
  background: var(--lsx-screen);
  overflow: hidden;
}
.lsx-marquee__cell img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
@keyframes lsx-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
@media (prefers-reduced-motion: reduce) {
  .lsx-marquee__row { animation: none; }
}

/* =========================================================
   Filter chips — the .lm-chip pill, in a selectable variant
   ========================================================= */
.lsx-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-bottom: clamp(2.4rem, 3.5vw, 3.6rem);
}
.lsx-chip {
  display: inline-flex; align-items: center;
  padding: 0.9rem 1.7rem;
  border-radius: 100px;
  border: 1px solid var(--st-muted);
  background: var(--base-tint);
  color: var(--t-muted);
  font-family: var(--_font-accent);
  font-size: 1.35rem; font-weight: var(--fw-medium);
  cursor: pointer;
  transition: border-color .3s, transform .3s, background .3s, color .3s;
}
@media (hover: hover) and (pointer: fine) {
  .lsx-chip:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    color: var(--t-bright);
  }
}
.lsx-chip.is-on {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--base);
}

/* =========================================================
   The gallery — one card per piece of work
   ========================================================= */
.lsx-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(32rem, 1fr));
  gap: clamp(1.2rem, 2vw, 2rem);
}
.lsx-card {
  position: relative;
  display: block;
  padding: 0;
  text-align: left;
  color: inherit;
  cursor: pointer;
  border-radius: var(--lsx-radius);
  border: 1px solid var(--st-muted);
  background: var(--base-tint);
  overflow: hidden;
  transition: transform .35s cubic-bezier(.22,1,.36,1), border-color .35s, box-shadow .35s;
}
@media (hover: hover) and (pointer: fine) {
  .lsx-card:hover {
    transform: translateY(-4px);
    border-color: var(--accent);
    box-shadow: 0 2.4rem 6rem -3rem rgba(0, 0, 0, .55);
  }
}
.lsx-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.lsx-card__media {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  background: var(--lsx-screen);
  overflow: hidden;
}
/* Two stacked layers on a multi-language card: the hidden one buffers the
   next language while the front one plays, then they swap. Mirrors the
   .lm-tile__layer cross-fade in css/lipsmatch.css. */
.lsx-card__vid {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0;
  transition: opacity .55s ease;
}
.lsx-card__vid.is-front { opacity: 1; }

/* the light band that sweeps across on each language change, the same
   beat as .lm-cycle__flash on the home-page player */
.lsx-card__flash {
  position: absolute; inset: 0; z-index: 2;
  background: linear-gradient(105deg, transparent 30%, rgba(255, 255, 255, .8) 50%, transparent 70%);
  opacity: 0;
  transform: translateX(-70%);
  pointer-events: none;
}
.lsx-card__media.is-flash .lsx-card__flash { animation: lsx-flash .5s ease-out; }
@keyframes lsx-flash {
  0% { opacity: 0; transform: translateX(-70%); }
  35% { opacity: .7; }
  100% { opacity: 0; transform: translateX(70%); }
}

/* the language currently on screen, lower-left over the scrim */
.lsx-card__lang {
  position: absolute; left: 1.2rem; bottom: 1.2rem; z-index: 3;
  font-family: var(--_font-accent);
  font-size: 1.3rem; font-weight: var(--fw-medium);
  letter-spacing: .01em;
  color: #fff;
  text-shadow: 0 1px 12px rgba(0, 0, 0, .7);
  pointer-events: none;
}
.lsx-card__lang:empty { display: none; }

.lsx-card__grad {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 52%, rgba(0, 0, 0, .6));
  pointer-events: none;
}

/* language count, upper-left over the scrim */
.lsx-card__langs {
  position: absolute; left: 1.2rem; top: 1.2rem; z-index: 2;
  display: inline-flex; align-items: center;
  padding: 0.5rem 1rem;
  border-radius: 100px;
  border: 1px solid rgba(255, 255, 255, .18);
  background: rgba(13, 14, 17, .68);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  color: #fff;
  font-family: var(--_font-accent);
  font-size: 1.2rem; font-weight: var(--fw-medium);
}

/* the affordance, lower-right; always visible on touch, on hover elsewhere */
.lsx-card__flip {
  position: absolute; right: 1.2rem; bottom: 1.2rem; z-index: 2;
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.5rem 1.1rem;
  border-radius: 100px;
  background: var(--accent);
  color: #161616;
  font-family: var(--_font-accent);
  font-size: 1.2rem; font-weight: var(--fw-semibold);
  opacity: 0;
  transform: translateY(0.5rem);
  transition: opacity .3s, transform .3s;
}
@media (hover: hover) and (pointer: fine) {
  .lsx-card:hover .lsx-card__flip { opacity: 1; transform: none; }
}
@media (hover: none) {
  .lsx-card__flip { opacity: 1; transform: none; }
}

.lsx-card__body {
  display: block;
  padding: 1.6rem 1.8rem 1.8rem;
}
.lsx-card__brand {
  display: block;
  font-family: var(--_font-accent);
  font-size: 1.2rem; letter-spacing: .16em; text-transform: uppercase;
  font-weight: var(--fw-semibold);
  color: var(--accent);
}
.lsx-card__title {
  display: block;
  margin: 0.4rem 0 1rem;
  font-family: var(--_font-accent);
  font-size: 2rem; font-weight: var(--fw-medium);
  line-height: 1.15;
  color: var(--t-bright);
}
.lsx-card__tags {
  display: flex; flex-wrap: wrap;
  gap: 0.5rem;
}
.lsx-tag {
  padding: 0.3rem 0.9rem;
  border-radius: 100px;
  border: 1px solid var(--st-muted);
  color: var(--t-muted);
  font-size: 1.15rem;
  line-height: 1.6;
}

/* =========================================================
   The lightbox — two stacked layers, one flip button.
   Fixed and above the header, with its own scroll context so
   Lenis (js/app.js) leaves the panel alone.
   ========================================================= */
.lsx-box {
  position: fixed; inset: 0; z-index: 1200;
  display: grid; place-items: center;
  padding: clamp(1rem, 3vw, 3rem);
}
.lsx-box[hidden] { display: none; }
.lsx-box__scrim {
  position: absolute; inset: 0;
  background: rgba(10, 10, 10, .88);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.lsx-box__panel {
  position: relative;
  display: flex; flex-direction: column;
  width: min(108rem, 100%);
  max-height: 92vh;
  border-radius: var(--lsx-radius);
  border: 1px solid var(--st-muted);
  background: var(--base-tint);
  overflow: hidden;
}
/* The stage is a mount for the shared Bourbon cycler (window.LM.buildCycle),
   which injects its own .lm-cycle__langs rail followed by a .lm-cycle stage.
   Those are styled by css/lipsmatch.css; all this does is give them room and
   cap the height so the title and blurb below stay visible on a short
   viewport. */
.lsx-box__stage {
  position: relative;
  flex: 0 0 auto;
  padding: clamp(1.4rem, 2.5vw, 2.4rem) clamp(1.4rem, 2.5vw, 2.4rem) 0;
}
.lsx-box__stage .lm-cycle {
  max-height: 56vh;
}
.lsx-box__stage .lm-cycle__layer {
  object-fit: contain;
}

.lsx-box__x {
  position: absolute; top: 1.2rem; right: 1.2rem; z-index: 5;
  width: 4rem; height: 4rem;
  display: grid; place-items: center;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 50%;
  background: rgba(13, 14, 17, .68);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  color: #fff;
  font-size: 1.8rem; line-height: 1;
  cursor: pointer;
  transition: border-color .3s, background .3s;
}
.lsx-box__x:hover { border-color: var(--accent); background: rgba(13, 14, 17, .9); }

.lsx-box__info {
  padding: clamp(1.8rem, 3vw, 2.8rem);
  overflow-y: auto;
  overscroll-behavior: contain;
}
.lsx-box__meta {
  font-family: var(--_font-accent);
  font-size: 1.2rem; letter-spacing: .16em; text-transform: uppercase;
  font-weight: var(--fw-semibold);
  color: var(--accent);
}
.lsx-box__title {
  margin: 0.6rem 0 0.8rem;
  font-family: var(--_font-accent);
  font-size: clamp(2rem, 3vw, 2.8rem);
  font-weight: var(--fw-medium);
  line-height: 1.15;
  color: var(--t-bright);
}
.lsx-box__blurb {
  margin: 0;
  max-width: 70ch;
  font-size: 1.6rem; line-height: 1.55;
  color: var(--t-muted);
}
.lsx-box__hint {
  margin: 1.4rem 0 0;
  display: inline-flex; align-items: center; gap: 0.7rem;
  font-size: 1.3rem;
  color: var(--t-muted-extra);
}
.lsx-box__hint i { font-size: 1.6rem; color: var(--accent); }

body.lsx-locked { overflow: hidden; }

/* =========================================================
   Booking block — the shared demo-schedule widget, sat beside
   the pitch. The widget reads the theme tokens directly, so it
   needs no palette mapping here.
   ========================================================= */
.lsx-book {
  display: grid;
  grid-template-columns: 1fr 1.05fr;
  gap: clamp(2rem, 4vw, 4rem);
  align-items: start;
}
.lsx-book__cal { min-width: 0; }
.lsx-book__points {
  list-style: none;
  margin: 2.4rem 0 1.6rem;
  padding: 0;
  display: grid; gap: 1rem;
}
.lsx-book__points li {
  position: relative;
  padding-left: 2.6rem;
  font-size: 1.6rem; line-height: 1.45;
  color: var(--t-medium);
}
.lsx-book__points li::before {
  content: "";
  position: absolute; left: 0; top: 0.85rem;
  width: 1.6rem; height: 1px;
  background: var(--accent);
}
.lsx-book__points a { color: var(--accent); }
.lsx-fineprint {
  margin: 0;
  font-size: 1.3rem;
  color: var(--t-muted-extra);
}

@media (max-width: 991px) {
  .lsx-book { grid-template-columns: 1fr; }
}
@media (max-width: 767px) {
  .lsx-grid { grid-template-columns: 1fr 1fr; gap: 1rem; }
  .lsx-card__body { padding: 1.2rem 1.3rem 1.4rem; }
  .lsx-card__title { font-size: 1.6rem; }
  .lsx-card__tags { display: none; }
  .lsx-box__panel { max-height: 94vh; }
}
@media (max-width: 479px) {
  .lsx-grid { grid-template-columns: 1fr; }
  .lsx-card__tags { display: flex; }
}

/* A stress-test clip is a single unnamed take: the cycler still drives it,
   but there is no language rail worth showing. */
.lsx-box__stage.is-solo .lm-cycle__langs { display: none; }
