.max-w-prose {
    max-width: 85ch;
  }

/* From https://css.glass */
.glass {
  background: rgba(18, 47, 101, 0.6);
  border-radius: 16px;
  backdrop-filter: blur(8px);
  animation: backdropShift 10s linear infinite;
  animation-delay: 2s;
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(18, 47, 101, 0.45);
  padding: 2rem;
  filter: saturate(0.8) brightness(0.9);
  opacity: 1;
  transition: opacity 1s ease-in-out, background 1s ease-in-out, backdrop-filter 1s ease-in-out, -webkit-backdrop-filter 1s ease-in-out, filter 1s ease-in-out;
  z-index: 2;
}

@keyframes backdropShift {
  0% {
    backdrop-filter: blur(8px) hue-rotate(-10deg);
  }
  50% {
    backdrop-filter: blur(8px) hue-rotate(10deg);
  }
  100% {
    backdrop-filter: blur(8px) hue-rotate(-10deg);
  }
}

.glass-unblurred {
  background: rgba(18, 47, 101, 0.05) !important;
  backdrop-filter: blur(0) hue-rotate(0deg) !important;
  -webkit-backdrop-filter: blur(0) hue-rotate(0deg) !important;
  filter: saturate(1.0) brightness(1.0) !important;
  opacity: 0.6 !important;
}

.toc:has(#TableOfContents) {
  background-color: rgba(25, 25, 35, 0.3);
  border-radius: 10px;
  max-height: 70vh;
  overflow-y: auto;
  padding: 1rem;
  scroll-behavior: smooth;
  scrollbar-color: rgba(145, 145, 185, 0.8) rgba(0, 0, 0, 0.1);
  scrollbar-width: thin;
}

.background-container {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: -1;
}

.background-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
  filter: blur(10px) saturate(0.65);
  transition: filter 2s ease;
}

.background-full {
  opacity: 0;
  transition: opacity 2s ease, filter 2s ease;
}

.background-full.loaded {
  opacity: 1;
  filter: blur(4px) saturate(0.65);
}

.background-image.unblurred {
  filter: blur(0px) saturate(1) !important;
}

#cursor-circle {
  position: fixed;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  pointer-events: none;
  transform: translate(-50%, -50%);
  opacity: 0;
  z-index: 1;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.00) 0%, rgba(255, 255, 255, 0.05) 75%, rgba(255, 255, 255, 0.7) 100%);
  transition: opacity 1.0s ease, width 4s ease, height 4s ease;
}

#cursor-circle.active {
  opacity: 1;
  width: 300px;
  height: 300px;
}

#cursor-circle.fade-out {
  opacity: 0;
  width: 20px;
  height: 20px;
  transition: opacity 1.0s ease, width 1s ease, height 1s ease;
}

/* Lead Styling */
.prose :where([class~="lead"]):not(:where([class~="not-prose"],[class~="not-prose"] *)) {
  color: rgb(209, 182, 164);
}

/* Header Page Name Styling */
nav > div > a {
  font-size: 1.5rem;
  text-shadow: 0 0 6px rgba(0, 0, 0, 0.7);
}

/* Header Button Styling */
header nav ul li a, 
header nav ul li button {
  display: inline-block;
  padding: 0.5rem 1rem;
  background: rgba(18, 47, 101, 0.25);
  border-radius: 8px;
  border: 1px solid rgba(25, 25, 35, 0.35);
  transition: all 0.3s ease;
  backdrop-filter: blur(4px);
  animation: backdropShift 10s linear infinite;
  -webkit-backdrop-filter: blur(8px);
  filter: saturate(0.9) brightness(0.9);
}

header nav ul li a:hover, 
header nav ul li button:hover {
  background-color: rgba(25, 25, 35, 0.4);
  transform: scale(1.05);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

/* Search button specific styling */
header button[id^="search-button"] {
  padding: 0.5rem 1rem;
  background: rgba(18, 47, 101, 0.25);
  border-radius: 8px;
  border: 1px solid rgba(25, 25, 35, 0.35);
  transition: all 0.3s ease;
  backdrop-filter: blur(4px);
  /* We use steps here to limit framerate to reduce CPU usage displaying the animation*/
  /* Because it is a slowly changing background, a low framerate does not impact apparent smoothness of the animation */
  animation: backdropShift 20s forwards steps(200) infinite;
  -webkit-backdrop-filter: blur(8px);
  filter: saturate(0.9) brightness(0.9);
}

header button[id^="search-button"]:hover {
  background-color: rgba(25, 25, 35, 0.4);
  transform: scale(1.05);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

/* TOC link styling */
#TableOfContents a {
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  transition: all 0.3s ease;
  display: block;
  padding: 0.25rem 0;
}

#TableOfContents a:hover {
  color: white;
  transform: translateX(4px);
}

/* Active TOC item */
#TableOfContents a.active {
  color: white;
  font-weight: 600;
  transform: translateX(4px);
  position: relative;
  transition: all 0.3s ease;
}

#TableOfContents a.active::before {
  content: '';
  position: absolute;
  left: -1rem;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 1rem;
  background: linear-gradient(to bottom, #4a9eff, #2d7bda);
  border-radius: 2px;
  transition: all 0.3s ease;
}

/* Remove the default smooth scrolling behavior */
html {
  scroll-behavior: smooth;
}

/* Video feature styling */
video.mb-6 {
  width: 100%;
  height: auto;
  object-fit: cover;
}

article video {
  max-width: 100%;
  height: auto;
}

/* Main page logo with programmatically generated sparks */
body:has(.background-container) article.glass figure:first-of-type {
  position: relative;
  isolation: isolate;
  display: inline-block;
}

body:has(.background-container) article.glass figure:first-of-type img {
  position: relative;
  z-index: 0;
}