/* Handoff ------------------------------------------------------------- */
/* The page between the checkout and the payment gateway: one card on the
   hero's gradient, a ring draining over the shop's seconds (the section
   sets --handoff-seconds), the number inside it, and one button. The
   stylesheet owns the ring's motion; the script only ticks the number. */
.handoff {
  display: grid;
  place-items: center;
  padding: clamp(2.5rem, 7vw, 5rem) var(--space-4);
  min-height: calc(100dvh - 4.5rem);
  background: var(--gradient-hero);
}

.handoff__card {
  width: 100%;
  max-width: 44rem;
  display: grid;
  gap: var(--space-6, 2rem);
  justify-items: center;
  text-align: center;
  padding: clamp(2rem, 6vw, 3.5rem) clamp(1.5rem, 6vw, 3.5rem);
  border-radius: calc(var(--radius-lg) + 8px);
  background: var(--surface-raised);
  border: 1px solid color-mix(in srgb, var(--primary) 22%, var(--line));
  box-shadow: var(--shadow-2);
}

.handoff__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.9rem;
  border-radius: var(--radius-pill);
  background: var(--primary-soft);
  color: var(--primary);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.handoff__eyebrow .icon {
  width: 1rem;
  height: 1rem;
}

.handoff__ring {
  position: relative;
  width: 14rem;
  height: 14rem;
  max-width: 100%;
}

.handoff__ring svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
  overflow: visible;
  filter: drop-shadow(0 0 10px color-mix(in srgb, var(--primary) 28%, transparent));
}

.handoff__track {
  fill: none;
  stroke: color-mix(in srgb, var(--primary) 18%, transparent);
  stroke-width: 9;
}

/* The dasharray is on the circle itself (439.8, the circumference of
   r = 70): the markup and this file agree on one number. */
.handoff__arc {
  fill: none;
  stroke: url(#handoff-grad);
  stroke-width: 9;
  stroke-linecap: round;
  stroke-dashoffset: 0;
  animation: handoff-drain var(--handoff-seconds, 5s) linear forwards;
}

.handoff__num {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: var(--font-heading);
  font-size: clamp(3.5rem, 12vw, 4.5rem);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.handoff__title {
  margin: 0;
  font-size: var(--display-xs);
  text-wrap: balance;
}

.handoff__lead {
  margin: 0;
  max-width: 34rem;
  font-size: var(--text-xl);
  color: var(--ink-soft);
  text-wrap: pretty;
}

.handoff__lead b {
  color: var(--ink);
  font-weight: 700;
}

.handoff__note {
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
  text-align: left;
  width: 100%;
  padding: var(--space-4);
  border-radius: var(--radius-md);
  background: var(--secondary-soft);
  border-left: 4px solid var(--secondary);
  color: var(--ink-soft);
  font-size: var(--text-base);
}

.handoff__note .icon {
  flex: 0 0 auto;
  width: 1.4rem;
  height: 1.4rem;
  margin-top: 0.1rem;
  color: var(--secondary);
}

.handoff__note p {
  margin: 0;
  min-width: 0;
}

.handoff__actions {
  display: grid;
  justify-items: center;
  gap: var(--space-3);
  width: 100%;
}

.handoff__actions .btn {
  min-width: 18rem;
}

.handoff__meta {
  font-size: var(--text-sm);
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
}

/* At zero the script has already replaced the location; the ring stays
   empty for the frame the browser still shows this page. */
.handoff.is-done .handoff__arc {
  animation: none;
  stroke-dashoffset: 439.8;
}

@keyframes handoff-drain {
  to {
    stroke-dashoffset: 439.8;
  }
}

@media (prefers-reduced-motion: reduce) {
  .handoff__arc {
    animation: none;
    stroke-dashoffset: 0;
  }
}

@media (max-width: 480px) {
  .handoff__actions .btn {
    width: 100%;
    min-width: 0;
  }

  .handoff__ring {
    width: 12rem;
    height: 12rem;
  }
}
