/* Pinewater scroll-film site.
   Order: fonts, tokens, base, shared parts (kicker, labels, script lines, buttons), chrome (skip link,
   loader, nav, phone menu), section stack, film stages, pinned panels (compare, light, estimator),
   closing, widths under 1100px, phone, landscape phone, reduced motion, debug overlay.
   Everything visual is a custom property on :root, so a restyle starts and mostly ends there.

   Three type roles: Fraunces (display serif), Manrope (text sans), Great Vibes (script accent, three lines only;
   the owner's pick, 11 Nov 2026).
   Composition: one central axis. The wordmark sits at the top centre and every caption of the film is
   centred under the picture, like an intertitle. */

/* ---------- fonts: self-hosted latin subsets from Google Fonts, SIL OFL 1.1 (licence texts in ../fonts) ---------- */

@font-face {
  font-family: "Fraunces";                /* v38, variable: weight 300-400 used, optical size 9-144 */
  src: url("../fonts/fraunces-latin.woff2") format("woff2");
  font-weight: 300 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Fraunces";                /* italic, text optical size: kickers only */
  src: url("../fonts/fraunces-latin-italic.woff2") format("woff2");
  font-weight: 300 400;
  font-style: italic;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Manrope";                 /* v23, variable: weight 400-600 used */
  src: url("../fonts/manrope-latin.woff2") format("woff2");
  font-weight: 400 600;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Great Vibes";             /* v21, Regular only */
  src: url("../fonts/great-vibes-latin.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---------- tokens ---------- */

:root {
  /* colour */
  --paper: #f2ede4;
  --ink: #12110e;
  --pine: #1f3a2e;
  --brass: #b08a57;
  --pine-deep: #14271f;                   /* pine at night: loader and phone menu */
  --brass-light: #dcc091;                 /* brass as text on the film and on pine (7:1 on pine) */
  --text: var(--paper);
  --text-dim: rgba(242, 237, 228, .82);
  --line: rgba(242, 237, 228, .26);       /* hairlines on the film and on pine */
  --line-strong: rgba(242, 237, 228, .6);
  --line-mid: rgba(242, 237, 228, .42);   /* the estimator's frame lines */
  --shade: 18, 17, 14;                    /* rgb parts of --ink, for see-through shades */
  --veil: rgba(20, 39, 31, .8);           /* --pine-deep, see-through: the compare handle */
  --mark: var(--brass-light);             /* the logo mark's line */
  --focus: var(--paper);
  --focus-under: var(--ink);
  --shadow-over: rgba(0, 0, 0, .5);       /* cast by a section onto the screen it slides over */
  --shadow-text: 0 1px 1.25rem rgba(18, 17, 14, .5);   /* keeps captions readable on a bright frame */

  /* type */
  --font-display: "Fraunces", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --font-text: "Manrope", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --font-script: "Great Vibes", "Snell Roundhand", "Segoe Script", cursive;
  /* The three blocks that stand in front of the finished house (hero, last line of the film, closing) are
     sized from --under-house, so that each ends under the house and never on it. A block's height is its
     fixed parts plus a multiple of its type size; the size is what is left, divided by that multiple. */
  --size-hero: clamp(2.25rem, min(1rem + 5vw, (var(--under-house) - var(--cue-b) - var(--hero-lede) - 3.6rem) * .38), 6rem);   /* two lines. Kicker and a clear gap 3.6rem; heading and script 2.63 of the size */
  --size-hero-script: calc(var(--size-hero) * .62);
  --size-h2: clamp(2.1rem, 1.2rem + 3.1vw, 4.25rem);
  --size-close: clamp(2rem, min(1.2rem + 4vw, max(min(5.6vw, 4.4rem, (var(--under-house) - var(--close-b) - 5.5rem) / 1.92), (var(--under-house) - var(--close-b) - 5.5rem) / 2.88)), 5.25rem);   /* the closing statement. Button and a clear gap 5.5rem; heading and script 1.92 of the size on one line (as wide as 5.6vw and 4.4rem allow), 2.88 on two */
  --size-close-script: calc(var(--size-close) * .8);
  --size-figure: clamp(2.6rem, 1.3rem + 3.6vw, 5rem);       /* the estimator's answer */
  --size-fact: clamp(2.6rem, 1.4rem + 3.8vw, 5.25rem);      /* interior figures */
  --size-script: clamp(2.5rem, 1.35rem + 4.1vw, 5.5rem);    /* script accent lines: about four fifths of the heading they sign */
  --size-script-xl: clamp(3.4rem, min(10.5vw, (var(--under-house) - var(--edge-b) - var(--row-h) - var(--gap-6) - 1.9rem) / 1.05), 9.5rem);   /* the film's last line: one line down to the phone breakpoint */
  --size-kicker: clamp(1.1rem, 1rem + .35vw, 1.35rem);
  --size-lede: clamp(1.02rem, .95rem + .32vw, 1.25rem);
  --size-body: 1rem;
  --size-label: .75rem;                   /* small-caps labels */
  --size-note: .8rem;                     /* chip notes, range ends, fine print */
  --size-ui: .9rem;                       /* nav links, small buttons, programme rows */
  --size-button: .95rem;
  --size-chip-name: 1rem;
  --size-value: 1.5rem;                   /* field values, in the display face */
  --size-menu: 2.1rem;                    /* phone menu links */
  --size-wordmark: 1.45rem;
  --lead-display: .98;
  --lead-body: 1.55;
  --track-display: -.018em;
  --track-label: .14em;

  /* space */
  --gutter: clamp(1rem, .4rem + 2.6vw, 3rem);
  --edge-b: clamp(1.25rem, .65rem + 2.6vw, 3.25rem);        /* bottom row of a stage to the stage's bottom edge */
  --cue-b: var(--edge-b);                                   /* a caption's bottom edge to the stage's: on the bottom row here, above it on narrower windows */
  --close-b: var(--edge-b);                                 /* the same for the closing block */
  --hero-lede: 0rem;                                        /* height kept for the hero's supporting line where it is on screen */
  --nav-h: 4.75rem;
  --gap-1: .25rem;
  --gap-2: .5rem;
  --gap-3: .75rem;
  --gap-4: 1rem;
  --gap-5: 1.5rem;
  --gap-6: 2.25rem;
  --gap-7: 3.5rem;
  --radius: 2px;
  --button-h: 3.25rem;
  --tap: 2.75rem;                         /* smallest touch target */
  --row-h: 1.75rem;                       /* bottom row: stage label, scroll hint, compare tags */
  --rule-w: 2rem;                         /* the thin rule beside a label */
  --cue-w: 46rem;                         /* widest caption */

  /* one screen. lvh/svh keep the stage still while a phone's address bar moves */
  --screen: 100vh;
  --screen-s: 100vh;

  /* The room under the house. In the hub view, the arrival and the closing shot the house's foot stands
     no lower than row 661 of a frame's 1080. The frame covers the stage, so that is half the stage's
     height plus 6.3vw down in a window wider than the 16:9 frame, and 61.2% down in a narrower one.
     This is what is left below it, measured up from the bottom of the caption area. */
  --under-house: min(var(--screen-s) - var(--screen) * .5 - 6.3vw, var(--screen-s) - var(--screen) * .612);

  /* motion */
  --dur-fast: 180ms;                      /* colour and border changes */
  --dur-base: 240ms;                      /* small parts: bars, labels */
  --dur-mark: 420ms;                      /* the marker of the light picker travelling to its hour */
  --dur-cue: 520ms;                       /* captions, loader, hint */
  --dur-stagger: 160ms;                   /* a script line arrives this long after its caption */
  --dur-panel: 460ms;                     /* phone menu */
  --dur-arrive: 700ms;                    /* the parts of a panel rising into place */
  --dur-reveal: 900ms;                    /* light picker reveal (read by js/studio.js) */
  --ease: cubic-bezier(.2, 0, 0, 1);
  --rise: 18px;                           /* how far a caption travels as it enters or leaves */
}

@supports (height: 100lvh) {
  :root { --screen: 100lvh; --screen-s: 100svh; }
}

/* ---------- base ---------- */

*, *::before, *::after { box-sizing: border-box; }

html {
  background: var(--ink);
  color-scheme: dark;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: rgba(176, 138, 87, .55) transparent;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  overflow-x: clip;
  background: var(--ink);
  color: var(--text);
  font: 400 var(--size-body) / var(--lead-body) var(--font-text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, p, ul, ol, dl, dd, dt { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img, picture, canvas, svg { display: block; }
a { color: inherit; }
button { font: inherit; color: inherit; }
::selection { background: var(--brass); color: var(--ink); }

h1, h2 {
  font-family: var(--font-display);
  font-weight: 300;
  line-height: var(--lead-display);
  letter-spacing: var(--track-display);
  text-wrap: balance;
}

/* A phrase stays on one line when it fits, so a heading breaks between phrases, not inside one. */
.phrase { display: inline-block; }

/* Two-tone ring: readable on a dark frame, a bright frame and on paper. */
:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  box-shadow: 0 0 0 2px var(--focus-under);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* ---------- shared parts ---------- */

/* Kicker: the short line above a heading, in the serif italic. */
.kicker {
  margin-bottom: var(--gap-3);
  font: italic 400 var(--size-kicker) / 1.2 var(--font-display);
}

/* Small-caps label with, where it has one, a thin rule beside it. */
.stage-label, .hint, .tag, .hour, .loader-note, .field-label, .figure dt {
  font: 600 var(--size-label) / 1.2 var(--font-text);
  letter-spacing: var(--track-label);
  text-transform: uppercase;
}
.rule { flex: none; width: var(--rule-w); height: 1px; background: var(--brass); }

/* Script accent: three lines on the whole page. */
.script {
  font: 400 var(--size-script) / 1.15 var(--font-script);
  font-synthesis: none;
  letter-spacing: 0;
  color: var(--brass-light);
}
.script-xl { font-size: var(--size-script-xl); line-height: 1.05; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--button-h);
  padding: 0 1.75rem;
  border: 1px solid var(--brass);
  border-radius: var(--radius);
  background: var(--brass);
  color: var(--ink);
  font: 600 var(--size-button) / 1 var(--font-text);
  text-decoration: none;
  text-shadow: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.btn:hover { background: var(--paper); border-color: var(--paper); }
.btn-small { min-height: 2.5rem; padding: 0 1.15rem; font-size: var(--size-ui); }
/* Quiet button: takes the colour of the text around it, so it follows the nav onto paper. */
.btn-ghost { border-color: currentColor; background: transparent; color: inherit; }
@supports (color: color-mix(in srgb, red 50%, blue)) {
  .btn-ghost { border-color: color-mix(in srgb, currentColor 55%, transparent); }
}
.btn-ghost:hover { background: var(--paper); border-color: var(--paper); color: var(--ink); }

/* ---------- chrome: skip link, loader, nav, phone menu ---------- */

.skip-link {
  position: fixed;
  top: .5rem;
  left: .5rem;
  z-index: 300;
  padding: .7rem 1rem;
  background: var(--paper);
  color: var(--ink);
  font: 600 var(--size-ui) / 1 var(--font-text);
  transform: translateY(-300%);
}
.skip-link:focus { transform: none; }

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font: 400 var(--size-wordmark) / 1 var(--font-display);
  letter-spacing: -.01em;
  text-decoration: none;
  white-space: nowrap;
}
.mark {
  flex: none;
  width: 1.05em;
  height: 1.05em;
  fill: none;
  stroke: var(--mark);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: stroke var(--dur-base) var(--ease);
}

.loader {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: var(--gap-4);
  background: var(--pine-deep);
  color: var(--text);
  transition: opacity var(--dur-cue) var(--ease), visibility 0s linear var(--dur-cue);
}
html:not(.js) .loader { display: none; }
.is-ready .loader { opacity: 0; visibility: hidden; }
.loader .wordmark { font-size: 2.25rem; }
.loader-rule { position: relative; width: 9rem; height: 1px; overflow: hidden; background: var(--line); }
.loader-rule::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--brass-light);
  animation: loader-run 1.4s var(--ease) infinite;
}
.is-ready .loader-rule::after { animation: none; }
.loader-note { color: var(--text-dim); }
@keyframes loader-run { from { transform: translateX(-100%); } to { transform: translateX(100%); } }

/* Links left, wordmark on the page's axis, action right. */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  column-gap: var(--gap-5);
  height: var(--nav-h);
  padding: 0 var(--gutter);
  color: var(--text);
  transition: color var(--dur-base) var(--ease);
}
.nav.menu-open { color: var(--text); --mark: var(--brass-light); --focus: var(--paper); --focus-under: var(--ink); }
.nav > .wordmark, .menu-toggle { position: relative; z-index: 2; }
.nav > .wordmark { justify-self: center; }
.nav-cta { justify-self: end; }

.nav-links { display: flex; gap: clamp(1rem, 2.2vw, 2.25rem); justify-self: start; }
.nav-links a {
  padding: .65rem 0;
  border-bottom: 1px solid transparent;
  font: 500 var(--size-ui) / 1 var(--font-text);
  text-decoration: none;
  white-space: nowrap;
  transition: border-color var(--dur-fast) var(--ease);
}
.nav-links a:hover { border-bottom-color: currentColor; }

.menu-toggle {
  display: none;
  width: var(--tap);
  height: var(--tap);
  margin: 0 -.6rem 0 auto;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}
.menu-toggle-icon i {
  position: absolute;
  right: .6rem;
  height: 1.5px;
  background: currentColor;
  transition: transform var(--dur-panel) var(--ease), width var(--dur-panel) var(--ease);
}
.menu-toggle-icon i:first-child { top: calc(50% - 5px); width: 1.5rem; }
.menu-toggle-icon i:last-child { top: calc(50% + 3px); width: .9rem; }
.menu-toggle[aria-expanded="true"] .menu-toggle-icon i:first-child { transform: translateY(4px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] .menu-toggle-icon i:last-child { width: 1.5rem; transform: translateY(-4px) rotate(-45deg); }

.menu {
  position: fixed;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  padding: calc(var(--nav-h) + var(--gap-5)) var(--gutter) calc(var(--gap-6) + env(safe-area-inset-bottom));
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--pine-deep);
  color: var(--text);
  visibility: hidden;
  transform: translateX(100%);
  transition: transform var(--dur-panel) var(--ease), visibility 0s linear var(--dur-panel);
}
.menu.is-open { visibility: visible; transform: none; transition-delay: 0s; }
.menu-links { display: flex; flex-direction: column; }
.menu-links a:not(.btn) {
  display: flex;
  align-items: center;
  min-height: 4.25rem;
  font: 300 var(--size-menu) / 1.1 var(--font-display);
  letter-spacing: var(--track-display);
  text-decoration: none;
}
.menu-links a:not(.btn) + a:not(.btn) { border-top: 1px solid var(--line); }
.menu-links .btn { margin-top: var(--gap-6); }
.menu-lock { overflow: hidden; }

/* ---------- section stack: each later section slides over the screen pinned before it ---------- */

main > section { position: relative; }
main > section + section { margin-top: calc(var(--screen) * -1); box-shadow: 0 -1.25rem 3.5rem var(--shadow-over); }
main > section:nth-child(1) { z-index: 1; }
main > section:nth-child(2) { z-index: 2; }
main > section:nth-child(3) { z-index: 3; }
main > section:nth-child(4) { z-index: 4; }
main > section:nth-child(5) { z-index: 5; }
main > section:nth-child(6) { z-index: 6; }
main > section:focus { outline: none; box-shadow: 0 -1.25rem 3.5rem var(--shadow-over); }

/* ---------- film stages ---------- */

/* A film section is --len screens tall. The scene's data-k of them are not scrubbed (the stage itself, the
   screen the next section slides over, and any pause on the last frame); the rest is the scroll that plays
   the film. Each stretch of the film is as long as its picture changes (tools/timeline.mjs prints the
   numbers): the build is 16.2 screens of scroll, a quarter slower than the reference site moves, with at
   least 2.4 screens for each clip that has machines in it (3.5 for the groundworks); the walk is 16 screens, which is three to four
   times as much change per notch as the build, because a camera walking through rooms changes the whole
   picture with every frame. Retune these when a clip changes. */
.scrub { height: calc(var(--screen) * var(--len, 10)); background: var(--ink); }
.scrub[data-scene="film"] { --len: 18.6; }
.scrub[data-scene="inside"] { --len: 18.3; }
.scrub[data-scene="away"] { --len: 4.4; }

.stage { position: sticky; top: 0; height: var(--screen); overflow: hidden; background-color: var(--ink); }
/* Clear until its first picture is drawn (js/stills.js adds "has-picture"), so a stage that is still loading
   brings its picture in instead of snapping from black. */
.film-canvas { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; transition: opacity var(--dur-base) var(--ease); }
.stage.has-picture .film-canvas { opacity: 1; }

/* No film (manifest or first frame failed, a scene not rendered yet, or no script): one still instead of
   a black stage, on a section one screen long (plus the one the next section slides over). Only the
   opening and the closing text stay: the build captions belong to pictures that are not there. */
.scrub.is-fallback { --len: 2; }
.scrub.is-fallback .stage,
html:not(.js) .stage { background: var(--ink) url("../img/poster.webp") center / cover no-repeat; }
.scrub.is-fallback .film-canvas,
html:not(.js) .film-canvas,
.scrub.is-fallback .cue:not(.cue-hero):not(.cue-close),
.scrub.is-fallback .stage-label,
.scrub.is-fallback .hint { display: none; }

/* No script at all: a static page. One screen per film section (plus the one the next section slides over),
   its still, the opening text; the panels as they stand. */
html:not(.js) .scrub { height: calc(var(--screen) * 2); }
html:not(.js) .stage-label,
html:not(.js) .hint { display: none; }

/* Shade over the picture. Always: a little at the top, behind the navigation, and along the bottom row.
   The taller shade behind a caption is there only while a caption is (js/cues.js adds "has-cue"), and it
   ends under the house. */
.shade {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(to bottom, rgba(var(--shade), .62), rgba(var(--shade), 0) 22%),
    linear-gradient(to top, rgba(var(--shade), .6), rgba(var(--shade), .24) 12%, rgba(var(--shade), 0) 26%);
}
.stage .shade::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0;
  background: linear-gradient(to top, rgba(var(--shade), .7), rgba(var(--shade), .45) 26%, rgba(var(--shade), 0) 38%);   /* the house's foot stands 38% up a wide stage */
  transition: opacity var(--dur-cue) var(--ease);
}
.stage.has-cue .shade::after,
html:not(.js) .stage .shade::after { opacity: 1; }

