/* Printed material (static, no animation).
   - Light grounds: paper stock (fine grain + faint fibres).
   - Dark grounds: film grain.
   - Halftone dot fade where a dark section meets a light one (and back).
   - Fluted (ribbed) glass on the nav bar.
   All textures are inline SVG feTurbulence data URIs, painted as background-image on the ground itself
   (no overlay elements over content, so nothing can intercept clicks). */

:root{
  /* paper grain: dark speckle, alpha kept very low */
  --tx-paper-grain:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n' x='0' y='0' width='100%25' height='100%25'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' seed='7' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .04 0 0 0 0 .08 0 0 0 0 .12 0 0 0 .9 -.34'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.36'/%3E%3C/svg%3E");
  /* paper fibres: stretched noise, mostly horizontal strands */
  --tx-paper-fibre:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='360' height='360'%3E%3Cfilter id='f' x='0' y='0' width='100%25' height='100%25'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.012 .55' numOctaves='3' seed='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .1 0 0 0 0 .2 0 0 0 0 .28 0 0 0 1.6 -.82'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23f)' opacity='.14'/%3E%3C/svg%3E");
  /* film grain: light speckle */
  --tx-film-grain:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='g' x='0' y='0' width='100%25' height='100%25'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' seed='11' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .85 0 0 0 0 .95 0 0 0 0 1 0 0 0 1 -.52'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)' opacity='.24'/%3E%3C/svg%3E");
}

/* ---------- grains (one or two background layers per ground) ---------- */
.ground-ice,.ground-powder{
  background-image:var(--tx-paper-grain),var(--tx-paper-fibre);
  background-size:220px 220px,360px 360px;
}
html,body,.ground-dark,.ground-red{
  background-image:var(--tx-film-grain);
  background-size:240px 240px;
}
.ground-red{background-size:200px 200px}

/* ---------- halftone fade at section joins ----------
   Rows of dots shrinking away from the seam, in the colour of the neighbouring section, so it reads as
   that ground bleeding in as printed ink. Lives in the section's top padding (>= 72px), never under text. */
.block,.page-head,.inner,footer{position:relative}
.ground-dark + .ground-ice::before,
.ground-dark + .ground-powder::before,
.ground-ice + .ground-dark::before,
.ground-powder + .ground-dark::before{
  --dot:var(--black);
  content:'';position:absolute;left:0;right:0;top:0;height:34px;z-index:0;pointer-events:none;
  background-repeat:repeat-x;
  background-image:
    radial-gradient(circle at 50% 50%,var(--dot) 2.7px,transparent 3.2px),
    radial-gradient(circle at 50% 50%,var(--dot) 2.2px,transparent 2.7px),
    radial-gradient(circle at 50% 50%,var(--dot) 1.7px,transparent 2.2px),
    radial-gradient(circle at 50% 50%,var(--dot) 1.2px,transparent 1.7px),
    radial-gradient(circle at 50% 50%,var(--dot) .75px,transparent 1.2px);
  background-size:7px 7px;
  background-position:0 0,3.5px 6px,0 12px,3.5px 18px,0 24px;
}
.ground-ice + .ground-dark::before,
.ground-powder + .ground-dark::before{--dot:var(--powder)}
.ground-dark + .ground-ice::before{--dot:var(--black)}
.ground-dark + .ground-powder::before{--dot:var(--black)}
/* the ::before is a positioned child under .wrap (z-index 1) and .corner (z-index 0, later in DOM) */

