:root {
  --bg: #070b0d;
  --panel: #0d1316;
  --panel-2: #111a1e;
  --line: rgba(255, 255, 255, 0.09);
  --text: #e8f0ec;
  --muted: #8b9b95;
  --green: #35f28b;
  --green-dim: rgba(53, 242, 139, 0.14);
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(60rem 40rem at 78% 18rem, rgba(53, 242, 139, 0.1), transparent 60%),
    radial-gradient(circle, rgba(255, 255, 255, 0.05) 1px, transparent 1.5px) 0 0 / 26px 26px;
  -webkit-mask-image: linear-gradient(#000, transparent 70rem);
  mask-image: linear-gradient(#000, transparent 70rem);
  pointer-events: none;
  z-index: -1;
}
a { color: inherit; }
code { font-family: var(--mono); font-size: 0.9em; color: #c9f7dd; }
h1, h2 { letter-spacing: -0.03em; line-height: 1.05; margin: 0; text-wrap: balance; }
h2 { font-size: clamp(1.7rem, 3vw, 2.4rem); }
p { margin: 0; }

.top, main, .foot { max-width: 76rem; margin: 0 auto; padding: 0 1.5rem; }
.top { display: flex; justify-content: space-between; align-items: center; padding-top: 1.4rem; padding-bottom: 1.4rem; }
.mark { display: flex; align-items: center; gap: 0.55rem; font-weight: 650; text-decoration: none; letter-spacing: -0.01em; }
.mark b { color: var(--green); font-weight: 650; }
.mark-dot { width: 0.6rem; height: 0.6rem; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px var(--green-dim); }
.top nav { display: flex; gap: 1.6rem; font-size: 0.92rem; }
.top nav a { color: var(--muted); text-decoration: none; }
.top nav a:hover { color: var(--text); }

.eyebrow { font: 500 0.78rem/1 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--green); margin-bottom: 1rem; }

/* Hero */
.hero { display: grid; grid-template-columns: minmax(0, 30rem) minmax(0, 1fr); gap: 2rem; align-items: start; padding-top: 3rem; }
.hero h1 { font-size: clamp(2.4rem, 5vw, 3.7rem); }
.hero h1 em { font-style: normal; color: var(--green); }
.lede { color: var(--muted); font-size: 1.1rem; margin: 1.2rem 0 2rem; max-width: 28rem; }

.card { background: linear-gradient(180deg, var(--panel-2), var(--panel)); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(0, 0, 0, 0.4); }
.search { padding: 1.1rem; position: relative; z-index: 2; }
.card-head { display: flex; align-items: center; gap: 0.6rem; font: 0.76rem/1.3 var(--mono); color: var(--muted); margin-bottom: 1rem; }
.live { flex: none; width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--green); animation: blink 2.4s ease-in-out infinite; }
@keyframes blink { 50% { opacity: 0.35; } }

.field { display: block; margin-bottom: 0.7rem; }
.field > span { display: block; font-size: 0.78rem; color: var(--muted); margin-bottom: 0.3rem; }
.field select, .field input {
  width: 100%; font: inherit; color: var(--text); background: #080d0f; border: 1px solid var(--line);
  border-radius: 10px; padding: 0.7rem 0.8rem; outline: none; appearance: none;
}
.field select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%238b9b95' stroke-width='1.6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 0.9rem center; padding-right: 2.2rem; }
.field input { font-size: 1.05rem; }
.field select:focus-visible, .field input:focus-visible { border-color: var(--green); box-shadow: 0 0 0 3px var(--green-dim); }

