/**
 * Planetarium SpaceX rockets + launch dates
 * Development work by David Lane
 */
body.plan-spacex {
  --sx-steel: #c9d0d8;
  --sx-white: #f4f6f8;
  --sx-soot: #1a1d22;
  --sx-flame: #ff8a3d;
  --sx-ok: #7dffb3;
  --sx-fail: #ff8b8b;
  --sx-wait: #ffd278;
}

.sx-wrap {
  position: relative;
}

.sx-wrap::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background:
    radial-gradient(1px 1px at 12% 18%, rgba(255, 255, 255, 0.55), transparent),
    radial-gradient(1px 1px at 78% 12%, rgba(255, 255, 255, 0.4), transparent),
    radial-gradient(1.5px 1.5px at 62% 36%, rgba(255, 210, 120, 0.45), transparent),
    radial-gradient(1px 1px at 28% 64%, rgba(255, 255, 255, 0.35), transparent),
    radial-gradient(1px 1px at 88% 72%, rgba(255, 255, 255, 0.5), transparent),
    radial-gradient(ellipse 70% 40% at 50% -8%, rgba(70, 90, 140, 0.28), transparent 58%);
}

.sx-status {
  min-height: 1.2rem;
  margin: 0 0 0.85rem;
  font-size: 0.8rem;
  color: rgba(157, 255, 196, 0.88);
}

.sx-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr));
  gap: 0.65rem;
  margin: 0 0 1.5rem;
}

.sx-stat {
  padding: 0.7rem 0.85rem 0.75rem;
  border-radius: 0.7rem;
  border: 1px solid var(--plan-line);
  background: var(--plan-glass);
}

.sx-stat__kicker {
  display: block;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--plan-muted);
  margin-bottom: 0.15rem;
}

.sx-stat strong {
  display: block;
  font-family: Fraunces, Georgia, serif;
  font-size: 1.15rem;
  font-weight: 560;
  line-height: 1.2;
}

.sx-section-title {
  font-family: Fraunces, Georgia, serif;
  font-size: 1.25rem;
  font-weight: 560;
  margin: 0 0 0.85rem;
}

.sx-rocket-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.85rem;
  margin-bottom: 2rem;
}

@media (max-width: 991.98px) {
  .sx-rocket-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 575.98px) {
  .sx-rocket-grid {
    grid-template-columns: 1fr;
  }
}

.sx-card {
  perspective: 1200px;
  -webkit-perspective: 1200px;
  isolation: isolate;
  width: 100%;
  padding: 0;
  border: none;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.sx-card:focus-visible {
  outline: 2px solid rgba(255, 210, 120, 0.7);
  outline-offset: 4px;
  border-radius: 0.9rem;
}

.sx-card-inner {
  position: relative;
  width: 100%;
  transform-style: preserve-3d;
  -webkit-transform-style: preserve-3d;
  transition: transform 0.5s ease-out;
}

.sx-card.is-flipped .sx-card-inner {
  transform: rotateY(180deg);
}

.sx-face {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 0.85rem 0.9rem 1rem;
  border-radius: 0.9rem;
  border: 1px solid var(--plan-line);
  background:
    linear-gradient(180deg, rgba(18, 24, 40, 0.94), rgba(8, 10, 18, 0.96));
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  overflow: hidden;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.28);
}

.sx-face--front {
  position: relative;
  z-index: 2;
  opacity: 1;
  visibility: visible;
}

.sx-face--back {
  position: absolute;
  inset: 0;
  -webkit-transform: rotateY(180deg) translateZ(0);
  transform: rotateY(180deg) translateZ(0);
  z-index: 1;
  opacity: 0;
  visibility: hidden;
  overflow: auto;
}

.sx-card.is-flipped .sx-face--front {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  z-index: 0;
}

.sx-card.is-flipped .sx-face--back {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  z-index: 3;
}

