/* A fabrication floor for the existing workshop, with native facility links. */
#outpost {
  --foundry-light: #efb27d;
  --foundry-active: #efb27d;
}

#outpost .outpost-model {
  isolation: isolate;
}

#outpost .outpost-model > img {
  z-index: 1;
  transition: filter .22s ease-out;
}

/* A low angular machine bed replaces the large decorative orbit. */
#outpost .foundry-bed {
  position: absolute;
  z-index: 0;
  left: 4%;
  right: 4%;
  bottom: 8%;
  height: 17%;
  pointer-events: none;
  clip-path: polygon(10% 0, 90% 0, 100% 78%, 94% 100%, 6% 100%, 0 78%);
  background:
    repeating-linear-gradient(90deg, transparent 0 31px, #a7c9cb17 31px 32px),
    linear-gradient(180deg, #0a1e2799, #0b1b22e6);
  border-bottom: 2px solid #91adb44d;
  box-shadow: inset 0 1px #bedbd92b;
}

#outpost .foundry-bed::before,
#outpost .foundry-bed::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

#outpost .foundry-bed::before {
  left: 8%;
  right: 8%;
  bottom: 21%;
  height: 2px;
  background: linear-gradient(90deg, #efb27d99 0 14%, transparent 14% 18%, #91b9bd4d 18% 82%, transparent 82% 86%, #efb27d99 86%);
}

#outpost .foundry-bed::after {
  left: 10%;
  bottom: 21%;
  width: 22%;
  height: 2px;
  opacity: 0;
  background: linear-gradient(90deg, transparent, var(--foundry-active), transparent);
}

#outpost .orbital-ring {
  z-index: 0;
  left: 8%;
  right: 8%;
  bottom: 12%;
  width: auto;
  height: 7%;
  aspect-ratio: auto;
  border: 0;
  border-top: 1px solid #a4ced130;
  border-bottom: 1px solid #a4ced130;
  border-radius: 0;
  transform: none;
  pointer-events: none;
}

#outpost .orbital-ring::before {
  inset: 5px 8%;
  border: 0;
  border-left: 2px solid #efb27d80;
  border-right: 2px solid #efb27d80;
  border-radius: 0;
}

#outpost .outpost-model figcaption {
  z-index: 2;
  padding: 4px 8px;
  background: #091b22c9;
  border-bottom: 1px solid #a8cbcc40;
}

/* Each plate points to a facility on the original model. */
#outpost .model-label {
  --facility-light: #efb27d;
  --facility-tint: #efb27d1f;
  min-height: 44px;
  border-color: #b3ced34d;
  border-left: 2px solid var(--facility-light);
  background: #0a1d27ed;
  box-shadow: inset 0 1px #e3efec14, 0 5px 12px #0003;
  transition: background .18s, border-color .18s, box-shadow .18s;
}

#outpost .model-label[data-facility="research"] {
  --facility-light: #92dce4;
  --facility-tint: #92dce41f;
}

#outpost .model-label[data-facility="growth"] {
  --facility-light: #e2d4b3;
  --facility-tint: #e2d4b31f;
}

#outpost .model-label > span {
  width: 25px;
  height: 25px;
  border: 1px solid #c4e0df38;
  border-radius: 2px;
  background: var(--facility-tint);
  color: var(--facility-light);
  flex-shrink: 0;
}

#outpost .model-label svg {
  display: block;
  width: 17px;
  height: 17px;
}

#outpost .model-label::before {
  content: "";
  position: absolute;
  width: 34px;
  height: 18px;
  color: var(--facility-light);
  opacity: .5;
  pointer-events: none;
  transition: opacity .18s;
}

#outpost .label-one::before {
  left: 100%;
  top: 50%;
  border-top: 1px solid currentColor;
  border-right: 1px solid currentColor;
}

#outpost .label-two::before {
  right: 100%;
  top: 50%;
  border-top: 1px solid currentColor;
  border-left: 1px solid currentColor;
}

#outpost .label-three::before {
  right: 100%;
  bottom: 50%;
  border-bottom: 1px solid currentColor;
  border-left: 1px solid currentColor;
}

