:root {
  --sans: "Helvetica Neue", Helvetica, Arial, "Hiragino Sans", "Hiragino Kaku Gothic ProN", sans-serif;
  --serif: "Libre Caslon Text", "Shippori Mincho", "Hiragino Mincho ProN", serif;
  --thin: "Cormorant Garamond", Georgia, serif;
  --quirk: "Fraunces", "Zen Antique", Georgia, serif;
  --cw: calc(((100vh - 190px) / 4.5 - 22px) * 1.497);
  --col: min(var(--cw), calc(50vw - 36px));
  --hh: 100px;
  --ih: 80px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #fff;
  color: #000;
  font: 14px/1.9 var(--sans);
  letter-spacing: .02em;
}

/* header */

header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 5;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  padding: 18px 24px 10px;
}

header .logo {
  height: 26px;
  width: auto;
  display: block;
}

nav {
  display: flex;
  gap: 10px;
  align-items: center;
}

nav button {
  pointer-events: auto;
  width: 34px;
  height: 34px;
  border: 0;
  background: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 0;
}

nav button:hover {
  opacity: .55;
}

nav button.current {
  display: none;
}

nav i {
  display: block;
}

nav i.play {
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 7px 0 7px 12px;
  border-color: transparent transparent transparent #000;
  margin-left: 1px;
}

nav i.pause {
  width: 11px;
  height: 13px;
  border-left: 4px solid #000;
  border-right: 4px solid #000;
}

nav i.stop {
  width: 11px;
  height: 11px;
  background: #000;
}

#info {
  position: fixed;
  left: 0;
  right: 0;
  top: var(--hh);
  z-index: 5;
  pointer-events: none;
  text-align: center;
  padding: 26px 24px 34px;
  font-size: clamp(12px, 1.25vw, 16px);
}

.num {
  font-family: var(--thin);
  font-weight: 600;
  font-size: 1.2em;
  font-variant-numeric: lining-nums;
  letter-spacing: .01em;
}

.quirk {
  font-family: var(--quirk);
  font-weight: 500;
  font-variation-settings: "SOFT" 100, "WONK" 1;
}

.sep {
  display: inline-block;
  width: 1px;
  height: 1em;
  background: #000;
  margin: 0 1em;
  vertical-align: -.12em;
}

.word {
  white-space: nowrap;
}

.glyph {
  display: inline-block;
  transform-origin: 50% 55%;
}

#intro {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* pages */

.page {
  display: none;
  padding-top: calc(var(--hh) + var(--ih));
}

.page.on {
  display: block;
}

/* play */

#movie {
  position: relative;
  width: calc(2 * var(--col) + 24px);
  margin: 0 auto 22px;
  padding: 0 24px;
  box-sizing: content-box;
}

#movie video {
  display: block;
  width: 100%;
  aspect-ratio: 16/9;
  background: #fff;
  border: 1px solid #000;
  cursor: pointer;
}

#bar {
  display: flex;
  align-items: center;
  gap: 14px;
  height: 34px;
  padding: 0 12px;
  border: 1px solid #000;
  border-top: 0;
  background: #fff;
}

#bar button {
  width: 22px;
  height: 22px;
  border: 0;
  background: none;
  padding: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

#bar button:hover {
  opacity: .55;
}

#bar i {
  display: block;
}

#bar i.play {
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 6px 0 6px 10px;
  border-color: transparent transparent transparent #000;
  margin-left: 2px;
}

#bar i.pause {
  width: 10px;
  height: 12px;
  border-left: 3px solid #000;
  border-right: 3px solid #000;
}

#bar i.sound {
  width: 10px;
  height: 10px;
  border: 1px solid #000;
  border-radius: 50%;
}

#bar i.sound.off {
  background: #000;
}

#bar i.full {
  width: 11px;
  height: 11px;
  border: 1px solid #000;
}

#time {
  font-size: 12px;
  min-width: 5.5em;
  white-space: nowrap;
}

#seek {
  position: relative;
  flex: 1;
  height: 14px;
  display: flex;
  align-items: center;
  cursor: pointer;
}

#seek::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 1px;
  background: #000;
  pointer-events: none;
}

#played {
  position: absolute;
  left: 0;
  top: 50%;
  height: 3px;
  margin-top: -1.5px;
  width: 0;
  background: #000;
}

