/* A preparation bay for the original crew artwork and role controls. */
.crew.chapter-scene {
  --crew-light: 255 178 116;
}

.crew.chapter-scene[data-theme="scout"] { --crew-light: 136 224 216; }
.crew.chapter-scene[data-theme="engineer"] { --crew-light: 154 203 250; }
.crew.chapter-scene[data-theme="medic"] { --crew-light: 220 182 251; }

.crew.chapter-scene .crew-panel {
  animation: none;
}

/* Open mounting marks replace the old full circle behind the character. */
.crew.chapter-scene .crew-figure::before {
  top: 6%;
  right: 11%;
  bottom: 12%;
  left: 11%;
  width: auto;
  height: auto;
  max-width: none;
  max-height: none;
  border: 0;
  border-radius: 0;
  color: rgb(var(--crew-light) / .5);
  background:
    linear-gradient(currentColor, currentColor) left top / 38px 1px,
    linear-gradient(currentColor, currentColor) left top / 1px 38px,
    linear-gradient(currentColor, currentColor) right top / 38px 1px,
    linear-gradient(currentColor, currentColor) right top / 1px 38px,
    linear-gradient(currentColor, currentColor) left bottom / 38px 1px,
    linear-gradient(currentColor, currentColor) left bottom / 1px 38px,
    linear-gradient(currentColor, currentColor) right bottom / 38px 1px,
    linear-gradient(currentColor, currentColor) right bottom / 1px 38px;
  background-repeat: no-repeat;
  box-shadow: none;
  pointer-events: none;
}

/* A low projection plate grounds the feet without covering the model. */
.crew.chapter-scene .crew-figure::after {
  left: 15%;
  right: 15%;
  bottom: 19px;
  height: 32px;
  border: 1px solid rgb(var(--crew-light) / .43);
  border-radius: 50%;
  background:
    radial-gradient(ellipse at center, rgb(var(--crew-light) / .2), transparent 68%),
    linear-gradient(90deg, transparent 49.8%, rgb(var(--crew-light) / .24) 50%, transparent 50.2%);
  box-shadow: 0 0 24px rgb(var(--crew-light) / .12), inset 0 0 12px rgb(var(--crew-light) / .09);
  filter: none;
  pointer-events: none;
}

