/* Instrument Sans is licensed under the SIL Open Font License. See fonts/OFL.txt. */

@font-face {
  font-family: "Instrument Sans";
  src: url("fonts/InstrumentSans.ttf") format("truetype");
  font-weight: 400 680;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #08090c;
  --ivory: #f2f1ed;
  --smoke: #3f464b;
  --quiet: #6a7176;
  --line: rgba(8, 9, 12, 0.18);
  --blue: #b6cfe3;
  --pad: clamp(20px, 4.2vw, 64px);
  --small: 13px;
  --tiny: 12px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--ivory);
  color: var(--ink);
  font-family: "Instrument Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-weight: 450;
  font-size: var(--small);
  line-height: 1.45;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  font-variant-numeric: tabular-nums;
}

img {
  max-width: 100%;
  height: auto;
}

p {
  margin: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  text-align: left;
}

::selection {
  background: var(--blue);
  color: var(--ink);
}

:focus-visible {
  outline: 1px solid var(--ink);
  outline-offset: 4px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip {
  position: absolute;
  left: 16px;
  top: -48px;
  z-index: 20;
  background: var(--ivory);
  color: var(--ink);
  padding: 8px 12px;
}

.skip:focus {
  top: 12px;
}

/* Three screens. */

.screen {
  position: relative;
  min-height: 100svh;
}

/* Document strip. */

.strip {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: baseline;
  padding: 18px var(--pad);
  font-size: var(--tiny);
  color: var(--quiet);
}

.strip > span:first-child {
  color: var(--ink);
}

.strip > span:last-child {
  display: flex;
  justify-content: flex-end;
  gap: 28px;
}

.strip a:hover,
.strip a:focus-visible {
  color: var(--ink);
}

.ast {
  display: inline-block;
  margin-left: 0.12em;
  color: var(--ink);
  font-weight: 520;
}

.strip .ast {
  margin-left: 0.1em;
}

/* Labels: museum wall text. */

.label {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-width: 38ch;
}

.label .head {
  color: var(--ink);
  font-weight: 520;
}

.no {
  display: inline-block;
  min-width: 3.2em;
  color: var(--quiet);
  font-weight: 450;
}

.label .material {
  color: var(--quiet);
}

.label .note {
  margin-top: 8px;
  color: var(--smoke);
}

/* 1. Opening. */

.opening {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
}

.opening .strip {
  position: relative;
  z-index: 2;
}

.film {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.opening-foot {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34ch;
  gap: clamp(28px, 6vw, 120px);
  align-items: end;
  padding: 0 var(--pad) 36px;
}

.opening-foot .deck {
  color: var(--smoke);
}

/* 2. Plates. */

.plates {
  display: grid;
  grid-template-columns: minmax(220px, 0.3fr) minmax(0, 1fr);
  gap: clamp(28px, 5vw, 96px);
  padding: 56px var(--pad) 36px;
  border-top: 1px solid var(--line);
}

.index ol {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
}

.index li {
  border-bottom: 1px solid var(--line);
}

.index button {
  display: grid;
  grid-template-columns: 3.2em minmax(0, 1fr);
  width: 100%;
  padding: 8px 0;
  color: var(--quiet);
  transition: color 400ms ease;
}

.index button .no {
  color: inherit;
}

.index button:hover,
.index button:focus-visible,
.index button[aria-current="true"] {
  color: var(--ink);
}

.viewer {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 18px;
  min-height: calc(100svh - 92px);
  position: relative;
}

.frame {
  position: relative;
  min-height: 0;
  overflow: hidden;
}

.frame img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: left center;
  opacity: 0;
  transition: opacity 1400ms ease;
}

.frame img.current {
  opacity: 1;
}

.plate-label {
  min-height: 4.6em;
}

.folio {
  position: absolute;
  right: 0;
  bottom: 0;
  font-size: var(--tiny);
  color: var(--quiet);
}

/* 3. Surface. */

.surface {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  border-top: 1px solid var(--line);
  touch-action: none;
}

.residue {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.surface .statement {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: clamp(28px, 6vw, 120px);
  align-items: end;
  padding: 16vh var(--pad) 0;
  pointer-events: none;
}

.statement-left {
  display: flex;
  flex-direction: column;
  gap: 40px;
}

/* The care label. Set like a woven garment label: codes in one column, words in the next. */

.care {
  min-width: 26ch;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: var(--small);
}

.care-name {
  color: var(--ink);
  font-weight: 520;
  margin-bottom: 14px;
}

.care-list {
  margin: 0;
  display: grid;
  grid-template-columns: 3.2em auto;
  row-gap: 1px;
}

.care-list > div {
  display: contents;
}

.care-list dt {
  color: var(--quiet);
}

.care-list dd {
  margin: 0;
  color: var(--ink);
}

.care-note {
  margin-top: 14px;
  max-width: 30ch;
  color: var(--quiet);
}

.care-note + .care-note {
  margin-top: 2px;
}

.care-note .ast {
  margin: 0 0.4em 0 0;
  color: var(--quiet);
}

.statement .line {
  max-width: 11ch;
  font-size: clamp(40px, 6.4vw, 96px);
  font-weight: 520;
  letter-spacing: -0.04em;
  line-height: 0.92;
}

.surface .strip {
  position: relative;
  z-index: 2;
  pointer-events: none;
}

.surface .strip a {
  pointer-events: auto;
}

/* Mobile. */

@media (max-width: 760px) {
  .opening-foot {
    grid-template-columns: 1fr;
    gap: 20px;
    padding-bottom: 24px;
  }

  .opening-foot .deck {
    max-width: 34ch;
  }

  .plates {
    grid-template-columns: 1fr;
    gap: 20px;
    padding-top: 24px;
    min-height: 0;
    align-content: start;
  }

  .viewer {
    grid-template-rows: auto auto;
  }

  .index ol {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    border-top: 0;
  }

  .index li {
    border-bottom: 0;
  }

  .index button {
    display: block;
    width: auto;
    padding: 2px 0;
  }

  .index button > span:last-child {
    display: none;
  }

  .index button .no {
    min-width: 0;
  }

  .viewer {
    min-height: 0;
    order: -1;
  }

  .frame {
    height: auto;
    aspect-ratio: 4 / 3;
  }

  .frame img {
    object-position: left top;
  }

  .surface .statement {
    grid-template-columns: 1fr;
    gap: 36px;
    padding-top: 12vh;
  }

  .statement-left {
    gap: 24px;
  }

  .care {
    min-width: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .frame img,
  .index button {
    transition: none;
  }
}
