:root {
  --bg: #08090A;
  --surface: #111214;
  --surface-2: #18191C;
  --text: #F4F5F0;
  --muted: rgba(244, 245, 240, .68);
  --subtle: rgba(244, 245, 240, .46);
  --line: rgba(244, 245, 240, .10);
  --lime: #C7FF35;
  --lime-tint: rgba(199, 255, 53, .12);
  --lav: #B28CFF;
  --purple: #7F3AED;
  --display: 'Sora', 'General Sans', system-ui, sans-serif;
  --body: 'General Sans', system-ui, sans-serif;
  --mono: 'Geist Mono', ui-monospace, monospace;
  --panel-w: 420px;
  --ease: cubic-bezier(.22, .8, .2, 1);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg); color: var(--text); font-family: var(--body); -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; cursor: pointer; }
#map { position: fixed; inset: 0; display: block; cursor: grab; touch-action: none; }
#map.dragging { cursor: grabbing; }
#map.pointing { cursor: pointer; }

/* ── top bar ── */
.top { position: fixed; top: 0; left: 0; right: 0; display: flex; align-items: center; justify-content: space-between; padding: 22px 28px; pointer-events: none; z-index: 5; }
.top > * { pointer-events: auto; }
.brand { background: none; border: 0; padding: 0; display: block; }
.brand img { height: 26px; display: block; }
.tools { display: flex; gap: 10px; align-items: center; }
.search { position: relative; display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 10px 0 14px; width: 290px;
  background: rgba(17, 18, 20, .72); border: 1px solid var(--line); border-radius: 999px; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); transition: border-color .2s; }
.search:focus-within { border-color: rgba(199, 255, 53, .45); }
.search svg { width: 16px; height: 16px; fill: none; stroke: var(--subtle); stroke-width: 1.6; stroke-linecap: round; flex: none; }
.search input { flex: 1; min-width: 0; background: none; border: 0; outline: 0; color: var(--text); font: 500 14px var(--body); }
.search input::placeholder { color: var(--subtle); }
kbd { font: 500 11px var(--mono); color: var(--subtle); border: 1px solid var(--line); border-radius: 6px; padding: 2px 6px; }
#results { position: absolute; top: 46px; left: 0; right: 0; margin: 0; padding: 6px; list-style: none; background: rgba(17, 18, 20, .96); border: 1px solid var(--line); border-radius: 16px; display: none; max-height: 340px; overflow: auto; }
#results.open { display: block; }
#results li { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; font-size: 14px; cursor: pointer; }
#results li small { margin-left: auto; font: 11px var(--mono); color: var(--subtle); text-transform: uppercase; letter-spacing: .06em; }
#results li.active, #results li:hover { background: var(--surface-2); }
.pill { height: 40px; padding: 0 16px; display: inline-flex; align-items: center; gap: 9px; border-radius: 999px; border: 1px solid var(--line); background: rgba(17, 18, 20, .72); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); font: 500 14px var(--body); transition: border-color .2s, background .2s; }
.pill:hover { border-color: rgba(244, 245, 240, .28); }
.pill.lime { background: var(--lime); color: #0B0C08; border-color: var(--lime); font-weight: 600; }
.pill.lime:hover { background: #d5ff66; }
.play { width: 0; height: 0; border-left: 8px solid var(--lime); border-top: 5px solid transparent; border-bottom: 5px solid transparent; }
.dot { width: 9px; height: 9px; border-radius: 50%; flex: none; display: inline-block; }

/* ── hero ── */
.hero { position: fixed; left: 28px; bottom: 92px; max-width: 470px; z-index: 3; pointer-events: none; transition: opacity .6s var(--ease), transform .6s var(--ease); }
.hero.gone { opacity: 0; transform: translateY(10px); }
.eyebrow { font: 500 12px var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--lime); }
.hero h1 { font: 600 clamp(40px, 5.2vw, 68px)/1 var(--display); letter-spacing: -.035em; margin: 14px 0 16px; }
.hero h1 em { font-style: normal; color: var(--lime); }
.hero p { font-size: 17px; line-height: 1.5; color: var(--muted); margin: 0 0 18px; }
.hint { display: flex; gap: 16px; font: 12px var(--mono); color: var(--subtle); letter-spacing: .04em; }
.hint span + span::before { content: "·"; margin-right: 16px; color: rgba(244, 245, 240, .25); }

/* ── panel ── */
.panel { position: fixed; top: 84px; right: 20px; bottom: 20px; width: var(--panel-w); z-index: 6; display: flex; flex-direction: column;
  background: rgba(14, 15, 17, .82); border: 1px solid var(--line); border-radius: 22px; backdrop-filter: blur(22px) saturate(1.2); -webkit-backdrop-filter: blur(22px) saturate(1.2);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .55); transform: translateX(calc(100% + 40px)); opacity: 0; transition: transform .55s var(--ease), opacity .4s var(--ease); }
