:root {
  --bg: #050a17;
  --bg-raised: #0c1528;
  --line: rgba(255, 255, 255, 0.10);
  --text: #eef2f8;
  --muted: #9aa7bd;
  --accent: #ffd133;
  --cyan: #4cd8ff;
  --max: 720px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background:
    radial-gradient(1200px 600px at 20% -10%, rgba(76, 216, 255, 0.10), transparent 60%),
    var(--bg);
  color: var(--text);
  font: 17px/1.6 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  min-height: 100vh;
}

a { color: var(--cyan); text-underline-offset: 3px; }
a:hover { color: #fff; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 20px; }

header.site {
  display: flex; align-items: center; justify-content: space-between;
  padding: 28px 0;
}
header.site .brand {
  color: var(--text); text-decoration: none;
  font-weight: 700; letter-spacing: -0.01em; font-size: 18px;
}
header.site nav a { color: var(--muted); text-decoration: none; margin-left: 20px; font-size: 15px; }
header.site nav a:hover { color: var(--text); }

.hero { padding: 56px 0 40px; }
.hero h1 { font-size: clamp(34px, 7vw, 52px); line-height: 1.1; letter-spacing: -0.02em; margin: 0 0 16px; }
.hero p { color: var(--muted); font-size: 19px; margin: 0; max-width: 34em; }

.card {
  display: flex; gap: 20px; align-items: flex-start;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 24px;
  margin: 24px 0 64px;
}
.card img { width: 88px; height: 88px; border-radius: 20px; flex: none; }
.card h2 { margin: 0 0 6px; font-size: 22px; }
.card p { margin: 0 0 12px; color: var(--muted); }
.card .links a { margin-right: 16px; font-size: 15px; }
.tag {
  display: inline-block; font-size: 12px; font-weight: 600; letter-spacing: 0.04em;
  text-transform: uppercase; color: #000; background: var(--accent);
  border-radius: 999px; padding: 2px 10px; margin-left: 8px; vertical-align: 3px;
}

article.doc { padding: 24px 0 64px; }
article.doc h1 { font-size: clamp(30px, 6vw, 40px); letter-spacing: -0.02em; margin: 0 0 4px; line-height: 1.15; }
article.doc .updated { color: var(--muted); margin: 0 0 32px; font-size: 15px; }
article.doc h2 { font-size: 21px; margin: 36px 0 8px; }
article.doc ul { padding-left: 1.2em; }
article.doc li { margin: 6px 0; }
article.doc strong { color: #fff; }

footer.site {
  border-top: 1px solid var(--line);
  padding: 24px 0 40px;
  color: var(--muted); font-size: 14px;
}
footer.site a { color: var(--muted); }

@media (max-width: 520px) {
  .card { flex-direction: column; }
  header.site nav a { margin-left: 14px; }
}

/* ---------- Landing page: interactive globe ---------- */

.wrap.wide { max-width: 1180px; }
.num { font-variant-numeric: tabular-nums; }

.home .hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: 40px;
  align-items: center;
  padding: 24px 0 48px;
}
.home .hero h1 { font-size: clamp(36px, 5.4vw, 64px); }
.home .hero p.lede { margin-top: 18px; }

.eyebrow {
  text-transform: uppercase; letter-spacing: 0.14em; font-size: 13px; font-weight: 600;
  color: var(--cyan); margin: 0 0 14px;
}
#hl-city { color: var(--accent); white-space: nowrap; }
#hl-deg { color: var(--accent); }

.picker { margin-top: 28px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips button, .surprise, .units {
  font: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 14px;
  transition: background 0.15s, border-color 0.15s, transform 0.15s;
}
.chips button:hover, .surprise:hover, .units:hover { background: rgba(255, 255, 255, 0.10); border-color: rgba(255, 255, 255, 0.25); }
.chips button:active, .surprise:active { transform: scale(0.96); }
.chips button[aria-pressed="true"] { background: var(--accent); color: #000; border-color: var(--accent); }
.surprise { margin-top: 12px; border-color: rgba(255, 209, 51, 0.5); color: var(--accent); }
button:focus-visible, a:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }

.stage { position: relative; }
.canvas-wrap {
  position: relative;
  aspect-ratio: 1 / 1;
  width: 100%;
  max-height: 62vh;
  margin: 0 auto;
}
#globe { width: 100%; height: 100%; display: block; cursor: grab; touch-action: pan-y; }
#globe:active { cursor: grabbing; }
.globe-fallback {
  display: none; position: absolute; inset: 0; margin: auto;
  width: 46%; height: auto; border-radius: 22%;
}
.no-webgl #globe, .no-webgl .drag-hint { display: none; }
.no-webgl .globe-fallback { display: block; }

.label {
  position: absolute; left: 0; top: 0;
  transform: translate(-50%, calc(-100% - 12px));
  pointer-events: none;
  font-size: 13px; font-weight: 600; white-space: nowrap;
  padding: 4px 10px; border-radius: 999px;
  background: rgba(5, 10, 23, 0.72);
  border: 1px solid var(--line);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  transition: opacity 0.2s;
}
.label.you { color: #fff; border-color: rgba(76, 216, 255, 0.6); }
.label.target { color: var(--accent); border-color: rgba(255, 209, 51, 0.6); }
.label.hover { color: var(--muted); }
.label.behind { opacity: 0; }

.drag-hint {
  position: absolute; bottom: 4%; left: 0; right: 0; margin: 0;
  text-align: center; font-size: 12px; letter-spacing: 0.08em; color: var(--muted);
  opacity: 0.7; pointer-events: none; transition: opacity 0.6s;
}
.drag-hint.gone { opacity: 0; }

.hud {
  background: rgba(12, 21, 40, 0.75);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 16px 18px;
  margin-top: 4px;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.hud-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 10px; }
.route { font-weight: 700; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.units { padding: 3px 12px; font-size: 13px; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 0; }
.stat dt { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.stat dd { margin: 2px 0 0; font-size: 19px; font-weight: 700; }
.stat.tunnel dd { color: var(--accent); }
.stat.depth dd { color: #ff9f43; }
.stat.fly dd { color: var(--cyan); }
.stat.aim dd { color: #fff; }
.hud .fact { margin: 14px 0 0; font-size: 14px; color: var(--muted); }
.hud .fact strong { color: var(--text); }
.hud .fact .aside { display: block; font-size: 13px; opacity: 0.8; margin-top: 2px; }
.stage .where-note { font-size: 12px; color: var(--muted); opacity: 0.7; margin: 8px 4px 0; }

.home .card { margin-top: 8px; }

@media (max-width: 900px) {
  .home .hero { grid-template-columns: 1fr; gap: 8px; padding-top: 8px; }
  .canvas-wrap { max-width: 520px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  .chips button, .surprise, .label, .drag-hint { transition: none; }
}

.chips .emoji { margin-right: 6px; }
.home .hero h1 { text-wrap: balance; }
@media (min-width: 901px) {
  /* Reserve three lines so picking a longer city name doesn't shove the chips around. */
  .home .hero h1 { min-height: 3.1em; }
}
@media (max-width: 520px) {
  .eyebrow { font-size: 11px; letter-spacing: 0.1em; }
}
