/* The Gathering Wizard (gather.html), on top of the homepage's site.css.
   Every class is gw-* so nothing collides with the site's own. Max sits in
   .gw-host, which paints its own background: Max's screened video blends
   against it (see max.css). */
.gather { --gw-chrome: calc(var(--ribbon-h) + var(--bar-h)); --canvas: var(--sc-canvas); --surface: #17141f; --magenta: #e43ffb; --accent-deep: #7427c8; --ease: cubic-bezier(.22, 1, .36, 1); }
.gather body, body.gather { overflow-x: hidden; }
body.gather::before { /* soft room light behind Max */
  content: ""; position: fixed; inset: -20vh -10vw auto; height: 80vh; pointer-events: none; z-index: -1;
  background: radial-gradient(40rem 26rem at 50% 18%, rgb(143 60 250 / .16), transparent 70%),
              radial-gradient(30rem 20rem at 70% 8%, rgb(228 63 251 / .09), transparent 70%);
  transition: opacity 600ms ease;
}
body.gather:not(.stage-intro)::before { opacity: 0; }

.gw { padding-top: calc(var(--gw-chrome) + 8px); min-height: 100vh; min-height: 100dvh; color: var(--sc-ink); font-size: 16px; line-height: 1.5; }
.gw button { font: inherit; }
.gw-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.gw-hp { position: absolute; left: -9999px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.gw .btn[disabled] { opacity: .5; cursor: default; }
.gw .btn { cursor: pointer; }
.gw-chip:focus-visible, .gw-send:focus-visible, .gw a:focus-visible, .gw-restart:focus-visible, .gw-check input:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }

/* ---------------------------------------------------------------- layout */
.gw-wiz { max-width: 42rem; margin: 0 auto; padding: 0 16px; }

/* Max's spot: big and centered at first, then a compact sticky guide */
.gw-host { position: relative; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 4px 0 0; }
.gw-host .max { width: 148px; transition: width 600ms var(--ease); }
.gw-dots { list-style: none; margin: 0; padding: 0; display: flex; gap: 8px; height: 10px; opacity: 0; transition: opacity 400ms; }
.gw-dots li { width: 8px; height: 8px; border-radius: 50%; background: var(--line-strong); transition: background 300ms, transform 300ms var(--ease), box-shadow 300ms; }
.gw-dots li.is-done { background: linear-gradient(135deg, var(--sc-accent), var(--magenta)); transform: scale(1.15); box-shadow: 0 0 10px rgb(228 63 251 / .55); }
.gw-dots li.is-now { box-shadow: 0 0 0 2px var(--violet-text); }
.gw-dots li.is-pop { animation: gw-dot-pop 520ms var(--ease); }
@keyframes gw-dot-pop { 0% { transform: scale(.4); } 55% { transform: scale(1.7); } 100% { transform: scale(1.15); } }
.gw-status { margin: 0; min-height: 1.4em; font-size: .9rem; color: var(--violet-text); font-weight: 500; opacity: 0; transition: opacity 250ms; text-align: center; }
.gw-status.is-on { opacity: 1; }
.gw-say { display: none; }
.gw-restart { display: none; position: absolute; right: 0; top: 8px; background: none; border: 0; color: var(--sc-ink-soft); cursor: pointer; padding: 8px 4px; font-size: .9rem; font-weight: 500; }
.gw-restart:hover { color: #fff; }
body.stage-chat .gw-restart { display: block; }

.gw-intro { text-align: center; }
.gw-intro h1 { margin: 14px 0 12px; font-weight: 800; font-size: clamp(2rem, 8.6vw, 3.5rem); line-height: 1; letter-spacing: -.035em; text-wrap: balance; color: var(--sc-ink); }
.gw-lede { margin: 0 auto; max-width: 34rem; color: var(--sc-ink-soft); font-size: 1.05rem; text-wrap: pretty; }

/* Max's first line: a dock reserved beside it, where he lands after flying down from the hero spot (gather.js) */
.gw-introline { display: flex; align-items: center; gap: 18px; }
.gw-introline .gw-msg--max { flex: 1; min-width: 0; }
.gw-dock { position: relative; flex: none; width: 112px; height: 112px; }
.gw-dock .max { position: absolute; left: 0; top: 0; width: 112px; }
.gw-host.is-leaving { overflow: hidden; }
.gw-host.is-empty { height: 0; padding: 0; overflow: hidden; }
body:not(.stage-intro) .gw-dock { display: none; } /* Max is back in the guide spot once the conversation starts */
@media (max-width: 719px) {
  .gw-introline { gap: 14px; }
  .gw-dock, .gw-dock .max { width: 84px; }
  .gw-dock { height: 84px; }
}

/* conversation */
.gw-convo { display: flex; flex-direction: column; gap: 16px; padding: 26px 0 6px; }
.gw-msg { margin: 0; animation: gw-msg-in 380ms var(--ease) both; }
@keyframes gw-msg-in { from { opacity: 0; transform: translateY(8px); } }
.gw-msg--max { max-width: 36rem; font-size: 1.2rem; line-height: 1.42; font-weight: 500; color: var(--warm-ink); letter-spacing: -.005em; }
.gw-msg--max .gw-txt { cursor: default; }
.gw-txt.is-typing::after { content: ""; display: inline-block; width: .5em; height: .5em; margin-left: .2em; border-radius: 50%; background: var(--magenta); box-shadow: 0 0 8px var(--magenta); vertical-align: .1em; animation: gw-tick 700ms ease-in-out infinite; }
@keyframes gw-tick { 50% { opacity: .25; transform: scale(.7); } }
.gw-msg--you {
  align-self: flex-end; max-width: 86%; padding: 10px 16px; border-radius: 18px 18px 6px 18px;
  background: linear-gradient(135deg, var(--accent-deep), var(--sc-accent)); color: #fff; font-weight: 500; overflow-wrap: anywhere;
}
.gw-msg.is-past { opacity: .55; transition: opacity 400ms; }
.gw-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.gw-chip {
  min-height: 44px; padding: 9px 16px; border-radius: 999px; line-height: 1.2; text-align: left;
  border: 1px solid var(--line-strong); background: var(--raised); color: var(--sc-ink);
  font-size: .98rem; font-weight: 500; cursor: pointer;
  animation: gw-chip-in 420ms var(--ease) both; animation-delay: calc(var(--i, 0) * 45ms);
  transition: border-color 160ms, background-color 160ms, transform 120ms, opacity 200ms;
}
@keyframes gw-chip-in { from { opacity: 0; transform: translateY(8px) scale(.96); } }
.gw-chip:active { transform: scale(.97); }
.gw-chip[aria-pressed="true"] { background: var(--sc-accent); border-color: var(--sc-accent); color: #fff; }
.gw-chip--ghost { background: transparent; color: var(--sc-ink-soft); }
.gw-chip--done { background: #fff; color: #15102a; border-color: #fff; font-weight: 600; }
.gw-chip--done[disabled] { opacity: .35; cursor: default; }
.gw-chips.is-locked .gw-chip { pointer-events: none; }
.gw-chips.is-locked .gw-chip:not([aria-pressed="true"]) { opacity: .3; }
@media (hover: hover) and (pointer: fine) { .gw-chip:hover { border-color: var(--violet-text); } }

/* composer */
.gw-composer { position: relative; z-index: 2; padding: 14px 0 6px; }
.gw-composer__box {
  display: flex; align-items: flex-end; gap: 8px; padding: 6px 6px 6px 18px;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: 24px;
  transition: border-color 200ms, box-shadow 300ms;
}
.gw-composer__box:focus-within { border-color: var(--sc-accent); box-shadow: 0 0 0 4px rgb(143 60 250 / .18), 0 10px 40px -10px rgb(228 63 251 / .35); }
.gw-composer textarea {
  flex: 1; min-width: 0; resize: none; border: 0; outline: 0; background: transparent; color: var(--sc-ink);
  font: inherit; font-size: 16px; line-height: 1.4; padding: 10px 0; max-height: 132px;
}
.gw-composer textarea::placeholder { color: #8a83a0; }
.gw-send {
  flex: none; width: 44px; height: 44px; border-radius: 50%; border: 0; cursor: pointer;
  display: grid; place-items: center; background: var(--line-strong); color: #fff; transition: background 200ms, transform 150ms;
}
.gw-send.is-ready { background: linear-gradient(135deg, var(--sc-accent), var(--magenta)); }
.gw-send svg { width: 20px; height: 20px; }
.gw-send:active { transform: scale(.94); }
.gw-hint { margin: 12px 6px 0; color: var(--sc-ink-soft); font-size: 14.5px; line-height: 1.45; } /* #b6afc7 on the canvas: about 9:1 */
@media (min-width: 720px) { .gw-hint { font-size: 15.5px; } }
.gw-introAct { display: flex; flex-direction: column; align-items: stretch; gap: 14px; padding: 16px 0 56px; }
.gw-introAct .btn { width: 100%; }
.gw-or { display: flex; align-items: center; gap: 12px; margin: 8px 0 0; color: var(--sc-ink-soft); font-size: .86rem; letter-spacing: .12em; text-transform: uppercase; font-weight: 600; }
.gw-or::before, .gw-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.gw-introAct .gw-chips { margin-top: 0; justify-content: center; }

/* chat stage: Max becomes a compact sticky guide under the site bar; the composer docks */
body.stage-chat .gw-intro, body.stage-results .gw-intro, body:not(.stage-intro) .gw-introAct, body:not(.stage-intro) .gw-hint { display: none; }
body.stage-chat .gw-host {
  position: sticky; top: var(--bar-h); z-index: 2; padding: 6px 0 22px;
  background: linear-gradient(var(--canvas) 84%, rgb(14 12 20 / 0));
}
/* the site bar is see-through; keep the conversation from showing through it above the sticky guide */
body.stage-chat .gw-host::before, body.stage-results .gw-host::before {
  content: ""; position: absolute; left: -16px; right: -16px; bottom: 100%; height: var(--bar-h); background: var(--canvas); pointer-events: none;
}
body.stage-chat .gw-host .max { width: 84px; }
body.stage-chat .gw-dots { opacity: 1; }
body.stage-chat .gw-convo { padding-bottom: 12px; min-height: 40vh; }
body.stage-chat .gw-composer {
  position: sticky; bottom: 0; padding: 18px 0 calc(12px + env(safe-area-inset-bottom));
  background: linear-gradient(rgb(14 12 20 / 0), var(--canvas) 34%);
}
body.stage-results .gw-convo, body.stage-results .gw-composer, body.is-finishing .gw-composer { display: none; }

/* results stage: Max sits beside his words */
body.stage-results .gw-wiz { max-width: 76rem; }
body.stage-results .gw-host {
  position: sticky; top: var(--bar-h); z-index: 2; flex-direction: row; align-items: center; gap: 12px; padding: 8px 0 14px;
  background: linear-gradient(var(--canvas) 78%, rgb(14 12 20 / 0));
}
body.stage-results .gw-host .max { width: 66px; }
body.stage-results .gw-say {
  display: block; flex: 1; min-width: 0; margin: 0; padding: 10px 14px; min-height: 48px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px 16px 16px 6px;
  color: var(--warm-ink); font-weight: 500; font-size: 1.02rem; line-height: 1.4;
}
body.stage-results .gw-status, body.stage-results .gw-dots { display: none; }

/* ---------------------------------------------------------------- results */
.gw-results { position: relative; z-index: 1; padding: 4px 0 72px; }
.gw-res-head h2:focus { outline: none; }
.gw-res-head { margin: 6px 0 18px; }
.gw-eyebrow { margin: 0 0 8px; font-size: .76rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--violet-text); }
.gw-res-head h2 { margin: 0; font-size: clamp(1.7rem, 6vw, 2.6rem); font-weight: 800; letter-spacing: -.03em; line-height: 1.05; text-wrap: balance; color: var(--sc-ink); }
.gw-summary { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.gw-summary li { padding: 5px 11px; border-radius: 999px; background: var(--raised); border: 1px solid var(--line); color: var(--sc-ink-soft); font-size: .84rem; }
.gw-cards { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); align-items: start; }
.gw-card {
  position: relative; padding: 22px 20px 20px; border-radius: var(--r-lg);
  background: linear-gradient(180deg, var(--raised), var(--surface)); border: 1px solid var(--line);
  opacity: 0; transform: translateY(22px) scale(.97);
  transition: opacity 600ms var(--ease), transform 700ms var(--ease), border-color 400ms, box-shadow 500ms;
  scroll-margin-top: calc(var(--bar-h) + 110px); scroll-margin-bottom: 20px;
}
.gw-card.is-in { opacity: 1; transform: none; }
.gw-card.is-lead { border-color: rgb(143 60 250 / .75); box-shadow: 0 0 0 1px rgb(143 60 250 / .3), 0 24px 70px -24px rgb(143 60 250 / .6); }
.gw-card__top { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 26px; }
.gw-card__tag { font-size: .74rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--violet-text); }
.gw-card__badge {
  padding: 5px 11px; border-radius: 999px; font-size: .78rem; font-weight: 700; color: #fff; white-space: nowrap;
  background: linear-gradient(90deg, var(--sc-accent), var(--magenta)); box-shadow: 0 0 18px rgb(228 63 251 / .45);
  transform: scale(0); transition: transform 500ms cubic-bezier(.34, 1.6, .5, 1);
}
.gw-card:not(.is-lead) .gw-card__badge { visibility: hidden; }
.gw-card.is-lead .gw-card__badge { transform: scale(1); }
.gw-card h3 { margin: 10px 0 6px; font-size: 1.5rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; color: var(--sc-ink); }
.gw-card__desc { margin: 0 0 16px; color: var(--sc-ink); font-size: 1rem; }
.gw-card dl { margin: 0 0 18px; display: grid; gap: 10px; }
.gw-card dl div { display: grid; gap: 2px; padding-top: 10px; border-top: 1px solid var(--line); }
.gw-card dt { font-size: .72rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--sc-ink-soft); }
.gw-card dd { margin: 0; color: var(--sc-ink); font-size: .95rem; line-height: 1.45; }
.gw-card .btn { width: 100%; }
.gw-card--c { cursor: pointer; }

.gw-next { margin-top: 34px; display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); opacity: 0; transform: translateY(16px); transition: opacity 600ms var(--ease), transform 600ms var(--ease); }
.gw-next.is-in { opacity: 1; transform: none; }
.gw-next h3 { margin: 0; font-size: 1.25rem; font-weight: 800; letter-spacing: -.01em; color: var(--sc-ink); }
.gw-panel { padding: 20px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); }
.gw-mail__label { display: block; font-weight: 700; font-size: 1.08rem; margin-bottom: 4px; color: var(--sc-ink); }
.gw-mail p { margin: 0 0 12px; color: var(--sc-ink-soft); font-size: .94rem; }
.gw-mail__row { display: flex; flex-direction: column; gap: 10px; }
.gw-mail input[type="email"] {
  min-height: 50px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--line-strong);
  background: var(--canvas); color: var(--sc-ink); font: inherit; font-size: 16px; min-width: 0; outline: 0;
}
.gw-mail input[type="email"]:focus { border-color: var(--sc-accent); box-shadow: 0 0 0 4px rgb(143 60 250 / .18); }
.gw-mail input[aria-invalid="true"] { border-color: #ff6b8a; }
.gw-mail .gw-mail__err { margin: 10px 0 0; color: #ff9db1; font-size: .9rem; font-weight: 500; }
.gw-check { display: flex; align-items: flex-start; gap: 10px; margin-top: 14px; color: var(--sc-ink-soft); font-size: .9rem; line-height: 1.4; cursor: pointer; }
.gw-check input { flex: none; width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--sc-accent); }
.gw-mail__ok { display: none; align-items: center; gap: 10px; font-weight: 600; color: var(--warm-ink); }
.gw-mail.is-sent .gw-mail__ok { display: flex; margin: 0; }
.gw-mail.is-sent .gw-mail__form { display: none; }
.gw-mail__ok svg { flex: none; width: 28px; height: 28px; }
.gw-links { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); }
.gw-link {
  display: flex; flex-direction: column; gap: 4px; padding: 18px 20px; border-radius: var(--r-lg);
  background: var(--surface); border: 1px solid var(--line); color: var(--sc-ink); text-decoration: none;
  transition: border-color 200ms, transform 200ms var(--ease);
}
.gw-link b { font-size: 1.05rem; }
.gw-link span { color: var(--sc-ink-soft); font-size: .93rem; }
.gw-link b::after { content: " →"; color: var(--violet-text); }
.gw-link[hidden] { display: none; }
.gw-link--launch { border-color: rgb(228 63 251 / .5); background: linear-gradient(135deg, rgb(116 39 200 / .3), rgb(228 63 251 / .14)); animation: gw-msg-in 600ms var(--ease) both; }
@media (hover: hover) and (pointer: fine) { .gw-link:hover { border-color: var(--violet-text); transform: translateY(-2px); } }
.gw-again { justify-self: start; }

/* ---------------------------------------------------------------- wider */
@media (min-width: 720px) {
  .gw-host .max { width: 176px; }
  .gw-introAct { align-items: center; }
  .gw-introAct .btn { width: auto; }
  .gw-mail__row { flex-direction: row; }
  .gw-mail input[type="email"] { flex: 1; }
  .gw-links { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body.stage-chat .gw-host .max { width: 84px; }
  body.stage-results .gw-host .max { width: 78px; }
  body.stage-results .gw-say { font-size: 1.1rem; }
}
@media (min-width: 980px) {
  .gw-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .gw-next { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); align-items: start; }
  .gw-next h3 { grid-column: 1 / -1; }
  .gw-links { grid-template-columns: minmax(0, 1fr); }
  body.stage-results .gw-host { max-width: 46rem; }
}
@media (prefers-reduced-motion: reduce) {
  .gw *, .gw *::before, .gw *::after { animation-duration: 1ms !important; animation-delay: 0ms !important; transition-duration: 200ms !important; }
  .gw-card, .gw-next { transform: none; }
}
