/* R54 — RU only, /ronin/ (PREVIEW). 1) «Кто RONIN» collage: the four figures are rigged (body + parts on SVG, same generated anonymous
   silhouettes as R48) and play slow-motion poses — kicker: slow kick, retract, second kick; samurai: raises the katana; wanderer: walks,
   staff planted and moved; zen: joined palms rise overhead. Desktop: figures drift on a slow orbit around the portrait (ru54.js),
   fading out while they pass above/below the card, so they never cross it. Phones: R49 one-at-a-time fade kept, figure drifts a little
   faster and its pose plays while it is shown. Modern/scientific counterweight (t154): megapolis, open laptop, books & scrolls,
   slowly floating formulas. 2) Pilgrim block: bigger text on phones; strip step 2.7 s. Reduced motion: everything static. */
.r54-rig svg{display:block;width:100%;height:100%;overflow:visible}
.r54-rig svg image{image-rendering:auto}
.r54-a{transform-box:view-box;animation-timing-function:cubic-bezier(.45,.05,.55,.95);animation-iteration-count:infinite;animation-fill-mode:both;animation-play-state:paused}
.r47-col.r47-run .r54-a{animation-play-state:running}
/* rest poses (also the reduced-motion pose): zen arms folded in the lap (hidden in the silhouette), others as drawn */
.r54-zn-up{transform:rotate(22.4deg) scaleY(1.021)}.r54-zn-fo{transform:translate(-35.0px,-5.0px) rotate(-54.8deg) scaleY(0.905)}
.r54-zn-up{animation-name:r54-zn-up;animation-duration:17s;animation-timing-function:linear}
.r54-zn-fo{animation-name:r54-zn-fo;animation-duration:17s;animation-timing-function:linear}
.r54-yk-th{animation-name:r54-yk-th;animation-duration:15s}
.r54-yk-sh{animation-name:r54-yk-sh;animation-duration:15s}
.r54-sm-sw{animation-name:r54-sm-sw;animation-duration:15s}
.r54-wd-bl{animation-name:r54-wd-bl;animation-duration:3.8s;animation-direction:alternate}
.r54-wd-fl{animation-name:r54-wd-fl;animation-duration:3.8s;animation-direction:alternate}
.r54-wd-bob{animation-name:r54-wd-bob;animation-duration:1.9s;animation-direction:alternate}
.r54-wd-st{animation-name:r54-wd-st;animation-duration:7.6s}
@keyframes r54-zn-up{0.00%{transform:rotate(22.4deg) scaleY(1.021)}8.00%{transform:rotate(22.4deg) scaleY(1.021)}8.30%{transform:rotate(24.3deg) scaleY(1.006)}9.18%{transform:rotate(27.0deg) scaleY(0.989)}10.55%{transform:rotate(30.4deg) scaleY(0.967)}12.37%{transform:rotate(34.3deg) scaleY(0.934)}14.56%{transform:rotate(38.9deg) scaleY(0.885)}17.07%{transform:rotate(45.1deg) scaleY(0.813)}19.83%{transform:rotate(54.0deg) scaleY(0.731)}22.78%{transform:rotate(65.5deg) scaleY(0.662)}25.86%{transform:rotate(78.4deg) scaleY(0.622)}29.00%{transform:rotate(90.0deg) scaleY(0.611)}32.14%{transform:rotate(-261.2deg) scaleY(0.617)}35.22%{transform:rotate(-254.2deg) scaleY(0.628)}38.17%{transform:rotate(-248.1deg) scaleY(0.640)}40.93%{transform:rotate(-242.0deg) scaleY(0.654)}43.44%{transform:rotate(-235.0deg) scaleY(0.678)}45.63%{transform:rotate(-226.6deg) scaleY(0.718)}47.45%{transform:rotate(-217.8deg) scaleY(0.777)}48.82%{transform:rotate(-210.3deg) scaleY(0.849)}49.70%{transform:rotate(-204.7deg) scaleY(0.922)}50.00%{transform:rotate(-201.3deg) scaleY(0.978)}68.00%{transform:rotate(-201.3deg) scaleY(0.978)}68.00%{transform:rotate(-201.3deg) scaleY(0.978)}68.19%{transform:rotate(-204.7deg) scaleY(0.922)}68.73%{transform:rotate(-210.3deg) scaleY(0.849)}69.58%{transform:rotate(-217.8deg) scaleY(0.777)}70.70%{transform:rotate(-226.6deg) scaleY(0.718)}72.06%{transform:rotate(-235.0deg) scaleY(0.678)}73.62%{transform:rotate(-242.0deg) scaleY(0.654)}75.33%{transform:rotate(-248.1deg) scaleY(0.640)}77.15%{transform:rotate(-254.2deg) scaleY(0.628)}79.06%{transform:rotate(-261.2deg) scaleY(0.617)}81.00%{transform:rotate(90.0deg) scaleY(0.611)}82.94%{transform:rotate(78.4deg) scaleY(0.622)}84.85%{transform:rotate(65.5deg) scaleY(0.662)}86.67%{transform:rotate(54.0deg) scaleY(0.731)}88.38%{transform:rotate(45.1deg) scaleY(0.813)}89.94%{transform:rotate(38.9deg) scaleY(0.885)}91.30%{transform:rotate(34.3deg) scaleY(0.934)}92.42%{transform:rotate(30.4deg) scaleY(0.967)}93.27%{transform:rotate(27.0deg) scaleY(0.989)}93.81%{transform:rotate(24.3deg) scaleY(1.006)}94.00%{transform:rotate(22.4deg) scaleY(1.021)}100.00%{transform:rotate(22.4deg) scaleY(1.021)}}
@keyframes r54-zn-fo{0.00%{transform:translate(-35.0px,-5.0px) rotate(-54.8deg) scaleY(0.905)}8.00%{transform:translate(-35.0px,-5.0px) rotate(-54.8deg) scaleY(0.905)}8.30%{transform:translate(-37.2px,-7.5px) rotate(-62.3deg) scaleY(0.868)}9.18%{transform:translate(-40.4px,-10.7px) rotate(-74.2deg) scaleY(0.844)}10.55%{transform:translate(-44.0px,-14.9px) rotate(-87.6deg) scaleY(0.862)}12.37%{transform:translate(-47.4px,-20.5px) rotate(-98.7deg) scaleY(0.917)}14.56%{transform:translate(-50.0px,-28.0px) rotate(-105.5deg) scaleY(0.975)}17.07%{transform:translate(-51.8px,-38.3px) rotate(-108.1deg) scaleY(1.009)}19.83%{transform:translate(-53.2px,-51.3px) rotate(-108.4deg) scaleY(1.024)}22.78%{transform:translate(-54.2px,-65.3px) rotate(-107.6deg) scaleY(1.027)}25.86%{transform:translate(-54.8px,-78.7px) rotate(-106.8deg) scaleY(1.026)}29.00%{transform:translate(-55.0px,-90.0px) rotate(-107.2deg) scaleY(1.029)}32.14%{transform:translate(-54.8px,-98.5px) rotate(-109.0deg) scaleY(1.038)}35.22%{transform:translate(-54.3px,-105.4px) rotate(-111.5deg) scaleY(1.050)}38.17%{transform:translate(-53.4px,-111.4px) rotate(-114.2deg) scaleY(1.062)}40.93%{transform:translate(-52.0px,-117.7px) rotate(-116.8deg) scaleY(1.071)}43.44%{transform:translate(-50.0px,-125.0px) rotate(-119.1deg) scaleY(1.074)}45.63%{transform:translate(-46.9px,-134.4px) rotate(-121.1deg) scaleY(1.066)}47.45%{transform:translate(-42.9px,-145.2px) rotate(-123.3deg) scaleY(1.050)}48.82%{transform:translate(-38.5px,-156.0px) rotate(-125.4deg) scaleY(1.030)}49.70%{transform:translate(-34.7px,-165.4px) rotate(-127.3deg) scaleY(1.013)}50.00%{transform:translate(-32.0px,-172.0px) rotate(-128.7deg) scaleY(1.002)}68.00%{transform:translate(-32.0px,-172.0px) rotate(-128.7deg) scaleY(1.002)}68.00%{transform:translate(-32.0px,-172.0px) rotate(-128.7deg) scaleY(1.002)}68.19%{transform:translate(-34.7px,-165.4px) rotate(-127.3deg) scaleY(1.013)}68.73%{transform:translate(-38.5px,-156.0px) rotate(-125.4deg) scaleY(1.030)}69.58%{transform:translate(-42.9px,-145.2px) rotate(-123.3deg) scaleY(1.050)}70.70%{transform:translate(-46.9px,-134.4px) rotate(-121.1deg) scaleY(1.066)}72.06%{transform:translate(-50.0px,-125.0px) rotate(-119.1deg) scaleY(1.074)}73.62%{transform:translate(-52.0px,-117.7px) rotate(-116.8deg) scaleY(1.071)}75.33%{transform:translate(-53.4px,-111.4px) rotate(-114.2deg) scaleY(1.062)}77.15%{transform:translate(-54.3px,-105.4px) rotate(-111.5deg) scaleY(1.050)}79.06%{transform:translate(-54.8px,-98.5px) rotate(-109.0deg) scaleY(1.038)}81.00%{transform:translate(-55.0px,-90.0px) rotate(-107.2deg) scaleY(1.029)}82.94%{transform:translate(-54.8px,-78.7px) rotate(-106.8deg) scaleY(1.026)}84.85%{transform:translate(-54.2px,-65.3px) rotate(-107.6deg) scaleY(1.027)}86.67%{transform:translate(-53.2px,-51.3px) rotate(-108.4deg) scaleY(1.024)}88.38%{transform:translate(-51.8px,-38.3px) rotate(-108.1deg) scaleY(1.009)}89.94%{transform:translate(-50.0px,-28.0px) rotate(-105.5deg) scaleY(0.975)}91.30%{transform:translate(-47.4px,-20.5px) rotate(-98.7deg) scaleY(0.917)}92.42%{transform:translate(-44.0px,-14.9px) rotate(-87.6deg) scaleY(0.862)}93.27%{transform:translate(-40.4px,-10.7px) rotate(-74.2deg) scaleY(0.844)}93.81%{transform:translate(-37.2px,-7.5px) rotate(-62.3deg) scaleY(0.868)}94.00%{transform:translate(-35.0px,-5.0px) rotate(-54.8deg) scaleY(0.905)}100.00%{transform:translate(-35.0px,-5.0px) rotate(-54.8deg) scaleY(0.905)}}
@keyframes r54-yk-th{0%{transform:rotate(80deg)}15%{transform:rotate(24deg)}29%{transform:rotate(0deg)}41%{transform:rotate(0deg)}52%{transform:rotate(22deg)}64%{transform:rotate(-4deg)}77%{transform:rotate(-4deg)}90%{transform:rotate(56deg)}100%{transform:rotate(80deg)}}
@keyframes r54-yk-sh{0%{transform:rotate(6deg)}15%{transform:rotate(112deg)}29%{transform:rotate(0deg)}41%{transform:rotate(0deg)}52%{transform:rotate(106deg)}64%{transform:rotate(0deg)}77%{transform:rotate(0deg)}90%{transform:rotate(70deg)}100%{transform:rotate(6deg)}}
@keyframes r54-sm-sw{0%,12%{transform:translate(0,0) rotate(0deg)}28%{transform:translate(4px,-30px) rotate(52deg)}46%,70%{transform:translate(10px,-78px) rotate(128deg)}92%,100%{transform:translate(0,0) rotate(0deg)}}
@keyframes r54-wd-bl{from{transform:rotate(-10deg)}to{transform:rotate(9deg)}}
@keyframes r54-wd-fl{from{transform:rotate(9deg)}to{transform:rotate(-10deg)}}
@keyframes r54-wd-bob{from{transform:translateY(0)}to{transform:translateY(-3px)}}
@keyframes r54-wd-st{0%{transform:translate(0,0) rotate(-6deg)}58%{transform:translate(0,0) rotate(7deg)}72%{transform:translate(0,-12px) rotate(2deg)}86%{transform:translate(0,-5px) rotate(-6deg)}100%{transform:translate(0,0) rotate(-6deg)}}