.stage-ui { position: absolute; inset: 0 0 auto 0; height: var(--screen-s); }

/* Captions, centred under the picture. js/cues.js adds "on" inside the caption's window and "past" after it. */
.cue {
  position: absolute;
  left: 0;
  right: 0;
  bottom: var(--cue-b);
  width: min(var(--cue-w), calc(100% - var(--gutter) * 2));
  margin-inline: auto;
  text-align: center;
  text-shadow: var(--shadow-text);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translate3d(0, var(--rise), 0);
  transition: opacity var(--dur-cue) var(--ease), transform var(--dur-cue) var(--ease), visibility 0s linear var(--dur-cue);
}
.cue.past { transform: translate3d(0, calc(var(--rise) * -1), 0); }
.cue.on { opacity: 1; visibility: visible; pointer-events: auto; transform: none; transition-delay: 0s; }

.cue h1 { font-size: var(--size-hero); line-height: .96; letter-spacing: -.022em; }
.cue h2 { font-size: var(--size-h2); }
.cue-text { max-width: 36rem; margin: var(--gap-5) auto 0; font-size: var(--size-lede); line-height: 1.5; text-wrap: balance; }   /* two or three lines, never a column */

/* A script line comes in a beat after the caption it signs. */
.cue .script { opacity: 0; transition: opacity var(--dur-cue) var(--ease); }
.cue.on .script { opacity: 1; transition-delay: var(--dur-stagger); }