#movie.fs {
  width: 100vw;
  padding: 0;
  margin: 0;
  background: #fff;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

#movie.fs video {
  border: 0;
  aspect-ratio: auto;
  height: calc(100vh - 34px);
  object-fit: contain;
}

#movie.fs #bar {
  border: 0;
  border-top: 1px solid #000;
}

#items {
  display: grid;
  grid-template-columns: repeat(2, var(--col));
  gap: 22px 24px;
  padding: 0 24px 80px;
  justify-content: center;
}

.item {
  cursor: pointer;
  position: relative;
}

.item img {
  width: 100%;
  display: block;
  transition: opacity .25s;
}

#items.dim .item:not(.hold) img {
  opacity: .5;
}

/* pause */

#photos {
  display: grid;
  --g: 24px;
  grid-template-columns: repeat(4, calc(var(--col) / 2 - var(--g) / 2));
  gap: 22px var(--g);
  padding: 0 24px 80px;
  justify-content: center;
}

.photo {
  position: relative;
  aspect-ratio: 1271/849;
  grid-column: span 2;
  cursor: pointer;
  transition: opacity .25s;
  perspective: calc(var(--col) * 2.6);
}

.photo .slab {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  will-change: transform;
}

.photo.tall .slab {
  inset: 0 27.69%;
}

.photo .face {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: #fff;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.photo .front {
  transform: rotateY(0deg);
}

.photo .back {
  transform: rotateY(180deg);
}

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

#photos.dim .photo:not(.hold) {
  opacity: .5;
}

/* overlay */

#overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: rgba(255, 255, 255, .92);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

#overlay.on {
  display: flex;
}

#dialog {
  position: relative;
  background: #fff;
  border: 1px solid #000;
  padding: 44px 40px 32px;
  width: min(980px, 100%);
  max-height: 100%;
  overflow: auto;
  scrollbar-width: none;
}

#dialog::-webkit-scrollbar {
  display: none;
}

#close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 30px;
  height: 30px;
  border: 0;
  background: none;
  cursor: pointer;
  font: 300 26px/1 var(--sans);
  color: #000;
  -webkit-appearance: none;
  appearance: none;
  padding: 0;
}

#caption {
  text-align: center;
  margin-bottom: 18px;
}

#dialog .label {
  font: 400 13px var(--serif);
  text-align: center;
  letter-spacing: .04em;
}

#picture {
  width: 100%;
  display: block;
}

#overlay.view .label {
  display: none;
}

#overlay.view #picture {
  aspect-ratio: auto;
  height: auto;
  max-height: min(calc(100dvh - 250px), 1000px);
  object-fit: contain;
  border: 1px solid #000;
}

#overlay.view.tall #picture {
  width: auto;
  max-width: 100%;
  margin: 0 auto;
}

/* stop */

#text {
  width: calc(2 * var(--col) + 24px);
  margin: 0 auto;
  padding: 6px 24px 120px;
  box-sizing: content-box;
}

#text section {
  margin: 0 0 80px;
}

#text h2,
#text p {
  margin: 0;
  font: 400 30px/1.9 var(--serif);
  letter-spacing: .03em;
}

#text h2 {
  margin-bottom: .4em;
}

#text p {
  font-feature-settings: "palt";
  text-align: left;
}

#text .figure {
  display: block;
  width: min(100%, 560px);
  height: auto;
  margin: 1.2em 0 .4em;
  mix-blend-mode: multiply;
}

#text .link {
  display: inline-block;
  margin: 0 0 1.4em;
  color: #000;
  text-decoration: none;
  border-bottom: 1px solid #000;
  line-height: 1.6;
}

#text .link:hover {
  opacity: .55;
}

@media (max-width: 700px) {
  #movie {
    width: calc(2 * var(--col) + 12px);
    padding: 0 12px;
    margin-bottom: 18px;
  }

  #items,
  #photos {
    gap: 18px 12px;
    padding: 0 12px 60px;
  }

  #photos {
    --g: 12px;
  }

  #dialog {
    padding: 40px 16px 24px;
  }

  #text {
    width: auto;
    padding: 0 20px 80px;
  }

  #text section {
    margin-bottom: 56px;
  }

  #text h2,
  #text p {
    font-size: 22px;
    line-height: 1.8;
  }
}
