/* ─────────────────────────────────────────────────────────────────────────
   Curiosity Globe — iridescent wireframe blueprint
   Palette:
     void   #04060c   deep cosmic black
     vellum rgba(255,255,255,0.86)   spec-sheet white
     rule   rgba(255,255,255,0.12)   hairline
     chroma cyan / magenta / violet  iridescent accents
   Type:
     Instrument Serif (display, italic)
     Inter (UI)
     JetBrains Mono (tech labels)
   ───────────────────────────────────────────────────────────────────────── */

:root {
  --void: #02101c;
  --void-2: #061b30;
  --sea-top:    #0d3a5e;
  --sea-mid:    #052238;
  --sea-deep:   #02101c;
  --sea-abyss:  #010a14;
  --vellum: rgba(220, 240, 255, 0.92);
  --vellum-soft: rgba(255, 255, 255, 0.56);
  --vellum-faint: rgba(255, 255, 255, 0.28);
  --rule: rgba(255, 255, 255, 0.12);
  --rule-soft: rgba(255, 255, 255, 0.06);

  --chroma-cyan:    #5ce6ff;
  --chroma-violet:  #b18bff;
  --chroma-magenta: #ff6ad9;
  --chroma-mint:    #7affd4;

  --iridescent: linear-gradient(
    90deg,
    #5ce6ff 0%,
    #b18bff 35%,
    #ff6ad9 65%,
    #ffb86d 100%
  );

  --accent: #ff6ad9;
  --accent-soft: rgba(255, 106, 217, 0.16);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  background: var(--sea-abyss);
  color: var(--vellum);
  font-family: 'Inter', system-ui, sans-serif;
  font-feature-settings: 'ss01', 'cv11';
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  /* Deep-sea descent — soft sun glow at the top fading to abyssal black at the floor.
     Layered radial caustics + faint grid suggest light filtering through water. */
  background-image:
    /* shafts of light from above */
    radial-gradient(ellipse 80% 60% at 50% -10%, rgba(120, 200, 255, 0.18), transparent 60%),
    radial-gradient(ellipse 60% 40% at 30% 10%, rgba(92, 230, 255, 0.10), transparent 70%),
    radial-gradient(ellipse 40% 30% at 75% 20%, rgba(177, 139, 255, 0.08), transparent 70%),
    /* faint plankton specks */
    radial-gradient(circle at 20% 30%, rgba(255,255,255,0.06) 0, rgba(255,255,255,0) 1px),
    radial-gradient(circle at 80% 70%, rgba(255,255,255,0.04) 0, rgba(255,255,255,0) 1px),
    /* hairline blueprint grid */
    linear-gradient(rgba(120,200,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(120,200,255,0.025) 1px, transparent 1px),
    /* the abyss — vertical depth gradient */
    linear-gradient(180deg, var(--sea-top) 0%, var(--sea-mid) 35%, var(--sea-deep) 65%, var(--sea-abyss) 100%);
  background-size: 100% 100%, 100% 100%, 100% 100%, 100% 100%, 100% 100%, 64px 64px, 64px 64px, 100% 100%;
  background-attachment: fixed;
}

/* Subtle vignette — no corner ticks */
body::before {
  content: '';
  position: fixed;
  inset: 12px;
  border: 1px solid var(--rule);
  pointer-events: none;
  z-index: 1;
}

.app {
  position: relative;
  width: 100vw;
  height: 100vh;
  display: grid;
  grid-template-columns: 280px 1fr 360px;
  grid-template-rows: 72px 1fr;
  gap: 0;
  z-index: 2;
}

/* ── TOP BAR ────────────────────────────────────────────────────────────── */
.topbar {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 10px 24px 0;
  border-bottom: none;
  background: transparent !important;
  backdrop-filter: none;
  z-index: 10;
  position: relative;
}
/* Inset hairline: starts where the left-rail content begins (22px in)
   and ends where the right-rail content ends — matches the visual
   container edges of "Your travels" and the curiosity card. */
.topbar::after {
  content: '';
  position: absolute;
  left: 22px;
  right: 22px;
  bottom: 0;
  height: 1px;
  background: var(--rule);
  pointer-events: none;
}
.brand {
  display: flex;
  align-items: baseline;
  justify-content: flex-start;
  gap: 10px;
  text-align: left;
}
.brand-mark {
  width: 22px;
  height: 22px;
  border: 1px solid var(--vellum-soft);
  border-radius: 50%;
  position: relative;
  align-self: center;
  background: transparent;
  box-shadow:
    inset 0 0 8px rgba(92, 230, 255, 0.4),
    0 0 12px rgba(177, 139, 255, 0.35);
}
.brand-mark::before {
  content: '';
  position: absolute;
  inset: 2px;
  border-radius: 50%;
  background:
    conic-gradient(
      from 0deg,
      rgba(92,230,255,0.45),
      rgba(177,139,255,0.45),
      rgba(255,106,217,0.45),
      rgba(255,184,109,0.35),
      rgba(92,230,255,0.45)
    );
  opacity: 0.7;
  mix-blend-mode: screen;
}
.brand-mark::after {
  content: '';
  position: absolute;
  inset: 6px;
  border: 1px solid rgba(255,255,255,0.4);
  border-radius: 50%;
}
.brand-name {
  font-family: 'Instrument Serif', Georgia, serif !important;
  font-size: 22px !important;
  letter-spacing: 0.01em;
  font-style: italic;
  font-weight: 400 !important;
  color: var(--vellum);
  background: var(--iridescent);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.brand-sep {
  color: var(--vellum-faint);
  margin: 0 8px;
}
.brand-tag {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--vellum-soft);
}

.topbar-tools {
  display: flex;
  align-items: center;
  gap: 8px;
}

.search {
  display: flex;
  align-items: center;
  height: 32px;
  width: 280px;
  padding: 0 12px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--rule);
  border-radius: 0;
  font-size: 12px;
  font-family: 'JetBrains Mono', monospace;
  color: var(--vellum);
}
.search:focus-within {
  border-color: var(--chroma-cyan);
  background: rgba(92,230,255,0.04);
  box-shadow: 0 0 0 1px rgba(92,230,255,0.25);
}
.search input {
  flex: 1;
  border: 0;
  background: transparent;
  outline: none;
  font: inherit;
  color: inherit;
  padding-left: 8px;
}
.search input::placeholder { color: var(--vellum-faint); }
.search-icon { opacity: 0.5; }

