/* ═══ building.css — THE KREMLIN: the Politburo portrait wall (allies & enemies) ═══
   Contract unchanged (see Capitol building.css): .building[data-open] > .bld-strip(.bld-label,.bld-chips>.bld-chip[data-band][data-moved]>.bld-dot,.bld-chev)
   + .bld-panel > .bld-row[data-band][data-moved][style="--p:0..100;--i:n"] > .bld-face(portrait svg) + .bld-main(.bld-top(.bld-name,.bld-band), .bld-meter(.bld-reveal,.bld-mark), .bld-note)
   Each band hangs its portraits as gilt frames on red damask; the stance meter is the brass plaque that lights warm gold → cold blue-grey;
   moved-this-beat portraits tilt slightly on their nail. Only transform/opacity animate. Reduced motion: everything lands instantly. */

.building { --bg-red: #d9262d; --bg-gold: var(--gold, #d4a93c); margin: 14px 0 6px; position: relative; font-family: var(--sans, system-ui); }

.bld-strip { all: unset; box-sizing: border-box; cursor: pointer; display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; align-items: center; width: 100%;
  padding: 11px 14px 11px 18px; border-radius: 3px; position: relative;
  background: repeating-linear-gradient(45deg, rgba(0,0,0,.14) 0 6px, transparent 6px 12px), linear-gradient(180deg, #5a0c14, #2a0509); border: 1px solid color-mix(in srgb, var(--bg-gold) 55%, transparent);
  box-shadow: 0 10px 26px -14px #000, inset 0 1px 0 rgba(255, 220, 160, .12); }
.bld-strip:focus-visible { outline: 2px solid var(--bg-gold); outline-offset: 2px; }
.bld-strip::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: linear-gradient(var(--bg-gold), #8a6a1c); }
.bld-label { font: 700 10px/1 var(--sans, sans-serif); letter-spacing: .26em; color: var(--bg-gold); grid-column: 1; }
.bld-chev { grid-column: 2; grid-row: 1; font: 700 20px/1 var(--serif, Georgia, serif); color: var(--bg-gold); transition: transform .35s cubic-bezier(.2, .8, .2, 1); }
.building[data-open="true"] .bld-chev { transform: rotate(90deg); }
.bld-chips { grid-column: 1 / -1; display: flex; gap: 6px; flex-wrap: wrap; }

.bld-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px 5px 8px; border-radius: 2px; font: 700 10.5px/1 var(--sans, sans-serif); letter-spacing: .08em; text-transform: uppercase;
  color: #1c1208; background: linear-gradient(180deg, #e4c46a, #b8902f); border: 1px solid #6a4e14; box-shadow: inset 0 1px 0 rgba(255,255,255,.4), 0 1px 3px rgba(0,0,0,.5); position: relative; }   /* a little brass plaque */
.bld-chip b { font-size: 9px; }
.bld-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--c, #8b93b2); box-shadow: 0 0 0 1.5px rgba(0,0,0,.45), 0 0 8px var(--c, transparent); }
.bld-chip[data-band="devoted"], .bld-row[data-band="devoted"] { --c: #f3c640; --lamp: #fff0a8; }
.bld-chip[data-band="warm"], .bld-row[data-band="warm"] { --c: #d9a93a; --lamp: #ffe08a; }
.bld-chip[data-band="cool"], .bld-row[data-band="cool"] { --c: #8e9bb0; --lamp: #cfd9ea; }
.bld-chip[data-band="hostile"], .bld-row[data-band="hostile"] { --c: #7e96b8; --lamp: #b9cdea; }
.bld-chip[data-band="blood-feud"], .bld-row[data-band="blood-feud"] { --c: #5e7ea8; --lamp: #9ab8e6; }
.bld-chip[data-band="blood-feud"] { filter: saturate(.6) brightness(.9); }
.bld-chip::after { content: ""; position: absolute; inset: -1px; border-radius: inherit; border: 1px solid #fff; opacity: 0; pointer-events: none; }
.bld-chip[data-moved="true"]::after { animation: bld-pulse 1.6s ease-out 2 .3s; }
@keyframes bld-pulse { 0% { opacity: .9; transform: scale(1); } 100% { opacity: 0; transform: scale(1.22, 1.5); } }

/* ── the wall ── */
.bld-panel { margin-top: 8px; padding: 6px 0 2px; border-radius: 3px; transform-origin: top; border: 1px solid color-mix(in srgb, var(--bg-gold) 40%, transparent);
  background: radial-gradient(circle at 50% 50%, rgba(255,150,150,.09) 0 5px, transparent 6px) 0 0 / 28px 28px, radial-gradient(circle at 0 0, rgba(0,0,0,.2) 0 8px, transparent 9px) 0 0 / 28px 28px, linear-gradient(180deg, #4a0a11, #2a0509 70%, #1c0306); }   /* red damask */
.building[data-open="true"] .bld-panel { animation: bld-open .38s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes bld-open { from { opacity: 0; transform: translateY(-8px) scaleY(.96); } to { opacity: 1; transform: none; } }

.bld-row { display: grid; grid-template-columns: 62px 1fr; gap: 14px; padding: 13px 14px; align-items: center; border-bottom: 1px solid rgba(0, 0, 0, .35); }
.bld-row:last-child { border-bottom: 0; }
.building[data-open="true"] .bld-row { animation: bld-row-in .45s cubic-bezier(.2, .8, .2, 1) both; animation-delay: calc(var(--i, 0) * 70ms + 120ms); }
@keyframes bld-row-in { from { opacity: 0; transform: translateX(-10px); } to { opacity: 1; transform: none; } }

/* the gilt frame, hung on a nail with a cord */
.bld-face { position: relative; width: 62px; height: 72px; padding: 5px; background: linear-gradient(135deg, #f1d27c, #a9801f 45%, #e6c466 60%, #8a6a1c); box-shadow: 0 0 0 1px #3a2808, 0 6px 10px -4px #000; display: grid; place-items: center; transform-origin: 50% -10px; }
.bld-face::before { content: ""; position: absolute; left: 50%; top: -11px; width: 24px; height: 12px; margin-left: -12px; border: 1px solid #c9a54a; border-bottom: 0; clip-path: polygon(0 100%, 50% 0, 100% 100%, 92% 100%, 50% 14%, 8% 100%); background: #c9a54a; }  /* the cord */
.bld-face::after { content: ""; position: absolute; left: 50%; top: -13px; width: 5px; height: 5px; margin-left: -2.5px; border-radius: 50%; background: #3a2a10; box-shadow: 0 1px 0 rgba(255,255,255,.3); }   /* the nail */
.bld-face svg { width: 100%; height: 100%; display: block; box-shadow: inset 0 0 0 1px rgba(0,0,0,.6); }
.bld-face .bld-init { font: 700 20px var(--serif, Georgia, serif); color: var(--c); }
.bld-row[data-moved="true"] .bld-face { animation: bld-tilt 3.2s ease-in-out 2; }
@keyframes bld-tilt { 0%, 100% { transform: rotate(0); } 18% { transform: rotate(5deg); } 40% { transform: rotate(-3.5deg); } 62% { transform: rotate(2deg); } 82% { transform: rotate(-.8deg); } }

.bld-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.bld-name { font: 700 16px/1.1 var(--serif, Georgia, serif); color: var(--paper, #f3ead2); letter-spacing: .01em; }
.bld-band { font: 800 9.5px/1 var(--sans, sans-serif); letter-spacing: .2em; text-transform: uppercase; color: var(--lamp, var(--c)); white-space: nowrap; }

/* the meter: a brass plaque. Its engraved strip lights from cold blue-grey (−100) to warm gold (+100). --p is 0..100. */
.bld-meter { position: relative; height: 12px; border-radius: 2px; container-type: inline-size; overflow: visible; padding: 0;
  background: linear-gradient(90deg, #4e6a92 0%, #7e8ea6 30%, #6a6455 50%, #cfa23a 74%, #f3c640 100%); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .55), inset 0 2px 3px rgba(0,0,0,.35), 0 1px 0 rgba(255,225,160,.25); }
.bld-meter::before { content: ""; position: absolute; left: 50%; top: -3px; bottom: -3px; width: 1px; background: rgba(255, 255, 255, .4); }
.bld-reveal { position: absolute; inset: 0; border-radius: inherit; background: #1a0508; transform-origin: right; transform: scaleX(0); }
.building[data-open="true"] .bld-reveal { animation: bld-wipe 1s cubic-bezier(.2, .7, .2, 1) both; animation-delay: calc(var(--i, 0) * 70ms + 260ms); transform: scaleX(0); }
@keyframes bld-wipe { from { transform: scaleX(1); transform-origin: right; } to { transform: scaleX(0); transform-origin: right; } }
/* the lamp: a small brass-bezelled star marking the stance */
.bld-mark { position: absolute; left: 0; top: 50%; width: 16px; height: 16px; margin: -8px 0 0 -8px; background: radial-gradient(circle, #fff 0 20%, var(--lamp, var(--c)) 48%, #3a2a0a 52%);
  clip-path: polygon(50% 0, 62% 34%, 98% 36%, 70% 58%, 80% 94%, 50% 72%, 20% 94%, 30% 58%, 2% 36%, 38% 34%); filter: drop-shadow(0 0 4px var(--lamp, var(--c))); transform: translateX(calc(var(--p, 50) * 1cqw)); }
.building[data-open="true"] .bld-mark { animation: bld-mark .95s cubic-bezier(.2, .8, .2, 1) both; animation-delay: calc(var(--i, 0) * 70ms + 300ms); }
@keyframes bld-mark { from { transform: translateX(50cqw); opacity: 0; } 30% { opacity: 1; } to { transform: translateX(calc(var(--p, 50) * 1cqw)); opacity: 1; } }

.bld-note { margin-top: 8px; font: italic 12.5px/1.35 var(--serif, Georgia, serif); color: color-mix(in srgb, var(--paper, #e9dfc4) 62%, transparent); }

@media (prefers-reduced-motion: reduce) {
  .bld-chip[data-moved="true"]::after { animation: none; opacity: .55; } .bld-row[data-moved="true"] .bld-face { animation: none; transform: rotate(3deg); }
  .building[data-open="true"] .bld-panel, .building[data-open="true"] .bld-row, .building[data-open="true"] .bld-reveal, .building[data-open="true"] .bld-mark { animation: none; }
  .bld-chev { transition: none; }
}
