:root {
  color-scheme: dark;
  --ink: #f3eee5;
  --muted: #b4aa9b;
  --ground: #0b0a0a;
  --line: rgba(243, 238, 229, 0.24);
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

body {
  margin: 0;
  overflow: hidden;
  background: var(--ground);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.site-header {
  position: fixed;
  z-index: 2;
  top: 0;
  left: 0;
  width: 100%;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 1.35rem 1.6rem;
  pointer-events: none;
}

.home-link,
.header-nav button {
  pointer-events: auto;
  color: var(--ink);
  font-size: 0.66rem;
  line-height: 1;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-decoration: none;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  pointer-events: auto;
}

.nav-left { justify-self: start; }
.nav-right { justify-self: end; }

.brand {
  display: block;
  width: 3.5rem;
  line-height: 0;
  pointer-events: auto;
}

.brand img { display: block; width: 100%; height: auto; }

.header-nav button {
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  font-family: inherit;
}

.home-link:hover,
.header-nav button:hover,
.arrow:hover { opacity: 0.62; }

.catalogue-track {
  display: flex;
  width: 100vw;
  height: 100vh;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
}

.catalogue-track::-webkit-scrollbar { display: none; }

.page {
  margin: 0;
  flex: 0 0 100vw;
  width: 100vw;
  height: 100vh;
  display: grid;
  place-items: center;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  padding: 5rem 3.6rem 5.2rem;
}

.cover,
.section-page {
  position: relative;
  overflow: hidden;
  background: var(--ground);
}

.cover {
  background: var(--ground);
}

.cover-image {
  position: absolute;
  inset: 0;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  transform: scale(1.04);
  animation: settle 13s ease-out both;
}

.cover-image.is-changing { animation: settle 10s ease-out both; }

.cover-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(11, 10, 10, 0.88), rgba(11, 10, 10, 0.56) 62%, rgba(11, 10, 10, 0.74)), linear-gradient(0deg, rgba(11, 10, 10, 0.7), transparent 56%);
}

.section-page h1 {
  z-index: 1;
  margin: 0;
  color: var(--ink);
  font-size: clamp(2.2rem, 5.2vw, 6.4rem);
  font-weight: 400;
  letter-spacing: 0.23em;
  text-align: center;
  text-transform: uppercase;
}

@keyframes settle {
  from { transform: scale(1.1); }
  to { transform: scale(1.04); }
}

.cover h1 {
  margin: 0;
  color: var(--ink);
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: clamp(49px, 10.2vw, 158px);
  font-weight: 300;
  letter-spacing: 0.025em;
  line-height: 0.82;
  position: relative;
  text-align: center;
}

.cover-title {
  position: absolute;
  z-index: 1;
  bottom: 8vw;
  left: 50%;
  display: grid;
  gap: 1rem;
  justify-items: center;
  transform: translateX(-50%);
}

.cover-title p {
  margin: 0;
  color: var(--ink);
  font-size: clamp(0.82rem, 1.5vw, 1.25rem);
  font-weight: 300;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.section-page {
  isolation: isolate;
  background-color: var(--ground);
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}

.section-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(11, 10, 10, 0.68), rgba(11, 10, 10, 0.54) 60%, rgba(11, 10, 10, 0.63)), rgba(11, 10, 10, 0.58);
}

.section-page h1 {
  position: relative;
  z-index: 1;
}


.page.artefact-page {
  grid-template-columns: minmax(0, 1fr) minmax(16rem, 0.34fr);
  grid-template-rows: minmax(0, 1fr);
  align-items: center;
  gap: 2.5rem;
}

.page.artefact-page img {
  width: 100%;
  height: min(78vh, 790px);
  max-width: none;
  max-height: none;
  object-fit: cover;
  object-position: 72% center;
}

.page.artefact-page .page-caption {
  width: 100% !important;
  align-self: center;
  font-size: 0.56rem;
}

.cover h1 {
  position: relative;
  z-index: 1;
}

.section-page h1 { color: var(--muted); }

.page.has-caption {
  grid-template-rows: minmax(0, 1fr) auto;
  align-content: stretch;
  gap: 0.95rem;
}

/* The fabric works begin below the fixed MA+KE lab mark. */
.page.fabric-page { padding-top: 9rem; }

