html {
  scroll-padding-top: 104px;
}

.site-nav {
  position: sticky;
  top: 0;
  z-index: 30;
}

.site-nav .header {
  padding-block: 15px;
}

.site-nav .mobile-menu {
  top: 100%;
  max-height: calc(100dvh - 78px);
  overflow: auto;
}

.site-nav a[aria-current="location"] {
  text-decoration: underline;
  text-decoration-color: #9f311c;
  text-underline-offset: .4em;
  text-decoration-thickness: 2px;
}

.depot > picture,
.ticket-bird > picture {
  display: contents;
}

.flight-board {
  --flight-accent: #ffcc50;
  position: relative;
  overflow: hidden;
  margin: 0 0 20px;
  padding: 14px 17px 13px;
  border: 2px solid var(--ink);
  background-color: #19243a;
  background-image:
    radial-gradient(ellipse at 80% 68%, #384766 0, transparent 64%),
    radial-gradient(circle, #dce9f37a 0 1px, transparent 1.4px);
  background-size: auto, 23px 23px;
  box-shadow: 4px 4px 0 #17202629;
  color: #fff7e6;
}

.flight-board[data-route="saturn"] { --flight-accent: #ffa08a; }
.flight-board[data-route="nowhere"] { --flight-accent: #a5e2ff; }

.flight-top,
.flight-labels {
  position: relative;
  font: 700 .72rem/1.4 monospace;
}

.flight-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  letter-spacing: .08em;
}

.flight-status {
  padding: 3px 8px;
  border: 1px solid currentColor;
  border-radius: 20px;
  color: var(--flight-accent);
  text-transform: uppercase;
}

.flight-map {
  position: relative;
  height: 64px;
  margin-inline: 6px;
  --rail-start: 7%;
  --rail-end: 92%;
}

.flight-track {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  fill: none;
  stroke: #cfdef7b0;
  stroke-width: 1px;
  stroke-dasharray: 4 5;
}

.flight-dot,
.flight-courier {
  position: absolute;
  z-index: 1;
  transform: translate(-50%, -50%);
}

.flight-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #eef7ff;
  box-shadow: 0 0 0 4px #dbe7fa26;
}

.flight-origin { left: var(--rail-start); top: 60%; }
.flight-midpoint { left: 50%; top: 35%; width: 6px; height: 6px; }
.flight-destination {
  left: var(--rail-end);
  top: 33%;
  width: 23px;
  height: 23px;
  border: 1px solid var(--flight-accent);
  background: radial-gradient(circle at 31% 31%, #fff7e6, var(--flight-accent) 46%, #283250 92%);
  box-shadow: 0 0 20px var(--flight-accent);
}

[data-route="saturn"] .flight-destination::after {
  content: "";
  position: absolute;
  inset: 6px -8px;
  border: 1px solid var(--flight-accent);
  border-radius: 50%;
  transform: rotate(-25deg);
}

[data-route="nowhere"] .flight-destination {
  background: #19243a;
  box-shadow: 0 0 12px #a5e2ff85, inset 0 0 8px #a5e2ff85;
}

.flight-courier {
  left: var(--rail-start);
  top: 60%;
  z-index: 2;
  display: grid;
  width: 30px;
  height: 27px;
  place-items: center;
  border: 1px solid #19243a;
  border-radius: 5px;
  background: #fff8e6;
  box-shadow: 0 2px 0 #19243a, 0 0 14px #ffffff5e;
  color: #19243a;
  font: 700 19px/1 Arial, sans-serif;
}

[data-phase="flying"] .flight-courier {
  animation: cooblet-flight .9s cubic-bezier(.3,.05,.25,1) both;
}

[data-phase="arrived"] .flight-courier {
  left: var(--rail-end);
  top: 33%;
  transform: translate(-75%, -76%) rotate(-12deg);
  background: var(--flight-accent);
}

@keyframes cooblet-flight {
  0% { left: var(--rail-start); top: 60%; }
  48% { left: 50%; top: 27%; transform: translate(-50%, -50%) rotate(9deg); }
  100% { left: var(--rail-end); top: 33%; transform: translate(-75%, -76%) rotate(-12deg); }
}

.flight-labels {
  display: grid;
  grid-template-columns: 1fr .9fr 1.2fr;
  gap: 6px;
  align-items: end;
}

.flight-labels :nth-child(2) { text-align: center; color: #dae4fa; }
.flight-labels strong { text-align: right; color: var(--flight-accent); }

.dispatch-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px 20px;
}

.dispatch-controls .underlined {
  font-weight: 700;
  font-size: .9rem;
}

.dispatch-controls [hidden] { display: none; }
.dispatch-controls button[aria-disabled="true"] { cursor: wait; }

.dispatch-log { margin-top: 23px; }

.dispatch-log h3 {
  margin: 0 0 3px;
  font-size: 1rem;
}

.dispatch-log ul { margin: 0; padding: 0; list-style: none; }

.dispatch-log li {
  display: flex;
  gap: 3px 13px;
  flex-wrap: wrap;
  align-items: baseline;
  padding: 8px 0;
  border-bottom: 1px dashed #17202670;
  font-size: .82rem;
}

.dispatch-log code { font-weight: 700; }

.allocation-bar > button {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  border: 0;
  border-right: var(--line);
  background: var(--sky);
  color: var(--ink);
  font: 400 clamp(1rem, 3.6vw, 2.5rem)/1 var(--display);
  cursor: pointer;
  transition: box-shadow .2s ease;
}

.allocation-bar > button[data-bucket="community"] { flex: 50 1 0; background: var(--coral); }
.allocation-bar > button[data-bucket="public"] { flex: 35 1 0; }
.allocation-bar > button[data-bucket="treasury"] { flex: 15 1 0; border-right: 0; background: var(--yellow); }
.allocation-bar > button:not([aria-pressed="true"]):hover { box-shadow: inset 0 -4px 0 #1720265e; }
.allocation-bar > button[aria-pressed="true"] { box-shadow: inset 0 -8px 0 var(--ink); }
.allocation-bar > button:focus-visible { z-index: 1; outline: 3px solid var(--ink); outline-offset: 3px; }

.allocation-summary {
  margin: 10px 0 0;
  font: 700 .85rem/1.4 monospace;
}

.allocation-details article {
  padding-top: 11px;
  border-top: 2px solid #17202638;
  transition: border-color .2s ease;
}

.allocation-details article.allocation-selected { border-top-color: var(--ink); }
.allocation-details .swatch { top: 16px; }

html.motion-paused .stamping .ticket-stamp,
html.motion-paused .flight-courier {
  animation: none;
}

@media (max-width: 850px) {
  html { scroll-padding-top: 86px; }
}

@media (max-width: 380px) {
  .flight-board { padding-inline: 11px; }
  .flight-labels { font-size: .66rem; }
  .site-nav .header { padding-inline: 4.2vw; gap: 8px; }
  .site-nav .header-cta { gap: 6px; padding-inline: 8px; }
  .hero-copy h1 { font-size: clamp(4rem, 20vw, 4.7rem); }
  .dispatch-heading h2,
  .depot h2 { font-size: clamp(2.7rem, 14vw, 3.1rem); }
  .token-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .token-summary strong { font-size: 1.55rem; }
}

@media (prefers-reduced-motion: reduce) {
  .allocation-bar > button,
  .allocation-details article { transition: none; }
}
