/*
 * deepinthe.space , Voyager 1 and Voyager 2 mission field notes.
 * The live panel is fed by /api/voyager, which normalizes NASA/JPL
 * Horizons geometric state vectors. All local positions are in AU.
 */
.voyager-medallion {
  background:
    radial-gradient(circle at 47% 42%, rgba(255, 227, 154, 0.2), transparent 33%),
    radial-gradient(circle at 50% 50%, #172137, #090d17 72%);
}

.voyager-medallion::after {
  inset: 9%;
  border-color: rgba(236, 215, 155, 0.2);
  border-style: dashed;
}

.voyager-live {
  position: relative;
  margin-top: 34px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--line));
  border-radius: 18px;
  background:
    radial-gradient(circle at 10% 18%, rgba(228, 190, 100, 0.08), transparent 34%),
    linear-gradient(145deg, rgba(18, 24, 38, 0.94), rgba(8, 11, 19, 0.94));
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.2);
}

.voyager-live::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(199, 218, 244, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(199, 218, 244, 0.025) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: linear-gradient(to bottom, black, transparent 85%);
}

.voyager-live-head {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 21px 17px;
  border-bottom: 1px solid var(--line);
}

.voyager-live-head h2 {
  margin: 0 0 5px;
}

.voyager-live-head p {
  max-width: 610px;
  margin: 0;
  font-size: 11px;
  line-height: 1.65;
}

.voyager-live-status {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 10px;
  border: 1px solid rgba(126, 218, 164, 0.28);
  border-radius: 999px;
  background: rgba(72, 180, 119, 0.08);
  color: rgba(185, 239, 207, 0.92);
  font-size: 8.5px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  white-space: nowrap;
}

.voyager-live-status::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #7bdca2;
  box-shadow: 0 0 10px rgba(123, 220, 162, 0.65);
}

.voyager-live-status.is-fallback {
  border-color: rgba(229, 196, 115, 0.25);
  background: rgba(229, 196, 115, 0.07);
  color: rgba(245, 220, 157, 0.88);
}

.voyager-live-status.is-fallback::before {
  background: #e5c473;
  box-shadow: 0 0 10px rgba(229, 196, 115, 0.5);
}

.voyager-live-body {
  position: relative;
  z-index: 1;
  padding: 19px 21px 20px;
}

.voyager-live-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--line);
}

.voyager-live-metric {
  min-width: 0;
  padding: 14px 14px 13px;
  background: rgba(9, 13, 22, 0.9);
}

.voyager-live-metric span {
  display: block;
  color: var(--dim);
  font-size: 8px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.voyager-live-metric strong {
  display: block;
  margin-top: 7px;
  color: var(--white);
  font-size: 18px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.015em;
  line-height: 1.1;
}

.voyager-live-metric strong span {
  display: inline;
  margin: 0;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-transform: none;
}

.voyager-live-metric small {
  display: block;
  margin-top: 4px;
  overflow: hidden;
  color: var(--dim);
  font-size: 8.5px;
  font-variant-numeric: tabular-nums;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.voyager-live-track {
  position: relative;
  height: 60px;
  margin: 20px 2px 4px;
}

.voyager-live-track::before {
  content: "";
  position: absolute;
  top: 28px;
  left: 4px;
  right: 4px;
  height: 1px;
  background: linear-gradient(90deg, rgba(255, 201, 109, 0.75), rgba(157, 200, 238, 0.28) 32%, rgba(157, 200, 238, 0.1));
}

.voyager-live-sun,
.voyager-live-oort {
  position: absolute;
  top: 21px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
}

.voyager-live-sun {
  left: 0;
  background: #ffc76e;
  box-shadow: 0 0 16px rgba(255, 190, 91, 0.7);
}

.voyager-live-oort {
  right: 0;
  width: 46px;
  border: 1px dashed rgba(168, 193, 227, 0.26);
  border-radius: 50%;
  transform: translateX(3px);
}

.voyager-live-track-label {
  position: absolute;
  top: 41px;
  color: var(--dim);
  font-size: 8px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.voyager-live-track-label:first-of-type {
  left: 0;
}

.voyager-live-track-label:last-of-type {
  right: 0;
  text-align: right;
}

.voyager-track-probe {
  position: absolute;
  top: 18px;
  left: clamp(1%, var(--probe-track, 50%), 99%);
  width: 19px;
  height: 19px;
  border: 1px solid rgba(255, 231, 174, 0.75);
  border-radius: 50%;
  background: rgba(224, 195, 125, 0.15);
  box-shadow: 0 0 0 5px rgba(224, 195, 125, 0.06), 0 0 18px rgba(224, 195, 125, 0.28);
  transform: translate(-50%, 0);
}

.voyager-track-probe::after {
  content: "";
  position: absolute;
  top: 6px;
  left: 6px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #f4d68e;
}

.voyager-live-foot {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-top: 12px;
  color: var(--dim);
  font-size: 8.5px;
  line-height: 1.6;
}

.voyager-live-foot p {
  margin: 0;
  font-size: inherit;
  line-height: inherit;
}

.voyager-live-foot a {
  flex: 0 0 auto;
  color: var(--soft);
}

.voyager-live-method {
  margin-top: 12px;
  padding-top: 11px;
  border-top: 1px solid var(--line);
  color: var(--dim);
  font-size: 9px;
  line-height: 1.65;
}

.voyager-live-method summary {
  width: max-content;
  max-width: 100%;
  color: var(--soft);
  cursor: pointer;
}

.voyager-live-method p {
  margin: 8px 0 0;
  font-size: 9.5px;
  line-height: 1.7;
}

.voyager-photo-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.voyager-photo-grid .planet-photo:only-child {
  grid-column: 1 / -1;
}

.voyager-photo-grid .planet-photo img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.voyager-challenge-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 17px;
}

.voyager-challenge-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface);
}

