.activity {
  padding-block: clamp(1.3rem, 2.8vw, 3rem);
  border-block: 1px solid var(--rule);
}
.sheet-cue, .dispatch-photo, .dispatch-board { display: none; }
.dispatch-pages { margin: 0; padding: 0; list-style: none; }
.dispatch-note + .dispatch-note { margin-top: 1.5rem; }
.dispatch-imprint { display: flex; align-items: center; justify-content: space-between; }
.dispatch-imprint :is(time, span) {
  font: 500 .69rem/1.2 var(--mono);
  letter-spacing: .08em;
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
}
.dispatch-print { width: 2.25rem; height: auto; fill: none; stroke: currentColor; stroke-width: 1.05; }
.dispatch-note h3 { margin: .25rem 0; font-size: 2.3rem; }
.dispatch-note p { max-width: 36em; line-height: 1.45; }
.dispatch-note a { color: #254b3b; text-decoration: underline; text-underline-offset: .18em; }
.dispatch-note a:hover { color: #142419; }
.activity[data-ready] {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.activity[data-ready] h2 { text-align: center; margin-bottom: 0; }
[data-ready] .dispatch-display { display: grid; justify-items: center; position: relative; width: min(100%, 74rem); isolation: isolate; }
[data-ready] .dispatch-unit { position: relative; width: min(65%, 46rem); aspect-ratio: 3 / 2; container-type: inline-size; }
[data-ready] .dispatch-photo { display: block; width: 100%; height: auto; pointer-events: none; }
[data-ready] .sheet-cue {
  display: inline-flex;
  gap: .5em;
  align-items: baseline;
  margin-top: .65em;
  color: #345341;
  font: italic clamp(.82rem, 2.2cqw, 1.08rem)/1.1 var(--serif);
}
.sheet-cue b { font: .92em/1 var(--sans); }
/* The paper meets the slot at 60% of the transparent product image's height. */
[data-ready] .dispatch-pages {
  position: absolute;
  inset: 0 0 40.03%;
  clip-path: inset(-2% 0 0);
  pointer-events: none;
}
[data-ready] .dispatch-note {
  position: absolute;
  bottom: 0;
  left: 27.15%;
  width: 45.9%;
  margin: 0;
  transform-origin: 50% 100%;
  filter: drop-shadow(3px 4px 3px rgba(44, 41, 17, .22));
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  pointer-events: auto;
  cursor: pointer;
}
[data-ready] .dispatch-note:active { cursor: grabbing; }
[data-ready] .dispatch-note.is-moving { visibility: hidden; pointer-events: none; }
[data-ready] .dispatch-note:focus-visible { outline: none; }
[data-ready] .dispatch-note:focus-visible .dispatch-stock { outline: 2px solid #45694e; outline-offset: -6px; }
[data-ready] .dispatch-stock {
  --paper-face: #f7f2df;
  position: relative;
  padding: 2.1cqw 3.3cqw 4.2cqw;
  min-height: 30cqw;
  color: #26362b;
  background-color: var(--paper-face);
  background-image:
    linear-gradient(0deg, rgba(110,96,56,.35), transparent 5%, rgba(249,246,224,.4) 9%, transparent 17%),
    linear-gradient(98deg, rgba(157,137,89,.24) 0%, rgba(255,255,251,.28) 12%, transparent 44%, rgba(181,164,125,.16) 52%, rgba(255,254,240,.4) 62%, transparent 79%, rgba(161,147,110,.17) 96%, rgba(255,255,250,.8)),
    repeating-linear-gradient(3deg, transparent 0 2px, rgba(100,85,51,.035) 2px 3px);
  clip-path: polygon(.25% 1.1%, 8% .45%, 20% .68%, 36% 1.4%, 50% 1%, 68% .3%, 84% .1%, 99.85% .65%, 99.65% 22%, 99% 54%, 98% 83%, 97% 100%, 2.7% 100%, 1.2% 81%, .55% 43%);
}
@media screen {
  [data-motion="on"] .activity[data-ready]:not(.is-turning):not(.is-pulling) .is-current .dispatch-stock {
    transform-origin: center bottom;
    animation: dispatch-paper-sway 4.8s ease-in-out infinite;
  }
}
@keyframes dispatch-paper-sway {
  0%, 100% { transform: perspective(34rem) rotateX(0deg) skewX(0deg); }
  35% { transform: perspective(34rem) rotateX(-3deg) skewX(1.15deg) scaleY(1.014); }
  72% { transform: perspective(34rem) rotateX(1.5deg) skewX(-.65deg); }
}
[data-ready] .dispatch-stock::after {
  content: "";
  pointer-events: none;
  position: absolute;
  height: .45cqw;
  bottom: 1.5cqw;
  left: 3.3cqw;
  right: 3.3cqw;
  border-block: 1px solid rgba(69, 80, 59, .32);
}
[data-ready] .dispatch-note:nth-child(2) .dispatch-stock { --paper-face: #eeeedb; }
[data-ready] .dispatch-note:nth-child(3) .dispatch-stock { --paper-face: #f4eada; }
[data-ready] .dispatch-imprint { color: #495744; border-bottom: 1px solid #8a8a74; padding-bottom: .55cqw; }
[data-ready] .dispatch-imprint :is(time, span) { font-size: clamp(.58rem, 1.28cqw, .78rem); }
[data-ready] .dispatch-print { width: 5.9cqw; max-width: 3rem; }
[data-ready] .dispatch-note h3 { margin: 1.15cqw 0 .82cqw; font: 400 clamp(1.55rem, 5.85cqw, 3.85rem)/.96 var(--serif); letter-spacing: -.03em; }
[data-ready] .dispatch-note p { font: 400 clamp(.82rem, 2.05cqw, 1.12rem)/1.35 var(--sans); letter-spacing: -.012em; }

/* Drawn slips land on the existing patterned wall, leaving the box freestanding. */
[data-ready] .dispatch-board.has-sheets {
  position: absolute;
  z-index: 2;
  inset: 8% 1.5% 4%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 20%));
  grid-template-rows: repeat(2, 1fr);
  justify-content: space-between;
  align-items: start;
  margin: 0;
  padding: 0;
  list-style: none;
  pointer-events: none;
}
.dispatch-board li { position: relative; min-width: 0; --angle: -4deg; }
.dispatch-board li:empty { visibility: hidden; }
.dispatch-board li:nth-child(2) { --angle: 3deg; }
.dispatch-board li:nth-child(3) { --angle: 1.5deg; }
.dispatch-board li:nth-child(4) { --angle: -2.5deg; }
.pinned-sheet {
  position: relative;
  padding: .76rem .85rem .83rem;
  transform: rotate(var(--angle));
  background: var(--paper-face, #f5efdb) url("assets/rack-grain.png");
  color: #24392d;
  border: 1px solid #ada98a88;
  box-shadow: 0 1px 2px #26352326, 2px 5px 7px -3px #39432b45;
}
.dispatch-board li:nth-child(even) { --paper-face: #eeefde; }
.pinned-sheet:not(:last-child) {
  position: absolute; inset: 0;
  overflow: hidden;
  transform: translate(-3px, 4px) rotate(calc(var(--angle) - 2deg));
}
.pinned-sheet::before {
  content: "";
  position: absolute;
  left: 50%; top: -.36rem;
  width: 2.65rem; height: .82rem;
  transform: translateX(-50%) rotate(-6deg);
  background: repeating-linear-gradient(92deg,#c5b78b70 0 1px,#decfa781 1px 3px);
  border-inline: 1px dashed #c6ba91a1;
  z-index: 1;
}
[data-ready] .pinned-sheet .dispatch-stock {
  padding: 0; min-height: 0; background: none; clip-path: none;
}
.pinned-sheet .dispatch-stock::after { display: none; }
[data-ready] .pinned-sheet .dispatch-imprint { padding-bottom: .25rem; gap: .25rem; }
[data-ready] .pinned-sheet .dispatch-imprint :is(span,time) { font-size: .57rem; letter-spacing: .03em; }
[data-ready] .pinned-sheet .dispatch-print { width: 1.35rem; flex: none; }
.pinned-sheet h3 { margin: .3rem 0; font: 400 clamp(1.22rem, 2vw, 1.9rem)/1 var(--serif); }
.pinned-sheet p { font: 400 clamp(.72rem, .95vw, .9rem)/1.32 var(--sans); }

@media (max-width: 800px) {
  [data-ready] .dispatch-unit { width: min(100%, 38rem); }
  [data-ready] .dispatch-board.has-sheets {
    position: relative; inset: auto; width: min(94%, 33rem);
    grid-template-columns: repeat(2, minmax(0,1fr));
    grid-template-rows: auto auto; gap: 1rem .8rem;
    padding: 0 .45rem .8rem;
  }
  .dispatch-board li:empty { display: none; }
}
@media (max-width: 590px) {
  [data-ready] .dispatch-display { width: calc(100vw - 8px); overflow: clip; }
  [data-ready] .dispatch-unit { width: 112%; }
  [data-ready] .dispatch-note { left: 25.15%; width: 49.9%; }
  [data-ready] .dispatch-stock {
    padding: 2.1cqw 3.5cqw 3.3cqw;
    clip-path: polygon(.4% 1%, 20% .6%, 38% 1.2%, 65% .3%, 99.6% .5%, 99% 41%, 97.5% 76%, 95% 100%, 5% 100%, 2% 75%, .7% 39%);
  }
}
@media print {
  .activity[data-ready] { display: block; }
  [data-ready] .dispatch-photo, [data-ready] .sheet-cue, [data-ready] .dispatch-board.has-sheets { display: none; }
  [data-ready] .dispatch-display, [data-ready] .dispatch-unit, [data-ready] .dispatch-pages { display: block; position: static; width: auto; aspect-ratio: auto; overflow: visible; clip-path: none; }
  [data-ready] .dispatch-note, [data-ready] .dispatch-note[hidden] { display: block !important; margin: 1rem 0; width: auto; position: static; filter: none; }
  [data-ready] .dispatch-stock { min-height: 0; padding: 0; background: none; clip-path: none; }
}