.tool-btn {
  height: 32px;
  padding: 0 14px;
  border: 1px solid var(--rule);
  border-radius: 0;
  background: transparent;
  color: var(--vellum);
  font: inherit;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.tool-btn:hover {
  border-color: var(--vellum-soft);
  background: rgba(255,255,255,0.04);
}
.tool-btn.primary {
  background: var(--vellum);
  color: var(--void);
  border-color: var(--vellum);
}
.tool-btn.primary:hover { background: #fff; }

/* ── LEFT RAIL: stats + categories + visited ────────────────────────────── */
.rail-left {
  border-right: 1px solid var(--rule);
  border-top: 1px solid var(--rule);
  padding: 20px 22px;
  overflow-y: auto;
  background: linear-gradient(180deg, rgba(255,255,255,0.015), transparent 60%);
  font-family: 'Inter', system-ui, sans-serif !important;
  color: var(--vellum);
}
.rail-left::-webkit-scrollbar { width: 4px; }
.rail-left::-webkit-scrollbar-thumb { background: var(--rule); }

.section-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--vellum-soft);
  margin: 0 0 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-label::before {
  content: '';
  width: 6px; height: 6px;
  border: 1px solid var(--vellum-soft);
  display: inline-block;
}
.section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--rule);
}

.stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 32px;
}
.stat {
  padding: 12px 12px 10px;
  border: 1px solid var(--rule);
  border-radius: 0;
  background: rgba(255,255,255,0.015);
  position: relative;
}
.stat-num {
  font-family: 'Instrument Serif', Georgia, serif !important;
  font-size: 30px !important;
  line-height: 1;
  letter-spacing: -0.01em;
  font-style: italic;
  font-weight: 400 !important;
  color: var(--vellum) !important;
  opacity: 1 !important;
}
.stat-num .small { font-size: 14px; opacity: 0.5; }
.stat-lbl {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--vellum-soft);
  margin-top: 8px;
}

.cats { display: flex; flex-direction: column; gap: 1px; margin: 0 -6px 32px; }
.cat {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 0;
  font-size: 12px;
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  color: var(--vellum-soft);
  border-left: 2px solid transparent;
  transition: all 0.15s ease;
}
.cat:hover {
  background: rgba(255,255,255,0.03);
  color: var(--vellum);
}
.cat.on {
  background: rgba(92,230,255,0.06);
  color: var(--chroma-cyan);
  border-left-color: var(--chroma-cyan);
  text-shadow: 0 0 12px rgba(92,230,255,0.4);
}
.cat .glyph {
  width: 14px;
  height: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0.9;
  flex-shrink: 0;
}
.cat .count {
  margin-left: auto;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  opacity: 0.55;
  letter-spacing: 0;
}

.visited-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  max-height: 280px;
  overflow-y: auto;
  margin: 0 -6px;
}
.visited-list::-webkit-scrollbar { width: 3px; }
.visited-list::-webkit-scrollbar-thumb { background: var(--rule); }

