/* trybudd.com access-code gate. Builds on site.css (tokens, .btn, .eyebrow, .footer, .skip). Type, spacing and
   radii follow the same steps; motion uses --ease and only animates transform. */

.gate-page { min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; }
.gate {
  flex: 1; width: 100%; max-width: 480px; margin: 0 auto; padding: 96px 16px 48px;
  display: flex; flex-direction: column; align-items: center; text-align: center;
  /* The arm layer is a full-size transparent image; while it turns, its empty corners must not widen the page. */
  overflow-x: clip;
}
@supports not (overflow: clip) { .gate { overflow-x: hidden; } }
.gate .eyebrow { margin-bottom: 12px; }
.gate__title {
  font-size: 48px; line-height: 1; letter-spacing: -0.02em; font-weight: 600;
  background: linear-gradient(90deg, var(--head-from), var(--head-to));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.gate__sub { margin-top: 16px; max-width: 400px; font-size: 18px; line-height: 28px; color: var(--muted); }

.gate__form { margin-top: 32px; display: flex; gap: 8px; width: 100%; max-width: 360px; }
.gate__form input {
  flex: 1; min-width: 0; padding: 8px 12px; border-radius: 12px;
  font-family: "Geist Mono", ui-monospace, monospace; font-size: 20px; line-height: 28px; letter-spacing: 0.24em; text-align: center;
  color: var(--text); background: var(--surface); border: 1px solid var(--line-strong);
  transition: border-color 300ms var(--ease);
}
.gate__form input::placeholder { color: var(--muted); opacity: 0.6; }
.gate__form input:focus-visible { border-color: var(--accent); }
.gate__form input[aria-invalid="true"] { border-color: var(--danger); }
.gate__form .btn { padding: 8px 16px; }
.gate__form[aria-busy="true"] .btn { opacity: 0.5; }

.gate__msg { min-height: 20px; margin-top: 12px; font-size: 14px; line-height: 20px; color: var(--danger); }
.gate__msg.is-ok { color: var(--ok); }
.gate__help { margin-top: 24px; font-size: 14px; line-height: 20px; color: var(--muted); }

/* Budd waving: the body bobs and leans, the right arm swings up from the shoulder and waves. Both layers share
   one canvas (360 × 319), so the shoulder pivot is a fixed point on it. */
.wave { width: 176px; aspect-ratio: 360 / 319; margin-bottom: 24px; }
.wave__fig { position: relative; width: 100%; height: 100%; transform-origin: 50% 100%; animation: wave-fig 4.8s var(--ease) 0.3s infinite both; }
.wave__fig img { position: absolute; inset: 0; width: 100%; height: 100%; user-select: none; -webkit-user-drag: none; }
.wave__arm { transform-origin: 90.6% 52.5%; animation: wave-arm 4.8s var(--ease) 0.3s infinite both; }

@keyframes wave-fig {
  0%, 72%, 100% { transform: none; }
  12%, 58% { transform: translateY(-4px) rotate(-2deg); }
}
@keyframes wave-arm {
  0% { transform: rotate(0deg); }
  14% { transform: rotate(-128deg); }
  24% { transform: rotate(-100deg); }
  34% { transform: rotate(-132deg); }
  44% { transform: rotate(-100deg); }
  56% { transform: rotate(-126deg); }
  72%, 100% { transform: rotate(0deg); }
}

/* Wrong code: Budd shakes. Right code: Budd hops. */
.wave.is-no .wave__fig { animation: wave-no 560ms var(--ease) both; }
.wave.is-no .wave__arm { animation: none; }
.wave.is-yes .wave__fig { animation: wave-yes 640ms var(--ease) both; }
.wave.is-yes .wave__arm { animation: none; transform: rotate(-128deg); transition: transform 300ms var(--ease); }
@keyframes wave-no {
  0%, 100% { transform: none; }
  20% { transform: translateX(-8px) rotate(-3deg); }
  40% { transform: translateX(8px) rotate(3deg); }
  60% { transform: translateX(-4px) rotate(-2deg); }
  80% { transform: translateX(4px) rotate(1deg); }
}
@keyframes wave-yes {
  0%, 100% { transform: none; }
  40% { transform: translateY(-16px); }
  70% { transform: translateY(2px); }
}

@media (prefers-reduced-motion: reduce) {
  .wave__fig, .wave.is-no .wave__fig, .wave.is-yes .wave__fig { animation: none; }
  .wave__arm, .wave.is-no .wave__arm, .wave.is-yes .wave__arm { animation: none; transform: rotate(-120deg); transition: none; }
}

@media (max-width: 560px) {
  .gate { padding-top: 64px; }
  .gate__title { font-size: 36px; line-height: 40px; }
  .wave { width: 144px; }
}

/* On the home page the wave is smaller and sits above the headline. */
.hero .wave { width: 112px; margin-bottom: 24px; }
