/* First-paint preloader: a long video being forged into shorts. Pure CSS (no
   JS needed) so it shows instantly; main.jsx fades it out once React mounts.
   Kept out of index.html because Vite's inline-CSS handling is flaky on Windows. */
#rf-preloader {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 30px;
  background: radial-gradient(60% 50% at 50% 35%, #1d1250 0%, #0b0720 70%);
  transition: opacity .5s ease, visibility .5s;
}
#rf-preloader.rf-done { opacity: 0; visibility: hidden; pointer-events: none; }

.rf-stage { position: relative; width: 240px; height: 190px; }

/* the long (16:9) source video */
.rf-wide {
  position: absolute; left: 0; top: 0; width: 240px; height: 82px; border-radius: 14px; overflow: hidden;
  background: linear-gradient(135deg, #2b1a6e, #160c3a);
  box-shadow: 0 0 0 1px rgba(255,255,255,.12), 0 20px 50px -20px rgba(108,71,255,.7);
}
.rf-wave {
  position: absolute; inset: auto 12px 12px 12px; height: 26px; opacity: .55;
  background: repeating-linear-gradient(90deg, rgba(201,194,255,.9) 0 3px, transparent 3px 7px);
  -webkit-mask: radial-gradient(60% 100% at 50% 100%, #000 40%, transparent 100%), linear-gradient(#000, #000);
  mask-image: linear-gradient(180deg, transparent 0%, #000 35%);
  clip-path: polygon(0 60%, 6% 30%, 12% 70%, 18% 20%, 25% 55%, 32% 10%, 40% 65%, 47% 25%, 55% 50%, 62% 5%, 70% 60%, 77% 30%, 85% 70%, 92% 35%, 100% 55%, 100% 100%, 0 100%);
}
.rf-head {
  position: absolute; top: 0; bottom: 0; width: 2px; left: 0; background: #ffa41b;
  box-shadow: 0 0 12px 2px rgba(255,164,27,.8);
  animation: rf-sweep 2.4s cubic-bezier(.65,0,.35,1) infinite;
}

/* the vertical shorts it produces */
.rf-cards { position: absolute; left: 0; right: 0; bottom: 0; display: flex; justify-content: center; gap: 14px; }
.rf-card {
  position: relative; width: 52px; height: 92px; border-radius: 10px; overflow: hidden;
  background: linear-gradient(180deg, #3a1c78, #1a0d3d);
  box-shadow: 0 0 0 1px rgba(255,255,255,.14), 0 14px 30px -12px rgba(255,45,122,.6);
  opacity: 0; transform: translateY(-34px) scale(.6);
  animation: rf-pop 2.4s cubic-bezier(.2,1.2,.4,1) infinite;
}
.rf-card:nth-child(2) { animation-delay: .35s; background: linear-gradient(180deg, #5a1a5e, #22092b); }
.rf-card:nth-child(3) { animation-delay: .7s; background: linear-gradient(180deg, #1e2a78, #0c1240); }
.rf-card::before { /* the speaker */
  content: ""; position: absolute; left: 50%; top: 22px; width: 18px; height: 18px; margin-left: -9px;
  border-radius: 50%; background: rgba(201,194,255,.75);
  box-shadow: 0 26px 0 6px rgba(201,194,255,.35);
}
.rf-card::after { /* caption lines */
  content: ""; position: absolute; left: 8px; right: 8px; bottom: 16px; height: 5px; border-radius: 3px;
  background: #fff; box-shadow: 6px 9px 0 -1px #ffa41b;
}
.rf-logo { width: 150px; height: auto; opacity: .95; }

@keyframes rf-sweep {
  0% { left: 4%; } 55% { left: 96%; } 100% { left: 96%; opacity: 0; }
}
@keyframes rf-pop {
  0%, 18% { opacity: 0; transform: translateY(-34px) scale(.6); }
  34% { opacity: 1; transform: translateY(0) scale(1.06); }
  42%, 82% { opacity: 1; transform: translateY(0) scale(1); }
  100% { opacity: 0; transform: translateY(6px) scale(.96); }
}
@media (prefers-reduced-motion: reduce) {
  .rf-head { animation: none; left: 60%; }
  .rf-card { animation: none; opacity: 1; transform: none; }
}