.visited-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px !important;
  border-radius: 0;
  font-size: 12px;
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.04em;
  cursor: pointer;
  color: var(--vellum-soft);
  border-left: 2px solid transparent;
}
.visited-item:hover { background: rgba(255,255,255,0.03); color: var(--vellum); }
.visited-item.active {
  background: rgba(255,106,217,0.08);
  color: var(--chroma-magenta);
  border-left-color: var(--chroma-magenta);
  text-shadow: 0 0 10px rgba(255,106,217,0.4);
}
.visited-flag {
  width: 14px;
  height: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  line-height: 1;
  flex-shrink: 0;
  filter: saturate(0.7) brightness(1.05);
}
.visited-item.active .visited-flag { filter: saturate(1) brightness(1.1) drop-shadow(0 0 4px rgba(255,106,217,0.5)); }
.visited-place { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-transform: uppercase; }
.visited-fav {
  font-size: 11px;
  opacity: 0.5;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 0 2px;
  color: inherit;
}
.visited-fav.on { opacity: 1; color: var(--chroma-mint); text-shadow: 0 0 8px rgba(122,255,212,0.6); }

.empty-hint {
  font-size: 11px;
  font-family: 'JetBrains Mono', monospace;
  color: var(--vellum-faint);
  font-style: normal;
  letter-spacing: 0.08em;
  padding: 4px 6px;
  text-transform: uppercase;
}

/* ── CENTER STAGE ───────────────────────────────────────────────────────── */
.stage {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  overflow: hidden;
  padding: 22px 0 0;
  background:
    radial-gradient(ellipse at 50% 38%, rgba(92,230,255,0.10) 0%, transparent 55%),
    radial-gradient(ellipse at 30% 75%, rgba(20,80,140,0.18) 0%, transparent 55%),
    radial-gradient(ellipse at 70% 25%, rgba(177,139,255,0.06) 0%, transparent 55%),
    transparent;
}

.stage-globe-wrap {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  margin-top: -48px;
}

/* ── Category segmented control (above the globe) ─────────────────────── */
.cat-segmented {
  display: inline-flex;
  align-items: stretch;
  gap: 0;
  height: 38px;
  padding: 3px;
  max-width: calc(100% - 32px);
  flex-wrap: nowrap;
  background: rgba(2, 16, 28, 0.55);
  backdrop-filter: blur(8px);
  border: 1px solid var(--rule);
  border-radius: 0;
  position: relative;
  z-index: 5;
  box-shadow:
    inset 0 0 0 1px rgba(92, 230, 255, 0.06),
    0 8px 24px rgba(0,0,0,0.4),
    0 0 30px rgba(92, 230, 255, 0.06);
}

.cat-seg {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--vellum-soft);
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 7px 11px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  position: relative;
  transition: color 0.15s ease;
  white-space: nowrap;
  min-width: 0;
}
.cat-seg:hover { color: var(--vellum); }
.cat-seg .cat-seg-count {
  font-size: 9px;
  opacity: 1;
  color: inherit;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
  padding-left: 2px;
  border-left: 1px solid var(--rule);
  padding-left: 6px;
  margin-left: 2px;
}
.cat-seg .cat-seg-icon {
  width: 12px; height: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0.85;
  flex-shrink: 0;
}
.cat-seg.on {
  background: rgba(92, 230, 255, 0.10);
  color: var(--chroma-cyan);
  text-shadow: 0 0 12px rgba(92, 230, 255, 0.5);
  box-shadow:
    inset 0 0 0 1px rgba(92, 230, 255, 0.3),
    0 0 18px rgba(92, 230, 255, 0.18);
}
.cat-seg.on .cat-seg-count { opacity: 0.85; }
.cat-seg + .cat-seg {
  border-left: 1px solid var(--rule);
}

/* Tighter on narrow stages — hide the count to keep one row */
@media (max-width: 1180px) {
  .cat-seg { padding: 7px 10px; gap: 5px; letter-spacing: 0.1em; }
  .cat-seg .cat-seg-count { display: none; }
}
@media (max-width: 1024px) {
  .cat-seg { padding: 8px 9px; font-size: 9.5px; letter-spacing: 0.06em; }
}
/* Icon-only on very narrow stages so all 4 segments stay on one row */
@media (max-width: 900px) {
  .cat-seg { padding: 8px 10px; gap: 0; }
  .cat-seg span:not(.cat-seg-icon):not(.cat-seg-count) { display: none; }
  .cat-seg .cat-seg-icon { width: 16px; height: 16px; }
}

/* corner construction marks on the stage — removed */

.stage-hint {
  position: absolute;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--vellum-soft);
  pointer-events: none;
}

.coords {
  position: absolute;
  bottom: 22px;
  left: 24px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10px;
  color: var(--vellum-soft);
  letter-spacing: 0.1em;
  pointer-events: none;
  text-transform: uppercase;
}

