:root {
  color-scheme: dark;
  --black: #070706;
  --paper: #f1efe9;
  --muted: #8c8880;
  --orange: #ed7435;
  --line: #4c2c1c;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background: var(--black);
}

body {
  margin: 0;
  overflow-x: hidden;
  background: var(--black);
  color: var(--paper);
  font-family: Arial, Helvetica, sans-serif;
}

body:has(.viewer[open]) {
  overflow: hidden;
}

button,
a {
  color: inherit;
}

.back-link {
  position: fixed;
  z-index: 20;
  top: 1.5rem;
  left: 1.5rem;
  display: flex;
  gap: 0.6rem;
  align-items: center;
  min-height: 44px;
  padding: 0.6rem;
  color: #c8c4bd;
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-decoration: none;
  text-transform: uppercase;
  transition: color 180ms ease;
}

.back-link::first-letter {
  color: var(--orange);
}

.back-link:hover {
  color: var(--paper);
}

.stage {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 8vw;
  background-image: url('images/background.jpg');
  background-position: center;
  background-size: cover;
}

.stage__shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.03) 18%, rgba(0, 0, 0, 0.84) 100%),
    linear-gradient(0deg, rgba(0, 0, 0, 0.52), transparent 52%);
}

.stage h1 {
  position: relative;
  z-index: 1;
  width: min(68vw, 52rem);
  margin: 0;
  text-align: right;
  font: 400 clamp(2.5rem, 6vw, 6rem) / 0.9 Georgia, 'Times New Roman', serif;
  letter-spacing: -0.045em;
  text-wrap: balance;
}

.stage h1 em {
  display: block;
  color: var(--orange);
  font-weight: 400;
}

.credit {
  position: absolute;
  z-index: 1;
  right: 1.8rem;
  bottom: 1.5rem;
  margin: 0;
  color: rgba(255, 255, 255, 0.38);
  font-size: 0.6rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.scroll-cue {
  position: absolute;
  z-index: 1;
  left: 1.8rem;
  bottom: 1.5rem;
  min-height: 44px;
  display: flex;
  gap: 0.8rem;
  align-items: center;
  color: #aaa69e;
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  text-decoration: none;
  text-transform: uppercase;
}

.scroll-cue span {
  color: var(--orange);
  font-size: 1rem;
}

.gallery {
  padding: 14vh 7vw 18vh;
  background: radial-gradient(circle at 50% 22%, #17120e, var(--black) 55%);
}

.gallery--fallback figure {
  width: min(100%, 70rem);
  margin: 0 auto 18vh;
}

.gallery--fallback img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: contain;
}

.act {
  width: min(100%, 76rem);
  margin: 0 auto 20vh;
  display: grid;
  grid-template-columns: 5rem minmax(0, 70rem);
  gap: 1.5rem;
  align-items: start;
  opacity: 0;
  transform: translateY(2rem);
  transition: opacity 700ms ease, transform 700ms cubic-bezier(0.2, 0.7, 0.2, 1);
}

.act:last-child {
  margin-bottom: 0;
}

.act--visible {
  opacity: 1;
  transform: none;
}

.act__count {
  margin: 0;
  padding-top: 0.7rem;
  border-top: 1px solid var(--line);
  color: #bc683d;
  font: 400 0.78rem / 1 Georgia, serif;
}

.act__frame {
  min-width: 0;
}

@media (min-width: 701px) {
  .act__frame {
    width: 100%;
    max-width: 80svh;
    margin-inline: auto;
  }
}

.act__open {
  position: relative;
  display: block;
  width: 100%;
  min-height: 44px;
  padding: 0;
  overflow: hidden;
  border: 0;
  background: #030303;
  cursor: zoom-in;
}

.act__open::after {
  content: '';
  position: absolute;
  inset: 0;
  border: 1px solid transparent;
  pointer-events: none;
  transition: border-color 220ms ease;
}

.act__open:hover::after {
  border-color: rgba(237, 116, 53, 0.62);
}

.act__open img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  transition: transform 900ms cubic-bezier(0.2, 0.7, 0.2, 1);
}

.act__open:hover img {
  transform: scale(1.012);
}

.act__label {
  margin: 0.75rem 0 0;
  color: #69655f;
  font-size: 0.58rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.progress {
  position: fixed;
  z-index: 15;
  right: 1.5rem;
  top: 50%;
  display: grid;
  gap: 0.45rem;
  transform: translateY(-50%);
}

.progress__mark {
  display: block;
  width: 3px;
  height: 3px;
  border-radius: 3px;
  background: #57534d;
  transition: height 240ms ease, background-color 240ms ease;
}

.progress__mark[aria-current='step'] {
  height: 24px;
  background: var(--orange);
}

.viewer {
  width: 100vw;
  height: 100svh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 1.5rem;
  border: 0;
  background: rgba(3, 3, 3, 0.98);
  color: var(--paper);
}

.viewer::backdrop {
  background: #000;
}

.viewer[open] {
  display: grid;
  grid-template-columns: 4rem 1fr 4rem;
  align-items: center;
}

.viewer figure {
  min-width: 0;
  margin: 0;
  text-align: center;
}

.viewer img {
  display: block;
  width: auto;
  height: auto;
  max-width: calc(100vw - 8rem);
  max-height: calc(100svh - 7rem);
  margin: auto;
  object-fit: contain;
}

.viewer figcaption {
  margin-top: 0.8rem;
  color: var(--muted);
  font-size: 0.65rem;
  letter-spacing: 0.16em;
}

.viewer button {
  min-width: 44px;
  min-height: 44px;
  border: 0;
  background: transparent;
  color: var(--paper);
  font-size: 1.5rem;
  cursor: pointer;
}

.viewer__close {
  position: absolute;
  z-index: 2;
  top: 1rem;
  right: 1rem;
}

:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 4px;
}

@media (max-width: 700px) {
  .back-link {
    top: 0.75rem;
    left: 0.75rem;
  }

  .stage {
    align-items: flex-end;
    justify-content: flex-start;
    padding: 1.5rem;
  }

  .stage h1 {
    width: 100%;
    margin-bottom: 16vh;
    text-align: left;
    font-size: clamp(2.5rem, 12vw, 4.4rem);
  }

  .credit {
    right: 1rem;
  }

  .scroll-cue {
    left: 1rem;
  }

  .gallery {
    padding: 12vh 1rem 16vh;
  }

  .act {
    grid-template-columns: 1fr;
    gap: 0.65rem;
    margin-bottom: 15vh;
  }

  .progress {
    display: none;
  }

  .viewer {
    padding: 1rem;
  }

  .viewer[open] {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 4rem;
  }

  .viewer figure {
    grid-column: 1 / -1;
  }

  .viewer img {
    max-width: calc(100vw - 2rem);
    max-height: calc(100svh - 8rem);
  }

  .viewer__nav--prev,
  .viewer__nav--next {
    grid-row: 2;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .act {
    opacity: 1;
    transform: none;
  }
}
