/* ==========================================================================
   Pankha Palette · DS-004 · TheLayoutLoft Parts Line
   Part styles only — all selectors prefixed .pk- . Drop-in safe.
   Skin: deck of paint chips splaying into a half-circle fan; picked shade
   becomes the block face. Own palette/timings.
   ========================================================================== */

.pk-block {
  position: relative; display: inline-block;
  width: 92px; height: 64px;
  border: none; border-radius: 10px; padding: 0;
  cursor: pointer; overflow: visible;
  background: #1E2330;
  transition: transform .18s ease;
}
.pk-block:hover { transform: translateY(-2px); }
.pk-block:focus-visible { outline: 2px solid #8B84EA; outline-offset: 3px; }

/* the "deck" — stacked chip edges behind the face */
.pk-block::before, .pk-block::after {
  content: ''; position: absolute; inset: 0; border-radius: 10px;
  background: #161B27; z-index: -1;
  transition: transform .3s cubic-bezier(.3,1.3,.4,1);
}
.pk-block::before { transform: rotate(-4deg) translateY(2px); }
.pk-block::after  { transform: rotate(4deg)  translateY(3px); }
.pk-open::before  { transform: rotate(-9deg) translateY(4px); }
.pk-open::after   { transform: rotate(9deg)  translateY(6px); }

/* top face = current shade */
.pk-face {
  position: absolute; inset: 0; border-radius: 10px;
  background: #5B4FC4;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.14),
              inset 0 -14px 22px rgba(0,0,0,.22);
  transition: background .3s;
}
.pk-cap {
  position: absolute; left: 0; right: 0; bottom: 7px;
  font: 600 9.5px/1 ui-monospace, monospace;
  letter-spacing: .06em; text-transform: uppercase;
  color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,.65);
  pointer-events: none;
  padding: 0 4px; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; text-align: center;
}
/* chevron hint */
.pk-face::after {
  content: ''; position: absolute; top: 8px; left: 50%;
  width: 7px; height: 7px; margin-left: -4px;
  border: solid rgba(255,255,255,.75); border-width: 0 0 2px 2px;
  transform: rotate(-45deg);
}
.pk-open .pk-face::after { transform: rotate(135deg); top: 11px; }

.pk-sr {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* --- the fan (zero-size pivot at block's bottom-center) -------------------- */
.pk-fan {
  position: absolute; left: 50%; bottom: -2px; width: 0; height: 0;
  z-index: 8;
}
.pk-swatch {
  position: absolute; bottom: 0; left: 0;
  margin-left: -21px;                  /* -swatchW/2 default 42px */
  transform-origin: 50% 100%;
  border: none; border-radius: 8px;
  background: var(--pk-c, #888);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.18),
              0 6px 18px rgba(0,0,0,.45);
  cursor: pointer; padding: 0;
  transition: box-shadow .15s;
}
.pk-swatch:hover, .pk-swatch:focus-visible {
  box-shadow: inset 0 0 0 2px #fff, 0 10px 26px rgba(0,0,0,.55);
  z-index: 30;
  outline: none;
}
.pk-swatch.pk-picked {
  box-shadow: inset 0 0 0 2.5px #F59E0B, 0 8px 22px rgba(0,0,0,.5);
}
.pk-tag {
  position: absolute; left: 50%; top: -22px;
  transform: translateX(-50%) rotate(0deg);
  font: 600 9px/1 ui-monospace, monospace; font-style: normal;
  letter-spacing: .05em; text-transform: uppercase; white-space: nowrap;
  color: #E8E6F0; background: #1E2330; border: 1px solid #3A4152;
  border-radius: 5px; padding: 3px 6px;
  opacity: 0; transition: opacity .15s;
  pointer-events: none;
}
.pk-swatch:hover .pk-tag,
.pk-swatch:focus-visible .pk-tag { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  .pk-block, .pk-block::before, .pk-block::after, .pk-face { transition: none; }
}

/* phone view: demo stage is designed ~900px wide — zoom the page down on small screens */
@media (max-width: 430px) { body { zoom: .40; } }
@media (min-width: 431px) and (max-width: 560px) { body { zoom: .52; } }
@media (min-width: 561px) and (max-width: 720px) { body { zoom: .65; } }
@media (min-width: 721px) and (max-width: 860px) { body { zoom: .78; } }
