/* A hand-drawn scroll companion, layered below the navigation and dialogs. */
.paper-flight {
  position: fixed;
  inset: 0;
  z-index: 8;
  color: #685477;
  opacity: 0;
  pointer-events: none;
  user-select: none;
  overflow: hidden;
  transition: opacity 250ms ease, color 220ms ease;
}
.paper-flight.in-flight { opacity: .95; }
.paper-flight[data-ink="light"] { color: #e3d3f5; }
.paper-flight.over-copy { opacity: .38; }
.paper-flight-plane {
  position: absolute;
  top: 0;
  left: 0;
  width: 140px;
  height: 110px;
  pointer-events: none;
  transform-origin: 50% 50%;
}
.paper-flight-art {
  display: block;
  width: 100%;
  height: 100%;
  background: currentColor;
  -webkit-mask: none center / contain no-repeat;
  mask: none center / contain no-repeat;
  transform-origin: 50% 50%;
}
.paper-flight.in-flight .paper-flight-art {
  /* Two impressions retain the pencil grain while strengthening fine strokes. */
  -webkit-mask-image: url('assets/paper-plane-sketch.webp'), url('assets/paper-plane-sketch.webp');
  mask-image: url('assets/paper-plane-sketch.webp'), url('assets/paper-plane-sketch.webp');
  mask-composite: add;
}
.paper-flight-trail {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-dasharray: 6 12;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: .48;
  pointer-events: none;
}
body:has(.menu-toggle[aria-expanded="true"]) .paper-flight,
body:has(dialog[open]) .paper-flight { opacity: 0; }
@media (max-width: 700px) {
  .paper-flight.in-flight { opacity: .85; }
  .paper-flight.over-copy { opacity: .3; }
  .paper-flight-trail { stroke-width: 1.25; stroke-dasharray: 4 9; opacity: .4; }
}
@media (prefers-reduced-motion: reduce), (forced-colors: active), print {
  .paper-flight { display: none; }
}

/* A restrained brand watermark keeps the headline as the focal point. */

body:has(form:focus-within) .paper-flight, body:has([role="dialog"]) .paper-flight { opacity: 0; }