.compass {
  position: absolute;
  top: 48px;
  right: 24px;
  width: 72px;
  height: 72px;
  border: 1px solid var(--rule);
  border-radius: 50%;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  box-shadow:
    inset 0 0 18px rgba(92,230,255,0.08),
    0 0 24px rgba(177,139,255,0.06);
}
.compass::before {
  content: '';
  position: absolute;
  inset: 10px;
  border: 1px dashed rgba(255,255,255,0.06);
  border-radius: 50%;
}
.compass-needle {
  width: 1.5px;
  height: 26px;
  background: linear-gradient(to bottom,
    var(--chroma-magenta) 0%,
    var(--chroma-magenta) 50%,
    var(--vellum-faint) 50%,
    var(--vellum-faint) 100%);
  transform-origin: center;
  border-radius: 1px;
  filter: drop-shadow(0 0 4px rgba(255,106,217,0.5));
}
.compass span {
  position: absolute;
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  letter-spacing: 0;
  color: var(--vellum-soft);
  font-weight: 500;
  line-height: 1;
  width: 12px;
  height: 10px;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
}
.compass .n { top: 4px;    left: 50%; margin-left: -6px; color: var(--chroma-magenta); }
.compass .s { bottom: 4px; left: 50%; margin-left: -6px; }
.compass .e { right: 3px;  top: 50%;  margin-top: -5px; }
.compass .w { left: 3px;   top: 50%;  margin-top: -5px; }

/* ── GLOBE ──────────────────────────────────────────────────────────────── */
.globe-stage {
  position: relative;
  perspective: 1600px;
  perspective-origin: 50% 38%;
  cursor: grab;
}
.globe-stage:active { cursor: grabbing; }

/* aura halo behind globe — soft iridescent bloom */
.globe-stage::before {
  content: '';
  position: absolute;
  inset: -8%;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 35%, rgba(92,230,255,0.18), transparent 55%),
    radial-gradient(circle at 70% 60%, rgba(255,106,217,0.16), transparent 50%),
    radial-gradient(circle at 50% 80%, rgba(177,139,255,0.14), transparent 55%);
  filter: blur(28px);
  pointer-events: none;
  z-index: 0;
}

.globe-3d {
  position: absolute;
  inset: 0;
  margin: auto;
  transform-style: preserve-3d;
  will-change: transform;
}

.globe-face { display: none; }

.globe-shadow {
  position: absolute;
  bottom: 6%;
  left: 50%;
  transform: translateX(-50%);
  background: radial-gradient(ellipse, rgba(177,139,255,0.18) 0%, transparent 65%);
  filter: blur(10px);
  pointer-events: none;
}

.globe-atmos { display: none; }

/* ── Jellyfish membrane shell ──────────────────────────────────────
   Translucent skin that catches highlights; nucleus glow bleeds through. */