.sx-card:hover .sx-face--front,
.sx-card:focus-visible .sx-face--front,
.sx-card.is-active .sx-face--front,
.sx-card.is-flipped .sx-face--back {
  border-color: rgba(255, 210, 120, 0.55);
  box-shadow: 0 0 0 1px rgba(255, 210, 120, 0.18);
}

.sx-pad {
  position: relative;
  margin: 0 0 1.75rem;
  min-height: min(32rem, 72vh);
  border-radius: 1rem;
  overflow: hidden;
  border: 1px solid rgba(255, 210, 120, 0.22);
  background: #05070f;
  box-shadow:
    0 24px 64px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(255, 210, 120, 0.08);
}

.sx-pad__stage {
  position: relative;
  height: min(32rem, 72vh);
  min-height: 20rem;
}

.sx-pad__canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}

.sx-pad__still {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 62%;
}

.sx-pad__hud {
  position: absolute;
  left: 1rem;
  bottom: 1rem;
  z-index: 2;
  max-width: 18rem;
  padding: 0.85rem 1rem 1rem;
  border-radius: 0.85rem;
  border: 1px solid rgba(255, 210, 120, 0.28);
  background: rgba(6, 9, 16, 0.72);
  backdrop-filter: blur(10px);
  pointer-events: auto;
}

.sx-pad__kicker {
  margin: 0 0 0.15rem;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255, 210, 120, 0.75);
}

.sx-pad__title {
  margin: 0;
  font-family: Fraunces, Georgia, serif;
  font-size: 1.45rem;
  font-weight: 560;
}

.sx-pad__phase {
  margin: 0.15rem 0 0;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sx-flame);
}

.sx-pad__clock {
  margin: 0.1rem 0 0.7rem;
  font-variant-numeric: tabular-nums;
  font-size: 0.95rem;
  color: var(--sx-ok);
}

.sx-hangar {
  margin: 0 0 1.85rem;
}

.sx-hangar__stage {
  display: grid;
  grid-template-columns: 11.5rem minmax(0, 1fr) 11.5rem;
  gap: 1rem 1.15rem;
  align-items: start;
  padding: 1rem 1.05rem 1.1rem;
  border-radius: 1rem;
  border: 1px solid rgba(125, 255, 179, 0.22);
  background:
    radial-gradient(ellipse 55% 80% at 8% 50%, rgba(90, 255, 170, 0.12), transparent 58%),
    radial-gradient(ellipse 55% 80% at 92% 50%, rgba(255, 138, 61, 0.12), transparent 58%),
    linear-gradient(180deg, rgba(12, 18, 32, 0.94), rgba(6, 8, 16, 0.96));
  box-shadow:
    0 18px 48px rgba(0, 0, 0, 0.35),
    0 0 0 1px rgba(255, 210, 120, 0.06);
}

.sx-who {
  margin: 0;
  min-width: 0;
  text-align: center;
}

.sx-who__photo {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
  object-position: center 12%;
  border-radius: 1.15rem;
  border: 2px solid rgba(160, 190, 235, 0.22);
  background: #070b14;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
}

.sx-who figcaption {
  margin-top: 0.55rem;
}

.sx-who__name {
  display: block;
  font-family: Fraunces, Georgia, serif;
  font-size: 1.05rem;
  font-weight: 560;
}

.sx-who__role {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--plan-muted);
}

.sx-who--zigzag .sx-who__photo {
  object-position: center 22%;
}

.sx-who--zigzag.is-speaking .sx-who__photo {
  border-color: rgba(125, 255, 179, 0.85);
  box-shadow:
    0 0 0 3px rgba(125, 255, 179, 0.22),
    0 0 28px rgba(90, 255, 170, 0.35);
}

.sx-who--elon.is-speaking .sx-who__photo {
  border-color: rgba(255, 138, 61, 0.9);
  box-shadow:
    0 0 0 3px rgba(255, 138, 61, 0.22),
    0 0 28px rgba(255, 138, 61, 0.32);
}

.sx-hangar__kicker {
  margin: 0 0 0.2rem;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(125, 255, 179, 0.78);
}

