/* ============================================
   The one celebration (ONE-FLOW-ONBOARDING-SPEC §5 B6, §7).

   Extracted from css/legacy-onboarding.css when L7 deleted that file with
   the legacy onboarding wizard. Only B6 fires a burst now, but the overlay
   it fires is this one — so its styles had to survive the wizard's.

   .sr-only rides along: index.html and partials/profile-materials-modal.html
   both use it, and legacy-onboarding.css was its only definition.
   ============================================ */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ============================================================
   Onboarding celebration overlay (resume/persona finish → discovery).
   A short, delightful "Profile set! Nice work." moment with the celebrating
   pea mascot + a confetti burst, then discovery setup auto-opens. Decoration
   only — the handoff degrades gracefully if this never renders.
   ============================================================ */
.onboarding-celebration {
  position: fixed;
  inset: 0;
  z-index: 100002; /* above the onboarding (100000) + first-run (100001) wizards */
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(14, 58, 78, 0.32);
  backdrop-filter: blur(2px);
}

.onboarding-celebration[hidden] {
  display: none !important;
}

.onboarding-celebration--in .onboarding-celebration__card {
  animation: celebrationPop 0.42s cubic-bezier(0.16, 1, 0.3, 1);
}

.onboarding-celebration--out {
  opacity: 0;
  transition: opacity 0.3s ease;
}

.onboarding-celebration__card {
  position: relative;
  display: grid;
  justify-items: center;
  gap: var(--space-2);
  width: min(420px, calc(100vw - 2 * var(--space-4)));
  padding: var(--space-7) var(--space-7) var(--space-6);
  border-radius: var(--radius-xl, 20px);
  background: var(--jb-paper, var(--surface));
  border: 1px solid var(--jb-line-soft, var(--border));
  border-top: 4px solid var(--jb-mint, var(--accent));
  box-shadow:
    0 24px 60px rgba(14, 58, 78, 0.28),
    0 6px 16px rgba(14, 58, 78, 0.12);
  text-align: center;
  overflow: hidden;
}

/* Staggered entrance — one orchestrated reveal: mascot pops with the card,
   then headline → subline → journey strip → CTA rise in sequence. */
.onboarding-celebration--in .onboarding-celebration__title {
  animation: celebrationRise 0.4s var(--ease, ease) 0.15s both;
}

.onboarding-celebration--in .onboarding-celebration__sub {
  animation: celebrationRise 0.4s var(--ease, ease) 0.25s both;
}

.onboarding-celebration--in .onboarding-celebration__journey {
  animation: celebrationRise 0.4s var(--ease, ease) 0.35s both;
}

.onboarding-celebration--in .onboarding-celebration__cta {
  animation: celebrationRise 0.4s var(--ease, ease) 0.45s both;
}

@keyframes celebrationRise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes celebrationPop {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.92);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.onboarding-celebration__mascot {
  width: 148px;
  height: auto;
  animation: celebrationBounce 0.9s ease 0.1s 2;
}

@keyframes celebrationBounce {
  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }
  35% {
    transform: translateY(-12px) rotate(-3deg);
  }
  70% {
    transform: translateY(-4px) rotate(2deg);
  }
}

.onboarding-celebration__title {
  margin: 0;
  font-family: var(--jb-font-display, "Caveat", cursive);
  font-size: 2rem;
  line-height: 1.1;
  color: var(--jb-navy, var(--text));
}

.onboarding-celebration__sub {
  margin: 0;
  font-size: var(--text-sm);
  line-height: 1.5;
  color: var(--jb-ink-2, var(--text-muted));
}

/* Journey strip — the "one wizard" map: Profile ✓ → Job discovery (current)
   → Other devices. Small caps, dots carry the state. */
.onboarding-celebration__journey {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-4);
  margin: var(--space-3) 0 var(--space-2);
  padding: 0;
}

.onboarding-celebration__journey-step {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--jb-ink-3, var(--text-faint));
  white-space: nowrap;
}

.onboarding-celebration__journey-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
  border: 1.5px solid var(--jb-line, var(--border));
  color: var(--jb-ink-3, var(--text-faint));
  background: var(--jb-paper, var(--surface));
  flex: 0 0 auto;
}