.globe-membrane {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  pointer-events: none;
  background:
    radial-gradient(circle at 35% 30%,
      rgba(255,255,255,0.18) 0%,
      rgba(255,255,255,0.05) 18%,
      rgba(255,255,255,0) 40%),
    radial-gradient(circle at 70% 75%,
      rgba(177,139,255,0.10) 0%,
      rgba(177,139,255,0) 45%),
    radial-gradient(circle at 50% 50%,
      rgba(4,6,12,0) 60%,
      rgba(92,230,255,0.10) 88%,
      rgba(255,106,217,0.18) 100%);
  /* glassy edge */
  box-shadow:
    inset 0 0 40px rgba(92, 230, 255, 0.18),
    inset 0 0 80px rgba(177, 139, 255, 0.12),
    inset 8px -8px 60px rgba(255, 106, 217, 0.12),
    0 0 1px rgba(255, 255, 255, 0.6),
    0 0 36px rgba(177, 139, 255, 0.18);
  /* subtle film-noise look */
  backdrop-filter: blur(0.5px);
  mix-blend-mode: screen;
}
.globe-membrane::before {
  /* specular highlight droplet */
  content: '';
  position: absolute;
  top: 12%; left: 22%;
  width: 38%; height: 28%;
  border-radius: 50%;
  background: radial-gradient(ellipse at 30% 30%,
    rgba(255,255,255,0.45) 0%,
    rgba(255,255,255,0.10) 40%,
    rgba(255,255,255,0) 70%);
  filter: blur(2px);
  transform: rotate(-22deg);
}
.globe-membrane::after {
  /* fresnel limb — bright iridescent ring at the silhouette */
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 50%;
  background: conic-gradient(from 0deg,
    rgba(92,230,255,0.0) 0%,
    rgba(92,230,255,0.5) 12%,
    rgba(177,139,255,0.5) 28%,
    rgba(255,106,217,0.5) 44%,
    rgba(255,184,109,0.4) 60%,
    rgba(122,255,212,0.5) 76%,
    rgba(92,230,255,0.5) 92%,
    rgba(92,230,255,0.0) 100%);
  -webkit-mask: radial-gradient(circle, transparent 0%, transparent 96%, #000 97.5%, #000 100%);
          mask: radial-gradient(circle, transparent 0%, transparent 96%, #000 97.5%, #000 100%);
  opacity: 0.85;
  filter: blur(0.6px);
}

/* ── Inner neon nucleus — chromatic blobs ────────────────────────── */
.globe-nucleus {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  pointer-events: none;
  /* clip blobs to the sphere silhouette */
  overflow: hidden;
}
.nucleus-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(28px);
  mix-blend-mode: screen;
  opacity: 0.55;
  animation: blob-drift 14s ease-in-out infinite;
}
.blob-cyan {
  width: 42%; height: 38%;
  top: 28%; left: 14%;
  background: radial-gradient(circle, rgba(92,230,255,0.55) 0%, rgba(92,230,255,0.25) 35%, rgba(92,230,255,0) 70%);
  animation-delay: -2s;
}
.blob-magenta {
  width: 46%; height: 34%;
  top: 18%; left: 38%;
  background: radial-gradient(circle, rgba(255,106,217,0.55) 0%, rgba(255,106,217,0.25) 35%, rgba(255,106,217,0) 70%);
  animation-delay: -6s;
}
.blob-violet {
  width: 50%; height: 42%;
  top: 42%; left: 32%;
  background: radial-gradient(circle, rgba(177,139,255,0.5) 0%, rgba(177,139,255,0.22) 35%, rgba(177,139,255,0) 70%);
  animation-delay: -9s;
}
.blob-amber {
  width: 28%; height: 26%;
  top: 56%; left: 18%;
  background: radial-gradient(circle, rgba(255,184,109,0.45) 0%, rgba(255,184,109,0.20) 35%, rgba(255,184,109,0) 70%);
  animation-delay: -4s;
}
.blob-mint {
  width: 32%; height: 30%;
  top: 52%; left: 56%;
  background: radial-gradient(circle, rgba(122,255,212,0.45) 0%, rgba(122,255,212,0.20) 35%, rgba(122,255,212,0) 70%);
  animation-delay: -11s;
}
@keyframes blob-drift {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25%      { transform: translate(8%, -4%) scale(1.08); }
  50%      { transform: translate(-6%, 6%) scale(0.94); }
  75%      { transform: translate(4%, 8%) scale(1.04); }
}

/* ── Land styles ─────────────────────────────────────────────── */
.land-dot, .land-stroke, .land-solid {
  position: absolute;
  top: 50%;
  left: 50%;
  pointer-events: none;
  backface-visibility: hidden;
}
.land-dot {
  width: 3px; height: 3px;
  margin: -1.5px 0 0 -1.5px;
  border-radius: 50%;
  background: var(--chroma-cyan);
  opacity: 0.85;
  box-shadow: 0 0 4px rgba(92,230,255,0.6);
}
.land-stroke {
  width: 5px; height: 1px;
  margin: -0.5px 0 0 -2.5px;
  background: var(--vellum-soft);
  opacity: 0.7;
  border-radius: 1px;
}
.land-solid {
  width: 5px; height: 5px;
  margin: -2.5px 0 0 -2.5px;
  border-radius: 50%;
  background: var(--chroma-violet);
  opacity: 0.85;
  box-shadow: 0 0 6px rgba(177,139,255,0.5);
}
.land-outline {
  position: absolute;
  top: 50%; left: 50%;
  width: 6px; height: 6px;
  margin: -3px 0 0 -3px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  pointer-events: none;
  backface-visibility: hidden;
}
.land-wirefill {
  position: absolute;
  top: 50%; left: 50%;
  width: 7px; height: 7px;
  margin: -3.5px 0 0 -3.5px;
  border-radius: 50%;
  background: rgba(177, 139, 255, 0.12);
  pointer-events: none;
  backface-visibility: hidden;
}

/* ── Region labels ─────────────────────────────────────────────── */
.region-labels-layer {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 3;
}
.region-label {
  position: absolute;
  pointer-events: none;
  white-space: nowrap;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 500;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--vellum);
  text-shadow: 0 0 6px rgba(4,6,12,0.9), 0 0 10px rgba(4,6,12,0.7);
  transition: opacity 0.2s ease;
}
.region-lg { font-size: 10px; letter-spacing: 0.32em; }
.region-md { font-size: 9px; letter-spacing: 0.26em; }
.region-sm { font-size: 8px; letter-spacing: 0.22em; opacity: 0.7; }
.region-ocean {
  font-family: 'Instrument Serif', Georgia, serif;
  font-style: italic;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0.04em;
  font-size: 14px;
  color: rgba(255,255,255,0.32);
}
.region-ocean-sm {
  font-family: 'Instrument Serif', Georgia, serif;
  font-style: italic;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0.04em;
  font-size: 11px;
  color: rgba(255,255,255,0.26);
}

/* ── Graticule ─── glowing iridescent wires ──────────────────────── */
/* NOTE: NO z-index here — these live inside `transform-style: preserve-3d`,
   and z-index would collapse them into a flat 2D stacking context and
   break the sphere illusion. DOM order handles stacking; 3D transforms
   handle depth. */
