/* ==========================================================
   preloader.css
   Opening screen "The peacock arrives": the 3D peacock glides across the screen on a
   wave, shedding feather-eyes that drift down behind it while a gold counter runs to
   100. It lands in the middle with a flash, the full logo appears where it stood,
   then the screen opens like a curtain. Driven by scripts/core/preloader.js.
   Hidden unless <html> has the class pk-pre-on.
   ========================================================== */
.pk-pre { display: none; }
.pk-pre-on .pk-pre { position: fixed; inset: 0; z-index: 2147483647; display: block; overflow: hidden; }
.pk-pre-on:not(.pk-pre-done) body { overflow: hidden; }

/* the two curtain halves (one soft radial glow shared across both) */
.pk-pre__half {
  position: absolute; top: 0; bottom: 0; width: 50.2%;
  background: radial-gradient(ellipse at 50% 45%, #0d3076 0%, #06183f 52%, #030c24 100%); background-size: 200% 100%;
  transition: transform 1.05s cubic-bezier(.76, 0, .24, 1);
}
.pk-pre__half.l { left: 0; background-position: 0 0; }
.pk-pre__half.r { right: 0; background-position: 100% 0; }
.pk-pre-done .pk-pre__half.l { transform: translateX(-101%); }
.pk-pre-done .pk-pre__half.r { transform: translateX(101%); }

.pk-pre__stage { position: absolute; inset: 0; transition: opacity .35s ease; }
.pk-pre-done .pk-pre__stage { opacity: 0; }

/* a faint gold horizon the peacock walks along */
.pk-pre__line { position: absolute; left: 6vw; right: 6vw; top: 62%; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 212, 92, .45), transparent); transform-origin: left; transform: scaleX(0); animation: pk-line 1.2s ease-out .2s forwards; }
@keyframes pk-line { to { transform: scaleX(1); } }

.pk-pre__bird { position: absolute; left: 0; top: 0; display: block; width: min(24vw, 190px); aspect-ratio: 1117 / 1079; will-change: transform, opacity;
  filter: drop-shadow(0 12px 22px rgba(0, 0, 0, .45)) drop-shadow(0 0 16px rgba(255, 196, 61, .3)); }

/* feather-eyes shed by the peacock */
.pk-pre__eye { position: absolute; left: 0; top: 0; width: 16px; height: 22px; margin: -11px 0 0 -8px; border-radius: 50% 50% 50% 50% / 62% 62% 38% 38%;
  background: radial-gradient(circle at 50% 58%, #1747d6 0 18%, #19c3b1 19% 36%, #f1c040 37% 56%, #12935a 57% 100%);
  box-shadow: 0 0 10px rgba(255, 212, 92, .5); animation: pk-drop 1.5s ease-out forwards; pointer-events: none; }
@keyframes pk-drop { 0% { opacity: .95; transform: translate(0, 0) rotate(var(--r, 0deg)) scale(1); }
  100% { opacity: 0; transform: translate(var(--dx, -40px), var(--dy, 80px)) rotate(calc(var(--r, 0deg) + 160deg)) scale(.15); } }

.pk-pre__ring { position: absolute; left: 50%; top: 50%; width: 40px; height: 40px; margin: -20px 0 0 -20px; border-radius: 50%;
  border: 2px solid rgba(255, 212, 92, .9); opacity: 0; }
.pk-land .pk-pre__ring { animation: pk-ring 1.1s ease-out forwards; }
@keyframes pk-ring { 0% { opacity: 1; transform: scale(.4); } 100% { opacity: 0; transform: scale(26); border-width: 1px; } }

.pk-pre__logo { position: absolute; left: 50%; top: 50%; width: min(600px, 80vw); height: auto; translate: -50% -50%;
  opacity: 0; transform: scale(.86); filter: blur(14px); transition: opacity .9s ease, transform 1.1s cubic-bezier(.2, .8, .2, 1), filter .9s ease; }
.pk-land .pk-pre__logo { opacity: 1; transform: none; filter: blur(0); }
.pk-land .pk-pre__bird { transition: opacity .5s ease, scale .5s ease; opacity: 0; scale: 1.35; }

.pk-pre__tag { position: absolute; left: 6vw; bottom: calc(8vh + .6em); margin: 0; color: rgba(255, 255, 255, .55); font: 500 12px / 1 "Inter Tight", Inter, sans-serif; letter-spacing: .32em; text-transform: uppercase; transition: opacity .4s ease; }
.pk-land .pk-pre__tag, .pk-land .pk-pre__line { opacity: 0; }

@media (max-width: 600px) { .pk-pre__bird { width: 34vw; } .pk-pre__tag { display: none; } }
@media (prefers-reduced-motion: reduce) { .pk-pre__eye, .pk-pre__line { display: none; } }

/* the peacock itself moves: the train of feathers sways from the hip, the chest and neck rock, the whole bird steps */
.pk-pre__bird img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.pk-pre__tail { clip-path: polygon(0 0, 56% 0, 52% 100%, 0 100%); transform-origin: 54% 62%; animation: pk-tail .9s ease-in-out infinite; }
.pk-pre__body { clip-path: polygon(54% 0, 100% 0, 100% 100%, 50% 100%); transform-origin: 70% 90%; animation: pk-body .9s ease-in-out infinite; }
.pk-land .pk-pre__tail { animation: pk-fan 1.2s cubic-bezier(.3, 1.4, .5, 1) forwards; }
.pk-land .pk-pre__body { animation: none; }
@keyframes pk-tail { 0%, 100% { transform: rotate(-3.5deg); } 50% { transform: rotate(3deg); } }
@keyframes pk-body { 0%, 100% { transform: rotate(-1.2deg) translateY(0); } 50% { transform: rotate(1.4deg) translateY(-1.5%); } }
@keyframes pk-fan { 0% { transform: rotate(0); } 40% { transform: rotate(-9deg) scale(1.04); } 100% { transform: rotate(0); } }
@media (prefers-reduced-motion: reduce) { .pk-pre__tail, .pk-pre__body { animation: none; } }
.pk-pre-on:not(.pk-pre-done) .asi-badge { display: none; }
