/* Shared reset + paper texture. */
*,
*::before,
*::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased; }
img, canvas, svg { display: block; max-width: 100%; }
a { color: inherit; }
canvas[aria-hidden] { pointer-events: auto; }

/* fibrous paper grain, generated in an SVG filter so nothing is downloaded */
.paper::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
  opacity: var(--grain, 0.35);
  /* its own compositor layer and no blend mode, so scrolling never re-blends the page under it */
  transform: translateZ(0);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='320' height='320'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .45  0 0 0 0 .38  0 0 0 0 .3  0 0 0 .55 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

/* scrollbars: a pencil line for the track, and a dab of brown wash with a pooled
   rim that slides along it */
::-webkit-scrollbar { width: 13px; height: 13px; background: transparent; }
::-webkit-scrollbar-track:vertical { background: linear-gradient(to right, transparent 6px, rgba(43, 35, 28, 0.16) 6px 7px, transparent 7px); }
::-webkit-scrollbar-track:horizontal { background: linear-gradient(to bottom, transparent 6px, rgba(43, 35, 28, 0.16) 6px 7px, transparent 7px); }
::-webkit-scrollbar-thumb {
  border: 3px solid transparent; background-clip: padding-box;
  background-color: rgba(138, 106, 60, 0.42);
  box-shadow: inset 0 0 0 1px rgba(110, 78, 40, 0.38), inset 0 0 6px rgba(110, 78, 40, 0.18);
  border-radius: 7px 9px 6px 10px / 10px 7px 9px 6px;
}
::-webkit-scrollbar-thumb:hover { background-color: rgba(138, 106, 60, 0.6); }
::-webkit-scrollbar-thumb:active { background-color: rgba(110, 78, 40, 0.7); }
::-webkit-scrollbar-corner { background: transparent; }
/* browsers without those (Firefox) get the nearest they offer */
@supports not selector(::-webkit-scrollbar) {
  * { scrollbar-width: thin; scrollbar-color: rgba(138, 106, 60, 0.55) transparent; }
}

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
