/* ********************** sticky *********************************
   * Copyright © Caerus Digital, LLC - All Rights Reserved
   * Created on 10/25/26, for matthew-elmore.com (copy of the caerus.digital sticky mockup)
   * Matthew Elmore <matt@caerus.digital>
   * Unauthorized copying of this file is strictly prohibited
   ********************** sticky *********************************

   One whole section per screen (sticky.js has the full rules). Every band is one screen tall under the frozen
   bars, content centered; a too-tall band is split into several; scrolling snaps to the start of a band; the
   Lunara stacked-panel cover (website/src/styles/global.css:171-188, 217-234) is the move between snap points.
   On in any window at least 600px tall (and portrait phones from 30rem). Nothing about a band's content or look
   changes: a section with no ground of its own gets the page ground. */
@media (min-height: 600px), (orientation: portrait) and (min-height: 30rem) {
  main > * { position: relative; background: var(--bg); }
  .stick-ready main > * { position: sticky; top: var(--stick-top, 48px); }
  .stick-ready main > :focus-within { position: relative; top: 0; }
}
.stick-ready main > .stick-off { position: relative; top: 0; }
.gfooter, .pfooter { position: relative; }

/* Snap: the markers sit where each band sits in the page; the footer is the last stop. */
html.snap-ready { scroll-snap-type: y mandatory; }
.snap-marks { position: absolute; left: 0; top: 0; width: 1px; height: 0; pointer-events: none; opacity: 0; }
.snap-marks > div { position: absolute; left: 0; width: 1px; scroll-snap-align: start; }
.snap-ready .gfooter, .snap-ready .pfooter { scroll-snap-align: end; }

/* Cover veil while the next band slides over a held one. */
:root { --cover-blur: 6px; --cover-dim: 0.3; }
.stack-covered::after { content: ''; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  backdrop-filter: blur(calc(var(--cover, 0) * var(--cover-blur)));
  background-color: rgb(18 18 18 / calc(var(--cover, 0) * var(--cover-dim))); }
@supports (-webkit-backdrop-filter: blur(1px)) {
  .stack-covered::after { -webkit-backdrop-filter: blur(calc(var(--cover, 0) * var(--cover-blur))); }
}
.stack-covered:has(:focus-visible)::after { content: none; }
@media (prefers-reduced-motion: reduce) { .stack-covered::after { content: none; } }

/* Legal text: two columns per screen on wide windows (sticky.js adds .two-col). */
.stick-ready .prose.two-col { max-width: var(--max-wide); columns: 2; column-gap: 64px; }
.stick-ready .prose.two-col > h2, .stick-ready .prose.two-col > .updated { column-span: all; }
.stick-ready .prose.two-col > * { break-inside: avoid-column; }

/* Pictures in a band that is a little too tall shrink to fit (sticky.js fitImages); text never scales. */
.stick-ready main > .img-capped img { max-height: var(--img-cap); width: auto; max-width: 100%; margin-left: auto; margin-right: auto; }

/* A thin band's content moved into its neighbour (sticky.js absorbThin). */
.stick-ready .absorbed { text-align: start; margin-top: clamp(28px, 4.5svh, 64px); }
.stick-ready .absorbed:first-child { margin-top: 0; margin-bottom: clamp(28px, 4.5svh, 64px); }
