:root {
  --ink: #f4efe6;
  --paper: #080706;
  --muted: rgba(244, 239, 230, 0.66);
  --line: rgba(244, 239, 230, 0.18);
}

* {
  box-sizing: border-box;
  font-stretch: inherit;
  font-width: inherit;
  font-variation-settings: inherit;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  overflow-x: hidden;
  background: var(--paper);
  color: var(--ink);
  font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
  font-stretch: 150%;
  font-width: 150%;
  font-variation-settings: "wdth" 150;
  letter-spacing: 0;
}

a,
button {
  color: inherit;
  font: inherit;
}

a {
  text-decoration: none;
}

button {
  cursor: pointer;
}

.brand-topbar {
  position: fixed;
  z-index: 30;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px clamp(18px, 4vw, 54px);
  background: linear-gradient(180deg, rgba(8, 7, 6, 0.7), rgba(8, 7, 6, 0));
  text-transform: uppercase;
}

.wordmark {
  font-size: clamp(18px, 2vw, 26px);
  font-weight: 800;
}

.brand-topbar nav {
  display: flex;
  gap: clamp(14px, 2vw, 28px);
  color: var(--muted);
  font-size: 11px;
}

.yzys-book {
  display: grid;
  gap: 0;
}

.pdf-page {
  position: relative;
  min-height: auto;
  display: grid;
  place-items: center;
  padding: 0;
  border-bottom: 0;
  background: #080706;
}

.pdf-page img {
  display: block;
  width: min(1180px, 100%);
  max-height: none;
  object-fit: contain;
  box-shadow: none;
}

.final-page {
  overflow: hidden;
}

.archive-trigger {
  position: absolute;
  z-index: 4;
  right: clamp(18px, 6vw, 90px);
  bottom: clamp(22px, 6vw, 78px);
  min-width: 176px;
  border: 1px solid rgba(244, 239, 230, 0.72);
  border-radius: 999px;
  padding: 13px 18px;
  background: rgba(8, 7, 6, 0.62);
  color: var(--ink);
  backdrop-filter: blur(16px);
  font-size: 12px;
  text-transform: uppercase;
  transition:
    transform 180ms ease,
    background 180ms ease;
}

.archive-trigger:hover {
  transform: translateY(-2px);
  background: rgba(244, 239, 230, 0.16);
}

.output-gallery {
  position: relative;
  min-height: 100svh;
  overflow: hidden;
  padding: clamp(80px, 10vw, 130px) clamp(14px, 4vw, 54px) clamp(42px, 6vw, 70px);
  border-top: 1px solid var(--line);
  background: #050504;
  opacity: 0;
  transform: scale(0.96);
  max-height: 0;
  pointer-events: none;
  transition:
    opacity 420ms ease,
    transform 420ms ease,
    max-height 0ms linear 420ms;
}

.output-gallery.is-open {
  opacity: 1;
  transform: scale(1);
  max-height: 4000px;
  pointer-events: auto;
  transition:
    opacity 420ms ease,
    transform 420ms ease,
    max-height 0ms;
}

.gallery-head {
  position: relative;
  z-index: 3;
  margin-bottom: 24px;
  text-transform: uppercase;
}

.gallery-head p {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 12px;
}

.gallery-head h1 {
  margin: 0;
  font-size: clamp(48px, 11vw, 148px);
  line-height: 0.86;
}

.output-wall {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  height: min(720px, 70svh);
  overflow: hidden;
  mask-image: linear-gradient(180deg, transparent, #000 10%, #000 90%, transparent);
}

.output-column {
  display: grid;
  gap: 12px;
  align-content: start;
  animation: output-scroll 26s linear infinite;
}

.output-wall:hover .output-column,
.output-wall:focus-within .output-column {
  animation-play-state: paused;
}

.output-column:nth-child(2) {
  animation-duration: 32s;
  animation-direction: reverse;
}

.output-column:nth-child(3) {
  animation-duration: 29s;
}

.output-column:nth-child(4) {
  animation-duration: 35s;
  animation-direction: reverse;
}

.output-tile {
  position: relative;
  display: block;
  width: 100%;
  border: 0;
  padding: 0;
  overflow: hidden;
  background: transparent;
  cursor: zoom-in;
  pointer-events: auto;
}

.output-tile img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  filter: saturate(0.95) contrast(1.02);
}

.output-tile:nth-child(3n) img {
  aspect-ratio: 1 / 1;
}

.output-tile:nth-child(4n) img {
  aspect-ratio: 3 / 4;
}

@keyframes output-scroll {
  from {
    transform: translateY(0);
  }

  to {
    transform: translateY(-50%);
  }
}

.lightbox {
  position: fixed;
  z-index: 80;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 54px 18px 24px;
  background: rgba(0, 0, 0, 0.9);
}

.lightbox[hidden] {
  display: none;
}

.lightbox img {
  max-width: 100%;
  max-height: 86svh;
  object-fit: contain;
}

.lightbox-close {
  position: absolute;
  top: 16px;
  right: 18px;
  border: 1px solid rgba(244, 239, 230, 0.45);
  border-radius: 999px;
  padding: 10px 14px;
  background: rgba(244, 239, 230, 0.08);
  color: var(--ink);
  font-size: 11px;
  text-transform: uppercase;
}

@media (max-width: 820px) {
  .brand-topbar {
    align-items: flex-start;
    padding: 18px;
  }

  .brand-topbar nav {
    display: grid;
    gap: 8px;
    text-align: right;
  }

  .pdf-page {
    min-height: 82svh;
    padding: 72px 10px 32px;
  }

  .pdf-page img {
    max-height: calc(82svh - 104px);
  }

  .archive-trigger {
    right: 18px;
    bottom: 22px;
    min-width: 148px;
    padding: 11px 13px;
    font-size: 11px;
  }

  .output-wall {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    height: 68svh;
  }
}

@media (max-width: 480px) {
  .gallery-head h1 {
    font-size: clamp(42px, 16vw, 76px);
  }
}
