/* The twelve, lit from behind — mounted in Sky 2 on 16 September 2026, for now, from the puppets prototype of 15 September
   (../zodiac-puppets-working-20260915/). The Chinese grid's cards carry the shadow-play puppets on their dyed lamps, and a card opens
   the held view: the puppet flies from its card onto the screen, the lamp comes up, the crest draws, the words rise; the arrows pass one
   off and the next on; closing carries it home. Everything here is scoped to #grid-chinese.puppets and dialog#pp-view, so removing the
   stylesheet link, the dialog and the script from index.html restores Sky 2 exactly. */
#grid-chinese.puppets,dialog#pp-view{
  --page:#000105;--ink:#f3efe6;--body:#c3c9d8;--muted:#99a1b4;--gold:#cbb486;--gold-soft:#e0cfa8;
  --line:#ffffff1c;--line-lit:#ffffff33;--box:#04060b;--box-hover:#090d16;--lamp:#ffd9a0;
  --serif:'Cormorant Garamond',Georgia,serif;--sans:'Inter',Arial,sans-serif;
  --cjk:'KaiTi','STKaiti','DFKai-SB','Noto Serif CJK TC','Songti TC','SimSun','Microsoft JhengHei',serif;
  --dye:#e07a2a;
}

/* the grid: Sky 2's card, made tall enough to hold a puppet, with a lamp behind it */
#grid-chinese.puppets li{position:relative}
#grid-chinese.puppets button{position:relative;display:flex;flex-direction:column;align-items:center;gap:6px;width:100%;padding:26px 8px 18px;font:inherit;color:inherit;cursor:pointer;
  border:1px solid var(--line);border-radius:8px;background:var(--box);text-align:center;overflow:hidden;isolation:isolate;
  transition:background .18s,border-color .18s}
/* no lift of the card on hover: a transform transition on this isolated, overflow-clipped button painted a dark box over the puppet for the first frames of every hover (measured 16 Sep); the tilt of the puppet and the lamp stay */
#grid-chinese.puppets button::before{content:"";position:absolute;left:50%;top:44%;width:150%;aspect-ratio:1;transform:translate(-50%,-50%);border-radius:50%;pointer-events:none;z-index:0;
  background:radial-gradient(circle,color-mix(in srgb,var(--lamp) 32%,transparent) 0%,color-mix(in srgb,var(--dye) 26%,transparent) 22%,color-mix(in srgb,var(--dye) 8%,transparent) 40%,transparent 60%);
  opacity:.75;transition:opacity .35s}
