/**
 * THE APP MACHINE — inspection view, service panel, and small chrome.
 *
 * The dialog reads as the retrieval bay opening: it rises from the bottom of
 * the machine on a motor curve, with no overshoot.
 */

.bay-dialog,
.info-dialog {
  width: min(880px, 92vw);
  max-height: 86dvh;
  padding: 0;
  border: 0;
  border-radius: 10px;
  overflow: hidden;
  background: none;
  color: #e9eaec;
  /* motor: fast authority in, long settle */
  transition:
    translate var(--dur-drawer) var(--ease-drawer-out),
    opacity 260ms ease,
    display var(--dur-drawer) allow-discrete,
    overlay var(--dur-drawer) allow-discrete;
}

.bay-dialog[open],
.info-dialog[open] {
  translate: 0 0;
  opacity: 1;
}

@starting-style {
  .bay-dialog[open],
  .info-dialog[open] {
    translate: 0 40%;
    opacity: 0;
  }
}

.bay-dialog:not([open]),
.info-dialog:not([open]) {
  translate: 0 40%;
  opacity: 0;
}

.bay-dialog::backdrop,
.info-dialog::backdrop {
  background: rgba(4, 5, 7, 0.74);
  backdrop-filter: blur(2px);
}

/* ====================================================================== */
/* PRODUCT INSPECTION                                                      */
/* ====================================================================== */

.bayview,
.infoview {
  --ink: #c0563f;
  position: relative;
  padding: clamp(16px, 2.4vw, 26px);
  background:
    linear-gradient(180deg, #202429 0%, #16191d 60%, #101316 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    inset 0 0 0 1px rgba(0, 0, 0, 0.6);
}

/* Lit strip along the top, as if the bay light just came on. */
.bayview::before,
.infoview::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--ink), transparent);
  opacity: 0.9;
}

.bayview__head,
.infoview__head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.bayview__code,
.infoview__code {
  margin: 0;
  padding: 4px 8px;
  border-radius: 2px;
  background: var(--display-bg);
  color: var(--display-amber);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-shadow: 0 0 6px rgba(255, 180, 84, 0.5);
}

.bayview__id {
  flex: 1 1 auto;
  min-width: 0;
}

.bayview__name,
.infoview__name {
  margin: 0;
  font-family: var(--font-marque);
  font-size: clamp(1.15rem, 3.2vw, 1.85rem);
  font-weight: 800;
  letter-spacing: 0.01em;
  line-height: 1;
  text-transform: uppercase;
}

.bayview__kind {
  margin: 3px 0 0;
  color: rgba(233, 234, 236, 0.5);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.bayview__close {
  flex: 0 0 auto;
  padding: 6px 12px;
  border: 0;
  border-radius: 2px;
  background: linear-gradient(180deg, #4a5058, #2c3136);
  color: rgba(236, 238, 240, 0.8);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  cursor: pointer;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    inset 0 -1px 0 rgba(0, 0, 0, 0.55);
  transition: transform var(--dur-release) var(--ease-release), color 160ms ease;
}

.bayview__close:hover {
  color: #fff;
}

.bayview__close:active {
  transform: translateY(1px);
  transition-duration: var(--dur-press);
}

.bayview__grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: clamp(14px, 2.4vw, 24px);
  padding: 18px 0;
}

.bayview__figure {
  margin: 0;
  border-radius: 4px;
  overflow: hidden;
  background: #0c0e10;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.08),
    0 10px 30px -12px rgba(0, 0, 0, 0.9);
}

.bayview__art {
  display: block;
  width: 100%;
  aspect-ratio: 144 / 100;
  object-fit: cover;
  object-position: top center;
}

.bayview__art--none {
  display: grid;
  place-items: center;
  aspect-ratio: 144 / 100;
  color: rgba(255, 255, 255, 0.22);
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.2em;
}

.bayview__copy {
  min-width: 0;
}

.bayview__tease {
  margin: 0 0 8px;
  color: #f2f3f4;
  font-size: 1.02rem;
  font-weight: 500;
  line-height: 1.35;
}

.bayview__summary {
  margin: 0 0 10px;
  color: rgba(233, 234, 236, 0.72);
  font-size: 0.88rem;
  line-height: 1.5;
}

.bayview__callout {
  margin: 0 0 14px;
  padding-left: 10px;
  border-left: 2px solid var(--ink);
  color: rgba(233, 234, 236, 0.5);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  line-height: 1.5;
}

.bayview__meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 14px;
  margin: 0;
}

.bayview__meta div {
  min-width: 0;
}

.bayview__meta dt {
  color: rgba(233, 234, 236, 0.36);
  font-family: var(--font-mono);
  font-size: 0.56rem;
  letter-spacing: 0.16em;
}

.bayview__meta dd {
  margin: 2px 0 0;
  color: rgba(233, 234, 236, 0.85);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bayview__actions {
  display: flex;
  justify-content: flex-end;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.bayview__launch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: 3px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--ink) 82%, white 18%), var(--ink));
  color: #fff;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-decoration: none;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.3),
    inset 0 -2px 0 rgba(0, 0, 0, 0.35),
    0 4px 14px -4px rgba(0, 0, 0, 0.8);
  transition: transform var(--dur-release) var(--ease-release), filter 160ms ease;
}

.bayview__launch:hover {
  filter: brightness(1.1);
}

.bayview__launch:active {
  transform: translateY(1.5px);
  transition-duration: var(--dur-press);
}

.bayview__launch--off {
  background: #2a2e33;
  color: rgba(255, 255, 255, 0.4);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  cursor: not-allowed;
}

/* ====================================================================== */
/* SERVICE PANEL                                                           */
/* ====================================================================== */

.info-dialog {
  width: min(560px, 92vw);
}

.infoview__head {
  justify-content: space-between;
}

.infoview__name {
  margin: 16px 0 8px;
}

.infoview__body {
  margin: 0 0 16px;
  color: rgba(233, 234, 236, 0.74);
  font-size: 0.92rem;
  line-height: 1.55;
}

.infoview__links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 18px;
  padding: 0;
  list-style: none;
}

.infoview__links a {
  display: inline-block;
  padding: 7px 13px;
  border-radius: 2px;
  background: linear-gradient(180deg, #3a4048, #23272b);
  color: rgba(236, 238, 240, 0.86);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-decoration: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

.infoview__links a:hover {
  color: #fff;
}

.infoview__plate {
  margin: 0;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(233, 234, 236, 0.3);
  font-family: var(--font-mono);
  font-size: 0.56rem;
  letter-spacing: 0.1em;
  line-height: 1.7;
}

/* ====================================================================== */
/* SERVICE ACCESS + NOSCRIPT                                               */
/* ====================================================================== */

.service-link {
  position: fixed;
  right: 10px;
  bottom: 10px;
  z-index: 20;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.04);
  transition: color 200ms ease, background 200ms ease;
}

.service-link:hover,
.service-link:focus-visible {
  color: rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.09);
}

.fallback-list {
  padding: 24px;
  font-family: var(--font-ui);
}

/* ====================================================================== */
/* RESPONSIVE                                                              */
/* ====================================================================== */

@media (max-width: 720px) {
  /* Inspection becomes a bottom sheet on touch. */
  .bay-dialog,
  .info-dialog {
    width: 100vw;
    max-width: none;
    max-height: 88dvh;
    margin: 0;
    margin-top: auto;
    border-radius: 12px 12px 0 0;
  }

  .bayview__grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .bayview__actions {
    justify-content: stretch;
  }

  .bayview__launch {
    flex: 1 1 auto;
    justify-content: center;
    padding: 14px 22px;
  }
}
