.cathedral-party {display:none;}

.hero.party-present {
  position:relative;
  isolation:isolate;
  overflow:hidden;
  /* Anchor the figures to the doorway even when the background crops on narrower screens. */
  background-position:center,79% 80%;
}
.party-present .hero-inner {position:relative; z-index:1;}
.party-present .cathedral-party {
  --figure-height:clamp(112px,10vw,152px);
  --summon-time:10s;
  display:flex;
  align-items:end;
  gap:calc(var(--figure-height) * .065);
  position:absolute;
  left:79%;
  bottom:clamp(5px,calc(20% - 2vw),14%);
  transform:translateX(-50%);
  pointer-events:none;
}
.cathedral-tim, .cathedral-berg {
  position:relative;
  width:calc(var(--figure-height) / 2);
  height:var(--figure-height);
}
.cathedral-tim::before, .cathedral-berg::before {
  content:"";
  position:absolute;
  inset:auto 1% 0;
  height:7%;
  border-radius:50%;
  background:radial-gradient(ellipse,#130d09e6 10%,#160f0a94 42%,transparent 74%);
}
.cathedral-tim::after, .cathedral-berg::after {
  content:"";
  position:absolute;
  top:0; bottom:0; left:calc(var(--figure-height) * -.125);
  width:var(--figure-height);
  background-repeat:no-repeat;
  background-size:1200% 100%;
  transform-origin:50% 95%;
}
.party-present .cathedral-tim::after {background-image:url('/art/portraits/tim-page-cels.webp');}
.party-present .cathedral-berg::after {background-image:url('/art/portraits/berg-staff-cels.webp');}

/* Nine bone groups share one engraved silhouette and meet at their joints in the standing pose. */
.cathedral-skeleton {
  display:none;
  position:absolute;
  left:calc(var(--figure-height) * 1.22);
  bottom:-1%;
  height:calc(var(--figure-height) * .78);
  aspect-ratio:2 / 3;
  transform-origin:50% 95%;
  filter:brightness(1.16) drop-shadow(0 1px 1px #201913aa);
}
.party-present .cathedral-skeleton {display:block;}
.cathedral-skeleton::before, .cathedral-skeleton::after {
  content:"";
  position:absolute;
  pointer-events:none;
}
.cathedral-skeleton::before {
  inset:auto 4% 1% 6%;
  height:8%;
  background:radial-gradient(ellipse,#14100cd9 0%,transparent 74%);
}
.cathedral-skeleton::after {
  inset:58% 0 -1%;
  opacity:0;
  background:radial-gradient(ellipse at 52% 91%,#d9ff8e 0%,#8acd74a6 13%,#4b92655e 36%,transparent 67%);
  mix-blend-mode:screen;
}
.cathedral-skeleton i {
  display:block;
  position:absolute;
  inset:0;
  clip-path:var(--joint);
  transform-origin:var(--pivot);
  background-size:100% 100%;
}
.party-present .cathedral-skeleton i {background-image:url('/art/portraits/summoned-skeleton.webp');}

/* Skull, rib cage, pelvis, arms, thighs and shins fall around their own centers. */
.cathedral-skeleton i:nth-child(1) {
  --joint:polygon(34% 0,65% 0,65% 15%,47% 15%,34% 13%); --pivot:51% 9%; --x:19%; --y:78%; --angle:42deg; --flat:.78;
}
.cathedral-skeleton i:nth-child(2) {
  --joint:polygon(34% 13%,47% 15%,65% 15%,62% 20%,59.5% 22%,61.5% 33.8%,57% 36.9%,46% 37%,33.6% 36.7%,33.6% 24%,36.5% 18.4%,32% 17.6%);
  --pivot:49% 27%; --x:-4%; --y:63%; --angle:-61deg; --flat:.62;
}
.cathedral-skeleton i:nth-child(3) {
  --joint:polygon(33.6% 36.7%,46% 37%,57% 36.9%,64% 36.7%,64% 44.8%,58.5% 48.2%,54.5% 48.6%,54.5% 51.5%,43% 51.5%,42% 48.2%,38% 46.7%,36% 45%,33% 44.3%);
  --pivot:49% 44%; --x:7%; --y:48%; --angle:64deg; --flat:.75;
}
.cathedral-skeleton i:nth-child(4) {
  --joint:polygon(0 14%,34% 13%,32% 17.6%,36.5% 18.4%,33.6% 24%,30% 35%,29% 61%,0 61%);
  --pivot:24% 38%; --x:22%; --y:52%; --angle:76deg; --flat:.87;
}
.cathedral-skeleton i:nth-child(5) {
  --joint:polygon(62% 19%,100% 14%,100% 61%,70% 61%,65% 39%,61.5% 33.8%,59.5% 22%);
  --pivot:69% 38%; --x:-14%; --y:52%; --angle:-69deg; --flat:.87;
}
.cathedral-skeleton i:nth-child(6) {
  --joint:polygon(30% 44%,33% 44.3%,36% 45%,38% 46.7%,42% 48.2%,43% 51.5%,44% 65.5%,25% 64.7%,29% 53%);
  --pivot:37% 56.5%; --x:11%; --y:35%; --angle:72deg; --flat:.82;
}
.cathedral-skeleton i:nth-child(7) {
  --joint:polygon(54.5% 51.5%,54.5% 48.6%,58.5% 48.2%,64% 44.8%,67% 47%,68% 65%,52% 65.5%);
  --pivot:59% 56.5%; --x:-7%; --y:37%; --angle:-82deg; --flat:.86;
}
.cathedral-skeleton i:nth-child(8) {
  --joint:polygon(0 64.7%,25% 64.7%,44% 65.5%,45% 100%,0 100%); --pivot:31% 79%; --x:-3%; --y:13%; --angle:-70deg; --flat:.77;
}
.cathedral-skeleton i:nth-child(9) {
  --joint:polygon(52% 65.5%,68% 65%,100% 65%,100% 100%,46% 100%); --pivot:60% 80%; --x:5%; --y:13%; --angle:70deg; --flat:.77;
}

@media (prefers-reduced-motion:no-preference) {
  .party-present .cathedral-tim::after {animation:tim-read 3.4s steps(11,end) infinite;}
  .party-present .cathedral-berg::after {animation:berg-summon var(--summon-time) steps(11,end) infinite;}
  .party-present .cathedral-skeleton i {animation:knit-bone var(--summon-time) linear infinite both;}
  .cathedral-skeleton i:nth-child(1) {animation-delay:.13s;}
  .cathedral-skeleton i:nth-child(4), .cathedral-skeleton i:nth-child(7) {animation-delay:.08s;}
  .cathedral-skeleton i:nth-child(5), .cathedral-skeleton i:nth-child(6) {animation-delay:-.14s;}
  .cathedral-skeleton i:nth-child(8), .cathedral-skeleton i:nth-child(9) {animation-delay:-.22s;}
  .party-present .cathedral-skeleton {animation:minion-stand var(--summon-time) ease-in-out infinite;}
  .party-present .cathedral-skeleton::after {animation:grave-light var(--summon-time) ease-in-out infinite;}
}
/* Display one complete drawn cel at a time. Hold the final point while the spell travels. */
@keyframes tim-read {
  0%,14% {background-position-x:0%;}
  54%,99.99% {background-position-x:100%;}
  100% {background-position-x:0%;}
}
@keyframes berg-summon {
  0%,2%,100% {background-position-x:0%;}
  14%,38% {background-position-x:100%;}
  53% {background-position-x:0%;}
}
@media (prefers-reduced-motion:no-preference) {
  .party-present .staff-stream {
    position:absolute;
    left:calc(var(--figure-height) * 1.18);
    top:calc(var(--figure-height) * .51);
    width:calc(var(--figure-height) * .48);
    height:calc(var(--figure-height) * .50);
    background:url('/art/portraits/staff-stream.webp') left top / 3200% 100% no-repeat;
    animation:staff-channel var(--summon-time) steps(31,end) infinite;
  }
}
@keyframes staff-channel {
  0%,14% {background-position-x:0%;}
  37%,100% {background-position-x:100%;}
}
@keyframes knit-bone {
  0%,16%,89%,100% {transform:translate(var(--x),var(--y)) rotate(var(--angle)) scale(.84,var(--flat));}
  18% {transform:translate(var(--x),calc(var(--y) - 1%)) rotate(var(--angle)) scale(.84,var(--flat)); animation-timing-function:cubic-bezier(.4,0,.17,1);}
  35% {transform:translate(0,-.9%) rotate(-.8deg);}
  36%,74% {transform:translate(0,0) rotate(0); animation-timing-function:cubic-bezier(.58,0,.94,.52);}
  84% {transform:translate(var(--x),var(--y)) rotate(var(--angle)) scale(.84,var(--flat)); animation-timing-function:ease-out;}
  86% {transform:translate(var(--x),calc(var(--y) - 1.6%)) rotate(var(--angle)) scale(.84,var(--flat));}
}
@keyframes minion-stand {
  0%,36%,75%,100% {transform:rotate(0) scaleY(1);}
  45%,66% {transform:rotate(-1.8deg) scaleY(1.021);}
  56% {transform:rotate(.9deg) scaleY(.99);}
}
@keyframes grave-light {
  0%,6%,38%,73%,90%,100% {opacity:0; transform:scale(.62);}
  17% {opacity:.95; transform:scale(1.15);}
  27% {opacity:.52; transform:scale(.95);}
  83% {opacity:.42; transform:scale(1);}
}

@media (max-width:730px) {
  .party-present .cathedral-party {--figure-height:clamp(90px,16vw,108px); left:71%; bottom:11%;}
  .party-present .hero-inner > * {max-width:62%;}
}
@media (max-width:560px) {
  .party-present .hero-inner {min-height:183px;}
  .party-present h1 {font-size:clamp(32px,8.8vw,48px);}
}
@media (max-width:370px) {
  .party-present .cathedral-party {--figure-height:80px;left:68%;}
  .party-present .hero-inner p {max-width:54%;}
  .party-present .eyebrow {font-size:9px;letter-spacing:.14em;gap:6px;}
  .party-present .eyebrow i {width:17px;flex-shrink:0;}
}
