:root {
  color-scheme: light;
  --paper: #f5f2ec;
  --ink: #161412;
  --image-backdrop: #0d0d0d;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--image-backdrop);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  transition: background-color 900ms ease;
}

img {
  display: block;
  max-width: 100%;
}

.site-header {
  position: fixed;
  z-index: 10;
  top: 0;
  left: 0;
  right: 0;
  padding: clamp(18px, 3vw, 36px);
}

.site-title {
  margin: 0;
  color: #fff;
  font-family: Chango, Georgia, "Times New Roman", serif;
  font-weight: 400;
  font-size: clamp(1.4rem, 3vw, 3rem);
  letter-spacing: 0;
  line-height: 1;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.45);
}

.carousel {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  background: var(--image-backdrop);
  transition: background-color 900ms ease;
}

.carousel-stage,
.carousel-slide {
  position: absolute;
  inset: 0;
}

.carousel-slide {
  display: grid;
  place-items: center;
  margin: 0;
  opacity: 0;
  transition: opacity 260ms ease;
  pointer-events: none;
}

.carousel-slide.is-active {
  opacity: 1;
  pointer-events: auto;
}

.carousel-slide img {
  width: min(82vw, 1280px);
  height: min(72vh, 820px);
  object-fit: contain;
  filter: drop-shadow(0 28px 70px rgba(0, 0, 0, 0.36));
}

.carousel-button,
.full-view-close {
  position: fixed;
  z-index: 20;
  display: grid;
  place-items: center;
  border: 0;
  background: rgba(245, 242, 236, 0.18);
  color: #fff;
  font: inherit;
  cursor: pointer;
  backdrop-filter: blur(18px);
}

.full-view-close:hover {
  background: rgba(245, 242, 236, 0.3);
}

.carousel-button:focus-visible,
.full-view-close:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 4px;
}

.carousel-button {
  top: 50%;
  padding: 0;
  background: transparent;
  font-family: "Space Mono", ui-monospace, monospace;
  font-size: clamp(0.78rem, 1.2vw, 0.96rem);
  font-weight: 700;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.58);
  transform: translateY(-50%);
  backdrop-filter: none;
}

.carousel-button:hover {
  background: transparent;
  text-decoration: underline;
  text-underline-offset: 0.26em;
}

.carousel-button-prev {
  left: clamp(14px, 3vw, 32px);
}

.carousel-button-next {
  right: clamp(14px, 3vw, 32px);
}

.carousel-instructions {
  position: fixed;
  z-index: 20;
  left: 50%;
  bottom: clamp(102px, 12vw, 122px);
  margin: 0;
  color: rgba(255, 255, 255, 0.64);
  font-family: "Space Mono", ui-monospace, monospace;
  font-size: clamp(0.62rem, 1vw, 0.76rem);
  line-height: 1.55;
  text-align: center;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.5);
  transform: translateX(-50%);
}

.thumbnail-strip {
  position: fixed;
  z-index: 20;
  left: 50%;
  bottom: clamp(18px, 3vw, 34px);
  display: flex;
  max-width: min(78vw, 860px);
  gap: 10px;
  overflow-x: auto;
  padding: 10px;
  border-radius: 16px;
  background: rgba(10, 10, 10, 0.24);
  transform: translateX(-50%);
  backdrop-filter: blur(18px);
}

.thumbnail-button {
  flex: 0 0 auto;
  width: 74px;
  height: 50px;
  padding: 0;
  border: 2px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  opacity: 0.64;
  overflow: hidden;
}

.thumbnail-button:hover,
.thumbnail-button.is-active {
  border-color: rgba(255, 255, 255, 0.9);
  opacity: 1;
}

.thumbnail-button:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 4px;
}

.thumbnail-button img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.full-view {
  position: fixed;
  z-index: 50;
  inset: 0;
  display: grid;
  place-items: center;
  padding: clamp(18px, 3vw, 36px);
  background: rgba(7, 7, 7, 0.94);
}

.full-view[hidden] {
  display: none;
}

.full-view-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.full-view-close {
  top: clamp(18px, 3vw, 36px);
  right: clamp(18px, 3vw, 36px);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 28px;
  line-height: 1;
}

.full-view-close span {
  margin-top: -3px;
}

@media (max-width: 640px) {
  .site-header {
    padding: 18px;
  }

  .site-title {
    font-size: 1.35rem;
  }

  .carousel-button {
    font-size: 0.72rem;
  }

  .carousel-slide img {
    width: 84vw;
    height: 68vh;
  }

  .carousel-instructions {
    bottom: 92px;
    width: calc(100vw - 118px);
    font-size: 0.52rem;
  }

  .thumbnail-strip {
    max-width: calc(100vw - 28px);
    gap: 8px;
    padding: 8px;
  }

  .thumbnail-button {
    width: 58px;
    height: 42px;
  }
}
