/* Hubble Atlas — night-observatory interface. Images are the light source; the UI stays out of their way. */
:root {
  --bg: #030409;
  --bg-2: #080a12;
  --panel: rgba(7, 9, 16, 0.94);
  --panel-solid: #0a0d16;
  --ink: #eceef4;
  --ink-2: #aab1c2;
  --ink-3: #6d7486;
  --line: rgba(255, 255, 255, 0.09);
  --line-2: rgba(255, 255, 255, 0.18);
  --amber: #ffb547;
  --amber-dim: rgba(255, 181, 71, 0.14);
  --cyan: #5fd4ff;
  --cyan-dim: rgba(95, 212, 255, 0.12);
  --display: 'Bebas Neue', 'Oswald', Impact, sans-serif;
  --body: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --top: 56px;
  --r: 10px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--body); font-size: 15px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
body { min-height: 100vh; overflow-x: hidden; }
body[data-view='sky'] { overflow: hidden; }
body.viewer-open { overflow: hidden; }
a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
img { display: block; max-width: 100%; }
kbd { font-family: var(--mono); font-size: 11px; padding: 1px 6px; border: 1px solid var(--line-2); border-radius: 4px; color: var(--ink-2); background: rgba(255,255,255,0.03); }
.mono { font-family: var(--mono); font-size: 12px; letter-spacing: 0.02em; }
.dim { color: var(--ink-3); }
.sr, .sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
::selection { background: var(--amber); color: #000; }

/* ---------------------------------------------------------------- buttons */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border: 1px solid var(--line-2); border-radius: 999px; font-size: 14px; color: var(--ink); background: rgba(255,255,255,0.04); transition: background .2s, border-color .2s, color .2s; text-decoration: none !important; }
.btn:hover { background: rgba(255,255,255,0.09); border-color: rgba(255,255,255,0.32); }
.btn.amber { background: var(--amber); color: #120c02; border-color: var(--amber); font-weight: 600; }
.btn.amber:hover { background: #ffc66e; }
.btn.cyan { color: var(--cyan); border-color: rgba(95,212,255,0.45); background: var(--cyan-dim); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn.ghost:hover { color: var(--ink); }
.btn.big { padding: 13px 22px; font-size: 15px; }
.round { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line-2); display: grid; place-items: center; background: rgba(6,8,14,0.85); font-size: 20px; line-height: 1; transition: border-color .2s, background .2s; }
.round:hover { border-color: var(--cyan); }
.round.sm { width: 38px; height: 38px; font-size: 18px; }
.round svg { width: 18px; height: 18px; }
.pill-btn { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-2); background: rgba(6,8,14,0.85); font-size: 13px; white-space: nowrap; }
.pill-btn svg { width: 16px; height: 16px; }
.pill-btn:hover { border-color: rgba(255,255,255,0.4); }
.pill-btn.amber { border-color: rgba(255,181,71,0.55); color: var(--amber); }
.pill-btn.amber.on { background: var(--amber); color: #120c02; }
.icon-btn { width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--line-2); font-family: var(--mono); font-size: 13px; color: var(--ink-2); }
.icon-btn:hover { color: var(--ink); border-color: var(--ink-2); }

/* ---------------------------------------------------------------- loader */
#loader { position: fixed; inset: 0; z-index: 100; background: var(--bg); display: grid; place-items: center; transition: opacity .7s ease, visibility .7s; }
#loader.done { opacity: 0; visibility: hidden; }
.ld-inner { width: min(420px, 84vw); }
.ld-mark { width: 54px; height: 54px; border: 1.5px solid var(--amber); border-radius: 50%; margin-bottom: 22px; position: relative; }
.ld-mark::before, .ld-mark::after { content: ''; position: absolute; background: var(--amber); }
.ld-mark::before { left: 50%; top: -10px; bottom: -10px; width: 1.5px; transform: translateX(-50%); }
.ld-mark::after { top: 50%; left: -10px; right: -10px; height: 1.5px; transform: translateY(-50%); }
.ld-mark span { position: absolute; inset: 18px; border-radius: 50%; background: var(--cyan); animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(0.55); opacity: 0.5; } }
.ld-title { font-family: var(--display); font-size: 46px; letter-spacing: 0.08em; line-height: 1; margin-bottom: 18px; }
.ld-title b { color: var(--amber); font-weight: 400; }
.bar { height: 3px; background: var(--line); border-radius: 3px; overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--cyan), var(--amber)); transition: width .25s; }
.ld-row { display: flex; justify-content: space-between; margin-top: 10px; color: var(--ink-2); }

