/* The album shares the document's coordinates and ends with the main content. */
#main { position: relative; isolation: isolate; }
body[data-page="project"] #main {
  --album-paper: var(--paper) url("../assets/paper-grain.svg") repeat;
  overflow: clip;
  background: var(--album-paper);
}
/* Opaque reading surfaces retain the original text rasterization on Windows.
   Keep the spaces around the intro typography open for the nearer prints. */
main.wrap :where(.page-title, .page-deck, .intro-line .text-link),
main.wrap > :is(.page-controls, #scores-panel, .browser-controls, .task-panel, .metric-notes) {
  position: relative;
  z-index: 0;
  background-color: var(--paper);
}
main.wrap > .efficiency { position: relative; z-index: 0; }
@media (min-width: 741px) {
  .project-sections {
    position: relative;
    z-index: 0;
    overflow: clip;
    background: var(--album-paper);
    background-position: var(--grain-x, 0px) var(--grain-y, 0px);
  }
  .project-sections:focus-within { overflow: visible; }
}
#main[data-narrow-album] > :is(.project-sections, .metric-notes, .task-panel) { background: transparent; }
.site-footer {
  position: relative;
  z-index: 1;
  background: var(--paper);
}
.album-scene {
  position: absolute;
  inset: 0 var(--album-bleed, 0px);
  z-index: -1;
  overflow: clip;
  pointer-events: none;
  user-select: none;
}
.album-margin {
  position: absolute;
  inset-block: 0;
  width: var(--album-margin);
  overflow: clip;
}
.album-left { left: 0; }
.album-right { right: 0; }
.album-opening {
  position: absolute;
  inset: 0 0 auto;
  height: var(--opening-height);
  overflow: clip;
}
.album-margin, .album-opening { contain: paint; }
.album-unit {
  position: absolute;
  width: var(--size);
  left: var(--x);
  top: var(--y);
  translate: -50% -50%;
  transform: rotate(var(--tilt));
}
.album-float { position: relative; }
.album-paper {
  margin: 0;
  padding: var(--border);
  background: #fffef9;
  border-radius: 1px;
  box-shadow: 0 0 0 .65px rgb(74 62 42 / .15), 0 1px 2px rgb(54 44 26 / .17),
              1px 5px 10px -5px rgb(59 44 27 / .29);
}
.album-paper img { display: block; width: 100%; object-fit: cover; }
.album-front { position: relative; }
.album-front img { height: auto; aspect-ratio: var(--aspect); }
.album-note {
  display: block;
  padding: .24em .2em .04em;
  color: #484b3d;
  white-space: nowrap;
  font: italic var(--letter)/1.06 var(--display);
}
.album-note[data-field="datetaken"] {
  padding: .52em .18em .19em;
  color: #59564c;
  text-align: right;
  font: 500 var(--date-size)/1.1 var(--sans);
  letter-spacing: .035em;
  font-variant-numeric: tabular-nums;
}
.album-unit[data-small] .album-note {
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: center;
}
.album-back {
  position: absolute;
  width: 87%;
  height: 94%;
  left: calc(7% + 24% * var(--fan));
  top: var(--rise);
  transform: rotate(calc(11deg * var(--fan)));
}
.album-back img { height: 100%; }
.album-back:nth-last-child(3) {
  width: 82%;
  height: 87%;
  left: calc(8% - 20% * var(--fan));
  top: 8%;
  transform: rotate(calc(-10deg * var(--fan)));
}
@keyframes album-drift {
  0%, 100% { transform: translate(calc(-1 * var(--dx)), var(--dy)) rotate(calc(-1 * var(--turn))); }
  38% { transform: translate(var(--dx), calc(.15 * var(--dy))) rotate(var(--turn)); }
  68% { transform: translate(calc(.3 * var(--dx)), calc(-1 * var(--dy))) rotate(calc(.45 * var(--turn))); }
}
@media (min-width: 741px) and (prefers-reduced-motion: no-preference) {
  .album-float { animation: album-drift var(--period) ease-in-out var(--phase) infinite; }
  .album-scene[data-asleep] .album-float { animation-play-state: paused; }
}
@media (max-width: 740px) {
  .album-margin { display: none; }
  main.wrap .page-title { background-color: transparent; }
}
@media print { .album-scene { display: none; } }