.panel.open { transform: none; opacity: 1; }
.panel-bar { display: flex; align-items: center; gap: 8px; padding: 12px 12px 0 12px; }
.crumb { flex: 1; font: 11px var(--mono); color: var(--subtle); letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line); background: transparent; font-size: 16px; display: grid; place-items: center; color: var(--muted); transition: border-color .2s, color .2s; flex: none; }
.icon:hover { color: var(--text); border-color: rgba(244, 245, 240, .3); }
.icon:disabled { opacity: .3; cursor: default; }
.panel-body { overflow-y: auto; padding: 18px 26px 28px; scrollbar-width: thin; scrollbar-color: rgba(244,245,240,.15) transparent; }
.panel-body > * { animation: rise .5s var(--ease) both; }
.panel-body > *:nth-child(2) { animation-delay: .04s; } .panel-body > *:nth-child(3) { animation-delay: .08s; }
.panel-body > *:nth-child(4) { animation-delay: .12s; } .panel-body > *:nth-child(n+5) { animation-delay: .16s; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
.kind { display: flex; align-items: center; gap: 8px; font: 500 11px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--subtle); }
.panel h2 { font: 600 30px/1.1 var(--display); letter-spacing: -.025em; margin: 10px 0 12px; }
.lede { font-size: 16.5px; line-height: 1.55; color: var(--text); margin: 0 0 20px; }
.lede.muted { color: var(--muted); }
.sec { margin-top: 24px; }
.sec h3 { font: 500 11px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--subtle); margin: 0 0 10px; }
.sec p { margin: 0; font-size: 15px; line-height: 1.55; color: var(--muted); }
.quote { border-left: 2px solid var(--lime); padding: 2px 0 2px 14px; font-size: 16px; line-height: 1.5; color: var(--text); margin: 0; }
.quote small { display: block; margin-top: 6px; font: 11px var(--mono); color: var(--subtle); letter-spacing: .04em; }
.duo { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.duo .card h4 { margin: 0 0 6px; font: 500 11px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--subtle); }
.card { background: rgba(244, 245, 240, .035); border: 1px solid var(--line); border-radius: 14px; padding: 14px; font-size: 14.5px; line-height: 1.5; color: var(--muted); }
.principles { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.principles li { position: relative; padding-left: 18px; font-size: 15px; line-height: 1.5; color: var(--muted); }
.principles li::before { content: ""; position: absolute; left: 0; top: 9px; width: 6px; height: 6px; border-radius: 50%; background: var(--lime); }

/* polarity track */
.polarity { margin: 4px 0 6px; }
.track { position: relative; height: 2px; margin: 14px 8px 12px; background: linear-gradient(90deg, rgba(199,255,53,.9), rgba(244,245,240,.25) 50%, rgba(199,255,53,.9)); border-radius: 2px; }
.track::before, .track::after { content: ""; position: absolute; top: -6px; width: 14px; height: 14px; border-radius: 50%; background: var(--bg); border: 2px solid var(--lime); }
.track::before { left: -8px; } .track::after { right: -8px; }
.poles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pole { text-align: left; background: rgba(244,245,240,.035); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; transition: border-color .2s, background .2s; }
.pole:hover, .pole.on { border-color: rgba(199,255,53,.5); background: rgba(199,255,53,.06); }
.pole b { display: block; font: 600 15px var(--display); letter-spacing: -.01em; color: var(--text); margin-bottom: 4px; }
.pole span { font-size: 13.5px; line-height: 1.45; color: var(--muted); }
.pole:last-child { text-align: right; }
.caption { font-size: 13px; color: var(--subtle); margin-top: 10px; line-height: 1.5; }

/* links */
.links { display: grid; gap: 6px; }
.link { display: grid; grid-template-columns: 14px 1fr; gap: 4px 10px; align-items: start; text-align: left; width: 100%; padding: 11px 12px; border-radius: 12px; border: 1px solid transparent; background: rgba(244,245,240,.03); transition: background .2s, border-color .2s; }
.link:hover { background: rgba(244,245,240,.06); border-color: var(--line); }
.link .dot { margin-top: 5px; }
.link b { font-weight: 600; font-size: 14.5px; }
.link em { grid-column: 2; font-style: normal; font-size: 13.5px; line-height: 1.45; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { padding: 7px 11px; border-radius: 999px; border: 1px solid var(--line); background: transparent; font-size: 13px; color: var(--muted); }
.chip:hover { color: var(--text); border-color: rgba(199,255,53,.45); }

/* two leaders */
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.leader { text-align: left; border: 1px solid rgba(178,140,255,.28); background: rgba(127,58,237,.07); border-radius: 16px; padding: 14px; display: flex; flex-direction: column; gap: 8px; transition: border-color .2s, background .2s; }
.leader:hover { border-color: rgba(178,140,255,.6); background: rgba(127,58,237,.12); }
.leader .who { display: flex; align-items: center; gap: 8px; font: 500 11px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--lav); }
.badge { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font: 600 12px var(--mono); color: var(--lav); border: 1.5px solid var(--lav); background: rgba(127,58,237,.25); }
.leader b { font: 600 15px/1.25 var(--display); letter-spacing: -.01em; }
.leader p { margin: 0; font-size: 13.5px; line-height: 1.45; color: var(--muted); }
.leader .tag { align-self: flex-start; font: 500 11px var(--mono); color: var(--lime); border: 1px solid rgba(199,255,53,.35); border-radius: 999px; padding: 3px 8px; }
.leader dl { margin: 0; display: grid; gap: 6px; }
.leader dt { font: 500 10.5px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--subtle); }
.leader dd { margin: 0; font-size: 13.5px; line-height: 1.45; color: var(--muted); }
.range { margin-top: 12px; padding: 14px 16px; border-radius: 14px; background: var(--lime-tint); border: 1px solid rgba(199,255,53,.25); font-size: 14.5px; line-height: 1.5; }
.range strong { display: block; font: 500 11px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--lime); margin-bottom: 4px; }
.flash { animation: flash 1.4s var(--ease); }
@keyframes flash { 0% { box-shadow: 0 0 0 0 rgba(199,255,53,.0); } 25% { box-shadow: 0 0 0 3px rgba(199,255,53,.45); } 100% { box-shadow: 0 0 0 0 rgba(199,255,53,0); } }

