/* Transparent, click-through artwork follows the viewport across every section. */
#python-overlay {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 30;
  display: block;
  overflow: hidden;
  background: transparent;
  border: 0;
  pointer-events: none;
  user-select: none;
  opacity: 0;
  visibility: hidden;
  contain: strict;
}

#python-overlay[data-python-state="ready"] {
  opacity: .34;
  visibility: visible;
  mask-image: linear-gradient(90deg, #000 0%, #0008 25%, #0004 48%, #0008 76%, #000 100%);
}

#python-overlay canvas {
  display: block;
  width: 100%;
  height: 100%;
  background: transparent;
  pointer-events: none;
}

/* Keep the pythons present while the manuscript is open, with quieter ink. */
body.revealed #python-overlay[data-python-state="ready"] {
  opacity: .27;
}

#python-overlay[hidden] {
  display: none;
  opacity: 0;
  visibility: hidden;
}

@media (max-width: 600px) {
  #python-overlay[data-python-state="ready"] { opacity: .2; }
  body.revealed #python-overlay[data-python-state="ready"] { opacity: .18; }
}

@media (prefers-reduced-motion: reduce) {
  html:not(.motion-opt-in) #python-overlay,
  html:not(.motion-opt-in) #python-overlay canvas {
    animation: none !important;
    transition: none !important;
  }
}

@media print {
  #python-overlay { display: none !important; }
}
