:root {
  color-scheme: dark;
  --bg: #020813;
  --glass: rgba(6, 18, 32, 0.52);
  --glass-strong: rgba(5, 17, 31, 0.72);
  --line: rgba(151, 205, 255, 0.18);
  --text: #eff8ff;
  --muted: rgba(218, 237, 255, 0.66);
  --accent: #70d7ff;
  --accent-strong: #19b9ff;
  --cyan-glow: rgba(63, 196, 255, 0.45);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  font: inherit;
}

.app-shell {
  position: relative;
  width: 100%;
  height: 100%;
  isolation: isolate;
  background:
    radial-gradient(circle at 50% 52%, rgba(12, 65, 105, 0.13), transparent 36%),
    #020813;
}

.globe-stage {
  position: absolute;
  inset: 0;
  z-index: 1;
  cursor: grab;
}

.globe-stage:active {
  cursor: grabbing;
}

.globe-stage canvas {
  display: block;
}

.vignette {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 50%, transparent 45%, rgba(0, 6, 14, 0.16) 67%, rgba(0, 4, 11, 0.62) 100%),
    linear-gradient(90deg, rgba(0, 6, 16, 0.52), transparent 29%, transparent 70%, rgba(0, 5, 15, 0.44));
}

.noise {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.7'/%3E%3C/svg%3E");
}

.glass-panel {
  border: 1px solid var(--line);
  background: linear-gradient(145deg, rgba(11, 29, 49, 0.62), var(--glass));
  box-shadow:
    0 18px 70px rgba(0, 0, 0, 0.23),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(18px) saturate(125%);
  -webkit-backdrop-filter: blur(18px) saturate(125%);
}

.topbar {
  position: absolute;
  z-index: 8;
  top: max(22px, env(safe-area-inset-top));
  left: 28px;
  right: 28px;
  height: 82px;
  padding: 0 18px 0 14px;
  border-radius: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(117, 220, 255, 0.28);
  border-radius: 18px;
  background: radial-gradient(circle at 30% 28%, rgba(89, 214, 255, 0.24), rgba(10, 43, 72, 0.2));
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.03) inset,
    0 0 30px rgba(38, 186, 246, 0.12);
}

.brand-mark svg {
  width: 42px;
  height: 42px;
  display: block;
}

.brand-copy {
  display: grid;
  gap: 4px;
}

.brand-copy strong {
  font-size: 19px;
  line-height: 1;
  letter-spacing: 0.18em;
}

.brand-copy small {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.topbar-status {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 11px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.035);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: rgba(225, 245, 255, 0.76);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #7fffd8;
  box-shadow: 0 0 16px rgba(127, 255, 216, 0.95);
  animation: breathe 2.2s ease-in-out infinite;
}

.hero-copy {
  position: absolute;
  z-index: 6;
  left: clamp(30px, 6vw, 96px);
  top: 50%;
  transform: translateY(-48%);
  width: min(430px, 36vw);
  pointer-events: none;
  text-shadow: 0 4px 30px rgba(0, 0, 0, 0.38);
}

.eyebrow {
  margin: 0 0 15px;
  color: var(--accent);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.24em;
}

.hero-copy h1 {
  margin: 0;
  font-size: clamp(35px, 4vw, 66px);
  line-height: 0.99;
  letter-spacing: -0.055em;
  font-weight: 710;
}

.hero-copy h1 span {
  color: rgba(227, 244, 255, 0.68);
  font-weight: 540;
}

.hero-note {
  max-width: 360px;
  margin: 20px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.info-card {
  position: absolute;
  z-index: 8;
  right: clamp(30px, 5vw, 78px);
  top: 50%;
  transform: translateY(-35%);
  width: 320px;
  padding: 20px;
  border-radius: 22px;
  transition: opacity .25s ease, transform .25s ease;
}

.info-card.is-hidden {
  opacity: 0;
  transform: translate(15px, -35%);
  pointer-events: none;
}

.info-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.info-kicker {
  color: var(--accent);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.2em;
}

.icon-button {
  width: 30px;
  height: 30px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.035);
  color: rgba(235, 247, 255, 0.75);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.info-card h2 {
  margin: 20px 0 5px;
  font-size: 29px;
  letter-spacing: -0.04em;
}

.info-card > p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 18px;
}

