/* Video layer used by the home and default Butterfly top banners. */
#page-header.has-top-video {
  overflow: hidden;
}

#page-header > .top-bg-video {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  pointer-events: none;
}

#page-header.has-top-video::before {
  z-index: 1;
}

#page-header.has-top-video #nav,
#page-header.has-top-video #site-info,
#page-header.has-top-video #scroll-down,
#page-header.has-top-video #page-site-info,
#page-header.has-top-video #post-info {
  z-index: 2;
}

/* A light paper-like background with an automatic dark-mode counterpart. */
body {
  background-color: #f8f9fc;
  background-image:
    radial-gradient(circle at 12% 18%, rgba(119, 152, 255, 0.12), transparent 28%),
    radial-gradient(circle at 88% 12%, rgba(255, 183, 213, 0.12), transparent 26%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(244, 247, 252, 0.96));
  background-attachment: fixed;
  background-size: cover;
}

[data-theme='dark'] body {
  background-color: #10131a;
  background-image:
    radial-gradient(circle at 12% 18%, rgba(86, 112, 190, 0.15), transparent 30%),
    radial-gradient(circle at 88% 12%, rgba(144, 77, 111, 0.12), transparent 28%),
    linear-gradient(135deg, rgba(16, 19, 26, 0.98), rgba(24, 29, 40, 0.98));
}

/* Keep index article cards readable while revealing a little more background. */
#recent-posts > .recent-post-item {
  background: rgba(255, 255, 255, 0.82);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

[data-theme='dark'] #recent-posts > .recent-post-item {
  background: rgba(28, 32, 40, 0.78);
}

/* Use the project's GIF as Butterfly's full-page loading illustration. */
#loading-box .spinner-box {
  background-image: url('/img/loading.gif');
  background-position: center;
  background-repeat: no-repeat;
  background-size: min(38vw, 160px) auto;
}

#loading-box .configure-border-1,
#loading-box .configure-border-2 {
  display: none;
}

#loading-box .loading-word {
  transform: translateY(105px);
}

/* Respect the visitor's operating-system motion preference. */
@media (prefers-reduced-motion: reduce) {
  #page-header > .top-bg-video {
    display: none;
  }
}
