:root {
  --fg: #f4f2ff;
  --c1: #ff3d81;
  --c2: #ffb03b;
  --c3: #3dd9ff;
  --c4: #9b5cff;
  --slide: 7s;
}

* { box-sizing: border-box; }

html, body { height: 100%; margin: 0; background: #000; color: var(--fg); }

body {
  font: 16px/1.4 ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  overflow: hidden;
}

.show {
  position: fixed;
  inset: 0;
  outline: none;
  background: #000;
}

.show.idle { cursor: none; }

.stage, .slide, .slide .backdrop, .slide .photo { position: absolute; inset: 0; }

.slide {
  opacity: 0;
  transition: opacity 1.2s ease;
}

.slide.on { opacity: 1; }

/* Blurred copy of the photo fills the letterbox around portrait/landscape shots */
.slide .backdrop {
  background: center / cover no-repeat;
  filter: blur(40px) brightness(0.45) saturate(1.3);
  transform: scale(1.2);
}

.slide .photo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transform-origin: var(--ox, 50%) var(--oy, 50%);
}

/* Slow Ken Burns drift while a slide is showing */
.slide.on .photo { animation: drift calc(var(--slide) + 1.5s) ease-out both; }
.show.paused .slide.on .photo { animation-play-state: paused; }

@keyframes drift {
  from { transform: scale(1); }
  to { transform: scale(1.06); }
}

/* Click/tap zones for prev/next */
.tap { position: absolute; top: 0; bottom: 0; width: 30%; z-index: 1; }
.tap.prev { left: 0; cursor: w-resize; }
.tap.next { right: 0; cursor: e-resize; }

.chrome {
  position: absolute;
  left: 0;
  right: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem;
  transition: opacity 0.4s;
}

.top {
  top: 0;
  justify-content: space-between;
  background: linear-gradient(rgb(0 0 0 / 0.55), transparent);
}

.bottom {
  bottom: 0;
  padding-bottom: 1.4rem;
  background: linear-gradient(transparent, rgb(0 0 0 / 0.55));
}

.show.idle .chrome { opacity: 0; pointer-events: none; }

.title {
  font-weight: 800;
  font-size: 1.1rem;
  background: linear-gradient(90deg, var(--c1), var(--c2), var(--c3), var(--c4));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.btn {
  appearance: none;
  border: 0;
  border-radius: 999px;
  min-width: 2.6rem;
  height: 2.6rem;
  padding: 0 0.9rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font: inherit;
  font-weight: 700;
  color: var(--fg);
  text-decoration: none;
  background: rgb(255 255 255 / 0.12);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  cursor: pointer;
  transition: background 0.2s, transform 0.2s cubic-bezier(0.2, 1.8, 0.4, 1);
}

.btn:hover, .btn:focus-visible { background: rgb(255 255 255 / 0.24); transform: scale(1.06); outline: none; }

.meta {
  margin-left: auto;
  font-variant-numeric: tabular-nums;
  color: rgb(244 242 255 / 0.8);
  font-size: 0.9rem;
}

.progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  z-index: 3;
  background: rgb(255 255 255 / 0.12);
}

#bar {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--c1), var(--c2), var(--c3), var(--c4));
}

.empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: rgb(244 242 255 / 0.7);
}

@media (prefers-reduced-motion: reduce) {
  .slide { transition-duration: 0.01ms; }
  .slide.on .photo { animation: none; }
}