.info-grid > div {
  padding: 12px;
  border: 1px solid rgba(139, 207, 255, 0.1);
  border-radius: 13px;
  background: rgba(0, 10, 22, 0.24);
}

.info-grid span,
.info-grid strong {
  display: block;
}

.info-grid span {
  margin-bottom: 5px;
  color: rgba(199, 225, 242, 0.52);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.09em;
}

.info-grid strong {
  color: #eaf8ff;
  font-size: 12px;
}

.controls {
  position: absolute;
  z-index: 8;
  left: 50%;
  bottom: max(25px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  display: flex;
  gap: 4px;
  padding: 5px;
  border-radius: 16px;
}

.control-button {
  min-height: 42px;
  padding: 0 13px;
  border: 1px solid transparent;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  color: rgba(226, 242, 252, 0.64);
  font-size: 11px;
  cursor: pointer;
  transition: background .18s ease, color .18s ease, border-color .18s ease;
}

.control-button:hover,
.control-button.is-active {
  border-color: rgba(118, 216, 255, 0.12);
  background: rgba(92, 195, 239, 0.1);
  color: #effbff;
}

.control-icon {
  color: var(--accent);
  font-size: 15px;
}

.legend {
  position: absolute;
  z-index: 8;
  right: 28px;
  bottom: max(28px, env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border-radius: 14px;
  color: rgba(221, 240, 252, 0.61);
  font-size: 10px;
  letter-spacing: 0.04em;
}

.legend-marker {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #7ce7ff;
  box-shadow: 0 0 0 4px rgba(69, 204, 255, 0.08), 0 0 14px rgba(75, 211, 255, 0.8);
}

.city-label {
  transform: translate(-50%, -50%);
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
  min-width: max-content;
  padding: 7px 10px;
  border: 1px solid rgba(131, 221, 255, 0.26);
  border-radius: 12px;
  background: linear-gradient(145deg, rgba(6, 17, 30, 0.92), rgba(8, 26, 44, 0.78));
  box-shadow:
    0 14px 34px rgba(0, 0, 0, 0.28),
    0 0 0 1px rgba(255, 255, 255, 0.03) inset,
    0 0 18px rgba(48, 197, 255, 0.14);
  backdrop-filter: blur(8px);
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  pointer-events: auto;
}

.city-label::before {
  content: "";
  position: absolute;
  left: 14px;
  bottom: -6px;
  width: 12px;
  height: 12px;
  transform: rotate(45deg);
  border-right: 1px solid rgba(131, 221, 255, 0.18);
  border-bottom: 1px solid rgba(131, 221, 255, 0.18);
  background: rgba(7, 20, 34, 0.85);
}

.city-label__name {
  position: relative;
  z-index: 1;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.1;
  color: #f4fdff;
}

.city-label__role {
  position: relative;
  z-index: 1;
  font-size: 10px;
  line-height: 1.2;
  color: rgba(210, 238, 252, 0.74);
}

.city-label--primary {
  border-color: rgba(191, 240, 255, 0.34);
  background: linear-gradient(145deg, rgba(14, 30, 48, 0.95), rgba(20, 47, 71, 0.86));
  box-shadow:
    0 18px 38px rgba(0, 0, 0, 0.34),
    0 0 0 1px rgba(255, 255, 255, 0.05) inset,
    0 0 22px rgba(97, 223, 255, 0.24);
}

.city-label--primary .city-label__name {
  color: #ffffff;
}

.loading-screen {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 20px;
  background: radial-gradient(circle at center, #071729 0%, #020813 60%);
  transition: opacity .55s ease, visibility .55s ease;
}

.loading-screen.is-done {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loading-screen p {
  margin: 0;
  color: rgba(211, 235, 250, 0.64);
  font-size: 11px;
  letter-spacing: 0.06em;
}

.loader-orbit {
  position: relative;
  width: 72px;
  height: 72px;
  border: 1px solid rgba(126, 219, 255, 0.16);
  border-radius: 50%;
  box-shadow: inset 0 0 30px rgba(46, 173, 229, 0.06);
}

.loader-orbit::before {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 50%;
  background: radial-gradient(circle at 34% 32%, #2b8fbc, #0a3654 42%, #052034 72%);
  box-shadow: 0 0 26px rgba(60, 194, 247, 0.2);
}

.loader-orbit span {
  position: absolute;
  width: 9px;
  height: 9px;
  top: -4px;
  left: 31px;
  border-radius: 50%;
  background: #8fe8ff;
  box-shadow: 0 0 14px #72dcff;
  transform-origin: 4px 40px;
  animation: orbit 1.8s linear infinite;
}

.error-card {
  position: absolute;
  z-index: 30;
  left: 50%;
  top: 50%;
  width: min(420px, calc(100vw - 40px));
  transform: translate(-50%, -50%);
  padding: 22px;
  border-radius: 18px;
}

.error-card strong {
  display: block;
  margin-bottom: 7px;
}

.error-card p {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.error-card button {
  border: 1px solid rgba(111, 217, 255, 0.28);
  border-radius: 10px;
  padding: 10px 14px;
  background: rgba(77, 197, 245, 0.12);
  color: #eaf9ff;
  cursor: pointer;
}

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

@keyframes breathe {
  50% { opacity: .45; transform: scale(.82); }
}

@media (max-width: 900px) {
  .topbar {
    left: 16px;
    right: 16px;
    top: max(14px, env(safe-area-inset-top));
  }

  .hero-copy {
    left: 22px;
    top: auto;
    bottom: 115px;
    transform: none;
    width: min(78vw, 520px);
  }

  .hero-copy h1 {
    font-size: clamp(31px, 7vw, 50px);
  }

  .hero-note {
    display: none;
  }

  .info-card {
    top: 118px;
    right: 16px;
    width: 266px;
    transform: none;
  }

  .info-card.is-hidden {
    transform: translateX(15px);
  }

  .legend {
    display: none;
  }

  .city-label {
    padding: 6px 9px;
  }

  .city-label__name {
    font-size: 12px;
  }

  .city-label__role {
    font-size: 9px;
  }
}

@media (max-width: 620px) {
  .brand-copy small,
  .topbar-status span:last-child {
    display: none;
  }

  .topbar {
    height: 66px;
    padding: 0 12px;
    border-radius: 18px;
  }

  .brand-mark {
    width: 42px;
    height: 42px;
    border-radius: 12px;
  }

  .brand-mark svg {
    width: 31px;
    height: 31px;
  }

  .brand-copy strong {
    font-size: 15px;
    letter-spacing: 0.12em;
  }

  .hero-copy {
    left: 18px;
    bottom: 91px;
    width: calc(100vw - 36px);
  }

  .eyebrow {
    margin-bottom: 10px;
    font-size: 8px;
  }

  .hero-copy h1 {
    font-size: clamp(28px, 9.2vw, 42px);
  }

  .info-card {
    display: none;
  }

  .controls {
    bottom: max(16px, env(safe-area-inset-bottom));
    width: calc(100vw - 30px);
    justify-content: stretch;
  }

  .control-button {
    flex: 1;
    justify-content: center;
    min-width: 0;
    padding: 0 6px;
    font-size: 9px;
  }

  .control-icon {
    display: none;
  }

  .city-label {
    padding: 6px 8px;
    border-radius: 10px;
  }

  .city-label__name {
    font-size: 11px;
  }

  .city-label__role {
    display: none;
  }
}

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