/* Layout */

.workbench, .orders, .counter.ticket {
  inline-size: min(100%, 72rem);
  margin-inline: auto;
}

.workbench, .orders {
  display: grid;
  gap: var(--worktop);
  align-items: center;
}

.workbench > .ticket { inline-size: 100%; }
.workbench > .mount, .orders > .mount {
  inline-size: min(100%, 35rem);
  margin-inline: auto;
  padding: clamp(1.125rem, 0.8rem + 1vw, 1.5rem);
}
.workbench > .mount > img { aspect-ratio: 4 / 3; }
.orders > .mount > img { aspect-ratio: 4 / 3; }

.orders > ol {
  inline-size: min(100%, 32rem);
  margin: 0 auto;
  padding: 0;
  list-style: none;
}
.orders > ol > li { padding-inline-end: clamp(0.5rem, 1.8vw, 1.5rem); }
.orders > ol > li + li {
  margin-block-start: clamp(0.75rem, 1.6vw, 1.375rem);
  padding-inline: clamp(0.5rem, 1.8vw, 1.5rem) 0;
}
.orders .ticket {
  position: relative;
  inline-size: 100%;
  gap: 0.65rem;
  padding: clamp(1.375rem, 1rem + 1vw, 2rem);
}
.orders .ticket::before {
  position: absolute;
  inset-block: var(--seam);
  inset-inline: var(--seam);
  pointer-events: none;
  content: "";
}
.orders .ticket > div {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.35rem 0.7rem;
}
.orders .ticket h2 { margin: 0; }

.counter.ticket {
  display: grid;
  align-items: center;
  gap: var(--worktop);
}
.counter > div:first-child > p { margin-block: 0; }
.counter > div:first-child > p + p { margin-block-start: 0.65rem; }
.counter .action { padding-inline: clamp(0.5rem, 1.1vw, 1rem); }

@media (min-width: 48rem) {
  .workbench { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); }
  .counter.ticket { grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); }
}
@media (min-width: 64rem) {
  .orders {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr) minmax(0, 1fr);
    gap: clamp(0.9rem, 1.6vw, 1.5rem);
  }
  .orders > ol:last-child { margin-block-start: clamp(1.5rem, 4vw, 3.5rem); }
  .orders > .mount > img { aspect-ratio: 1; }
}

/* Type */

.orders .ticket h2 { font-size: clamp(1.5rem, 1.35rem + 0.6vw, 1.875rem); }
.orders .ticket > div > span {
  font-family: var(--jost);
  font-size: clamp(2.125rem, 1.8rem + 1vw, 2.75rem);
  font-weight: 500;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

/* Colour */

.orders .ticket { box-shadow: none; }
.orders .ticket::before {
  --stitch: linear-gradient(var(--magenta), var(--magenta));
  background-image: var(--stitch), var(--stitch), var(--stitch), var(--stitch);
  background-position: left top, right top, right bottom, left bottom;
  background-repeat: no-repeat;
  background-size: 100% var(--thread), var(--thread) 100%, 100% var(--thread), var(--thread) 100%;
}

/* Motion: one pass around the inset, with the paper and its words held still. */

@media (prefers-reduced-motion: no-preference) {
  .orders .ticket[data-stitched]::before { animation: stitching 400ms linear both; }
}

@keyframes stitching {
  0%   { background-size:   0% var(--thread), var(--thread)   0%,   0% var(--thread), var(--thread)   0%; }
  30%  { background-size: 100% var(--thread), var(--thread)   0%,   0% var(--thread), var(--thread)   0%; }
  50%  { background-size: 100% var(--thread), var(--thread) 100%,   0% var(--thread), var(--thread)   0%; }
  80%  { background-size: 100% var(--thread), var(--thread) 100%, 100% var(--thread), var(--thread)   0%; }
  100% { background-size: 100% var(--thread), var(--thread) 100%, 100% var(--thread), var(--thread) 100%; }
}