.cue-hero { --cue-w: 68rem; }
.cue-hero .phrase { display: block; }                             /* always two lines: the second is the promise */
.cue-hero .script { padding-left: 0; font-size: var(--size-hero-script); }   /* centred under the heading, on the page's axis (owner, 11 Nov) */
/* The hero's supporting line fits under the house, with the rest of the block, only in a window at least
   1200px tall. In a shorter one it is kept for screen readers and taken off the screen. */
@media (max-height: 1199px) {
  .cue-hero .cue-text { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}
@media (min-height: 1200px) {
  :root { --hero-lede: 5.5rem; }
}
.cue-welcome { --cue-w: 100rem; bottom: calc(var(--edge-b) + var(--row-h) + var(--gap-6)); }   /* clear of the bottom row: the line is as wide as the stage */
.cue-welcome .script { opacity: 1; transition: none; }            /* the caption is the script line */

/* Bottom row: the stage on screen (left) and the scroll hint (right). */
.stage-label, .hint {
  position: absolute;
  bottom: var(--edge-b);
  display: flex;
  align-items: center;
  gap: var(--gap-3);
  min-height: var(--row-h);
  color: var(--text-dim);
  text-shadow: var(--shadow-text);
}
.stage-label { left: var(--gutter); }
.stage-value { color: var(--text); white-space: nowrap; }
.hint { right: var(--gutter); transition: opacity var(--dur-cue) var(--ease), visibility 0s linear var(--dur-cue); }
.hint.is-gone { opacity: 0; visibility: hidden; }
.hint-line { position: relative; width: 1px; height: var(--row-h); overflow: hidden; background: var(--line); }
.hint-line::after {
  content: "";
  position: absolute;
  inset: 0 0 60% 0;
  background: var(--brass-light);
  animation: hint-drop 2.4s var(--ease) infinite;
}
.hint.is-gone .hint-line::after { animation: none; }
@keyframes hint-drop { from { transform: translateY(-100%); } to { transform: translateY(250%); } }

/* Inside: three real dimensions of the model. */
.cue-facts { --cue-w: 56rem; }
.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.facts li { display: grid; justify-items: center; align-content: start; gap: var(--gap-3); padding: 0 var(--gap-4); }
.facts li + li { border-left: 1px solid var(--line); }
.fact-figure {
  font: 300 var(--size-fact) / 1 var(--font-display);
  font-variant-numeric: lining-nums;
  letter-spacing: -.02em;
  white-space: nowrap;
}
.fact-unit { font-size: .5em; letter-spacing: 0; }
.fact-label { font-size: var(--size-body); line-height: 1.35; text-wrap: balance; }

/* ---------- pinned panels ---------- */

.hold { background: var(--ink); }
/* The scroll distance a panel stays pinned for. It has to be content, not padding: a sticky box only
   travels inside its parent's content box. */
.hold::after { content: ""; display: block; height: calc(var(--screen) * var(--hold, 2.3)); }
/* Before and after, and the five hours: nothing in them is driven by the scroll, so they stay whole for a third of a
   screen only. The hold has to be more than 1: the next section slides over this one during its last screen
   (main > section + section), and with less than 1 this panel never reaches the top before that starts. */
#compare, #light { --hold: 1.35; }
.pin { position: sticky; top: 0; height: var(--screen); overflow: hidden; background: var(--ink); }
.pin-ui { position: absolute; inset: 0 0 auto 0; height: var(--screen-s); pointer-events: none; }
.shade-panel {
  background:
    linear-gradient(to bottom, rgba(var(--shade), .74), rgba(var(--shade), .3) 22%, rgba(var(--shade), 0) 40%),
    linear-gradient(to top, rgba(var(--shade), .72), rgba(var(--shade), 0) 30%);
}

.panel-head {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(var(--nav-h) + var(--gap-4));
  width: min(var(--cue-w), calc(100% - var(--gutter) * 2));
  margin-inline: auto;
  text-align: center;
  text-shadow: var(--shadow-text);
}
.panel-head h2 { font-size: var(--size-h2); }

/* Frame against handover. --x is the divider position, set by js/compare.js. */
.compare { position: absolute; inset: 0; cursor: ew-resize; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.compare-layer,
.compare-layer img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; -webkit-user-drag: none; }
.compare-before { clip-path: inset(0 calc(100% - var(--x)) 0 0); }
.compare-divider { position: absolute; top: 0; bottom: 0; left: var(--x); width: 1px; margin-left: -.5px; background: var(--paper); pointer-events: none; }
.compare-handle {
  position: absolute;
  top: 50%;
  left: var(--x);
  width: 3.25rem;
  height: 3.25rem;
  margin: -1.625rem 0 0 -1.625rem;
  border: 1px solid var(--paper);
  border-radius: 50%;
  background: var(--veil);
  cursor: ew-resize;
  touch-action: pan-y;
}
.compare-handle::before,
.compare-handle::after {
  content: "";
  position: absolute;
  top: 50%;
  width: .5rem;
  height: .5rem;
  margin-top: -.25rem;
  border: solid var(--brass-light);
  border-width: 0 0 1.5px 1.5px;
}
.compare-handle::before { left: .9rem; transform: rotate(45deg); }
.compare-handle::after { right: .9rem; transform: rotate(-135deg); }

.tag {
  position: absolute;
  bottom: var(--edge-b);
  display: flex;
  align-items: center;
  gap: var(--gap-3);
  min-height: var(--row-h);
  text-shadow: var(--shadow-text);
}
.tag-left { left: var(--gutter); }
.tag-right { right: var(--gutter); }

/* Light: five stills of one view. js/studio.js stacks the chosen still on top and opens it as a growing
   circle, and moves the marker along the line to the chosen hour. */
.light-view { position: absolute; inset: 0; background: var(--ink); }
.light-view > *,
.light-view img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hours {
  position: absolute;
  left: 0;
  right: 0;
  bottom: var(--edge-b);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  width: fit-content;
  max-width: calc(100% - var(--gutter) * 2);
  margin-inline: auto;
  border-top: 1px solid var(--line-strong);
  pointer-events: auto;
}
.hour {
  min-height: var(--tap);
  padding: .35rem clamp(.6rem, 1.6vw, 1.4rem) 0;
  border: 0;
  background: none;
  color: var(--text-dim);
  text-shadow: var(--shadow-text);
  white-space: nowrap;
  cursor: pointer;
  transition: color var(--dur-fast) var(--ease);
}
.hour:hover,
.hour[aria-pressed="true"] { color: var(--text); }
.hours-mark {
  position: absolute;
  top: -2px;
  left: 0;
  width: var(--mark-w, 0px);
  height: 3px;
  background: var(--brass-light);
  transform: translate3d(var(--mark-x, 0px), var(--mark-y, 0px), 0);
  pointer-events: none;
}
.hours.is-set .hours-mark { transition: transform var(--dur-mark) var(--ease), width var(--dur-mark) var(--ease); }
html:not(.js) .hour[aria-pressed="true"] { box-shadow: inset 0 2px 0 var(--brass-light); }

/* Estimator, on pine at night: the same dark family as the film around it, so no section changes the page's
   colour. Choices across the top, the answer under them, then the programme.
   Taller than the screen on small phones: it then scrolls to its end before it pins. */
.hold-paper { --hold: 2.4; background: var(--pine-deep); color: var(--text); }
.pin-paper {
  top: min(0px, calc(var(--screen-s) - var(--pin-h, 0px)));   /* --pin-h: content height, set by js/main.js */
  display: grid;
  align-content: center;
  height: auto;
  min-height: var(--screen);
  overflow: visible;
  background:
    radial-gradient(90% 60% at 50% 0%, rgba(176, 138, 87, .14), rgba(176, 138, 87, 0) 70%),
    linear-gradient(to bottom, var(--ink), var(--pine-deep) 38%);
}

.estimate {
  width: min(100%, 78rem);
  margin-inline: auto;
  padding: calc(var(--nav-h) + var(--gap-4)) var(--gutter) var(--gap-6);
}
.estimate h2 { margin-bottom: var(--gap-6); font-size: var(--size-h2); text-align: center; }

.estimate-inputs {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.45fr) minmax(0, 1.25fr);
  border-block: 1px solid var(--line-mid);
}
.field { padding: var(--gap-5) clamp(1rem, 2.2vw, 2.25rem); }
.field:first-child { padding-left: 0; }
.field:last-child { padding-right: 0; }
.field + .field { border-left: 1px solid var(--line); }
.field-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--gap-4); }
.field-label { display: block; margin-bottom: var(--gap-3); color: var(--text-dim); }
.field-head .field-label { margin-bottom: 0; }
.field-value { font: 400 var(--size-value) / 1 var(--font-display); font-variant-numeric: lining-nums tabular-nums; color: var(--brass-light); }

