/* The home page's performing layout. Everything here is under .show, which flag.js sets before the first paint
   when the screen is wide and motion is welcome (and takes back if the motion script never reports). Without it the
   home page is the still, stacked page in styles.css.
   The page is a run of full-screen panels. Each panel is a tall wrapper whose stage sticks to the top of the window
   for the panel's length (--len, in svh); the next panel then rises over it, and the motion script sinks and dims
   the one being covered, so at rest exactly one panel fills the screen. The psychrometer is drawn on a fixed canvas
   above every panel (scene.js), and the .slot boxes say where it stands. Each stage is composed around the space
   its slot leaves for the object: the object never rests on text. */

.show body { background: var(--navy); }
.show .panel { padding: 0; height: calc(var(--len, 100) * 1svh); min-height: 0; display: block; overflow-x: clip; }   /* (a slot may reach the edge; it must never widen the page) */
.show .panel__stage { position: sticky; top: calc(var(--over, 0) * -1px); height: 100svh; min-height: 100svh; margin: 0;
  padding: calc(var(--chrome) + clamp(1.5rem, 4.5svh, 3rem)) var(--gut) clamp(1.5rem, 4.5svh, 3rem); overflow: clip; background: var(--ground); transform-origin: 50% 0; }
.show .panel__stage.is-tall { height: auto; }
.show .panel--open { --len: 140; }
.show .panel--loud { --len: 190; }
.show .panel--say { --len: 150; }
.show .panel--six { --len: 380; }
.show .panel--check { --len: 130; }
.show .panel--proof { --len: 120; }
.show .panel--prices { --len: 115; }
.show .panel--doors { --len: 110; }
.show .panel--close { --len: 100; }

/* the slots: invisible boxes in window coordinates while their panel is pinned */
/* (a slot never starts under the strip and the bar: on a short window its top moves down and its foot stays put) */
.show .slot { --top: max(var(--y), calc(var(--chrome) + 1rem)); display: block; position: absolute; left: var(--x); top: var(--top); width: var(--w);
  height: calc(var(--y) + var(--h) - var(--top)); pointer-events: none; visibility: hidden; }
.show .slot--open { --x: 51vw; --y: 14svh; --w: 43vw; --h: 48svh; }
.show .slot--open-out { --x: 30vw; --y: 26svh; --w: 46vw; --h: 46svh; }
.show .slot--whirl { --x: 50vw; --y: 55svh; --w: 45vw; --h: 37svh; }   /* (below the two lines even while it spins) */
.show .slot--say { --x: 66vw; --y: 13svh; --w: 26vw; --h: 80svh; }
.show .slot--six { --x: 50vw; --y: 67svh; --w: 46vw; --h: 28svh; }
.show .slot--calls { --x: 2vw; --y: 76svh; --w: 30vw; --h: 20svh; }
.show .slot--calls-out { --x: 68vw; --y: 76svh; --w: 30vw; --h: 20svh; }
.show .slot--check { --x: 60vw; --y: 11.5svh; --w: 34vw; --h: 16svh; }
.show .slot--proof { --x: 58vw; --y: 66svh; --w: 38vw; --h: 28svh; }
.show .slot--prices { --x: 70vw; --y: 13svh; --w: 24vw; --h: 80svh; }
.show .slot--doors { --x: 54vw; --y: 12svh; --w: 40vw; --h: 26svh; }
.show .slot--close { --x: 52vw; --y: 16svh; --w: 44vw; --h: 68svh; }

/* when the 3D object is on screen, the still pictures of it step aside (scene.js sets .gl once it draws) */
.gl.show .open__still, .gl.show .close__still { visibility: hidden; }
.gl .open__still { position: relative; }
.gl .open__still img { visibility: hidden; }   /* (its box stays, and the live object is drawn in it) */
.wb-canvas { position: fixed; inset: 0; width: 100vw; height: 100svh; z-index: 20; pointer-events: none; opacity: 0; transition: opacity 600ms var(--ease-out); }
.wb-canvas.is-on { opacity: 1; }
.wb-canvas--hero { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; }

