/**
 * Star Wars hangar reel — cold bay, aged metal, warm engines.
 * Development work by David Lane
 */
body.plan-starwars {
  --sw-ink: #e7ebf2;
  --sw-muted: rgba(231, 235, 242, 0.62);
  --sw-metal: #b7bcc6;
  --sw-engine: #ff7a3a;
  --sw-line: rgba(183, 188, 198, 0.28);
}

.sw-wrap {
  max-width: 1180px;
}

.sw-stage-block {
  position: relative;
  margin-bottom: 1rem;
}

.sw-stage {
  position: relative;
  width: 100%;
  height: min(68vh, 38rem);
  min-height: 22rem;
  border-radius: 1rem;
  overflow: hidden;
  background:
    radial-gradient(ellipse 70% 55% at 50% 42%, rgba(70, 78, 92, 0.35), transparent 60%),
    linear-gradient(180deg, #10131a 0%, #07080d 100%);
  border: 1px solid var(--sw-line);
}

.sw-stage__canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.sw-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 1.25rem 1.35rem 4.5rem;
  background:
    radial-gradient(ellipse 50% 40% at 50% 45%, rgba(255, 122, 58, 0.16), transparent 62%),
    linear-gradient(180deg, rgba(16, 19, 26, 0.2), rgba(7, 8, 13, 0.88));
}

.sw-fallback[hidden] {
  display: none;
}

.sw-fallback__kicker,
.sw-hud__kicker {
  margin: 0;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--sw-engine);
}

.sw-fallback h2,
.sw-hud__title {
  margin: 0.15rem 0 0.35rem;
  font-family: Fraunces, Georgia, serif;
  font-weight: 560;
  letter-spacing: -0.02em;
}

.sw-fallback p:last-child {
  margin: 0;
  max-width: 36rem;
  color: var(--sw-muted);
}

.sw-hud {
  position: absolute;
  left: 0.85rem;
  bottom: 0.85rem;
  z-index: 2;
  max-width: min(24rem, calc(100% - 1.7rem));
  padding: 0.7rem 0.85rem 0.75rem;
  border-radius: 0.85rem;
  border: 1px solid var(--sw-line);
  background: rgba(7, 8, 13, 0.72);
  pointer-events: none;
}

.sw-hud__title {
  font-size: 1.35rem;
}

.sw-hud__camera {
  margin: 0;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sw-metal);
}

.sw-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0 0 1rem;
}

.sw-chips .pw-btn.is-on {
  border-color: var(--sw-engine);
  color: #fff;
}

.sw-tour {
  margin-top: 0.25rem;
  padding: 0.9rem 1rem;
  border-radius: 0.85rem;
  border: 1px solid var(--plan-line, var(--sw-line));
  background: var(--plan-glass, rgba(8, 12, 22, 0.72));
}

.sw-tour__stage {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1rem;
  align-items: center;
}

.sw-tour__kicker {
  margin: 0;
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--sw-engine);
}

.sw-tour__title {
  margin: 0.1rem 0 0;
  font-family: Fraunces, Georgia, serif;
  font-size: 1.05rem;
  font-weight: 560;
}

.sw-tour__line {
  margin: 0.35rem 0 0.75rem;
  font-size: 0.98rem;
}

.sw-tour__controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.sw-hud__hint {
  margin: 0.35rem 0 0;
  font-size: 0.75rem;
  color: var(--sw-muted);
}

.sw-stage.is-walk .sw-stage__canvas,
#ctStage .sw-stage__canvas {
  cursor: grab;
}

.sw-tour__beats {
  list-style: none;
  margin: 0.6rem 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  max-height: 8.5rem;
  overflow: auto;
}

.sw-tour__beats button {
  appearance: none;
  border: 1px solid var(--sw-line);
  background: transparent;
  color: inherit;
  font-size: 0.72rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  cursor: pointer;
}

.sw-tour__beats button.is-on {
  border-color: var(--sw-engine);
  color: #fff;
}

.sw-tour__beats button:focus-visible,
.sw-chips .pw-btn:focus-visible {
  outline: 2px solid var(--sw-engine);
  outline-offset: 2px;
}

.sw-tour__note,
.sw-tour__status {
  margin: 0.55rem 0 0;
  font-size: 0.78rem;
  color: var(--sw-muted);
}

.sw-who__photo {
  width: 4.5rem;
  height: 4.5rem;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(183, 188, 198, 0.45);
}

.sw-who.is-speaking .sw-who__photo {
  border-color: var(--sw-engine);
  box-shadow: 0 0 0 3px rgba(255, 122, 58, 0.35);
}

@media (prefers-reduced-motion: reduce) {
  .sw-who.is-speaking .sw-who__photo {
    box-shadow: none;
  }
}

@media (max-width: 720px) {
  .sw-stage {
    height: 62vh;
    min-height: 18rem;
  }

  .sw-tour__stage {
    grid-template-columns: 1fr;
  }
}