.chips { display: grid; gap: var(--gap-2); }
.chips-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.chips-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.chip {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: .3rem;
  min-height: 3.75rem;
  padding: .6rem .85rem;
  border: 1px solid var(--line-mid);
  border-radius: var(--radius);
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}
.chip:hover { border-color: var(--text); }
.chip[aria-checked="true"] { background: var(--brass-light); border-color: var(--brass-light); color: var(--ink); }
.chip-name { font: 600 var(--size-chip-name) / 1.15 var(--font-text); }
.chip-note { font: 500 var(--size-note) / 1.2 var(--font-text); font-variant-numeric: tabular-nums; opacity: .82; }

.range { -webkit-appearance: none; appearance: none; display: block; width: 100%; height: 2.5rem; margin: 0; background: transparent; cursor: pointer; }
.range::-webkit-slider-runnable-track { height: 2px; background: linear-gradient(to right, var(--brass-light) var(--fill, 0%), var(--line-mid) var(--fill, 0%)); }
.range::-moz-range-track { height: 2px; background: var(--line-mid); }
.range::-moz-range-progress { height: 2px; background: var(--brass-light); }
.range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 1.25rem;
  height: 1.25rem;
  margin-top: calc(1px - .625rem);
  border: 0;
  border-radius: 50%;
  background: var(--brass-light);
}
.range::-moz-range-thumb { box-sizing: border-box; width: 1.25rem; height: 1.25rem; border: 0; border-radius: 50%; background: var(--brass-light); }
.range:focus-visible { outline: none; box-shadow: none; }
.range:focus-visible::-webkit-slider-thumb { outline: 2px solid var(--brass-light); outline-offset: 3px; }
.range:focus-visible::-moz-range-thumb { outline: 2px solid var(--brass-light); outline-offset: 3px; }
.range-ends { display: flex; justify-content: space-between; font: 500 var(--size-note) / 1 var(--font-text); font-variant-numeric: tabular-nums; color: var(--text-dim); }