.onboarding-celebration__journey-step--done {
  color: var(--jb-mint-deep, #2f8a5a);
}

.onboarding-celebration__journey-step--done .onboarding-celebration__journey-dot {
  background: var(--jb-mint, var(--accent));
  border-color: var(--jb-mint, var(--accent));
  color: var(--jb-ink-inverse, #fff);
}

.onboarding-celebration__journey-step--current {
  color: var(--jb-navy, var(--text));
}

.onboarding-celebration__journey-step--current .onboarding-celebration__journey-dot {
  background: var(--jb-navy, var(--text));
  border-color: var(--jb-navy, var(--text));
  color: var(--jb-ink-inverse, #fff);
  box-shadow: 0 0 0 3px var(--jb-mint-soft, rgba(95, 203, 142, 0.25));
}

/* Primary CTA — the single way forward; big, mint, unmissable. */
.onboarding-celebration__cta {
  width: 100%;
  min-height: 50px;
  margin-top: var(--space-2);
  padding: var(--space-3) var(--space-6);
  font: inherit;
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--jb-ink-inverse, #fff);
  background: linear-gradient(
    135deg,
    var(--jb-mint, #5fcb8e),
    var(--jb-mint-deep, #2f8a5a)
  );
  border: none;
  border-radius: var(--radius-lg);
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(47, 138, 90, 0.32);
  transition:
    transform 0.12s var(--ease, ease),
    box-shadow 0.12s var(--ease, ease);
}

.onboarding-celebration__cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 26px rgba(47, 138, 90, 0.4);
}

.onboarding-celebration__cta:active {
  transform: translateY(0);
}

.onboarding-celebration__cta:focus-visible {
  outline: 3px solid var(--jb-mint-soft, rgba(95, 203, 142, 0.45));
  outline-offset: 2px;
}

/* Confetti */
.onboarding-celebration__confetti {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.onboarding-celebration__confetti-piece {
  position: absolute;
  top: -12px;
  width: 8px;
  height: 12px;
  border-radius: 2px;
  opacity: 0.9;
  animation: celebrationConfetti 1.6s ease-in forwards;
}

@keyframes celebrationConfetti {
  0% {
    transform: translate(0, -16px) rotate(0deg);
    opacity: 0;
  }
  12% {
    opacity: 1;
  }
  100% {
    transform: translate(var(--drift, 0), 320px) rotate(520deg);
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .onboarding-celebration--in .onboarding-celebration__card,
  .onboarding-celebration--in .onboarding-celebration__title,
  .onboarding-celebration--in .onboarding-celebration__sub,
  .onboarding-celebration--in .onboarding-celebration__journey,
  .onboarding-celebration--in .onboarding-celebration__cta,
  .onboarding-celebration--burst,
  .onboarding-celebration--burst .onboarding-celebration__card,
  .onboarding-celebration__mascot,
  .onboarding-celebration__confetti-piece {
    animation: none;
  }
  .onboarding-celebration__confetti-piece {
    display: none;
  }
  .onboarding-celebration__cta {
    transition: none;
  }
}

/* While fading out, the overlay must not eat clicks meant for the next
   wizard being revealed beneath it. */
.onboarding-celebration--out {
  pointer-events: none;
}

/* Quiet alternate path under the celebration CTA. Looks like an
   inline link but keeps a 44px tap target for phone thumbs. */
.onboarding-celebration__alt {
  all: unset;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 var(--space-2);
  box-sizing: border-box;
  cursor: pointer;
  margin-top: var(--space-2);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--jb-ink-2, var(--text-muted));
  text-decoration: underline;
  text-underline-offset: 3px;
  animation: celebrationRise 0.4s var(--ease, ease) 0.45s both;
}

.onboarding-celebration__alt:hover {
  color: var(--jb-navy, var(--text));
}

/* ============================================================
   The finale burst (SIXBEATS2 locked decision 2).

   The acceptance rerun found this overlay covering Beat 6 as a modal:
   full-viewport scrim, `pointer-events: auto`, z-index 100002, and
   `Run discovery now` unclickable underneath it for the whole sample
   (NEW-1, BLOCKER). The burst variant is the same DOM with the modal
   taken out of it — no scrim, no blur, no hit testing, and a card that
   sits at the top of the viewport instead of over the beat's actions.
   ============================================================ */
.onboarding-celebration--burst {
  pointer-events: none;
  background: none;
  backdrop-filter: none;
  align-items: flex-start;
  justify-content: center;
  padding-top: var(--space-6);
}

/* Opaque on purpose: the burst sits ON the beat, and a translucent card
   let B6's own headline ghost through it on a 390 px screen. */
.onboarding-celebration--burst .onboarding-celebration__card {
  width: min(340px, calc(100vw - 2 * var(--space-5)));
  padding: var(--space-3) var(--space-5) var(--space-4);
  gap: var(--space-1);
  box-shadow:
    0 16px 40px rgba(14, 58, 78, 0.22),
    0 4px 12px rgba(14, 58, 78, 0.1);
}

.onboarding-celebration--burst .onboarding-celebration__mascot {
  width: 72px;
}

.onboarding-celebration--burst .onboarding-celebration__title {
  font-size: 1.6rem;
}

.onboarding-celebration--burst .onboarding-celebration__sub {
  font-size: var(--text-xs);
}
