/* lualdi.ai scroller (test page).
   One pinned stage. Scrolling through .lx drives a single 0..1 timeline in scroller.js,
   the same model as the Edolus replica: smoothed progress, camera keyframes with rest
   points, per-scene weights. Everything here is DOM overlay; the scene is the canvas. */

body { overflow-x: clip; }

.lx { position: relative; height: 935vh; }
.lx-stage {
  position: sticky; top: 0;
  height: 100vh; height: 100svh;
  overflow: hidden;
  background: radial-gradient(ellipse 80% 70% at 62% 46%, #0f1c27 0%, #09121a 52%, #05080c 100%);
  --veil: 0; --ra: 0;
}
.lx-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; opacity: 0; transition: opacity 1.4s ease; }
.lx-ready .lx-canvas { opacity: 1; }

/* legibility: a left-hand veil under the chapter copy, a soft vignette all round */
.lx-veil { position: absolute; inset: 0; pointer-events: none; opacity: var(--veil);
  background: linear-gradient(90deg, rgba(6, 10, 14, .88) 0%, rgba(6, 10, 14, .58) 30%, rgba(6, 10, 14, 0) 58%); }
.lx-shade { position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse 115% 90% at 55% 50%, transparent 58%, rgba(3, 6, 9, .62) 100%); }

/* intro: same geometry as the hero head (.e-head) on every other platform page */
.lx-intro { position: absolute; left: 40px; right: 40px; top: clamp(48px, 10vh, 120px);
  opacity: var(--a, 1); transform: translateY(var(--y, 0px)); will-change: opacity, transform; }
.lx .e-wordmark .amber-dot { align-self: flex-end; margin-bottom: .066em; margin-left: .08em; }
.lx-intro .eyebrow { margin-bottom: 14px; }

/* chapters */
.lx-ch { position: absolute; left: 40px; top: 50%; width: min(470px, calc(100vw - 80px)); margin: 0;
  opacity: var(--a, 0); transform: translateY(calc(-50% + var(--y, 0px)));
  filter: blur(calc((1 - var(--a, 0)) * 7px)); visibility: hidden; will-change: opacity, transform, filter; }
.lx-ch.on { visibility: visible; }
.lx-num { font-family: var(--f-mono); font-size: 11px; letter-spacing: .24em; color: var(--amber); }
.lx-rule { display: block; width: 32px; height: 1px; background: var(--amber); margin: 16px 0 20px; }
.lx-title { font-family: var(--f-display); font-weight: 800; font-size: clamp(28px, 2.8vw, 44px);
  line-height: 1.08; letter-spacing: -.02em; color: var(--silver-bright); margin: 0 0 20px; }
.lx-desc { font-size: 15px; line-height: 1.78; color: var(--silver); margin: 0; max-width: 440px; }

/* close: the scene settles into the page's own background, so the footer follows without a seam */
.lx-end { position: absolute; inset: 0; pointer-events: none; opacity: var(--e, 0);
  background: linear-gradient(180deg, rgba(13, 20, 27, .5) 0%, rgba(13, 20, 27, .82) 50%, var(--bg-0) 100%); }
.lx-outro { position: absolute; left: 20px; right: 20px; top: 63%; transform: translateY(-50%); text-align: center;
  opacity: var(--a, 0); filter: blur(calc((1 - var(--a, 0)) * 6px)); visibility: hidden; }
.lx-outro.on { visibility: visible; }
.lx-outro .wordmark { justify-content: center; margin-bottom: 14px; }
/* the lualdi.ai infinity mark: square pixels on a lemniscate, a pulse circulating the loop */
.lx-mark { display: block; width: clamp(150px, 15vw, 220px); height: auto; margin: 0 auto 30px; overflow: visible;
  filter: drop-shadow(0 0 7px rgba(34, 211, 238, .35)); }
