/* ==================================================================================================================
   Metal Craft Engineering, rounds D1 (V1) and D2 (S2, 15 Nov 2026): the grounds for d1-bg.js (the red strands, LOCKED TO
   THE PAGE: they scroll with the text and drift in place; Live = WebGL, Video = the greyscale loop drawn into a canvas).
   Linked after theme.css; each rule here replaces a theme.css or style.css rule with the same specificity or one more
   class or type selector, never !important. Off in print, forced colours and "more contrast" (the JS stays off there too)
   and under html[data-bg="live"] (the preview switcher's old look: the dot grid and the old grounds come back).
   States, set on <html> by d1-bg.js:
   - html.js before d1-bg.js starts (it starts after load): the board without the dot grid;
   - html.d1-on (Live or Video) / html.d1-still (a still: Flow's when WebGL fails, the film's under Video with reduced motion or a refused film): .d1-vwrap,
     main's first child (board + body-aligned grain, page coordinates from main's top, on the Forge pages from the hero's
     foot, to the page's foot), holding ONE canvas, the .d1-slab (3 views tall, moved by transform inside the wrapper as the
     view nears its edge). Live's canvas is alpha only (accent lines over the board); Video's and the poster's are opaque
     white with dark accent lines, multiplied into the board, so white leaves the board and its grain exactly as they are;
   - html:not(.js): the poster on body, fixed to the view and multiplied into the board (on the Forge pages on each section
     after the hero and the footer, because the stage covers body there).
   ================================================================================================================== */
.d1-vwrap{position:absolute;left:0;right:0;top:0;z-index:-1;display:none;pointer-events:none;overflow:hidden;
  background-color:var(--bg);background-image:var(--board-grain);
  background-position:0 var(--d1-gy,0px),131px calc(67px + var(--d1-gy,0px))}
.d1-slab{position:absolute;left:0;top:0;display:block;pointer-events:none;opacity:0;transition:opacity .9s ease;will-change:transform}
.d1-slab.d1-in{opacity:1}
.d1-slab--mul{mix-blend-mode:multiply}
@media screen and (forced-colors:none){@media not all and (prefers-contrast:more){

/* The dot grid (theme.css 10, B22) retires: the strings replace it wherever scripts run. */
html.js:not([data-bg="live"]) body,html.js:not([data-bg="live"]) :where(.forge~main>.hero~*){background-image:var(--board-grain);background-position:0 0,131px 67px}

/* The strands' layer. main is its stacking context (on the Forge pages it already is, z-index 1 over the stage); the footer
   stacks above it (as it already does on the Forge pages) so the strings run under it, not over its text. */
html:is(.d1-on,.d1-still) .d1-vwrap{display:block}
html:is(.d1-on,.d1-still) main{position:relative;isolation:isolate}
html:is(.d1-on,.d1-still) main~.ftr{position:relative;z-index:1}
html:is(.d1-on,.d1-still) main>:is(.sec:not(.sec--alt,.sec--grid),.cta),
html.js:is(.d1-on,.d1-still):not([data-bg="live"]) :where(.forge~main>.hero~*,.forge~.ftr){background-color:transparent;background-image:none}
html:is(.d1-on,.d1-still) .page-head:not(.page-head--media)::before{background:none}

/* Posters for no JS: stills of Flow, the default look, rendered by d1-bg.js itself (round D3, F1; the film's own -v1 posters
   in assets/video stay for the Video look). */
:root{--d1-poster:url(assets/textures/strings-flow-red-land-v2.webp)}
html[data-segment="bridges"]{--d1-poster:url(assets/textures/strings-flow-bridges-land-v2.webp)}
@media (orientation:portrait){
  :root{--d1-poster:url(assets/textures/strings-flow-red-port-v2.webp)}
  html[data-segment="bridges"]{--d1-poster:url(assets/textures/strings-flow-bridges-port-v2.webp)}
}
html:not(.js):not([data-bg="live"]) body{
  background-image:var(--d1-poster),var(--board-grain);background-attachment:fixed,scroll,scroll;
  background-size:cover,auto,auto;background-position:50% 50%,0 0,131px 67px;background-repeat:no-repeat,repeat,repeat;
  background-blend-mode:multiply,normal,normal}
/* No scripts on the Forge pages: the stage's board covers body, so each section after the hero and the footer carries it. */
html:not(.js):not([data-bg="live"]) :is(.forge~main>.hero~*,.forge~.ftr){background-color:var(--bg);
  background-image:var(--d1-poster),var(--board-grain);background-attachment:fixed,scroll,scroll;
  background-size:cover,auto,auto;background-position:50% 50%,0 0,131px 67px;background-repeat:no-repeat,repeat,repeat;
  background-blend-mode:multiply,normal,normal}
html:not(.js):not([data-bg="live"]) main>:is(.sec:not(.sec--alt,.sec--grid),.cta){background-color:transparent}
html:not(.js):not([data-bg="live"]) .page-head:not(.page-head--media)::before{background:none}
}}
@media print{.d1-vwrap{display:none}}
