:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #101820;
  color: #f6f3ed;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-width: 240px;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #101820;
}

button {
  font: inherit;
}

.slideshow {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 220px;
  overflow: hidden;
  isolation: isolate;
  background: #101820;
}

.image-stage,
.slide-image,
.vignette {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.image-stage {
  z-index: -2;
  background: #101820;
}

.slide-image {
  object-fit: cover;
  object-position: center;
  opacity: 0;
  transform: scale(1.015);
  transition: opacity 1100ms ease, transform 8000ms linear;
}

.slide-image.is-active {
  opacity: 1;
  transform: scale(1);
}

.vignette {
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(9, 18, 27, 0.75) 0%, rgba(9, 18, 27, 0.08) 34%, rgba(9, 18, 27, 0.15) 54%, rgba(9, 18, 27, 0.9) 100%),
    linear-gradient(90deg, rgba(9, 18, 27, 0.5), transparent 46%, rgba(9, 18, 27, 0.12));
}

.slide-copy,
.toolbar {
  position: absolute;
  left: clamp(1.1rem, 4vw, 4.5rem);
  right: clamp(1.1rem, 4vw, 4.5rem);
}

.eyebrow,
.slide-number {
  margin: 0;
  color: #d4aa62;
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  line-height: 1.3;
  text-transform: uppercase;
}

.slide-copy {
  bottom: clamp(2.2rem, 5vh, 3.5rem);
  max-width: 40rem;
}

.slide-copy h2 {
  margin: 0.35rem 0 0.25rem;
  font-size: clamp(1rem, 2.2vw, 2.2rem);
  font-weight: 550;
  letter-spacing: -0.045em;
  line-height: 1.02;
}

.slide-copy p:not(.slide-number) {
  max-width: 34rem;
  margin: 0;
  color: rgba(246, 243, 237, 0.84);
  font-size: clamp(0.72rem, 1vw, 0.88rem);
  line-height: 1.4;
}

.toolbar {
  bottom: clamp(0.7rem, 1.5vw, 1.2rem);
}

.progress {
  width: 100%;
  height: 2px;
  overflow: hidden;
  background: rgba(246, 243, 237, 0.24);
}

.progress span {
  display: block;
  width: 0;
  height: 100%;
  background: #d4aa62;
  transform-origin: left center;
}

.progress span.is-playing {
  animation: progress 8s linear forwards;
}

.dialog-close {
  border: 1px solid rgba(246, 243, 237, 0.35);
  border-radius: 999px;
  color: #f6f3ed;
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
}

.dialog-close:hover {
  border-color: #d4aa62;
  background: rgba(212, 170, 98, 0.16);
  color: #fff6e7;
}

.dialog-close:focus-visible {
  outline: 2px solid #d4aa62;
  outline-offset: 3px;
}

.credits-dialog {
  width: min(42rem, calc(100% - 2rem));
  max-height: min(80vh, 42rem);
  padding: clamp(1.2rem, 3vw, 2rem);
  border: 1px solid rgba(212, 170, 98, 0.45);
  border-radius: 1.1rem;
  background: #17242d;
  color: #f6f3ed;
  box-shadow: 0 1rem 5rem rgba(0, 0, 0, 0.45);
}

.credits-dialog::backdrop {
  background: rgba(4, 9, 13, 0.74);
  backdrop-filter: blur(4px);
}

.dialog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.dialog-header h2 {
  margin: 0.35rem 0 0;
  font-size: clamp(1.5rem, 4vw, 2.4rem);
  letter-spacing: -0.04em;
}

.dialog-close {
  width: 2.25rem;
  height: 2.25rem;
  flex: 0 0 auto;
  background: transparent;
  font-size: 1.4rem;
  line-height: 1;
}

.dialog-intro {
  margin: 1.4rem 0;
  color: rgba(246, 243, 237, 0.75);
  font-size: 0.86rem;
  line-height: 1.5;
}

.credits-list {
  display: grid;
  gap: 1rem;
  margin: 0;
  padding-left: 1.2rem;
  overflow-y: auto;
}

.credits-list li {
  padding-left: 0.25rem;
  color: rgba(246, 243, 237, 0.78);
  font-size: 0.82rem;
  line-height: 1.45;
}

.credits-list strong {
  color: #f6f3ed;
}

.credits-list a {
  color: #e8c685;
}

@keyframes progress {
  from { width: 0; }
  to { width: 100%; }
}

@media (max-width: 560px) {
  .slide-copy {
    bottom: 2.8rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .slide-image,
  .dialog-close {
    transition: none;
  }

  .progress span.is-playing {
    animation: none;
    width: 100%;
  }
}