.sx-hangar__title {
  margin: 0 0 0.55rem;
  font-family: Fraunces, Georgia, serif;
  font-size: 1.35rem;
  font-weight: 560;
}

.sx-hangar__speaker {
  margin: 0 0 0.2rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--sx-wait);
}

.sx-hangar__line {
  margin: 0 0 0.85rem;
  min-height: 4.4rem;
  font-size: 1.02rem;
  line-height: 1.45;
  color: var(--sx-white);
}

.sx-hangar__controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.sx-hangar__status {
  margin: 0.55rem 0 0;
  font-size: 0.72rem;
  color: var(--plan-muted);
}

.sx-hangar__note {
  margin: 0.35rem 0 0;
  font-size: 0.7rem;
  color: var(--plan-muted);
}

@media (max-width: 767.98px) {
  .sx-hangar__stage {
    grid-template-columns: 1fr 1fr;
  }

  .sx-hangar__script {
    grid-column: 1 / -1;
    order: 3;
  }

  .sx-hangar__line {
    min-height: 0;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .sx-who.is-speaking .sx-who__photo {
    animation: sx-speak 1.8s ease-in-out infinite;
  }
}

@keyframes sx-speak {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-3px);
  }
}

.sx-card__shot {
  position: relative;
  display: block;
  height: auto;
  aspect-ratio: 3 / 4;
  border-radius: 0.65rem;
  overflow: hidden;
  border: 1px solid rgba(160, 190, 235, 0.12);
  background: #070b14;
}

.sx-card__photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  z-index: 1;
}

.sx-card[data-rocket='falcon-9'] .sx-card__photo {
  object-position: center 18%;
}

.sx-card[data-rocket='starship'] .sx-card__photo {
  object-position: center 20%;
}

.sx-card__shot-shade {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    linear-gradient(180deg, transparent 42%, rgba(5, 7, 15, 0.72) 100%),
    radial-gradient(circle at 50% 18%, rgba(255, 210, 120, 0.08), transparent 48%);
}

.sx-card__yt {
  position: absolute;
  right: 0.55rem;
  bottom: 0.55rem;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
  background: rgba(8, 10, 16, 0.82);
  border: 1px solid rgba(255, 80, 80, 0.55);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
}

.sx-card__yt:hover,
.sx-card__yt:focus-visible {
  background: #c4302b;
  border-color: #ff6b6b;
  outline: none;
}

.sx-card__flip-hint {
  margin: 0;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 210, 120, 0.72);
}

.sx-card__kicker {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sx-wait);
}

.sx-card__video {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 0.55rem;
  background: #070b14;
  border: 1px solid rgba(160, 190, 235, 0.16);
}

.sx-card__video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.sx-card__facts {
  display: grid;
  gap: 0.35rem 0.7rem;
  margin: 0;
}

.sx-card__facts div {
  display: grid;
  grid-template-columns: 6.5rem minmax(0, 1fr);
  gap: 0.35rem;
  font-size: 0.78rem;
}

.sx-card__facts dt {
  margin: 0;
  color: var(--plan-muted);
  font-weight: 700;
}

.sx-card__facts dd {
  margin: 0;
}

.sx-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: auto;
}

.sx-card__wiki {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--plan-line);
  color: inherit;
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 600;
}

.sx-carl {
  margin: 0 0 1.75rem;
  padding: 0.95rem 1.05rem 1.05rem;
  border-radius: 1rem;
  border: 1px solid rgba(125, 255, 179, 0.22);
  background: var(--plan-glass);
}

.sx-carl__lead {
  margin: 0 0 0.7rem;
  color: var(--plan-muted);
  font-size: 0.88rem;
}

