@font-face {
  font-family: "DM Sans";
  src: url("./assets/type/dm-sans.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Mono";
  src: url("./assets/type/plex-mono.woff2") format("woff2");
  font-display: swap;
}

:root {
  color-scheme: dark;
  --paper: #f0f2ee;
  --muted: #aab3b1;
  --line: #333b3a;
  --gutter: clamp(1.15rem, 4.24vw, 5.75rem);
  --mono: "IBM Plex Mono", monospace;
  font-family: "DM Sans", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--paper);
  background: #0a0c0c;
  -webkit-font-smoothing: antialiased;
}

* { box-sizing: border-box; }
body, h1, p, figure { margin: 0; }
img { display: block; }
a { color: inherit; text-decoration: none; }
::selection { color: #fff; background: #476461; }

.masthead {
  min-height: 4.25rem;
  padding: .35rem var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.author, .back {
  display: inline-flex;
  align-items: center;
  gap: .62rem;
}

.author { font-size: 1.05rem; font-weight: 600; letter-spacing: .075em; }
.author img { mix-blend-mode: lighten; }
.back { min-height: 44px; color: #dce2de; font-size: .94rem; }
.back-symbol { font-size: 1.35rem; line-height: .85; font-weight: 400; color: #a1ada9; }
.back:hover { text-decoration: underline; text-underline-offset: .34em; }
.back:focus-visible { outline: 2px solid #a8cebf; outline-offset: .24rem; }

.exhibit {
  min-height: calc(100svh - 4.25rem);
  max-width: 1900px;
  margin: 0 auto;
  padding: clamp(3.25rem, 7.5svh, 7rem) var(--gutter);
  display: grid;
  grid-template-columns: minmax(12rem, .30fr) minmax(0, 1fr);
  align-content: center;
  align-items: start;
  gap: clamp(2rem, 4.25vw, 5rem);
}

.heading { padding-top: 1.25rem; }
.english-title { color: #b9cfc8; font: .84rem/1.5 var(--mono); text-transform: uppercase; letter-spacing: .19em; }
h1 { margin: .28em 0 .46em -.055em; font-size: clamp(4.6rem, 6.2vw, 8rem); font-weight: 600; letter-spacing: -.08em; line-height: 1; }
.details { max-width: 16rem; border-top: 1px solid var(--line); padding-top: 1.15rem; line-height: 1.65; }
.details > p:first-child { max-width: 10em; text-wrap: balance; font-size: clamp(1.02rem, 1.2vw, 1.3rem); letter-spacing: .015em; }
.details > p:first-child span { display: inline-block; }
.medium { margin-top: .6rem; color: var(--muted); font-size: .88rem; }
.medium span { margin-inline: .25em; color: #74837f; }
.medium time { font: .84rem var(--mono); }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.gallery { position: relative; min-width: 0; margin: 0; border: 0; padding: 0; }
.projection { position: relative; overflow: hidden; aspect-ratio: 16 / 9; background: #152426; }
.shot { position: absolute; inset: 0; opacity: 0; visibility: hidden; pointer-events: none; }
.shot img, .shot video { width: 100%; height: 100%; object-fit: cover; display: block; }
.shot video { touch-action: pan-y; }
.shot video:focus-visible { outline: 2px solid #b5d7cb; outline-offset: -4px; }
.gallery[data-inspecting="true"] video { cursor: ew-resize; }
.shot, .shot img { transition: opacity .48s ease, visibility 0s linear .48s, transform .68s ease-out; }
.shot img { transform: scale(1.018); }
#orbit:checked ~ .projection .film-shot,
#deck:checked ~ .projection .deck-shot,
#overhead:checked ~ .projection .overhead-shot {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition-delay: 0s;
}
#overhead:checked ~ .projection .overhead-shot img,
#deck:checked ~ .projection .deck-shot img { transform: scale(1); }

.transport {
  display: grid;
  grid-template-columns: auto minmax(3rem, 1fr) auto;
  align-items: center;
  gap: clamp(.6rem, 1.45vw, 1.4rem);
  min-height: 3.25rem;
  border-bottom: 1px solid var(--line);
}
.transport[hidden] { display: none; }
#play-toggle {
  min-height: 44px;
  border: 0;
  background: none;
  color: var(--paper);
  display: inline-flex;
  align-items: center;
  gap: .65rem;
  padding: 0 .15rem;
  font: inherit;
  font-size: .9rem;
  cursor: pointer;
}
#play-toggle:focus-visible, #film-time:focus-visible { outline: 2px solid #a8cebf; outline-offset: 2px; }
#play-toggle i { width: 0; height: 0; border: solid transparent; border-width: 5px 0 5px 8px; border-left-color: currentColor; }
#play-toggle[data-playing="true"] i { width: 8px; height: 10px; border: solid currentColor; border-width: 0 2px; }
#film-time { --played: 0%; appearance: none; width: 100%; min-width: 0; min-height: 44px; margin: 0; padding: 0; background: transparent; accent-color: #c4dbd1; cursor: pointer; }
#film-time::-webkit-slider-runnable-track { height: 2px; background: linear-gradient(to right, #c4dbd1 var(--played), #4c5854 var(--played)); }
#film-time::-webkit-slider-thumb { appearance: none; width: 11px; height: 11px; margin-top: -4.5px; border-radius: 50%; background: #e7f1eb; }
#film-time::-moz-range-track { height: 2px; background: #4c5854; }
#film-time::-moz-range-progress { height: 2px; background: #c4dbd1; }
#film-time::-moz-range-thumb { width: 11px; height: 11px; border: 0; border-radius: 50%; background: #e7f1eb; }
.timecode { color: #b8c1bd; font: .75rem/1.3 var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; }

.gallery-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.4rem;
  padding: .75rem 0;
  border-bottom: 1px solid var(--line);
}

.captions { font-size: 1rem; line-height: 1.7; color: var(--muted); text-wrap: pretty; }
.captions p { display: none; }
#orbit:checked ~ .gallery-foot .caption-film,
#deck:checked ~ .gallery-foot .caption-deck,
#overhead:checked ~ .gallery-foot .caption-overhead { display: block; }

.choices { display: flex; gap: .4rem; flex: none; }
.choice {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .52rem;
  padding: .42rem .6rem;
  min-height: 44px;
  border: 1px solid transparent;
  color: #9ba7a2;
  font-size: .89rem;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: border-color .2s, color .2s, background-color .2s;
}

.choice img { width: 48px; height: 27px; object-fit: cover; opacity: .6; }
.choice:hover { color: var(--paper); background: #171c1b; }
#orbit:checked ~ .gallery-foot label[for="orbit"],
#overhead:checked ~ .gallery-foot label[for="overhead"],
#deck:checked ~ .gallery-foot label[for="deck"] { border-color: #657872; color: var(--paper); background: #171d1c; }
#orbit:checked ~ .gallery-foot label[for="orbit"] img,
#overhead:checked ~ .gallery-foot label[for="overhead"] img,
#deck:checked ~ .gallery-foot label[for="deck"] img { opacity: 1; }
#orbit:focus-visible ~ .gallery-foot label[for="orbit"],
#overhead:focus-visible ~ .gallery-foot label[for="overhead"],
#deck:focus-visible ~ .gallery-foot label[for="deck"] { outline: 2px solid #b0d4c7; outline-offset: 2px; }

@media (max-width: 74rem) {
  .gallery-foot { align-items: flex-start; flex-direction: column-reverse; gap: .65rem; }
  .choice:first-child { margin-left: -.15rem; }
}

@media (max-width: 57rem) {
  .exhibit { display: block; min-height: 0; padding-block: clamp(2rem, 5vh, 3.2rem); }
  .heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 1.2rem; padding-top: 0; margin-bottom: 1.45rem; }
  h1 { font-size: clamp(3.7rem, 9vw, 5.2rem); margin: .17em 0 0 -.05em; }
  .details { max-width: min(55%, 16rem); text-align: right; border: 0; padding: 0; }
  .details > p:first-child { max-width: none; }
  .medium { margin-top: .18rem; }
  .gallery-foot { flex-direction: row; flex-wrap: wrap-reverse; align-items: center; }
}

@media (max-width: 38rem) {
  .masthead { min-height: 3.6rem; }
  .author img { width: 27px; height: 27px; }
  .author { font-size: .96rem; gap: .4rem; }
  .back { font-size: .88rem; }
  .english-title { font-size: .75rem; }
  .details { max-width: 58%; }
  .details > p:first-child { font-size: 1rem; }
  .medium, .medium time { font-size: .8rem; }
  .projection { width: calc(100% + 2 * var(--gutter)); margin-inline: calc(-1 * var(--gutter)); aspect-ratio: 1.42; }
  .overhead-shot img { object-position: 50% 50%; }
  .deck-shot img { object-position: 46% 50%; }
  .gallery-foot { display: grid; gap: .85rem; padding: .95rem 0; }
  .choices { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); grid-row: 1; width: 100%; }
  .choice { padding-inline: .25rem; gap: .35rem; }
  .choice img { width: clamp(24px, 8vw, 42px); height: auto; }
  .captions { font-size: 1rem; }
}
@media (max-width: 22rem) {
  .choice img { display: none; }
  .timecode { font-size: .7rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::after { transition: none !important; }
}
