/* ═══ memoriam.css — the airbrushed photograph ═══
   When a leader falls (overthrown, executed, denounced) the plaque shows a formal group portrait with the fallen man airbrushed out.
   <div class="memoriam" data-pos="3" style="--n:5">                       <!-- --n = how many figures, data-pos 1..n (0-based left→right) = where the fallen man stood -->
     <div class="photo"> <i class="fig"></i> ×n  <i class="ghost"></i> </div>   <!-- or let memoriam.js-free CSS draw the lineup: .fig are silhouettes; the one at data-pos is replaced by .ghost -->
     <div class="caption">Moscow, 7 November 1937</div>
   </div>
   Simplest use: <div class="memoriam" style="--n:5;--at:2"><div class="photo"></div><div class="caption">…</div></div> — the lineup of dark busts is drawn by CSS gradients;
   --at (0-based) is the gap. A faint ghost-oval (.ghost, auto-drawn) marks where he stood. It must hurt: the empty space is the loudest thing in the picture.
   Motion: on mount the ghost fades in LAST (opacity) after the photo develops (opacity/filter-free). Reduced motion: shown. */

.memoriam { --n: 5; --at: 2; position: relative; margin: 14px 0; padding: 14px 14px 12px; border-radius: 2px; background: color-mix(in srgb, var(--paper, #e9dfc4) 94%, #fff); color: var(--ink, #17130e); box-shadow: 0 14px 30px -16px #000, 0 0 0 1px rgba(0,0,0,.3); transform: rotate(-.6deg); }
.memoriam::before { content: ""; position: absolute; inset: 0; pointer-events: none; mix-blend-mode: multiply; opacity: var(--grain, .35);
  background: repeating-linear-gradient(0deg, rgba(120,100,60,.1) 0 1px, transparent 1px 3px), radial-gradient(120% 90% at 50% 50%, transparent 60%, rgba(90,70,30,.35)); }
.memoriam .photo { position: relative; height: 150px; overflow: hidden; background: linear-gradient(180deg, color-mix(in srgb, var(--photo, #7b6a50) 70%, #fff) 0, var(--photo, #7b6a50) 70%, color-mix(in srgb, var(--photo, #7b6a50) 60%, #000)); box-shadow: inset 0 0 0 1px rgba(0,0,0,.4), inset 0 0 28px rgba(0,0,0,.4); }
/* the backdrop: a draped curtain and a plinth */
.memoriam .photo::before { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(90deg, rgba(0,0,0,.12) 0 10px, transparent 10px 22px), linear-gradient(180deg, transparent 70%, rgba(0,0,0,.25)); }
/* the row: n figures as soft dark busts (head + shoulders) built from radial gradients — every position but --at */
.memoriam .photo::after { content: ""; position: absolute; left: 4%; right: 4%; bottom: 0; height: 74%;
  background: repeating-conic-gradient(from 0deg at 0 0, transparent 0 0);
  --w: calc(100% / var(--n));
  background-image: radial-gradient(ellipse 15% 22% at 50% 30%, #1a1612 0 98%, transparent 100%), radial-gradient(ellipse 36% 52% at 50% 100%, #231e18 0 98%, transparent 100%);
  background-size: var(--w) 100%; background-repeat: repeat-x; -webkit-mask: linear-gradient(90deg, #000 calc(var(--at) * (100% / var(--n))), transparent 0, transparent calc((var(--at) + 1) * (100% / var(--n))), #000 0) 0 0 / 100% 100% no-repeat; mask: linear-gradient(90deg, #000 calc(var(--at) * (100% / var(--n))), transparent 0, transparent calc((var(--at) + 1) * (100% / var(--n))), #000 0) 0 0 / 100% 100% no-repeat; }
/* the ghost: the faint oval where he stood — airbrush smudge, slightly lighter than the wall, edges not quite clean */
.memoriam .ghost, .memoriam .photo > .ghost { position: absolute; z-index: 2; bottom: 0; height: 74%; width: calc(92% / var(--n)); left: calc(4% + var(--at) * (92% / var(--n)) + 1%);
  background: radial-gradient(ellipse 34% 26% at 50% 30%, rgba(255,245,220,.34) 0 60%, transparent 100%), radial-gradient(ellipse 62% 54% at 50% 100%, rgba(255,245,220,.26) 0 60%, transparent 100%); filter: blur(2.4px); }
.memoriam .ghost::after { content: ""; position: absolute; inset: 6% 8% 0; border: 1.5px dashed rgba(255,255,255,.35); border-radius: 50% 50% 0 0 / 38% 38% 0 0; }
.memoriam .photo .ghost { opacity: 0; animation: mem-ghost 2.4s ease-out 1.2s forwards; }
.memoriam .photo { animation: mem-develop 1.4s ease-out both; }
/* an auto-ghost when no .ghost element is supplied */
.memoriam:not(:has(.ghost)) .photo > i.auto { display: none; }
.memoriam .caption { margin-top: 10px; font: italic 13px/1.35 var(--serif, Georgia, serif); color: color-mix(in srgb, var(--ink, #17130e) 80%, transparent); text-align: center; letter-spacing: .02em; }
.memoriam .caption::before { content: "— "; } .memoriam .caption::after { content: " —"; }
@keyframes mem-ghost { to { opacity: 1; } } @keyframes mem-develop { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .memoriam .photo, .memoriam .photo .ghost { animation: none; opacity: 1; } }