@media (max-width: 767.98px), (hover: none) and (pointer: coarse), (prefers-reduced-motion: reduce) {
  .sx-card {
    perspective: none;
    -webkit-perspective: none;
  }

  .sx-card-inner {
    transform-style: flat;
    -webkit-transform-style: flat;
  }

  .sx-card.is-flipped .sx-card-inner {
    transform: none;
  }

  .sx-face--front,
  .sx-face--back {
    -webkit-transform: none !important;
    transform: none !important;
    backface-visibility: visible;
    -webkit-backface-visibility: visible;
    position: relative;
    inset: auto;
  }

  .sx-face--back {
    display: none;
  }

  .sx-card.is-flipped .sx-face--front {
    display: none;
  }

  .sx-card.is-flipped .sx-face--back {
    display: flex;
  }
}

.sx-card__shot .sx-vehicle {
  z-index: 0;
  opacity: 0.35;
}

.sx-card__pad::after {
  content: none;
}

.sx-vehicle {
  position: absolute;
  left: 50%;
  bottom: 1.35rem;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  transform: translateX(-50%);
  transform-origin: 50% 100%;
}

.sx-vehicle__core {
  position: relative;
  width: 0.72rem;
  height: 8.2rem;
  background: linear-gradient(90deg, #d7dde4, var(--sx-white) 40%, #b8c0c8);
  border-radius: 0.28rem 0.28rem 0.1rem 0.1rem;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12);
}

.sx-vehicle__core::before {
  content: '';
  position: absolute;
  left: 50%;
  top: -0.85rem;
  width: 0.55rem;
  height: 1.05rem;
  transform: translateX(-50%);
  background: var(--sx-white);
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
}

.sx-vehicle__core::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 1.7rem;
  height: 0.85rem;
  background: var(--sx-soot);
}

.sx-vehicle--f1 .sx-vehicle__core {
  height: 5.4rem;
  width: 0.62rem;
}

.sx-vehicle--fh {
  gap: 0.12rem;
}

.sx-vehicle--fh .sx-vehicle__core {
  height: 7.4rem;
}

.sx-vehicle--fh .sx-vehicle__core:nth-child(2) {
  height: 8.2rem;
}

.sx-vehicle--ss .sx-vehicle__core {
  width: 1.15rem;
  height: 7.6rem;
  background: linear-gradient(90deg, #8f969e, var(--sx-steel) 45%, #6e757c);
  border-radius: 0.55rem 0.55rem 0.15rem 0.15rem;
}

.sx-vehicle--ss .sx-vehicle__core::before {
  width: 0.95rem;
  height: 1.35rem;
  background: var(--sx-steel);
}

.sx-vehicle--ss .sx-vehicle__core::after {
  top: auto;
  bottom: 1.6rem;
  height: 0.2rem;
  background: rgba(20, 20, 24, 0.55);
}

.sx-vehicle__fin {
  position: absolute;
  bottom: 2.1rem;
  width: 0.55rem;
  height: 1.4rem;
  background: var(--sx-steel);
  clip-path: polygon(0 0, 100% 30%, 100% 100%, 0 100%);
}

.sx-vehicle__fin--l {
  left: -0.45rem;
}

.sx-vehicle__fin--r {
  right: -0.45rem;
  transform: scaleX(-1);
}

.sx-vehicle__flame {
  position: absolute;
  left: 50%;
  bottom: -0.55rem;
  width: 0.38rem;
  height: 0.7rem;
  transform: translateX(-50%);
  background: radial-gradient(circle at 50% 0, #ffe9a8, var(--sx-flame) 55%, transparent 75%);
  border-radius: 50%;
  opacity: 0.85;
}

@media (prefers-reduced-motion: no-preference) {
  .sx-card:hover .sx-vehicle,
  .sx-card:focus-visible .sx-vehicle,
  .sx-card.is-active .sx-vehicle {
    animation: sx-lift 1.8s ease-in-out infinite;
  }
}

@keyframes sx-lift {
  0%,
  100% {
    transform: translateX(-50%) translateY(0);
  }
  50% {
    transform: translateX(-50%) translateY(-6px);
  }
}

.sx-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}

.sx-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid var(--plan-line);
  color: var(--plan-muted);
}

