:root {
  color-scheme: dark;
  --ink: #020607;
  --panel: rgba(3, 10, 11, 0.76);
  --line: rgba(193, 216, 207, 0.2);
  --muted: #8d9b97;
  --paper: #ecf5ee;
  --acid: #b9ff3d;
  --cyan: #39d7ce;
  --amber: #ffb83e;
  --red: #ff695e;
  --rail: clamp(220px, 18vw, 310px);
  --top: 74px;
  font-family: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
  background: var(--ink);
  color: var(--paper);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-width: 320px;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #020607;
}

button,
a {
  font: inherit;
}

button {
  color: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

#app {
  position: relative;
  width: 100%;
  height: 100dvh;
  min-height: 620px;
  isolation: isolate;
  background: #020607;
}

#orbital-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -3;
  cursor: grab;
}

#orbital-canvas:active {
  cursor: grabbing;
}

.scan-grid {
  position: absolute;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  opacity: 0.28;
  background-image:
    linear-gradient(rgba(169, 208, 195, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(169, 208, 195, 0.035) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: linear-gradient(to bottom, black, transparent 72%);
}

.topbar {
  position: absolute;
  inset: 0 0 auto;
  height: var(--top);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(2, 6, 7, 0.72);
  backdrop-filter: blur(18px);
  z-index: 10;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  width: max-content;
}

.brand img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  filter: grayscale(1) contrast(1.4) brightness(1.7);
}

.brand span {
  display: grid;
  gap: 3px;
}

.brand strong {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 18px;
  letter-spacing: 0;
}

.brand small,
.mission-clock,
.top-actions,
.rail-heading,
.mode-copy small,
.scale-readout span,
.scale-readout small,
.solar-readout,
.stage-label span,
.stage-label small,
.scale-axis,
.orbit-caption span,
.verification-copy > span,
.verification-copy p,
.verify-button b,
.telemetry span,
.telemetry b {
  font-size: 10px;
  line-height: 1.25;
  letter-spacing: 0.08em;
}

.brand small {
  color: var(--muted);
}

.mission-clock {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
}

.mission-clock strong {
  color: var(--paper);
  font-size: 13px;
  letter-spacing: 0.12em;
}

.signal-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--acid);
  box-shadow: 0 0 14px rgba(185, 255, 61, 0.8);
  animation: pulse 1.8s ease-in-out infinite;
}

.top-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}

.top-actions a,
.rail-links a {
  padding: 8px 10px;
  color: #aab8b3;
  border: 1px solid transparent;
  transition: color 160ms ease, border-color 160ms ease, background 160ms ease;
}

.top-actions a:hover,
.rail-links a:hover {
  color: var(--paper);
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.04);
}

.proof-rail,
.clock-rail {
  position: absolute;
  top: var(--top);
  bottom: 154px;
  width: var(--rail);
  padding: 22px 18px;
  background: var(--panel);
  backdrop-filter: blur(18px);
  z-index: 5;
}

.proof-rail {
  left: 0;
  border-right: 1px solid var(--line);
}

.clock-rail {
  right: 0;
  border-left: 1px solid var(--line);
}

.rail-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  color: var(--muted);
}

.rail-heading b {
  color: var(--acid);
  font-weight: 500;
}

.proof-modes {
  display: grid;
  gap: 4px;
}

.proof-mode {
  position: relative;
  display: grid;
  grid-template-columns: 28px 1fr 8px;
  align-items: center;
  min-height: 60px;
  padding: 8px 9px;
  color: #82908b;
  text-align: left;
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  transition: color 180ms ease, border-color 180ms ease, background 180ms ease;
}

.proof-mode:hover {
  color: var(--paper);
  border-color: var(--line);
}

.proof-mode.active {
  color: var(--paper);
  border-color: rgba(185, 255, 61, 0.34);
  background: rgba(185, 255, 61, 0.06);
}

.mode-index {
  color: #59645f;
  font-size: 9px;
}

.mode-copy {
  display: grid;
  gap: 5px;
}

.mode-copy b {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 14px;
  letter-spacing: 0;
}

.mode-copy small {
  color: #65716d;
}

.proof-mode.active .mode-copy small {
  color: #9ba9a4;
}

.proof-mode i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  border: 1px solid currentColor;
}

.proof-mode.active i {
  border-color: var(--acid);
  background: var(--acid);
  box-shadow: 0 0 10px rgba(185, 255, 61, 0.8);
}

.scale-readout {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 74px;
  display: grid;
  gap: 8px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.scale-readout span,
.scale-readout small {
  color: var(--muted);
}

.scale-readout strong {
  font-family: Arial, Helvetica, sans-serif;
  font-size: clamp(32px, 3vw, 48px);
  line-height: 0.95;
  letter-spacing: 0;
}

.scale-readout sup {
  color: var(--acid);
  font-size: 0.43em;
}

.rail-links {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 15px;
  display: flex;
  justify-content: space-between;
  font-size: 9px;
}

.city-list {
  display: grid;
  max-height: calc(100% - 96px);
  overflow-y: auto;
  scrollbar-width: none;
}

.city-list::-webkit-scrollbar {
  display: none;
}

.city-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px 12px;
  padding: 10px 7px;
  color: #84918d;
  text-align: left;
  border: 0;
  border-bottom: 1px solid rgba(193, 216, 207, 0.1);
  background: transparent;
  cursor: pointer;
}