/* floating formulas / digits — generic math & physics notation, very low opacity, only beside the card */
.r54-fx{display:none;position:absolute;inset:0;pointer-events:none;z-index:0}
.r54-fx span{position:absolute;white-space:nowrap;font-family:var(--mono,ui-monospace,monospace);font-size:14px;letter-spacing:.04em;
  color:rgba(var(--c2),.9);opacity:0;filter:blur(.35px);text-shadow:0 0 10px rgba(var(--c2),.55);animation:r54-float 34s linear infinite;animation-play-state:paused}
.r47-col.r47-run .r54-fx span{animation-play-state:running}
@keyframes r54-float{0%{opacity:0;transform:translateY(26px)}18%{opacity:var(--o,.3)}78%{opacity:var(--o,.3)}100%{opacity:0;transform:translateY(-46px)}}

@media (min-width:1024px){
  .r54-fx{display:block}
  .r54-fx span:nth-child(odd){right:calc(50% + 250px + var(--fx,8vw))}
  .r54-fx span:nth-child(even){left:calc(50% + 250px + var(--fx,8vw))}
  /* orbit (ru54.js): figures are placed by transform from the column origin */
  .r47-col.r54-orb .r47-fig{left:0;right:auto;top:0;animation:none;transition:opacity .25s linear;will-change:transform,opacity}
  .r54-rig.r54-flip svg{transform:scaleX(-1)}
  /* modern motifs take the places of the manuscript, mountains and mala */
  .r54-books{right:calc(50% + 190px + 13vw);top:58%;width:clamp(260px,21vw,380px);opacity:.55;animation-duration:60s}
  .r54-megapolis{left:calc(50% + 110px + 9vw);top:26%;width:clamp(340px,31vw,580px);opacity:.75;animation-duration:76s}
  /* the open laptop orbits with the figures (ru54.js) so it is never hidden behind them */
  .r54-laptop{--w:clamp(250px,19vw,350px);right:calc(50% + var(--r50l) - var(--w)/2);top:30%;width:var(--w);opacity:.9;z-index:1;mix-blend-mode:lighten;animation-duration:70s;
    -webkit-mask-image:radial-gradient(ellipse 50% 50% at 50% 50%,#000 40%,rgba(0,0,0,.6) 68%,transparent 100%);mask-image:radial-gradient(ellipse 50% 50% at 50% 50%,#000 40%,rgba(0,0,0,.6) 68%,transparent 100%)}
  .r47-col .r47-p.r54-laptop{filter:blur(.4px) brightness(2) contrast(1.15)}
  html[data-theme="blue"] .r47-col .r47-p.r54-laptop{filter:blur(.4px) hue-rotate(205deg) saturate(.95) brightness(2.1) contrast(1.15)}
  .r47-col.r54-orb .r54-laptop{left:0;right:auto;top:0;animation:none;will-change:transform,opacity}
}
@media (min-width:1024px) and (max-width:1279px){.r54-fx span{--fx:0px!important;font-size:12px}}
@media (max-width:767px){
  /* figures: same one-at-a-time fade, a slightly faster drift while shown; pose plays only while shown (paused otherwise, no snap) */
  .r47-p.r47-fig{transform:translateY(18px) scale(.95);transition:opacity 2.2s ease-in-out,transform 6.5s linear}
  .r47-p.r47-fig.on{transform:translateY(-8px) scale(1)}
  .r47-col.r47-run .r47-fig:not(.on) .r54-a{animation-play-state:paused}
  .r54-zn-up,.r54-zn-fo{animation-duration:9s}
  .r54-yk-th,.r54-yk-sh,.r54-sm-sw{animation-duration:8.5s}
  .r54-wd-bl,.r54-wd-fl{animation-duration:2.2s}.r54-wd-bob{animation-duration:1.1s}.r54-wd-st{animation-duration:4.4s}
  /* a few formulas low in the side corners, behind the dissolving portrait edges — never near the face */
  .r54-fx{display:block;z-index:-1}
  .r54-fx span{font-size:10px;animation-duration:26s}
  .r54-fx span:nth-child(n+5){display:none}
  .r54-fx span:nth-child(1){left:4%;top:66%!important}.r54-fx span:nth-child(2){right:4%;top:72%!important}
  .r54-fx span:nth-child(3){left:6%;top:82%!important}.r54-fx span:nth-child(4){right:5%;top:86%!important}
  /* pilgrim block: text +17% (15 → 17.5px) */
  body.pg-ronin #ronin .r52-frame .india-t{font-size:17.5px;line-height:1.45}
  body.pg-ronin #ronin .r52-frame .india-k{font-size:12px}
  .r52-strip{max-height:calc(100svh - var(--hdr) - 8px - 380px - 96px)}
}
@media (max-width:374px){body.pg-ronin #ronin .r52-frame .india-t{font-size:16.5px;line-height:1.42}}
.r52-track{transition-duration:.8s}
@media (prefers-reduced-motion:reduce){
  .r54-a,.r54-fx span{animation:none!important}
  .r54-fx span{opacity:var(--o,.3)}
  .r47-p.r47-fig,.r47-p.r47-fig.on{transform:none}
}

/* R54b (Serj, t170): no limb/pose motion — the four figures are static whole silhouettes again (R53 images, wrapped for the orbit mirror).
   Orbit (~120 s), fade near the card, mobile one-at-a-time crossfade with gentle drift — unchanged. */
.r54b-st img{display:block;width:100%;height:100%;object-fit:contain}
.r54b-st.r54-flip img{transform:scaleX(-1)}
@media (max-width:767px){
  /* R54b: strict hand-over — the shown figure fades out first, the next one fades in after it (no overlap); gentle drift kept */
  .r47-p.r47-fig{transition:opacity 1.4s ease-in-out,transform 6.5s linear}
  .r47-p.r47-fig.on{transition:opacity 1.8s ease-in-out 1.4s,transform 6.5s linear}
}