/* ── legend ── */
.legend { position: fixed; left: 28px; bottom: 26px; display: flex; gap: 4px; padding: 5px; z-index: 4; background: rgba(17,18,20,.72); border: 1px solid var(--line); border-radius: 999px; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.legend button { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px; border-radius: 999px; border: 0; background: transparent; font: 500 13px var(--body); color: var(--muted); transition: background .2s, color .2s, opacity .2s; }
.legend button:hover { background: var(--surface-2); color: var(--text); }
.legend button.off { opacity: .38; }
.legend button small { font: 11px var(--mono); color: var(--subtle); }

.zoom { position: fixed; right: 28px; bottom: 26px; display: flex; gap: 4px; padding: 5px; z-index: 4; background: rgba(17,18,20,.72); border: 1px solid var(--line); border-radius: 999px; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); transition: right .55s var(--ease); }
.zoom button { width: 32px; height: 32px; border-radius: 50%; border: 0; background: transparent; font-size: 18px; color: var(--muted); display: grid; place-items: center; }
.zoom button:hover { background: var(--surface-2); color: var(--text); }
.zoom svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }
body.panel-open .zoom { right: calc(var(--panel-w) + 40px); }

/* ── tour ── */
.tour { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); z-index: 7; display: flex; align-items: center; gap: 16px; padding: 10px 10px 10px 18px; width: min(640px, calc(100vw - 32px));
  background: rgba(14,15,17,.9); border: 1px solid rgba(199,255,53,.28); border-radius: 20px; backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); box-shadow: 0 20px 60px rgba(0,0,0,.5); animation: rise .5s var(--ease); }