.city-row:hover,
.city-row.active {
  color: var(--paper);
}

.city-row.active {
  border-bottom-color: rgba(57, 215, 206, 0.48);
}

.city-row b {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 12px;
  letter-spacing: 0;
}

.city-row strong {
  grid-row: span 2;
  align-self: center;
  color: var(--paper);
  font-size: 14px;
  letter-spacing: 0.04em;
}

.city-row small {
  color: #58635f;
  font-size: 9px;
}

.solar-readout {
  position: absolute;
  right: 18px;
  bottom: 18px;
  left: 18px;
  display: grid;
  gap: 5px;
  padding-top: 12px;
  color: var(--muted);
  border-top: 1px solid var(--line);
}

.solar-readout b {
  color: var(--cyan);
  font-weight: 500;
}

.center-stage {
  position: absolute;
  top: var(--top);
  right: var(--rail);
  bottom: 154px;
  left: var(--rail);
  z-index: 2;
  pointer-events: none;
}

.stage-label {
  position: absolute;
  top: 22px;
  left: 50%;
  display: grid;
  justify-items: center;
  gap: 4px;
  transform: translateX(-50%);
  text-shadow: 0 2px 14px #000;
}

.stage-label span,
.stage-label small {
  color: var(--muted);
}

.stage-label strong {
  font-family: Arial, Helvetica, sans-serif;
  font-size: clamp(22px, 2.6vw, 42px);
  letter-spacing: 0;
}

.scale-axis {
  position: absolute;
  top: 50%;
  left: 20px;
  display: grid;
  grid-template-columns: auto 80px auto;
  align-items: center;
  gap: 9px;
  color: #65716d;
  transform: rotate(-90deg) translateX(-50%);
  transform-origin: left top;
}

.scale-axis i {
  height: 1px;
  background: var(--line);
}

.scale-axis b {
  color: #9ba8a4;
  font-weight: 500;
}

.orbit-caption {
  position: absolute;
  bottom: 20px;
  left: 50%;
  width: min(580px, calc(100% - 80px));
  text-align: center;
  transform: translateX(-50%);
  text-shadow: 0 2px 18px #000;
}

.orbit-caption span {
  color: var(--acid);
}

.orbit-caption h1 {
  margin: 7px 0 4px;
  font-family: Arial, Helvetica, sans-serif;
  font-size: clamp(34px, 5vw, 76px);
  line-height: 0.92;
  letter-spacing: 0;
}

.orbit-caption p {
  max-width: 560px;
  margin: 0 auto;
  color: #a6b2ae;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 13px;
  line-height: 1.45;
}

.verification-dock {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 154px;
  border-top: 1px solid var(--line);
  background: rgba(2, 7, 8, 0.9);
  backdrop-filter: blur(22px);
  z-index: 8;
}

.dock-primary {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr) 150px;
  align-items: center;
  gap: 18px;
  height: 104px;
  padding: 12px 24px;
}

.status-seal {
  position: relative;
  display: grid;
  place-content: center;
  width: 68px;
  height: 68px;
  text-align: center;
  border: 1px solid rgba(185, 255, 61, 0.45);
  border-radius: 50%;
}

.status-seal::before,
.status-seal::after {
  position: absolute;
  inset: 5px;
  content: "";
  border: 1px dashed rgba(185, 255, 61, 0.2);
  border-radius: 50%;
}

.status-seal::after {
  inset: -5px;
  border-style: solid;
  border-color: transparent var(--acid);
  animation: spin 8s linear infinite;
}

.status-seal span,
.status-seal small {
  color: var(--muted);
  font-size: 8px;
}

.status-seal b {
  color: var(--acid);
  font-size: 18px;
}

.status-seal.verified {
  border-color: var(--cyan);
}

.status-seal.verified::after {
  border-color: transparent var(--cyan);
}

.status-seal.verified b {
  color: var(--cyan);
}

