:root {
  color-scheme: dark;
  --space: #08090b;
  --panel: #111215;
  --ink: #eeeae3;
  --muted: #a5a39f;
  --accent: #e9a16f;
  --line: #303033;
  --display: Georgia, 'Times New Roman', serif;
  --mono: ui-monospace, 'SFMono-Regular', Consolas, monospace;
}

* { box-sizing: border-box; }
html { background: var(--space); scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--space);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; }
button {
  color: inherit;
  background: transparent;
  border: 0;
  cursor: pointer;
}
button:focus-visible, input:focus-visible, a:focus-visible, summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}
button:disabled { cursor: not-allowed; opacity: 0.4; }
.observatory { position: relative; min-height: 100svh; }
.masthead {
  position: absolute;
  z-index: 3;
  top: 0;
  left: 0;
  right: 0;
  height: 64px;
  padding: 0 clamp(20px, 3.4vw, 48px);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
  font-size: 10px;
  letter-spacing: 1.8px;
}
.brand-orbit {
  width: 24px;
  height: 24px;
  display: inline-block;
  border: 1px solid var(--accent);
  border-radius: 50%;
  position: relative;
}
.brand-orbit::after {
  content: '';
  width: 34px;
  height: 10px;
  position: absolute;
  top: 6px;
  left: -6px;
  border: 1px solid #eeeae388;
  border-radius: 50%;
  transform: rotate(-25deg);
}
.edition { color: var(--muted); }
.text-button { color: var(--muted); font-size: 11px; }
.text-button span { margin-left: 8px; color: var(--accent); }
.text-button:hover { color: var(--ink); }

.scroll-journey {
  position: relative;
  height: 230svh;
  min-height: 1400px;
}
.universe {
  position: sticky;
  top: 0;
  width: 100%;
  height: 100svh;
  min-height: 580px;
  overflow: hidden;
  isolation: isolate;
  background: var(--space);
}
#universe, #matter {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}
#universe { cursor: grab; }
#universe.dragging { cursor: grabbing; }
#matter { pointer-events: none; }
.journey-copy {
  position: absolute;
  top: clamp(88px, 12vh, 128px);
  left: clamp(24px, 5vw, 72px);
  width: min(300px, 44vw);
  pointer-events: none;
}
.eyebrow {
  color: var(--accent);
  font: 8px var(--mono);
  letter-spacing: 1.5px;
  margin: 0;
}
.journey-copy h1 {
  margin: 12px 0 0;
  color: var(--ink);
  font: 400 clamp(24px, 2.3vw, 34px)/1.15 var(--display);
  letter-spacing: -0.7px;
}
.journey-track {
  width: 76px;
  height: 2px;
  margin-top: 16px;
  background: #ffffff24;
}
.journey-track span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--accent);
}
.scene-error {
  position: absolute;
  z-index: 2;
  top: 74px;
  left: 50%;
  transform: translateX(-50%);
  max-width: min(90%, 520px);
  padding: 12px 16px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  font-size: 12px;
  line-height: 1.5;
}
.scene-error[hidden] { display: none; }