.voyager-challenge-card strong {
  display: block;
  margin-bottom: 7px;
  color: var(--text);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.voyager-challenge-card p {
  margin: 0;
  color: var(--text-soft);
  font-size: 11px;
  line-height: 1.7;
}

.voyager-command-flow {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 18px 0;
  padding: 0;
  list-style: none;
  counter-reset: command-step;
}

.voyager-command-flow li {
  position: relative;
  min-height: 94px;
  margin: 0;
  padding: 14px 13px 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.022);
  counter-increment: command-step;
}

.voyager-command-flow li::before {
  content: "0" counter(command-step);
  display: block;
  margin-bottom: 9px;
  color: color-mix(in srgb, var(--accent) 70%, white);
  font-size: 8px;
  letter-spacing: 0.07em;
}

.voyager-command-flow strong {
  display: block;
  margin-bottom: 5px;
  font-size: 10.5px;
}

.voyager-command-flow span {
  color: var(--dim);
  font-size: 9.5px;
  line-height: 1.55;
}

.voyager-command-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(220px, 0.6fr);
  gap: 14px;
  align-items: stretch;
}

.voyager-command-panel .media-module {
  margin: 0;
}

.voyager-command-panel .media-module-head h3 {
  margin: 0;
  color: var(--text-dim);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.voyager-command-side {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: color-mix(in srgb, var(--accent) 5%, var(--surface));
}

.voyager-command-side strong {
  display: block;
  margin-bottom: 8px;
  color: var(--text);
  font-size: 11px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.voyager-command-side p {
  margin: 0;
  font-size: 10.5px;
  line-height: 1.7;
}

.voyager-mission-list {
  display: grid;
  gap: 0;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
}

.voyager-mission-list li {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 18px;
  margin: 0;
  padding: 13px 15px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.015);
}

.voyager-mission-list li:last-child {
  border-bottom: 0;
}

.voyager-mission-list time {
  color: color-mix(in srgb, var(--accent) 62%, white);
  font-size: 9px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.07em;
  line-height: 1.7;
  text-transform: uppercase;
}

.voyager-mission-list span {
  color: var(--text-soft);
  font-size: 11px;
  line-height: 1.7;
}

.voyager-comparison {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 13px;
}

.voyager-comparison table {
  width: 100%;
  min-width: 500px;
  border-collapse: collapse;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.voyager-comparison th,
.voyager-comparison td {
  padding: 11px 13px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.voyager-comparison th {
  color: var(--dim);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.voyager-comparison td {
  color: var(--text-soft);
}

.voyager-comparison tr:last-child td {
  border-bottom: 0;
}

[data-theme="light"] .voyager-live {
  background:
    radial-gradient(circle at 10% 18%, rgba(205, 160, 54, 0.14), transparent 34%),
    linear-gradient(145deg, rgba(251, 249, 243, 0.98), rgba(241, 245, 249, 0.96));
}

[data-theme="light"] .voyager-live-metric {
  background: rgba(255, 255, 255, 0.88);
}

@media (max-width: 760px) {
  .voyager-live-head {
    display: grid;
    gap: 12px;
    padding: 17px 16px 15px;
  }

  .voyager-live-status {
    width: max-content;
  }

  .voyager-live-body {
    padding: 15px 16px 17px;
  }

  .voyager-live-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .voyager-live-foot {
    display: grid;
    gap: 6px;
  }

  .voyager-photo-grid,
  .voyager-challenge-grid,
  .voyager-command-panel {
    grid-template-columns: 1fr;
  }

  .voyager-command-flow {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .voyager-mission-list li {
    grid-template-columns: 82px minmax(0, 1fr);
    gap: 12px;
  }
}

@media (max-width: 430px) {
  .voyager-live-metric {
    padding: 12px 11px;
  }

  .voyager-live-metric strong {
    font-size: 15px;
  }

  .voyager-command-flow {
    grid-template-columns: 1fr;
  }

  .voyager-mission-list li {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .voyager-track-probe {
    transition: none;
  }
}
