/* ═══ building.css — "THE BUILDING REMEMBERS": allies & enemies panel ═══
   Data per row: { id, name, stance (-100..100), note, moved? }.  Markup contract (see skeletons/building.html):

   <section class="building" data-open="false">
     <button class="bld-strip" aria-expanded="false" aria-controls="bld-panel">
       <span class="bld-label">THE BUILDING REMEMBERS</span>
       <span class="bld-chips"> <span class="bld-chip" data-band="hostile" data-moved="true"><i class="bld-dot"></i>SCHULZ · hostile <b>▼</b></span> …×3 </span>
       <span class="bld-chev">›</span>
     </button>
     <div class="bld-panel" id="bld-panel" hidden>
       <div class="bld-row" data-band="hostile" data-moved="true" style="--p:23;--i:0">   <!-- --p = (stance+100)/2, 0..100 -->
         <div class="bld-face">…portrait svg…</div>
         <div class="bld-main">
           <div class="bld-top"><span class="bld-name">Schulz</span><span class="bld-band">hostile</span></div>
           <div class="bld-meter"><i class="bld-reveal"></i><i class="bld-mark"></i></div>
           <div class="bld-note">knows about The Letters</div>
         </div>
       </div>
     </div>
   </section>
   Set data-open="true" + aria-expanded + remove [hidden] to open; the meters fill in on open.
   Only transform/opacity animate. Reduced motion: everything lands instantly. */

.building { --bg-red: #ff5a5f; --bg-gold: #d4af37; 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 16px; border-radius: 14px; position: relative;
  background: linear-gradient(180deg, rgba(20, 26, 56, .92), rgba(8, 11, 24, .96)); border: 1px solid rgba(212, 175, 55, .28);
  box-shadow: 0 10px 26px -14px #000, inset 0 1px 0 rgba(255, 255, 255, .05); }
.bld-strip:focus-visible { outline: 2px solid var(--bg-gold); outline-offset: 2px; }
.bld-strip::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 3px; background: linear-gradient(var(--bg-red), var(--bg-gold)); }
.bld-label { font: 700 10px/1 var(--sans); letter-spacing: .26em; color: var(--bg-gold); grid-column: 1; }
.bld-chev { grid-column: 2; grid-row: 1; font: 700 20px/1 var(--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: 999px; font: 700 10.5px/1 var(--sans); letter-spacing: .08em; text-transform: uppercase;
  color: #e9e3d2; background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .12); position: relative; }
.bld-chip b { font-size: 9px; }
.bld-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--c, #8b93b2); box-shadow: 0 0 8px var(--c, transparent); }
.bld-chip[data-band="devoted"], .bld-row[data-band="devoted"] { --c: #d4af37; }
.bld-chip[data-band="warm"], .bld-row[data-band="warm"] { --c: #e6c765; }
.bld-chip[data-band="cool"], .bld-row[data-band="cool"] { --c: #8b93b2; }
.bld-chip[data-band="hostile"], .bld-row[data-band="hostile"] { --c: #ff7a6b; }
.bld-chip[data-band="blood-feud"], .bld-row[data-band="blood-feud"] { --c: #ff2d3a; }
.bld-chip[data-band="blood-feud"] { border-color: rgba(255, 45, 58, .5); }
.bld-chip::after { content: ""; position: absolute; inset: -1px; border-radius: inherit; border: 1px solid var(--c); 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); } }

/* ── panel ── */
.bld-panel { margin-top: 8px; padding: 6px 0 2px; border-radius: 14px; background: linear-gradient(180deg, rgba(12, 16, 36, .95), rgba(7, 9, 20, .98));
  border: 1px solid rgba(255, 255, 255, .08); transform-origin: top; }
.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: 54px 1fr; gap: 12px; padding: 13px 14px; align-items: center; border-bottom: 1px solid rgba(255, 255, 255, .06); }
.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; } }

.bld-face { width: 54px; height: 54px; border-radius: 50%; overflow: hidden; border: 2px solid var(--c, #8b93b2); box-shadow: 0 0 0 3px rgba(0, 0, 0, .5), 0 0 16px -2px var(--c); background: #10142b; display: grid; place-items: center; }
.bld-face svg { width: 100%; height: 100%; display: block; }
.bld-face .bld-init { font: 700 20px var(--serif); color: var(--c); }

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

/* the meter: −100 (blood red) … +100 (gold). --p is 0..100. */
.bld-meter { position: relative; height: 8px; border-radius: 8px; container-type: inline-size; overflow: visible;
  background: linear-gradient(90deg, #b0121f 0%, #ff5a5f 28%, #4a4f6e 50%, #c9a53a 74%, #d4af37 100%); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .5); }
.bld-meter::before { content: ""; position: absolute; left: 50%; top: -3px; bottom: -3px; width: 1px; background: rgba(255, 255, 255, .28); } /* neutral tick */
.bld-reveal { position: absolute; inset: 0; border-radius: inherit; background: #0b0f22; transform-origin: right; transform: scaleX(0); } /* cover wipe, opens left→right */
.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; } }
.bld-mark { position: absolute; left: 0; top: 50%; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; background: #f7f0da; border: 3px solid var(--c, #fff);
  box-shadow: 0 0 0 2px #05060f, 0 0 12px 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-row[data-moved="true"] .bld-mark::after { content: ""; position: absolute; inset: -6px; border-radius: 50%; border: 2px solid var(--c); opacity: 0; animation: bld-pulse 1.6s ease-out 3 1.3s; }

.bld-note { margin-top: 8px; font: italic 12.5px/1.35 var(--serif); color: #a9a9bd; }

@media (prefers-reduced-motion: reduce) {
  .bld-chip[data-moved="true"]::after, .bld-row[data-moved="true"] .bld-mark::after { animation: none; opacity: .55; }
  .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; }
}