/* ---------------------------------------------------------------- 1. the opening: type left, the object above its two readings */
.show .open__grid { height: 100%; grid-template-columns: minmax(0, 1.02fr) minmax(0, 1fr); align-items: stretch; }
.show .open__text { display: grid; align-content: space-between; }
.show .open__h { font-size: clamp(2.2rem, min(3.9vw, 7.8svh), 4.4rem); }
.show .open__h .line { white-space: nowrap; }
.show .open__object { grid-template-rows: 1fr auto; }
.show .open__still { max-width: 30rem; margin-left: auto; align-self: center; }
.show .open__read { position: relative; z-index: 25; }
.js.show .open__h .line > span { transform: translateY(105%); }

/* ---------------------------------------------------------------- 2. heat and water: two lines across the top, the whirl below them */
.show .panel--loud .panel__stage { display: grid; grid-template-rows: auto 1fr; }
.show .loud { font-size: clamp(3rem, min(7.3vw, 14svh), 9rem); }
.show .loud span { will-change: transform; }
.show .loud__note { align-self: end; max-width: 30rem; }

/* ---------------------------------------------------------------- 3. the statement: read at the reader's pace, the instrument upright beside it */
.show .panel--say .panel__stage { display: grid; align-content: center; }
.show .say { font-size: clamp(1.9rem, min(3.3vw, 6.2svh), 3.4rem); max-width: 25ch; }
.js.show .say .w { color: #8C97A1; } /* 3.3:1 on white: enough for bold text this large, before it is inked */

/* ---------------------------------------------------------------- 4. what we measure: one plate and one reading at a time */
.show .six__grid { height: 100%; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); align-items: start; gap: 0 4.5rem; }
.show .six__plates { height: 100%; max-height: none; aspect-ratio: auto; }
.show .six__plates .plate + .plate { display: block; }
.show .six__plates .plate { clip-path: inset(100% 0 0 0); transition: clip-path 620ms cubic-bezier(0.32, 0.72, 0, 1); }
.show .six__plates .plate.is-shown { clip-path: inset(0 0 0 0); }
.show .six__list { position: relative; min-height: 44svh; }
.show .six__list > li { position: absolute; inset: 0 0 auto 0; padding-top: 1.25rem; opacity: 0; visibility: hidden; transform: translateY(1.25rem); transition: opacity 320ms var(--ease-out), transform 460ms var(--ease-out), visibility 0s 320ms; }
.show .six__list > li.is-on { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
.show .six__fine { position: absolute; left: calc(var(--gut) + 38vw); bottom: clamp(1rem, 3svh, 2rem); margin: 0; display: none; }

/* ---------------------------------------------------------------- 5. the calls travel sideways; the object crosses beneath them */
.show .side { height: max(100svh, calc(var(--travel, 0) * 1px + 100svh)); }
.show .side__pin { position: sticky; top: 0; height: 100svh; overflow: clip; background: var(--ground); display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto;
  padding: calc(var(--chrome) + clamp(1.5rem, 4.5svh, 3rem)) 0 24svh; transform-origin: 50% 0; }
.show .side__head { padding: 0 var(--gut); }
.show .side__row { display: flex; gap: 5.5rem; align-items: start; width: max-content; padding: 0 30vw 0 var(--gut); margin: clamp(1.5rem, 4svh, 3rem) 0 0; will-change: transform; }
.show .side__row a { text-decoration-skip-ink: none; }
.show .call { flex: none; width: 31rem; max-width: none; background: var(--ground); } /* (the ground travels with each item, so a checker never measures it against the page behind the stage) */
.show .call:nth-child(even) { margin-left: 0; }
.show .call--plate { width: auto; }
.show .call--plate .plate { height: 34svh; aspect-ratio: 4 / 5; }   /* (ends above the object's track) */
.show .side__more { position: absolute; right: var(--gut); bottom: clamp(1rem, 3svh, 2rem); margin: 0; font-size: 0.9375rem; }

/* ---------------------------------------------------------------- 6. the split check */
.show .panel--check .panel__stage { display: grid; align-content: center; }
.show .check { margin-top: 0; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 0 5rem; }
.show .check h2 { font-size: clamp(1.75rem, min(3vw, 5.4svh), 2.75rem); margin-bottom: 1rem; }
.show .check__how { margin-bottom: clamp(1rem, 3svh, 2rem); }
.show .check__right { padding-top: 19svh; }   /* the object lies above the result */
.show .split__n { font-size: clamp(4.5rem, min(9vw, 15svh), 8.5rem); }
.show .therm { margin-bottom: clamp(0.75rem, 2svh, 1.5rem); }
.show .verdict { min-height: 5.8em; margin-bottom: 0.75rem; font-size: 1.0625rem; }
.show .check__fine { display: none; }
.show .band { margin-bottom: 0.75rem; }
.show .split__l { margin: 0.25rem 0 0.75rem; }

/* ---------------------------------------------------------------- 7 to 9: plain where looked up, each composed round the object's place */
.show .panel--proof .panel__stage, .show .panel--prices .panel__stage { display: grid; align-content: center; }
.show .panel--prices .prices__head, .show .panel--prices .tbl, .show .panel--prices .prices__note { max-width: 62vw; }
.show .panel--doors .panel__stage { display: grid; align-content: end; }   /* the rows sit at the foot; the object lies above them */

/* ---------------------------------------------------------------- 10. after the visit */
.show .panel--close .panel__stage { display: grid; align-content: center; }
.show .close__object { min-height: 60svh; }

/* ---------------------------------------------------------------- reading text grows with a wide window, so a 1920 screen is not set in small print */
.show .open__lead, .show .loud__note, .show .close__say + p { font-size: clamp(1.25rem, 1.3vw, 1.625rem); }
.show .open__lead { max-width: 28ch; }
.show .open__read { grid-template-columns: auto minmax(0, 30ch); }
.show .open__read p, .show .six__list p:not(.six__n):not(.six__read), .show .call p, .show .check__how, .show .verdict, .show .quote blockquote, .show .door span, .show .panel .tbl th, .show .panel .tbl td { font-size: clamp(1.0625rem, 1.12vw, 1.375rem); }
.show .six__read span { font-size: clamp(1.25rem, 1.35vw, 1.625rem); }

/* ---------------------------------------------------------------- short windows: a laptop at 125 % scaling gives Chrome about 1536 x 674.
   Every large figure is sized by the smaller of the window's width and height, so each stage still fits at rest. */
.show .tel { font-size: clamp(2.25rem, min(6vw, 10.5svh), 5.5rem); }
.show .open__read .r { font-size: clamp(2.75rem, min(6vw, 10svh), 5.75rem); }
.show .open__h { margin-bottom: clamp(0.5rem, 2svh, 1.25rem); }
.show .close__read .r { font-size: clamp(3.75rem, min(13vw, 19svh), 12rem); }
.show .close__say { font-size: clamp(1.25rem, min(2.2vw, 4.2svh), 2rem); }
.show .close__object { min-height: min(60svh, 30rem); }
.show .therm output { font-size: clamp(2.25rem, min(5vw, 8svh), 4.5rem); }
.show .panel .tbl th, .show .panel .tbl td { padding-block: clamp(0.4rem, 1.5svh, 0.85rem); }
.show .panel .tbl td.money .r { font-size: clamp(1.5rem, 3.4svh, 2rem); }
.show .prices__head { margin-bottom: clamp(0.5rem, 2svh, 1.5rem); }

.show .open__h { font-size: clamp(2rem, min(3.9vw, 6.3svh), 4.4rem); }
.show .open__still { max-width: min(30rem, 58svh); }
.show .check h2 { font-size: clamp(1.6rem, min(3vw, 4.8svh), 2.75rem); margin-bottom: clamp(0.5rem, 1.5svh, 1rem); }
.show .check__how li { margin-bottom: clamp(0rem, 0.6svh, 0.35rem); }
.show .close__still { max-width: min(100%, 78svh); margin-inline: auto; }
@media (max-height: 760px) {
  .show .split__n { font-size: clamp(4rem, min(9vw, 12svh), 8.5rem); }
  .show .verdict { min-height: 5.6em; min-height: calc(4lh + 1px); }   /* (the longest verdict is four lines at these widths) */
  .show .check fieldset legend { float: left; margin-right: 1.75rem; line-height: 2.75rem; }   /* the question and its two answers share a row */
  /* the two sliders keep a 32 px target (above the 24 px minimum) and give back the rest */
  .show .therm__tube, .show .therm input[type="range"], .show .therm input[type="range"]::-webkit-slider-runnable-track { height: 2rem; }
  .show .therm input[type="range"]::-webkit-slider-thumb { height: 2rem; }
  .show .therm input[type="range"]::-moz-range-track { height: 2rem; }
  .show .therm input[type="range"]::-moz-range-thumb { height: 2rem; }
}

/* a section off screen pauses its own animations */
.is-off * { animation-play-state: paused !important; }
