/* The site as one long sheet (static/js/sheets.js). Every page lies somewhere along the same length of paper, its bar
   included, and a tap winds the paper along: going on brings the new page up from below, going back brings it down
   from above, with blank paper between the two. Nothing is laid on
   anything and the paper never shows a cut, so the only thing that ever changes the paper itself is the theme's roll
   (whimsy.js), which lays the other paper over this one surface wherever it is, the foot of a page included.
   The browser carries the two pages as pictures between documents (cross-document view transitions); where it cannot,
   or the reader asks for less motion, a tap is the plain cut it always was. */
@media (prefers-reduced-motion: no-preference) { @view-transition { navigation: auto; } }
/* a page come back to (back, forward, reload: sheets.js marks it) does not rise into place: the browser puts it back
   where it was left by an element near the top, and the rise moved that element 6px */
html.returned main { animation: none; }

/* the kinds are set by sheets.js when the new page is revealed; the theme switch's roll (whimsy.js) has none, so
   nothing here touches it, and its own rules (whimsy.css) are put aside for these */
:root:active-view-transition-type(wind, unwind)::view-transition-old(root),
:root:active-view-transition-type(wind, unwind)::view-transition-new(root) { animation: none; mix-blend-mode: normal; clip-path: none; opacity: 1; }
/* between the two pages: more of the same paper (each page's picture ends where the window did, so the one above has
   its last 72px rubbed out into it; the one below starts with its own bar, already blank paper). It is wound with
   them, at their pace, its grain lined up with the page above (--wind-py, from sheets.js): paper that stood still
   while the pages moved would make them two pictures sliding over a desk */
