:root {
  color-scheme: light;
  font-family: Montserrat, Arial, Helvetica, sans-serif;
  background: #f2f4f5;
  color: #161d21;
  --accent: #ffcd11;
  --dark: #171717;
  --muted: #5d6b72;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
}

.site-header {
  background: var(--dark);
  border-bottom: 5px solid var(--accent);
  color: white;
  padding: 28px 18px;
  text-align: center;
  text-transform: uppercase;
}

.eyebrow {
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  margin: 0 0 8px;
}

h1 {
  font-size: 22px;
  line-height: 1.25;
  margin: 0;
}

.site-header p:last-child {
  margin: 8px 0 0;
  text-transform: none;
}

.page {
  margin: 0 auto;
  max-width: 980px;
  padding: 28px 16px;
}

.camera-list {
  display: grid;
  gap: 24px;
}

.camera-card {
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, .12);
  overflow: hidden;
}

.camera-head {
  align-items: center;
  background: var(--dark);
  color: white;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 14px 16px;
}

.camera-head h2 {
  color: var(--accent);
  font-size: 18px;
  margin: 0;
  text-transform: uppercase;
}

.quality {
  background: var(--accent);
  border-radius: 4px;
  color: #000;
  font-size: 12px;
  font-weight: 900;
  padding: 5px 9px;
}

.viewer {
  aspect-ratio: 16 / 9;
  background: #000;
  overflow: hidden;
  position: relative;
  width: 100%;
}

.player-mount,
.placeholder {
  inset: 0;
  position: absolute;
}

.player-mount {
  background: #000;
}

.placeholder {
  align-items: center;
  color: white;
  display: flex;
  justify-content: center;
  padding: 20px;
  text-align: center;
}

.intro-sequence {
  background: #05070a;
  color: white;
  inset: 0;
  overflow: hidden;
  position: absolute;
  z-index: 5;
}

.intro-map-stage,
.intro-space-stage,
.intro-final-fade {
  inset: 0;
  position: absolute;
}

.intro-map-stage {
  animation: map-stage-out 8.2s ease-in-out forwards;
  background: #111;
  background-image: url("/assets/map-location.png");
  background-position: center;
  background-size: cover;
  transform-origin: center;
}

.intro-map {
  border: 0;
  filter: saturate(1.15) contrast(1.08);
  height: 100%;
  inset: 0;
  opacity: .78;
  position: absolute;
  transform: scale(1.08);
  width: 100%;
}

.intro-map-shade {
  background:
    linear-gradient(90deg, rgba(0, 0, 0, .44), rgba(0, 0, 0, .06), rgba(0, 0, 0, .36)),
    linear-gradient(0deg, rgba(0, 0, 0, .42), transparent 38%, rgba(0, 0, 0, .26));
  inset: 0;
  position: absolute;
}

.intro-location-pulse {
  background: #e40016;
  border: 2px solid white;
  border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(228, 0, 22, .78), 0 0 24px rgba(228, 0, 22, .86);
  height: 18px;
  left: 50%;
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 18px;
}

.intro-location-pulse::before,
.intro-location-pulse::after {
  border: 1px solid rgba(255, 255, 255, .85);
  border-radius: 50%;
  content: "";
  inset: -18px;
  opacity: 0;
  position: absolute;
}

.intro-location-pulse {
  animation: pulse-dot 1.05s ease-out infinite;
}

.intro-location-pulse::before {
  animation: pulse-ring 1.8s ease-out infinite;
}

.intro-location-pulse::after {
  animation: pulse-ring 1.8s ease-out .48s infinite;
}

.intro-crosshair {
  border: 1px solid rgba(255, 255, 255, .54);
  border-radius: 50%;
  height: 110px;
  left: 50%;
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 110px;
}

.intro-crosshair::before,
.intro-crosshair::after {
  background: rgba(255, 255, 255, .64);
  content: "";
  left: 50%;
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
}

.intro-crosshair::before {
  height: 1px;
  width: 140px;
}

.intro-crosshair::after {
  height: 140px;
  width: 1px;
}

.intro-label,
.intro-space-label,
.intro-map-credit {
  background: rgba(0, 0, 0, .64);
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 800;
  left: 18px;
  line-height: 1.2;
  padding: 8px 10px;
  position: absolute;
  text-transform: uppercase;
  top: 16px;
}