.page img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  box-shadow: none;
  user-select: none;
  -webkit-user-drag: none;
  cursor: zoom-in;
}

.page.has-caption img { max-height: 100%; }

.page-caption {
  width: min(100%, 72rem);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.1rem;
  margin: 0;
  color: var(--ink);
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  line-height: 1.35;
  text-transform: uppercase;
  justify-self: center;
}

.page-caption.two-up { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.caption-block { min-width: 0; }

.caption-block h2,
.caption-block p { margin: 0; font: inherit; }

.caption-block h2 { margin-bottom: 0.18rem; font-size: 0.72rem; font-weight: 400; letter-spacing: 0.09em; }

.caption-detail { color: var(--muted); font-weight: 400; letter-spacing: 0.07em; white-space: nowrap; }

.caption-block p { color: var(--muted); }

.controls {
  position: fixed;
  z-index: 3;
  right: 1.6rem;
  bottom: 1.35rem;
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.arrow {
  width: 2.55rem;
  height: 2.55rem;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font: 1.12rem/1 Arial, Helvetica, sans-serif;
  transition: opacity 180ms ease, border-color 180ms ease;
}

.arrow:disabled { cursor: default; opacity: 0.25; }

.reader {
  width: 100vw;
  height: 100vh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: var(--ground);
  color: var(--ink);
}

.reader::backdrop { background: rgba(0, 0, 0, 0.82); }

.reader-canvas {
  width: 100%;
  height: 100%;
  overflow: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4rem 5rem;
}

.reader-page {
  width: min(1800px, 180vw);
  display: grid;
  grid-template-rows: auto auto;
  gap: 1rem;
  margin: 0;
}

.reader-canvas img {
  display: block;
  width: 100%;
  max-width: none;
  height: auto;
  box-shadow: none;
}

.reader-page .page-caption { width: 100%; font-size: 0.8rem; }

.reader-page .caption-block h2 { font-size: 0.92rem; }

.reader-close {
  position: fixed;
  z-index: 1;
  top: 1.25rem;
  right: 1.5rem;
  width: 2.7rem;
  height: 2.7rem;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--ground);
  color: var(--ink);
  cursor: pointer;
  font: 1.5rem/1 Arial, Helvetica, sans-serif;
}

@media (max-width: 640px) {
  html,
  body,
  .catalogue-track,
  .page {
    height: 100svh;
    min-height: 100svh;
  }

  .site-header {
    grid-template-columns: 1fr auto 1fr;
    gap: 0.35rem;
    padding: 1.05rem 0.8rem;
  }

  .brand { width: 2.9rem; }

  .home-link { display: none; }

  .header-nav { gap: 0.4rem; }

  .home-link,
  .header-nav button { font-size: 0.44rem; letter-spacing: 0.11em; }

  .caption-detail { white-space: normal; }

  .cover-title { bottom: 7rem; gap: 0.75rem; }

  .cover-title p { font-size: 0.7rem; }

  .page.artefact-page { display: grid; grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) auto; gap: 0.6rem; }

  .page.artefact-page img { width: auto; height: auto; max-width: 100%; max-height: 100%; object-fit: contain; }

  .page.artefact-page .page-caption { font-size: 0.47rem; }

  .page { padding: 5.75rem 1rem 5rem; }

  .page.fabric-page { padding-top: 6.5rem; }

  .page.has-caption { gap: 0.6rem; }

  /* Keep the complete artwork visible in the phone-sized slide. */
  .page:not(.cover):not(.section-page) img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
  }

  .page-caption { width: 100%; gap: 0.75rem; font-size: 0.48rem; line-height: 1.28; }

  .caption-block h2 { font-size: 0.56rem; }

  .controls {
    right: 1rem;
    bottom: 1rem;
    gap: 0.65rem;
  }

  .arrow { width: 2.35rem; height: 2.35rem; }

  .reader-canvas { align-items: flex-start; justify-content: flex-start; padding: 4rem 1rem 1rem; }

  .reader-page { width: 240vw; }

  .reader-page .page-caption { font-size: 0.72rem; }

  .reader-page .caption-block h2 { font-size: 0.84rem; }

  .reader-close { top: 0.8rem; right: 0.9rem; }

}