/* ---------- fluted glass nav ---------- */
.nav::before{
  background-color:rgba(11,11,11,.9);
  background-image:
    /* ribs: bright edge, soft body, shadow edge, repeating every 9px */
    repeating-linear-gradient(90deg,
      rgba(217,241,255,.11) 0,rgba(217,241,255,.05) 1px,rgba(217,241,255,.015) 3px,
      rgba(0,0,0,0) 5px,rgba(0,0,0,.22) 8px,rgba(0,0,0,.34) 9px),
    /* broad lens sheen drifting across the bar */
    linear-gradient(90deg,rgba(217,241,255,0) 0,rgba(217,241,255,.035) 22%,rgba(217,241,255,0) 38%,rgba(217,241,255,.025) 70%,rgba(217,241,255,0) 100%),
    /* top light, bottom dark */
    linear-gradient(180deg,rgba(217,241,255,.06),rgba(217,241,255,0) 45%,rgba(0,0,0,.18));
  box-shadow:inset 0 1px 0 rgba(217,241,255,.07),0 10px 24px -14px rgba(0,0,0,.6);
}
@media (prefers-reduced-transparency:reduce){
  .nav::before{background-color:#0B0B0B;-webkit-backdrop-filter:none;backdrop-filter:none}
}

/* ---------- round 2: the lead found the dark and red grounds still read as flat ("if we're doing texture, we should do it
   a little better"). Stronger film grain, a slow print mottle (uneven ink coverage over hundreds of pixels) and a fine
   halftone screen on dark grounds; dark ink speckle on red; the halftone seam now also where red meets its neighbours.
   Body text stays at its contrast: the strongest layer is sparse speckle, and the screen dots are ~5% alpha. ---------- */
:root{
  --tx-film-grain-2:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='g' x='0' y='0' width='100%25' height='100%25'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' seed='11' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .85 0 0 0 0 .95 0 0 0 0 1 0 0 0 1.2 -.5'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(#g)' opacity='.5'/%3E%3C/svg%3E");
  --tx-ink-speck:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='k' x='0' y='0' width='100%25' height='100%25'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='2' seed='4' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1.3 -.55'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(#k)' opacity='.55'/%3E%3C/svg%3E");
  --tx-mottle:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='900' height='900'%3E%3Cfilter id='m' x='0' y='0' width='100%25' height='100%25'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.006' numOctaves='3' seed='7' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .85 0 0 0 0 .95 0 0 0 0 1 0 0 0 1.1 -.42'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(#m)' opacity='.12'/%3E%3C/svg%3E");
}
html,body,.ground-dark{
  background-image:var(--tx-film-grain-2),var(--tx-mottle),radial-gradient(rgba(189,217,233,.05) .75px,transparent 1.05px);
  background-size:240px 240px,900px 900px,4px 4px;
}
.ground-red{
  background-image:var(--tx-film-grain-2),var(--tx-ink-speck),var(--tx-mottle),radial-gradient(rgba(11,11,11,.12) .8px,transparent 1.1px);
  background-size:240px 240px,200px 200px,900px 900px,4px 4px;
}
.ground-ice + .ground-red::before,.ground-powder + .ground-red::before,
.ground-red + .ground-dark::before,.ground-red + .ground-ice::before,.ground-red + .ground-powder::before,
.ground-dark + .ground-red::before{
  content:'';position:absolute;left:0;right:0;top:0;height:34px;z-index:0;pointer-events:none;
  background-repeat:repeat-x;
  background-image:
    radial-gradient(circle at 50% 50%,var(--dot) 2.7px,transparent 3.2px),
    radial-gradient(circle at 50% 50%,var(--dot) 2.2px,transparent 2.7px),
    radial-gradient(circle at 50% 50%,var(--dot) 1.7px,transparent 2.2px),
    radial-gradient(circle at 50% 50%,var(--dot) 1.2px,transparent 1.7px),
    radial-gradient(circle at 50% 50%,var(--dot) .75px,transparent 1.2px);
  background-size:7px 7px;
  background-position:0 0,3.5px 6px,0 12px,3.5px 18px,0 24px;
}
.ground-ice + .ground-red::before{--dot:var(--ice)}
.ground-powder + .ground-red::before{--dot:var(--powder)}
.ground-dark + .ground-red::before{--dot:var(--black)}
.ground-red + .ground-dark::before,.ground-red + .ground-ice::before,.ground-red + .ground-powder::before{--dot:var(--red)}