#grid-chinese.puppets button:hover{background:var(--box-hover);border-color:color-mix(in srgb,var(--dye) 60%,#cbb486)}
#grid-chinese.puppets button:hover::before{opacity:1}
#grid-chinese.puppets button:focus-visible{outline:1px solid var(--gold);outline-offset:3px}
#grid-chinese.puppets li.on button{border-color:var(--gold);box-shadow:inset 0 0 0 1px #cbb48666}
#grid-chinese.puppets .pin{top:8px;left:10px;z-index:2}
#grid-chinese.puppets .emblem{position:relative;z-index:1;width:min(100%,222px);aspect-ratio:1;margin:0 0 8px}
/* and no tilt of the puppet on hover, for the same reason: any transform transition inside this card paints the box; the lamp brightens and the light sweeps instead */
#grid-chinese.puppets .emblem img{display:block;width:100%;height:100%;object-fit:contain;filter:drop-shadow(0 0 16px color-mix(in srgb,var(--dye) 40%,transparent)) drop-shadow(0 10px 14px #000a);transition:opacity .2s}
#grid-chinese.puppets li.away .emblem img{opacity:0}
#grid-chinese.puppets .emblem::after{content:"";position:absolute;inset:4%;pointer-events:none;opacity:0;
  background:linear-gradient(115deg,#fff0 42%,#ffffff1c 50%,#fff0 58%);background-size:250% 100%;background-position:120% 0}
/* the sweep blends normally: with mix-blend-mode:screen the browser painted a dark box over the puppet for the first frames of every hover (measured 16 Sep) */
#grid-chinese.puppets button:hover .emblem::after{opacity:1;animation:pp-sweep .9s cubic-bezier(.2,.7,.2,1) 1 forwards}
@keyframes pp-sweep{from{background-position:120% 0}to{background-position:-20% 0}}
#grid-chinese.puppets b{position:relative;z-index:1;font:500 17px/1.1 var(--serif);color:#f2efe7}
#grid-chinese.puppets i{position:relative;z-index:1;font:400 10.5px/1 var(--sans);font-variant-numeric:lining-nums;letter-spacing:.14em;text-transform:uppercase;color:#7f8799;font-style:normal}

/* the held view: the shadow theatre — the screen, the lamp behind it, the puppet and its shadow, the ring */
dialog#pp-view{border:0;padding:0;margin:0;background:transparent;max-width:none;max-height:none;width:100vw;height:100vh;color:var(--body);inset:0}
dialog#pp-view::backdrop{background:#000105}
dialog#pp-view[open]{display:grid;grid-template-columns:minmax(0,1.15fr) minmax(0,.85fr);align-items:center;gap:40px;padding:40px min(6vw,110px);
  background:radial-gradient(60% 60% at 42% 46%,color-mix(in srgb,var(--dye) 22%,#000105) 0%,#000105 72%)}
dialog#pp-view .pp-stage{display:grid;place-items:center;perspective:1600px}
dialog#pp-view .tilt{position:relative;width:min(86vh,840px);aspect-ratio:1;transform-style:preserve-3d;
  transform:rotateX(var(--rx,0deg)) rotateY(var(--ry,0deg));transition:transform .14s linear}
dialog#pp-view .tilt .screen{position:absolute;inset:10%;border-radius:50%;transform:translateZ(-56px);opacity:0;transition:opacity .7s;
  background:radial-gradient(circle at 50% 46%,#2b2114 0%,#150f08 40%,#0a0704 62%,transparent 74%)}
dialog#pp-view .tilt .screen::after{content:"";position:absolute;inset:0;border-radius:50%;opacity:.55;mix-blend-mode:screen;
  -webkit-mask:radial-gradient(circle,#000 0%,#000 55%,#0000 72%);mask:radial-gradient(circle,#000 0%,#000 55%,#0000 72%);
  background:repeating-linear-gradient(0deg,#0000 0 2px,#ffffff06 2px 3px),repeating-linear-gradient(90deg,#0000 0 2px,#ffffff06 2px 3px)}
dialog#pp-view .tilt .lamp{position:absolute;inset:16%;border-radius:50%;transform:translateZ(-40px);filter:blur(30px);opacity:0;transition:opacity .7s;
  background:radial-gradient(circle at calc(50% - var(--lx,0)*.4%) calc(46% - var(--ly,0)*.4%),color-mix(in srgb,var(--lamp) 70%,transparent) 0%,color-mix(in srgb,var(--dye) 45%,transparent) 30%,color-mix(in srgb,var(--dye) 12%,transparent) 52%,transparent 70%)}
dialog#pp-view.landed .screen,dialog#pp-view.landed .lamp{opacity:1}
dialog#pp-view .pp-figure{position:absolute;inset:0;transform-style:preserve-3d;pointer-events:none}
dialog#pp-view .tilt .cast{position:absolute;inset:19%;width:62%;height:62%;object-fit:contain;transform:translate(calc(var(--lx,0)*-.9px),calc(var(--ly,0)*-.7px + 18px)) translateZ(-16px);
  filter:blur(10px) brightness(.35) saturate(1.6);opacity:.6;transition:none}
dialog#pp-view .tilt .puppet{position:absolute;inset:19%;width:62%;height:62%;object-fit:contain;transform:translateZ(36px);transform-origin:50% 8%;
  filter:drop-shadow(0 0 22px color-mix(in srgb,var(--dye) 35%,transparent))}
dialog#pp-view.landed .puppet{animation:pp-hang 1.1s cubic-bezier(.2,.7,.2,1) both}
@keyframes pp-hang{0%{transform:translateZ(36px) rotate(-5deg) translateY(-14px)}45%{transform:translateZ(36px) rotate(2.2deg) translateY(0)}75%{transform:translateZ(36px) rotate(-.9deg)}100%{transform:translateZ(36px) rotate(0)}}
dialog#pp-view.arriving .pp-figure,dialog#pp-view.arriving .crest-box,dialog#pp-view.arriving .text,dialog#pp-view.arriving .sheen{opacity:0}
dialog#pp-view.leaving .pp-figure,dialog#pp-view.leaving .crest-box,dialog#pp-view.leaving .sheen{opacity:0}
dialog#pp-view.leaving .text{opacity:0;transition:opacity .3s}
dialog#pp-view.leaving .screen,dialog#pp-view.leaving .lamp{opacity:0;transition:opacity .45s}
dialog#pp-view .pp-ghost{position:fixed;z-index:5;pointer-events:none;object-fit:contain;transform-origin:0 0;will-change:transform;
  filter:drop-shadow(0 0 22px color-mix(in srgb,var(--dye) 35%,transparent)) drop-shadow(0 12px 18px #000a)}
dialog#pp-view .tilt .sheen{position:absolute;inset:22.5%;pointer-events:none;mix-blend-mode:screen;transform:translateZ(46px);
  background:radial-gradient(circle at calc(50% + var(--lx,0)*1%) calc(38% + var(--ly,0)*1%),#ffffff22 0%,#ffffff08 26%,#fff0 56%)}
dialog#pp-view .tilt .branch{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%) translateZ(-60px);
  font:400 min(40vh,420px)/1 var(--cjk);color:var(--gold);opacity:.05;pointer-events:none;user-select:none}

/* the crest: three rings of the tradition's geometry, drawn once the puppet has landed; the bearer's sector takes the dye */
dialog#pp-view .crest-box{position:absolute;inset:0;transform:translateZ(8px);pointer-events:none}
dialog#pp-view .crest{width:100%;height:100%;overflow:visible;display:block}
dialog#pp-view .crest .hair{fill:none;stroke:var(--gold);stroke-opacity:.28;stroke-width:1}
dialog#pp-view .crest .ring-hours line{stroke:var(--gold);stroke-opacity:.5;stroke-width:1.2}
dialog#pp-view .crest .br{font:400 24px/1 var(--cjk);fill:var(--gold);fill-opacity:.55;text-anchor:middle;dominant-baseline:central}
dialog#pp-view .crest .br.me{fill:var(--gold-soft);fill-opacity:1;font-size:30px}
dialog#pp-view .crest .mine-band{fill:none;stroke:var(--dye);stroke-opacity:.22;stroke-width:44;stroke-linecap:butt}
dialog#pp-view .crest .mine-arc{fill:none;stroke:var(--dye);stroke-width:3;stroke-linecap:round}
dialog#pp-view .crest .mk{fill:none;stroke-linecap:round;stroke-linejoin:round;stroke-width:5;stroke:#7f8799;overflow:visible}
dialog#pp-view .crest .mk.me{stroke:var(--gold-soft);stroke-width:6}
dialog#pp-view .crest .mk.ally{stroke:var(--gold)}
dialog#pp-view .crest .mk.foe{stroke:#cdb9b0;stroke-opacity:.9}
dialog#pp-view .crest .seat{fill:var(--dye);fill-opacity:.2;stroke:var(--dye);stroke-opacity:.7;stroke-width:1}
dialog#pp-view .crest .trine{fill:var(--gold);fill-opacity:.035;stroke:var(--gold-soft);stroke-width:1.5;stroke-opacity:.9;stroke-linejoin:round}
dialog#pp-view .crest .clash{fill:none;stroke:#e9e2d0;stroke-opacity:.35;stroke-width:1;stroke-dasharray:5 7}
dialog#pp-view .crest .ring-element use{fill:none;stroke:var(--gold);stroke-opacity:.5;stroke-width:1.4;stroke-linecap:round;stroke-linejoin:round}
dialog#pp-view .crest .ring{transform-box:view-box;transform-origin:50% 50%;animation:pp-ring-in .7s cubic-bezier(.2,.7,.2,1) both}
dialog#pp-view .crest .ring-kin{animation-delay:.25s}
dialog#pp-view .crest .ring-element{animation-delay:.45s}
dialog#pp-view .crest .trine,dialog#pp-view .crest .clash{stroke-dasharray:2400;stroke-dashoffset:2400;animation:pp-draw 1.1s cubic-bezier(.2,.7,.2,1) .55s forwards}
@keyframes pp-ring-in{from{opacity:0;transform:rotate(-7deg) scale(.94)}to{opacity:1;transform:none}}
@keyframes pp-draw{to{stroke-dashoffset:0}}

dialog#pp-view .text{transition:opacity .3s}
dialog#pp-view .text.in>*{animation:pp-rise .6s cubic-bezier(.2,.7,.2,1) both}
dialog#pp-view .text.in>:nth-child(1){animation-delay:.25s}dialog#pp-view .text.in>:nth-child(2){animation-delay:.32s}dialog#pp-view .text.in>:nth-child(3){animation-delay:.39s}
dialog#pp-view .text.in>:nth-child(4){animation-delay:.46s}dialog#pp-view .text.in>:nth-child(5){animation-delay:.53s}dialog#pp-view .text.in>:nth-child(6){animation-delay:.6s}
@keyframes pp-rise{from{opacity:0;transform:translateY(10px)}to{opacity:1;transform:none}}
dialog#pp-view .text h2{font:500 clamp(40px,5vw,66px)/1 var(--serif);color:var(--ink);margin:0 0 10px}
dialog#pp-view .text .rule-label{font:500 11px/1 var(--sans);letter-spacing:.2em;text-transform:uppercase;color:var(--gold);margin:0 0 14px}
dialog#pp-view .text .title{font:italic 500 23px/1.3 var(--serif);color:color-mix(in srgb,var(--dye) 55%,var(--gold-soft));margin:0 0 16px}
dialog#pp-view .text .facts{font:400 12px/1.7 var(--sans);letter-spacing:.06em;text-transform:uppercase;color:var(--gold);margin:0 0 22px}
dialog#pp-view .text .desc{font:400 19px/1.6 var(--serif);color:var(--body);margin:0;max-width:520px}
dialog#pp-view .legend{display:grid;grid-template-columns:auto 1fr;gap:6px 18px;margin:26px 0 0;padding:18px 0 0;border-top:1px solid var(--line);max-width:520px}
dialog#pp-view .legend div{display:contents}
dialog#pp-view .legend dt{font:500 10.5px/1.8 var(--sans);letter-spacing:.18em;text-transform:uppercase;color:var(--gold)}
dialog#pp-view .legend dd{margin:0;font:400 15px/1.5 var(--serif);color:var(--ink)}
dialog#pp-view .legend dd.years{color:var(--muted);font-variant-numeric:lining-nums}
dialog#pp-view .legend dd.years b{font-weight:500;color:var(--ink)}
dialog#pp-view .legend dd.years b.mine{color:var(--gold-soft);border-bottom:1px solid var(--gold)}
dialog#pp-view .close,dialog#pp-view .step{position:fixed;top:24px;right:28px;width:44px;height:44px;border-radius:50%;border:1px solid var(--line-lit);
  background:#000105b3;color:var(--ink);font:400 24px/1 var(--serif);cursor:pointer;display:grid;place-items:center;padding:0;z-index:2}
dialog#pp-view .step{top:50%;transform:translateY(-50%);right:auto;left:22px}
dialog#pp-view .step.next{left:auto;right:22px}
dialog#pp-view .close:hover,dialog#pp-view .step:hover,dialog#pp-view .close:focus-visible,dialog#pp-view .step:focus-visible{border-color:var(--gold);color:var(--gold-soft);outline:0}

@media (max-width:1100px){
  dialog#pp-view[open]{grid-template-columns:1fr;align-content:start;gap:24px;padding:80px 24px 96px;overflow:auto}
  dialog#pp-view .tilt{width:min(86vw,520px)}
  dialog#pp-view .text{text-align:center}dialog#pp-view .text .desc{margin:0 auto}
  dialog#pp-view .step{top:auto;bottom:22px;transform:none}
  dialog#pp-view .legend{margin-left:auto;margin-right:auto;grid-template-columns:auto auto;justify-content:center;text-align:left}
}
@media (prefers-reduced-motion:reduce){
  #grid-chinese.puppets button,#grid-chinese.puppets .emblem,dialog#pp-view .tilt,dialog#pp-view .text,dialog#pp-view .screen,dialog#pp-view .lamp{transition:none}
  #grid-chinese.puppets button:hover .emblem::after{animation:none;opacity:0}
  dialog#pp-view.landed .puppet,dialog#pp-view .crest .ring,dialog#pp-view .crest .trine,dialog#pp-view .crest .clash,dialog#pp-view .text.in>*{animation:none;opacity:1;stroke-dashoffset:0}
}
