/**
 * Bitnnock "Living Ledger" sitewide background.
 * A scroll-linked animated particle network (drifting dots, distance-
 * based connecting lines, and traveling energy packets, all drawn on
 * a <canvas>) that lives behind every page's content - home, dashboard,
 * wallet, trade room, marketplace, auth, KYC, support, settings, and
 * every other page rendered through the shared frontend layout.
 *
 * This system originally also included a perspective floor grid,
 * drifting blurred orbs, straight light beams, and a winding SVG
 * "circuit" path with rings/pulsing nodes. Each was removed after
 * review: the grid and beams read as generic "AI-generated template"
 * cliches, orbs muddied the pure black backdrop with a gold wash,
 * and the circuit's curved lines drew the same "stray diagonal line
 * crossing empty black space" complaint as the beams. Their rules are
 * kept as `display: none` rather than deleted so the markup in every
 * template doesn't need to change.
 *
 * Nothing about the existing design is changed: every card, panel, and
 * piece of content keeps its exact black background, spacing, and
 * styling. This file only (a) draws the animation inside the
 * .bn-market-flow wrapper added around @yield('content') in
 * frontend.blade.php, and (b) makes each page's own outer content
 * shell transparent so that animation is visible behind it, exactly
 * the way the original black canvas looked before - just alive now
 * instead of flat. Individual cards/panels inside each page are
 * untouched and keep their own solid black background.
 */

.bn-market-flow {
  --bn-flow-progress: 0;
  --bn-flow-ring-scale: 0.88;
  position: relative;
  /*
   * No isolation:isolate here. Bootstrap opens some modals in place
   * (data-bs-toggle) while their backdrop is appended to <body>; an
   * isolated wrapper would trap those modals (z-index 1055) below the
   * body-level backdrop (z-index 1050), leaving them dimmed and
   * unusable. The animated .bn-market-flow__visual layer creates its
   * own stacking context via z-index, so the blend/front effect is
   * unaffected by dropping isolation.
   *
   * overflow-x:clip stays: the orbs intentionally hang past the left and
   * right edges, and without clipping they would widen the page and
   * cause horizontal scrolling on mobile. overflow-y must stay visible
   * (not clip/hidden) - this element is also a flex child (see
   * `flex: 1 0 auto` below for .pw-home), and per the flexbox spec a
   * flex item's automatic minimum size collapses to 0 whenever its
   * overflow is anything other than visible. With overflow-y:clip that
   * collapse let this wrapper shrink to the viewport height instead of
   * growing to fit its real content, silently clipping away every
   * section past the first screen. Splitting the axes keeps the
   * horizontal clipping while restoring correct content-based height.
   */
  overflow-x: clip;
  overflow-y: visible;
  background: #13100d;
}

.bn-market-flow::before,
.bn-market-flow::after {
  content: "";
  position: absolute;
  z-index: 0;
  right: 0;
  left: 0;
  height: 240px;
  pointer-events: none;
}

