/* PianoImp — "The Show Is Starting" (app/Views/creators/pianoimp.php).
   A jester's circus theatre in his red and blue harlequin: velvet curtains
   part on his stage art, a marquee sign chases its bulbs, gem spades and
   diamonds drift between the acts, piano keyboards divide them (and play),
   and the gallery is a deck of cards with a harlequin back.
   Motion is transform and opacity only, and stops for reduced motion and
   the site's lite mode (docs/MOTION.md, mobile-performance rules). */

@font-face { font-family: 'Cinzel'; src: url('/assets/fonts/cinzel-900-latin.woff2') format('woff2'); font-weight: 900; font-display: swap; }
@font-face { font-family: 'Cinzel'; src: url('/assets/fonts/cinzel-700-latin.woff2') format('woff2'); font-weight: 700; font-display: swap; }

body.cp-theme-pianoimp {
  --pi-bg: #0c0910; --pi-bg2: #150f1c; --pi-panel: #19121f;
  --pi-red: #c41d36; --pi-red-d: #7d0f22; --pi-red-dd: #4a0714;
  --pi-blue: #3550c9; --pi-blue-d: #1f2f86; --pi-blue-dd: #121a4f;
  --pi-gold: #f2c14e; --pi-gold-d: #b8862b; --pi-ivory: #f6eedc; --pi-pink: #ff4f7b;
  --pi-ink: #f3ecdf; --pi-ink2: #c9bfd0; --pi-ink3: #8f8499;
  --pi-line: rgba(242, 193, 78, .28);
  /* Harlequin diamonds: a conic split into four triangles per 2:3 tile, so
     neighbouring tiles join into red and blue diamonds. */
  --pi-harlequin: conic-gradient(from -33.69deg, var(--pi-red-d) 0 67.38deg, var(--pi-blue-d) 0 180deg, var(--pi-red-d) 0 247.38deg, var(--pi-blue-d) 0) 0 0 / 28px 42px;
  --scroll-acc: #c41d36;
  background: var(--pi-bg);
}
html:has(> body.cp-theme-pianoimp) { --scroll-acc: #c41d36; }

.pi {
  position: relative;
  overflow-x: clip;
  padding: 0 0 0;
  color: var(--pi-ink);
  font-family: 'Nunito', system-ui, sans-serif;
  background:
    radial-gradient(ellipse 70% 40% at 15% 30%, rgba(196, 29, 54, .16), transparent 70%),
    radial-gradient(ellipse 70% 40% at 85% 65%, rgba(53, 80, 201, .16), transparent 70%),
    var(--pi-bg);
}
/* The faint harlequin lattice behind every act. */
.pi::before { content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none; opacity: .07;
  background: conic-gradient(from -33.69deg, #ff2d4f 0 67.38deg, #4062ff 0 180deg, #ff2d4f 0 247.38deg, #4062ff 0) 0 0 / 64px 96px;
  -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 12%, #000 88%, transparent 100%); mask-image: linear-gradient(180deg, transparent 0, #000 12%, #000 88%, transparent 100%); }
.pi > * { position: relative; z-index: 1; }
.pi a { color: inherit; text-decoration: none; }
.pi img { display: block; max-width: 100%; height: auto; }
.pi em { font-style: normal; color: var(--pi-red); text-shadow: 2px 2px 0 var(--pi-blue-dd); }
.pi-suit { display: inline-block; width: 1em; height: 1em; vertical-align: -.12em; fill: currentColor; }
.pi-suit.is-diamond, .pi-suit.is-heart { fill: var(--pi-red); }
.pi-suit.is-spade, .pi-suit.is-club { fill: var(--pi-ink); }

/* ================= the stage ================= */
.pi-hero { position: relative; isolation: isolate; padding-bottom: 30px; }
.pi-stage { position: relative; overflow: hidden; height: clamp(360px, 58vw, 860px); max-height: 92vh; background: #1a0a10; }
.pi-stage-art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 28%; animation: pi-settle 2.8s cubic-bezier(.2, .7, .2, 1) .4s both; }
@keyframes pi-settle { from { transform: scale(1.07); } to { transform: none; } }
.pi-stage::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(180deg, transparent 55%, rgba(12, 9, 16, .55) 80%, var(--pi-bg) 100%); }

/* Two spotlights sweeping slowly across the stage. */
.pi-beams i { position: absolute; top: -10%; width: 34%; height: 130%; opacity: .32; mix-blend-mode: screen; pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 236, 170, .9), rgba(255, 236, 170, 0) 85%);
  clip-path: polygon(46% 0, 54% 0, 100% 100%, 0 100%); transform-origin: 50% 0; animation: pi-sweep 9s ease-in-out infinite alternate; }
.pi-beams i:first-child { left: 6%; rotate: -18deg; }
.pi-beams i:last-child { right: 6%; rotate: 18deg; animation-delay: -4.5s; }
@keyframes pi-sweep { from { transform: rotate(-8deg); } to { transform: rotate(8deg); } }

