/* ============================================================
   Captains stage — the briefing's debrief layout, on the home page.

   Orb on the left inside a domain constellation, step copy on the
   right, transport along the bottom. Each Captain presents itself,
   then a convergence beat, then the roster hands over to the live
   orbs already on the page for voice and chat.

   The presentation is its own surface. The existing #orbIntro keeps
   every working integration and appears at the end, which is where
   talking to a Captain actually belongs.
   ============================================================ */

.cap-stage {
  --cs-gold: var(--gold, #D4AF52);
  --cs-gold-hi: var(--gold-strong, #F3D98F);
  --cs-line: rgba(212, 175, 82, .20);
  --cs-ink: var(--text, #F3EEE0);
  --cs-dim: var(--text-dim, #ABA290);
  position: relative;
  max-width: 1280px;
  margin: 0 auto;
  padding: clamp(18px, 3vw, 30px) clamp(16px, 4vw, 44px) 0;
}

/* ---- the stage: orb | copy ---- */
.cs-deck {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  align-items: center;
  gap: clamp(20px, 4vw, 56px);
  min-height: clamp(420px, 52vh, 560px);
}

/* ---- left: orb inside the constellation ---- */
.cs-orbwrap {
  position: relative;
  aspect-ratio: 1;
  width: 100%;
  max-width: 560px;
  margin-inline: auto;
  display: grid;
  place-items: center;
}
.cs-orbwrap canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.cs-orb {
  position: relative;
  width: 40%;
  aspect-ratio: 1;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 34% 26%, rgba(255, 214, 140, .16), rgba(0, 0, 0, 0) 58%),
    radial-gradient(circle at 50% 50%, #12100b 0%, #0a0806 62%, #070505 100%);
  border: 1px solid rgba(232, 190, 110, .40);
  box-shadow:
    0 0 0 1px rgba(255, 225, 170, .09) inset,
    0 0 50px rgba(226, 178, 90, .22),
    0 0 110px rgba(226, 178, 90, .10);
  transition: border-color .5s ease, box-shadow .5s ease;
}
.cs-orb img {
  width: 58%;
  height: auto;
  display: block;
  filter: drop-shadow(0 0 18px rgba(240, 190, 100, .45));
  transition: opacity .45s ease;
}
.cs-orbcap {
  position: absolute;
  left: 50%;
  /* Directly beneath the orb, not at the foot of the wrap: down there it
     collided with the lower constellation labels, which sit on the ring. */
  top: 75%;
  transform: translateX(-50%);
  text-align: center;
  width: max-content;
  max-width: 64%;
}
.cs-orbcap b {
  display: block;
  font: 400 clamp(19px, 2.1vw, 27px)/1.1 var(--font-display, "Cormorant Garamond", Georgia, serif);
  letter-spacing: .18em;
  color: var(--cs-ink);
}
.cs-orbcap span {
  display: block;
  margin-top: 5px;
  font: 400 10.5px/1.35 var(--font-body, "Cormorant Garamond", Georgia, serif);
  color: var(--cs-dim);
}
.cs-orbcap em {
  display: block;
  margin-top: 3px;
  font: 500 8.5px/1 var(--font-mono, ui-monospace, "JetBrains Mono", monospace);
  letter-spacing: .24em;
  text-transform: uppercase;
  font-style: normal;
  color: rgba(212, 175, 82, .72);
}

/* ---- right: the step ---- */
.cs-copy { min-width: 0; }
.cs-kicker {
  font: 500 10.5px/1 var(--font-mono, ui-monospace, monospace);
  letter-spacing: .26em;
  text-transform: uppercase;
  color: var(--cs-gold);
  margin-bottom: clamp(12px, 2vw, 20px);
}
.cs-head {
  margin: 0 0 clamp(12px, 1.8vw, 20px);
  font: 400 clamp(30px, 4.4vw, 56px)/1.08 var(--font-display, "Cormorant Garamond", Georgia, serif);
  letter-spacing: -.01em;
  color: var(--cs-ink);
}
.cs-body {
  margin: 0;
  max-width: 44ch;
  font: 400 clamp(15px, 1.35vw, 19px)/1.62 var(--font-body, "Cormorant Garamond", Georgia, serif);
  color: var(--cs-dim);
}
.cs-body b { color: var(--cs-ink); font-weight: 600; }

/* Steps cross-fade rather than cut. */
.cs-copy, .cs-orbcap { transition: opacity .34s ease; }
.cap-stage.is-turning .cs-copy,
.cap-stage.is-turning .cs-orbcap { opacity: 0; }

/* ---- transport ---- */
.cs-bar {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  padding: clamp(14px, 2vw, 20px) 0 6px;
  margin-top: clamp(12px, 2vw, 20px);
  border-top: 1px solid var(--cs-line);
}
.cs-btn {
  appearance: none;
  background: transparent;
  border: 1px solid var(--cs-line);
  border-radius: 9px;
  padding: 9px 15px;
  font: 500 10.5px/1 var(--font-mono, ui-monospace, monospace);
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--cs-ink);
  cursor: pointer;
  transition: border-color .2s ease, background .2s ease, color .2s ease, opacity .2s ease;
}
.cs-btn:hover:not(:disabled) { border-color: var(--cs-gold); }
.cs-btn:disabled { opacity: .34; cursor: default; }
.cs-btn.is-on,
.cs-btn.cs-primary {
  border-color: var(--cs-gold);
  background: var(--cs-gold);
  color: #1A1305;
}
.cs-spacer { flex: 1 1 40px; }
.cs-count {
  font: 500 10.5px/1 var(--font-mono, ui-monospace, monospace);
  letter-spacing: .18em;
  color: var(--cs-dim);
  white-space: nowrap;
}
.cs-hint {
  font: 500 9.5px/1 var(--font-mono, ui-monospace, monospace);
  letter-spacing: .14em;
  color: rgba(171, 162, 144, .6);
  white-space: nowrap;
}
.cs-progress {
  height: 2px;
  background: rgba(212, 175, 82, .13);
  border-radius: 2px;
  overflow: hidden;
}
.cs-progress i {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--gold-deep, #9C7128), var(--cs-gold-hi));
  transition: width .34s ease;
}

/* ---- the roster hand-off ----
   The live orbs are the last step, not a parallel thing competing for
   attention while the deck is running. */
#orbIntro { display: none; }
.cap-stage.is-roster ~ #orbIntro,
.cap-stage.is-roster + #orbIntro { display: block; }
.cap-stage.is-roster .cs-deck { display: none; }

@media (max-width: 900px) {
  .cs-deck {
    grid-template-columns: 1fr;
    gap: 18px;
    min-height: 0;
    padding-top: 6px;
  }
  .cs-orbwrap { max-width: 380px; }
  .cs-copy { text-align: center; }
  .cs-body { margin-inline: auto; }
}
@media (max-width: 560px) {
  .cs-orbwrap { max-width: 300px; }
  .cs-btn { padding: 8px 11px; font-size: 9.5px; letter-spacing: .12em; }
  .cs-hint { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .cs-copy, .cs-orbcap, .cs-progress i { transition: none; }
}

/* A presented Captain that lives on its own page gets a way there. */
.cs-more {
  display: inline-block;
  margin-left: .4em;
  color: var(--cs-gold);
  text-decoration: none;
  border-bottom: 1px solid rgba(212, 175, 82, .4);
  white-space: nowrap;
}
.cs-more:hover { border-bottom-color: var(--cs-gold); }

/* ── Convergence scene ───────────────────────────────────────────────
   The briefing's convergence: the Captains' own orbs orbiting the
   Innerface core, drawn in as they converge, with a card per signal
   underneath. Only shown on the convergence step. */
.cs-signals {
  display: none;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px;
  margin-top: clamp(14px, 2vw, 22px);
}
.cap-stage.is-converge .cs-signals { display: grid; }
.cs-sig {
  border: 1px solid var(--cs-line);
  border-left: 2px solid var(--sig, var(--cs-gold));
  border-radius: 10px;
  padding: 13px 15px;
  background: rgba(255, 255, 255, .012);
}
.cs-sig b {
  display: block;
  font: 400 15px/1.2 var(--font-display, "Cormorant Garamond", Georgia, serif);
  letter-spacing: .12em;
  color: var(--sig, var(--cs-gold));
  margin-bottom: 3px;
}
.cs-sig i {
  display: block;
  font: 500 8.5px/1.3 var(--font-mono, ui-monospace, monospace);
  letter-spacing: .16em;
  text-transform: uppercase;
  font-style: normal;
  color: var(--cs-dim);
  margin-bottom: 7px;
}
.cs-sig p {
  margin: 0;
  font: 400 13px/1.5 var(--font-body, "Cormorant Garamond", Georgia, serif);
  color: var(--cs-dim);
}
.cs-sig .st {
  display: inline-block;
  margin-top: 8px;
  font: 500 8px/1 var(--font-mono, ui-monospace, monospace);
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--sig, var(--cs-gold));
  opacity: .85;
}
/* On convergence the deck goes full width — the constellation is the point. */
.cap-stage.is-converge .cs-deck { grid-template-columns: minmax(0, 1fr); }
.cap-stage.is-converge .cs-orbwrap { max-width: min(560px, 74vw); }
.cap-stage.is-converge .cs-copy { text-align: center; }
.cap-stage.is-converge .cs-body { margin-inline: auto; }
.cs-replay { margin-left: 2px; }

/* The core gives way on convergence so the planets have room to orbit it. */
.cap-stage.is-converge .cs-orb { width: 30%; transition: width .8s ease; }
.cap-stage.is-converge .cs-orbcap { top: 68%; }