.feed-dock {
  position: absolute;
  z-index: 2;
  bottom: 54px;
  left: 50%;
  transform: translateX(-50%);
  width: min(600px, calc(100% - 96px));
  padding: 11px 14px 9px;
  border: 1px solid #504237;
  border-radius: 16px;
  background: #101115ee;
  box-shadow: 0 8px 34px #0006;
}
.feed-actions { display: flex; align-items: center; gap: 8px; }
.matter-source {
  min-width: 0;
  min-height: 42px;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 6px 10px;
  border: 1px solid #343438;
  border-radius: 999px;
  color: var(--muted);
  font-size: 10px;
  touch-action: none;
  user-select: none;
  cursor: grab;
}
.matter-source:hover, .matter-source:focus-visible {
  border-color: var(--accent);
  background: #211a15;
  color: var(--ink);
}
.matter-source:active { cursor: grabbing; }
.object-glyph {
  flex: 0 0 auto;
  font: 13px var(--mono);
  letter-spacing: -1px;
  line-height: 18px;
  pointer-events: none;
}
.asteroid-glyph { color: #f4b783; }
.star-glyph { color: #d4eaff; font-size: 18px; }
.probe-glyph { color: #a7e6d1; font-size: 10px; }
.feed-play {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--accent);
  font-size: 14px;
}
.feed-play:hover { border-color: var(--accent); }
.feed-status {
  min-height: 17px;
  margin-top: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font: 8px var(--mono);
  letter-spacing: 0.2px;
}
.capture-stat { white-space: nowrap; color: var(--muted); }
.capture-stat span { color: var(--ink); }
.gesture-hint {
  position: absolute;
  bottom: 13px;
  left: clamp(20px, 3.4vw, 48px);
  margin: 0;
  color: var(--muted);
  font: 8px var(--mono);
  letter-spacing: 0.3px;
  white-space: nowrap;
  pointer-events: none;
}
.gesture-hint > span:first-child { color: var(--accent); font-size: 13px; margin-right: 6px; }
.hint-separator { margin: 0 8px; color: #6e6258; }
.zoom-controls {
  position: absolute;
  right: clamp(16px, 3vw, 40px);
  bottom: 8px;
  display: flex;
  align-items: center;
  gap: 3px;
  color: var(--muted);
  font: 9px var(--mono);
}
.zoom-controls button {
  width: 32px;
  height: 32px;
  color: var(--muted);
  font-size: 18px;
}
.zoom-controls button:hover { color: var(--ink); }
.zoom-controls > span { width: 32px; text-align: center; }

.controls {
  width: min(960px, calc(100% - 48px));
  min-height: 82px;
  margin: 36px auto 48px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
}
.play-button {
  min-width: 74px;
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 11px;
}
.play-button svg { color: var(--accent); }
.control-divider { width: 1px; height: 28px; flex: 0 0 1px; background: var(--line); }
.range-control {
  min-width: 100px;
  max-width: 220px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.range-control > span {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 9px;
}
output { min-width: 32px; color: var(--ink); font: 9px var(--mono); text-align: right; }
input[type=range] { width: 100%; height: 16px; margin: 0; accent-color: var(--accent); cursor: pointer; }
input[type=range]::-webkit-slider-runnable-track { height: 2px; border-radius: 1px; background: #49413b; }
input[type=range]::-webkit-slider-thumb { width: 9px; height: 9px; margin-top: -3px; appearance: none; border-radius: 50%; background: var(--accent); }
input[type=range]::-moz-range-track { height: 2px; background: #49413b; }
input[type=range]::-moz-range-thumb { width: 9px; height: 9px; border: 0; border-radius: 50%; background: var(--accent); }
.palette-button {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 10px;
}
.palette-swatch {
  width: 11px;
  height: 11px;
  border: 2px solid #583e2e;
  border-radius: 50%;
  outline: 1px solid var(--accent);
  background: var(--accent);
}
.palette-button.mono .palette-swatch {
  border-color: #606060;
  outline-color: var(--ink);
  background: var(--ink);
}
.icon-button {
  width: 40px;
  min-width: 40px;
  height: 42px;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 22px;
}
.capture-button {
  height: 38px;
  padding: 0 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid #48413c;
  border-radius: 7px;
  background: #1b1917;
  font-size: 10px;
  white-space: nowrap;
}
.capture-button:hover { border-color: var(--accent); }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.noscript { position: absolute; top: 35%; left: 10%; color: var(--accent); }

dialog {
  width: 520px;
  max-width: calc(100% - 32px);
  max-height: calc(100svh - 48px);
  padding: 28px;
  overflow: auto;
  border: 1px solid #44403b;
  border-radius: 14px;
  background: var(--panel);
  color: var(--ink);
  scrollbar-gutter: stable;
}
dialog::backdrop { background: #000b; backdrop-filter: blur(6px); }
.notes-top { margin-bottom: 18px; display: flex; align-items: center; justify-content: space-between; }
.notes-top .eyebrow { color: var(--muted); }
h2 { margin: 0 0 22px; font: 400 36px/1.12 var(--display); letter-spacing: -1px; }
em { color: var(--accent); font-weight: 400; }
dialog p { color: var(--muted); font-size: 12px; line-height: 1.8; }
dl { margin: 20px 0; }
dl > div { padding: 13px 0; border-top: 1px solid var(--line); }
dt { margin-bottom: 6px; font-size: 11px; }
dd { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.7; }
.notes-foot { font-size: 10px !important; }
.return-button {
  width: 100%;
  margin-top: 16px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
  text-align: left;
  font-size: 11px;
}
.return-button span { float: right; color: var(--accent); }

@media (max-width: 900px) {
  .controls { gap: 12px; padding: 14px; }
  .angle-control { max-width: none; flex-basis: 100%; order: 3; }
}
@media (max-width: 600px) {
  .masthead { height: 58px; padding: 0 20px; }
  .brand { gap: 9px; font-size: 9px; letter-spacing: 1.4px; }
  .brand-orbit { width: 21px; height: 21px; }
  .brand-orbit::after { width: 29px; height: 9px; top: 5px; left: -5px; }
  .text-button { font-size: 10px; }
  .universe { min-height: 560px; }
  .journey-copy { top: 82px; left: 20px; width: min(250px, 70vw); }
  .journey-copy h1 { margin-top: 9px; font-size: 25px; }
  .journey-track { width: 58px; margin-top: 12px; }
  .feed-dock { bottom: 48px; width: calc(100% - 32px); padding: 9px 9px 7px; border-radius: 14px; }
  .feed-actions { gap: 6px; }
  .matter-source { min-height: 52px; flex-direction: column; gap: 1px; padding: 4px 3px; font-size: 8px; }
  .object-glyph { font-size: 12px; line-height: 16px; }
  .star-glyph { font-size: 17px; }
  .probe-glyph { font-size: 9px; }
  .feed-play { width: 32px; height: 32px; flex-basis: 32px; }
  .feed-status { margin-top: 4px; font-size: 7px; }
  .gesture-hint { bottom: 10px; left: 16px; font-size: 7px; }
  .hint-separator { margin: 0 5px; }
  .zoom-controls { right: 10px; bottom: 3px; gap: 0; }
  .zoom-controls button { width: 27px; height: 28px; }
  .zoom-controls > span { width: 28px; }
  .controls { width: calc(100% - 32px); margin: 24px auto 32px; padding: 12px; gap: 10px 12px; }
  .play-button { min-width: 64px; justify-content: flex-start; }
  .range-control { min-width: calc(50% - 8px); max-width: none; padding: 3px 0; }
  .angle-control { min-width: 100%; }
  .palette-button { margin-left: auto; }
  .capture-button { padding: 0 10px; }
  .capture-button span { display: none; }
  .icon-button { width: 34px; min-width: 34px; }
  dialog { padding: 22px; }
}
@media (max-width: 360px) {
  .edition { display: none; }
  .source-label { display: none; }
  .matter-source { min-height: 38px; flex-direction: row; }
  .object-glyph { font-size: 13px; }
  .star-glyph { font-size: 18px; }
  .journey-copy { left: 16px; }
  .feed-dock { width: calc(100% - 24px); }
  .gesture-hint { left: 12px; }
  .zoom-controls { right: 6px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
@media (forced-colors: active) {
  button, input, dialog, .controls { border: 1px solid ButtonText; }
  html { scrollbar-color: auto; }
}

/* Keep wheel, touch, and keyboard scrolling; hide scrollbar tracks on every surface. */
* {
  scrollbar-width: none !important;
  scrollbar-gutter: auto !important;
  -ms-overflow-style: none !important;
}
*::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}