#outpost .model-label:is(:hover, :focus-visible) {
  border-color: var(--facility-light);
  background: #19323bed;
  box-shadow: inset 0 0 0 1px var(--facility-tint), 0 5px 14px #0005;
}

#outpost .model-label:is(:hover, :focus-visible)::before { opacity: 1; }

#outpost .model-label:focus-visible {
  outline: 2px solid var(--facility-light);
  outline-offset: 4px;
}

#outpost .outpost-model:has([data-facility="research"]:is(:hover, :focus-visible)) { --foundry-active: #92dce4; }
#outpost .outpost-model:has([data-facility="growth"]:is(:hover, :focus-visible)) { --foundry-active: #e2d4b3; }
#outpost .outpost-model:has(.model-label:is(:hover, :focus-visible)) > img {
  filter: drop-shadow(0 26px 24px #010a0eae) drop-shadow(0 0 8px #edb57c26);
}

#outpost .outpost-model:has(.model-label:is(:hover, :focus-visible)) .foundry-bed::after {
  animation: foundry-current .7s ease-out both;
}

/* The management entry and service rail remain ordinary game links. */
#outpost .outpost-copy .round-link span {
  border-radius: 1px;
  color: #12242b;
  border-color: #efb27d;
  background: #efb27d;
  transform: none;
}

#outpost .outpost-copy .round-link:is(:hover, :focus-visible) {
  color: #ffd0a6;
  border-bottom-color: #efb27d;
}

#outpost .outpost-copy .round-link:is(:hover, :focus-visible) span {
  background: #ffd0a6;
  transform: translate(2px, -2px);
}

#outpost .outpost-copy .round-link:focus-visible,
#outpost .outpost-links a:focus-visible {
  outline: 2px solid #efb27d;
  outline-offset: 5px;
}

#outpost .outpost-links {
  border-top: 1px solid #acc7c94d;
  border-bottom: 1px solid #acc7c926;
  background: #091c25dc;
}

#outpost .outpost-links a {
  --service-light: #efb27d;
  position: relative;
  transition: background .18s;
}

#outpost .outpost-links a:nth-child(2) { --service-light: #a6d5d8; }
#outpost .outpost-links a:nth-child(3) { --service-light: #e2d4b3; }

#outpost .outpost-links a::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 32px;
  height: 2px;
  background: var(--service-light);
  opacity: .55;
  pointer-events: none;
}

#outpost .outpost-links a:is(:hover, :focus-visible) {
  background: #1b354066;
}

#outpost .outpost-links a:is(:hover, :focus-visible) > span { color: var(--service-light); }

@keyframes foundry-current {
  0% { opacity: 0; transform: translateX(0); }
  25% { opacity: .85; }
  100% { opacity: 0; transform: translateX(250%); }
}

@media (max-width: 760px) {
  #outpost .foundry-bed { bottom: 7%; height: 15%; }
  #outpost .orbital-ring { bottom: 11%; height: 6%; }
  #outpost .outpost-model figcaption { padding: 3px 6px; }
  #outpost .model-label { min-height: 36px; padding: 6px; gap: 5px; }
  #outpost .model-label > span { width: 20px; height: 20px; }
  #outpost .model-label svg { width: 14px; height: 14px; }
  #outpost .model-label::before { width: 14px; height: 9px; opacity: .4; }
  #outpost .model-label:focus-visible { outline-offset: 2px; }
  #outpost .outpost-links a { padding-left: 10px; padding-right: 10px; }
  #outpost .outpost-links a + a { padding-left: 10px; }
  #outpost .outpost-links a::before { width: 24px; }
}

@media (max-width: 370px) {
  #outpost .model-label { padding: 5px; gap: 4px; }
  #outpost .model-label::before { width: 9px; height: 7px; }
}

@media (prefers-reduced-motion: reduce) {
  #outpost .outpost-model > img,
  #outpost .model-label,
  #outpost .model-label::before,
  #outpost .outpost-copy .round-link span,
  #outpost .outpost-links a { transition: none; }
  #outpost .outpost-model:has(.model-label:is(:hover, :focus-visible)) .foundry-bed::after { animation: none; }
  #outpost .outpost-copy .round-link:is(:hover, :focus-visible) span { transform: none; }
}