.verification-copy {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.verification-copy > span {
  color: var(--acid);
}

.verification-copy strong {
  overflow: hidden;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 16px;
  text-overflow: ellipsis;
  white-space: nowrap;
  letter-spacing: 0;
}

.verification-copy p {
  overflow: hidden;
  margin: 0;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.progress-track {
  width: 100%;
  height: 2px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.1);
}

.progress-track i {
  display: block;
  width: 0;
  height: 100%;
  background: var(--acid);
  box-shadow: 0 0 12px rgba(185, 255, 61, 0.7);
  transition: width 120ms linear;
}

.verify-button {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  min-height: 50px;
  padding: 0 14px;
  color: #0a1204;
  font-weight: 700;
  text-align: left;
  border: 0;
  background: var(--acid);
  cursor: pointer;
  transition: background 160ms ease, transform 160ms ease;
}

.verify-button:hover {
  background: #d0ff78;
  transform: translateY(-1px);
}

.verify-button:disabled {
  cursor: wait;
  opacity: 0.62;
  transform: none;
}

.verify-button b {
  padding: 5px;
  color: #314514;
  border: 1px solid rgba(49, 69, 20, 0.35);
}

.telemetry {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  height: 50px;
  border-top: 1px solid rgba(193, 216, 207, 0.12);
}

.telemetry div {
  display: grid;
  align-content: center;
  gap: 3px;
  min-width: 0;
  padding: 0 14px;
  border-right: 1px solid rgba(193, 216, 207, 0.12);
}

.telemetry span {
  color: #56615d;
}

.telemetry b {
  overflow: hidden;
  color: #a9b7b2;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.icon-button {
  position: absolute;
  z-index: 11;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  color: #9aa7a2;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(2, 7, 8, 0.72);
  cursor: pointer;
}

.sound-toggle {
  right: calc(var(--rail) + 20px);
  top: calc(var(--top) + 20px);
}

.motion-toggle {
  right: calc(var(--rail) + 20px);
  top: calc(var(--top) + 60px);
}

.toast {
  position: absolute;
  left: 50%;
  bottom: 174px;
  z-index: 12;
  max-width: min(440px, calc(100% - 32px));
  padding: 9px 12px;
  color: var(--paper);
  font-size: 10px;
  border: 1px solid var(--line);
  background: rgba(2, 7, 8, 0.94);
  opacity: 0;
  transform: translate(-50%, 8px);
  transition: opacity 180ms ease, transform 180ms ease;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes pulse {
  50% { opacity: 0.35; }
}

@media (max-width: 1050px) {
  :root {
    --rail: 210px;
  }

  .topbar {
    grid-template-columns: 1fr auto;
  }

  .mission-clock {
    display: none;
  }

  .proof-rail,
  .clock-rail {
    padding-right: 12px;
    padding-left: 12px;
  }

  .scale-readout,
  .solar-readout {
    right: 12px;
    left: 12px;
  }

  .scale-readout strong {
    font-size: 34px;
  }
}

@media (max-width: 760px) {
  :root {
    --top: 60px;
  }

  #app {
    min-height: 560px;
  }

  .topbar {
    padding: 0 12px;
  }

  .brand img {
    width: 30px;
    height: 30px;
  }

  .brand small {
    display: none;
  }

  .top-actions a {
    padding: 7px 5px;
    font-size: 9px;
  }

  .proof-rail {
    top: auto;
    right: 0;
    bottom: 154px;
    left: 0;
    width: auto;
    height: 70px;
    padding: 8px;
    border-top: 1px solid var(--line);
    border-right: 0;
  }

  .proof-rail .rail-heading,
  .scale-readout,
  .rail-links {
    display: none;
  }

  .proof-modes {
    grid-template-columns: repeat(4, 1fr);
    gap: 3px;
  }

  .proof-mode {
    grid-template-columns: 1fr;
    min-height: 52px;
    padding: 5px;
    text-align: center;
  }

  .mode-index,
  .proof-mode i,
  .mode-copy small {
    display: none;
  }

  .mode-copy b {
    font-size: 10px;
  }

  .clock-rail {
    top: 68px;
    right: 8px;
    bottom: auto;
    width: 126px;
    height: 190px;
    padding: 8px;
    border: 1px solid var(--line);
  }

  .clock-rail .rail-heading,
  .solar-readout {
    display: none;
  }

  .city-list {
    max-height: 100%;
  }

  .city-row {
    grid-template-columns: 1fr;
    padding: 6px 3px;
  }

  .city-row strong {
    grid-row: auto;
    font-size: 11px;
  }

  .city-row small {
    display: none;
  }

  .center-stage {
    top: var(--top);
    right: 0;
    bottom: 224px;
    left: 0;
  }

  .stage-label {
    top: 14px;
  }

  .stage-label strong {
    font-size: 22px;
  }

  .scale-axis,
  .orbit-caption p {
    display: none;
  }

  .orbit-caption {
    bottom: 12px;
    width: calc(100% - 32px);
    text-align: left;
  }

  .orbit-caption h1 {
    font-size: 40px;
  }

  .verification-dock {
    height: 154px;
  }

  .dock-primary {
    grid-template-columns: 48px minmax(0, 1fr) 92px;
    gap: 10px;
    padding: 10px;
  }

  .status-seal {
    width: 46px;
    height: 46px;
  }

  .status-seal b {
    font-size: 13px;
  }

  .status-seal small {
    display: none;
  }

  .verification-copy strong {
    font-size: 13px;
  }

  .verification-copy p {
    display: none;
  }

  .verify-button {
    min-height: 44px;
    padding: 0 8px;
    font-size: 10px;
  }

  .verify-button b {
    display: none;
  }

  .telemetry {
    grid-template-columns: repeat(3, 1fr);
  }

  .telemetry div:nth-child(4),
  .telemetry div:nth-child(5) {
    display: none;
  }

  .sound-toggle,
  .motion-toggle {
    right: auto;
    left: 10px;
  }

  .sound-toggle {
    top: 70px;
  }

  .motion-toggle {
    top: 108px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
