:root {
  --bg: #02030a;
  --bg-2: #070b1c;
  --ink: #f2f4ff;
  --ink-2: rgba(242, 244, 255, 0.72);
  --ink-3: rgba(242, 244, 255, 0.5);
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.18);
  --glass: rgba(10, 14, 28, 0.72);

  --edu: #60a5fa;
  --career: #f97316;
  --skills: #a78bfa;
  --hobbies: #34d399;
  --travel: #f472b6;

  --sans: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  width: 100%; height: 100%;
  height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  touch-action: none;
}
#globe-canvas { touch-action: none; }

/* Subtle starfield background via radial gradients */
body::before {
  content: "";
  position: fixed; inset: 0;
  background:
    radial-gradient(ellipse at 20% 10%, rgba(40, 60, 130, 0.35), transparent 55%),
    radial-gradient(ellipse at 85% 80%, rgba(90, 30, 130, 0.22), transparent 55%),
    radial-gradient(ellipse at 50% 50%, rgba(10, 18, 40, 1), #01020a 70%);
  pointer-events: none;
  z-index: 0;
}

/* ─── Splash ────────────────────────────────────────────────── */
.splash {
  position: fixed; inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  background: radial-gradient(ellipse at center, #050a22 0%, #01020a 65%);
  transition: opacity 0.8s ease, transform 0.8s ease;
}
.splash.hide {
  opacity: 0;
  transform: scale(1.08);
  pointer-events: none;
}
.splash-inner {
  text-align: center;
  position: relative;
  z-index: 2;
  padding: 32px;
  max-width: 720px;
}
.splash-eyebrow {
  font-size: 12px;
  color: var(--ink-3);
  margin-bottom: 28px;
}
.splash-name {
  font-weight: 600;
  font-size: clamp(44px, 6vw, 80px);
  line-height: 1;
  margin: 0 0 18px;
  letter-spacing: -0.035em;
}
.splash-name .first { display: inline-block; }
.splash-name .last  { display: inline-block; }
.splash-tagline {
  font-size: 17px;
  color: var(--ink-2);
  margin: 0 auto 36px;
  max-width: 520px;
  line-height: 1.55;
}
.splash-tagline em { font-style: normal; color: var(--ink); }
.splash-btn {
  display: inline-flex; align-items: center; gap: 10px;
  background: #f2f4ff; color: #02030a;
  border: none; border-radius: 999px;
  padding: 14px 24px;
  font: 500 15px/1 var(--sans);
  cursor: pointer;
  transition: background 0.2s ease;
}
.splash-btn:hover { background: #fff; }
.splash-hint {
  margin-top: 28px;
  font-size: 13px;
  color: var(--ink-3);
}
.splash-hint kbd {
  font: inherit;
  font-size: 11px;
  padding: 1px 6px;
  margin: 0 1px;
  border-radius: 4px;
  border: 1px solid var(--line-strong);
  color: var(--ink-2);
}
.splash-alt {
  display: inline-block;
  margin-top: 14px;
  font-size: 13px;
  color: var(--ink-2);
  text-underline-offset: 3px;
}
.splash-alt:hover { color: var(--ink); }

.splash-stars {
  position: absolute; inset: 0;
  background-image:
    radial-gradient(1px 1px at 20% 30%, #fff, transparent),
    radial-gradient(1px 1px at 70% 15%, rgba(255,255,255,0.7), transparent),
    radial-gradient(1px 1px at 45% 70%, rgba(180,200,255,0.8), transparent),
    radial-gradient(1px 1px at 90% 60%, #fff, transparent),
    radial-gradient(1px 1px at 10% 80%, rgba(255,255,255,0.5), transparent),
    radial-gradient(1px 1px at 60% 45%, rgba(255,255,255,0.6), transparent),
    radial-gradient(1px 1px at 30% 55%, #fff, transparent),
    radial-gradient(1px 1px at 80% 85%, rgba(220,230,255,0.7), transparent);
  background-size: 100% 100%;
  opacity: 0.6;
  animation: twinkle 6s ease-in-out infinite alternate;
}
@keyframes twinkle {
  from { opacity: 0.35; }
  to   { opacity: 0.75; }
}

.hidden { display: none !important; }

/* ─── Top bar ──────────────────────────────────────────────── */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 20;
  padding: 18px 28px;
  display: flex;
  align-items: center;
  gap: 24px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.8s ease 0.4s;
}
.topbar.show { opacity: 1; }
.topbar > * { pointer-events: auto; }

.topbar-left { display: flex; align-items: center; gap: 14px; }
.mark {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  font-size: 13px;
  font-weight: 600;
  background: rgba(255,255,255,0.04);
}
.topbar-name { line-height: 1.1; }
.tn-1 { font-size: 14px; font-weight: 600; letter-spacing: -0.01em; }
.tn-2 { font-size: 12px; color: var(--ink-3); margin-top: 2px; }

.topbar-filters {
  display: flex;
  gap: 6px;
  flex: 1;
  justify-content: center;
  flex-wrap: wrap;
}
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 14px;
  border-radius: 999px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--line);
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}
.chip:hover { background: rgba(255,255,255,0.08); color: var(--ink); }
.chip.active {
  background: rgba(255,255,255,0.92);
  color: #02030a;
  border-color: transparent;
}
.chip .dot {
  width: 7px; height: 7px; border-radius: 50%;
  box-shadow: 0 0 6px currentColor;
}

.topbar-right { display: flex; gap: 8px; }
.ghost-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--line);
  color: var(--ink-2);
  font: 500 12px/1 var(--sans);
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.ghost-btn:hover { background: rgba(255,255,255,0.1); color: var(--ink); }

/* ─── Stage ────────────────────────────────────────────────── */
.stage {
  position: fixed; inset: 0;
  z-index: 5;
}
#globe-canvas {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  display: block;
  cursor: grab;
}
#globe-canvas.grabbing { cursor: grabbing; }
#globe-canvas.hover-pin { cursor: pointer; }

.overlay {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 6;
}
.overlay .pin-label {
  font-size: 12px;
  fill: var(--ink);
  opacity: 0.9;
  paint-order: stroke;
  stroke: rgba(0,0,0,0.7);
  stroke-width: 3px;
  stroke-linejoin: round;
}
.overlay .pin-label-bg {
  fill: rgba(5, 8, 20, 0.75);
  stroke: rgba(255,255,255,0.12);
}
.overlay .pin-tick {
  stroke: rgba(255,255,255,0.45);
  stroke-width: 1;
}

/* ─── Loading ──────────────────────────────────────────────── */
.loading {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  background: radial-gradient(ellipse at center, rgba(5,8,20,0.6) 0%, transparent 70%);
  z-index: 15;
  pointer-events: none;
  opacity: 1;
  transition: opacity 0.5s ease;
}
.loading.hide { opacity: 0; }
.loading-ring {
  width: 36px; height: 36px;
  border: 2px solid rgba(255,255,255,0.1);
  border-top-color: #b8c8ff;
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
  margin-bottom: 12px;
}
.loading-text {
  font-size: 11px;
  color: var(--ink-3);
  text-align: center;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Info card ────────────────────────────────────────────── */
.info-card {
  position: absolute;
  top: 88px; right: 32px;
  width: 360px;
  max-width: calc(100vw - 48px);
  /* stop above the timeline panel */
  max-height: calc(100dvh - 88px - 176px);
  overflow-y: auto;
  scrollbar-width: thin;
  background: linear-gradient(180deg, rgba(14, 20, 42, 0.92), rgba(6, 10, 24, 0.92));
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  padding: 24px 26px 26px;
  z-index: 12;
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.03),
    0 40px 80px -20px rgba(0,0,0,0.6),
    inset 0 1px 0 rgba(255,255,255,0.06);
  animation: card-in 0.4s cubic-bezier(.2,.9,.2,1);
}
@keyframes card-in {
  from { opacity: 0; transform: translateX(12px); }
  to   { opacity: 1; transform: translateX(0); }
}
.info-close {
  position: absolute; top: 12px; right: 14px;
  width: 28px; height: 28px;
  background: transparent;
  border: none;
  color: var(--ink-3);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  border-radius: 50%;
  transition: all 0.15s ease;
}
.info-close:hover { background: rgba(255,255,255,0.08); color: var(--ink); }
.info-chip {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.05);
  border: 1px solid currentColor;
  margin-bottom: 14px;
}
.info-chip::before {
  content: "";
  width: 6px; height: 6px; border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 6px currentColor;
}
.info-title {
  font-weight: 600;
  font-size: 24px;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 4px;
}
.info-sub {
  font-size: 14px;
  color: var(--ink-2);
  margin-bottom: 14px;
}
.info-meta {
  display: flex; align-items: center; gap: 8px;
  font-size: 11px;
  color: var(--ink-3);
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}
.info-meta .dot { opacity: 0.5; }
.info-blurb {
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--ink-2);
  margin: 0 0 18px;
}
.info-highlights {
  margin: -6px 0 18px;
  padding: 0 0 0 16px;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--ink-2);
}
.info-highlights li { margin: 0 0 6px; }
.info-highlights li::marker { color: var(--ink-3); }
.info-link {
  display: inline-block;
  margin: -6px 0 16px;
  font-size: 14px;
  font-weight: 500;
  color: #b8c8ff;
  text-decoration: none;
}
.info-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.info-tags {
  display: flex; gap: 6px;
  flex-wrap: wrap;
}
.info-tag {
  font-size: 12px;
  padding: 3px 9px;
  border-radius: 4px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--line);
  color: var(--ink-2);
}

