:root {
  --ivory: #f2eee5;
  --ivory-light: #f8f5ee;
  --ink: #252720;
  --muted: #69675f;
  --bronze: #7d806f;
  --line: rgba(50, 48, 40, 0.2);
  --serif-jp: "Noto Serif JP", serif;
  --serif-en: "Cormorant Garamond", serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--ivory);
  font-family: var(--serif-jp);
  font-weight: 300;
  line-height: 1.9;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery-header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 27px 4vw;
  border-bottom: 1px solid var(--line);
  background: rgba(248, 245, 238, 0.88);
}

.gallery-logo {
  display: flex;
  width: fit-content;
  flex-direction: column;
}

.gallery-logo span {
  font-size: 23px;
  letter-spacing: 0.16em;
}

.gallery-logo small,
.gallery-header p,
.back-link {
  color: var(--muted);
  font-family: var(--serif-en);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.gallery-logo small {
  font-family: var(--serif-jp);
  font-size: 7px;
}

.gallery-header p {
  margin: 0;
}

.back-link {
  justify-self: end;
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  padding-bottom: 5px;
  border-bottom: 1px solid var(--bronze);
}

.gallery-intro {
  display: grid;
  min-height: 72vh;
  grid-template-columns: 0.7fr 1.5fr 0.7fr;
  align-items: end;
  gap: 6vw;
  padding: 12vh 6vw 9vh;
  border-bottom: 1px solid var(--line);
}

.gallery-kicker,
.gallery-index {
  margin: 0;
  color: var(--muted);
  font-family: var(--serif-en);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.gallery-kicker {
  align-self: start;
}

.gallery-title h1 {
  margin: 0;
  font-family: var(--serif-en);
  font-size: clamp(76px, 12vw, 176px);
  font-weight: 400;
  letter-spacing: -0.03em;
  line-height: 0.68;
}

.gallery-title h1 em {
  color: var(--bronze);
  font-weight: 400;
}

.gallery-title > p {
  max-width: 470px;
  margin: 70px 0 0 auto;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.1em;
  line-height: 2.4;
}

.gallery-index {
  justify-self: end;
  padding-left: 25px;
  border-left: 1px solid var(--bronze);
  line-height: 2;
}

.exhibition {
  padding: 16vh 6vw 10vh;
}

.exhibit {
  margin-bottom: 28vh;
}

.exhibit-frame {
  position: relative;
  overflow: hidden;
  background: #d8d3c7;
  border: 1px solid rgba(50, 48, 40, 0.08);
}

.exhibit-primary {
  width: min(88%, 1120px);
  margin-right: auto;
  margin-left: auto;
}

.exhibit-primary .exhibit-frame {
  height: min(70vw, 940px);
}

.exhibit-process {
  width: min(62vw, 820px);
  margin-right: 6vw;
  margin-left: auto;
}

.exhibit-process .exhibit-frame {
  height: min(76vw, 920px);
}

.exhibit-detail {
  width: min(42vw, 600px);
  margin-left: 10vw;
}

.exhibit-detail .exhibit-frame {
  aspect-ratio: 1;
}

.gallery-closing {
  min-height: 75vh;
  padding: 13vh 10vw;
  border-top: 1px solid var(--line);
  background: #d6d2c6;
}

.gallery-closing h2 {
  max-width: 780px;
  margin: 70px 0 90px;
  font-size: clamp(36px, 6vw, 76px);
  font-weight: 300;
  letter-spacing: 0.08em;
  line-height: 1.6;
}

.gallery-closing h2 em {
  color: var(--bronze);
  font-weight: 300;
}

.gallery-next-rooms {
  width: min(100%, 960px);
  margin-bottom: 56px;
}

.gallery-next-rooms > p {
  margin: 0 0 18px;
  color: var(--muted);
  font-family: var(--serif-en);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.gallery-next-rooms > div {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
}

.gallery-next-rooms a {
  display: grid;
  min-height: 150px;
  grid-template-columns: 1fr auto;
  align-content: space-between;
  gap: 26px;
  padding: 24px 28px;
  transition: color 180ms ease, background 180ms ease;
}

.gallery-next-rooms a + a {
  border-left: 1px solid var(--ink);
}

.gallery-next-rooms small {
  grid-column: 1 / -1;
  color: var(--muted);
  font-family: var(--serif-en);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.gallery-next-rooms strong {
  font-size: 18px;
  font-weight: 300;
  letter-spacing: 0.14em;
}

.gallery-next-rooms a:hover {
  color: var(--ivory-light);
  background: var(--ink);
}

.gallery-next-rooms a:hover small {
  color: rgba(248, 245, 238, 0.62);
}

.gallery-actions {
  display: grid;
  width: min(100%, 960px);
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--ink);
}

.gallery-actions a {
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: space-between;
  padding: 22px 25px;
  border-bottom: 1px solid var(--ink);
  font-size: 12px;
  letter-spacing: 0.1em;
}

.gallery-actions a + a {
  border-left: 1px solid var(--ink);
}

.gallery-footer {
  display: flex;
  justify-content: space-between;
  padding: 25px 4vw;
  color: var(--muted);
  background: var(--ink);
  font-family: var(--serif-en);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.motion-ready .reveal-media,
.motion-ready .reveal-copy {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 440ms ease, transform 560ms cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal-media.is-visible,
.reveal-copy.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.motion-fallback .reveal-media,
.motion-fallback .reveal-copy {
  opacity: 1;
  transform: none;
  transition: none;
}

@media (max-width: 760px) {
  .gallery-header {
    grid-template-columns: 1fr auto;
    padding: 20px 6vw;
  }

  .gallery-header p {
    display: none;
  }

  .gallery-intro {
    min-height: 680px;
    grid-template-columns: 1fr;
    align-items: start;
    gap: 35px;
    padding: 120px 7vw 70px;
  }

  .gallery-title h1 {
    font-size: 88px;
    line-height: 0.72;
  }

  .gallery-title > p {
    margin: 55px 0 0;
    font-size: 11px;
  }

  .gallery-index {
    justify-self: start;
  }

  .exhibition {
    padding: 90px 7vw 30px;
  }

  .exhibit {
    width: 100%;
    margin: 0 0 130px;
  }

  .exhibit-primary .exhibit-frame,
  .exhibit-process .exhibit-frame {
    height: 115vw;
  }

  .exhibit-process {
    width: 86%;
    margin-left: auto;
  }

  .exhibit-detail .exhibit-frame {
    aspect-ratio: 1;
  }

  .exhibit-detail {
    width: 72%;
    margin-left: 0;
  }

  .gallery-closing {
    min-height: auto;
    padding: 90px 7vw;
  }

  .gallery-closing h2 {
    margin: 50px 0 70px;
    font-size: 32px;
  }

  .gallery-next-rooms {
    margin-bottom: 46px;
  }

  .gallery-next-rooms > div {
    grid-template-columns: 1fr;
  }

  .gallery-next-rooms a {
    min-height: 122px;
    padding: 20px 0;
  }

  .gallery-next-rooms a + a {
    border-top: 1px solid rgba(41, 42, 37, 0.24);
    border-left: 0;
  }

  .gallery-actions {
    grid-template-columns: 1fr;
  }

  .gallery-actions a {
    padding: 20px 0;
    border-left: 0;
  }

  .gallery-actions a + a {
    border-top: 0;
    border-left: 0;
  }

  .gallery-footer {
    gap: 18px;
    flex-direction: column;
  }
}

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

  .motion-ready .reveal-media,
  .motion-ready .reveal-copy,
  .motion-ready .reveal-media img {
    opacity: 1;
    clip-path: none;
    transform: none;
    transition: none;
  }
}
