/* Terrain / topo background lines — TVA Brand Identity System v2.0.
   The topographic contour pattern is the brand's DEFINING texture, but per
   brand rule it belongs ONLY on the navy/black gradient background — never
   on a light/white page background (Ryan, Jul 14 2026: "there shouldn't be
   topography lines on the [light] backgrounds... only on the blue/black
   gradient backgrounds"). This fixed body::before layer used to render at low
   opacity in light mode too, which bled faint contour lines into every light
   card/section site-wide (testimonial quotes included). Light mode's page
   background is the white/off-white gradient (see styles/index.css), not
   navy — so it now gets zero topo. Dark mode's page background IS the navy
   gradient, so its topo stays. */

body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url("/assets/terrainLines.png");
  background-size: cover;
  background-position: center;
  pointer-events: none;
  z-index: 0;
}

/* Light mode: ZERO topo opacity — standing rule (Ryan, Jul 13 2026, restated in
   CLAUDE.md's Brand Identity & Visual System as superseding any prior "10%/15%"
   spec). This was briefly reverted to 0.15 on Jul 19 2026 to chase a report that
   topo was "missing from the homepage" — but the homepage's navy sections
   (NAVY_SECTION_BG, apps/consumer/src/domains/marketing/components/brand-home/
   primitives.tsx) already bake their own topo-white-soft.png directly into the
   section background, independent of this global body::before layer, so raising
   light-mode opacity here did nothing for that and instead bled contour lines
   through every white/off-white section site-wide (reported broken again by
   Ryan, Jul 19 2026 — careers page and others). Section-to-section separation on
   light pages comes from alternating flat background-color between sections
   (white / off-white / neutral), never from this texture. If a navy section is
   missing its topo, fix that section's own background-image — do not re-zero
   this rule to compensate. */
.light body::before,
[data-theme="light"] body::before,
body::before {
  opacity: 0;
}

/* Dark mode: the ONLY place the topo texture shows, over the navy-to-black
   gradient page background. Inverted to light contour lines, blended so they
   read as glowing hairlines against the navy. */
.dark body::before,
[data-theme="dark"] body::before {
  filter: invert(1) grayscale(1);
  mix-blend-mode: screen;
  opacity: 0.14;
}

/* ---------------------------------------------------------------------------
   LEGACY HOMEPAGE SCOPE — body.legacy-home is set by ConsumerLayout on "/" only.
   Tyler's restored pre-design-v2 homepage (commit 63542686b) uses the ORIGINAL
   texture values below; every other route keeps the design-v2 values above.
   Keep these rules LAST in the file — they win specificity ties by source order.
   Light mode gets zero topo here too, same brand rule as above — its page
   background isn't navy either. */
body.legacy-home::before {
  background-position: 0% 0%; /* pre-v2 default (no center) */
  opacity: 0; /* same brand spec as the design-v2 rule above — see note there */
}
.dark body.legacy-home::before,
[data-theme="dark"] body.legacy-home::before {
  filter: invert(1);
  mix-blend-mode: normal;
  opacity: 0.1;
}

/* ---------------------------------------------------------------------------
   FOOTER EXCEPTION (Ryan, Jul 14 2026 — standing site-wide design rule):
   the footer never shows topo, full stop — even though its background is
   navy/black like the sections that ARE allowed topo. The <footer> element's
   own opaque background already blocks the fixed body::before layer behind
   it (confirmed: dark-mode global topo does not visually bleed under the
   real footer on any tested page), and no page should ever add its own
   `.vab-topo` div inside a footer. This rule is a permanent guardrail against
   a future footer restyle accidentally reintroducing it — not a fix for an
   observed break. */
footer .vab-topo,
footer::before {
  opacity: 0 !important;
}