.sx-badge--active {
  color: var(--sx-ok);
  border-color: rgba(125, 255, 179, 0.35);
}

.sx-badge--retired {
  color: var(--plan-muted);
}

.sx-badge--development {
  color: var(--sx-wait);
  border-color: rgba(255, 210, 120, 0.4);
}

.sx-card h3 {
  margin: 0;
  font-family: Fraunces, Georgia, serif;
  font-size: 1.15rem;
  font-weight: 560;
}

.sx-card__date {
  margin: 0;
  font-size: 0.8rem;
  color: var(--sx-wait);
}

.sx-card__desc {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--plan-muted);
}

.sx-card__count {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 600;
}

.sx-launches__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.35rem 1rem;
}

.sx-launches__count {
  margin: 0 0 0.85rem;
  font-size: 0.8rem;
  color: var(--plan-muted);
}

.sx-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 0.7rem;
  align-items: center;
  margin-bottom: 0.85rem;
}

.sx-search {
  position: relative;
  flex: 1 1 16rem;
}

.sx-search i {
  position: absolute;
  left: 0.7rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--plan-muted);
  pointer-events: none;
}

.sx-search input,
.sx-year select {
  width: 100%;
  border-radius: 999px;
  border: 1px solid var(--plan-line);
  background: rgba(8, 12, 22, 0.72);
  color: var(--plan-ink);
  padding: 0.45rem 0.85rem 0.45rem 2rem;
  font-size: 0.85rem;
}

.sx-year {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  color: var(--plan-muted);
}

.sx-year select {
  width: auto;
  padding-left: 0.7rem;
  min-width: 7.5rem;
}

.sx-search input:focus-visible,
.sx-year select:focus-visible {
  outline: none;
  border-color: rgba(255, 210, 120, 0.55);
}

.sx-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.sx-chip {
  border-radius: 999px;
  border: 1px solid var(--plan-line);
  background: var(--plan-glass);
  color: var(--plan-ink);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.28rem 0.7rem;
  white-space: nowrap;
}

.sx-chip[aria-pressed='true'],
.sx-chip:hover,
.sx-chip:focus-visible {
  border-color: rgba(255, 210, 120, 0.55);
  color: #fff;
  outline: none;
}

.sx-table-wrap {
  overflow-x: auto;
  border-radius: 0.75rem;
  border: 1px solid var(--plan-line);
  background: rgba(6, 9, 16, 0.72);
}

.sx-table {
  width: 100%;
  margin: 0;
  border-collapse: collapse;
  font-size: 0.84rem;
}

.sx-table th,
.sx-table td {
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid rgba(160, 190, 235, 0.12);
  vertical-align: top;
}

.sx-table th {
  position: sticky;
  top: 0;
  background: #0c121e;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--plan-muted);
  z-index: 1;
}

.sx-table tbody tr:hover td {
  background: rgba(255, 210, 120, 0.06);
}

.sx-table tbody tr.is-year-start td {
  border-top: 1px solid rgba(255, 210, 120, 0.22);
}

.sx-date {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.sx-date small {
  display: block;
  color: var(--plan-muted);
  font-size: 0.7rem;
}

.sx-outcome {
  font-weight: 700;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.sx-outcome--success {
  color: var(--sx-ok);
}

.sx-outcome--failure,
.sx-outcome--partial {
  color: var(--sx-fail);
}

.sx-outcome--go,
.sx-outcome--tbc,
.sx-outcome--tbd {
  color: var(--sx-wait);
}

.sx-empty {
  margin: 1rem 0.75rem;
  color: var(--plan-muted);
}

@media (max-width: 575.98px) {
  .sx-pad__hud {
    left: 0.65rem;
    right: 0.65rem;
    max-width: none;
    bottom: 0.65rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sx-card:hover .sx-vehicle,
  .sx-card:focus-visible .sx-vehicle,
  .sx-card.is-active .sx-vehicle,
  .sx-who.is-speaking .sx-who__photo {
    animation: none;
  }
}