.pi-dust i { position: absolute; bottom: -10px; left: var(--x); width: 4px; height: 4px; border-radius: 50%; background: #ffe9a8; opacity: 0; box-shadow: 0 0 6px #ffd56b;
  animation: pi-dust var(--d) linear infinite; animation-delay: calc(var(--k) * -.9s); }
@keyframes pi-dust { 0% { transform: translateY(0); opacity: 0; } 15% { opacity: .8; } 100% { transform: translateY(-70vh) translateX(30px); opacity: 0; } }

/* Velvet curtains: closed to start, gathered to the sides once the page opens. */
.pi-curtain { position: absolute; top: 0; bottom: 0; z-index: 3; width: 51%; pointer-events: none;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, .35), transparent 18%, transparent 80%, rgba(0, 0, 0, .5)),
    repeating-linear-gradient(90deg, #5c0918 0, #a3142c 2.2%, #d0263f 3.4%, #a3142c 4.6%, #5c0918 6.8%);
  box-shadow: inset 0 0 60px rgba(0, 0, 0, .6); }
.pi-curtain.is-l { left: 0; transform-origin: 0 50%; }
.pi-curtain.is-r { right: 0; transform-origin: 100% 50%; }
/* The curtains part on their own as the page opens — no script needed. */
.pi-hero .pi-curtain { animation: pi-part 1.9s cubic-bezier(.6, 0, .2, 1) .35s both; }
@keyframes pi-part { from { transform: none; } to { transform: scaleX(.16); } }
.pi-tie { position: absolute; top: 56%; width: 46px; height: 16px; border-radius: 8px; background: linear-gradient(180deg, #ffe08a, var(--pi-gold-d)); box-shadow: 0 3px 6px rgba(0, 0, 0, .5); }
.pi-hero .pi-tie { animation: pi-fade .6s ease 1.9s both; }
@keyframes pi-fade { from { opacity: 0; } to { opacity: 1; } }
.pi-curtain.is-l .pi-tie { right: -4px; }
.pi-curtain.is-r .pi-tie { left: -4px; }
.pi-valance { position: absolute; left: 0; right: 0; top: 0; z-index: 4; height: clamp(34px, 5vw, 64px); pointer-events: none;
  background:
    radial-gradient(circle at 50% 0, #a3142c 0 62%, transparent 63%) 0 100% / clamp(60px, 8vw, 110px) 100% repeat-x,
    linear-gradient(180deg, #4a0714, #8a1026);
  filter: drop-shadow(0 6px 6px rgba(0, 0, 0, .45)); }
.pi-valance::after { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 8px; background: repeating-linear-gradient(90deg, var(--pi-gold) 0 6px, var(--pi-gold-d) 6px 12px); }

/* The marquee sign over the front of the stage. */
.pi-sign { position: relative; z-index: 5; max-width: 880px; margin: clamp(-140px, -9vw, -60px) auto 0; padding: 40px clamp(22px, 5vw, 64px) 38px; text-align: center;
  border-radius: 26px; background: radial-gradient(ellipse at 50% 0, #2a1630, var(--pi-panel) 70%); border: 3px solid var(--pi-gold);
  box-shadow: 0 0 0 6px var(--pi-red-dd), 0 0 0 9px var(--pi-gold-d), 0 30px 70px -20px #000; }
.pi-bulbs { position: absolute; display: flex; justify-content: space-between; pointer-events: none; }
.pi-bulbs.is-top, .pi-bulbs.is-bottom { left: 22px; right: 22px; }
.pi-bulbs.is-top { top: 12px; }
.pi-bulbs.is-bottom { bottom: 12px; }
.pi-bulbs.is-left, .pi-bulbs.is-right { top: 46px; bottom: 46px; flex-direction: column; }
.pi-bulbs.is-left { left: 12px; }
.pi-bulbs.is-right { right: 12px; }
.pi-bulbs i { width: 9px; height: 9px; border-radius: 50%; background: #fff3c6; box-shadow: 0 0 8px 2px rgba(255, 210, 100, .85); animation: pi-chase 1.2s steps(1) infinite; }
.pi-bulbs i:nth-child(3n+2) { animation-delay: .4s; }
.pi-bulbs i:nth-child(3n) { animation-delay: .8s; }
@keyframes pi-chase { 0% { opacity: 1; } 33% { opacity: .25; } }

.pi-kick { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 10px; font-family: 'Cinzel', serif; font-weight: 700; font-size: 13px; letter-spacing: .18em; text-transform: uppercase; color: var(--pi-gold); }
.pi-kick .pi-suit { width: 15px; height: 15px; }
.pi-name { margin: 2px 0 6px; font-family: 'Cinzel', 'Anton', serif; font-weight: 900; font-size: clamp(46px, 8.4vw, 108px); line-height: .95; letter-spacing: .02em; color: var(--pi-ivory);
  text-shadow: 4px 4px 0 var(--pi-red), -4px -4px 0 var(--pi-blue), 0 0 40px rgba(242, 193, 78, .35); overflow-wrap: anywhere; }
.pi-tagline { margin: 10px 0 18px; font-family: 'Cinzel', serif; font-weight: 700; font-size: clamp(17px, 2.2vw, 24px); letter-spacing: .14em; text-transform: uppercase; color: var(--pi-gold); }
.pi-tags { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 0 0 22px; padding: 0; list-style: none; }
.pi-tags li { display: inline-flex; align-items: center; gap: 6px; padding: 6px 13px; border-radius: 99px; background: rgba(255, 255, 255, .06); border: 1px solid var(--pi-line); font-weight: 800; font-size: 14px; }
.pi-tags .pi-suit { width: 12px; height: 12px; }

.pi-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.pi-actions.is-center { justify-content: center; margin-top: 22px; }
.pi-btn { display: inline-flex; align-items: center; gap: 8px; padding: 13px 22px; border-radius: 12px; border: 2px solid var(--pi-gold); background: rgba(12, 9, 16, .6); color: var(--pi-ivory);
  font-family: 'Cinzel', serif; font-weight: 900; font-size: 15px; letter-spacing: .06em; text-transform: uppercase; cursor: pointer; transition: transform .25s var(--spring-snappy, ease), background .25s ease; }
.pi-btn:hover { transform: translateY(-2px); background: rgba(242, 193, 78, .12); }
.pi-btn.is-hot { position: relative; overflow: hidden; border-color: var(--pi-gold); background: var(--pi-red); box-shadow: 0 6px 0 var(--pi-red-dd), 0 10px 26px -8px rgba(196, 29, 54, .8); }
.pi-btn.is-hot:hover { background: #d8263f; }
.pi-btn:focus-visible, .pi-key:focus-visible, .pi-mask:focus-visible, .pi-deck a:focus-visible { outline: 3px solid var(--pi-gold); outline-offset: 3px; }

/* ================= the gem suits ================= */
.pi-gem { position: absolute; z-index: 2; pointer-events: none; width: clamp(54px, 7vw, 104px); filter: drop-shadow(0 12px 20px rgba(0, 0, 0, .55)); animation: pi-float 7s ease-in-out infinite alternate; }
.pi-gem img { width: 100%; animation: pi-tilt 11s ease-in-out infinite alternate; }
.pi-gem.is-diamond { animation-delay: -3s; }
@keyframes pi-float { from { transform: translateY(0); } to { transform: translateY(-22px); } }
@keyframes pi-tilt { from { transform: rotate(-12deg); } to { transform: rotate(12deg); } }
.pi-gem.at-hero.is-spade { left: max(2%, calc(50% - 600px)); bottom: 40px; }
.pi-gem.at-hero.is-diamond { right: max(2%, calc(50% - 600px)); bottom: 110px; }
.pi-gem.at-about { right: 1%; top: 30px; width: clamp(44px, 5vw, 74px); }
.pi-gem.at-streams { left: -10px; top: 10px; width: clamp(40px, 4.4vw, 66px); }
.pi-gem.at-cards { right: 2%; top: 30px; }
.pi-gem.at-shop { left: 1%; bottom: 10px; width: clamp(40px, 4.4vw, 66px); }

/* ================= piano keys between the acts ================= */
.pi-keys { position: relative; z-index: 2; max-width: 1100px; margin: 26px auto; padding: 0 20px; opacity: 0; transform: translateY(16px); transition: opacity .8s ease, transform .8s ease; }
.pi-keys.is-in { opacity: 1; transform: none; }
.pi-keys-rail { height: 18px; border-radius: 10px 10px 0 0; background: var(--pi-harlequin); border: 2px solid var(--pi-gold-d); border-bottom: 0; box-shadow: inset 0 -4px 6px rgba(0, 0, 0, .5); }
.pi-keys-bed { position: relative; display: flex; height: clamp(84px, 11vw, 140px); padding: 0 0 6px; border: 2px solid var(--pi-gold-d); border-top: 0; border-radius: 0 0 10px 10px; background: #0a0709; touch-action: none; }
.pi-key { position: relative; padding: 0; border: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.pi-key.is-white { flex: 1 1 0; margin: 0 1px; border-radius: 0 0 6px 6px; background: linear-gradient(180deg, #e9dfc9, var(--pi-ivory) 30%, #fffaf0 92%, #d9ccb0); box-shadow: inset 0 -6px 0 #d8c9a6; transition: transform .08s ease, background .15s ease; transform-origin: 50% 0; }
.pi-key.is-black { position: absolute; top: 0; left: calc(var(--at) / 14 * 100%); z-index: 2; width: 4.4%; height: 60%; translate: -50% 0; border-radius: 0 0 5px 5px;
  background: linear-gradient(180deg, #2b2330, #0a070c 85%, #3a3040); box-shadow: inset 0 -5px 0 #000, 0 3px 4px rgba(0, 0, 0, .6); transition: transform .08s ease; transform-origin: 50% 0; }
.pi-key.is-on.is-white { transform: scaleY(.985); background: linear-gradient(180deg, #ffd56b, #ffe7a6 60%, #ffcf5c); box-shadow: inset 0 -2px 0 var(--pi-gold-d), 0 0 22px rgba(242, 193, 78, .7); }
.pi-key.is-on.is-black { transform: scaleY(.97); background: linear-gradient(180deg, var(--pi-red), var(--pi-red-d)); }
.pi-key.is-white:nth-child(7n+1)::after { content: ""; position: absolute; left: 50%; bottom: 14px; width: 7px; height: 7px; margin-left: -3.5px; rotate: 45deg; background: var(--pi-red); opacity: .55; }

/* The notes a key throws up as it plays. */
.pi-notes { position: fixed; inset: 0; z-index: 60; pointer-events: none; overflow: hidden; }
.pi-note { position: absolute; width: 22px; height: 22px; margin: -11px 0 0 -11px; animation: pi-note 1.3s cubic-bezier(.2, .7, .3, 1) forwards; }
.pi-note .pi-suit { width: 100%; height: 100%; filter: drop-shadow(0 0 6px rgba(242, 193, 78, .8)); }
@keyframes pi-note { from { transform: translate(0, 0) scale(.6) rotate(0); opacity: 1; } to { transform: translate(var(--dx), -120px) scale(1.25) rotate(var(--r)); opacity: 0; } }

/* ================= acts ================= */
.pi-sec { max-width: 1240px; margin: 0 auto; padding: 56px 32px; }
.pi-sec-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.pi-sec-head.is-center { justify-content: center; text-align: center; }
.pi-title { margin: 0; font-family: 'Cinzel', serif; font-weight: 900; font-size: clamp(32px, 4.6vw, 56px); line-height: 1.02; text-transform: uppercase; letter-spacing: .02em; color: var(--pi-ivory); }
.pi-more { padding: 9px 16px; border-radius: 10px; border: 2px solid var(--pi-gold-d); font-family: 'Cinzel', serif; font-weight: 900; font-size: 14px; color: var(--pi-gold); white-space: nowrap; transition: background .2s ease; }
.pi-more:hover { background: rgba(242, 193, 78, .1); }
.pi-row-h { margin: 18px 0 12px; font-family: 'Cinzel', serif; font-weight: 700; font-size: 18px; letter-spacing: .12em; text-transform: uppercase; color: var(--pi-ink2); }
.pi-rules { max-width: 560px; margin: 12px auto 0; color: var(--pi-ink2); font-size: 16px; line-height: 1.6; }
.pi-panel { position: relative; padding: 30px; border-radius: 20px; background: linear-gradient(180deg, rgba(36, 24, 44, .92), rgba(22, 15, 28, .94)); border: 1px solid var(--pi-line); box-shadow: 0 24px 50px -24px #000; }
.pi-panel::before { content: ""; position: absolute; left: 18px; right: 18px; top: -1px; height: 6px; border-radius: 0 0 6px 6px; background: var(--pi-harlequin); background-size: 14px 21px; opacity: .95; }
.pi-empty p { margin: 0; color: var(--pi-ink2); line-height: 1.6; }
.pi-empty a { color: var(--pi-gold); text-decoration: underline; }

/* Act I: a playing card of him beside his own words. */
.pi-about { display: grid; grid-template-columns: minmax(0, 380px) minmax(0, 1fr); gap: 48px; align-items: center; }
.pi-playing { position: relative; margin: 0; padding: 16px; border-radius: 22px; background: var(--pi-ivory); rotate: -3deg; box-shadow: 0 0 0 3px var(--pi-gold), 0 30px 60px -20px #000; opacity: 0; transform: translateY(24px); transition: opacity .8s ease, transform .9s cubic-bezier(.2, .8, .2, 1), rotate .5s ease; }
.pi-playing.is-in { opacity: 1; transform: none; }
.pi-playing:hover { rotate: 0deg; }
.pi-playing img { width: 100%; border-radius: 12px; border: 3px solid var(--pi-red-d); }
.pi-index { position: absolute; z-index: 2; display: flex; flex-direction: column; align-items: center; line-height: 1; font-family: 'Cinzel', serif; font-weight: 900; color: var(--pi-red); }
.pi-index b { font-size: 26px; }
.pi-index .pi-suit { width: 20px; height: 20px; margin-top: 2px; }
.pi-index .pi-suit.is-spade { fill: #16101a; }
.pi-index.is-tl { left: 2px; top: 4px; padding: 6px 6px 8px; border-radius: 0 0 12px 0; background: var(--pi-ivory); }
.pi-index.is-br { right: 2px; bottom: 4px; padding: 8px 6px 6px; border-radius: 12px 0 0 0; background: var(--pi-ivory); rotate: 180deg; color: #16101a; }
.pi-about-copy { opacity: 0; transform: translateY(24px); transition: opacity .8s ease .1s, transform .9s cubic-bezier(.2, .8, .2, 1) .1s; }
.pi-about-copy.is-in { opacity: 1; transform: none; }
.pi-about-copy p { font-size: 17px; line-height: 1.7; color: var(--pi-ink2); }
.pi-about-copy .pi-title { margin-bottom: 14px; }
.pi-links { display: flex; flex-wrap: wrap; gap: 10px; margin: 20px 0 0; padding: 0; list-style: none; }
.pi-links a { display: inline-flex; align-items: center; gap: 8px; padding: 9px 15px 9px 9px; border-radius: 12px; background: rgba(255, 255, 255, .05); border: 1px solid var(--pi-line); font-weight: 800; transition: background .2s ease, transform .2s ease; }
.pi-links a:hover { background: rgba(196, 29, 54, .25); transform: translateY(-2px); }
.pi-links span { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: var(--pi-red); }
.pi-links svg { width: 16px; height: 16px; fill: #fff; }

/* Video rails: show tickets with a perforated stub. */
.pi-rail { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(260px, 30%); gap: 18px; overflow-x: auto; padding: 6px 4px 18px; scroll-snap-type: x mandatory; scrollbar-width: thin; scrollbar-color: var(--pi-red) transparent; }
.pi-rail.is-tall { grid-auto-columns: minmax(180px, 19%); }
.pi-card { scroll-snap-align: start; padding: 10px; border-radius: 16px; background: linear-gradient(180deg, #241830, #170f1d); border: 2px solid var(--pi-gold-d); transition: transform .3s var(--spring-snappy, ease), border-color .3s ease; }
.pi-card:hover { transform: translateY(-4px) rotate(-.6deg); border-color: var(--pi-gold); }
.pi-card-thumb { position: relative; overflow: hidden; border-radius: 10px; aspect-ratio: 16 / 9; background: var(--pi-harlequin); }
.pi-card.is-tall .pi-card-thumb { aspect-ratio: 9 / 16; }
.pi-card-thumb > a { position: absolute; inset: 0; display: block; }
.pi-card-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.pi-card:hover .pi-card-thumb img { transform: scale(1.05); }
.pi-play { position: absolute; left: 50%; top: 50%; display: grid; place-items: center; width: 54px; height: 54px; margin: -27px 0 0 -27px; rotate: 45deg; border-radius: 8px; background: var(--pi-red); border: 2px solid var(--pi-gold); box-shadow: 0 8px 20px rgba(0, 0, 0, .55); transition: transform .3s var(--spring-snappy, ease); }
.pi-play i { rotate: -45deg; font-style: normal; font-size: 18px; color: #fff; margin-left: 3px; }
.pi-card:hover .pi-play { transform: scale(1.12); }
.pi-chip { position: absolute; left: 8px; top: 8px; display: inline-flex; align-items: center; gap: 5px; padding: 4px 9px; border-radius: 7px; background: rgba(12, 9, 16, .82); border: 1px solid var(--pi-line); font-size: 12px; font-weight: 800; letter-spacing: .04em; }
.pi-chip .pi-suit { width: 11px; height: 11px; }
.pi-len { position: absolute; right: 8px; bottom: 8px; padding: 3px 8px; border-radius: 6px; background: rgba(12, 9, 16, .82); font-size: 12px; font-weight: 800; }
.pi-card-title { margin: 10px 2px 2px; padding-top: 10px; border-top: 2px dashed rgba(242, 193, 78, .3); font-family: 'Nunito', system-ui, sans-serif; text-transform: none; letter-spacing: 0; color: var(--pi-ink); font-size: 15px; font-weight: 800; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pi-card.is-tall .pi-card-title { font-size: 14px; }
.pi-follow { display: flex; align-items: center; gap: 16px; max-width: 520px; }
.pi-follow-ico { display: grid; place-items: center; width: 54px; height: 54px; border-radius: 12px; background: var(--pi-red); }
.pi-follow-ico svg { width: 26px; height: 26px; fill: #fff; }
.pi-follow b { display: block; font-size: 18px; }
.pi-follow small { color: var(--pi-ink3); font-size: 14px; }
.pi-follow-go { margin-left: auto; font-size: 24px; color: var(--pi-gold); }

/* The interlude: the mask, centre stage. */
.pi-interlude { position: relative; max-width: 760px; margin: 20px auto; padding: 56px 24px 40px; text-align: center; border-radius: 28px;
  background: radial-gradient(ellipse 60% 70% at 50% 40%, rgba(255, 220, 140, .14), transparent 70%); opacity: 0; transform: scale(.96); transition: opacity .8s ease, transform .9s ease; }
.pi-interlude.is-in { opacity: 1; transform: none; }
.pi-interlude .pi-bulbs.is-top { top: 14px; left: 18%; right: 18%; }
.pi-mask { position: relative; display: block; width: clamp(170px, 26vw, 260px); margin: 0 auto; padding: 0; border: 0; background: none; cursor: pointer; animation: pi-sway 5s ease-in-out infinite alternate; transform-origin: 50% 10%; }
.pi-mask img { width: 100%; filter: drop-shadow(0 20px 30px rgba(0, 0, 0, .6)); }
@keyframes pi-sway { from { transform: rotate(-5deg); } to { transform: rotate(5deg); } }
.pi-mask.is-laughing { animation: pi-laugh .7s ease; }
@keyframes pi-laugh { 0%, 100% { transform: none; } 15% { transform: translateY(-10px) rotate(-6deg) scale(1.05); } 30% { transform: translateY(0) rotate(5deg); } 45% { transform: translateY(-8px) rotate(-4deg) scale(1.04); } 60% { transform: rotate(3deg); } 80% { transform: translateY(-4px) rotate(-2deg); } }
.pi-ha { position: absolute; inset: 0; pointer-events: none; }
.pi-ha i { position: absolute; top: 20%; font-family: 'Cinzel', serif; font-weight: 900; font-style: normal; font-size: clamp(22px, 3vw, 34px); color: var(--pi-gold); text-shadow: 2px 2px 0 var(--pi-red); opacity: 0; }
.pi-ha i:nth-child(1) { left: -30%; --dx: -30px; }
.pi-ha i:nth-child(2) { right: -34%; top: 10%; --dx: 30px; color: var(--pi-pink); }
.pi-ha i:nth-child(3) { left: 50%; top: -18%; --dx: 0px; translate: -50% 0; }
.pi-mask.is-laughing .pi-ha i { animation: pi-ha 1.1s ease-out forwards; }
.pi-mask.is-laughing .pi-ha i:nth-child(2) { animation-delay: .15s; }
.pi-mask.is-laughing .pi-ha i:nth-child(3) { animation-delay: .3s; }
@keyframes pi-ha { 0% { opacity: 0; transform: scale(.4); } 25% { opacity: 1; transform: scale(1.15) translateX(var(--dx)); } 100% { opacity: 0; transform: translateY(-40px) translateX(var(--dx)) scale(1); } }
.pi-interlude-line { margin: 26px 0 4px; font-family: 'Cinzel', serif; font-weight: 900; font-size: clamp(22px, 3.2vw, 34px); text-transform: uppercase; }
.pi-interlude-hint { margin: 0; color: var(--pi-ink3); font-size: 14px; }

/* Act IV: pick a card. */
.pi-cards-sec { padding-bottom: 40px; }
.pi-deck { display: flex; flex-wrap: wrap; justify-content: center; gap: clamp(16px, 2vw, 24px); max-width: 1140px; margin: 34px auto 0; padding: 0; list-style: none; perspective: 1400px; }
.pi-deal { flex: 0 1 164px; min-width: 0; rotate: var(--t); transition: rotate .4s ease, translate .4s var(--spring-snappy, ease); }
.pi-deal:hover { rotate: 0deg; translate: 0 -6px; }
.pi-deal > a { display: block; aspect-ratio: 5 / 7; }
.pi-flip { position: relative; display: block; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform .8s cubic-bezier(.3, 1.3, .5, 1); }
.pi-face, .pi-back { position: absolute; inset: 0; border-radius: 16px; overflow: hidden; -webkit-backface-visibility: hidden; backface-visibility: hidden; box-shadow: 0 18px 34px -14px #000; }
.pi-face { padding: 9px; background: var(--pi-ivory); border: 2px solid var(--pi-gold); }
.pi-face img { width: 100%; height: 100%; object-fit: cover; border-radius: 9px; }
.pi-face .pi-index { left: 9px; top: 9px; padding: 5px 6px 7px; }
.pi-face .pi-index b { font-size: 20px; }
.pi-face .pi-index .pi-suit { width: 16px; height: 16px; }
.pi-back { transform: rotateY(180deg); display: grid; place-items: center; background: var(--pi-harlequin); border: 9px solid var(--pi-ivory); outline: 2px solid var(--pi-gold); outline-offset: -14px; }
.pi-back::before { content: ""; position: absolute; inset: 14px; border-radius: 8px; border: 2px solid var(--pi-gold); }
.pi-back-gem { position: relative; display: grid; place-items: center; width: 44%; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle, rgba(12, 9, 16, .9) 55%, rgba(12, 9, 16, 0) 72%); }
.pi-back-gem img, .pi-back-gem .pi-suit { width: 70%; height: auto; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .6)); }
/* Dealt (pianoimp.js): face down until picked. */
.pi-deck.is-dealt .pi-deal:not(.is-up) .pi-flip { transform: rotateY(180deg); }
.pi-deck.is-dealt .pi-deal:not(.is-up) > a { cursor: pointer; }
.pi-deck.is-dealing .pi-deal { animation: pi-deal .7s cubic-bezier(.2, .9, .3, 1.2) both; animation-delay: calc(var(--k) * .09s); }
@keyframes pi-deal { from { opacity: 0; transform: translate(0, -80px) rotate(-20deg) scale(.8); } to { opacity: 1; transform: none; } }
.pi-deal.is-up .pi-face { box-shadow: 0 0 0 3px var(--pi-gold), 0 0 30px rgba(242, 193, 78, .45), 0 18px 34px -14px #000; }

/* The closer look. */
.pi-viewer { width: min(94vw, 980px); max-width: none; max-height: none; margin: auto; padding: 0; border: 0; background: none; overflow: visible; color: var(--pi-ink); }
.pi-viewer::backdrop { background: rgba(8, 4, 10, .78); }
.pi-viewer-panel { position: relative; padding: 16px 16px 12px; border-radius: 26px; background: var(--pi-harlequin); border: 4px solid var(--pi-gold); box-shadow: 0 30px 70px -20px #000; }
.pi-viewer[open] .pi-viewer-panel { animation: pi-viewer-in .45s cubic-bezier(.3, 1.4, .5, 1); }
@keyframes pi-viewer-in { from { opacity: 0; transform: translateY(18px) rotateY(-30deg) scale(.94); } to { opacity: 1; transform: none; } }
.pi-viewer-frame { display: grid; place-items: center; border-radius: 16px; border: 6px solid var(--pi-ivory); background: var(--pi-bg); overflow: hidden; }
.pi-viewer-frame img { width: auto; max-width: 100%; height: auto; max-height: calc(100vh - 200px); }
.pi-viewer-frame img.is-swap { animation: pi-viewer-swap .4s ease; }
@keyframes pi-viewer-swap { from { opacity: 0; transform: scale(.97); } to { opacity: 1; transform: none; } }
.pi-viewer-close { position: absolute; right: -14px; top: -14px; z-index: 2; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; border: 3px solid var(--pi-gold); background: var(--pi-red); color: #fff; font-size: 26px; line-height: 1; cursor: pointer; }
.pi-viewer-bar { display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 10px; }
.pi-viewer-nav { position: relative; display: grid; place-items: center; width: 46px; height: 46px; padding: 0; border: 2px solid var(--pi-gold); border-radius: 12px; background: rgba(12, 9, 16, .85); color: var(--pi-ivory); cursor: pointer; }
.pi-viewer-nav .pi-suit { position: absolute; width: 60%; height: 60%; opacity: .25; }
.pi-viewer-nav i { position: relative; font-style: normal; font-size: 26px; font-weight: 900; }
.pi-viewer-count { margin: 0; min-width: 70px; padding: 6px 12px; border-radius: 8px; background: rgba(12, 9, 16, .85); text-align: center; font-family: 'Cinzel', serif; font-weight: 900; }

/* The merch tent. */
/* Four across (he has four pieces); two by two below that, never 3 + 1. */
.pi-shop { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
@media (max-width: 1080px) { .pi-shop { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; } }
@media (max-width: 560px) { .pi-shop { grid-template-columns: minmax(0, 1fr); } }
.pi-soon { display: flex; align-items: center; gap: 22px; }
.pi-soon img { width: 90px; flex: none; animation: pi-sway 5s ease-in-out infinite alternate; }

/* Join the troupe. */
.pi-join-card { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 34px; align-items: center; opacity: 0; transform: translateY(20px); transition: opacity .8s ease, transform .8s ease; }
.pi-join-card.is-in { opacity: 1; transform: none; }
.pi-join-copy p:not(.pi-kick) { color: var(--pi-ink2); line-height: 1.7; font-size: 16px; }
.pi-join-copy .pi-actions { justify-content: flex-start; }
.pi-nums { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 0; padding: 0; list-style: none; }
.pi-nums li { padding: 16px; border-radius: 14px; background: rgba(255, 255, 255, .04); border: 1px solid var(--pi-line); }
.pi-nums b { display: block; font-family: 'Cinzel', serif; font-weight: 900; font-size: 30px; color: var(--pi-gold); }
.pi-nums span { font-size: 13px; color: var(--pi-ink2); }

/* ================= curtain call ================= */
.pi-end { position: relative; overflow: hidden; margin-top: 40px; padding: 70px 24px 60px; background: radial-gradient(ellipse 50% 70% at 50% 100%, rgba(255, 210, 120, .18), transparent 70%), #12080c; border-top: 6px solid var(--pi-red-d); }
.pi-curtain.is-call { width: 30%; }
.pi-curtain.is-call.is-l { transform: scaleX(.7); }
.pi-curtain.is-call.is-r { transform: scaleX(.7); }
.pi-end-in { position: relative; z-index: 4; display: flex; align-items: center; justify-content: center; gap: clamp(18px, 4vw, 48px); max-width: 860px; margin: 0 auto; }
.pi-end-art { width: clamp(130px, 18vw, 220px); border-radius: 18px; border: 3px solid var(--pi-gold); box-shadow: 0 20px 40px -14px #000; rotate: -4deg; }
.pi-end-card { padding: 26px 28px; border-radius: 20px; background: rgba(25, 18, 31, .92); border: 1px solid var(--pi-line); text-align: center; }
.pi-gg { margin: 4px 0 0; font-family: 'Cinzel', serif; font-weight: 900; font-size: clamp(22px, 3vw, 32px); text-transform: uppercase; line-height: 1.15; }
.pi-credits { margin: 14px 0 0; color: var(--pi-ink3); font-size: 13px; }
.pi-credits a { color: var(--pi-gold); }

/* ================= the site's bar, in his colours ================= */
body.cp-theme-pianoimp .cpnav-in { background: rgba(25, 14, 26, .95); border-color: rgba(242, 193, 78, .35); -webkit-backdrop-filter: none; backdrop-filter: none; box-shadow: 0 10px 30px -12px rgba(0, 0, 0, .7); }
body.cp-theme-pianoimp .cpnav-who { color: var(--pi-ivory); border-left-color: rgba(242, 193, 78, .3); font-family: 'Cinzel', serif; font-weight: 900; }
body.cp-theme-pianoimp .cpnav-av { border-color: var(--pi-gold); }
body.cp-theme-pianoimp .cpnav-links a { color: var(--pi-ink2); font-weight: 700; }
body.cp-theme-pianoimp .cpnav-links a:hover { color: #fff; background: rgba(196, 29, 54, .3); }
body.cp-theme-pianoimp .cpnav-links a[aria-current="true"] { background: var(--pi-red); color: #fff; box-shadow: none; }
body.cp-theme-pianoimp :is(.cpnav-burger, .cpnav-account) { background: #2a1630; color: var(--pi-ivory); }
body.cp-theme-pianoimp .cpnav-burger span { background: var(--pi-gold); }
body.cp-theme-pianoimp .cpnav-cart { background: var(--pi-red); color: #fff; box-shadow: 0 4px 0 var(--pi-red-dd); }
body.cp-theme-pianoimp .cpnav-cart:hover { background: #d8263f; }

/* ================= the video player, in his colours ================= */
body.cp-theme-pianoimp .cp-player { background: rgba(8, 4, 10, .78); -webkit-backdrop-filter: none; backdrop-filter: none; }
body.cp-theme-pianoimp .cp-player-panel { padding: 14px 14px 10px; border-radius: 22px; background: var(--pi-harlequin); border: 4px solid var(--pi-gold); box-shadow: 0 30px 70px -20px #000; }
body.cp-theme-pianoimp .cp-player-frame { border-radius: 14px; overflow: hidden; border: 4px solid var(--pi-ivory); background: #000; }
body.cp-theme-pianoimp .cp-player-caption { margin: 10px 4px 2px; padding: 8px 14px; border-radius: 10px; background: rgba(12, 9, 16, .9); font-family: 'Cinzel', serif; font-weight: 900; color: var(--pi-ivory); }
body.cp-theme-pianoimp .cp-player-close { background: var(--pi-red); color: #fff; border: 3px solid var(--pi-gold); font-weight: 900; }

/* ================= phones and tablets ================= */
@media (max-width: 900px) {
  .pi-sec { padding: 44px 18px; }
  .pi-about { grid-template-columns: minmax(0, 1fr); gap: 30px; }
  .pi-playing { max-width: 340px; margin: 0 auto; }
  .pi-join-card { grid-template-columns: minmax(0, 1fr); }
  .pi-rail { grid-auto-columns: minmax(240px, 72%); }
  .pi-rail.is-tall { grid-auto-columns: minmax(160px, 44%); }
  .pi-gem.at-hero { display: none; }
  .pi-sign { margin-left: 14px; margin-right: 14px; }
}
@media (max-width: 560px) {
  /* The whole stage, at its own shape, below the two-row bar. */
  .pi-stage { height: auto; max-height: none; padding-top: 104px; background: linear-gradient(180deg, #2a0710, #1a0a10); }
  .pi-stage-art { position: relative; height: auto; object-fit: fill; }
  .pi-stage::after { background: linear-gradient(180deg, transparent 75%, var(--pi-bg) 100%); }
  .pi-sign { padding: 34px 20px 32px; margin-top: -24px; }
  .pi-kick { font-size: 11px; letter-spacing: .14em; }
  .pi-bulbs.is-left, .pi-bulbs.is-right { display: none; }
  .pi-bulbs.is-top i:nth-child(n+11), .pi-bulbs.is-bottom i:nth-child(n+11) { display: none; }
  .pi-sec-head { flex-wrap: wrap; }
  .pi-deal { flex-basis: calc(50% - 12px); max-width: 190px; }
  .pi-keys { padding: 0 10px; }
  .pi-end-in { flex-direction: column; }
  .pi-curtain.is-call { width: 22%; }
  .pi-ha i:nth-child(1) { left: -12%; }
  .pi-ha i:nth-child(2) { right: -14%; }
}

/* ================= calm: reduced motion and lite mode ================= */
@media (prefers-reduced-motion: reduce) {
  .pi *, .pi *::before, .pi *::after { animation: none !important; transition-duration: .01ms !important; transition-delay: 0s !important; }
  .pi-hero .pi-curtain { transform: scaleX(.16); }
  .pi-tie { opacity: 1; }
}
.perf-lite .pi-dust, .perf-lite .pi-beams { display: none; }
.perf-lite .pi-gem, .perf-lite .pi-gem img, .perf-lite .pi-bulbs i, .perf-lite .pi-mask:not(.is-laughing), .perf-lite .pi-soon img { animation: none; }