.estimate-result { margin-top: var(--gap-5); }
.figures { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; column-gap: var(--gap-6); }
.figure dt { color: var(--text-dim); }
.figure dd {
  margin-top: var(--gap-2);
  font: 300 var(--size-figure) / 1 var(--font-display);
  font-variant-numeric: lining-nums tabular-nums;
  letter-spacing: -.02em;
  white-space: nowrap;
}
.figure-months { text-align: right; }

/* Programme: each phase starts where the one before ends; the track is the longest build this estimator can give. */
.programme { --phase-name: 7.25rem; --phase-time: 3.75rem; margin-top: var(--gap-5); }
.phases-title { margin-bottom: var(--gap-2); }
.phases li {
  display: grid;
  grid-template-columns: var(--phase-name) minmax(0, 1fr) var(--phase-time);
  column-gap: var(--gap-4);
  align-items: center;
  min-height: 2rem;
  font: 500 var(--size-ui) / 1 var(--font-text);
}
.phases li + li { border-top: 1px solid var(--line); }
.phase-track { position: relative; height: .5rem; }
.phase-track i {
  position: absolute;
  top: 0;
  bottom: 0;
  left: calc(var(--start) * 100%);
  width: calc(var(--span) * 100%);
  background: var(--brass-light);
  transition: left var(--dur-base) var(--ease), width var(--dur-base) var(--ease);
}
.phase-time { text-align: right; font-variant-numeric: tabular-nums; color: var(--text-dim); }
.phases-axis {
  display: flex;
  justify-content: space-between;
  margin: var(--gap-2) calc(var(--phase-time) + var(--gap-4)) 0 calc(var(--phase-name) + var(--gap-4));
  padding-top: var(--gap-2);
  border-top: 1px solid var(--line-mid);
  font: 500 var(--size-note) / 1 var(--font-text);
  font-variant-numeric: tabular-nums;
  color: var(--text-dim);
}
.fineprint { margin-top: var(--gap-4); font: 400 var(--size-note) / 1.4 var(--font-text); color: var(--text-dim); }

