html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #000;
  color: #fff;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body.cursor-hidden,
body.cursor-hidden * {
  cursor: none !important;
}

#slideshow {
  position: fixed;
  inset: 0;
  background: #000;
}

.slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  overflow: hidden;
  background: #000;
  transition-property: opacity;
  transition-timing-function: ease-in-out;
}

.slide.active {
  opacity: 1;
  z-index: 2;
}

.background {
  position: absolute;
  inset: -5vh -5vw;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  filter: blur(28px) brightness(0.35) saturate(0.8);
  transform: scale(1.08);
  opacity: 0;
}

body.use-blur-background .background {
  opacity: 1;
}

.photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-position: center;
  transform: scale(1.01);
}

.slide.active .photo {
  animation: kenburns 14s ease-in-out forwards;
}

#caption {
  position: absolute;
  z-index: 5;
  left: 50%;
  bottom: 5vh;
  transform: translateX(-50%);
  max-width: min(80vw, 900px);
  padding: 0.7rem 1.1rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.58);
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.35);
  color: rgba(255, 255, 255, 0.96);
  font-size: clamp(1rem, 2vw, 1.5rem);
  line-height: 1.3;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.8s ease;
}

#caption.visible {
  opacity: 1;
}

#controls,
#help {
  position: absolute;
  z-index: 10;
  opacity: 0;
  transition: opacity 0.3s ease;
}

#controls {
  left: 50%;
  bottom: 1.25rem;
  transform: translateX(-50%);
  display: flex;
  gap: 0.5rem;
  padding: 0.45rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(10px);
}

#controls button {
  border: 0;
  border-radius: 999px;
  padding: 0.6rem 0.85rem;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  font: inherit;
}

#controls button:hover {
  background: rgba(255, 255, 255, 0.28);
}

#help {
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
  padding: 0.5rem 0.8rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.45);
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.95rem;
  white-space: nowrap;
}

body.show-ui #controls,
body.show-ui #help,
#controls:focus-within {
  opacity: 1;
}

#empty-state {
  position: absolute;
  z-index: 20;
  inset: 0;
  display: grid;
  place-content: center;
  text-align: center;
  padding: 2rem;
  color: rgba(255, 255, 255, 0.9);
}

#empty-state h1 {
  margin: 0 0 0.75rem;
  font-size: clamp(2rem, 5vw, 4rem);
}

#empty-state p {
  margin: 0;
  font-size: clamp(1rem, 2vw, 1.4rem);
  color: rgba(255, 255, 255, 0.7);
}

code {
  padding: 0.15rem 0.35rem;
  border-radius: 0.35rem;
  background: rgba(255, 255, 255, 0.12);
}

@keyframes kenburns {
  from {
    transform: scale(1.01) translate3d(-0.5%, -0.3%, 0);
  }
  to {
    transform: scale(1.08) translate3d(0.5%, 0.3%, 0);
  }
}

@media (max-width: 700px) {
  #controls {
    width: calc(100vw - 2rem);
    justify-content: center;
    border-radius: 1rem;
    flex-wrap: wrap;
  }

  #help {
    display: none;
  }
}
