/* 2026-10-29 rebuild. Owned by the Flow builder (see site-work/_ref/BRIEF.md). */
/* ═══════════════════════════════════════════════════════════════════
   flow.css: the journey between sections. Motion and measuring live in
   flow.js; this file only holds what that script creates or marks while
   it runs (the fl- classes). Without JS, without GSAP, or
   with reduced motion, nothing below applies and the page keeps its own
   flat off-white ground.

   Stacking, from the back:
     1. the hero (z auto), then .fl-veil (fixed, z 1) dimming it
     2. .w-world (z 2): its own background, then .fl-paper at z -999
        inside it, then every section on top
     3. the nav (z 100)
   ═══════════════════════════════════════════════════════════════════ */

/* The paper: one layer at the very back of the white world, part of the
   page, so it scrolls with it and costs nothing while scrolling. Its own
   compositing layer, so a sheet that moves never repaints the sections. */
.fl-paper {
  position: absolute;
  inset: 0;
  z-index: -999;
  pointer-events: none;
  contain: strict;
  will-change: transform;
}

/* A sheet: one section's tinted paper, its top edge rounded like the
   white world's own edge. flow.js sets its place, height and colour. */
.fl-sheet {
  position: absolute;
  left: 0;
  right: 0;
  border-radius: var(--fl-r, 40px) var(--fl-r, 40px) 0 0;
}
/* 'wash' mode: one sheet for the whole world, its colour turning. */
.fl-wash {
  top: 0;
  bottom: 0;
  border-radius: 0;
}

/* The veil: dims the night while the white world rises over it. The world
   paints over it everywhere below its rounded edge. */
.fl-veil {
  position: fixed;
  left: 0;
  right: 0;
  top: -100px;
  height: calc(100vh + 200px);
  z-index: 1;
  pointer-events: none;
  contain: strict;
  background-color: #040506;
  opacity: 0;
  visibility: hidden;
}

/* Where a section grows from as it arrives (its top edge's centre), and
   where it settles toward as you leave it (its bottom edge's centre). */
.fl-rise { transform-origin: 50% 0; }
.fl-sink { transform-origin: 50% 100%; }
.fl-hero { transform-origin: 50% 100%; will-change: transform; }

/* chapter-flow.css gives several sections a near-white wash made for the
   old flat ground. flow.js adds this class only to sections where that
   exact wash is still the one winning, so a background a section builder
   sets on purpose is never touched. */
.fl-bare { background-image: none !important; }

/* The nav keeps its dark glass, so it reads over every colour; the glass
   takes a deep shade of the section under it. */
nav.top.fl-tint.scrolled { background: var(--fl-nav, rgba(8, 11, 16, 0.88)); }

/* Printed, the page is the plain page. */
@media print {
  .fl-paper, .fl-veil { display: none !important; }
  .fl-rise, .fl-sink, .fl-hero { transform: none !important; }
}