/* ---------- panels arrive: js/main.js sets "is-in" while a panel's section is across the middle of the screen ---------- */

/* Each part rises into place a beat after the one before it, and goes back the same way when the panel leaves. */
.js .hold .panel-head,
.js .hold .hours,
.js .hold .tag,
.js .hold .compare-handle,
.js .estimate > h2,
.js .estimate-inputs,
.js .figures,
.js .programme,
.js .fineprint {
  opacity: 0;
  transform: translate3d(0, var(--rise), 0);
  transition: opacity var(--dur-arrive) var(--ease), transform var(--dur-arrive) var(--ease);
}
.js .hold.is-in .panel-head,
.js .hold.is-in .hours,
.js .hold.is-in .tag,
.js .hold.is-in .compare-handle,
.js .hold.is-in .estimate > h2,
.js .hold.is-in .estimate-inputs,
.js .hold.is-in .figures,
.js .hold.is-in .programme,
.js .hold.is-in .fineprint { opacity: 1; transform: none; }
.js .hold.is-in .hours,
.js .hold.is-in .tag,
.js .hold.is-in .compare-handle,
.js .hold.is-in .estimate-inputs { transition-delay: var(--dur-stagger); }
.js .hold.is-in .figures { transition-delay: calc(var(--dur-stagger) * 2); }
.js .hold.is-in .programme { transition-delay: calc(var(--dur-stagger) * 3); }
.js .hold.is-in .fineprint { transition-delay: calc(var(--dur-stagger) * 4); }