/* ---------------------------------------------------------------- topbar */
.topbar { position: fixed; top: 0; left: 0; right: 0; height: var(--top); z-index: 40; display: flex; align-items: center; gap: 22px; padding: 0 18px; background: linear-gradient(180deg, rgba(3,4,9,0.92), rgba(3,4,9,0.0)); }
body:not([data-view='sky']) .topbar { background: rgba(3,4,9,0.97); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); font-family: var(--display); font-size: 24px; letter-spacing: 0.1em; text-decoration: none !important; flex-shrink: 0; }
.brand svg { width: 26px; height: 26px; color: var(--amber); }
.brand b { color: var(--amber); font-weight: 400; }
.tabs { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; flex: 1; min-width: 0; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { color: var(--ink-2); padding: 7px 12px; border-radius: 999px; font-size: 14px; white-space: nowrap; text-decoration: none; transition: color .2s, background .2s; }
.tabs a:hover { color: var(--ink); background: rgba(255,255,255,0.05); }
.tabs a.on { color: var(--ink); background: rgba(255,255,255,0.08); box-shadow: inset 0 0 0 1px var(--line-2); }
.top-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.live-pill { display: inline-flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 11.5px; color: var(--ink-2); padding: 5px 11px; border: 1px solid var(--line); border-radius: 999px; background: rgba(6,8,14,0.7); white-space: nowrap; }
.live-pill i { width: 7px; height: 7px; border-radius: 50%; background: #3ef08a; box-shadow: 0 0 0 0 rgba(62,240,138,.6); animation: live 2.2s infinite; }
.live-pill.demo i { background: var(--amber); animation: none; }
@keyframes live { 0% { box-shadow: 0 0 0 0 rgba(62,240,138,.55); } 70% { box-shadow: 0 0 0 8px rgba(62,240,138,0); } 100% { box-shadow: 0 0 0 0 rgba(62,240,138,0); } }
.search-btn { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 10px 0 12px; border: 1px solid var(--line-2); border-radius: 999px; color: var(--ink-2); font-size: 13px; background: rgba(6,8,14,0.7); }
.search-btn svg { width: 15px; height: 15px; }
.search-btn:hover { color: var(--ink); border-color: var(--ink-3); }

/* ---------------------------------------------------------------- views */
.view { display: none; }
.view.active { display: block; }
.page { padding: calc(var(--top) + 28px) clamp(16px, 3vw, 40px) 80px; min-height: 100vh; }
.view-head { max-width: 1400px; margin: 0 auto 26px; }
.view-title .kicker, .kicker { display: block; font-family: var(--mono); font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.16em; color: var(--amber); margin-bottom: 6px; }
.view-title h1, .view-title .vt { font-family: var(--display); font-weight: 400; font-size: clamp(40px, 6vw, 76px); line-height: 0.95; letter-spacing: 0.02em; margin: 0 0 12px; }
.lede { color: var(--ink-2); max-width: 760px; font-size: 16px; margin: 0 0 8px; }
.empty { padding: 60px 0; color: var(--ink-3); font-family: var(--mono); font-size: 13px; text-align: center; }
.sec-h { max-width: 1400px; margin: 38px auto 14px; font-weight: 500; font-size: 18px; display: flex; gap: 10px; align-items: baseline; }
.sec-h .mono { color: var(--ink-3); }

/* ---------------------------------------------------------------- sky */
.sky-view { position: fixed; inset: 0; }
#sky { position: absolute; inset: 0; }
.sky-canvas { display: block; }
.sky-labels { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.sky-label { position: absolute; left: 0; top: 0; white-space: nowrap; font-family: var(--mono); transition: opacity .3s; will-change: transform; }
.sky-label.con { font-size: 10.5px; letter-spacing: 0.22em; text-transform: uppercase; color: rgba(95,212,255,0.42); }
.sky-label.mes { font-size: 10px; color: rgba(255,181,71,0.7); }
.reticle { position: absolute; left: 50%; top: 50%; width: 34px; height: 34px; margin: -17px 0 0 -17px; pointer-events: none; opacity: 0.32; }
.reticle::before, .reticle::after { content: ''; position: absolute; background: var(--ink); }
.reticle::before { left: 50%; top: 0; bottom: 0; width: 1px; -webkit-mask: linear-gradient(#000 0 35%, transparent 35% 65%, #000 65%); mask: linear-gradient(#000 0 35%, transparent 35% 65%, #000 65%); }
.reticle::after { top: 50%; left: 0; right: 0; height: 1px; -webkit-mask: linear-gradient(90deg, #000 0 35%, transparent 35% 65%, #000 65%); mask: linear-gradient(90deg, #000 0 35%, transparent 35% 65%, #000 65%); }
.hud { position: absolute; left: 18px; top: calc(var(--top) + 8px); display: flex; gap: 14px; color: var(--ink-2); pointer-events: none; font-size: 11.5px; text-shadow: 0 1px 4px #000; }
.hud .toward { color: var(--cyan); }
.hovercard { position: absolute; left: 0; top: 0; z-index: 12; display: flex; gap: 12px; align-items: center; width: 290px; padding: 9px; border-radius: var(--r); background: var(--panel); border: 1px solid var(--line-2); pointer-events: none; box-shadow: 0 10px 30px rgba(0,0,0,0.6); }
.hovercard img { width: 76px; height: 76px; object-fit: cover; border-radius: 6px; flex-shrink: 0; background: #111; }
.hovercard b { display: block; font-weight: 500; font-size: 14px; line-height: 1.25; margin: 2px 0 4px; }
.hovercard .k, .target .k, .vw-kicker { display: flex; align-items: center; gap: 7px; font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-2); }
.hovercard .k i, .target .k i, .vw-kicker i, .chip i, .legend .cats i, .tile-cap i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.hovercard .mono { color: var(--ink-3); font-size: 11px; }

.target { position: absolute; right: 16px; top: calc(var(--top) + 10px); max-height: calc(100vh - var(--top) - 120px); width: min(380px, calc(100vw - 32px)); z-index: 15; overflow-y: auto; padding: 18px 18px 20px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line-2); box-shadow: 0 20px 60px rgba(0,0,0,0.6); animation: slidein .35s ease; }
@keyframes slidein { from { transform: translateX(20px); opacity: 0; } }
.target .x { position: absolute; right: 12px; top: 12px; width: 30px; height: 30px; border-radius: 50%; color: var(--ink-2); border: 1px solid var(--line); }
.target .x:hover { color: var(--ink); }
.target h3 { font-family: var(--display); font-weight: 400; font-size: 36px; line-height: 1; letter-spacing: 0.02em; margin: 8px 30px 8px 0; }
.target .meta { color: var(--ink-2); margin-bottom: 2px; }
.target .hero-img { display: block; width: 100%; margin: 14px 0 10px; border-radius: 10px; overflow: hidden; position: relative; text-align: left; background: #0b0d14; min-height: 120px; }
.target .hero-img img { width: 100%; max-height: 300px; object-fit: cover; transition: transform 1.2s ease; }
.target .hero-img:hover img { transform: scale(1.04); }
.target .hero-img span { position: absolute; left: 0; right: 0; bottom: 0; padding: 30px 12px 10px; font-size: 13px; background: linear-gradient(transparent, rgba(0,0,0,0.85)); }
.target .x-sum { color: var(--ink-2); font-size: 14px; margin: 0 0 12px; }
.target .sub { color: var(--ink-3); margin: 6px 0 8px; }
.target .thumbs { display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px; margin-bottom: 14px; }
.target .thumbs button { aspect-ratio: 1; border-radius: 5px; overflow: hidden; background: #0b0d14; }
.target .thumbs img { width: 100%; height: 100%; object-fit: cover; opacity: 0.85; transition: opacity .2s; }
.target .thumbs button:hover img { opacity: 1; }
.target .open { width: 100%; justify-content: center; }
.target .t-links { display: flex; gap: 8px; margin-top: 8px; }
.target .t-links .btn { flex: 1; justify-content: center; font-size: 13px; padding: 7px 10px; }
body.touring .target { animation: none; }

.year-ghost { position: absolute; left: 50%; top: 46%; transform: translate(-50%, -50%); font-family: var(--display); font-size: clamp(120px, 22vw, 300px); color: rgba(255,255,255,0.0); -webkit-text-stroke: 1px rgba(255,181,71,0.0); pointer-events: none; letter-spacing: 0.04em; transition: color .4s, -webkit-text-stroke-color .4s; z-index: 2; }
.year-ghost.on { color: rgba(255,181,71,0.07); -webkit-text-stroke-color: rgba(255,181,71,0.5); }

.dock { position: absolute; left: 16px; right: 16px; bottom: max(16px, env(safe-area-inset-bottom)); z-index: 14; display: flex; align-items: flex-end; gap: 14px; pointer-events: none; }
.dock > * { pointer-events: auto; }
.tm { display: flex; align-items: center; gap: 12px; padding: 10px 16px 10px 10px; border-radius: 16px; background: var(--panel); border: 1px solid var(--line-2); width: min(560px, 100%); }
#play-btn { flex-shrink: 0; color: var(--amber); border-color: rgba(255,181,71,0.5); }
#play-btn .i-pause { display: none; }
#play-btn.on .i-play { display: none; }
#play-btn.on .i-pause { display: block; }
.tm-body { flex: 1; min-width: 0; }
.tm-top { display: flex; justify-content: space-between; color: var(--ink-3); font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; }
.tm-top b { color: var(--amber); font-weight: 500; font-size: 13px; }
.tm-scale { display: flex; justify-content: space-between; color: var(--ink-3); font-size: 10px; margin-top: 1px; }
input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 22px; background: transparent; margin: 2px 0 0; }
input[type=range]::-webkit-slider-runnable-track { height: 2px; background: linear-gradient(90deg, var(--cyan), var(--amber)); border-radius: 2px; }
input[type=range]::-moz-range-track { height: 2px; background: linear-gradient(90deg, var(--cyan), var(--amber)); border-radius: 2px; }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%; background: var(--bg); border: 2px solid var(--amber); margin-top: -7px; box-shadow: 0 0 0 4px rgba(255,181,71,0.15); }
input[type=range]::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: var(--bg); border: 2px solid var(--amber); }
.dock-tools { display: flex; gap: 8px; align-items: center; margin-left: auto; }

.legend { position: absolute; left: 16px; bottom: 100px; z-index: 13; width: 250px; padding: 14px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line-2); display: none; }
.legend.open { display: block; animation: slidein .25s ease; }
.lg-h { color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.14em; font-size: 10.5px; margin: 0 0 8px; }
.legend .cats, .legend .layers { display: flex; flex-direction: column; gap: 2px; margin-bottom: 14px; }
.legend button { display: flex; align-items: center; gap: 9px; padding: 5px 8px; border-radius: 6px; font-size: 13px; color: var(--ink-3); text-align: left; }
.legend button.on { color: var(--ink); }
.legend button:not(.on) i { opacity: 0.25; }
.legend .layers button::before { content: ''; width: 12px; height: 12px; border-radius: 3px; border: 1px solid var(--line-2); }
.legend .layers button.on::before { background: var(--cyan); border-color: var(--cyan); }
.legend button:hover { background: rgba(255,255,255,0.05); }
.lg-tip { margin: 0; color: var(--ink-3); font-size: 12px; }

.intro { position: absolute; inset: 0; z-index: 20; display: flex; align-items: center; padding: calc(var(--top) + 20px) clamp(18px, 6vw, 90px) 60px; overflow-y: auto; background: radial-gradient(ellipse at 30% 50%, rgba(3,4,9,0.82), rgba(3,4,9,0.35) 60%, rgba(3,4,9,0.05)); opacity: 0; transition: opacity .6s ease; }
.intro.on { opacity: 1; }
.intro-inner { max-width: 760px; transform: translateY(14px); transition: transform .8s cubic-bezier(.2,.7,.2,1); }
.intro.on .intro-inner { transform: none; }
.intro h1 { font-family: var(--display); font-weight: 400; font-size: clamp(54px, 7.4vw, 112px); line-height: 0.92; letter-spacing: 0.015em; margin: 6px 0 20px; max-width: 11.5em; }
.intro h1 em { font-style: normal; color: var(--amber); }
.intro .lede { font-size: clamp(15px, 1.3vw, 18px); color: #c7ccd8; max-width: 600px; }
.stats { display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 22px 0 28px; color: var(--ink-2); }
.stats b { color: var(--ink); font-weight: 500; font-size: 14px; }
.stats .live { display: inline-flex; align-items: center; gap: 7px; color: #74f0a7; }
.stats .live i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.intro-cta { display: flex; flex-wrap: wrap; gap: 10px; }
.intro-latest { position: absolute; right: clamp(16px, 4vw, 60px); bottom: 48px; }
.intro-latest button { display: flex; align-items: center; gap: 14px; width: 360px; padding: 10px; text-align: left; border-radius: 14px; background: var(--panel); border: 1px solid var(--line-2); transition: border-color .2s, transform .3s; }
.intro-latest button:hover { border-color: var(--amber); transform: translateY(-2px); }
.intro-latest img { width: 96px; height: 96px; object-fit: cover; border-radius: 9px; flex-shrink: 0; }
.intro-latest em { display: block; font-style: normal; color: var(--amber); font-size: 11px; margin-bottom: 4px; }
.intro-latest b { font-weight: 500; font-size: 15px; line-height: 1.3; }
.no-webgl-msg { display: none; position: absolute; inset: 0; place-items: center; padding: 40px; text-align: center; color: var(--ink-2); }
body.no-webgl .no-webgl-msg { display: grid; }
body.no-webgl .dock, body.no-webgl .intro { display: none; }

/* ---------------------------------------------------------------- gallery */
.filters { margin-top: 18px; display: flex; flex-direction: column; gap: 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line-2); font-size: 13px; color: var(--ink-2); transition: all .15s; }
.chip:hover { color: var(--ink); border-color: var(--ink-3); }
.chip.on { color: var(--ink); background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.4); }
.filter-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.search-inline input, .filter-row select, .years input { height: 36px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--bg-2); color: var(--ink); padding: 0 10px; font: inherit; font-size: 13px; }
.search-inline input { width: min(360px, 80vw); }
.years { display: flex; align-items: center; gap: 4px; color: var(--ink-3); }
.years input { width: 76px; font-family: var(--mono); }
.toggle { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--ink-2); cursor: pointer; }
.toggle input { accent-color: var(--amber); }
.count { margin-top: 14px; color: var(--ink-3); }
.jgrid { max-width: 1800px; margin: 0 auto; }
.jrow { display: flex; gap: 6px; margin-bottom: 6px; }
.tile { position: relative; display: block; overflow: hidden; border-radius: 4px; background: #0b0d14; flex-shrink: 0; }
.tile img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s cubic-bezier(.2,.7,.2,1), opacity .4s; }
.tile:hover img { transform: scale(1.045); }
.tile.broken img { opacity: 0; }
.tile.broken::after { content: 'Image unavailable'; position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--mono); font-size: 11px; color: var(--ink-3); }
.tile-cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 26px 10px 9px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 7px; background: linear-gradient(transparent, rgba(0,0,0,0.88)); color: var(--ink); opacity: 0; transform: translateY(6px); transition: opacity .25s, transform .25s; }
.tile:hover .tile-cap, .tile:focus-visible .tile-cap { opacity: 1; transform: none; }
.tile-cap b { font-weight: 500; font-size: 13px; line-height: 1.25; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile-cap em { font-style: normal; font-family: var(--mono); font-size: 10.5px; color: var(--ink-2); width: 100%; padding-left: 15px; }
.badge { position: absolute; top: 8px; left: 8px; font-family: var(--mono); font-size: 10.5px; padding: 3px 7px; border-radius: 999px; background: rgba(0,0,0,0.75); color: var(--amber); }
.sentinel { height: 2px; }

/* ---------------------------------------------------------------- timeline */
.tl-head { margin-bottom: 18px; }
#view-timeline.page { padding-left: 0; padding-right: 0; }
#view-timeline .view-head { padding: 0 clamp(16px, 3vw, 40px); }
.tl-track { display: flex; gap: 0; overflow-x: auto; padding: 10px clamp(16px, 3vw, 40px) 30px; scroll-snap-type: x proximity; cursor: grab; scrollbar-color: var(--ink-3) transparent; }
.tl-track:active { cursor: grabbing; }
.tl-year { flex: 0 0 auto; width: 300px; padding: 0 18px 0 16px; border-left: 1px solid var(--line); scroll-snap-align: start; position: relative; }
.tl-year::before { content: ''; position: absolute; left: -4px; top: 18px; width: 7px; height: 7px; border-radius: 50%; background: var(--amber); }
.tl-year header { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.tl-year h2 { font-family: var(--display); font-weight: 400; font-size: 58px; margin: 0; line-height: 1; letter-spacing: 0.02em; }
.tl-year header .mono { color: var(--ink-3); }
.tl-ms { list-style: none; padding: 0; margin: 8px 0 12px; display: flex; flex-direction: column; gap: 6px; }
.tl-ms li { font-size: 12.5px; line-height: 1.4; color: var(--cyan); padding: 6px 9px; border-radius: 8px; background: var(--cyan-dim); border: 1px solid rgba(95,212,255,0.22); }
.tl-stack { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.tl-img { position: relative; display: block; aspect-ratio: 1; border-radius: 6px; overflow: hidden; background: #0b0d14; }
.tl-img.hero { grid-column: span 2; aspect-ratio: 4 / 3; }
.tl-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s; }
.tl-img:hover img { transform: scale(1.05); }
.tl-img span { position: absolute; left: 0; right: 0; bottom: 0; padding: 22px 8px 7px; font-size: 11.5px; line-height: 1.25; color: var(--ink); background: linear-gradient(transparent, rgba(0,0,0,0.85)); opacity: 0; transition: opacity .25s; }
.tl-img.hero span, .tl-img:hover span { opacity: 1; }
.tl-more { margin-top: 10px; font-size: 13px; color: var(--amber); }
.tl-quiet { color: var(--ink-3); font-size: 13px; font-style: italic; }

/* ---------------------------------------------------------------- media */
.mgrid { max-width: 1400px; margin: 0 auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; }
.mcard { display: block; color: var(--ink); text-decoration: none !important; }
.mthumb { position: relative; aspect-ratio: 16 / 9; border-radius: 10px; overflow: hidden; background: #0b0d14; }
.mthumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s; }
.mcard:hover .mthumb img { transform: scale(1.05); }
.mthumb.broken img { visibility: hidden; }
.play { position: absolute; left: 50%; top: 50%; width: 54px; height: 54px; margin: -27px; border-radius: 50%; display: grid; place-items: center; background: rgba(0,0,0,0.6); border: 1px solid rgba(255,255,255,0.4); font-size: 20px; color: var(--amber); transition: transform .3s, background .3s; }
.mcard:hover .play { transform: scale(1.1); background: rgba(0,0,0,0.8); }
.mmeta { padding: 10px 2px; }
.mmeta b { display: block; font-weight: 500; font-size: 14.5px; line-height: 1.3; }
.mmeta .mono { color: var(--ink-3); font-size: 11px; }

/* ---------------------------------------------------------------- news */
.news { max-width: 1400px; margin: 0 auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 20px; }
.ncard { display: flex; flex-direction: column; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); background: var(--bg-2); color: var(--ink); text-decoration: none !important; transition: border-color .2s, transform .3s; }
.ncard:hover { border-color: var(--line-2); transform: translateY(-2px); }
.ncard.lead { grid-column: 1 / -1; flex-direction: row; }
.ncard.lead .nimg { flex: 1.4; aspect-ratio: auto; min-height: 340px; }
.ncard.lead .ntext { flex: 1; padding: 28px; display: flex; flex-direction: column; justify-content: center; }
.ncard.lead h3 { font-family: var(--display); font-weight: 400; font-size: clamp(32px, 3.4vw, 48px); line-height: 1; letter-spacing: 0.01em; }
.nimg { aspect-ratio: 16 / 9; overflow: hidden; background: #0b0d14; }
.nimg img { width: 100%; height: 100%; object-fit: cover; }
.ntext { padding: 16px 18px 20px; }
.ntext .mono { color: var(--amber); font-size: 11px; }
.ntext h3 { margin: 6px 0 8px; font-weight: 500; font-size: 18px; line-height: 1.3; }
.ntext p { margin: 0; color: var(--ink-2); font-size: 14px; }

/* ---------------------------------------------------------------- collections */
.cgrid { max-width: 1400px; margin: 0 auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.ccard { text-align: left; border-radius: 12px; overflow: hidden; background: var(--bg-2); border: 1px solid var(--line); transition: border-color .2s, transform .3s; }
.ccard:hover { border-color: var(--amber); transform: translateY(-2px); }
.cimg { aspect-ratio: 4 / 3; overflow: hidden; background: #0b0d14; }
.cimg img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s; }
.ccard:hover .cimg img { transform: scale(1.05); }
.ctext { padding: 14px 16px 16px; }
.ctext h3 { margin: 0 0 4px; font-family: var(--display); font-weight: 400; font-size: 30px; line-height: 1; letter-spacing: 0.02em; }
.ctext .mono { color: var(--ink-3); }
.back { color: var(--ink-2); margin-bottom: 14px; }
.back:hover { color: var(--ink); }
.src-link { display: inline-block; margin-top: 6px; }
.masonry { max-width: 1600px; margin: 0 auto; columns: 4 280px; column-gap: 8px; }
.mimg { display: block; width: 100%; margin: 0 0 8px; border-radius: 6px; overflow: hidden; break-inside: avoid; background: #0b0d14; }
.mimg img { width: 100%; height: auto; transition: opacity .2s; }
.mimg:hover img { opacity: 0.85; }

/* ---------------------------------------------------------------- viewer */
.viewer { position: fixed; inset: 0; z-index: 60; display: none; background: rgba(2,3,6,0.985); }
.viewer.open { display: grid; grid-template-columns: 1fr 400px; animation: fade .3s ease; }
.viewer.panel-hidden { grid-template-columns: 1fr 0; }
.viewer.panel-hidden .vw-panel { display: none; }
@keyframes fade { from { opacity: 0; } }
.vw-stage { position: relative; overflow: hidden; min-height: 0; }
.vw-placeholder { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; filter: blur(0); opacity: 0.9; transition: opacity .6s; }
.vw-placeholder.gone { opacity: 0; pointer-events: none; }
.vw-osd { position: absolute; inset: 0; }
.vw-media { position: absolute; inset: 0; display: none; place-items: center; padding: 30px; }
.vw-media.on { display: grid; }
.vw-media video { max-width: 100%; max-height: 100%; border-radius: 8px; background: #000; }
.vw-audio { display: flex; flex-direction: column; align-items: center; gap: 18px; max-width: 900px; width: 100%; }
.vw-audio img { max-height: 62vh; border-radius: 8px; }
.vw-audio audio { width: min(600px, 100%); }
.vw-external { display: flex; flex-direction: column; align-items: center; gap: 18px; }
.vw-external img { max-height: 66vh; border-radius: 8px; opacity: 0.8; }
.vw-loading { position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%); padding: 6px 12px 6px 10px; border-radius: 999px; background: rgba(0,0,0,0.7); color: var(--ink-2); display: none; align-items: center; gap: 8px; font-size: 11px; }
.vw-loading.on { display: flex; }
.vw-loading span { width: 10px; height: 10px; border-radius: 50%; border: 1.5px solid var(--amber); border-top-color: transparent; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.vw-tools { position: absolute; left: 16px; top: 16px; display: flex; gap: 6px; z-index: 3; }
.vw-tools button { width: 38px; height: 38px; border-radius: 50%; background: rgba(0,0,0,0.65); border: 1px solid var(--line-2); font-size: 17px; color: var(--ink); }
.vw-tools button:hover { border-color: var(--cyan); }
.vw-nav { position: absolute; top: 50%; width: 50px; height: 76px; margin-top: -38px; font-size: 44px; line-height: 1; color: var(--ink-2); z-index: 3; background: rgba(0,0,0,0.35); border-radius: 8px; }
.vw-nav:hover { color: var(--ink); background: rgba(0,0,0,0.6); }
.vw-nav.prev { left: 12px; }
.vw-nav.next { right: 12px; }
.vw-close { position: absolute; right: 16px; top: 14px; z-index: 5; width: 40px; height: 40px; border-radius: 50%; background: rgba(0,0,0,0.7); border: 1px solid var(--line-2); font-size: 16px; }
.vw-close:hover { border-color: var(--amber); color: var(--amber); }
.vw-panel { overflow-y: auto; padding: 64px 26px 30px; border-left: 1px solid var(--line); background: var(--panel-solid); }
.vw-panel h2 { font-family: var(--display); font-weight: 400; font-size: 42px; line-height: 0.98; letter-spacing: 0.015em; margin: 10px 0 8px; }
.vw-sub { color: var(--ink-3); margin-bottom: 16px; }
.vw-locate { margin-bottom: 18px; }
.vw-facts { margin: 0 0 18px; border-top: 1px solid var(--line); }
.vw-row { display: grid; grid-template-columns: 116px 1fr; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.vw-row dt { color: var(--ink-3); font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; padding-top: 2px; }
.vw-row dd { margin: 0; }
.vw-desc p { margin: 0 0 12px; color: #cfd3dd; font-size: 14.5px; }
.vw-more { margin: 0 0 10px; border: 1px solid var(--line); border-radius: 8px; padding: 0 12px; }
.vw-more summary { padding: 9px 0; cursor: pointer; font-size: 13px; color: var(--ink-2); }
.vw-more p { font-size: 13.5px; color: var(--ink-2); margin: 0 0 10px; }
.vw-credit { margin: 16px 0; }
.vw-credit .mono, .vw-dl > .mono { color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.1em; font-size: 10.5px; }
.vw-credit p { margin: 4px 0 0; font-size: 13px; color: var(--ink-2); }
.vw-dl { display: flex; flex-direction: column; gap: 2px; margin: 16px 0; }
.vw-dl a { padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.vw-dl em { font-style: normal; color: var(--ink-3); margin-left: 6px; }
.vw-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0; }
.vw-note { color: var(--ink-3); font-size: 11px; }
.openseadragon-canvas:focus { outline: none; }

/* ---------------------------------------------------------------- search palette */
.palette { position: fixed; inset: 0; z-index: 80; background: rgba(2,3,6,0.78); display: flex; justify-content: center; padding: 12vh 16px 16px; opacity: 0; transition: opacity .15s; }
.palette.on { opacity: 1; }
.pal-box { width: min(720px, 100%); max-height: 72vh; display: flex; flex-direction: column; border-radius: 16px; background: var(--panel-solid); border: 1px solid var(--line-2); box-shadow: 0 30px 80px rgba(0,0,0,0.7); overflow: hidden; }
.pal-in { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.pal-in svg { width: 18px; height: 18px; color: var(--ink-3); flex-shrink: 0; }
.pal-in input { flex: 1; min-width: 0; background: none; border: 0; color: var(--ink); font: inherit; font-size: 17px; outline: none; }
.pal-in input::-webkit-search-cancel-button { display: none; }
.palette .hint { padding: 8px 16px 0; color: var(--ink-3); font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; }
.results { list-style: none; margin: 0; padding: 6px; overflow-y: auto; }
.results li { display: flex; align-items: center; gap: 12px; padding: 7px 8px; border-radius: 9px; cursor: pointer; }
.results li.sel, .results li:hover { background: rgba(255,255,255,0.06); }
.results li.none { color: var(--ink-3); cursor: default; font-size: 14px; padding: 18px 10px; }
.results img { width: 48px; height: 48px; object-fit: cover; border-radius: 6px; flex-shrink: 0; background: #0b0d14; }
.results li > div { flex: 1; min-width: 0; }
.results b { display: block; font-weight: 500; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.results .mono { color: var(--ink-3); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.results .fly { width: 34px; height: 34px; border-radius: 50%; color: var(--cyan); border: 1px solid rgba(95,212,255,0.35); flex-shrink: 0; }
.results .fly:hover { background: var(--cyan-dim); }
.pal-foot { display: flex; gap: 18px; padding: 9px 16px; border-top: 1px solid var(--line); color: var(--ink-3); font-size: 11px; }

/* ---------------------------------------------------------------- about */
.modal { position: fixed; inset: 0; z-index: 85; background: rgba(2,3,6,0.82); display: grid; place-items: center; padding: 16px; }
.modal[hidden] { display: none; }
.modal-box { position: relative; width: min(640px, 100%); max-height: 86vh; overflow-y: auto; padding: 30px; border-radius: 16px; background: var(--panel-solid); border: 1px solid var(--line-2); }
.modal-box h2 { font-family: var(--display); font-weight: 400; font-size: 52px; margin: 0 0 10px; line-height: 1; }
.modal-box h3 { font-size: 15px; font-weight: 600; margin: 20px 0 6px; }
.modal-box p { color: var(--ink-2); font-size: 14.5px; margin: 0 0 10px; }
.modal-box .close { position: absolute; right: 14px; top: 14px; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line-2); }
.keys kbd { margin: 0 2px; }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1100px) {
  .live-pill { display: none; }
  .viewer.open { grid-template-columns: 1fr 340px; }
}
@media (max-width: 820px) {
  :root { --top: 52px; }
  .topbar { gap: 10px; padding: 0 12px; flex-wrap: nowrap; }
  .brand span { display: none; }
  .search-btn span, .search-btn kbd { display: none; }
  .search-btn { width: 34px; padding: 0; justify-content: center; }
  .tabs a { padding: 6px 10px; font-size: 13.5px; }
  .hud { display: none; }
  .dock { flex-direction: column; align-items: stretch; gap: 8px; left: 10px; right: 10px; }
  .tm { width: 100%; }
  .dock-tools { margin-left: 0; justify-content: space-between; }
  .pill-btn span { display: none; }
  .pill-btn { width: 38px; padding: 0; justify-content: center; }
  .legend { bottom: 150px; left: 10px; }
  .target { left: 10px; right: 10px; top: auto; bottom: 146px; width: auto; max-height: 44vh; padding: 14px 14px 16px; }
  .target h3 { font-size: 28px; }
  .target .hero-img img { max-height: 150px; }
  .target .x-sum { display: none; }
  .target .thumbs { grid-template-columns: repeat(6, 1fr); }
  /* With a target open on a phone, the Time Machine steps aside so the card never runs under it. */
  body:has(#sky-target:not([hidden])) .tm { display: none; }
  body:has(#sky-target:not([hidden])) .target { bottom: calc(max(16px, env(safe-area-inset-bottom)) + 50px); max-height: 58vh; }
  .intro { align-items: flex-end; padding-bottom: 40px; background: linear-gradient(0deg, rgba(3,4,9,0.95) 30%, rgba(3,4,9,0.35)); }
  .intro-latest { display: none; }
  .intro-cta .btn.big { padding: 11px 16px; font-size: 14px; }
  .viewer.open { grid-template-columns: 1fr; grid-template-rows: 58vh 1fr; }
  .viewer.panel-hidden { grid-template-rows: 1fr 0; }
  .vw-panel { border-left: 0; border-top: 1px solid var(--line); padding: 18px 18px 40px; }
  .vw-panel h2 { font-size: 34px; }
  .vw-nav { width: 38px; height: 60px; font-size: 34px; margin-top: -30px; }
  .ncard.lead { flex-direction: column; }
  .ncard.lead .nimg { min-height: 0; aspect-ratio: 16 / 9; }
  .tl-year { width: 250px; }
  .hovercard { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

/* intro hides the instrument panel until you step into the sky */
body.intro-on .dock, body.intro-on .hud, body.intro-on .reticle, body.intro-on .legend { opacity: 0; pointer-events: none; }
.dock, .hud, .reticle { transition: opacity .5s; }