.crew.chapter-scene .crew-figure > img {
  margin-bottom: 20px;
  max-height: min(435px, calc(100% - 44px));
  filter: drop-shadow(0 22px 22px #02090b9c) drop-shadow(0 3px 6px rgb(var(--crew-light) / .12));
}

.crew.chapter-scene .figure-word {
  color: #d6e5e905;
  -webkit-text-stroke-color: rgb(var(--crew-light) / .17);
}

.crew.chapter-scene .crew-figure figcaption {
  letter-spacing: .19em;
  color: #bdd3ce;
}

.crew.chapter-scene .crew-panel:not([hidden]) .crew-figure > img {
  animation: crew-materialize .55s cubic-bezier(.2,.7,.25,1) both;
}

.crew.chapter-scene .crew-panel:not([hidden]) .crew-figure::before,
.crew.chapter-scene .crew-panel:not([hidden]) .crew-figure::after {
  animation: crew-mount-light .6s ease-out both;
}

.crew.chapter-scene .crew-copy h3 span {
  display: flex;
  align-items: center;
  gap: 12px;
}

.crew.chapter-scene .crew-copy h3 span::before {
  content: "";
  display: block;
  width: 24px;
  height: 1px;
  flex-shrink: 0;
  background: currentColor;
}

.crew.chapter-scene .crew-copy .round-link span {
  border-radius: 2px;
  border-color: rgb(var(--crew-light) / .55);
  background: #0a242db3;
  transform: none;
}

.crew.chapter-scene .crew-copy .round-link:is(:hover, :focus-visible) {
  color: var(--role-color);
}

.crew.chapter-scene .crew-copy .round-link:is(:hover, :focus-visible) span {
  transform: translate(2px, -2px);
  background: rgb(var(--crew-light) / .12);
}

/* The rail is one connected selector, with a different light for each role. */
.crew.chapter-scene .crew-tabs {
  border-color: #99bbc15c;
  border-bottom: 1px solid #99bbc12b;
}

.crew.chapter-scene .crew-tabs button {
  --tab-light: #ffb274;
  position: relative;
  background: #071820d6;
  box-shadow: inset -1px 0 #a6c6cc26;
  transition: color .18s, background .18s, border-color .18s, box-shadow .18s;
}

.crew.chapter-scene .crew-tabs button[data-theme="scout"] { --tab-light: #88e0d8; }
.crew.chapter-scene .crew-tabs button[data-theme="engineer"] { --tab-light: #9acbfa; }
.crew.chapter-scene .crew-tabs button[data-theme="medic"] { --tab-light: #dcb6fb; }

.crew.chapter-scene .crew-tabs button > span:first-child {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  padding-top: 0;
  border: 1px solid #b9d5d038;
  font-variant-numeric: tabular-nums;
  color: var(--tab-light);
}

.crew.chapter-scene .crew-tabs button::before {
  content: "";
  position: absolute;
  left: 0;
  top: 30%;
  bottom: 30%;
  width: 2px;
  background: var(--tab-light);
  opacity: 0;
  pointer-events: none;
}

.crew.chapter-scene .crew-tabs button[aria-selected="true"] {
  color: #fff5e7;
  background: #14303ad9;
  border-bottom-color: var(--tab-light);
  box-shadow: inset -1px 0 #a6c6cc26, inset 0 1px #d7ece532;
}

.crew.chapter-scene .crew-tabs button[aria-selected="true"]::before { opacity: 1; }
.crew.chapter-scene .crew-tabs button[aria-selected="true"] > span:first-child { border-color: var(--tab-light); }
.crew.chapter-scene .crew-tabs button[aria-selected="true"] .tab-arrow { color: var(--tab-light); }
.crew.chapter-scene .crew-tabs button:hover { color: #fff5e7; background: #173540ed; }
.crew.chapter-scene .crew-tabs button[aria-selected="true"]:hover { background: #1c3d47ed; }

.crew.chapter-scene .crew-tabs button:focus-visible {
  outline: 2px solid var(--tab-light);
  outline-offset: -5px;
}

@keyframes crew-materialize {
  from { opacity: .45; transform: translateY(8px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes crew-mount-light {
  from { opacity: .15; }
  45% { opacity: 1; }
  to { opacity: .8; }
}

@media (max-width: 760px) {
  .crew.chapter-scene .crew-figure::before {
    top: 5%;
    right: 8%;
    bottom: 13%;
    left: 8%;
    background-size: 25px 1px, 1px 25px, 25px 1px, 1px 25px, 25px 1px, 1px 25px, 25px 1px, 1px 25px;
  }
  .crew.chapter-scene .crew-figure::after {
    left: 11%;
    right: 11%;
    bottom: 18px;
    height: 26px;
  }
  .crew.chapter-scene .crew-figure > img {
    margin-bottom: 28px;
    max-height: min(310px, calc(100% - 32px));
  }
  .crew.chapter-scene .crew-figure figcaption { letter-spacing: .12em; }
  .crew.chapter-scene .crew-copy h3 span { gap: 8px; }
  .crew.chapter-scene .crew-copy h3 span::before { width: 16px; }
  .crew.chapter-scene .crew-tabs button { padding: 15px 5px 13px; }
  .crew.chapter-scene .crew-tabs button > span:first-child { width: 18px; height: 18px; }
}

@media (max-width: 370px) {
  .crew.chapter-scene .crew-tabs button { padding-inline: 3px; }
  .crew.chapter-scene .crew-copy h3 span { letter-spacing: .16em; }
}

@media (prefers-reduced-motion: reduce) {
  .crew.chapter-scene .crew-panel:not([hidden]) .crew-figure > img,
  .crew.chapter-scene .crew-panel:not([hidden]) .crew-figure::before,
  .crew.chapter-scene .crew-panel:not([hidden]) .crew-figure::after { animation: none; }
  .crew.chapter-scene .crew-copy .round-link:is(:hover, :focus-visible) span { transform: none; }
}
