/* Moving screens: levitating hero phones, the screen wall you can fling, and the achievement badges that unlock.
 * Everything here is an enhancement: with no script, or when the visitor asks for less motion, the wall and the badges sit still. */

/* ---- hero: all three phones levitate ---- */
@keyframes m-float-l { 50% { transform: rotate(-5deg) translateY(-12px); } }
@keyframes m-float-r { 50% { transform: rotate(5deg) translateY(-12px); } }
@keyframes m-float-f { 50% { transform: translateY(-14px); } }
.hero__stage--trio .phone--left { animation: m-float-l 7s ease-in-out infinite; }
.hero__stage--trio .phone--right { animation: m-float-r 7.6s ease-in-out -3.8s infinite; }
.hero__stage--trio .phone--front { animation: m-float-f 6.4s ease-in-out -1.6s infinite; }
/* the rotated back phone used to push the page 12px wider than a phone screen */
.hero { overflow-x: clip; }

/* ---- screen wall: drifts left on its own; scroll, drag or swipe to speed it along ---- */
.wall { padding: clamp(32px, 5vw, 72px) 0 clamp(48px, 7vw, 96px); }
.wall .wrap { margin-bottom: clamp(20px, 3vw, 36px); }
/* The row clips sideways (the loop), so the phones' shadows need room below them: 120px of padding, cancelled by a negative margin so the page spacing is unchanged,
   and a mask that fades the last 100px to nothing, so the shadow melts into the page instead of ending on a line. */
.wall__row { overflow: hidden; padding: 12px 0 120px; margin-bottom: -80px;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent), linear-gradient(180deg, #000 calc(100% - 100px), transparent);
  mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent), linear-gradient(180deg, #000 calc(100% - 100px), transparent);
  -webkit-mask-composite: source-in; mask-composite: intersect; cursor: grab; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.wall__row.is-drag { cursor: grabbing; }
.wall__track { display: flex; gap: 22px; width: max-content; will-change: transform; animation: m-wall 80s linear infinite; }
.wall__row.is-js .wall__track { animation: none; }
.wall__track .phone { width: clamp(140px, 15vw, 190px); flex: none; padding: 7px; border-radius: 34px; }
.wall__track .phone img { border-radius: 28px; pointer-events: none; -webkit-user-drag: none; }
.wall__track .phone:nth-child(even) { transform: translateY(28px); }
@keyframes m-wall { to { transform: translateX(-50%); } }

/* ---- achievement badges that unlock ---- */
.m-badges { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.m-badge { position: relative; width: 52px; height: 52px; }
.m-badge img { position: absolute; inset: 0; width: 100%; height: 100%; transition: opacity 0.5s ease, transform 0.5s ease; }
.m-badge .un { opacity: 0; transform: scale(0.6); }
.m-badge.is-on .lk { opacity: 0; }
.m-badge.is-on .un { opacity: 1; transform: scale(1); }
.m-ach { margin-top: 36px; padding: 22px; border: 1px solid var(--line-strong); border-radius: 18px; background: var(--surface); }
.m-ach__h { font: 600 1.125rem/1.2 var(--head); margin: 0; }
.m-badges--16 { gap: 14px; }
.m-badges--16 .m-badge { width: 64px; height: 64px; }
.m-ach__c { margin: 14px 0 0; }
.m-ach__c b { color: var(--lime); }

/* ---- calmer for anyone who asks for it ---- */
@media (prefers-reduced-motion: reduce) {
  .hero__stage--trio .phone--left, .hero__stage--trio .phone--right, .hero__stage--trio .phone--front { animation: none; }
  .m-badge img { transition: none; }
  .wall__track { animation: none; }
  .wall__row { overflow-x: auto; cursor: auto; user-select: auto; }
  .wall__track .phone:nth-child(n+13) { display: none; }
}
