/* Lucretius page: background. The SVG tiles come from notes/lucretius/make_bg.py; the moving fractals from scripts/lucretius-fractals.js.
   Default (since 18 November 2026, late): no background ornament; the fractal engine was removed at the user's request.
   ?bg=d shows the earlier "currents and atoms" tiles, ?bg=a, b or c the earlier margin strips (a script in the page sets html[data-bg]). */
body { position: relative; }
.cat-top, .cat { position: relative; z-index: 1; }
.lp-deco { position: absolute; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
html[data-bg='d'] .lp-deco {
  background:
    radial-gradient(60% 40% at 0% 12%, rgba(122, 31, 43, .10), transparent 70%),
    radial-gradient(55% 45% at 100% 48%, rgba(122, 31, 43, .09), transparent 70%),
    radial-gradient(60% 40% at 10% 88%, rgba(122, 31, 43, .08), transparent 70%); }
.lp-fx { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none;
  -webkit-mask-image: linear-gradient(to right, #000 calc(50% - 720px), rgba(0,0,0,.16) calc(50% - 560px), rgba(0,0,0,.16) calc(50% + 560px), #000 calc(50% + 720px));
  mask-image: linear-gradient(to right, #000 calc(50% - 720px), rgba(0,0,0,.16) calc(50% - 560px), rgba(0,0,0,.16) calc(50% + 560px), #000 calc(50% + 720px)); }
html[data-bg] .lp-fx { display: none; }
.lp-deco i { display: none; }

/* ?bg=d: currents and atoms */
html[data-bg='d'] .lp-deco::before, html[data-bg='d'] .lp-deco::after { content: ''; position: absolute; inset: 0;
  -webkit-mask-image: linear-gradient(to right, #000 calc(50% - 720px), rgba(0,0,0,.16) calc(50% - 560px), rgba(0,0,0,.16) calc(50% + 560px), #000 calc(50% + 720px));
  mask-image: linear-gradient(to right, #000 calc(50% - 720px), rgba(0,0,0,.16) calc(50% - 560px), rgba(0,0,0,.16) calc(50% + 560px), #000 calc(50% + 720px)); }
html[data-bg='d'] .lp-deco::before { background: url(../images/lucretius/bg-d-lines.svg) 50% 0 / 2400px 1600px repeat-y; }
html[data-bg='d'] .lp-deco::after { background: url(../images/lucretius/bg-d-atoms.svg) 50% 0 / 2400px 1600px repeat-y; animation: lp-fall 90s linear infinite; }
@keyframes lp-fall { to { background-position: 50% 1600px; } }
@media (prefers-reduced-motion: reduce) { html[data-bg='d'] .lp-deco::after { animation: none; } }

/* ?bg=a, b, c: margin strips */
html[data-bg='a'] .lp-deco, html[data-bg='b'] .lp-deco, html[data-bg='c'] .lp-deco { background: none; }
html[data-bg='a'] .lp-deco i, html[data-bg='b'] .lp-deco i, html[data-bg='c'] .lp-deco i { display: block; position: absolute; top: 0; bottom: 0; width: 250px; background: url(../images/lucretius/bg-a.svg) 0 0 / 250px 1600px repeat-y; }
html[data-bg] .lp-deco i:first-child { left: calc(50% - 840px); }
html[data-bg] .lp-deco i:last-child { right: calc(50% - 840px); transform: scaleX(-1); background-position: 0 800px; }
html[data-bg='b'] .lp-deco i { background-image: url(../images/lucretius/bg-b.svg); }
html[data-bg='c'] .lp-deco i { background-image: url(../images/lucretius/bg-c.svg); }

@media (max-width: 760px) {
  .lp-fx { -webkit-mask-image: linear-gradient(rgba(0,0,0,.45), rgba(0,0,0,.45)); mask-image: linear-gradient(rgba(0,0,0,.45), rgba(0,0,0,.45)); }
  html[data-bg='d'] .lp-deco::before, html[data-bg='d'] .lp-deco::after { background-size: 1500px 1000px; }
  html[data-bg] .lp-deco i { opacity: .5; } html[data-bg] .lp-deco i:first-child { left: -190px; } html[data-bg] .lp-deco i:last-child { right: -190px; }
}