/* The programme's bars draw from the left once their rows are in. */
.js .phase-track { transform: scaleX(0); transform-origin: left center; transition: transform var(--dur-reveal) var(--ease); }
.js .hold.is-in .phase-track { transform: none; transition-delay: calc(var(--dur-stagger) * 4); }

/* ---------- closing ---------- */

/* The closing block stands under the lit house, on the bottom row, with the fine print in the row's left
   corner (where the film has its stage label). Narrower windows stack them: see "under 1100px". */
.cue-close { --cue-w: 70rem; bottom: var(--close-b); }           /* wide enough for the statement on one line at its largest one-line size */
.cue-close h2 { font-size: var(--size-close); line-height: .96; letter-spacing: -.022em; }
.cue-close .script { margin-top: .05em; font-size: var(--size-close-script); }
.cue-close .btn { margin-top: var(--gap-4); }

.foot {
  position: absolute;
  left: var(--gutter);
  bottom: var(--edge-b);
  max-width: calc(50% - var(--gutter) - 10rem);             /* ends well short of the button on the page's axis */
  font: 400 var(--size-note) / 1.4 var(--font-text);
  text-wrap: balance;
  text-shadow: var(--shadow-text);
  color: var(--text-dim);
}

/* ---------- under 1100px: captions sit above the bottom row; the estimator's choices take two rows ---------- */

@media (max-width: 1099px) {
  :root {
    --cue-b: calc(var(--edge-b) + var(--row-h) + var(--gap-4));
    --close-b: calc(var(--edge-b) + var(--row-h) + var(--gap-5));
  }
  .cue-welcome { bottom: var(--cue-b); }
  .stage .shade::after { background: linear-gradient(to top, rgba(var(--shade), .7), rgba(var(--shade), .45) 30%, rgba(var(--shade), 0) 50%); }   /* captions stand higher here, and their shade with them */
  .foot { right: var(--gutter); max-width: none; text-align: center; }          /* the fine print, centred under the closing block */

  .estimate h2 { margin-bottom: var(--gap-5); }
  .estimate-inputs { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); }
  .field { padding-block: var(--gap-4); }
  .field-area { grid-column: 1 / -1; padding-inline: 0; border-bottom: 1px solid var(--line); }
  .field-area + .field { padding-left: 0; border-left: 0; }
}

/* ---------- phone ---------- */

