/* ===========================================================================
   WISCRIPT — THE QUACK INNOVATION AWARDS
   The billing on the page, and the theatre it opens into. Two registers: the
   ceremony (gold, velvet, moonlight) and the reel that was not supposed to be
   in the machine (red, grain, tape). Same bones, different lamps.
   =========================================================================== */

/* ------------------------------------------------------------- the billing */
.qia-bill { text-align: center; }
.qia-bill .legend { color: var(--duck); }
.qia-bill h2 {
  font-size: clamp(30px, 6.4vw, 54px); line-height: 1.04;
  margin: 12px 0 0; font-variation-settings: 'opsz' 48;
}
.qia-bill p { margin: 12px auto 0; max-width: 54ch; }
.qia-bill__bulbs {
  display: flex; justify-content: center; gap: 9px;
  margin: var(--base) 0 var(--wide); list-style: none; padding: 0;
}
.qia-bill__bulbs i {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--duck); opacity: .22;
  animation: qia-bulb 1.9s infinite steps(1, end);
}
.qia-bill__bulbs i:nth-child(2) { animation-delay: .19s; }
.qia-bill__bulbs i:nth-child(3) { animation-delay: .38s; }
.qia-bill__bulbs i:nth-child(4) { animation-delay: .57s; }
.qia-bill__bulbs i:nth-child(5) { animation-delay: .76s; }
.qia-bill__bulbs i:nth-child(6) { animation-delay: .95s; }
.qia-bill__bulbs i:nth-child(7) { animation-delay: 1.14s; }
@keyframes qia-bulb {
  0%, 22%   { opacity: 1; box-shadow: 0 0 10px rgba(255,210,63,.75); }
  23%, 100% { opacity: .22; box-shadow: none; }
}
.switch.qia-open {
  background: var(--duck); color: var(--ink-on-duck);
  padding: 14px 22px; font-size: 12px;
}
.switch.qia-open:hover { background: #ffdd70; }
.switch.qia-open:active { background: #e6bd2f; }
.qia-bill__fine { margin-top: var(--base) !important; }

/* ---------------------------------------------------------------- theatre */
.qia {
  position: fixed; inset: 0; z-index: 9800;
  background: #04080a;
  color: #f4ecdc;
  font-family: 'Newsreader', Georgia, serif;
  opacity: 0; transition: opacity .55s ease;
  display: grid; grid-template-rows: 1fr auto;
  overflow: hidden;
  --qia-gold: #ffd23f;
  --qia-warm: #f6ead2;
  --qia-vel1: #52101a;
  --qia-vel2: #7a1a26;
  --qia-vel3: #380a12;
}
.qia.is-in { opacity: 1; }
.qia--dark {
  --qia-gold: #ff3b5c;
  --qia-warm: #ffd9de;
  --qia-vel1: #2a0208;
  --qia-vel2: #4a0410;
  --qia-vel3: #170105;
  background: #0a0203;
}

/* the room: a pool of light on a dark floor, plus dust */
.qia__room {
  position: relative; overflow: hidden; min-height: 0;
  display: grid; place-items: center;
  padding: clamp(18px, 4vw, 46px);
}
.qia__room::before {
  content: ''; position: absolute; inset: -10%;
  background:
    radial-gradient(60% 46% at 50% 34%, rgba(255,210,63,.13), transparent 70%),
    radial-gradient(90% 70% at 50% 120%, rgba(255,210,63,.07), transparent 70%);
  pointer-events: none;
}
.qia--dark .qia__room::before {
  background:
    radial-gradient(58% 44% at 50% 34%, rgba(255,59,92,.16), transparent 70%),
    radial-gradient(90% 70% at 50% 120%, rgba(120,0,30,.22), transparent 70%);
}
.qia__grain {
  position: absolute; inset: -50%; pointer-events: none; opacity: .05;
  background-image: var(--shimmer); background-size: 120px 120px;
  animation: qia-grain 1.1s steps(3, end) infinite;
}
.qia--dark .qia__grain { opacity: .16; }
@keyframes qia-grain {
  0%   { transform: translate3d(0,0,0); }
  33%  { transform: translate3d(-18px, 9px, 0); }
  66%  { transform: translate3d(11px, -14px, 0); }
  100% { transform: translate3d(0,0,0); }
}

/* two spotlights crossing the stage */
.qia__beam {
  position: absolute; top: -34%; width: 46vmax; height: 120vmax;
  pointer-events: none; mix-blend-mode: screen;
  background: linear-gradient(to bottom, rgba(255,210,63,.16), rgba(255,210,63,0) 62%);
  clip-path: polygon(46% 0, 54% 0, 100% 100%, 0 100%);
  transform-origin: 50% 0;
  opacity: 0; transition: opacity .9s ease;
}
.qia--dark .qia__beam { background: linear-gradient(to bottom, rgba(255,59,92,.2), rgba(255,59,92,0) 62%); }
.qia.is-lit .qia__beam { opacity: 1; }
.qia__beam--l { left: -18vmax; animation: qia-sweep-l 13s ease-in-out infinite alternate; }
.qia__beam--r { right: -18vmax; animation: qia-sweep-r 11s ease-in-out infinite alternate; }
@keyframes qia-sweep-l { from { transform: rotate(9deg); } to { transform: rotate(26deg); } }
@keyframes qia-sweep-r { from { transform: rotate(-9deg); } to { transform: rotate(-26deg); } }

/* velvet */
.qia__curtain {
  position: absolute; top: 0; bottom: 0; width: 52%;
  background:
    repeating-linear-gradient(90deg,
      var(--qia-vel3) 0 10px, var(--qia-vel1) 10px 26px,
      var(--qia-vel2) 26px 34px, var(--qia-vel1) 34px 50px);
  box-shadow: 0 0 80px rgba(0,0,0,.7) inset;
  transition: transform 1.5s cubic-bezier(.65,.02,.2,1);
  z-index: 4;
}
.qia__curtain--l { left: 0; transform: translateX(0); }
.qia__curtain--r { right: 0; transform: translateX(0); }
.qia.is-open .qia__curtain--l { transform: translateX(-101%); }
.qia.is-open .qia__curtain--r { transform: translateX(101%); }
.qia__pelmet {
  position: absolute; top: 0; left: 0; right: 0; height: 58px; z-index: 5;
  background:
    repeating-linear-gradient(90deg,
      var(--qia-vel3) 0 10px, var(--qia-vel1) 10px 26px,
      var(--qia-vel2) 26px 34px, var(--qia-vel1) 34px 50px);
  -webkit-mask-image: radial-gradient(22px 26px at 22px 100%, transparent 98%, #000 100%);
  mask-image: radial-gradient(22px 26px at 22px 100%, transparent 98%, #000 100%);
  -webkit-mask-size: 44px 100%; mask-size: 44px 100%;
  -webkit-mask-repeat: repeat-x; mask-repeat: repeat-x;
}

/* --------------------------------------------------------------- the stage */
.qia__stage {
  position: relative; z-index: 6;
  width: min(760px, 100%); text-align: center;
  max-height: 100%; min-height: 0; overflow-y: auto;
  scrollbar-width: thin; scrollbar-color: rgba(255,210,63,.3) transparent;
}
.qia__scene { min-height: min(52vh, 430px); display: grid; align-content: center; gap: var(--base); padding: 6px 2px; }
.qia p { max-width: none; margin: 0; }
.qia .qia__cite   { max-width: 56ch; margin: 0 auto; }
.qia .qia__speech { max-width: 52ch; margin: 0 auto; }
.qia .qia__say    { max-width: 54ch; margin: 0 auto; }

.qia__marquee {
  font-size: clamp(26px, 5.6vw, 58px); line-height: 1.02; font-weight: 560;
  letter-spacing: -.02em; color: var(--qia-warm);
  text-shadow: 0 0 38px rgba(255,210,63,.3);
}
.qia--dark .qia__marquee { text-shadow: 0 0 34px rgba(255,59,92,.45); }
.qia__marquee b { color: var(--qia-gold); font-weight: 560; }
.qia__sub {
  font-family: 'Spline Sans Mono', ui-monospace, monospace;
  font-size: 11px; letter-spacing: .22em; text-transform: uppercase;
  color: rgba(244,236,220,.55);
}

.qia__nomlabel { transition: opacity .4s ease, max-height .5s var(--ease); max-height: 2em; }
.qia__nomlabel.is-out { opacity: 0; max-height: 0; overflow: hidden; }
.qia__cat {
  font-family: 'Spline Sans Mono', ui-monospace, monospace;
  font-size: clamp(11px, 1.6vw, 13px); letter-spacing: .26em; text-transform: uppercase;
  color: var(--qia-gold);
}
.qia__rule {
  width: 62px; height: 2px; margin: 0 auto; background: var(--qia-gold); opacity: .55;
  transform: scaleX(0); transform-origin: 50%;
  animation: qia-rule .7s var(--ease) forwards;
}
@keyframes qia-rule { to { transform: scaleX(1); } }

.qia__noms { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.qia__noms li {
  background: rgba(255,255,255,.035);
  border: 1px solid rgba(255,210,63,.14);
  border-radius: 10px; padding: 13px 16px;
  display: grid; gap: 3px; text-align: left;
  opacity: 0; transform: translateY(10px);
  animation: qia-nom .5s var(--ease) forwards;
}
.qia--dark .qia__noms li { border-color: rgba(255,59,92,.22); }
.qia__noms li:nth-child(2) { animation-delay: .5s; }
.qia__noms li:nth-child(3) { animation-delay: 1s; }
.qia__noms li:nth-child(4) { animation-delay: 1.5s; }
@keyframes qia-nom { to { opacity: 1; transform: none; } }
.qia__nom-n { font-size: 19px; font-weight: 600; color: var(--qia-warm); }
.qia__nom-m {
  font-family: 'Spline Sans Mono', ui-monospace, monospace;
  font-size: 12.5px; color: rgba(244,236,220,.55); line-height: 1.5;
}
.qia__noms {
  transition: opacity .45s ease, max-height .55s var(--ease), margin .45s ease;
  max-height: 600px;
}
.qia__noms.is-out { opacity: 0; max-height: 0; margin: 0; overflow: hidden; }
.qia__noms li.is-won {
  border-color: var(--qia-gold);
  background: rgba(255,210,63,.1);
  box-shadow: 0 0 0 1px var(--qia-gold), 0 18px 40px -22px rgba(255,210,63,.5);
}

/* the envelope */
.qia__env { display: grid; place-items: center; gap: 12px; }
.qia__env-card {
  width: 210px; height: 128px; position: relative;
  background: linear-gradient(#fbf3e2, #e8dcc2);
  border-radius: 6px; box-shadow: 0 22px 44px -18px rgba(0,0,0,.8);
  animation: qia-shake 1.5s ease-in-out infinite;
}
.qia__env-card::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(#d9cbaa, #cabb98);
  clip-path: polygon(0 0, 100% 0, 50% 62%);
  transform-origin: top; transition: transform .7s cubic-bezier(.4,1.4,.5,1);
}
.qia__env-card::after {
  content: ''; position: absolute; left: 50%; top: 58%; width: 30px; height: 30px;
  margin: -15px 0 0 -15px; border-radius: 50%;
  background: radial-gradient(circle at 36% 32%, #e2604f, #8a1d15);
  box-shadow: 0 2px 6px rgba(0,0,0,.4);
}
.qia__env.is-open .qia__env-card { animation: none; }
.qia__env.is-open .qia__env-card::before { transform: rotateX(178deg); }
.qia__env.is-open .qia__env-card::after { opacity: 0; transition: opacity .2s; }
@keyframes qia-shake {
  0%, 100% { transform: rotate(-1.4deg) translateY(0); }
  50%      { transform: rotate(1.4deg) translateY(-4px); }
}

/* the winner */
.qia__winner { display: grid; gap: 12px; justify-items: center; }
.qia__trophy { width: 84px; height: 84px; filter: drop-shadow(0 10px 22px rgba(255,210,63,.35)); }
.qia__win-n {
  font-size: clamp(30px, 6vw, 56px); line-height: 1.05; font-weight: 600;
  color: var(--qia-gold); letter-spacing: -.02em;
  animation: qia-stamp .5s cubic-bezier(.2,1.6,.4,1) both;
}
@keyframes qia-stamp {
  from { transform: scale(1.5); opacity: 0; filter: blur(8px); }
  to   { transform: none; opacity: 1; filter: none; }
}
.qia__cite { max-width: 56ch; margin: 0 auto; color: rgba(244,236,220,.85); font-size: 17px; }
.qia__speech {
  font-family: 'Spline Sans Mono', ui-monospace, monospace;
  font-size: 13px; color: rgba(244,236,220,.55); max-width: 52ch; margin: 0 auto;
}

/* the host */
.qia__host { display: flex; align-items: flex-end; justify-content: center; gap: 14px; }
.qia__host svg { width: 92px; height: 74px; animation: qia-bob 2.6s ease-in-out infinite; }
@keyframes qia-bob { 0%,100% { transform: translateY(0) rotate(-1deg); } 50% { transform: translateY(-5px) rotate(1deg); } }
.qia__podium {
  width: 118px; height: 78px; border-radius: 8px 8px 3px 3px;
  background: linear-gradient(#1c2f3a, #10202a);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.07), 0 16px 30px -20px #000;
  display: grid; place-items: center;
}
.qia__podium span {
  font-family: 'Spline Sans Mono', ui-monospace, monospace;
  font-size: 9px; letter-spacing: .2em; color: var(--qia-gold); opacity: .8;
}
.qia__say {
  min-height: 3.2em; font-size: clamp(17px, 2.4vw, 22px); line-height: 1.5;
  max-width: 54ch; margin: 0 auto; color: var(--qia-warm);
}
.qia__say i { font-style: normal; opacity: .35; }

/* the projector panel — dark reel only */
.qia__proj {
  position: relative; width: min(420px, 84vw); max-height: 30vh; aspect-ratio: 16/10;
  margin: 0 auto; border-radius: 10px; overflow: hidden;
  box-shadow: 0 30px 60px -28px #000, 0 0 0 1px rgba(255,59,92,.3);
}
.qia__proj::before {
  content: ''; position: absolute; inset: -14px;
  background:
    repeating-conic-gradient(#3a2a30 0 25%, #171114 0 50%) 0 0 / 26px 26px,
    radial-gradient(60% 60% at 40% 40%, #5a3038, #170f12);
  filter: blur(9px) saturate(.7);
}
.qia__proj::after {
  content: 'CENSORED'; position: absolute; inset: 42% 0 auto;
  font-family: 'Spline Sans Mono', ui-monospace, monospace;
  font-size: 17px; letter-spacing: .44em; text-indent: .44em; text-align: center;
  color: #0c0406; background: var(--qia-gold); padding: 8px 0;
}
.qia__projwrap { position: relative; margin-bottom: 26px; }
.qia__projtag {
  position: absolute; inset: auto 0 -26px; text-align: center;
  font-family: 'Spline Sans Mono', ui-monospace, monospace;
  font-size: 11px; letter-spacing: .2em; color: rgba(255,217,222,.6);
}

/* the tape button */
.qia__tape {
  border: 0; border-radius: 9px; cursor: pointer;
  background: var(--qia-gold); color: #16060a;
  font-family: 'Spline Sans Mono', ui-monospace, monospace;
  font-size: 12px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase;
  padding: 14px 22px;
  box-shadow: 0 0 0 0 rgba(255,59,92,.6);
  animation: qia-pulse 1.8s ease-out infinite;
}
@keyframes qia-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(255,59,92,.55); }
  100% { box-shadow: 0 0 0 22px rgba(255,59,92,0); }
}
.qia__tape:hover { filter: brightness(1.08); }

/* redaction */
.qia__red { background: currentColor; border-radius: 2px; }

/* glitch, for when the wrong reel loads */
.qia.is-glitch .qia__stage { animation: qia-glitch .42s steps(2, end) 3; }
@keyframes qia-glitch {
  0%   { transform: translate(0,0);   filter: none; }
  25%  { transform: translate(-9px,3px); filter: hue-rotate(-60deg) saturate(2); }
  50%  { transform: translate(7px,-4px); filter: invert(1); }
  75%  { transform: translate(-4px,-2px); filter: hue-rotate(80deg); }
  100% { transform: translate(0,0); filter: none; }
}
.qia__bars {
  position: absolute; inset: 0; z-index: 8; pointer-events: none; opacity: 0;
  background: repeating-linear-gradient(0deg,
    rgba(255,255,255,.06) 0 2px, transparent 2px 5px);
}
.qia.is-glitch .qia__bars { opacity: 1; }

/* ------------------------------------------------------------- the console */
.qia__console {
  position: relative; z-index: 7;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 12px clamp(14px, 3vw, 28px);
  background: rgba(4,8,10,.9);
  border-top: 1px solid rgba(255,210,63,.16);
}
.qia--dark .qia__console { border-top-color: rgba(255,59,92,.24); }
.qia__rail { display: flex; gap: 5px; flex: 1 1 auto; min-width: 100px; }
.qia__rail i {
  height: 3px; flex: 1 1 0; border-radius: 2px; background: rgba(244,236,220,.16);
  transition: background-color .3s ease;
}
.qia__rail i.is-done { background: rgba(255,210,63,.45); }
.qia__rail i.is-now  { background: var(--qia-gold); }
.qia__btn {
  border: 1px solid rgba(244,236,220,.22); background: transparent; color: var(--qia-warm);
  border-radius: 8px; padding: 9px 13px; cursor: pointer;
  font-family: 'Spline Sans Mono', ui-monospace, monospace;
  font-size: 11px; letter-spacing: .16em; text-transform: uppercase;
}
.qia__btn:hover { border-color: var(--qia-gold); color: var(--qia-gold); }
.qia__btn--x { border-color: rgba(244,236,220,.4); }

/* ------------------------------------------------------------------ confetti */
.qia__fall { position: absolute; inset: 0; z-index: 7; pointer-events: none; overflow: hidden; }
.qia__fall span { position: absolute; top: -40px; font-size: 22px; line-height: 1; }

@media (max-width: 620px) {
  .qia__scene { min-height: 62vh; }
  .qia__host svg { width: 66px; height: 54px; }
  .qia__podium { width: 92px; height: 62px; }
}

@media (prefers-reduced-motion: reduce) {
  .qia__beam, .qia__grain, .qia__fall { display: none; }
  .qia__curtain { transition: none; }
  .qia__env-card, .qia__host svg, .qia__tape { animation: none; }
  .qia__noms li { animation-duration: .01s; }
}

.qia__trophy { color: var(--qia-gold); }
.qia-bill__bulbs li { display: contents; }