/* ─── Timeline ─────────────────────────────────────────────── */
.timeline {
  position: fixed;
  left: 32px; right: 32px;
  bottom: 24px;
  max-width: 760px;
  margin: 0 auto;
  background: linear-gradient(180deg, rgba(14, 20, 42, 0.82), rgba(6, 10, 24, 0.82));
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  padding: 18px 24px 16px;
  z-index: 14;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.6s ease 0.8s, transform 0.6s ease 0.8s;
}
.timeline.show { opacity: 1; transform: translateY(0); }

.timeline-label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 12px;
}
.tl-title {
  font-size: 12px;
  color: var(--ink-3);
}
.tl-year {
  font-size: 20px;
  font-weight: 600;
  color: #fdba74;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.timeline-track {
  position: relative;
  height: 32px;
}

#tl-scrubber {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  height: 4px;
  background: rgba(255,255,255,0.08);
  border-radius: 2px;
  outline: none;
  margin: 14px 0 0;
  position: relative; z-index: 2;
}
#tl-scrubber::-webkit-slider-thumb {
  appearance: none;
  -webkit-appearance: none;
  width: 18px; height: 18px;
  background: #fdba74;
  border: 3px solid #02030a;
  border-radius: 50%;
  box-shadow: 0 0 12px rgba(253, 186, 116, 0.7);
  cursor: grab;
}
#tl-scrubber::-moz-range-thumb {
  width: 18px; height: 18px;
  background: #fdba74;
  border: 3px solid #02030a;
  border-radius: 50%;
  box-shadow: 0 0 12px rgba(253, 186, 116, 0.7);
  cursor: grab;
}
#tl-scrubber:active::-webkit-slider-thumb { cursor: grabbing; }