.grat-meridian {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border-left: 1px solid rgba(92, 230, 255, 0.32);
  border-right: 1px solid rgba(255, 106, 217, 0.32);
  pointer-events: none;
  box-shadow:
    inset 1px 0 4px rgba(92, 230, 255, 0.18),
    inset -1px 0 4px rgba(255, 106, 217, 0.18);
}
.grat-parallel {
  position: absolute;
  top: 50%; left: 50%;
  border-radius: 50%;
  border: 1px solid rgba(177, 139, 255, 0.30);
  pointer-events: none;
  box-shadow: 0 0 6px rgba(177, 139, 255, 0.14);
}
.globe-style-wire .grat-meridian {
  border-left-color: rgba(92, 230, 255, 0.55);
  border-right-color: rgba(255, 106, 217, 0.55);
  box-shadow:
    inset 1px 0 6px rgba(92, 230, 255, 0.35),
    inset -1px 0 6px rgba(255, 106, 217, 0.35);
}
.globe-style-wire .grat-parallel {
  border-color: rgba(177, 139, 255, 0.5);
  box-shadow: 0 0 10px rgba(177, 139, 255, 0.25);
}

/* ── Pin ────────────────────────────────────────────────────────────── */
.globe-pin {
  position: absolute;
  top: 50%; left: 50%;
  width: 0; height: 0;
  pointer-events: none;
}
.globe-pin-dot {
  position: absolute;
  width: 10px; height: 10px;
  margin: -5px 0 0 -5px;
  border-radius: 50%;
  background: var(--chroma-magenta);
  box-shadow:
    0 0 0 2px rgba(255,106,217,0.25),
    0 0 12px rgba(255,106,217,0.85),
    0 0 24px rgba(255,106,217,0.45);
}
.globe-pin-stem {
  position: absolute;
  width: 1px; height: 22px;
  margin: -27px 0 0 -0.5px;
  background: linear-gradient(to bottom, transparent, var(--chroma-magenta));
  border-radius: 1px;
  opacity: 0.9;
  filter: drop-shadow(0 0 4px rgba(255,106,217,0.6));
}
.globe-pin-pulse {
  position: absolute;
  width: 10px; height: 10px;
  margin: -5px 0 0 -5px;
  border-radius: 50%;
  border: 1px solid var(--chroma-magenta);
  animation: pin-pulse 1.8s ease-out infinite;
}
@keyframes pin-pulse {
  0%   { transform: scale(1);   opacity: 0.9; }
  100% { transform: scale(4);   opacity: 0;   }
}
.globe-visited {
  position: absolute;
  top: 50%; left: 50%;
  width: 5px; height: 5px;
  margin: -2.5px 0 0 -2.5px;
  border-radius: 50%;
  background: var(--chroma-mint);
  opacity: 0.7;
  pointer-events: none;
  box-shadow: 0 0 6px rgba(122,255,212,0.5);
}

/* ── Floating "drop pin" controls bottom of stage ─────────────────────── */
.stage-controls {
  position: absolute;
  bottom: 22px;
  left: 24px;
  right: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  z-index: 4;
}

.shuffle-btn {
  height: 34px;
  padding: 0 17px;
  border-radius: 0;
  background: rgba(2, 16, 28, 0.55);
  backdrop-filter: blur(8px);
  color: var(--vellum);
  border: 1px solid var(--chroma-violet);
  font: inherit;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  position: relative;
  overflow: hidden;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
  box-shadow:
    inset 0 0 0 1px rgba(177, 139, 255, 0.12),
    0 0 24px rgba(177, 139, 255, 0.20);
}
/* iridescent sweep sits idle on the button; runs only when .spinning is added on click */
.shuffle-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    100deg,
    transparent 0%,
    transparent 35%,
    rgba(177, 139, 255, 0.30) 50%,
    rgba(92, 230, 255, 0.25) 60%,
    transparent 80%
  );
  transform: translateX(-100%);
  pointer-events: none;
}
.shuffle-btn:hover {
  border-color: var(--chroma-violet);
  color: #fff;
  background: rgba(177, 139, 255, 0.10);
}
.shuffle-btn:active {
  transform: translateY(1px);
}