body.panel-open .tour { left: calc((100vw - var(--panel-w) - 40px) / 2); }
.tour-step { font: 500 12px var(--mono); color: var(--lime); letter-spacing: .08em; white-space: nowrap; }
.tour-text { flex: 1; display: flex; flex-direction: column; gap: 2px; font-size: 14px; line-height: 1.4; color: var(--muted); }
.tour-text strong { font: 600 15px var(--display); color: var(--text); letter-spacing: -.01em; }
.tour-nav { display: flex; gap: 6px; align-items: center; }
body.touring .legend, body.touring .hero { opacity: 0; pointer-events: none; }

/* ── tooltip and note ── */
.tip { position: fixed; z-index: 8; pointer-events: none; max-width: 280px; padding: 10px 12px; border-radius: 12px; background: rgba(17,18,20,.94); border: 1px solid var(--line); font-size: 13px; line-height: 1.45; color: var(--muted); opacity: 0; transform: translateY(4px); transition: opacity .18s, transform .18s; }
.tip.on { opacity: 1; transform: none; }
.tip b { display: block; color: var(--text); font-weight: 600; font-size: 13.5px; margin-bottom: 3px; }
.note { position: fixed; left: 50%; transform: translateX(-50%); bottom: 8px; font: 10.5px var(--mono); color: rgba(244,245,240,.3); letter-spacing: .04em; z-index: 2; pointer-events: none; white-space: nowrap; }
body.touring .note { opacity: 0; }

/* ── small screens ── */
@media (max-width: 760px) {
  :root { --panel-w: 100vw; }
  .top { padding: 14px 16px; }
  .brand img { height: 20px; }
  .search { width: 44px; padding: 0 12px; }
  .search input, .search kbd { display: none; }
  .search:focus-within { width: calc(100vw - 32px); position: fixed; left: 16px; top: 14px; }
  .search:focus-within input { display: block; }
  .hero { left: 16px; right: 16px; bottom: 84px; }
  .hero p { font-size: 15px; }
  .hint { display: none; }
  .legend { left: 16px; right: 16px; bottom: 16px; overflow-x: auto; border-radius: 18px; }
  .legend button { flex: none; }
  .zoom { display: none; }
  .panel { top: auto; right: 0; left: 0; bottom: 0; width: auto; height: 62vh; border-radius: 22px 22px 0 0; transform: translateY(105%); }
  .panel-body { padding: 12px 18px 24px; }
  .duo, .compare { grid-template-columns: 1fr; }
  .tour { bottom: 12px; flex-wrap: wrap; }
  body.panel-open .tour { left: 50%; bottom: calc(62vh + 10px); }
  .note { display: none; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }
.tour[hidden] { display: none; }
@media (max-width: 760px) {
  .tour-label { display: none; }
  #tourBtn { width: 40px; padding: 0; justify-content: center; }
  .hero h1 { font-size: 40px; }
  .tour-text span { display: none; }
}
@media (max-width: 760px) { .legend { scrollbar-width: none; } .legend::-webkit-scrollbar { display: none; } }
