/* R47 — RU only, /ronin/ «Кто RONIN» block (MOCKUP). Layout as on tablet: the portrait card centred, the text below.
   Desktop (≥1024): soft «facets» collage left and right of the card (generated motifs, no people; ma-yoko as one piece),
   pieces melt into each other through feathered masks and screen blending, very slow drift; the portrait itself is static.
   Phones (<768): portrait with dissolving edges (face fully opaque), motifs crossfade slowly behind it (ru47.js).
   Tablet 768–1023: unchanged (R46). Blue theme: hue-rotate, as for the martial-arts silhouettes. */
.r47-col{display:none}
.r47-p{display:block}

/* ---------- desktop ---------- */
@media (min-width:1024px){
  body.pg-ronin #ronin .ronin-grid{grid-template-columns:minmax(0,1fr);gap:72px}
  body.pg-ronin #ronin .portrait-ma{position:relative;top:auto;justify-self:center;width:420px;max-width:100%}
  body.pg-ronin #ronin .ma-ghosts{display:none}
  body.pg-ronin #ronin .ronin-txt{width:100%;max-width:820px;margin:0 auto}
  .r47-col{display:block;position:absolute;z-index:-1;pointer-events:none;top:-14%;bottom:-8%;left:50%;width:min(100vw,1680px);transform:translateX(-50%)}
  .r47-p{position:absolute;height:auto;mix-blend-mode:screen;opacity:.7;filter:blur(.6px);
    -webkit-mask-image:radial-gradient(ellipse 50% 50% at 50% 50%,#000 12%,rgba(0,0,0,.55) 55%,transparent 100%);mask-image:radial-gradient(ellipse 50% 50% at 50% 50%,#000 12%,rgba(0,0,0,.55) 55%,transparent 100%);
    animation:r47-drift 56s ease-in-out infinite alternate;animation-play-state:paused}
  .r47-col.r47-run .r47-p{animation-play-state:running}
  /* left of the card (outwards): yoko next to the card, manuscript, map far out, meditating figure low */
  /* R48: four distinct anonymous figures, two per side (top/bottom), over flowing backdrops; figures use normal blending so they stay readable */
  .r47-fig{z-index:2;mix-blend-mode:normal;opacity:.92;filter:blur(.8px);-webkit-mask-image:radial-gradient(ellipse 50% 50% at 50% 50%,#000 58%,transparent 100%);mask-image:radial-gradient(ellipse 50% 50% at 50% 50%,#000 58%,transparent 100%)}
  /* left: zen meditator top, yoko-geri bottom; backdrop skyline/mountains/temples, manuscript, map, ocean */
  /* R49: figures never under the card — box edge = card edge + gap (clamp 48–110px) */
  /* R50: each figure centred in the free space between the card edge (50% ± 210px) and the viewport edge:
     the card is not exactly centred in the viewport (offset --r50d, measured by ru47.js; 0 without JS), so
     left centre offset from the card centre = 105px + 25vw + d/2, right = 105px + 25vw − d/2; --w = figure width */
  .r47-col{--r50d:0px;--r50l:calc(105px + 25vw + var(--r50d)/2);--r50r:calc(105px + 25vw - var(--r50d)/2)}
  .r48-zen{--w:clamp(190px,15vw,290px);right:calc(50% + var(--r50l) - var(--w)/2);top:11%;width:var(--w);animation-duration:68s}
  .r47-yoko{-webkit-mask-image:radial-gradient(ellipse 50% 50% at 50% 50%,#000 72%,transparent 100%);mask-image:radial-gradient(ellipse 50% 50% at 50% 50%,#000 72%,transparent 100%);--w:clamp(200px,16vw,300px);right:calc(50% + var(--r50l) - var(--w)/2);top:52%;width:var(--w);animation-duration:64s;animation-direction:alternate-reverse}
  .r48-skyline{right:calc(50% + 70px + 9vw);top:24%;width:clamp(360px,33vw,620px);opacity:.85;animation-duration:84s}
  .r47-manuscript{right:calc(50% + 200px + 16vw);top:8%;width:clamp(280px,24vw,440px);opacity:.45;animation-duration:60s}
  .r47-map{right:calc(50% + 120px + 12vw);top:-8%;width:clamp(320px,29vw,540px);opacity:.5;animation-duration:72s;animation-direction:alternate-reverse}
  .r47-ocean{right:calc(50% + 130px + 13vw);top:66%;width:clamp(320px,29vw,540px);opacity:.55;animation-duration:80s}
  /* right: standing samurai top, wanderer with staff and straw hat bottom; backdrop ghats, mountains, stupa, mala */
  .r48-samurai{--w:clamp(155px,13.5vw,250px);left:calc(50% + var(--r50r) - var(--w)/2);top:8%;width:var(--w);animation-duration:66s;animation-direction:alternate-reverse}
  .r48-wanderer{--w:clamp(155px,13.5vw,250px);left:calc(50% + var(--r50r) - var(--w)/2);top:51%;width:var(--w);animation-duration:70s}
  .r47-ghats{left:calc(50% + 110px + 8vw);top:-8%;width:clamp(320px,29vw,540px);opacity:.8;animation-duration:62s;animation-direction:alternate-reverse}
  .r47-mountains{left:calc(50% + 120px + 10vw);top:42%;width:clamp(340px,31vw,580px);opacity:.65;animation-duration:76s}
  .r47-stupa{left:calc(50% + 220px + 15vw);top:20%;width:clamp(200px,16vw,300px);opacity:.6;animation-duration:58s}
  .r47-mala{left:calc(50% + 220px + 15vw);top:66%;width:clamp(200px,16vw,300px);opacity:.5;animation-duration:70s;animation-direction:alternate-reverse}
  html[data-theme="blue"] .r47-p{filter:blur(.6px) hue-rotate(205deg) saturate(.95) brightness(1.08)}
  html[data-theme="blue"] .r47-fig{filter:blur(.8px) hue-rotate(205deg) saturate(.95) brightness(1.15)}
}
@keyframes r47-drift{from{transform:translate3d(-10px,6px,0) scale(1)}to{transform:translate3d(12px,-8px,0) scale(1.04)}}

/* ---------- phones (<768) ---------- */
@media (max-width:767px){
  body.pg-ronin #ronin .ma-ghosts{display:none}
  body.pg-ronin #ronin .portrait-ma{position:relative}
  /* portrait: dissolving edges; the face area (centre-top) stays fully opaque */
  body.pg-ronin #ronin .portrait-ma .portrait-ph{width:80%;max-width:330px;margin-left:auto;margin-right:auto;border-color:transparent;background:transparent;box-shadow:none;
    -webkit-mask-image:radial-gradient(ellipse 56% 52% at 50% 38%,#000 46%,rgba(0,0,0,.5) 74%,transparent 100%);mask-image:radial-gradient(ellipse 56% 52% at 50% 38%,#000 46%,rgba(0,0,0,.5) 74%,transparent 100%)}
  body.pg-ronin #ronin .portrait-ma .portrait-ph::before{display:none}
  body.pg-ronin #ronin .portrait-ma figcaption{margin:6px 8px 0;padding:0;position:relative;z-index:2}
  .r47-col{display:block;position:absolute;z-index:auto;pointer-events:none;top:-8%;left:-20px;right:-20px;height:96%}
  .r47-col .r47-p{z-index:-1}
  /* figures sit in front of the portrait's dissolved lower corners (z 1), far from the face; caption stays above (z 2) */
  .r47-col .r47-p.r47-fig{z-index:1}
  /* backgrounds: full-bleed slides, each feathered by its own mask */
  .r47-p{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;opacity:0;transform:scale(1.04);
    transition:opacity 2.4s ease-in-out,transform 7s ease-out;filter:brightness(1.7) saturate(1.1);
    -webkit-mask-image:radial-gradient(ellipse 54% 52% at 50% 48%,#000 50%,transparent 100%);mask-image:radial-gradient(ellipse 54% 52% at 50% 48%,#000 50%,transparent 100%)}
  .r47-p.on{opacity:1;transform:scale(1.1)}
  /* R49: the 4 people — one at a time, low in a side corner flanking the portrait (never behind the head), alternating left/right:
     zen (L) → yoko-geri (R) → wanderer (L) → samurai (R) */
  .r47-p.r47-fig{inset:auto;bottom:3%;width:32%;height:auto;object-fit:contain;filter:brightness(1.35) saturate(1.1);transform:translateY(10px);
    transition:opacity 2.4s ease-in-out,transform 6s ease-out;
    -webkit-mask-image:radial-gradient(ellipse 50% 50% at 50% 50%,#000 56%,transparent 100%);mask-image:radial-gradient(ellipse 50% 50% at 50% 50%,#000 56%,transparent 100%)}
  .r47-p.r47-fig.on{opacity:.95;transform:none}
  .r47-p.r48-zen,.r47-p.r48-wanderer{left:1%}
  .r47-p.r48-samurai{right:1%}
  .r47-p.r47-yoko{right:1.5%} /* R50: foot ≥12px from the screen edge; yoko on the right so the kick goes outward, away from the portrait */
  .r47-p.r48-zen{width:35%}
  .r47-p.r47-yoko{width:38%;bottom:4%}
  html[data-theme="blue"] .r47-p{filter:hue-rotate(205deg) saturate(.95) brightness(1.9)}
  html[data-theme="blue"] .r47-p.r47-fig{filter:hue-rotate(205deg) saturate(.95) brightness(1.5)}
}
@media (prefers-reduced-motion:reduce){.r47-p{animation:none!important;transition:none!important}.r47-p.on,.r47-p.r47-fig.on{transform:none}}
