:root {
  /* Matches the flat navy at the edges of the orb render, so the video blends. */
  --bg: #01091c;
  --text: #f4f7ff;
  --muted: #8fb4ff;
  --soft: #b9c3dc;
  --faint: #5e6a8a;
  --blue: #2f7bff;
  --cyan: #38c6ff;
  --green: #3ddc84;
  --line: rgba(79, 160, 255, 0.28);
  --glow: rgba(56, 150, 255, 0.35);
  --orb-w: min(100%, 560px);
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  display: grid;
  place-items: start center;
  padding: 18px 16px 40px;
}

.page {
  width: min(680px, 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Headline: "What's your NEXT (3) MOVES?" The wordmark is built in text so it stays crisp and scales. */

.headline {
  margin: 6px 0 4px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  column-gap: 0.28em;
  row-gap: 2px;
  font-size: clamp(26px, 5vw, 36px);
  font-weight: 700;
  letter-spacing: -0.01em;
  text-align: center;
  text-shadow: 0 0 24px rgba(79, 160, 255, 0.25);
}

.headline .lead { white-space: nowrap; }

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.2em;
  color: #fff;
  font-weight: 800;
  font-size: 0.92em;
  letter-spacing: 0.05em;
}

/* No gap before the question mark */
.wordmark + .lead { margin-left: -0.28em; }

.wm-three {
  display: inline-grid;
  place-items: center;
  width: 1.45em;
  height: 1.45em;
  border-radius: 50%;
  letter-spacing: 0;
  background:
    linear-gradient(var(--bg), var(--bg)) padding-box,
    linear-gradient(160deg, var(--green), var(--cyan) 55%, var(--blue)) border-box;
  border: 0.12em solid transparent;
  box-shadow: 0 0 14px rgba(56, 198, 255, 0.35);
}

.wm-three {
  background:
    linear-gradient(var(--bg), var(--bg)) padding-box,
    linear-gradient(160deg, var(--green), var(--cyan) 55%, var(--blue)) border-box;
  color: var(--cyan);
  font-size: 0.95em;
  line-height: 1;
}

.tagline {
  margin: 0;
  color: var(--muted);
  font-size: clamp(14px, 2.4vw, 17px);
  text-align: center;
  transition: opacity 0.35s ease;
}

.tagline.is-swapping { opacity: 0; }

/* The orb: Jo's render as a looping video, the spark title laid over the window. */

.ball-button {
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  width: var(--orb-w);
  margin-top: 4px;
  border-radius: 24px;
  outline-offset: 6px;
}

.ball-button:focus-visible { outline: 2px solid var(--cyan); }

/* The render has empty navy across its top 14%; the frame is cropped to 800 x 560 and bottom-aligned
   so the orb sits close under the tagline and the faint residue strip along the top edge is cut off. */
.orb {
  position: relative;
  width: 100%;
  aspect-ratio: 800 / 560;
  overflow: hidden;
  border-radius: 24px;
}

/* The render carries a faint strip of residue along its top edge; this covers it with page colour. */
.orb::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  /* Fades to the page colour at zero alpha, not to transparent black, or a dark band appears. */
  background: linear-gradient(0deg, var(--bg) 0%, rgba(1, 9, 28, 0) 10%);
}

.orb-window { z-index: 2; }

.orb-video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 100%;
  background: var(--bg) url("/assets/orb-still.png") 50% 100% / cover no-repeat;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}

/* Window centre measured on the render: x 50.6%, y 52.6%, usable diameter about 26% of width. */
.orb-window {
  position: absolute;
  left: 50.6%;
  top: 45%;
  width: 29%;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  text-align: center;
  padding: 3%;
}

.orb-title {
  color: #fff;
  font-weight: 600;
  font-size: clamp(12px, calc(var(--orb-px, 560px) * 0.037), 21px);
  line-height: 1.12;
  letter-spacing: -0.01em;
  text-shadow: 0 0 10px rgba(56, 150, 255, 0.6), 0 1px 2px rgba(0, 0, 0, 0.7);
  hyphens: auto;
  text-wrap: balance;
  transition: opacity 0.25s ease;
}