.results { list-style: none; margin: 0.2rem 0 0; padding: 0; min-height: 17.5rem; }
.results li { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding: 0.5rem 0.65rem; border-radius: 9px; cursor: pointer; }
.results li[aria-selected="true"] { background: var(--green-dim); }
.results .name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.results .name small { color: var(--muted); font-size: 0.85em; }
.results .name mark { background: none; color: var(--green); }
.results .coords { flex: none; font: 0.74rem var(--mono); color: var(--muted); }
.results li[aria-selected="true"] .coords { color: var(--green); }
.results .empty { color: var(--muted); cursor: default; }
.trace { font: 0.74rem/1.4 var(--mono); color: var(--muted); border-top: 1px solid var(--line); margin-top: 0.6rem; padding-top: 0.75rem; min-height: 2.2rem; overflow-wrap: anywhere; }
.trace b { color: #c9f7dd; font-weight: 500; }

.hero-globe { position: relative; margin: -2rem -7rem 0 -3rem; }
.globe { aspect-ratio: 1; width: 100%; max-width: 50rem; margin-left: auto; cursor: grab; touch-action: pan-y; opacity: 0; transition: opacity 1.2s ease; }
.globe.ready { opacity: 1; }
.globe.dragging { cursor: grabbing; }
.globe canvas { width: 100%; height: 100%; display: block; }
.readout { position: absolute; left: 50%; bottom: 3%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 0.25rem; text-align: center; pointer-events: none; }
.readout-name { font-weight: 600; background: rgba(7, 11, 13, 0.75); padding: 0.25rem 0.8rem; border-radius: 99px; border: 1px solid var(--line); backdrop-filter: blur(6px); }
.readout-coords { font: 0.78rem var(--mono); color: var(--green); }

/* Pulsing marker, attached to the globe's marker anchor */
.pulse { position: absolute; left: 0; top: 0; width: 0; height: 0; transition: opacity 0.3s; }
.pulse i, .pulse::after { content: ""; position: absolute; left: -7px; top: -7px; width: 14px; height: 14px; border-radius: 50%; }
.pulse::after { background: var(--green); box-shadow: 0 0 14px 3px rgba(53, 242, 139, 0.75), 0 0 0 2px rgba(7, 11, 13, 0.6); animation: throb 1.6s ease-in-out infinite; }
.pulse i { border: 2px solid var(--green); animation: ring 2.2s cubic-bezier(0.2, 0.6, 0.3, 1) infinite; }
.pulse i + i { animation-delay: 1.1s; }
@keyframes ring { from { transform: scale(1); opacity: 0.9; } to { transform: scale(5.5); opacity: 0; } }
@keyframes throb { 50% { transform: scale(0.72); } }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); border-radius: 16px; margin-top: 4rem; background: var(--panel); position: relative; z-index: 2; }
.stats div { padding: 1.4rem 1.5rem; border-left: 1px solid var(--line); }
.stats div:first-child { border-left: 0; }
.stats b { display: block; font-size: 1.7rem; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.stats span { color: var(--muted); font-size: 0.9rem; }

/* Sections */
section.split, section.samples, section.how { padding-top: 7rem; }
.split { display: grid; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1fr); gap: 3rem; align-items: center; }
.split p, .section-lede { color: var(--muted); margin-top: 1rem; max-width: 40rem; }
.ticks { list-style: none; padding: 0; margin: 1.4rem 0 0; display: grid; gap: 0.6rem; color: #c5d1cc; }
.ticks li { padding-left: 1.6rem; position: relative; }
.ticks li::before { content: ""; position: absolute; left: 0.1rem; top: 0.45em; width: 0.7rem; height: 0.4rem; border: solid var(--green); border-width: 0 0 2px 2px; transform: rotate(-45deg); }

.stack { min-width: 0; }
.stack .or { margin: 1.4rem 0 0.8rem; font-size: 0.92rem; }

/* Code panels */
.code { background: #0a1013; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; box-shadow: 0 30px 80px -40px #000; }
.samples .code { margin-top: 2rem; }
.code-bar { display: flex; align-items: center; gap: 1rem; padding: 0.55rem 0.6rem 0.55rem 1.1rem; border-bottom: 1px solid var(--line); font: 0.78rem var(--mono); color: var(--muted); }
.code-bar .note { margin-left: auto; font-family: var(--sans); }
.code-bar .copy { margin-left: auto; }
.code-bar .note + .copy { margin-left: 0; }
.copy { font: 500 0.78rem var(--sans); color: var(--text); background: rgba(255, 255, 255, 0.06); border: 1px solid var(--line); border-radius: 7px; padding: 0.35rem 0.7rem; cursor: pointer; }
.copy:hover { background: rgba(255, 255, 255, 0.12); }
.code pre { margin: 0; padding: 1.1rem 1.2rem 1.3rem; overflow: auto; max-height: 34rem; font: 0.82rem/1.65 var(--mono); tab-size: 2; outline: none; }
.code pre:focus-visible { box-shadow: inset 0 0 0 2px var(--green-dim); }
.code code { color: #d5dfda; font-size: inherit; }
.tok-c { color: #62746d; font-style: italic; }
.tok-s { color: #9be9b9; }
.tok-n { color: #f2c477; }
.tok-k { color: #7cc7ff; }
.tok-t { color: #d7b3ff; }
.tok-f { color: #f0e6a8; }

.tablist { display: flex; gap: 0.15rem; padding: 0.5rem 0.5rem 0; background: #080d0f; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tablist button { display: flex; align-items: center; gap: 0.5rem; font: 500 0.88rem var(--sans); color: var(--muted); background: none; border: 0; border-bottom: 2px solid transparent; padding: 0.6rem 0.9rem 0.65rem; cursor: pointer; white-space: nowrap; border-radius: 8px 8px 0 0; }
.tablist button img { width: 18px; height: 18px; filter: saturate(0.7) opacity(0.6); transition: filter 0.15s; }
.tablist button:hover { color: var(--text); }
.tablist button[aria-selected="true"] { color: var(--text); border-bottom-color: var(--green); background: #0a1013; }
.tablist button[aria-selected="true"] img, .tablist button:hover img { filter: none; }
.tablist button:focus-visible { outline: 2px solid var(--green); outline-offset: -2px; }

/* How */
.steps { list-style: none; counter-reset: step; padding: 0; margin: 2.2rem 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem; }
.steps li { counter-increment: step; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 1.4rem; }
.steps li::before { content: "0" counter(step); font: 0.78rem var(--mono); color: var(--green); display: block; margin-bottom: 0.9rem; }
.steps p { color: var(--muted); margin-top: 0.5rem; font-size: 0.95rem; }

.foot { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; color: var(--muted); font-size: 0.85rem; padding-top: 5rem; padding-bottom: 2.5rem; }

@media (max-width: 60rem) {
  .hero { grid-template-columns: 1fr; padding-top: 1.5rem; }
  .hero-globe { order: -1; margin: -1rem auto 2.5rem; width: min(100%, 26rem); }
  .readout { bottom: -2.2rem; width: 100%; }
  .readout-name { font-size: 0.9rem; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .split { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stats div:nth-child(3) { border-left: 0; }
  .stats div:nth-child(n + 3) { border-top: 1px solid var(--line); }
  .steps { grid-template-columns: 1fr; }
  .top nav a:not(:first-child) { display: none; }
  section.split, section.samples, section.how { padding-top: 4.5rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .pulse i, .pulse::after, .live { animation: none; }
  .pulse i { transform: scale(2.4); opacity: 0.5; }
  .pulse i + i { display: none; }
}
