/* CreateGame.ai — the closing waitlist: black space, the mascot, a short form. The mascot copy reuses
   the hero's .m-* animations from home.css; join.js only adds small, eased reactions on top. */

.close.join { position: relative; isolation: isolate; padding-bottom: 40px; }

/* the mascot, with a soft green glow behind it (static, like the hero's) */
.join-mascot { position: relative; display: flex; justify-content: center; margin: 0 auto 30px; }
.join-mascot::before { content: ""; position: absolute; left: 50%; top: 50%; z-index: -1; width: 520px; max-width: 100vw; height: 420px; transform: translate(-50%, -50%); background: radial-gradient(closest-side, color-mix(in oklab, var(--world) 14%, transparent) 0%, transparent 72%); pointer-events: none; }
.join-octo { display: block; width: clamp(128px, 14vw, 172px); height: auto; overflow: visible; animation: m-bob 5.2s ease-in-out infinite alternate; }
.join-body { transform-origin: 200px 150px; }
/* while the eyes are steered by join.js, their own idle wander steps aside */
.join-gazing .join-octo .m-eyes { animation: none; }
/* off-screen, the mascot rests */
.join-off .join-octo, .join-off .join-octo * { animation-play-state: paused; }

/* the form: one centred column */
.close .waitlist.join-form { display: flex; flex-direction: column; gap: 26px; max-width: 520px; margin: 44px auto 0; text-align: left; }
.join-field { display: flex; flex-direction: column; gap: 10px; min-width: 0; margin: 0; padding: 0; border: 0; }
.join-label { display: block; padding: 0; color: var(--ink); font: 500 14.5px/1.3 var(--font); letter-spacing: -.01em; }
/* a floated legend is laid out as an ordinary flex item, so the column gap applies to it */
legend.join-label { float: left; width: 100%; }
.close .join-form input[type="email"] { width: 100%; height: 50px; background: rgba(253, 251, 248, .07); }

/* pills: real radios, visually hidden, with the label drawn as the pill */
.join-pills { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.join-pill { position: relative; display: flex; min-width: 0; cursor: pointer; }
.join-pill input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.join-pill span { display: flex; flex: 1; align-items: center; justify-content: center; min-height: 44px; padding: 0 14px; border: 1px solid var(--line); border-radius: 999px; background: rgba(253, 251, 248, .07); color: var(--ink); font: 500 14.5px/1.2 var(--font); letter-spacing: -.01em; text-align: center; white-space: nowrap; transition: background .22s var(--ease-out), border-color .22s var(--ease-out), color .22s var(--ease-out), transform .22s var(--ease-out); }
.join-pill:hover span { border-color: var(--ink); background: rgba(253, 251, 248, .12); }
.join-pill:active span { transform: scale(.97); }
.join-pill input:checked + span { border-color: var(--ink); background: var(--ink); color: var(--on-ink); }
.join-pill input:focus-visible + span { box-shadow: 0 0 0 2px var(--paper), 0 0 0 4px var(--accent); }

/* the note: grows a little as you type, then scrolls */
.join-note { display: block; width: 100%; min-height: 104px; max-height: 208px; padding: 13px 16px; border: 1px solid var(--line); border-radius: var(--r-ctl); background: rgba(253, 251, 248, .07); color: var(--ink); font: 400 16px/1.5 var(--font); resize: none; outline: none; field-sizing: content; transition: border-color .2s, box-shadow .2s; }
.join-note::placeholder { color: var(--muted); }
.join-note:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }

/* one white button, full width, and the status line under it */
.close .join-form button[type="submit"] { width: 100%; height: 52px; margin-top: 6px; font-size: 15.5px; }
.close .join-form button[type="submit"]:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--paper), 0 0 0 4px var(--accent); }
.close .join-form .form-note { margin: -14px 0 0; text-align: center; }

/* the rows settle in one after another once the section is revealed */
.js .close.join .join-form > :not(.hp) { opacity: 0; transform: translateY(10px); transition: opacity .7s var(--ease-out), transform .8s var(--ease-out); }
.js .close.join.in .join-form > :not(.hp) { opacity: 1; transform: none; }
.js .close.join.in .join-form > :nth-child(2) { transition-delay: .18s; }
.js .close.join.in .join-form > :nth-child(3) { transition-delay: .26s; }
.js .close.join.in .join-form > :nth-child(4) { transition-delay: .34s; }
.js .close.join.in .join-form > :nth-child(5) { transition-delay: .42s; }
.js .close.join.in .join-form > :nth-child(6) { transition-delay: .5s; }
.js .close.join.in .join-form > :nth-child(7) { transition-delay: .56s; }
.js .close.join.in .join-form > :nth-child(8) { transition-delay: .62s; }

@media (max-width: 560px) {
  .close .waitlist.join-form { gap: 24px; margin-top: 36px; }
  /* the long option takes its own row, the other two share the next */
  .join-pills:has([value="mcp"]) { grid-template-columns: 1fr 1fr; }
  .join-pills:has([value="mcp"]) > :first-child { grid-column: 1 / -1; }
}
/* a quiet line under a question */
.join-hint { margin: 9px 2px 0; color: var(--body); font-size: 13.5px; line-height: 1.5; }

/* opened from a "Join the waitlist" button: the same section takes the whole screen, black, with
   only the mascot and the form, and everything arrives in turn */
.join-x { display: none; }
html.join-lock { overflow: hidden; }
.close.join.join-open { position: fixed; inset: 0; z-index: 60; max-width: none; margin: 0; padding: clamp(36px, 8vh, 88px) var(--gutter) 56px; overflow-y: auto; overscroll-behavior: contain; background: var(--paper); animation: join-in .45s ease both; }
.close.join.join-closing { animation: join-out .26s ease both; }
.join-open .join-x { position: fixed; right: 20px; top: 18px; z-index: 1; display: block; width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 50%; background: rgba(253, 251, 248, .07); cursor: pointer; transition: border-color .2s, background .2s; animation: land .6s .3s var(--ease-out) both; }
.join-open .join-x:hover { border-color: var(--ink); background: rgba(253, 251, 248, .14); }
.join-x::before, .join-x::after { content: ""; position: absolute; left: 50%; top: 50%; width: 16px; height: 1.5px; margin: -.75px 0 0 -8px; border-radius: 1px; background: var(--ink); transform: rotate(45deg); }
.join-x::after { transform: rotate(-45deg); }
.join-open .join-octo { animation: emerge-in .7s var(--ease-out) both, emerge-form 1.3s cubic-bezier(.45, .5, .25, 1) both, m-bob 5.2s 1.3s ease-in-out infinite alternate; }
.join-open .join-mascot::before { animation: emerge-in 1.4s ease both; }
.join-open > h2 { animation: land .8s .28s var(--ease-out) both; }
.join-open .join-form > :not(.hp) { animation: land .8s var(--ease-out) both; }
.join-open .join-form > :nth-child(1) { animation-delay: .38s; }
.join-open .join-form > :nth-child(3) { animation-delay: .46s; }
.join-open .join-form > :nth-child(4) { animation-delay: .54s; }
.join-open .join-form > :nth-child(5) { animation-delay: .62s; }
.join-open .join-form > :nth-child(6) { animation-delay: .7s; }
.join-open .join-form > :nth-child(7) { animation-delay: .76s; }
@keyframes join-in { from { opacity: 0; } }
@keyframes join-out { to { opacity: 0; transform: scale(.985); } }
@media (max-width: 560px) {
  .close.join.join-open { padding-top: 64px; }
  .join-open .join-x { right: 12px; top: 12px; }
}