.orb.is-shaking { animation: wobble 0.7s cubic-bezier(.36,.07,.19,.97) both; }
.orb.is-shaking .orb-title { animation: resurface 0.7s ease-out both; }

@keyframes wobble {
  10%, 90% { transform: translate3d(-1px, 0, 0) rotate(-0.6deg); }
  20%, 80% { transform: translate3d(2px, 0, 0) rotate(1.2deg); }
  30%, 50%, 70% { transform: translate3d(-4px, 0, 0) rotate(-1.8deg); }
  40%, 60% { transform: translate3d(4px, 0, 0) rotate(1.8deg); }
}

@keyframes resurface {
  0% { opacity: 1; transform: scale(1); }
  35% { opacity: 0; transform: scale(0.85); }
  65% { opacity: 0; transform: scale(0.85); }
  100% { opacity: 1; transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .orb.is-shaking, .orb.is-shaking .orb-title { animation: none; }
}

/* The question, in a glowing box under the orb */

.spark {
  width: 100%;
  margin-top: calc(var(--orb-px, 560px) * -0.08);
  position: relative;
  z-index: 3;
  min-height: 92px;
  display: grid;
  place-items: center;
  padding: 22px 26px;
  border-radius: 22px;
  border: 1.5px solid transparent;
  background:
    linear-gradient(#06122e, #06122e) padding-box,
    linear-gradient(90deg, var(--blue), var(--cyan) 50%, var(--green)) border-box;
  box-shadow: 0 0 28px var(--glow), inset 0 0 40px rgba(31, 90, 220, 0.12);
  text-align: center;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.spark.is-swapping { opacity: 0; transform: translateY(4px); }

.spark-body {
  margin: 0;
  color: var(--text);
  font-size: clamp(17px, 3vw, 21px);
  line-height: 1.4;
  max-width: 44ch;
}

.spark[data-kind="experiment"] .spark-body,
.spark[data-kind="escape"] .spark-body,
.spark[data-kind="breather"] .spark-body { color: var(--soft); font-size: clamp(16px, 2.7vw, 19px); }

/* Choices: normally just Shake again */

.choices {
  margin-top: 22px;
  width: 100%;
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.choice {
  border: 1.5px solid transparent;
  border-radius: 999px;
  background:
    linear-gradient(#071734, #071734) padding-box,
    linear-gradient(90deg, var(--green), var(--cyan) 45%, var(--blue)) border-box;
  color: #fff;
  font: inherit;
  font-weight: 600;
  font-size: 17px;
  padding: 14px 34px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  text-decoration: none;
  box-shadow: 0 0 22px rgba(56, 198, 255, 0.35);
  transition: box-shadow 0.2s ease, transform 0.15s ease;
}

.choice:hover { box-shadow: 0 0 34px rgba(56, 198, 255, 0.6); }
.choice:active { transform: translateY(1px); }
.choice:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }
.choice svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.choice[hidden] { display: none; }

/* Explore panel (Stage 2 shell, behind a flag until the ball can answer) */

.explore-panel {
  width: 100%;
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.composer {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: start;
}

/* The thread: the person on the right, the ball on the left, newest at the bottom. */
.thread { display: flex; flex-direction: column; gap: 10px; }
.thread:empty { display: none; }
.bubble {
  max-width: 88%;
  padding: 12px 16px;
  border-radius: 18px;
  font-size: 16px;
  line-height: 1.5;
  text-align: left;
}
.bubble-you {
  align-self: flex-end;
  background: linear-gradient(90deg, rgba(47, 123, 255, 0.35), rgba(56, 198, 255, 0.25));
  border: 1px solid rgba(56, 198, 255, 0.35);
  color: #fff;
  border-bottom-right-radius: 6px;
}
.bubble-ball {
  align-self: flex-start;
  border: 1px solid var(--line);
  background: rgba(6, 18, 46, 0.7);
  color: var(--soft);
  border-bottom-left-radius: 6px;
}
.bubble-ball.is-moves { max-width: 100%; padding: 16px 20px; }
.bubble.is-waiting { color: var(--muted); font-style: italic; }
.bubble p { margin: 0 0 10px; }
.bubble p:last-child, .bubble ul:last-child { margin-bottom: 0; }
.bubble ul { margin: 0 0 12px; padding-left: 20px; }
.bubble li { margin: 4px 0; }
.bubble strong { color: #fff; font-weight: 600; }

/* The hand-off: the ball never switches to moves on its own; the person taps. */
.handoff { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
.handoff[hidden] { display: none; }
.choice-go { background:
    linear-gradient(90deg, var(--green), var(--cyan) 45%, var(--blue)) padding-box,
    linear-gradient(90deg, var(--green), var(--cyan) 45%, var(--blue)) border-box;
  color: #01091c; }
.choice-go:hover { box-shadow: 0 0 34px rgba(61, 220, 132, 0.6); }

.explore-panel[hidden] { display: none; }

.explore-panel textarea {
  width: 100%;
  resize: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(1, 9, 28, 0.6);
  color: var(--text);
  font: inherit;
  font-size: 15px;
  line-height: 1.45;
  padding: 12px 14px;
}

.explore-panel textarea:focus { outline: 2px solid var(--cyan); outline-offset: 0; border-color: transparent; }
.explore-panel textarea::placeholder { color: var(--faint); }

.send {
  border: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--blue), var(--cyan));
  color: #fff;
  font: inherit;
  font-size: 15px;
  padding: 12px 18px;
  cursor: pointer;
  align-self: stretch;
}

.send:hover { filter: brightness(1.1); }
.send:disabled { opacity: 0.6; cursor: default; }


/* Keep your moves */

.keep { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.keep:empty { display: none; }
.choice-quiet { font-weight: 500; font-size: 15px; padding: 11px 24px; box-shadow: none; }
.choice-quiet:hover { box-shadow: 0 0 22px rgba(56, 198, 255, 0.35); }
.send-panel { width: 100%; display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; }
.send-panel[hidden] { display: none; }
.send-panel input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(1, 9, 28, 0.6);
  color: var(--text);
  font: inherit;
  font-size: 15px;
  padding: 12px 16px;
}
.send-panel input:focus { outline: 2px solid var(--cyan); outline-offset: 0; border-color: transparent; }
.send-panel input::placeholder { color: var(--faint); }
.turnstile { grid-column: 1 / -1; min-height: 0; display: flex; justify-content: center; }
.turnstile:empty { display: none; }
.send-note { grid-column: 1 / -1; margin: 0; text-align: center; color: var(--muted); font-size: 14px; }
.return-choices { display: contents; }
.return-choices[hidden] { display: none; }
.spark[data-kind="return"] .spark-body { color: var(--text); }

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

/* Footer */

.divider {
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line) 20%, var(--line) 80%, transparent);
  margin: 34px 0 24px;
}

.beyond {
  display: flex;
  gap: 22px;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
}

.beyond a {
  color: #fff;
  text-decoration: none;
  font-size: clamp(15px, 2.6vw, 18px);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.beyond a:hover { color: var(--cyan); }
.beyond svg { width: 20px; height: 20px; stroke: var(--green); fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.beyond-sep { width: 1px; height: 22px; background: var(--line); }

.beyond-caption {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: clamp(14px, 2.4vw, 17px);
  text-align: center;
}

@media (max-width: 480px) {
  body { padding: 20px 12px 32px; }
  .spark { padding: 18px 18px; border-radius: 18px; }
  .beyond-sep { display: none; }
}
