Where is the node_type variable set?
node_type is set in node_preprocess_html() from the Node module.

/**
 * Implements hook_preprocess_HOOK() for HTML document templates.
 */
function node_preprocess_html(&amp;$variables) {
  // If on an individual node page, add the node type to body classes.
  if (($node = \Drupal::routeMatch()-&gt;getParameter('node')) &amp;&amp; $node instanceof NodeInterface) {
    $variables['node_type'] = $node-&gt;getType();
  }
}