/* Let native anchors retain their URLs, focus behavior and browser history. */
html {
  scroll-behavior: smooth;
}

/* Only the reading area moves; navigation and the quiet sky remain steady. */
#main {
  animation: page-arrive 240ms cubic-bezier(.2, .7, .3, 1) both;
}

.is-page-leaving #main {
  animation: page-depart 140ms cubic-bezier(.4, 0, .8, .4) both;
}

@keyframes page-arrive {
  from { transform: translateY(14px); opacity: .72; }
  to { transform: translateY(0); opacity: 1; }
}

@keyframes page-depart {
  from { transform: translateY(0); opacity: 1; }
  to { transform: translateY(-6px); opacity: .78; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  #main, .is-page-leaving #main { animation: none; }
}

@media print {
  html { scroll-behavior: auto; }
  #main, .is-page-leaving #main { animation: none; }
}