@media (max-width: 759px) {
  :root {
    --nav-h: 3.75rem;
    --size-hero: clamp(2rem, 10.2vw, 3rem);                 /* "A house that belongs" still fits one line */
    --size-close: clamp(2rem, 9.6vw, 3rem);
    --size-script: clamp(2.1rem, 10vw, 2.9rem);
    --size-hero-script: var(--size-script);                 /* a script line needs its size here: both sign at the common one */
    --size-close-script: var(--size-script);
    --size-script-xl: clamp(2.9rem, 15vw, 4.75rem);         /* two lines: "Welcome to" over "the lake." */
    --size-lede: 1rem;
    --size-wordmark: 1.3rem;
    --rule-w: 1.25rem;
    --gap-6: 1.75rem;
  }

  .nav { display: flex; justify-content: space-between; }
  .nav-links, .nav-cta { display: none; }
  .menu-toggle { display: block; }

  .cue-hero .script { padding-left: 0; }
  .cue-text { margin-top: var(--gap-4); }
  .stage-key { display: none; }                             /* the rule and the stage name are enough here */

  .facts li { padding: 0 var(--gap-2); gap: var(--gap-2); }
  .fact-label { font-size: var(--size-ui); }

  .panel-head { top: calc(var(--nav-h) + var(--gap-2)); }
  .hours { width: auto; max-width: none; left: var(--gutter); right: var(--gutter); justify-content: space-between; }
  .hour { padding-inline: .3rem; letter-spacing: .08em; }

  .scrub.is-fallback .stage,
  html:not(.js) .stage { background-image: url("../img/m/poster.webp"); }

  .cue-close .btn,
  .menu-links .btn { width: 100%; }

  .estimate { padding-top: calc(var(--nav-h) + var(--gap-2)); padding-bottom: var(--gap-5); }
  .estimate h2 { margin-bottom: var(--gap-4); }
  .estimate-inputs { grid-template-columns: minmax(0, 1fr); }
  .field { padding: var(--gap-4) 0; }
  .field + .field { border-left: 0; border-top: 1px solid var(--line); }
  .field-area { border-bottom: 0; }
  .chip { min-height: 3.5rem; padding: .5rem .65rem; }
  .estimate-result { margin-top: var(--gap-4); }
  .programme { --phase-name: 6.5rem; --phase-time: 3.25rem; margin-top: var(--gap-4); }
  .phases li { min-height: 1.8rem; column-gap: var(--gap-3); }
  .phases-axis { margin-left: calc(var(--phase-name) + var(--gap-3)); margin-right: calc(var(--phase-time) + var(--gap-3)); }
}

/* ---------- the smallest phones (320 to 359px wide) ----------
   The bottom row of the film has no room for both the stage and the scroll hint: the hint gives way (the
   hero says "scroll" by itself). The five hours stay on one line with tighter letters and padding. */
@media (max-width: 359px) {
  .hint { display: none; }
  .hours { left: .75rem; right: .75rem; max-width: none; flex-wrap: nowrap; }
  .hour { padding-inline: .15rem; letter-spacing: .03em; }
}

/* ---------- landscape phone ---------- */

@media (max-height: 520px) and (orientation: landscape) {
  :root {
    --nav-h: 3.25rem;
    --size-hero: clamp(1.7rem, 9.5vh, 2.6rem);
    --size-h2: clamp(1.5rem, 8vh, 2.2rem);
    --size-figure: clamp(1.8rem, 10vh, 2.6rem);
    --size-fact: clamp(1.8rem, 11vh, 2.6rem);
    --size-script: clamp(1.7rem, 9vh, 2.4rem);
    --size-hero-script: var(--size-script);
    --size-close-script: var(--size-script);
    --size-script-xl: clamp(2.4rem, 17vh, 4rem);
    --size-lede: .95rem;
    --size-menu: 1.4rem;
    --gap-6: 1.25rem;
    --gap-5: 1rem;
  }

  .cue-text { margin-top: var(--gap-3); }
  .kicker { margin-bottom: var(--gap-2); }
  .cue-hero .script { margin-top: -.2em; }
  .hint-line { display: none; }
  .menu { padding-top: calc(var(--nav-h) + var(--gap-2)); }
  .menu-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--gap-6); }
  .menu-links a:not(.btn) { min-height: 3rem; }
  .menu-links a:not(.btn) + a:not(.btn) { border-top: 0; }
  .menu-links .btn { grid-column: 1 / -1; margin-top: var(--gap-4); }
  .cue-close .btn { width: auto; }
}

/* ---------- reduced motion: the same overrides for the system setting and for html.calm (forced by ?poster=1) ---------- */

@media (prefers-reduced-motion: reduce) {
  :root { --dur-fast: 1ms; --dur-base: 1ms; --dur-mark: 1ms; --dur-cue: 220ms; --dur-stagger: 0ms; --dur-panel: 1ms; --dur-arrive: 220ms; --dur-reveal: 220ms; --rise: 0px; }
  .loader-rule::after, .hint-line::after { animation: none; }
}
html.calm { --dur-fast: 1ms; --dur-base: 1ms; --dur-mark: 1ms; --dur-cue: 220ms; --dur-stagger: 0ms; --dur-panel: 1ms; --dur-arrive: 220ms; --dur-reveal: 220ms; --rise: 0px; }
html.calm .loader-rule::after,
html.calm .hint-line::after { animation: none; }

/* ---------- debug overlay (?debug=1): a developer's read-out, not part of the design ---------- */

.debug {
  position: fixed;
  right: .5rem;
  top: calc(var(--nav-h) + .25rem);
  z-index: 200;
  margin: 0;
  padding: .5rem .65rem;
  border: 0;
  background: rgba(0, 0, 0, .8);
  color: #d9ffd4;
  font: 11px / 1.5 ui-monospace, "Cascadia Mono", Consolas, Menlo, monospace;
  text-align: left;
  white-space: pre;
  cursor: pointer;
}