.intro-map-credit {
  bottom: 12px;
  font-size: 10px;
  font-weight: 700;
  left: auto;
  right: 12px;
  text-transform: none;
  top: auto;
}

.intro-space-stage {
  animation: space-stage-in 8.2s ease-in-out forwards;
  background: #03060c;
  opacity: 0;
}

.intro-stars,
.intro-stars::before,
.intro-stars::after {
  background-image:
    radial-gradient(circle, rgba(255, 255, 255, .92) 0 1px, transparent 1.5px),
    radial-gradient(circle, rgba(151, 188, 226, .72) 0 1px, transparent 1.5px);
  background-position: 0 0, 32px 46px;
  background-size: 96px 96px, 142px 142px;
  inset: -20%;
  position: absolute;
}

.intro-stars {
  animation: stars-drift 8.2s linear forwards;
}

.intro-stars::before,
.intro-stars::after {
  content: "";
  opacity: .52;
}

.intro-stars::before {
  transform: rotate(14deg) scale(1.15);
}

.intro-stars::after {
  opacity: .32;
  transform: rotate(-9deg) scale(.9);
}

.intro-earth {
  animation: earth-arrive 8.2s ease-in-out forwards;
  background-color: #0d2339;
  background-image: url("/assets/earth-blue-marble.png");
  background-position: center;
  background-size: cover;
  border-radius: 50%;
  bottom: -34%;
  box-shadow:
    inset -34px -24px 34px rgba(0, 0, 0, .44),
    inset 14px 10px 22px rgba(255, 255, 255, .22),
    0 0 42px rgba(84, 158, 218, .38);
  height: 68%;
  left: 50%;
  max-height: 540px;
  max-width: 540px;
  min-height: 210px;
  min-width: 210px;
  position: absolute;
  transform: translateX(-50%);
  width: 38%;
}

.intro-satellite {
  animation: satellite-pass 8.2s cubic-bezier(.2, .78, .22, 1) forwards;
  height: 64px;
  left: 64%;
  position: absolute;
  top: 15%;
  transform: rotate(-18deg);
  width: 142px;
  z-index: 2;
}

.sat-body,
.sat-panel,
.sat-dish {
  display: block;
  position: absolute;
}

.sat-body {
  background: linear-gradient(135deg, #d7dde1, #66737d 55%, #1d262d);
  border: 1px solid rgba(255, 255, 255, .42);
  border-radius: 5px;
  box-shadow: 0 7px 18px rgba(0, 0, 0, .38);
  height: 30px;
  left: 53px;
  top: 18px;
  width: 36px;
}

.sat-panel {
  background:
    linear-gradient(90deg, rgba(255, 255, 255, .22) 1px, transparent 1px),
    linear-gradient(0deg, rgba(255, 255, 255, .18) 1px, transparent 1px),
    #17426d;
  background-size: 12px 100%, 100% 11px, auto;
  border: 1px solid rgba(149, 195, 232, .82);
  height: 34px;
  top: 16px;
  width: 44px;
}

.sat-panel-left {
  left: 2px;
}

.sat-panel-right {
  right: 2px;
}

.sat-dish {
  border: 2px solid rgba(220, 229, 235, .92);
  border-left: 0;
  border-radius: 0 30px 30px 0;
  height: 28px;
  left: 90px;
  top: 26px;
  transform: rotate(30deg);
  width: 20px;
}

.intro-signal {
  animation: datastream 1.2s infinite ease-out;
  background: #00d2ff;
  border-radius: 2px;
  box-shadow: 0 0 8px #00d2ff, 0 0 16px #00d2ff;
  height: 35px;
  opacity: 0;
  position: absolute;
  top: 35px;
  transform-origin: top center;
  width: 3px;
  z-index: 1;
}

.intro-signal-1 {
  animation-delay: 0s;
  left: 70px;
}

.intro-signal-2 {
  animation-delay: 0.4s;
  left: 60px;
}

.intro-signal-3 {
  animation-delay: 0.8s;
  left: 50px;
}

.intro-space-label {
  animation: label-swap 8.2s ease-in-out forwards;
  opacity: 0;
}

.intro-final-fade {
  animation: final-flash 8.2s ease-in-out forwards;
  background: #fff;
  opacity: 0;
}

@keyframes map-stage-out {
  0%, 34% {
    opacity: 1;
    transform: scale(1);
  }
  52% {
    opacity: .62;
    transform: scale(.58);
  }
  64%, 100% {
    opacity: 0;
    transform: scale(.22);
  }
}

@keyframes space-stage-in {
  0%, 34% { opacity: 0; }
  48%, 92% { opacity: 1; }
  100% { opacity: 0; }
}

@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 0 0 rgba(228, 0, 22, .8), 0 0 24px rgba(228, 0, 22, .88); }
  60% { box-shadow: 0 0 0 16px rgba(228, 0, 22, 0), 0 0 28px rgba(228, 0, 22, .98); }
}

