:root {
  color-scheme: light;
  font-family: "Leelawadee UI", Tahoma, system-ui, sans-serif;
  background: #ffffff;
  color: #172c3c;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: radial-gradient(ellipse at 50% 35%, #eaf7f8, transparent 65%);
}
.shell { width: min(100%, 940px); }
.brand {
  display: flex;
  align-items: center;
  gap: .45em;
  font: 700 19px system-ui, sans-serif;
  letter-spacing: .04em;
  margin-bottom: 16px;
}
.brand span:last-child { color: #536b7a; font-weight: 450; }
.brand-icon { color: #067964; padding: 4px 9px; border: 1px solid #a1d8cc; border-radius: 8px; }
.stage {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  height: clamp(260px, 48vw, 430px);
  border: 1px solid #c9e0e5;
  border-radius: 24px;
  box-shadow: 0 18px 55px #24536a12;
  background: radial-gradient(ellipse at 70% 66%, #d9f4f2, transparent 57%), linear-gradient(#ffffff, #edf6f9);
}
.stars, .terrain, .lane, .orbit, .runner, .gate { position: absolute; }
.stars {
  inset: 0;
  opacity: .6;
  background-image: radial-gradient(circle, #72bcc2 1px, transparent 1.6px), radial-gradient(circle, #8da7c8 1px, transparent 2px);
  background-size: 97px 89px, 71px 113px;
  background-position: 11px 27px, 41px 6px;
  mask-image: linear-gradient(#000, transparent 85%);
}
.orbit {
  width: clamp(130px, 26vw, 245px);
  aspect-ratio: 1;
  right: 15%;
  top: 9%;
  border-radius: 50%;
  border: 1px solid #389eaa55;
  box-shadow: 0 0 48px #6fc9d333, inset 0 0 48px #6fc9d333;
  background: repeating-linear-gradient(0deg, #439fa90a 0 4px, transparent 4px 12px);
}
.terrain {
  inset: 59% -40% -38%;
  transform: perspective(170px) rotateX(42deg);
  background: repeating-linear-gradient(90deg, #4598ae40 0 1px, transparent 1px 56px), repeating-linear-gradient(0deg, #4598ae40 0 1px, transparent 1px 34px);
}
.lane {
  left: 7%; right: 8%; bottom: 25%; height: 2px;
  background: linear-gradient(90deg,#62baa655,#239e87,#62baa655);
  box-shadow: 0 0 16px 3px #56bda83d;
}
.gate {
  right: 12%; bottom: 25%; height: 48%; width: 11%;
  border: 2px solid #259a86;
  border-radius: 50%;
  box-shadow: 0 0 26px #59c7af5c, inset 0 0 28px #67d6bf66;
  background: #9befda55;
  animation: glow 1.8s ease-in-out infinite alternate;
}
.runner {
  bottom: 20%;
  left: 22%;
  width: clamp(154px, 29vw, 265px);
  max-width: 56%;
  aspect-ratio: 1;
  filter: drop-shadow(0 8px 13px #31546342);
}
.sprite {
  width: 100%; height: 100%;
  background: url(courier.png) 0 0 / 200% 200% no-repeat;
  animation: scan 1.2s ease-in-out infinite alternate;
}
[data-state=running] .sprite { animation: run .36s step-end infinite; }
[data-state=running] .runner { animation: depart 1.2s ease-out forwards; }
[data-state=running] .terrain { animation: scroll .28s linear infinite; }
[data-state=error] .sprite, [data-state=error] .gate, [data-state=error] .signal i { animation: none; }
.origin, .destination {
  position: absolute;
  bottom: 11%;
  color: #3f6576;
  font: 700 11px ui-monospace, Consolas, monospace;
  letter-spacing: .18em;
}
.origin { left: 8%; }
.destination { right: 10%; }
.details { position: relative; padding: 24px 0 0; }
h1 { font-size: clamp(23px, 4vw, 35px); margin: 9px 0 3px; line-height: 1.25; }
p { color: #4c6474; margin: 8px 0 0; line-height: 1.6; }
.signal { display: flex; gap: 5px; }
.signal i { width: 22px; height: 4px; border-radius: 4px; background: #138e76; animation: glow .65s alternate infinite; }
.signal i:nth-child(2) { animation-delay: .15s; }
.signal i:nth-child(3) { animation-delay: .30s; }
.signal i:nth-child(4) { animation-delay: .45s; }
.action { display: inline-block; color: #086c60; margin-top: 14px; }
.action[hidden] { display: none; }
@keyframes glow { to { opacity: .52; } }
@keyframes scan { to { transform: translateY(-4px); } }
@keyframes run {
  0% { background-position: 100% 0; }
  33% { background-position: 0 100%; }
  66% { background-position: 100% 100%; }
}
@keyframes depart { to { left: 63%; } }
@keyframes scroll { to { background-position: -56px 0, 0 0; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; }
  [data-state=running] .sprite { background-position: 100% 0; }
}