:root:active-view-transition-type(wind, unwind)::view-transition { background: var(--ground) var(--paper-img) 0 var(--wind-py, 0px) / 768px 768px; background-blend-mode: var(--patch-blend); }
:root { --wind-ms: 420ms; --wind-gap: 28px; --wind-ease: cubic-bezier(0.45, 0.05, 0.15, 1); }
:root:active-view-transition-type(wind)::view-transition { animation: wind-paper calc(var(--wind-ms) * var(--sheet-slow, 1)) var(--wind-ease) both; }
:root:active-view-transition-type(unwind)::view-transition { animation: unwind-paper calc(var(--wind-ms) * var(--sheet-slow, 1)) var(--wind-ease) both; }
@keyframes wind-paper { to { background-position: 0 calc(var(--wind-py, 0px) - 100lvh - var(--wind-gap)); } }
@keyframes unwind-paper { from { background-position: 0 calc(var(--wind-py, 0px) - 100lvh - var(--wind-gap)); } }
:root:active-view-transition-type(wind)::view-transition-old(root),
:root:active-view-transition-type(unwind)::view-transition-new(root) { -webkit-mask: linear-gradient(#000 calc(100% - 72px), transparent); mask: linear-gradient(#000 calc(100% - 72px), transparent); }

/* on: this page goes up and away, the next comes up after it */
:root:active-view-transition-type(wind)::view-transition-old(root) { animation: wind-away calc(var(--wind-ms) * var(--sheet-slow, 1)) var(--wind-ease) both; }
:root:active-view-transition-type(wind)::view-transition-new(root) { animation: wind-in calc(var(--wind-ms) * var(--sheet-slow, 1)) var(--wind-ease) both; }
@keyframes wind-away { to { transform: translateY(calc(-100% - var(--wind-gap))); } }
@keyframes wind-in { from { transform: translateY(calc(100% + var(--wind-gap))); } }
/* back: this page goes down and away, the one before comes down after it */
:root:active-view-transition-type(unwind)::view-transition-old(root) { animation: unwind-away calc(var(--wind-ms) * var(--sheet-slow, 1)) var(--wind-ease) both; }
:root:active-view-transition-type(unwind)::view-transition-new(root) { animation: unwind-in calc(var(--wind-ms) * var(--sheet-slow, 1)) var(--wind-ease) both; }
@keyframes unwind-away { to { transform: translateY(calc(100% + var(--wind-gap))); } }
@keyframes unwind-in { from { transform: translateY(calc(-100% - var(--wind-gap))); } }

/* ---------------------------------------------------------------- the foot of the page
   The page ends under its copyright line, on the same paper: no edge, nothing under it. On a phone the line does not
   fit in one row and broke after its third item, leaving the last alone; there it is two rows on purpose: whose, then
   the three links. */
@media (max-width: 440px) { footer.site-foot > span:first-child { flex-basis: 100%; } }
/* a finger's worth to tap (about 44px tall): each link's reach runs past its words, invisibly, halfway into the gaps */
footer.site-foot a { position: relative; }
footer.site-foot a::after { content: ""; position: absolute; left: -9px; right: -9px; top: -12px; bottom: -12px; }

/* ---------------------------------------------------------------- the bar: where you are, and the phone's menu
   The section the reader is in has a pencil line under its name (--field-line, the site's written line). */
header.blur-header .primary-link[aria-current] { position: relative; }
header.blur-header .primary-link[aria-current]::after { content: ""; position: absolute; left: 0.7rem; right: 0.7rem; bottom: -5px; height: 5px;
  pointer-events: none; background: var(--field-line) center / 100% 100% no-repeat; }
/* the menu button's two bars, and the cross they turn into, as two strokes of the pencil */
/* both buttons answer a finger's tap over about 44px, more than they show: the menu's box grows by padding it gives
   back in margin, the theme button's reach is an empty layer over it */
.btn-menu { gap: 7px; box-sizing: content-box; padding: 6px; margin: -6px; }
.btn-dark::before { content: ""; position: absolute; inset: -10px; }
.btn-menu::before, .btn-menu::after { height: 5px; width: 22px; background-color: currentColor; filter: none !important; opacity: 0.92;
  -webkit-mask: url(../images/marks/underline.svg) center / 100% 100% no-repeat; mask: url(../images/marks/underline.svg) center / 100% 100% no-repeat; }
.btn-menu::after { scale: -1 -1; }
.open .btn-menu::before { width: 24px; --tw-translate-y: 6px; }
.open .btn-menu::after { width: 24px; --tw-translate-y: -6px; }
/* on a phone the menu is a slip of the same paper, pulled down from under the bar below the button: its own piece,
   so it has an edge (drawn by sheets.js) and lies a little above the page. The page stays where it is. */
.slip-edge { display: none; }
@media (max-width: 1023.98px) {
  /* (11-12) its right edge is drawn too, 12px inside the screen (under the button's right side): a slip that ran off the
     screen's side read as a cut through the page more than a piece over it */
  header.blur-header nav { position: absolute; right: 0; top: 100%; width: auto; z-index: 1; padding: 0 12px 40px 40px; overflow: hidden;
    visibility: hidden; pointer-events: none; transition: visibility 0s linear 0.26s; }
  .open header.blur-header nav { visibility: visible; transition-delay: 0s; }
  header.blur-header .nav-wrapper { display: flex; position: relative; width: auto; padding: 4px 20px 16px 30px; align-items: flex-end;
    color: rgba(64, 57, 48, 1); transform: translateY(-105%); transition: transform 0.26s cubic-bezier(0.3, 0.75, 0.3, 1); }
  /* (Sam 11-10) its paper ends along its pencil lines (--slip-clip, from sheets.js), with no shadow ("Nothing else has a
     shadow like that"); drawn 4px past the box so a line that wanders outside it still has paper up to its middle */
  header.blur-header .nav-wrapper::before { content: ""; position: absolute; inset: -4px; z-index: -1;
    background: var(--ground) var(--paper-img) 0 0 / 768px 768px; background-blend-mode: var(--patch-blend); clip-path: var(--slip-clip, inset(4px)); }
  .dark header.blur-header .nav-wrapper { color: rgba(214, 210, 200, 1); }
  .open header.blur-header .nav-wrapper { transform: none; pointer-events: auto; }
  header.blur-header .nav-wrapper .primary-link { display: inline-block; padding: 0.62rem 0; text-align: right; font-size: 1.08rem; color: #17171b; }
  .dark header.blur-header .nav-wrapper .primary-link { color: #edeef1; }
  header.blur-header .primary-link[aria-current]::after { left: 0; right: 0; bottom: 0.42rem; }
  .slip-edge { display: block; position: absolute; left: 0; top: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
  .slip-edge .pl { fill: none; stroke-linecap: round; }
  .slip-edge stop { stop-color: currentColor; }
}
@media (prefers-reduced-motion: reduce) { header.blur-header nav, header.blur-header .nav-wrapper { transition: none !important; } }