.bn-market-flow::before {
  top: 0;
  /*
   * Shortened from a 240px fade so the nav bar - which sits fixed
   * directly over this exact region on every page - shows the
   * animation immediately instead of only after scrolling past the
   * old, taller fade zone.
   */
  height: 64px;
  background: linear-gradient(180deg, #13100d, transparent);
}

.bn-market-flow::after {
  bottom: 0;
  background: linear-gradient(0deg, #13100d, transparent);
}

.bn-market-flow__visual {
  /*
   * Raised from z-index:0 so this whole layer (a stacking-context unit,
   * since it's positioned with its own z-index) paints in front of the
   * yielded content sections instead of behind them - the canvas
   * particle network then blends on top of cards via mix-blend-mode
   * instead of being fully hidden behind their solid backgrounds.
   */
  position: sticky;
  z-index: 6;
  top: 0;
  width: 100%;
  height: 100svh;
  margin-bottom: -100svh;
  overflow: hidden;
  pointer-events: none;
  /* No tinted wash - the backdrop stays pure black; only the drawn
     particles and connections carry color. */
  background: none;
}

.bn-market-flow__visual::before,
.bn-market-flow__visual::after {
  content: "";
  position: absolute;
  /* z-index:7 (not 1) so these still paint on top of .bn-market-flow__canvas
     (z-index:6, both compared inside this element's own local stacking
     context) now that the canvas paints an opaque fill - see the canvas
     rule below. At the old z-index:1 they'd otherwise be silently buried
     under that opaque fill instead of layering over it like they always
     visually have. */
  z-index: 7;
  pointer-events: none;
}

.bn-market-flow__visual::before {
  inset: 8% 0;
  /* The pair of vertical accent lines this used to draw at 8%/92% (via a
     90deg gradient) read as a stray hairline seam that didn't blend into
     the page - the same "stray line crossing empty space" complaint that
     already got the beams/circuit/grid removed above. Only that 90deg
     layer is dropped; the 180deg horizontal glow band stays. */
  background: linear-gradient(180deg, transparent, rgba(236, 232, 224, 0.025) 50%, transparent);
  mask-image: linear-gradient(transparent, #000 18%, #000 82%, transparent);
}

.bn-market-flow__visual::after {
  top: 50%;
  left: 50%;
  width: min(78vw, 920px);
  aspect-ratio: 1;
  border: 1px solid rgba(236, 196, 108, 0.06);
  border-radius: 50%;
  /* Halo shadows removed - they added a diffuse gold tint to the
     black backdrop. The thin ring outline stays. */
  transform: translate(-50%, -50%) scale(var(--bn-flow-ring-scale));
  opacity: 0.72;
}

.bn-market-flow__grid {
  /* Removed: a receding perspective floor grid reads as a generic,
     "AI-generated tech background" cliché rather than a bespoke effect.
     The particle network carries the scene on its own. Element is kept
     (rather than removed from every template) so nothing needs to
     change beyond this one rule. */
  display: none;
}

.bn-market-flow__canvas {
  position: absolute;
  z-index: 6;
  inset: 0;
  width: 100%;
  height: 100%;
  /*
   * Opaque now (was opacity:0.35 + mix-blend-mode:screen) - painting its
   * own wallpaper-tone fill instead of staying a faint see-through sheet.
   * This canvas sits BEHIND every section/app shell (those are all
   * z-index:7 - custom.css' [data-pw-section] rule and the .pw-app/
   * .p2p-dash/.wlf-auth/etc. rule below - vs. this element's z-index:6),
   * so unlike the footer/drawer copies just below - which sit IN FRONT of
   * real, readable text and must stay see-through - this one can safely
   * BE the backdrop rather than a separate hazy layer floating on top of
   * a same-colored parent. That's also what makes the particles read as
   * more present ("more to the front") without touching a single alpha
   * value in the JS: they were always drawn at these exact colors/alphas,
   * just multiplied down by the old 0.35 container opacity afterward -
   * removing that multiplier (and the screen blend, which would otherwise
   * double-lighten this fill against the identical #13100d showing
   * through .bn-market-flow around it - screen(c,c) is noticeably
   * brighter than c, which would read as a seam) is the entire effect.
   */
  opacity: 1;
  mix-blend-mode: normal;
  background:
    radial-gradient(ellipse 90% 55% at 50% 0%, rgba(236, 196, 108, 0.05), transparent 65%),
    #13100d;
  pointer-events: none;
  /* Soft edge falloff (not a hard vignette box-shadow) - fades the
     canvas's own alpha near the frame edges so the scene reads as a lit,
     receding 3D space instead of a flat tile of dots, without touching
     the shared markup this canvas is embedded in across half a dozen
     layouts. Still safe now that the fill is opaque: what's revealed
     underneath at the faded edge is .bn-market-flow's own identical
     #13100d, so the fade reads only as the particles/gradient dimming,
     never as a color seam. */
  mask-image: radial-gradient(120% 100% at 50% 42%, #000 62%, rgba(0, 0, 0, 0.78) 100%);
  -webkit-mask-image: radial-gradient(120% 100% at 50% 42%, #000 62%, rgba(0, 0, 0, 0.78) 100%);
}

/*
 * Footer/drawer copies sit IN FRONT of real, readable content (footer
 * links/copyright, drawer nav - see each variant's own rule further
 * below), not behind a matching-tone wallpaper, so the original
 * translucent/screen-blended treatment has to stay here or an opaque
 * canvas would black out the text underneath it. Two classes outranks
 * the bare element selector above regardless of source order, so this
 * reliably wins for just these two cases.
 */
.bn-market-flow--footer .bn-market-flow__canvas,
.bn-market-flow--drawer .bn-market-flow__canvas {
  background: transparent;
  opacity: 0.35;
  mix-blend-mode: screen;
}

.bn-market-flow__orb {
  /* Removed: the blurred orbs painted large diffuse gold clouds
     across the backdrop. Background stays black now; only the crisp
     canvas particles remain. */
  display: none;
}

.bn-market-flow__orb--one {
  top: 3%;
  left: -22%;
  background: #ecc46c;
  transform: translate3d(var(--bn-flow-orb-one-x), var(--bn-flow-orb-one-y), 0);
  animation: bnFlowOrbOne 16s ease-in-out infinite alternate;
}

.bn-market-flow__orb--two {
  right: -26%;
  bottom: -5%;
  background: #b4834a;
  transform: translate3d(var(--bn-flow-orb-two-x), var(--bn-flow-orb-two-y), 0);
  animation: bnFlowOrbTwo 19s ease-in-out infinite alternate;
}

.bn-market-flow__beam {
  /* Removed: a lone thin diagonal line reads as a stray artifact rather
     than a deliberate effect, especially in the empty stretches between
     sections where nothing else is on screen to give it context. */
  display: none;
}

.bn-market-flow__circuit {
  /* Removed: the winding ghost/live/rail paths plus their ring and
     node markers read as thin stray diagonal lines wherever they cross
     a plain black section - the same complaint as the light beams, just
     curved instead of straight. The particle canvas (drifting dots,
     connections, and traveling energy packets) is now the entire
     visual on its own. */
  display: none;
}

/*
 * Reveal the animation through the homepage section wrappers. These
 * selectors intentionally match the ones already forcing a solid
 * black background in custom.css (same specificity, same #live-terminal
 * exclusion), and this file loads after custom.css, so this simply
 * wins the tie and swaps that black fill for the animated one behind
 * it. Nothing about spacing, borders, radius, or hover states changes,
 * and every inner card/panel inside these sections keeps its own solid
 * black background exactly as before.
 */
.pw-home [data-pw-section]:not(#live-terminal),
.pw-home [data-pw-section]:not(#buy-sell):not(#live-terminal),
.pw-home #buy-sell {
  background: transparent !important;
  background-image: none !important;
}

/*
 * Section 9's two graphics (the "Data Not Collected" phone screenshot and
 * the faceid_v3 scan gif) are legacy template exports flattened onto a
 * solid opaque #000 canvas, not a real transparent one - confirmed by
 * inspecting both files' pixels, which sample as pure (0,0,0) outside
 * their subject with alpha 255 throughout. Section-9 used to be an opaque
 * homepage "floating slab" section painted with --bn-panel-gradient
 * (#1c1712 - a shade lighter than the #13100d page tone, so cards read as
 * raised above the page). Sitting inside that, the graphics' flat
 * true-black canvas read as a hard rectangle instead of blending into
 * the panel like every other panel did.
 *
 * The phone screenshot (a static PNG) is fixed permanently at the asset
 * level: every pixel that was pure background has been replaced with a
 * flat fill color, baked directly into the file (originally
 * max(pixel, #1c1712) per channel - the exact result `mix-blend-mode:
 * lighten` against the section's old opaque panel tone would have
 * produced; re-baked to a flat #13100d fill - see note below the rule -
 * once section-9 itself went transparent). The flat black canvas around
 * the card is now literally that fill color with real opaque pixels; the
 * subject (card grey, white/blue text and icon) was always brighter than
 * the fill on every channel, so exact-color-match replacement leaves it
 * untouched. This is intentionally NOT done with a runtime blend mode -
 * it was found to occasionally repaint back to solid black when
 * interacting with the hero's Spline <iframe> above (iframes always get
 * their own compositing layer, and mix-blend-mode blending across a
 * layer boundary next to one is a known class of Chromium compositor
 * bugs that don't show up in every GPU/driver combo, which made it
 * unreproducible in automated testing but very reproducible for at least
 * one real user). Baking the result into the pixels removes the runtime
 * blend entirely, so there is nothing left for that class of bug to
 * disrupt.
 *
 * The faceid_v3 gif (152 animated frames) can't get the same treatment
 * safely - round-tripping it through Pillow to rewrite every frame's
 * pixels silently dropped a frame and doubled the per-frame duration
 * (152 frames @ 30ms -> 151 @ 60ms), which would have halved the
 * animation's speed. Since that's a worse regression than the bug it'd
 * fix, it still uses mix-blend-mode: lighten, but is hardened against
 * the same compositing bug by forcing its column onto its own stable GPU
 * layer (transform/will-change below) - the standard remedy for
 * mix-blend-mode failing to recomposite correctly near an unrelated
 * layer boundary changing elsewhere on the page.
 *
 * Both blends (baked-in and live) need something opaque to reconcile
 * against, and section-9 has `isolation: isolate` (further up, the
 * homepage "floating slab" rule) - isolation makes the group's own
 * internal backdrop start fully transparent regardless of what's set
 * further up the cascade, so a blend has nothing to compare against and
 * silently no-ops, leaving raw near-black pixels on screen (confirmed
 * with a minimal repro: a `lighten` child inside an isolated-but-
 * transparent parent renders unblended, while the same child inside an
 * isolated parent that has its own opaque background blends correctly).
 * Painting a backdrop directly onto each image's immediate column - still
 * inside the same isolated group, so it doesn't touch the isolation rule
 * or anything outside these two columns - gives lighten a real backdrop
 * to reconcile against.
 *
 * That backdrop is --bitnnock-bg (#13100d - the page/canvas base tone),
 * NOT --bn-panel-gradient (#1c1712, a lighter "raised panel" tone) as it
 * used to be. Section-9 was opaque with the panel tone when this rule was
 * first written, so matching that tone made these two graphics blend into
 * their own section. Section-9 (like every homepage section now) is
 * transparent so the Living Ledger canvas shows through it directly -
 * i.e. its real visible backdrop is the canvas's own #13100d fill, not
 * #1c1712 - so #1c1712 now reads as a visibly wrong-toned rectangle
 * sitting on top of the darker canvas around it. #13100d can't chase the
 * canvas's own moving particles/gradient (that's inherent to reconciling
 * an animated layer against a static image/GPU-layered blend), but it
 * matches the canvas's resting base color exactly, which is what removes
 * the hard, obviously-mismatched seam.
 */
.pw-home .section-9 .w-col:has(> img[src*="app-5-privacy"]),
.pw-home .section-9 .column-9:has(> img[src*="faceid"]) {
  background-color: var(--bitnnock-bg, #13100d);
  /* Force each onto its own stable GPU compositing layer so its blend
     result doesn't get recomputed/disrupted when the hero iframe's own
     layer changes on interaction (see comment above). */
  transform: translateZ(0);
  will-change: transform;
}

.pw-home .section-9 img[src*="faceid"] {
  mix-blend-mode: lighten;
}

/*
 * Section-9 as a whole (not just the two graphics above) kept getting
 * reported as having an inconsistent/wrong-looking background. That's
 * `.bn-market-flow__canvas`'s mix-blend-mode: screen (it leaves true
 * black untouched but visibly lifts anything above it) - the canvas is
 * painted in front of every homepage section (z-index: 6) and animates
 * continuously, so the brightness it contributes at any given instant is
 * essentially random. Confirmed by sampling the same pixel repeatedly
 * with zero interaction: 7-12 RGB values of drift, no hover needed.
 *
 * The first fix here only occluded the canvas behind section-9
 * specifically (z-index: 7, its own real background) since that's the
 * section that had been reported - it just has unusually large plain
 * background for the drift to be visible against. But the same canvas
 * sits behind *every* section, so the identical drift was measurable
 * everywhere else too, just less visible behind smaller patches of plain
 * background - it kept getting reported "in other sections" one at a
 * time. That occlusion is now the default for every homepage section
 * (custom.css' shared [data-pw-section] rule) instead of a per-section
 * special case, so this file no longer needs its own copy for section-9.
 */

/*
 * Reveal the animation through every other page's outer content shell
 * (dashboard, wallet, trade room, marketplace browse, auth/login,
 * KYC, support, settings, CMS/legal pages, etc). Each of these classes
 * is the single root wrapper for its page type and currently paints
 * its own plain solid-black fill; overriding only that outer shell
 * (not its nested __panel/__card/__stat components) lets the animation
 * show through in the space around those still-solid-black cards,
 * exactly like the homepage above.
 */
.pw-app,
.p2p-dash,
.p2p-dash--v2,
.wlf-auth,
.bn-page,
.wlfi-cms-page {
  background: transparent !important;
  background-image: none !important;
}

/*
 * .bn-market-flow__visual is deliberately raised to z-index:6 with
 * mix-blend-mode:screen (below) so the particle network paints IN
 * FRONT of content and blends over it, which suits the homepage's
 * spacious hero/marketing sections, but on every data-dense app page
 * (dashboard tiles, wallet balances, trade terms, form fields) a
 * bright particle or comet trail drifting across a card at any given
 * moment reads as "this container has no solid background." Content
 * here still sits inside the now-transparent shells above, so the
 * animation stays visible in the margins/gaps around cards; this
 * just gives that content its own stacking context one level above
 * the visual layer so cards/panels/tables occlude it on their own
 * surface instead of being painted over. Homepage keeps the original
 * in-front treatment (no .pw-app-site there), as do the separate
 * footer/drawer chrome instances below, which aren't data surfaces.
 */
body.pw-app-site .pw-app,
body.pw-app-site .p2p-dash,
body.pw-app-site .wlf-auth,
body.pw-app-site .bn-page,
body.pw-app-site .wlfi-cms-page {
  position: relative;
  z-index: 7;
}

/* Same fix, admin side: admin/layouts/master.blade.php places the
   fixed, full-viewport .bn-market-flow--page (z-index:4) as a sibling
   *before* .page-wrapper (sidenav/topnav/tables/panels), rather than
   wrapping content the way the frontend's .bn-market-flow does, so
   admin's own data tables and cards need the same one-level-higher
   stacking context to occlude it instead of being painted over. */
body.bn-admin .page-wrapper {
  position: relative;
  z-index: 5;
}

/* Same fix again, three more standalone layouts that also render
   .bn-market-flow--page (z-index:4) via partials.bn_market_flow_page
   but aren't covered by any of the selectors above: admin's own
   pre-auth screens (login, password reset/email/code-verify - all
   share .login-main), the site's generic error pages (404, 500,
   maintenance, etc. - errors/layout.blade.php's <main>), and the
   step-up re-authentication bridge page (partials/step_up_resume.blade.php's
   <main>). Without this, all three sit at the default z-index:auto and
   the canvas paints over them every animation frame instead of behind
   them. */
.login-main,
.p2p-error-page__shell,
.p2p-step-up-resume__shell {
  position: relative;
  z-index: 5;
}

/*
 * custom.css clears the fixed nav bar with a `.page-wrapper > #main.p2p-dash`
 * direct-child rule. Since .bn-market-flow now sits between .page-wrapper
 * and that content root, this re-applies the exact same clearance one
 * level deeper so no page loses its top spacing under the fixed nav.
 */
body.pw-app-site:has(.pw-plasma-shell):not(:has(.pw-home)):not(:has(.p2p-auth)):not(:has(.wlf-auth)) .bn-market-flow > #main.p2p-dash,
body.pw-app-site:has(.pw-plasma-shell):not(:has(.pw-home)):not(:has(.p2p-auth)):not(:has(.wlf-auth)) .bn-market-flow > .pw-app.p2p-dash {
  padding-top: calc(var(--pw-header-clearance, 7.75rem) + env(safe-area-inset-top, 0px));
  box-sizing: border-box;
}

@media (max-width: 767px) {
  body.pw-app-site:has(.pw-plasma-shell):not(:has(.pw-home)):not(:has(.p2p-auth)):not(:has(.wlf-auth)) .bn-market-flow > #main.p2p-dash,
  body.pw-app-site:has(.pw-plasma-shell):not(:has(.pw-home)):not(:has(.p2p-auth)):not(:has(.wlf-auth)) .bn-market-flow > .pw-app.p2p-dash {
    padding-top: calc(5.25rem + env(safe-area-inset-top, 0px) + 0.625rem);
  }
}

/*
 * custom.css and plasma-home.css also pin the footer to the bottom of
 * short pages by giving the content element `flex: 1 0 auto` inside
 * .page-wrapper's flex column. That only works on a direct flex child,
 * so the same flex-grow now needs to live on .bn-market-flow (the new
 * direct child) for the homepage and for the login/register auth
 * screens, exactly matching the original values.
 *
 * min-height:max-content is required alongside flex-shrink:0 here.
 * Per the flexbox spec, a flex item's automatic (default) minimum size
 * is forced to 0 whenever its overflow computes to anything but
 * visible on both axes - and overflow-x:clip above forces overflow-y's
 * used value away from true "visible" too. With an automatic min-height
 * of 0, this wrapper was sizing to the flex line (900px viewport) and
 * silently clipping the ~11,000px of real homepage content beneath it
 * instead of growing to fit it. Giving min-height an explicit value
 * (anything other than the default "auto") opts back out of that
 * auto-minimum-zero rule, so the wrapper is guaranteed to be at least
 * as tall as its content while flex-grow:1 still lets it stretch
 * further to fill the viewport on short pages.
 *
 * :not(...) exclusions matter here: the drawer/footer/standalone-page
 * instances also carry the plain .bn-market-flow base class, but they
 * are position:absolute with inset:0 (sized against their own fixed/
 * relative ancestor, e.g. the drawer panel or footer). Their only
 * child is itself absolutely positioned, so it contributes nothing to
 * an intrinsic "auto"/max-content height - applying this same
 * min-height:max-content to them collapsed each one to 0px, silently
 * blanking the animation in the mobile drawer and (depending on page)
 * the footer.
 */
body:has(.pw-home) .bn-market-flow:not(.bn-market-flow--drawer):not(.bn-market-flow--footer):not(.bn-market-flow--page) {
  flex: 1 0 auto;
  min-height: max-content;
}

/*
 * plasma-home.css is a legacy Webflow export whose generic `.body`
 * utility class (applied here as `class="pw-home body"`, a *class*
 * name, unrelated to the <body> element) hard-codes `height: 100vh`.
 * That was harmless in the original markup because nothing wrapping
 * it ever clipped vertical overflow, so the real (taller) content
 * simply extended past that box and stayed visible/scrollable. Now
 * that .bn-market-flow wraps it with overflow-x:clip (needed to
 * contain the animation's decorative orbs), the browser's overflow
 * rules stop treating this box's vertical overflow as visible too,
 * so the old fixed 100vh started silently cutting the homepage down
 * to one screen instead of letting it size to its real content.
 * Restoring auto/min-height here (specificity-equal, but this file
 * loads last) keeps the "fill at least one screen" intent for short
 * pages without capping taller ones.
 */
.pw-home.body {
  height: auto;
  min-height: 100vh;
}

body.pw-app-site:has(.wlf-auth--login) .bn-market-flow:not(.bn-market-flow--drawer):not(.bn-market-flow--footer):not(.bn-market-flow--page),
body.pw-app-site:has(.wlf-auth--register) .bn-market-flow:not(.bn-market-flow--drawer):not(.bn-market-flow--footer):not(.bn-market-flow--page),
body.pw-app-site:has(.p2p-auth--login) .bn-market-flow:not(.bn-market-flow--drawer):not(.bn-market-flow--footer):not(.bn-market-flow--page),
body.pw-app-site:has(.p2p-auth--register) .bn-market-flow:not(.bn-market-flow--drawer):not(.bn-market-flow--footer):not(.bn-market-flow--page) {
  flex: 1 0 auto;
  height: auto !important;
  min-height: 0 !important;
  overflow: visible !important;
  padding-bottom: clamp(1rem, 3vw, 1.5rem);
}

@keyframes bnFlowOrbOne {
  from { margin-top: -3vh; margin-left: -2vw; }
  to { margin-top: 5vh; margin-left: 5vw; }
}

@keyframes bnFlowOrbTwo {
  from { margin-right: -3vw; margin-bottom: -4vh; }
  to { margin-right: 4vw; margin-bottom: 5vh; }
}

@media (max-width: 640px) {
  .bn-market-flow__visual {
    height: 100svh;
    margin-bottom: -100svh;
  }

  /* Scoped to footer/drawer only (not the bare .bn-market-flow__canvas) -
     the main/page canvas stays opaque at every viewport width now, same
     reasoning as the base rule above. */
  .bn-market-flow--footer .bn-market-flow__canvas,
  .bn-market-flow--drawer .bn-market-flow__canvas {
    opacity: 0.28;
  }

  .bn-market-flow__visual::after {
    width: 118vw;
    opacity: 0.5;
  }
}

/*
 * Footer's own compact copy of the same living background - same
 * canvas particle network, just sized to fill the footer's own short
 * box instead of taking over the full viewport. .wlf-footer is already
 * position:relative, so this layer absolutely fills it and sits behind
 * the real footer content.
 */
.bn-market-flow--footer {
  /* Raised above .wlf-footer__inner (z-index:1) - same "in front, blended"
     treatment as the main content, instead of sitting behind the footer's
     own links and copyright text. The base .bn-market-flow class paints a
     solid canvas-tone fill (correct when this layer sits behind everything);
     now that it's in front, that solid fill has to go or it would black out
     the footer text sitting beneath it. */
  position: absolute;
  inset: 0;
  z-index: 4;
  overflow: hidden;
  pointer-events: none;
  background: transparent;
}

.bn-market-flow--footer::before,
.bn-market-flow--footer::after {
  content: none;
}

.bn-market-flow__visual--compact {
  position: absolute;
  inset: 0;
  height: 100%;
  margin-bottom: 0;
}

/*
 * z-index:7 (not just position:relative) matters here: position:sticky's
 * containment math is supposed to stop .bn-market-flow__visual (the MAIN
 * homepage canvas, z-index:6, sticky top:0 with a margin-bottom:-100svh
 * trick so it never adds real height to its container) from ever painting
 * past its own containing block's bottom edge - but confirmed by measuring
 * both rects at max scroll: that containing block's bottom edge lands
 * ~149px above the true page bottom, while the sticky visual is still
 * reporting a full 0-to-viewport-height box, i.e. it overflows its
 * container by that same ~149px right at the very end of the page. That
 * sliver lands exactly on this footer. It was invisible before this file's
 * canvas rule made the layer opaque (previously opacity:0.35 + screen
 * blend, imperceptible over the footer's own dark background); opaque, it
 * silently painted over the footer's links/copyright instead of behind
 * them, because .wlf-footer and its children had no z-index of their own
 * to out-rank the canvas's explicit 6. Same fix as every other real-content
 * surface in this file - one level above the canvas is enough regardless
 * of why the overlap happens, without needing to touch the sticky/margin
 * math that's working correctly for its actual job everywhere else on
 * the page.
 */
.wlf-footer {
  position: relative;
  z-index: 7;
  overflow: hidden;
}

.wlf-footer__inner {
  position: relative;
  z-index: 1;
}

/*
 * The nav bar is fixed/sticky above everything and already uses a
 * frosted-glass backdrop-filter blur with a translucent tint - it was
 * built to let a hint of moving content show through the blur instead
 * of a flat bar. That tint was originally dropped very low (0.34-0.58)
 * back when the particle canvas was much brighter; now that the canvas
 * has been toned down to "faint and sparse" per design feedback, the
 * same low alpha mostly just reveals plain page text/headings scrolling
 * underneath the nav instead of the animation, reading as a transparency
 * bug rather than a deliberate effect. Raised back closer to the base
 * component's own values (pw-plasma-nav.css uses 0.5/0.88/0.92) so the
 * nav reads as a solid piece of chrome with only a subtle glass tint,
 * not a see-through bar with content bleeding through it.
 */
.pw-plasma-shell .navbar_component,
.pw-plasma-shell.pw-plasma-shell--inner .navbar_component,
body.pw-app-site .pw-plasma-shell .navbar_component,
body.pw-app-site .pw-plasma-shell.pw-plasma-shell--inner .navbar_component,
body.home-page .pw-plasma-shell .navbar_component {
  background-color: rgba(19, 16, 13, 0.74) !important;
}

/*
 * Specificity note: the base rule above includes a
 * "body.home-page .pw-plasma-shell .navbar_component" variant, which
 * (1 type + 3 classes) already outranks a plain
 * ".pw-plasma-shell .navbar_component.is-scrolled" (3 classes, no type
 * selector) - so on the homepage the scrolled state was silently losing
 * to the base alpha no matter how far down the page you scrolled. Every
 * body-qualified variant from the base rule needs a matching
 * ".is-scrolled" counterpart here so the scrolled state can actually win
 * on every page, not just on body.pw-app-site.
 */
.pw-plasma-shell .navbar_component.is-scrolled,
body.pw-app-site .pw-plasma-shell .navbar_component.is-scrolled,
body.home-page .pw-plasma-shell .navbar_component.is-scrolled {
  background-color: rgba(19, 16, 13, 0.92) !important;
}

/*
 * Tablet: same "body.home-page"/"body.pw-app-site" specificity (0,3,1) as
 * the base rule's own qualified variants, so this actually overrides them
 * at this breakpoint (source order breaks the tie) instead of silently
 * losing to the base rule the way a bare ".pw-plasma-shell .navbar_component"
 * (0,2,0) always would. ".is-scrolled" stays at (0,4,1) so it still wins
 * over this regardless of viewport.
 */
@media (min-width: 768px) and (max-width: 1023px) {
  .pw-plasma-shell .navbar_component,
  body.pw-app-site .pw-plasma-shell .navbar_component,
  body.home-page .pw-plasma-shell .navbar_component {
    background-color: rgba(19, 16, 13, 0.85) !important;
  }
}

/*
 * Header menu (the hamburger drawer) - its own compact copy of the same
 * living background, same treatment as the footer: raised above the
 * drawer's nav links/CTA buttons (which are plain in-flow content with
 * no z-index of their own) and blended with mix-blend-mode so the links
 * stay readable while particles drift behind/through them instead of a
 * flat black panel. Alpha raised for the same readability reason as the
 * nav bar above - this is a full-screen navigation panel, so it needs to
 * read as solid chrome first and "living" second.
 */
.pw-plasma-drawer {
  background: rgba(19, 16, 13, 0.94) !important;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.bn-market-flow--drawer {
  /* .pw-plasma-drawer__head/__nav/__foot are flex items of the drawer's
     flex column, which the spec treats as implicitly positioned - this
     explicit z-index still wins and paints above them. Drop the base
     .bn-market-flow solid canvas-tone fill for the same reason as the
     footer above: it would otherwise black out the drawer's own nav links. */
  position: absolute;
  inset: 0;
  z-index: 4;
  overflow: hidden;
  pointer-events: none;
  background: transparent;
}

.bn-market-flow--drawer::before,
.bn-market-flow--drawer::after {
  content: none;
}

/*
 * Standalone-page variant - used by layouts that never pass through the
 * frontend layout (admin panel, 404/419/500 error pages). A fixed
 * full-viewport copy of the same system, blended in front of the page
 * content exactly like the footer/drawer instances. z-index 4 keeps it
 * above plain content cards but below fixed chrome (admin sidenav,
 * topnav, modals, dropdowns all use much higher z-index values), and
 * pointer-events:none means it can never block a click.
 */
.bn-market-flow--page {
  position: fixed;
  inset: 0;
  z-index: 4;
  overflow: hidden;
  pointer-events: none;
  background: transparent;
}

.bn-market-flow--page::before,
.bn-market-flow--page::after {
  content: none;
}

/* Same specificity fix as the tablet block above - qualify with
   body.home-page/body.pw-app-site so this reliably wins at this
   breakpoint instead of the plain selectors silently losing to the
   base rule's higher-specificity variants. */
@media (max-width: 767px) {
  .pw-plasma-shell .navbar_component,
  .pw-unified-nav.navbar_component,
  body.pw-app-site .pw-plasma-shell .navbar_component,
  body.home-page .pw-plasma-shell .navbar_component {
    background-color: rgba(19, 16, 13, 0.85) !important;
  }
}
