/* ============================================================================
   The homepage's stacked sheets (the seams, Aldo, 29 Sept 2026: "unique, and
   that makes the page more professional"). Homepage only (30 Sept 2026):
   tools/site.mjs loads this and web/home/sheets.js on the homepage and nowhere
   else, so the other pages built from the homepage's sections (owners, the
   town pages and more) are untouched. The sheet's look (its corner radius
   --sheet-r, its shadow --sheet-cast and its gold edge --sheet-gilt) is a set
   of tokens in base.css; the holding, the shade and the decks are here.
   ========================================================================== */

/* Where the homepage changes colour, the next section arrives as a sheet with softly rounded top
   corners and slides up over the one before it, which holds still while it's covered: the testimonials
   under the 2 a.m. band, the comparison and the areas. The record band before them isn't held (Aldo,
   22 Oct 2026: its figures were cut through as the testimonials climbed over it); it ends in the site's
   still edge (base.css), as the proof bars on the other pages do. A soft shadow
   falls from the sheet's edge, the edge itself is gilt (a fine line of solid gold that thins away
   along the corners, like the edge of good stationery), and the sheet underneath dims a little as it
   goes under. No pictures. src/home.mjs builds the decks; sheets.js measures each sheet (--sheet-h),
   adds .is-live and sets the shade. Without script, with reduced motion or Stop animations, and in
   print, the sheets simply rest on each other, with the same corners, edge and shadow, and nothing is
   held. */
.deck { --pin-top: var(--header-h); --pin-bottom: 0px; display: flow-root; position: relative; isolation: isolate; }
/* A sheet holds where the view ends: above the phone bar, and under the header, or at the top of a
   short screen, where the header scrolls away (base.css). */
@media (max-width: 899px) { .deck { --pin-bottom: calc(var(--bar-h) + env(safe-area-inset-bottom, 0px)); } }
@media (max-height: 500px) { .deck { --pin-top: 0px; --pin-bottom: 0px; } }

.deck__sheet { position: relative; z-index: 1; }
/* --sheet-k (sheets.js) is the part of the corner radius left as the sheet nears the header, 1 to 0. */
.deck__sheet + .deck__sheet { --sheet-rk: calc(var(--sheet-r) * var(--sheet-k, 1)); margin-top: calc(var(--sheet-r) * -1); border-radius: var(--sheet-rk) var(--sheet-rk) 0 0; }
/* The edge: a band along the top of the sheet draws the gilt line, which thins away along the
   corners, and casts the shadow; its clip keeps the shadow above the sheet, so nothing of it reaches
   where the sheets end together at the bottom of their deck. The gold is solid, so it reads as gold
   at 1x and in dark mode too (the critic, 30 Sept 2026: a see-through gold read as a grey line). */
.deck__sheet + .deck__sheet::before { content: ""; position: absolute; z-index: 4; inset: 0 0 auto; height: 360px; max-height: 100%;
  border-top: 1px solid var(--sheet-gilt); border-radius: inherit; box-shadow: var(--sheet-cast);
  clip-path: inset(-240px 0 calc(100% - var(--sheet-r) - 2px) 0); pointer-events: none; opacity: var(--sheet-k, 1); }
/* The 2 a.m. band clips everything but the shadow above it, and its photo takes the corners. */
.deck > .night { overflow: visible; clip-path: inset(-240px 0 0 0); }
.deck > .night > .night__photo { border-radius: var(--sheet-rk) var(--sheet-rk) 0 0; }
/* On phones the photo is a small tile beside the heading (home.css), not the band's top: its own corners. */
@media (max-width: 699px) { .deck > .night > .night__photo, .deck > .night.is-flush > .night__photo { border-radius: 18px; } }
/* It keeps room below its closing lines (the checker, 30 Sept 2026: the band holds once its end
   reaches the bottom of the view, so without it the comparison rose over the band's ending almost at
   once). Its phones stand whole mid-band on every page (home.css), and the room keeps the owner's reply,
   the estimate button and the small print in view about as long as before the sheets, and lands a find
   in the page on the small print in view. */
.deck > .night { padding-bottom: 32svh; }
/* Flush: a sheet nearing the header closes its corners as it comes, the radius never more than its
   distance from the header, and its edge and shadow fade with them, so the sheet it covers never
   shows through the corners as dark notches below the header (the critic, 30 Sept 2026), and nothing
   snaps square (the checker, 30 Sept 2026). At the header (sheets.js adds .is-flush) they're square
   and the edge is gone. Scrolled back down, the corners return. */
.deck > .deck__sheet.is-flush, .deck > .night.is-flush > .night__photo { border-radius: 0; }
.deck > .deck__sheet.is-flush::before { opacity: 0; }
/* The sheets held underneath leave with the deck's end; the last sheet reaches 2px past it (the deck
   is its own formatting context, so the margin stays inside), so their edges stay under it and no
   hairline shows where the deck meets the next section. */
.deck > section:last-of-type, .deck > :last-child { margin-bottom: -2px; }

/* Each sheet makes room for the next one's edge: at rest it covers its corner radius. The held sheets
   that end in closing lines (the reviews' permission note; the comparison's buttons and Toolkit link)
   keep more room below them, as the 2 a.m. band does below its small print: the next sheet covers a held one
   from its end up, so without it those lines were in view for a fraction of the time they had before
   the sheets, and a find in the page or a link to a line of text could land under the next sheet (the
   checker, 30 Sept 2026). */
.deck > .reviews, .deck > .compare { padding-bottom: calc(var(--s8) + var(--sheet-r) + 18svh); }
/* A white section is see-through by default (the page's paper shows behind it), so a sheet gets its own
   paper, or what's under it shows through around its cards (Aldo, 22 Oct 2026: the reviews "bleed over that
   edge"). */
.deck > .deck__sheet.tone-1 { background-color: var(--paper); }
/* (The section under the hero, the Google reviews' band, rested on it as a still sheet from 22 Oct 2026, and rose over
   the hero's photo with the Story line; since Aldo's review of 23 Oct 2026 the hero flows straight into How it works,
   web/home/story.css.) */

/* Live: each sheet but the last holds still while the next one covers it. A sheet taller than the
   view holds once its end is in view; a shorter one, under the header. */
.deck.is-live > .deck__sheet:has(+ .deck__sheet) { position: sticky; top: min(var(--pin-top), calc(100svh - var(--pin-bottom) - var(--sheet-h, 200vh))); }
/* The shade on a sheet going under (sheets.js sets its opacity from how much of it is covered): the
   brand's teal on white, so white paper cools rather than greys. Nothing under a sheet moves or
   shrinks: paper under a sheet stays where it is. */
.deck__shade { position: absolute; inset: 0; z-index: 5; border-radius: inherit; background: var(--sheet-shade, rgb(16 57 71 / 0.08)); opacity: 0; pointer-events: none; will-change: opacity; }
.deck > .compare { --sheet-shade: rgb(4 18 24 / 0.18); }
.deck > .night { --sheet-shade: rgb(0 0 0 / 0.26); }
:root[data-theme="dark"] .deck > .deck__sheet { --sheet-shade: rgb(0 0 0 / 0.28); }
@media (prefers-reduced-motion: reduce) { .deck.is-live > .deck__sheet { position: relative; top: auto; } .deck__shade { display: none; } }
.a11y-still .deck.is-live > .deck__sheet { position: relative; top: auto; }
.a11y-still .deck__shade { display: none; }
@media print { .deck.is-live > .deck__sheet { position: relative; top: auto; } .deck__shade { display: none; } .deck__sheet + .deck__sheet::before { box-shadow: none; } }
