:root {
  color-scheme: dark;
  --paper: #050507;
  --ink: #f5efe4;
  --muted: rgba(245, 239, 228, 0.56);
  --rule: rgba(245, 239, 228, 0.18);
  --gold: #d7a340;
  font-family: "IBM Plex Mono", "SF Mono", ui-monospace, monospace;
}

* {
  box-sizing: border-box;
}

html,
body,
.shell {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--paper);
  color: var(--ink);
  overscroll-behavior: none;
}

.shell {
  position: fixed;
  inset: 0;
}

.viz {
  position: absolute;
  top: 58px;
  right: 0;
  bottom: 0;
  left: 0;
  width: 100%;
  height: calc(100vh - 58px);
  border: 0;
  background: #050507;
}

.meta {
  position: absolute;
  top: 18px;
  left: 54px;
  z-index: 5;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  pointer-events: none;
}

.meta__mark {
  color: var(--ink);
}

.constellation {
  position: absolute;
  right: 18px;
  bottom: 18px;
  z-index: 6;
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 9px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

/* Collapsed by default: only the toggle shows; the link row unfolds on click. */
.constellation__toggle {
  appearance: none;
  cursor: pointer;
  color: rgba(245, 239, 228, 0.6);
  background: rgba(5, 5, 7, 0.62);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 4px 8px;
  font: inherit;
  font-size: 9px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.constellation__toggle:hover {
  color: var(--ink);
}

.constellation__links {
  display: none;
  gap: 10px;
  align-items: center;
}

.constellation.is-open .constellation__links {
  display: flex;
}

.constellation a {
  color: rgba(245, 239, 228, 0.46);
  text-decoration: none;
  border: 1px solid transparent;
  padding: 4px 6px;
  background: rgba(5, 5, 7, 0.32);
}

.constellation a:hover,
.constellation a.is-current {
  color: var(--ink);
  border-color: var(--rule);
}

.shell.is-cinema .meta,
.shell.is-mobile-shell .meta,
.shell.is-mobile-shell .constellation {
  display: none;
}

.shell.is-cinema .viz,
.shell.is-mobile-shell .viz {
  top: 0;
  height: 100dvh;
}

@media (max-width: 760px) {
  .meta {
    left: 18px;
    top: 14px;
    font-size: 9px;
    letter-spacing: 0.2em;
  }

  .constellation {
    right: 12px;
    bottom: 18px;
  }

  .viz {
    top: 0;
    height: 100dvh;
  }

  .constellation {
    display: none;
  }
}
