/* ============================================================================
   Caledapt — persistent scenic world
   ----------------------------------------------------------------------------
   ONE landscape for the whole homepage. It is a fixed, home-only, decorative
   stage that sits behind every section, so the page reads as a single place
   rather than a stack of independently-backgrounded sections.

   Why fixed and not sticky-per-section: the previous build gave each section
   its own scenery, so scrolling produced "section / background / section /
   background" and the visual states appeared compiled on top of each other.
   A single fixed layer removes that by construction — there is physically only
   one landscape on the page.

   The arc, per the brief:
     0-15%   full scenic presence (hero)
     15-45%  scrollytelling transformations
     45-65%  heavily darkened behind evidence / engagement / gateway
     65-88%  very subdued behind pricing / FAQ / reading
     88-100% opens back up for founder / final CTA

   Driven entirely by CSS custom properties written from one rAF loop, so
   there is no layout thrash and no per-element JS.

   Reduced motion: the stage stops tracking entirely and falls back to a
   static, gentle vignette. No sticky trap, no drift.
   ============================================================================ */

.world {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  background: var(--ink-950);
  contain: strict;
}

.world__photo,
.world__video-picker img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 62% 46%;
}

/* A subtle scanline-free "grain" is deliberately absent: it read as a scaled
   image artefact at large sizes, which is exactly what the brief rejected. */

/* ---------------------------------------------------------------------------
   Everything on the page sits above the world.
   --------------------------------------------------------------------------- */
/* THE HEADER EXCLUSION IS LOAD-BEARING.

   This was `.page > *`, which matched .site-header and overrode its
   `position: fixed` on source order -- world.css loads after site.css. The nav
   then scrolled away with the document: measured header top travelling
   24px -> -15812px across a single page. The header is fixed-position chrome,
   not content, so it is excluded here. */
.page > *:not(.site-header):not(.mobile-nav) { position: relative; z-index: 1; }

/* Restated where source order cannot overrule it. */
.site-header { position: fixed; inset: 0 0 auto 0; }

/* Sections that must stay fully legible over the photograph. */
.solid-surface {
  background: linear-gradient(to bottom, var(--ink-950), var(--ink-900) 40%, var(--ink-950));
}
/* Excluded: see design-system.css. Body-level widgets (the Ask Caledapt
   launcher/panel) must keep their own positioning. */
.solid-surface > *:not(.rag-launcher):not(.rag-panel):not(.mobile-nav) { position: relative; z-index: 1; }

/* ---------------------------------------------------------------------------
   Reduced motion: no drift, no zoom, no sticky trap. The landscape stays as a
   static backdrop at a readable, gentle level of darkening.
   --------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .world { position: fixed; }
  .world__photo {
    transform: none;
    opacity: 0.5;
    will-change: auto;
  }
  }

/* ---------------------------------------------------------------------------
   Mobile: keep the scene, drop the expensive choreography. No zoom, no drift,
   and a flatter darkening so text contrast never depends on the photograph.
   --------------------------------------------------------------------------- */
@media (max-width: 768px) {
  .world__photo {
    inset: 0;
    width: 100%;
    height: 100%;
    transform: none;
    object-position: 58% 40%;
    opacity: 0.42;
  }
  }

/* ---------------------------------------------------------------------------
   Print and forced-colors: drop the scenery entirely, keep the text.
   --------------------------------------------------------------------------- */
@media print {
  .world { display: none; }
}

@media (forced-colors: active) {
  .world { display: none; }
}