/* ── Click-triggered animation ────────────────────────────────────── */
.shuffle-btn.spinning {
  animation: shuffle-pulse 0.7s ease-out;
}
.shuffle-btn.spinning::before {
  animation: shuffle-sweep 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.shuffle-btn.spinning .spin-ico {
  animation: spin-ico-rotate 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
}
@keyframes shuffle-sweep {
  from { transform: translateX(-100%); }
  to   { transform: translateX(100%); }
}
@keyframes shuffle-pulse {
  0% {
    box-shadow:
      inset 0 0 0 1px rgba(177, 139, 255, 0.12),
      0 0 24px rgba(177, 139, 255, 0.20);
  }
  40% {
    box-shadow:
      inset 0 0 0 1px rgba(177, 139, 255, 0.55),
      0 0 60px rgba(177, 139, 255, 0.65),
      0 0 100px rgba(92, 230, 255, 0.35);
    text-shadow: 0 0 14px rgba(177, 139, 255, 0.75);
  }
  100% {
    box-shadow:
      inset 0 0 0 1px rgba(177, 139, 255, 0.12),
      0 0 24px rgba(177, 139, 255, 0.20);
  }
}
@keyframes spin-ico-rotate {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
.shuffle-btn .spin-ico {
  flex-shrink: 0;
  opacity: 0.95;
}

.zoom-ctrl {
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: var(--void);
  border: 1px solid var(--rule);
  border-radius: 0;
  overflow: hidden;
}
.zoom-btn {
  width: 32px; height: 28px;
  border: none;
  background: transparent;
  color: var(--vellum);
  font-size: 14px;
  cursor: pointer;
  font-weight: 600;
}
.zoom-btn:hover { background: rgba(255,255,255,0.05); }

/* ── RIGHT RAIL: curiosity card ───────────────────────────────────── */
.rail-right {
  border-left: 1px solid var(--rule);
  border-top: 1px solid var(--rule);
  background: linear-gradient(180deg, rgba(255,255,255,0.015), transparent 60%);
  padding: 22px 26px 26px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  position: relative;
}
.rail-right::-webkit-scrollbar { width: 4px; }
.rail-right::-webkit-scrollbar-thumb { background: var(--rule); }

/* small spec frame in top-right of rail */
.rail-right::before {
  content: 'SPEC / 001';
  position: absolute;
  top: 14px;
  right: 22px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.2em;
  color: var(--vellum-faint);
}

.curiosity {
  display: flex;
  flex-direction: column;
  gap: 14px !important;
  position: relative;
  padding-top: 24px;
}
.curiosity::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 60px;
  height: 1px;
  background: var(--iridescent);
}
.curiosity-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--vellum-soft);
}
.curiosity-meta .pip {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--chroma-magenta);
  box-shadow: 0 0 6px var(--chroma-magenta);
}
.curiosity-place {
  font-family: 'Instrument Serif', Georgia, serif;
  font-style: italic;
  font-size: 14px;
  color: var(--vellum);
  text-transform: none;
  letter-spacing: 0;
  margin-left: auto;
}
.curiosity-coord {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: var(--vellum-soft);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.curiosity-title {
  font-family: 'Instrument Serif', Georgia, serif !important;
  font-weight: 400 !important;
  font-style: italic !important;
  font-size: 30px !important;
  line-height: 1.18 !important;
  letter-spacing: -0.01em;
  margin: 14px 0 22px !important;
  color: var(--vellum);
  text-wrap: pretty;
}
.curiosity-title em { font-style: italic; }
.curiosity-fact {
  font-size: 13px;
  line-height: 1.6;
  color: var(--vellum-soft);
  margin: 0;
  text-wrap: pretty;
}
.curiosity-rule {
  border: none;
  border-top: 1px solid var(--rule);
  margin: 8px 0;
}
.curiosity-actions {
  display: flex;
  gap: 8px;
  margin-top: auto;
  padding-top: 16px;
}
.act {
  flex: 1;
  height: 36px;
  border-radius: 0;
  border: 1px solid var(--vellum-soft);
  background: transparent;
  color: var(--vellum);
  font: inherit;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s ease;
}
.act.fill {
  background: var(--vellum);
  color: var(--void);
  border-color: var(--vellum);
}
.act:hover {
  border-color: var(--chroma-cyan);
  color: var(--chroma-cyan);
  background: rgba(92,230,255,0.05);
  text-shadow: 0 0 10px rgba(92,230,255,0.4);
}
.act.fill:hover {
  background: var(--chroma-cyan);
  color: var(--void);
  border-color: var(--chroma-cyan);
  text-shadow: none;
  box-shadow: 0 0 24px rgba(92,230,255,0.4);
}
.act.faved {
  color: var(--chroma-mint);
  border-color: var(--chroma-mint);
  text-shadow: 0 0 8px rgba(122,255,212,0.5);
}
.act.faved:hover {
  background: var(--chroma-mint);
  color: var(--void);
  text-shadow: none;
}

.empty-curiosity {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 18vh;
  text-align: center;
  color: var(--vellum-soft);
}
.empty-curiosity .glyph {
  width: 64px; height: 64px;
  margin: 0 auto 14px;
  border: 1px solid var(--vellum-faint);
  border-radius: 50%;
  position: relative;
  box-shadow:
    inset 0 0 18px rgba(92,230,255,0.15),
    0 0 24px rgba(177,139,255,0.15);
}
.empty-curiosity .glyph::before {
  content: '';
  position: absolute;
  inset: 8px;
  border: 1px dashed rgba(255,255,255,0.08);
  border-radius: 50%;
}
.empty-curiosity .glyph::after {
  content: '';
  position: absolute;
  width: 8px; height: 8px;
  background: var(--chroma-magenta);
  border-radius: 50%;
  top: 14px; left: 42px;
  box-shadow: 0 0 12px var(--chroma-magenta);
}
.empty-curiosity h3 {
  font-family: 'Instrument Serif', Georgia, serif;
  font-style: italic;
  font-size: 22px;
  font-weight: 400;
  margin: 0;
  color: var(--vellum);
}
.empty-curiosity p {
  font-size: 12px;
  line-height: 1.55;
  margin: 0;
  max-width: 240px;
  margin-left: auto; margin-right: auto;
  color: var(--vellum-soft);
}
.empty-curiosity b {
  color: var(--chroma-cyan);
  font-weight: 500;
}
.empty-cta {
  color: var(--chroma-cyan);
  font-weight: 500;
  text-decoration: none;
  border-bottom: 1px solid rgba(92, 230, 255, 0.4);
  padding-bottom: 1px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.empty-cta:hover {
  text-shadow: 0 0 10px rgba(92, 230, 255, 0.6);
  border-bottom-color: var(--chroma-cyan);
}

/* ── Curiosity card layout variants ────────────────────────────── */

/* "floating" — anchored card next to pin overlaying the stage */
.app[data-card-pos="floating"] { grid-template-columns: 280px 1fr; }
.app[data-card-pos="floating"] .rail-right { display: none; }
.curiosity-floating {
  position: absolute;
  top: 26%;
  right: 6%;
  width: 320px;
  background: rgba(4,6,12,0.85);
  backdrop-filter: blur(8px);
  border: 1px solid var(--vellum-soft);
  padding: 24px 22px 20px;
  z-index: 5;
  box-shadow:
    0 0 0 1px rgba(92,230,255,0.15),
    0 24px 60px rgba(0,0,0,0.6),
    0 0 60px rgba(177,139,255,0.18);
  animation: card-pop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.curiosity-floating::after {
  /* corner tick removed */
  content: none;
}
.curiosity-floating .curiosity-title {
  font-size: 22px !important;
  line-height: 1.22;
  margin-bottom: 20px !important;
}
@keyframes card-pop {
  from { transform: translateY(8px) scale(0.96); opacity: 0; }
  to   { transform: translateY(0)   scale(1);    opacity: 1; }
}

/* "bottom" — sheet rises from bottom of stage */
.app[data-card-pos="bottom"] { grid-template-columns: 280px 1fr; }
.app[data-card-pos="bottom"] .rail-right { display: none; }
.curiosity-bottom {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: rgba(4,6,12,0.94);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--vellum-soft);
  padding: 24px 32px 26px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 28px;
  align-items: end;
  z-index: 5;
  box-shadow:
    0 -1px 0 0 rgba(92,230,255,0.2),
    0 -16px 50px rgba(177,139,255,0.1);
  animation: sheet-up 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.curiosity-bottom .curiosity-title { font-size: 28px !important; max-width: 720px; }
.curiosity-bottom .curiosity-fact  { font-size: 13px; max-width: 720px; }
.curiosity-bottom .curiosity-actions {
  flex-direction: column;
  gap: 8px;
  width: 200px;
  padding: 0;
}
@keyframes sheet-up {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}
.app[data-card-pos="bottom"] .stage-controls { display: none; }

/* ── Search results dropdown ───────────────────────────────────────── */
.search-results {
  position: absolute;
  top: 50px;
  right: 24px;
  width: 320px;
  background: rgba(4,6,12,0.95);
  backdrop-filter: blur(10px);
  border: 1px solid var(--vellum-soft);
  box-shadow: 0 12px 32px rgba(0,0,0,0.6), 0 0 0 1px rgba(92,230,255,0.15);
  max-height: 320px;
  overflow-y: auto;
  z-index: 20;
}
.sr-item {
  padding: 10px 14px;
  font-size: 12px;
  cursor: pointer;
  border-bottom: 1px solid var(--rule);
  display: flex;
  flex-direction: column;
  gap: 2px;
  color: var(--vellum);
}
.sr-item:hover { background: rgba(92,230,255,0.06); }
.sr-item:last-child { border-bottom: none; }
.sr-item-place { font-weight: 500; font-family: 'JetBrains Mono', monospace; text-transform: uppercase; letter-spacing: 0.08em; }
.sr-item-fact {
  font-size: 11px;
  color: var(--vellum-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sr-empty { padding: 16px; text-align: center; color: var(--vellum-soft); font-size: 12px; font-style: italic; }

/* ── Toast for "did you know" suggestions ──────────────────────────── */
.toast {
  position: absolute;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--void);
  color: var(--vellum);
  padding: 10px 18px;
  border: 1px solid var(--vellum-soft);
  border-radius: 0;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  white-space: nowrap;
  box-shadow: 0 0 24px rgba(92,230,255,0.2);
  z-index: 6;
  animation: toast-in 0.3s ease;
}
@keyframes toast-in {
  from { opacity: 0; transform: translate(-50%, 8px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}

/* Projected continents — iridescent on dark.
   No per-circle filter (expensive on hundreds of dots); the screen
   blend mode + the existing globe-stage aura provide the glow. */
.projected-continents circle {
  /* keep dots crisp + cheap */
}
