:root {
  --mobile-banner-height: 30px;
}

html,
body.body-main {
  height: 100%;
  width: 100%;
  overflow: hidden !important;
  margin: 0 !important;
  padding: 0 !important;
  touch-action: none;
}

body.body-main {
  /* Hide scrollbar for Chrome, Safari and Opera */
  &::-webkit-scrollbar {
    display: none;
  }
  /* Hide scrollbar for IE, Edge and Firefox */
  -ms-overflow-style: none; /* IE and Edge */
  scrollbar-width: none; /* Firefox */
}

/* Set a different background for the calendar page ONLY on desktop screens */
@media (min-width: 769px) {
  body.body-main {
    background: #000 url(../assets/backgrounds/main_background.jpg) center 15%
      no-repeat !important;
    /* Modern-format tiers; the jpg shorthand above is the fallback. Tiers are
       built by tools/build_images.mjs (`make images`). */
    background-image: image-set(
      url(../assets/backgrounds/main_background.avif) type("image/avif"),
      url(../assets/backgrounds/main_background.webp) type("image/webp")
    ) !important;
    background-size: cover !important;
    background-attachment: fixed;
  }

  .quantum-widget {
    top: clamp(0vh, 0vh, 0vh);
    left: 0%;
    transform: translate(-50%, 0);
    width: clamp(1000px, 50vw, 1000px);
  }

  .video-background {
    display: none;
  }
}

h1 {
  color: #fff; /* Changed to white for dark background */
  margin-bottom: 20px;
}

/* Media Queries for .container position and background */
@media screen and (max-width: 768px) {
  body.body-main {
    /* Specific body overrides for mobile */
    background: transparent !important;
  }

  /* Hide the black overscroll bars that obscure the video at top/bottom */
  body.body-main::before,
  body.body-main::after {
    display: none !important;
  }

  .video-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    min-height: 100dvh;
    z-index: -1;
    overflow: hidden;
  }

  .video-background video {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .hide-on-mobile {
    display: none;
  }
}

body.body-main footer {
  position: fixed;
  z-index: 1001;
  left: 0;
  right: 0;
  bottom: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 0px;
  width: 100%;
  max-width: none;
  transform: none;
  font-size: 12px;
  text-align: center;
  padding: 0;
  pointer-events: none;
}

body.body-main footer a {
  pointer-events: auto;
  color: rgba(255, 255, 255, 0.5);
  transition:
    opacity 0.5s ease,
    color 0.5s ease;
  text-decoration: none;
}

body.body-main footer a:hover,
body.body-main footer a:focus {
  opacity: 1;
  color: #fff;
}

body.body-main footer .mobile-banner {
  position: relative;
  left: auto;
  bottom: auto;
  transform: none;
  display: block;
  height: var(--mobile-banner-height);
  width: auto;
  margin: 0 auto;
  z-index: auto;
  opacity: 0.5;
  visibility: visible;
  pointer-events: none;
  mix-blend-mode: normal;
  transition:
    opacity 0.3s cubic-bezier(0.25, 0.8, 0.25, 1),
    visibility 0s linear 0.3s;
}

footer .fa-github {
  font-size: 12px;
}

/* iOS Safe Area Insets for bottom-positioned elements on the main page */
@supports (bottom: env(safe-area-inset-bottom)) {
  body.body-main footer {
    bottom: calc(10px + env(safe-area-inset-bottom));
  }
}

.quantum-widget {
  position: fixed;
  aspect-ratio: 1;
  height: auto;
  min-height: 1px;
  z-index: 500;
  pointer-events: auto;
  display: grid;
  place-items: center;
  padding: 0;
  background: none;
  gap: 0;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  cursor: grab;
  filter: none;
  overflow: visible;
}

.quantum-widget canvas,
.quantum-widget .quantum-wave-canvas {
  position: relative;
  z-index: 1;
  width: 100% !important;
  height: 100% !important;
  display: block;
  background: transparent !important;
  mix-blend-mode: normal;
  filter: grayscale(1) contrast(1.2) brightness(1.12);
}

.quantum-background-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw !important;
  height: 100vh !important;
  pointer-events: none;
  z-index: 499;
}

.quantum-widget.is-dragging {
  cursor: grabbing;
}

.quantum-widget.is-offline {
  filter: grayscale(1) contrast(1.05);
}

.quantum-widget.is-offline canvas {
  background: repeating-linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.18),
    rgba(255, 255, 255, 0.18) 8px,
    rgba(0, 0, 0, 0.18) 8px,
    rgba(0, 0, 0, 0.18) 16px
  ) !important;
}

.quantum-widget .quantum-offline {
  width: 100% !important;
  height: 100% !important;
  mask-image: radial-gradient(
    circle at 50% 50%,
    rgba(0, 0, 0, 1) 70%,
    rgba(0, 0, 0, 0) 100%
  );
  mask-repeat: no-repeat;
  mask-size: 120% 120%;
  -webkit-mask-image: radial-gradient(
    circle at 50% 50%,
    rgba(0, 0, 0, 1) 70%,
    rgba(0, 0, 0, 0) 100%
  );
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-size: 120% 120%;
}

@media screen and (max-width: 768px) {
  .quantum-widget {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: clamp(220vw, 86vw, 92vw);
    aspect-ratio: 1;
    z-index: 100;
    filter: drop-shadow(0 24px 56px rgba(0, 0, 0, 0.55));
  }

  .quantum-widget canvas,
  .quantum-widget .quantum-wave-canvas {
    border-radius: 42px;
  }
}
