:root {
  color-scheme: dark;
  --ink: #05070b;
  --panel: rgba(8, 12, 19, .82);
  --line: rgba(202, 229, 239, .16);
  --muted: #8999a6;
  --text: #ecf3f5;
  --cyan: #7ce7ff;
  --gold: #f4d58d;
  --rose: #ff8c9d;
  --violet: #afa2ff;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; background: var(--ink); color: var(--text); font-family: var(--sans); }
button, input { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible, a:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }

.app-shell { width: 100%; height: 100%; background: radial-gradient(circle at 40% 35%, #101928 0, #05070b 48%, #020305 100%); }
.topbar { position: fixed; z-index: 30; inset: 0 0 auto 0; height: 68px; padding: 0 20px; display: grid; grid-template-columns: auto minmax(180px, 1fr) minmax(280px, 440px) auto; gap: 18px; align-items: center; border-bottom: 1px solid var(--line); background: linear-gradient(180deg, rgba(3,5,9,.95), rgba(3,5,9,.7)); backdrop-filter: blur(18px); }
.brand { border: 0; background: none; display: flex; align-items: center; gap: 11px; padding: 8px 0; color: #fff; font-size: .82rem; letter-spacing: .14em; cursor: pointer; white-space: nowrap; }
.brand b { color: var(--cyan); font-weight: 650; }
.brand-mark { position: relative; display: block; width: 27px; height: 27px; border: 1px solid rgba(124,231,255,.65); border-radius: 50%; transform: rotate(-18deg); }
.brand-mark::before { content: ""; position: absolute; inset: 9px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 12px var(--gold); }
.brand-mark::after { content: ""; position: absolute; left: -4px; top: 11px; width: 33px; height: 5px; border: 1px solid rgba(124,231,255,.75); border-radius: 50%; border-top-color: transparent; }
.crumbs { display: flex; align-items: center; gap: 7px; min-width: 0; color: var(--muted); overflow: hidden; }
.crumbs button { border: 0; background: none; color: inherit; padding: 6px 4px; font-size: .78rem; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crumbs button:last-child { color: #dfeaec; }
.crumbs span { color: rgba(255,255,255,.22); }

.search-wrap { position: relative; height: 40px; display: flex; align-items: center; gap: 9px; border: 1px solid var(--line); background: rgba(255,255,255,.045); border-radius: 8px; padding: 0 10px; transition: border-color .2s, background .2s; }
.search-wrap:focus-within { border-color: rgba(124,231,255,.55); background: rgba(8,16,24,.92); }
.search-wrap svg { width: 18px; fill: none; stroke: var(--muted); stroke-width: 1.7; }
.search-wrap input { width: 100%; min-width: 0; background: none; border: 0; outline: 0; color: var(--text); font-size: .88rem; }
.search-wrap input::placeholder { color: #6f7b85; }
kbd { padding: 3px 6px; border: 1px solid rgba(255,255,255,.12); border-radius: 4px; color: #65717a; font-size: .66rem; white-space: nowrap; }
.search-results { position: absolute; left: 0; right: 0; top: calc(100% + 8px); max-height: min(430px, 65vh); overflow: auto; padding: 6px; border: 1px solid var(--line); border-radius: 10px; background: rgba(5,8,13,.97); box-shadow: 0 22px 60px rgba(0,0,0,.45); }
.search-result { width: 100%; display: grid; grid-template-columns: 30px 1fr auto; gap: 10px; align-items: center; padding: 10px; border: 0; border-radius: 7px; background: transparent; text-align: left; cursor: pointer; }
.search-result:hover, .search-result.active { background: rgba(124,231,255,.08); }
.result-dot { width: 8px; height: 8px; border-radius: 50%; margin: auto; background: var(--cyan); box-shadow: 0 0 9px currentColor; }
.search-result strong { display: block; font-size: .86rem; font-weight: 560; }
.search-result small { color: var(--muted); font-size: .71rem; }
.search-result em { color: #75838e; font-size: .67rem; font-style: normal; }
.icon-btn { width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 8px; background: rgba(255,255,255,.035); cursor: pointer; }
.icon-btn svg { width: 19px; fill: none; stroke: #afbdc5; stroke-width: 1.7; }

.viewport, #space, .grain { position: absolute; inset: 0; width: 100%; height: 100%; }
#space { display: block; touch-action: none; cursor: grab; }
#space.dragging { cursor: grabbing; }
.grain { pointer-events: none; opacity: .16; mix-blend-mode: screen; background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.95' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.22'/%3E%3C/svg%3E"); }

.scope-card { position: absolute; z-index: 5; top: 100px; left: 26px; max-width: 355px; pointer-events: none; text-shadow: 0 2px 18px #000; }
.eyebrow { display: block; color: var(--cyan); font-size: .67rem; line-height: 1.5; font-weight: 700; letter-spacing: .18em; }
.scope-card h1 { margin: 8px 0 7px; max-width: 340px; font-family: Georgia, "Times New Roman", serif; font-size: clamp(2rem, 3vw, 3.4rem); line-height: .98; font-weight: 400; letter-spacing: -.035em; }
.scope-card p { margin: 0; max-width: 330px; color: #a8b5bd; font-size: .84rem; line-height: 1.55; }
.stats { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 17px; }
.stat { display: flex; gap: 5px; align-items: baseline; padding: 6px 8px; border: 1px solid rgba(255,255,255,.11); border-radius: 4px; background: rgba(2,5,8,.45); backdrop-filter: blur(8px); }
.stat strong { font-size: .76rem; color: #fff; }
.stat span { font-size: .64rem; color: #8a98a1; }

.legend { position: absolute; z-index: 5; left: 27px; bottom: 92px; display: flex; flex-direction: column; gap: 7px; pointer-events: none; }
.legend-item { display: flex; align-items: center; gap: 8px; color: #8b9aa4; font-size: .67rem; }
.legend-dot { width: 7px; height: 7px; border: 1px solid currentColor; border-radius: 50%; box-shadow: 0 0 8px currentColor; }
.navigation-pad { position: absolute; z-index: 7; left: 25px; bottom: 29px; height: 42px; display: flex; align-items: center; overflow: hidden; border: 1px solid var(--line); border-radius: 7px; background: rgba(5,9,14,.76); backdrop-filter: blur(14px); }
.navigation-pad button { width: 40px; height: 40px; border: 0; background: transparent; font-size: 1.25rem; cursor: pointer; }
.navigation-pad button:hover { background: rgba(255,255,255,.06); }
.navigation-pad span { min-width: 53px; color: #82919a; font-size: .68rem; text-align: center; }
.navigation-pad .reset { border-left: 1px solid var(--line); }
.navigation-pad svg { width: 16px; fill: none; stroke: #afbbc2; stroke-width: 1.7; }
.hint { position: absolute; z-index: 5; left: 50%; bottom: 30px; transform: translateX(-50%); display: flex; align-items: center; gap: 8px; color: #75838d; font-size: .68rem; pointer-events: none; white-space: nowrap; }
.mouse-icon { width: 12px; height: 18px; border: 1px solid #697680; border-radius: 7px; position: relative; }
.mouse-icon::after { content: ""; position: absolute; top: 3px; left: 5px; width: 1px; height: 4px; background: var(--cyan); }

.detail-panel { position: absolute; z-index: 20; top: 84px; right: 18px; bottom: 18px; width: min(365px, calc(100vw - 36px)); padding: 18px; overflow-y: auto; border: 1px solid var(--line); border-radius: 11px; background: var(--panel); backdrop-filter: blur(24px) saturate(120%); box-shadow: 0 24px 70px rgba(0,0,0,.34); transform: translateX(calc(100% + 30px)); opacity: 0; transition: transform .34s cubic-bezier(.2,.8,.2,1), opacity .25s; }
.detail-panel.open { transform: translateX(0); opacity: 1; }
.panel-close { position: sticky; z-index: 2; float: right; top: 0; width: 31px; height: 31px; border: 1px solid var(--line); border-radius: 50%; background: rgba(8,12,18,.75); color: #aebac1; font-size: 1.1rem; cursor: pointer; }
.object-image { width: calc(100% + 36px); height: 180px; margin: -18px -18px 17px; object-fit: cover; border-radius: 11px 11px 0 0; display: block; }
.image-credit { margin: -10px 0 15px; color: #697984; font-size: .62rem; line-height: 1.4; }
.detail-type { display: flex; align-items: center; gap: 8px; color: var(--cyan); font-size: .66rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; }
.detail-type i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 10px currentColor; }
.detail-panel h2 { clear: both; margin: 10px 0 6px; font-family: Georgia, "Times New Roman", serif; font-size: 2rem; line-height: 1.05; font-weight: 400; letter-spacing: -.025em; }
.catalog-name { margin: 0 0 15px; color: #7c8b95; font-size: .73rem; }
.detail-copy { color: #b4c0c6; font-size: .82rem; line-height: 1.58; }
.facts { display: grid; grid-template-columns: 1fr 1fr; margin: 18px 0; border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.fact { min-height: 63px; padding: 10px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.fact span { display: block; margin-bottom: 4px; color: #75848d; font-size: .63rem; text-transform: uppercase; letter-spacing: .08em; }
.fact strong { font-size: .82rem; font-weight: 520; color: #eaf0f2; }
.primary-action { width: 100%; min-height: 44px; margin: 2px 0 14px; display: flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid rgba(124,231,255,.48); border-radius: 6px; background: rgba(124,231,255,.1); color: #dffaff; font-size: .78rem; cursor: pointer; }
.primary-action:hover { background: rgba(124,231,255,.17); }
.source-link { color: #8fa0aa; font-size: .7rem; text-underline-offset: 3px; }

.loading { position: absolute; z-index: 40; inset: 0; display: grid; place-content: center; gap: 18px; background: #04060a; color: #8f9ca5; font-size: .72rem; letter-spacing: .09em; transition: opacity .5s; }
.loading.done { opacity: 0; pointer-events: none; }
.orbit-loader { position: relative; width: 54px; height: 54px; margin: auto; border: 1px solid rgba(124,231,255,.25); border-radius: 50%; animation: spin 1.5s linear infinite; }
.orbit-loader::before { content: ""; position: absolute; inset: 18px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 14px var(--gold); }
.orbit-loader i { position: absolute; top: -3px; left: 23px; width: 7px; height: 7px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 12px var(--cyan); }
@keyframes spin { to { transform: rotate(360deg); } }

dialog { width: min(620px, calc(100vw - 32px)); max-height: min(760px, calc(100vh - 32px)); padding: 30px; overflow: auto; border: 1px solid rgba(124,231,255,.24); border-radius: 12px; background: #0a0e15; color: var(--text); box-shadow: 0 35px 100px rgba(0,0,0,.65); }
dialog::backdrop { background: rgba(0,2,5,.75); backdrop-filter: blur(8px); }
dialog h2 { margin: 9px 0 14px; font-family: Georgia, serif; font-size: 2rem; font-weight: 400; }
dialog h3 { margin: 24px 0 8px; font-size: .82rem; letter-spacing: .08em; text-transform: uppercase; }
dialog p, .sources { color: #aebbc2; font-size: .86rem; line-height: 1.65; }
.dialog-close { position: absolute; top: 16px; right: 16px; width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 50%; background: transparent; cursor: pointer; }
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; margin: 22px 0; background: var(--line); border: 1px solid var(--line); }
.about-grid div { padding: 14px; background: #0a0e15; }
.about-grid strong { display: block; color: var(--gold); font-family: Georgia, serif; font-size: 1.5rem; font-weight: 400; }
.about-grid span { color: #84929b; font-size: .7rem; }
.sources { padding-left: 19px; }
.sources a { color: #beeefa; }
.data-date { color: #697781; font-size: .7rem; }

@media (max-width: 820px) {
  .topbar { height: auto; min-height: 65px; grid-template-columns: 1fr auto; padding: 9px 12px; gap: 8px; }
  .brand { font-size: .75rem; }
  .crumbs { display: none; }
  .search-wrap { grid-row: 2; grid-column: 1 / -1; height: 38px; }
  .icon-btn { grid-column: 2; grid-row: 1; }
  .scope-card { top: 124px; left: 16px; max-width: calc(100vw - 32px); }
  .scope-card h1 { font-size: 2rem; max-width: 280px; }
  .scope-card p { font-size: .76rem; max-width: 280px; }
  .stats { margin-top: 11px; max-width: 285px; }
  .legend { display: none; }
  .navigation-pad { left: 14px; bottom: 16px; }
  .hint { display: none; }
  .detail-panel { top: auto; left: 8px; right: 8px; bottom: 8px; width: auto; max-height: 52vh; padding: 16px; border-radius: 13px; transform: translateY(calc(100% + 20px)); }
  .detail-panel.open { transform: translateY(0); }
  .object-image { width: calc(100% + 32px); height: 130px; margin: -16px -16px 14px; }
  .detail-panel h2 { font-size: 1.7rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
