/* assets/scroll3d.css — scroll-driven 3D for trust.php, features.php, changelog.php (2026-11-26).
   assets/scroll3d.js writes --in (1 = still below the fold, 0 = in place) and --out (0 = in place, 1 = scrolled past)
   on each element. Nothing moves until the script runs, and nothing moves with reduced motion. */

/* sections rise out of depth as they enter and lean back as they leave */
.s3d-sec {
  --in: 0; --out: 0; --oy: 0%;
  /* pivot on the top edge while entering, on the bottom edge while leaving (set by the script) */
  transform-origin: 50% var(--oy);
  transform: perspective(1400px)
             translate3d(0, calc(var(--in) * 90px), calc(var(--in) * -220px))
             rotateX(calc(var(--in) * 16deg - var(--out) * 7deg))
             scale(calc(1 - var(--out) * .05));
  opacity: calc(1 - var(--in) * .85 - var(--out) * .35);
  will-change: transform, opacity;
}
/* the hero only leaves: it tips back into the screen */
.s3d-hero {
  --out: 0;
  transform-origin: 50% 100%;
  transform: perspective(1200px) translate3d(0, calc(var(--out) * 40px), calc(var(--out) * -160px)) rotateX(calc(var(--out) * 14deg));
  opacity: calc(1 - var(--out) * .6);
  will-change: transform, opacity;
}
/* cards fan in: each column comes from a little deeper (--k = 0, 1, 2, 3). Individual properties, so the cards' own
   hover transform and the tilt (CSS rotate, aac3d.js) still work on top. */
.s3d-card {
  --in: 0; --k: 0;
  translate: 0 calc(var(--in) * (50px + var(--k) * 38px)) calc(var(--in) * (-60px - var(--k) * 50px));
  scale: calc(1 - var(--in) * .1);
}
/* changelog: release cards swing in from alternating sides, like pages of a book. The card keeps its own hover
   transform, so this uses the individual properties; the perspective comes from the parent .cl-release. */
.s3d-relwrap { perspective: 1300px; }
.s3d-rel {
  --in: 0; --out: 0; --dir: 1;
  transform-origin: calc(50% - var(--dir) * 50%) 50%;
  translate: calc(var(--in) * var(--dir) * 70px) calc(var(--in) * 40px) calc(var(--in) * -180px - var(--out) * 60px);
  rotate: 0 1 0 calc(var(--in) * var(--dir) * -24deg);
  opacity: calc(1 - var(--in) * .8 - var(--out) * .3);
  will-change: translate, rotate, opacity;
}

/* the 3D object that travels with the page (desktop only) */
.s3d-stage {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  opacity: 0; transition: opacity .8s ease;
}
.s3d-stage.on { opacity: 1; }
.s3d-stage canvas { display: block; width: 100% !important; height: 100% !important; }

/* progress rail on the right edge: one tick per step, the current one lit */
.s3d-rail {
  position: fixed; right: 18px; top: 50%; z-index: 20; translate: 0 -50%;
  display: flex; flex-direction: column; gap: 10px; pointer-events: none;
  opacity: 0; transition: opacity .5s ease;
}
.s3d-rail.on { opacity: 1; }
.s3d-rail i {
  display: block; width: 4px; height: 18px; border-radius: 4px;
  background: rgba(100, 116, 139, .35); transition: background .3s, box-shadow .3s, height .3s;
}
.s3d-rail i.done { background: rgba(52, 211, 153, .45); }
.s3d-rail i.on { height: 30px; background: #34d399; box-shadow: 0 0 12px rgba(52, 211, 153, .8); }
@media (max-width: 1100px) { .s3d-rail { display: none; } }

@media (prefers-reduced-motion: reduce) {
  .s3d-sec, .s3d-hero, .s3d-card, .s3d-rel { transform: none !important; translate: none !important; scale: none !important; rotate: none !important; opacity: 1 !important; }
  .s3d-stage, .s3d-rail { display: none; }
}
