/* The black suitcase also marks reading progress in the header. */
.terminal-header {
  position: sticky;
  top: 0;
  z-index: 8;
  background: var(--paper);
}
html { scroll-padding-top: 5.4rem; }
.route-rail {
  position: absolute;
  inset: auto 0 0;
  height: 2px;
  pointer-events: none;
}
.route-ink {
  display: block;
  height: 100%;
  background: var(--accent);
  transform: scaleX(var(--route-fraction, 0));
  transform-origin: left;
}
.route-case {
  position: absolute;
  top: 0;
  left: 0;
  width: 2.9rem;
  height: auto;
  transform: translate(var(--route-travel, 0px), -50%) rotate(-5deg);
  filter: drop-shadow(0 2px 2px #1a1b1738);
}
.route-ink, .route-case { opacity: 0; }
.terminal-running .reading .route-ink,
.terminal-running .reading .route-case { opacity: 1; }
@media (min-width: 761px) {
  nav .author-nav { display: inline-flex; align-items: center; gap: .35rem; }
}
.airplane {
  display: inline-block;
  width: 1.18em;
  height: 1.18em;
  flex: none;
  background: currentColor;
  clip-path: polygon(49% 0, 55% 5%, 58% 34%, 96% 59%, 96% 69%, 58% 55%, 55% 78%, 69% 91%, 69% 99%, 50% 92%, 31% 99%, 31% 91%, 45% 78%, 42% 55%, 4% 69%, 4% 59%, 42% 34%, 45% 6%);
  transform: rotate(43deg);
}
.author-nav .airplane, .byline-link .airplane { color: var(--accent); }
.byline-link { max-width: 100%; text-decoration: none; }
.byline-link .airplane { width: .49em; height: .49em; margin: 0 0 .12em .03em; }
.byline-link:hover { text-decoration: underline; text-decoration-thickness: 1px; }
.write-author {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .6rem;
  min-height: 3rem;
  padding: .65rem 1.15rem;
  border: 2px solid var(--ink);
  border-radius: 2px;
  background: var(--accent);
  color: var(--ink);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.3;
  text-align: center;
  text-decoration: none;
}
.write-author:hover { box-shadow: 2px 2px 0 var(--ink); }
.write-author:active { box-shadow: inset 0 0 0 1px var(--ink); }
.write-author:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.plane-window {
  display: grid;
  place-items: center;
  flex: none;
  width: 1.35rem;
  height: 1.35rem;
  overflow: hidden;
}
.plane-window .airplane { width: 1.05rem; height: 1.05rem; }
.terminal-running .write-author:is(:hover, :focus-visible) .airplane { animation: take-off .9s ease-in-out; }
.terminal-running :is(.byline-link,.author-nav):is(:hover,:focus-visible) .airplane { animation: plane-hop .7s ease both; }
@keyframes take-off {
  0%,100% { transform: translate(0,0) rotate(43deg); }
  46% { transform: translate(2.25rem,-2.25rem) rotate(43deg); opacity: 1; }
  47%,50% { opacity: 0; }
  51% { transform: translate(-2.25rem,2.25rem) rotate(43deg); opacity: 1; }
}
@keyframes plane-hop {
  0%,100% { transform: translate(0,0) rotate(43deg); }
  50% { transform: translate(.17em,-.22em) rotate(36deg); }
}
.tray-gallery { container-type: inline-size; }
.tray-gallery [hidden] { display: none !important; }
.baggage-stage {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 1.5;
  background: #4a4843;
}
.belt-photo { width: 100%; height: 100%; object-fit: cover; }
.belt-interior { position: absolute; inset: 13.4% 0 14.1%; overflow: hidden; }
.belt-interior span {
  display: block;
  width: 200%;
  height: 100%;
  background: url('/assets/belt-slat.webp') left top / 12.5% 100% repeat-x;
}
.belt-interior::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, #ffffff30, transparent 44%, #131a202e);
  box-shadow: inset 0 3px 7px #150f0b63, inset 0 -2px 4px #1116;
}
.belt-train {
  position: absolute;
  inset: 13.4% auto 14.1% 0;
  width: max-content;
  display: flex;
  pointer-events: none;
}
.belt-sequence {
  display: flex;
  flex: none;
  align-items: center;
  gap: 5cqw;
  padding-inline: 2.5cqw 24.5cqw;
}
.belt-bag, .belt-book {
  flex: none;
  transform: translateY(var(--offset, 0)) rotate(var(--tilt, 0deg));
  filter: drop-shadow(.45cqw .95cqw .55cqw #17120d80);
}
/* The four luggage widths total 139cqw, preserving the 225cqw loop. */
.belt-bag { height: auto; }
.case-cabin { width: 35cqw; --tilt: -6deg; --offset: -2cqw; }
.case-pilot { width: 23cqw; --tilt: 5deg; --offset: 2cqw; }
.case-checked { width: 39cqw; --tilt: -7deg; --offset: -1.5cqw; }
.case-trunk { width: 42cqw; --tilt: -3deg; --offset: 1cqw; }
/* Keep the real photographed page block and register the cover on its top plane. */
.belt-book {
  position: relative;
  isolation: isolate;
  container-type: inline-size;
  width: 17cqw;
  --offset: 1.4cqw;
  --tilt: 3deg;
  filter: drop-shadow(.07cqw .14cqw .11cqw #130e08b8) drop-shadow(.19cqw .37cqw .32cqw #100b0759);
}
.angled-copy { --offset: -1.6cqw; --tilt: 13deg; }
.paper-stock {
  display: block;
  width: 100%;
  height: auto;
  clip-path: polygon(0.61% 11.09%, 0.83% 10.17%, 1.49% 9.43%, 73.27% 0.80%, 98.96% 87.00%, 98.21% 88.90%, 19.43% 99.27%, 18.78% 99.14%, 18.34% 98.10%);
  filter: sepia(.19) brightness(.95);
}
.printed-jacket, .belt-book::after {
  position: absolute;
  top: 9.4825%;
  left: .6565%;
  width: 75.499%;
  height: auto;
  border-radius: 1.3% 0 0 .6%;
  transform-origin: top left;
  transform: perspective(336.134cqw) matrix3d(
    .974489, -.137661, -.056307, 0,
    .150936,  .878741,  .311182, 0,
    0, 0, 1, 0,
    0, 0, 0, 1
  );
}
.printed-jacket {
  filter: brightness(.94) saturate(.95);
}
.belt-book::after {
  content: "";
  aspect-ratio: 1001 / 1420;
  background:
    linear-gradient(90deg, #100d0ab0, #f5dfb448 1.5%, #f5dfb427 3%, #18110d24 4.7%, transparent 8%),
    linear-gradient(137deg, #f7d4a03b 0, transparent 44%, #15110e28 100%);
  box-shadow: inset 0 .5cqw #f1dab631, inset -.6cqw -.5cqw #100c0999;
}
.inspect-case {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: end;
  justify-content: end;
  color: white;
  background: transparent;
  border: none;
  padding: 1rem;
  cursor: pointer;
}
.inspect-case span {
  display: inline-flex;
  align-items: center;
  gap: .75rem;
  padding: .5rem .75rem;
  background: var(--ink);
  border: 1px solid var(--rule);
  font: 600 .875rem/1.4 var(--ui);
}
.inspect-case b { font: 500 1.25em/1 var(--ui); color: var(--accent); }
.inspect-case:is(:hover, :focus-visible) span { border-color: var(--accent); }
.inspect-case:focus-visible { outline-offset: -4px; }
.tray-caption {
  flex-wrap: wrap;
  gap: .25rem .75rem;
  min-height: 2.75rem;
  font: 500 .875rem/1.4 var(--ui);
}
.tray-caption button {
  min-height: 2.75rem;
  padding: .5rem 0;
  font: 600 .875rem/1.4 var(--ui);
}
.tray-caption .back-to-case { padding-left: 0; margin-right: auto; color: var(--muted); font-weight: 500; }
.baggage-label { margin-right: auto; }
.tray-caption .motion-toggle > span { font: inherit; }
.tray-caption #flip-cover > span { font: 500 1.25em/1 var(--ui); }
@container (max-width: 32rem) {
  .tray-caption:has(.back-to-case:not([hidden])) {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    row-gap: 0;
  }
  #cover-status { grid-column: 1 / -1; grid-row: 1; padding-top: .5rem; }
  #flip-cover { justify-self: end; text-align: end; }
  .back-to-case { text-align: start; }
}
.play-symbol {
  flex: none;
  width: .65rem;
  height: .74rem;
  border-left: .61rem solid currentColor;
  border-top: .37rem solid transparent;
  border-bottom: .37rem solid transparent;
}
.terminal-running .play-symbol {
  border: 0;
  border-left: .17rem solid;
  border-right: .17rem solid;
  width: .47rem;
  height: .65rem;
}
/* One 225cqw sequence travels exactly nine 25cqw slat tiles. */
.baggage-stage { --slat-time: 4s; }
.belt-interior span { animation: run-belt var(--slat-time) linear infinite paused; }
.belt-train { animation: carry-baggage calc(9 * var(--slat-time)) linear infinite paused; }
.terminal-running .baggage-stage:not(.offscreen) :is(.belt-train, .belt-interior span) {
  animation-play-state: running;
}
@keyframes run-belt {
  from { transform: translateX(-12.5%); }
  to { transform: translateX(0); }
}
@keyframes carry-baggage {
  from { transform: translateX(-50%); }
  to { transform: translateX(0); }
}
@media (max-width: 760px) {
  html { scroll-padding-top: 4.75rem; }
  .hero-text { display: contents; }
  .hero-heading { grid-row: 1; }
  .tray-gallery { grid-row: 2; }
  .hero-bottom { grid-row: 3; }
  .hero-bottom .hero-blurb { margin-top: 0; }
  .route-case { width: 2.4rem; }
  .inspect-case { padding: .75rem; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .route-case { display: none; }
}
