/* ==========================================================================
   Pick & Race — homepage intro splash (plays once per browser session)
   Turned on by a tiny inline script in <head> that adds html.pr-intro-on.
   Everything below is CSS-driven, so it self-dismisses even if JS fails.
   ========================================================================== */

.pr-intro { display: none; }

html.pr-intro-on .pr-intro {
  display: block;
  position: fixed; inset: 0; z-index: 9999;
  overflow: hidden; cursor: pointer;
  animation: prIntroGone 0s linear 6s forwards; /* safety net */
}
@keyframes prIntroGone { to { visibility: hidden; pointer-events: none; } }

/* two curtain halves with a checkered edge */
.pr-panel {
  position: absolute; left: 0; right: 0; height: 50.6%; z-index: 1;
  background: var(--paper) radial-gradient(rgba(30,42,69,.09) 1.5px, transparent 2px) 0 0 / 22px 22px;
}
.pr-panel::after {
  content: ""; position: absolute; left: 0; right: 0; height: 24px;
  background: repeating-conic-gradient(var(--ink) 0 25%, var(--paper) 0 50%) 0 0 / 24px 24px;
  clip-path: inset(0 100% 0 0);
  animation: prEdge .55s cubic-bezier(.6,0,.2,1) 3.2s forwards; /* finish line sweeps in */
}
.pr-panel.bot::after { clip-path: inset(0 0 0 100%); animation-name: prEdgeR; }
@keyframes prEdge  { to { clip-path: inset(0 0 0 0); } }
@keyframes prEdgeR { to { clip-path: inset(0 0 0 0); } }
.pr-panel.top { top: 0;    animation: prPanelUp   1s cubic-bezier(.7,0,.2,1) 4.05s forwards; }
.pr-panel.top::after { bottom: 0; }
.pr-panel.bot { bottom: 0; animation: prPanelDown 1s cubic-bezier(.7,0,.2,1) 4.05s forwards; }
.pr-panel.bot::after { top: 0; }
@keyframes prPanelUp   { to { transform: translateY(-102%); } }
@keyframes prPanelDown { to { transform: translateY(102%); } }

/* racers dash across, one per lane */
.pr-racer {
  position: absolute; left: 0; top: var(--y); z-index: 2;
  width: 84px; height: 62px; margin-top: -31px;
  transform: translateX(-160px);
  animation: prRun var(--d) cubic-bezier(.5,.05,.5,.95) var(--delay, 0s) forwards;
}
.pr-racer::before { /* speed streak */
  content: ""; position: absolute; right: 100%; top: 50%; width: 150px; height: 3px; margin-right: -8px;
  background: linear-gradient(90deg, transparent, rgba(30,42,69,.35)); border-radius: 2px;
}
.pr-racer .body { width: 100%; height: 100%; display: block; transform-origin: 50% 70%; animation: prBob .28s ease-in-out infinite; }
.pr-racer[data-kind="turtle"] .body { animation-duration: .5s; }
.pr-racer .body svg { width: 100%; height: 100%; overflow: visible; display: block; }
.pr-racer[data-kind="ball"] .body { animation: none; }
.pr-racer .flame { transform-origin: 100% 50%; transform-box: fill-box; animation: flicker 0.12s linear infinite alternate; }
.pr-racer .ball-spin { transform-origin: 20px 22px; animation: spin .4s linear infinite; }
@keyframes prRun { to { transform: translateX(calc(100vw + 180px)); } }
@keyframes prBob { 0%,100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-4px) rotate(-3deg); } }

/* title lockup */
.pr-title {
  position: absolute; left: 50%; top: 50%; z-index: 3; text-align: center; white-space: nowrap;
  transform: translate(-50%, -50%) scale(.6); opacity: 0;
  animation: prTitle 1.5s cubic-bezier(.2,1.4,.4,1) 1.7s forwards;
}
.pr-title .logo {
  display: flex; align-items: center; justify-content: center; gap: .3em;
  font: 800 clamp(2.4rem, 9vw, 4.6rem)/1 var(--font-display); color: var(--ink);
}
.pr-title .dot {
  width: .62em; height: .62em; border-radius: 50%;
  background: var(--chalk); border: 3px solid var(--ink); display: inline-block;
}
.pr-title .tag {
  display: table; margin: 14px auto 0; padding: 6px 18px;
  font: 700 clamp(.95rem, 3vw, 1.25rem)/1.2 var(--font-display);
  background: var(--pencil); color: var(--ink);
  border: 2px solid var(--ink); border-radius: 999px; box-shadow: 3px 3px 0 var(--ink);
  transform: rotate(-2deg);
}
@keyframes prTitle {
  0%   { opacity: 0; transform: translate(-50%, -50%) scale(.6) rotate(-4deg); }
  30%  { opacity: 1; transform: translate(-50%, -50%) scale(1.07) rotate(1deg); }
  42%  { transform: translate(-50%, -50%) scale(1) rotate(0); }
  84%  { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1.12); }
}

/* confetti burst as the finish line lands */
.pr-confetti { position: absolute; left: 50%; top: 50%; z-index: 4; pointer-events: none; }
.pr-confetti i {
  position: absolute; width: 10px; height: 14px; border-radius: 2px; background: var(--c); opacity: 0;
  animation: prConf 1.3s cubic-bezier(.12,.7,.3,1) 3.3s both;
}
@keyframes prConf {
  0%   { opacity: 1; transform: translate(0,0) scale(.4) rotate(0); }
  55%  { opacity: 1; transform: translate(var(--x), var(--y)) scale(1) rotate(var(--r)); }
  100% { opacity: 0; transform: translate(var(--x), calc(var(--y) + 16vh)) scale(1) rotate(calc(var(--r) * 1.6)); }
}

.pr-hint {
  position: absolute; left: 0; right: 0; bottom: 14px; z-index: 3; text-align: center;
  font: 600 .75rem/1 var(--font-body); letter-spacing: .06em; text-transform: uppercase;
  color: var(--ink-soft); opacity: 0; animation: prHint .4s ease .8s forwards, prHintOut .2s ease 3.1s forwards;
}
@keyframes prHint    { to { opacity: .7; } }
@keyframes prHintOut { to { opacity: 0; } }

/* homepage hero settles in as the curtains open (transform only, so text is never hidden from crawlers/LCP) */
html.pr-intro-on .hero > div:first-child > *,
html.pr-intro-on .hero .pond { animation: prRise .9s cubic-bezier(.2,.8,.2,1) both; }
html.pr-intro-on .hero > div:first-child > :nth-child(1) { animation-delay: 4.05s; }
html.pr-intro-on .hero > div:first-child > :nth-child(2) { animation-delay: 4.15s; }
html.pr-intro-on .hero > div:first-child > :nth-child(3) { animation-delay: 4.25s; }
html.pr-intro-on .hero > div:first-child > :nth-child(4) { animation-delay: 4.35s; }
html.pr-intro-on .hero .pond { animation-delay: 4.3s; }
/* skipped early: same motion, no wait */
html.pr-intro-quick .hero > div:first-child > *,
html.pr-intro-quick .hero .pond { animation: prRise .45s cubic-bezier(.2,.8,.2,1) both; }
@keyframes prRise { from { transform: translateY(26px); } to { transform: none; } }

@media (max-width: 600px) {
  .pr-racer { width: 62px; height: 46px; margin-top: -23px; }
}
@media (prefers-reduced-motion: reduce) {
  html.pr-intro-on .pr-intro { display: none; }
  html.pr-intro-on .hero > div:first-child > *, html.pr-intro-on .hero .pond { animation: none; }
}