.lx-mark .px { fill: rgba(34, 211, 238, .22); transform-box: fill-box; transform-origin: 50% 50%; animation: lx-flow 3s ease-in-out infinite; }
@keyframes lx-flow { 0%, 100% { fill: rgba(34, 211, 238, .22); transform: scale(.78); } 50% { fill: #67f0ff; transform: scale(1.18); } }
.lx-outro .hero-tag-row { justify-content: center; }
.lx-outro .btn { margin-top: 36px; }

/* chapter rail */
.lx-rail { position: absolute; right: 30px; top: 50%; transform: translateY(-50%);
  display: flex; flex-direction: column; gap: 4px; opacity: var(--ra); }
.lx-rail button { display: flex; align-items: center; justify-content: flex-end; gap: 10px;
  background: none; border: 0; padding: 7px 0; cursor: pointer;
  font-family: var(--f-mono); font-size: 10px; letter-spacing: .2em; color: var(--ink-2); transition: color .3s; }
.lx-rail button::after { content: ''; width: 14px; height: 1px; background: currentColor; transition: width .35s ease; }
.lx-rail button.on { color: var(--amber); }
.lx-rail button.on::after { width: 34px; }
.lx-rail button:hover { color: var(--silver-bright); }

/* readout, bottom left */
.lx-hud { position: absolute; left: 40px; bottom: 30px; display: flex; gap: 16px; align-items: baseline;
  font-family: var(--f-mono); font-size: 10px; letter-spacing: .24em; text-transform: uppercase;
  color: var(--ink-1); pointer-events: none; opacity: var(--hud, 1); }
.lx-hud-n { color: var(--amber); font-weight: 400; }

/* scroll cue: a mouse with a running wheel, a label, and a line that drips toward the next chapter */
.lx-hint { position: absolute; left: 50%; bottom: 30px; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 12px; cursor: pointer;
  font-family: var(--f-mono); font-size: 10px; letter-spacing: .32em; text-transform: uppercase;
  color: var(--silver); opacity: var(--a, 1); background: none; border: 0; padding: 6px 10px; white-space: nowrap; }
.lx-hint:hover { color: var(--silver-bright); }
.lx-mouse { position: relative; width: 22px; height: 34px; border: 1.5px solid rgba(238, 241, 247, .55); border-radius: 12px;
  box-shadow: 0 0 18px rgba(34, 211, 238, .18); }
.lx-mouse::after { content: ''; position: absolute; left: 50%; top: 7px; width: 3px; height: 7px; margin-left: -1.5px;
  border-radius: 2px; background: var(--amber); animation: lx-wheel 1.8s cubic-bezier(.45, .05, .55, .95) infinite; }
.lx-hint i { display: block; width: 1px; height: 30px; background: linear-gradient(var(--amber), transparent);
  transform-origin: top; animation: lx-drip 1.8s ease-in-out infinite; }
@keyframes lx-wheel { 0% { transform: translateY(0); opacity: 1; } 70% { transform: translateY(10px); opacity: 0; } 100% { transform: translateY(0); opacity: 0; } }
@keyframes lx-drip { 0% { transform: scaleY(0); opacity: 1; } 60% { transform: scaleY(1); opacity: 1; } 100% { transform: scaleY(1); opacity: 0; } }

/* touch: native snapping, one chapter per swipe (scroller.js places the stops) */
html.lx-snapping { scroll-snap-type: y mandatory; }
.lx-snap { position: absolute; left: 0; width: 1px; height: 1px; opacity: 0; pointer-events: none; scroll-snap-align: start; scroll-snap-stop: always; }

/* no WebGL: the copy still runs, over the gradient */
.lx-nogl .lx-canvas { display: none; }

@media (max-width: 900px) {
  .lx { height: 866vh; }
  html.lx-snapping .lx { height: 640vh; }       /* snapping on touch: a shorter swipe reaches the next chapter */
  .lx-intro { left: 22px; right: 22px; top: clamp(120px, 26vh, 240px); }
  .lx-ch { left: 22px; right: 22px; width: auto; top: auto; bottom: 70px; transform: translateY(var(--y, 0px)); }
  .lx-title { font-size: clamp(24px, 7vw, 32px); margin-bottom: 14px; }
  .lx-desc { font-size: 14px; line-height: 1.7; }
  .lx-rule { margin: 12px 0 14px; }
  .lx-veil { background: linear-gradient(0deg, rgba(6, 10, 14, .95) 0%, rgba(6, 10, 14, .72) 40%, rgba(6, 10, 14, 0) 68%); }
  .lx-rail { right: 12px; top: 40%; }          /* clear of the chapter copy on short phones */
  .lx-rail button { font-size: 0; gap: 0; padding: 8px 0; }
  .lx-rail button::after { width: 10px; }
  .lx-rail button.on::after { width: 22px; }
  .lx-hud { display: none; }
  .lx-hint { bottom: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  .lx-ch, .lx-outro { filter: none; }
  .lx-hint i, .lx-mouse::after { animation: none; }
  .lx-mark .px { animation: none; fill: #22d3ee; transform: scale(1); }
}
