/* ============================================================
   Delta — Background texture (shared)

   Furrow contours screened back behind the whole application.
   Link this after the page stylesheet on any page.

   It paints on body::before with a negative z-index, so it sits
   above the page's own background gradient and below every piece
   of content — no stacking-context juggling per page, and no
   extra markup.

   The asset carries its own alpha (flat purple ink, transparent
   ground) so it reads correctly over each page's warm gradient
   rather than fighting a white rectangle.

   Two things were fixed in the asset itself rather than here,
   because CSS can't reach them:
     · The source lines compress hard toward the top — 14.1% ink
       against 3.6% at the bottom — which would have laid a dark
       band exactly across the header. Density is normalised row
       by row, then faded out over the top 30%.
     · Fine 1px line art aliases badly when scaled, so it carries
       a half-pixel blur.
   ============================================================ */

:root{
  /* One dial for the whole application. The lines are scaled up a long way
     by `cover`, so this has to sit low — much above .2 and they stop being
     ground and start being stripes behind the copy. Backed off 40% from .16
     after the lines were reading too dark against the cards and copy. */
  --texture-opacity: .096;
}

body::before{
  content:"";
  position:fixed; inset:0; z-index:-1;
  pointer-events:none;

  background-image:url("assets/img/furrows.png");
  background-repeat:no-repeat;
  background-position:center bottom;
  /* cover, so the curve reads at one scale whatever the viewport;
     fixed, so it stays put as a ground rather than scrolling with copy */
  background-size:cover;
  background-attachment:fixed;

  opacity:var(--texture-opacity);
}

/* Real Stories runs on a cooler, greyer ground than the other pages, so the
   purple lines read harder there — and that page's whole hierarchy is the
   depth-of-field falloff, which a busy background works against. */
body[data-texture="quiet"]::before{ opacity:calc(var(--texture-opacity) * .55); }

/* Narrow screens crop `cover` hard and the lines get steep and busy behind
   the copy. Backing it off keeps the pages readable on a phone. */
@media (max-width: 760px){
  :root{ --texture-opacity: .06; }
}

/* background-attachment: fixed is a known jank source on iOS Safari, where
   it also mis-sizes against the dynamic toolbar. Scroll it there instead. */
@supports (-webkit-touch-callout: none){
  body::before{ background-attachment:scroll; background-size:100% auto; }
}

@media (prefers-reduced-motion: reduce){
  body::before{ background-attachment:scroll; }
}