.timeline-ticks {
  position: absolute;
  left: 0; right: 0;
  top: 14px;
  height: 4px;
  pointer-events: none;
}
.timeline-ticks .tick {
  position: absolute;
  top: -4px;
  width: 2px; height: 12px;
  background: rgba(255,255,255,0.3);
  transform: translateX(-50%);
}
.timeline-ticks .tick-label {
  position: absolute;
  top: 12px;
  font-size: 11px;
  color: var(--ink-3);
  transform: translateX(-50%);
  white-space: nowrap;
}
.timeline-meta {
  margin-top: 6px;
  font-size: 12px;
  color: var(--ink-3);
  text-align: center;
}

/* ─── Tweaks panel ─────────────────────────────────────────── */
.tweaks {
  position: fixed;
  right: 20px;
  bottom: 160px;
  width: 280px;
  background: linear-gradient(180deg, rgba(14, 20, 42, 0.92), rgba(6, 10, 24, 0.92));
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  z-index: 30;
  font-size: 12px;
  overflow: hidden;
  animation: card-in-r 0.4s cubic-bezier(.2,.9,.2,1);
}
@keyframes card-in-r {
  from { opacity: 0; transform: translateX(12px); }
  to   { opacity: 1; transform: translateX(0); }
}
.tweaks-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 14px;
  font-size: 12px;
  color: var(--ink-2);
  border-bottom: 1px solid var(--line);
}
.tweaks-body { padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.tw-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.tw-row label { color: var(--ink-2); font-size: 11px; }
.tw-row input[type="range"] { width: 120px; accent-color: #b8c8ff; }
.tw-row input[type="checkbox"] { accent-color: #b8c8ff; }
.tw-row select {
  background: rgba(255,255,255,0.05);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 4px 8px;
  font: 500 11px/1 var(--sans);
}


/* ─── View switch (shared with the solar-system page) ──────── */
.view-switch {
  display: inline-flex;
  padding: 3px;
  border-radius: 999px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--line);
}
.view-switch a {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-2);
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}
.view-switch a:hover { color: var(--ink); background: rgba(255,255,255,0.06); }
.view-switch a[aria-current="page"] { background: rgba(255,255,255,0.92); color: #02030a; }
.view-switch svg { width: 14px; height: 14px; }
.topbar-right { align-items: center; }

/* ─── Hover tooltip ────────────────────────────────────────── */
.pin-tip {
  position: absolute;
  left: 0; top: 0;
  z-index: 11;
  display: flex; align-items: center; gap: 8px;
  padding: 7px 11px;
  border-radius: 10px;
  background: rgba(6, 10, 24, 0.9);
  border: 1px solid var(--line-strong);
  font-size: 12.5px;
  white-space: nowrap;
  pointer-events: none;
  transform: translate(14px, -50%);
}
.pin-tip-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: 0 0 auto; }
.pin-tip-title { color: var(--ink); font-weight: 500; }
.pin-tip-city { color: var(--ink-3); }

/* ─── Info card: nearby + navigation ───────────────────────── */
.info-nearby {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.info-nearby-label { font-size: 12px; color: var(--ink-3); margin-bottom: 8px; }
.info-nearby-list { display: flex; flex-direction: column; gap: 4px; }
.info-nearby-item {
  display: flex; align-items: center; gap: 9px;
  width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: rgba(255,255,255,0.03);
  color: var(--ink-2);
  font: 400 13px/1.3 var(--sans);
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.info-nearby-item:hover { background: rgba(255,255,255,0.08); color: var(--ink); }
.info-nearby-item .dot { width: 6px; height: 6px; border-radius: 50%; flex: 0 0 auto; }
.info-nearby-item .yr { margin-left: auto; color: var(--ink-3); font-size: 12px; font-variant-numeric: tabular-nums; }
.info-nav {
  /* pinned to the card's bottom edge when the card scrolls */
  position: sticky;
  bottom: -26px;
  display: flex; align-items: center; justify-content: space-between;
  margin: 18px -26px -26px;
  padding: 12px 26px 14px;
  border-top: 1px solid var(--line);
  background: rgb(7, 11, 26);
}
.info-count { font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.info-nav-btn {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.04);
  color: var(--ink-2);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.info-nav-btn:hover { background: rgba(255,255,255,0.1); color: var(--ink); }

/* ─── Timeline play ────────────────────────────────────────── */
.tl-play {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 12px 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: rgba(255,255,255,0.05);
  color: var(--ink);
  font: 500 12px/1 var(--sans);
  cursor: pointer;
  transition: background 0.15s ease;
}
.tl-play:hover { background: rgba(255,255,255,0.12); }
.tl-play .i-stop { display: none; }
.tl-play[aria-pressed="true"] .i-stop { display: block; }
.tl-play[aria-pressed="true"] .i-play { display: none; }
.timeline-label { gap: 12px; align-items: center; }
.timeline-label .tl-title { margin-right: auto; }
.timeline-ticks .tick.is-past { background: #fdba74; }

:focus-visible { outline: 2px solid #b8c8ff; outline-offset: 2px; }

/* ─── Responsive ──────────────────────────────────────────── */
@media (max-width: 720px) {
  .topbar {
    padding: 10px 12px;
    padding-top: max(10px, env(safe-area-inset-top));
    gap: 10px;
  }
  .mark { width: 32px; height: 32px; font-size: 12px; }
  .topbar-name { display: none; }
  .tn-1 { font-size: 12px; }
  .tn-2 { font-size: 12px; }

  /* Horizontally-scrollable chip rail instead of hiding filters */
  .topbar-filters {
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    justify-content: flex-start;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    mask-image: linear-gradient(90deg, transparent, #000 12px, #000 calc(100% - 12px), transparent);
    padding: 2px 4px;
    flex: 1 1 auto;
    min-width: 0;
  }
  .topbar-filters::-webkit-scrollbar { display: none; }
  .chip { flex: 0 0 auto; padding: 6px 12px; font-size: 11px; }

  .ghost-btn { padding: 7px 11px; font-size: 11px; }
  .ghost-btn span, .view-switch .vs-label { display: none; }
  .view-switch a { padding: 6px 9px; }
  .tl-play-label { display: none; }
  .tl-play { padding: 7px; }
  .pin-tip { display: none; }

  .info-card {
    right: 10px; left: 10px;
    width: auto;
    transform: none;
    top: auto;
    bottom: calc(150px + env(safe-area-inset-bottom));
    padding: 18px 18px 20px;
    border-radius: 14px;
    animation: card-in-b 0.4s cubic-bezier(.2,.9,.2,1);
    max-height: 45vh;
    overflow-y: auto;
  }
  @keyframes card-in-b { from { opacity:0; transform: translateY(12px);} to {opacity:1; transform: translateY(0);} }
  .info-title { font-size: 21px; }
  .info-nav { bottom: -20px; margin: 14px -18px -20px; padding: 10px 18px 12px; }
  .info-blurb { font-size: 13.5px; }

  .timeline {
    left: 10px; right: 10px;
    bottom: max(10px, env(safe-area-inset-bottom));
    padding: 12px 16px 10px;
    border-radius: 12px;
  }
  .tl-year { font-size: 18px; }

  .tweaks {
    right: 10px; left: 10px;
    bottom: calc(150px + env(safe-area-inset-bottom));
    width: auto;
  }

  /* Hide pin labels on phones — they clutter a small viewport */
  .overlay .pin-label,
  .overlay .pin-label-bg,
  .overlay .pin-tick { display: none; }

  .splash-name { font-size: clamp(38px, 11vw, 56px); }
  .splash-tagline { font-size: 15px; padding: 0 12px; }
  .splash-btn { padding: 12px 20px; font-size: 14px; }
}

/* Tighter still on very narrow phones */
@media (max-width: 380px) {
  .topbar-name { display: none; }
  .info-card { bottom: calc(140px + env(safe-area-inset-bottom)); }
}