@keyframes pulse-ring {
  0% {
    opacity: .88;
    transform: scale(.42);
  }
  100% {
    opacity: 0;
    transform: scale(1.32);
  }
}

@keyframes stars-drift {
  0% { transform: translate3d(0, 0, 0); }
  100% { transform: translate3d(-36px, 18px, 0); }
}

@keyframes earth-arrive {
  0%, 42% {
    opacity: 0;
    transform: translateX(-50%) scale(.42);
  }
  58%, 90% {
    opacity: 1;
    transform: translateX(-50%) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateX(-50%) scale(1.08);
  }
}

@keyframes satellite-pass {
  0%, 40% {
    opacity: 0;
    transform: translate3d(120px, -60px, 0) rotate(-18deg) scale(.78);
  }
  54%, 88% {
    opacity: 1;
    transform: translate3d(0, 0, 0) rotate(-18deg) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate3d(-90px, 42px, 0) rotate(-18deg) scale(.94);
  }
}

@keyframes datastream {
  0% {
    opacity: 0;
    transform: rotate(45deg) translateY(0) scaleY(0.5);
  }
  20% {
    opacity: 1;
    transform: rotate(45deg) translateY(20px) scaleY(1.5);
  }
  80% {
    opacity: 1;
    transform: rotate(45deg) translateY(180px) scaleY(1);
  }
  100% {
    opacity: 0;
    transform: rotate(45deg) translateY(220px) scaleY(0.5);
  }
}

@keyframes label-swap {
  0%, 47% { opacity: 0; }
  56%, 88% { opacity: 1; }
  100% { opacity: 0; }
}

@keyframes final-flash {
  0%, 88% { opacity: 0; }
  94% { opacity: .14; }
  100% { opacity: 0; }
}

.hud {
  background: #f8fafb;
  border-top: 1px solid #dde5e8;
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr auto;
  padding: 14px 16px;
}

.status-title {
  display: block;
  font-weight: 800;
}

.status-detail {
  color: var(--muted);
  display: block;
  font-size: 13px;
  margin-top: 3px;
}

.actions {
  display: flex;
  gap: 8px;
}

button {
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  min-height: 40px;
  padding: 0 14px;
}

.btn-play {
  background: var(--accent);
  color: #000;
}

.btn-stop {
  background: #313b41;
  color: white;
}

button:disabled {
  cursor: wait;
  opacity: .6;
}

.camera-log {
  color: #64747b;
  font-size: 12px;
  padding: 0 16px 14px;
}

.site-footer {
  color: #65737a;
  font-size: 13px;
  padding: 24px 16px 36px;
  text-align: center;
}

@media (max-width: 680px) {
  .camera-head,
  .hud {
    grid-template-columns: 1fr;
  }

  .camera-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .actions {
    width: 100%;
  }

  .actions button {
    flex: 1;
  }

  .intro-label,
  .intro-space-label,
  .intro-map-credit {
    font-size: 11px;
    left: 10px;
    max-width: calc(100% - 20px);
    top: 10px;
  }

  .intro-map-credit {
    bottom: 8px;
    left: auto;
    right: 8px;
    top: auto;
  }

  .intro-earth {
    bottom: -42%;
    width: 62%;
  }

  .intro-satellite {
    left: 52%;
    top: 12%;
    transform: scale(.72) rotate(-18deg);
  }

  .intro-signal {
    transform: scale(0.85);
  }
}

@media (prefers-reduced-motion: reduce) {
  .intro-sequence,
  .intro-map-stage,
  .intro-space-stage,
  .intro-stars,
  .intro-earth,
  .intro-satellite,
  .intro-signal,
  .intro-space-label,
  .intro-final-fade {
    animation: none;
  }
}
