/* ==================================================================
   ALIENSREPORT — SIGNAL INTERFERENCE (loads after aliens.css)
   Makes the night sky and every story picture read like an intercepted
   transmission:
   - page background: a spinning black hole and a nebula storm with
     lightning, both in the section's colors,
     drifting columns of alien runes, brief bright rune flashes, CRT scan lines, jittering static and a slow rolling band
   - header: scan lines and static over the section backdrop
   - story pictures (cards, side list, showcases, homepage lead, article
     hero): denser scan lines, live static, a ticking rune readout down
     the right edge in the section's light tint, and an occasional
     glitch burst
   Artwork: assets/alien-runes-field.svg (mask, filled with the section
   color), assets/alien-runes-strip-<section>.svg (colored, outlined),
   assets/static-noise.svg. Redraw the runes with
   ../tools/fx/make_alien_runes.py. Everything here is decoration only:
   pointer-events are off, and reduced-motion visitors get still layers.
   ================================================================== */

:root {
  --fx-runes: url("assets/alien-runes-field.svg");
  --fx-noise: url("assets/static-noise.svg");
  --fx-scan: repeating-linear-gradient(0deg, rgba(0, 0, 0, .34) 0 1px, transparent 1px 3px);
  --fx-strip: url("assets/alien-runes-strip-breaking.svg");
}
[data-theme="breaking"]   { --fx-strip: url("assets/alien-runes-strip-breaking.svg"); }
[data-theme="sightings"]  { --fx-strip: url("assets/alien-runes-strip-sightings.svg"); }
[data-theme="disclosure"] { --fx-strip: url("assets/alien-runes-strip-disclosure.svg"); }
[data-theme="encounters"] { --fx-strip: url("assets/alien-runes-strip-encounters.svg"); }
[data-theme="science"]    { --fx-strip: url("assets/alien-runes-strip-science.svg"); }
[data-theme="casefiles"]  { --fx-strip: url("assets/alien-runes-strip-casefiles.svg"); }
[data-theme="debunked"]   { --fx-strip: url("assets/alien-runes-strip-debunked.svg"); }
[data-theme="culture"]    { --fx-strip: url("assets/alien-runes-strip-culture.svg"); }

/* ---------- page background (all four layers sit behind the content) ---------- */
/* 1. rare bright rune flashes, large, in a new spot each time */
html::before {
  content: ""; position: fixed; z-index: -1; inset: -200px; pointer-events: none;
  background: var(--a-lime);
  -webkit-mask: var(--fx-runes) 0 0 / 860px 1147px repeat; mask: var(--fx-runes) 0 0 / 860px 1147px repeat;
  opacity: 0; animation: fx-flash 13s steps(1, end) infinite;
}
/* 2. columns of runes drifting slowly upward, in the section color */
body::before {
  content: ""; position: fixed; z-index: -1; left: 0; right: 0; top: 0; height: calc(100% + 768px); pointer-events: none;
  background: var(--hl, var(--a-lime));
  -webkit-mask: var(--fx-runes) 0 0 / 576px 768px repeat; mask: var(--fx-runes) 0 0 / 576px 768px repeat;
  opacity: .13; animation: fx-drift 96s linear infinite, fx-shimmer 5.2s ease-in-out infinite;
  will-change: transform;
}
/* 3. a slow bright band rolling down the screen */
body::after {
  content: ""; position: fixed; z-index: -1; left: 0; right: 0; top: 0; height: 38vh; pointer-events: none;
  background: linear-gradient(180deg, transparent, rgba(180, 255, 0, .035) 40%, rgba(230, 255, 210, .085) 50%, rgba(180, 255, 0, .035) 60%, transparent);
  animation: fx-roll 9.5s linear infinite; will-change: transform;
}
/* 4. scan lines and static over all of it */
html::after {
  content: ""; position: fixed; z-index: -1; inset: -120px; pointer-events: none;
  background: var(--fx-scan), var(--fx-noise) 0 0 / 220px 220px;
  opacity: .36; animation: fx-jitter .48s steps(1, end) infinite; will-change: transform;
}
@keyframes fx-drift { to { transform: translateY(-768px); } }
@keyframes fx-shimmer { 0%, 100% { opacity: .13; } 50% { opacity: .07; } 71% { opacity: .15; } 72% { opacity: .04; } 73% { opacity: .14; } }
@keyframes fx-roll { from { transform: translateY(-40vh); } to { transform: translateY(105vh); } }
/* vertical moves are multiples of 3px so the scan lines stay put while the static jumps */
@keyframes fx-jitter {
  0% { transform: translate(0, 0); } 17% { transform: translate(-41px, -27px); } 33% { transform: translate(-89px, -6px); }
  50% { transform: translate(-17px, -63px); } 67% { transform: translate(-63px, -42px); } 83% { transform: translate(-103px, -87px); }
}
@keyframes fx-flash {
  0%   { opacity: 0; transform: translate(0, 0); }
  31%  { opacity: .2; } 31.6% { opacity: .05; } 32.2% { opacity: .24; } 34% { opacity: 0; }
  35%  { transform: translate(-310px, -140px); }
  77%  { opacity: .18; } 77.5% { opacity: 0; } 78% { opacity: .22; } 79.5% { opacity: 0; }
  80%  { transform: translate(-130px, -460px); }
}

/* ---------- header: scan lines and static over the section backdrop ---------- */
.site-header::before {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background: var(--fx-scan), var(--fx-noise) 0 0 / 220px 220px;
  opacity: .55; mix-blend-mode: hard-light; animation: fx-jitter-bg .48s steps(1, end) infinite;
}
@keyframes fx-jitter-bg {
  0% { background-position: 0 0, 0 0; } 17% { background-position: 0 0, -41px -27px; } 33% { background-position: 0 0, -89px -6px; }
  50% { background-position: 0 0, -17px -63px; } 67% { background-position: 0 0, -63px -42px; } 83% { background-position: 0 0, -103px -87px; }
}

/* ---------- story pictures ----------
   One layer above each picture carries the rune readout (right edge, section tint),
   the scan lines and the static. Its frames below step the static about eight times
   a second and tick the runes up one glyph every third frame; a strip cell is 5/3
   of the strip width, twelve cells per loop. The pictures' own ::after overlays
   (aliens.css, archive.css, thumbnail-hero.css) are left as they are. */
.story .thumb, .side-item .thumb, .showcase-image, .article-top .story-paper-art,
.archive-feature .frame, #hero .hero-main:not(.has-art) .media-card .frame { container-type: inline-size; }
.story .thumb, .side-item .thumb, .showcase-image, .archive-feature .frame, #hero .hero-main:not(.has-art) .media-card .frame,
#hero .has-art .art-tile, .showcase-hero .has-art .art-tile, .article-top .story-paper-art {
  --fx-d: 0s; --fx-burst: 8.3s; --fx-o: .58; --fx-rw: clamp(8px, 3.1cqw, 17px); isolation: isolate;
}
#hero .has-art .art-tile, .showcase-hero .has-art .art-tile, .article-top .story-paper-art { --fx-rw: clamp(12px, 2.9cqw, 22px); }
.story .thumb::before, .side-item .thumb::before, .showcase-image::before,
.archive-feature .frame::before, #hero .hero-main:not(.has-art) .media-card .frame::before,
#hero .has-art .art-tile::before, .showcase-hero .has-art .art-tile::before, .article-top .story-paper-art::before {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background:
    repeating-linear-gradient(0deg, rgba(0, 0, 0, .3) 0 1px, transparent 1px 3px),
    var(--fx-noise) 0 0 / 220px 220px,
    var(--fx-strip) right 3.5% top 0 / var(--fx-rw) auto repeat-y;
  opacity: var(--fx-o);
  animation: fx-signal 4.32s steps(1, end) var(--fx-d) infinite, fx-burst var(--fx-burst) linear var(--fx-d) infinite;
}
.article-top .story-paper-art::before { --fx-o: .46; }
/* card thumbnails carry the logo upper right and credits along the bottom, so their
   runes get their own shorter column between the two (the static layer keeps only
   its first two backgrounds) */
.story .thumb::before, .side-item .thumb::before, .showcase-image::before,
.archive-feature .frame::before, #hero .hero-main:not(.has-art) .media-card .frame::before {
  background:
    repeating-linear-gradient(0deg, rgba(0, 0, 0, .3) 0 1px, transparent 1px 3px),
    var(--fx-noise) 0 0 / 220px 220px;
}
.story .thumb::after, .side-item .thumb::after, .showcase-image::after,
.archive-feature .frame::after, #hero .hero-main:not(.has-art) .media-card .frame::after {
  content: ""; position: absolute; z-index: 2; pointer-events: none; top: 31%; bottom: 14%; right: 1.4%; width: calc(var(--fx-rw) + 6px);
  border-radius: 3px; box-shadow: 0 0 0 1px rgba(0, 0, 0, .5);
  background: var(--fx-strip) center 0 / var(--fx-rw) auto repeat-y, linear-gradient(rgba(3, 6, 4, .5), rgba(3, 6, 4, .5));
  --fx-o: .95; opacity: var(--fx-o);
  animation: fx-tick 4.32s steps(12, end) var(--fx-d) infinite, fx-burst var(--fx-burst) linear var(--fx-d) infinite;
}
.side-item .thumb::after { display: none; }      /* too small to read; the static is enough there */
/* the play button, video length and fallback-graphic labels stay on top */
.thumb > .play, .showcase-image > .play, .frame > .play, .thumb > .dur, .showcase-image > .dur { z-index: 3; }
.article-top .story-paper-art > span { position: relative; z-index: 3; }
.thumb > img, .showcase-image > img, .frame > img, .art-tile > img { animation: fx-img-glitch var(--fx-burst) linear var(--fx-d) infinite; }

/* spread the bursts so the cards never glitch together */
#stories .story:nth-child(5n+2) .thumb, .side-item:nth-child(4n+2) .thumb, .showcase-lead:nth-child(2n) .showcase-image { --fx-d: -2.7s; --fx-burst: 9.1s; }
#stories .story:nth-child(5n+3) .thumb, .side-item:nth-child(4n+3) .thumb { --fx-d: -5.3s; --fx-burst: 7.6s; }
#stories .story:nth-child(5n+4) .thumb, .side-item:nth-child(4n) .thumb { --fx-d: -1.4s; --fx-burst: 10.2s; }
#stories .story:nth-child(5n) .thumb { --fx-d: -6.8s; --fx-burst: 8.8s; }

@keyframes fx-tick { from { background-position: center 0; } to { background-position: center calc(var(--fx-rw) * -20); } }
@keyframes fx-signal {
  0% { background-position: 0 0, 0px 0px, right 3.5% top calc(var(--fx-rw) * 0/3); }
  2.78% { background-position: 0 0, -62px -192px, right 3.5% top calc(var(--fx-rw) * 0/3); }
  5.56% { background-position: 0 0, -141px -60px, right 3.5% top calc(var(--fx-rw) * 0/3); }
  8.33% { background-position: 0 0, -62px -87px, right 3.5% top calc(var(--fx-rw) * -5/3); }
  11.11% { background-position: 0 0, -213px -210px, right 3.5% top calc(var(--fx-rw) * -5/3); }
  13.89% { background-position: 0 0, -65px -150px, right 3.5% top calc(var(--fx-rw) * -5/3); }
  16.67% { background-position: 0 0, -140px -177px, right 3.5% top calc(var(--fx-rw) * -10/3); }
  19.44% { background-position: 0 0, -187px -210px, right 3.5% top calc(var(--fx-rw) * -10/3); }
  22.22% { background-position: 0 0, -134px -129px, right 3.5% top calc(var(--fx-rw) * -10/3); }
  25% { background-position: 0 0, -150px -138px, right 3.5% top calc(var(--fx-rw) * -15/3); }
  27.78% { background-position: 0 0, -99px -105px, right 3.5% top calc(var(--fx-rw) * -15/3); }
  30.56% { background-position: 0 0, -103px 0px, right 3.5% top calc(var(--fx-rw) * -15/3); }
  33.33% { background-position: 0 0, -218px -42px, right 3.5% top calc(var(--fx-rw) * -20/3); }
  36.11% { background-position: 0 0, -7px -204px, right 3.5% top calc(var(--fx-rw) * -20/3); }
  38.89% { background-position: 0 0, -66px -12px, right 3.5% top calc(var(--fx-rw) * -20/3); }
  41.67% { background-position: 0 0, -122px -66px, right 3.5% top calc(var(--fx-rw) * -25/3); }
  44.44% { background-position: 0 0, -88px -114px, right 3.5% top calc(var(--fx-rw) * -25/3); }
  47.22% { background-position: 0 0, -94px -171px, right 3.5% top calc(var(--fx-rw) * -25/3); }
  50% { background-position: 0 0, -201px -72px, right 3.5% top calc(var(--fx-rw) * -30/3); }
  52.78% { background-position: 0 0, -195px -9px, right 3.5% top calc(var(--fx-rw) * -30/3); }
  55.56% { background-position: 0 0, -112px -63px, right 3.5% top calc(var(--fx-rw) * -30/3); }
  58.33% { background-position: 0 0, -120px -3px, right 3.5% top calc(var(--fx-rw) * -35/3); }
  61.11% { background-position: 0 0, -15px -39px, right 3.5% top calc(var(--fx-rw) * -35/3); }
  63.89% { background-position: 0 0, -210px -39px, right 3.5% top calc(var(--fx-rw) * -35/3); }
  66.67% { background-position: 0 0, -44px -210px, right 3.5% top calc(var(--fx-rw) * -40/3); }
  69.44% { background-position: 0 0, -118px -6px, right 3.5% top calc(var(--fx-rw) * -40/3); }
  72.22% { background-position: 0 0, -174px -165px, right 3.5% top calc(var(--fx-rw) * -40/3); }
  75% { background-position: 0 0, -106px -75px, right 3.5% top calc(var(--fx-rw) * -45/3); }
  77.78% { background-position: 0 0, -94px -42px, right 3.5% top calc(var(--fx-rw) * -45/3); }
  80.56% { background-position: 0 0, -124px -210px, right 3.5% top calc(var(--fx-rw) * -45/3); }
  83.33% { background-position: 0 0, -199px -66px, right 3.5% top calc(var(--fx-rw) * -50/3); }
  86.11% { background-position: 0 0, -150px -135px, right 3.5% top calc(var(--fx-rw) * -50/3); }
  88.89% { background-position: 0 0, -115px -189px, right 3.5% top calc(var(--fx-rw) * -50/3); }
  91.67% { background-position: 0 0, -30px -198px, right 3.5% top calc(var(--fx-rw) * -55/3); }
  94.44% { background-position: 0 0, -195px -168px, right 3.5% top calc(var(--fx-rw) * -55/3); }
  97.22% { background-position: 0 0, -166px -3px, right 3.5% top calc(var(--fx-rw) * -55/3); }
}
/* the glitch burst: the static flares, the runes blink and the picture slips sideways */
@keyframes fx-burst {
  0%, 86% { opacity: var(--fx-o); } 86.6% { opacity: 1; } 87.4% { opacity: .3; } 88.2% { opacity: 1; } 89.4%, 100% { opacity: var(--fx-o); }
}
@keyframes fx-img-glitch {
  86.6% { translate: -5px 0; } 87.4% { translate: 4px 0; } 88.2% { translate: -2px 0; } 89.4% { translate: 0 0; }
}

/* ---------- the black hole ----------
   A fixed backdrop behind the content (markup: the .black-hole block at the top
   of header.html). Its accretion disk is tilted flat (rotateX) and spins in its
   own plane; the back of the disk passes behind the event horizon and a clipped
   copy of the front half passes in front of it. A lensed halo rings the horizon,
   brighter on top where light from the far side of the disk bends over it.
   Colors follow the section (--red, --red-hot, --red-dark, --glow from
   section-themes.css); they are registered so a section change fades them. */
@property --bh-hot  { syntax: "<color>"; inherits: true; initial-value: #d4ff3a; }
@property --bh-main { syntax: "<color>"; inherits: true; initial-value: #3ddc00; }
@property --bh-dark { syntax: "<color>"; inherits: true; initial-value: #1c7a00; }
@property --bh-glow { syntax: "<color>"; inherits: true; initial-value: rgba(120, 255, 40, .45); }
.black-hole, .nebula {             /* the black hole and the nebula storm share the fading section colors */
  --bh-hot: var(--red-hot, #d4ff3a); --bh-main: var(--red, #3ddc00); --bh-dark: var(--red-dark, #1c7a00); --bh-glow: var(--glow, rgba(120, 255, 40, .45));
  transition: --bh-hot 1.6s ease, --bh-main 1.6s ease, --bh-dark 1.6s ease, --bh-glow 1.6s ease;
}
.black-hole {
  /* centered in the right-hand margin beside the 1240px content column, sized so the
     horizon (31% of --bh) fills that margin on wide screens; narrower windows see its edge */
  --bh: clamp(560px, (100vw - 1240px) * 1.7, 1080px);
  position: fixed; z-index: -1; pointer-events: none; width: var(--bh); height: var(--bh);
  left: calc(100vw - max(60px, (100vw - 1240px) / 4) - var(--bh) / 2); top: calc(50vh - var(--bh) / 2);
  rotate: -16deg; opacity: .92;
}
.black-hole > span { position: absolute; inset: 0; }
.black-hole > .bh-glow {
  inset: -12%; border-radius: 50%;
  background: radial-gradient(closest-side, var(--bh-glow), transparent 62%);
  opacity: .5; animation: bh-breathe 9s ease-in-out infinite;
}
/* the disk: light from the side turning toward us is brighter (Doppler beaming) */
.bh-back, .bh-front { -webkit-mask: linear-gradient(90deg, rgba(0, 0, 0, .38), #000 72%); mask: linear-gradient(90deg, rgba(0, 0, 0, .38), #000 72%); }
.bh-front { clip-path: inset(50% 0 41.5% 0); }   /* only the near rim crosses in front of the horizon */
.bh-disk {
  position: absolute; inset: 0; border-radius: 50%;
  background:
    radial-gradient(closest-side, transparent 30%, #fff 31.5%, color-mix(in srgb, var(--bh-hot) 60%, #fff) 33%, var(--bh-hot) 37%, transparent 50%),
    repeating-radial-gradient(closest-side, var(--bh-hot) 0, var(--bh-main) 1.6%, var(--bh-dark) 3.1%, var(--bh-main) 4.3%, var(--bh-hot) 5.6%),
    radial-gradient(closest-side, var(--bh-hot) 30%, var(--bh-main) 55%, var(--bh-dark) 100%);
  background-blend-mode: normal, soft-light, normal;
  -webkit-mask: radial-gradient(closest-side, transparent 29.5%, #000 31.5%, rgba(0, 0, 0, .85) 50%, rgba(0, 0, 0, .3) 76%, transparent 100%);
  mask: radial-gradient(closest-side, transparent 29.5%, #000 31.5%, rgba(0, 0, 0, .85) 50%, rgba(0, 0, 0, .3) 76%, transparent 100%);
  transform: rotateX(73deg) rotateZ(0deg); animation: bh-spin 30s linear infinite; will-change: transform;
}
/* bright and dark clumps orbiting at different speeds make the spin visible */
.bh-disk::before, .bh-disk::after { content: ""; position: absolute; inset: 0; border-radius: 50%; }
.bh-disk::before {
  background: conic-gradient(from 20deg, rgba(0, 0, 0, .62), transparent 38deg 70deg, rgba(0, 0, 0, .5) 105deg, transparent 150deg 190deg, rgba(0, 0, 0, .66) 230deg, transparent 275deg 315deg, rgba(0, 0, 0, .62));
}
.bh-disk::after {
  background: conic-gradient(from 80deg, transparent, rgba(255, 255, 255, .5) 24deg, transparent 52deg 160deg, rgba(255, 255, 255, .38) 188deg, transparent 214deg 290deg, rgba(255, 255, 255, .3) 318deg, transparent 345deg);
  mix-blend-mode: overlay; animation: bh-swirl 11s linear infinite reverse;
}
/* the event horizon with its thin photon ring */
.black-hole > .bh-core {
  inset: 34.5%; border-radius: 50%; background: #000;
  box-shadow:
    0 0 0 calc(var(--bh) * .0025) color-mix(in srgb, var(--bh-hot) 85%, #fff),
    0 0 calc(var(--bh) * .018) calc(var(--bh) * .004) var(--bh-hot),
    0 0 calc(var(--bh) * .07) calc(var(--bh) * .012) var(--bh-glow),
    inset 0 0 calc(var(--bh) * .03) #000;
}
/* the lensed halo around it */
.black-hole > .bh-lens {
  inset: 29%; border-radius: 50%;
  background: radial-gradient(closest-side, transparent 72%, color-mix(in srgb, var(--bh-hot) 65%, #fff) 77%, var(--bh-hot) 82%, var(--bh-main) 90%, transparent 100%);
  -webkit-mask: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, .9) 30%, rgba(0, 0, 0, .18) 58%, rgba(0, 0, 0, .5) 100%);
  mask: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, .9) 30%, rgba(0, 0, 0, .18) 58%, rgba(0, 0, 0, .5) 100%);
  animation: bh-flicker 6.5s ease-in-out infinite;
}
@keyframes bh-spin { from { transform: rotateX(73deg) rotateZ(0deg); } to { transform: rotateX(73deg) rotateZ(360deg); } }
@keyframes bh-swirl { to { transform: rotate(360deg); } }
@keyframes bh-breathe { 0%, 100% { opacity: .42; scale: 1; } 50% { opacity: .62; scale: 1.06; } }
@keyframes bh-flicker { 0%, 100% { opacity: .85; } 40% { opacity: 1; } 43% { opacity: .7; } 46% { opacity: 1; } }
@media (max-width: 760px) {
  .black-hole { --bh: 118vmin; left: calc(100vw - var(--bh) * .38); top: calc(56vh - var(--bh) / 2); opacity: .7; }
}

/* ---------- the nebula storm ----------
   Fixed in the left-hand margin, opposite the black hole (markup: the .nebula
   block at the top of header.html). Billowing cloud masses in the section's main
   and dark colors, bright wisps in its light tint and dark dust lanes, each layer
   turning at its own pace, with lightning that strikes in a new spot each time
   and lights up the clouds around it. The clouds and bolts are masks from
   ../tools/fx/make_nebula_storm.py, filled with the same fading colors as the
   black hole; a round fade keeps the turning layers free of corners. */
.nebula {
  --nb: clamp(640px, (100vw - 1240px) * 2.3, 1320px);
  position: fixed; z-index: -1; pointer-events: none; width: var(--nb); height: var(--nb);
  left: calc(max(60px, (100vw - 1240px) / 4) - var(--nb) / 2); top: calc(46vh - var(--nb) / 2);
  opacity: .9;
}
.nebula > span {
  position: absolute; inset: 0;
  -webkit-mask-composite: source-in; mask-composite: intersect;
  will-change: rotate, scale;
}
.nebula > .nb-mass {             /* the main cloud masses */
  background: linear-gradient(125deg, var(--bh-dark) 15%, var(--bh-main) 45%, var(--bh-hot) 62%, var(--bh-dark) 88%);
  -webkit-mask-image: url("assets/nebula-cloud-a.svg"), radial-gradient(ellipse 46% 30% at 40% 56%, #000 5%, rgba(0, 0, 0, .45) 55%, transparent 100%);
  -webkit-mask-size: calc(var(--nb) * .9) calc(var(--nb) * .9), 100% 100%;
  mask: url("assets/nebula-cloud-a.svg") 0 0 / calc(var(--nb) * .9) calc(var(--nb) * .9), radial-gradient(ellipse 46% 30% at 40% 56%, #000 5%, rgba(0, 0, 0, .45) 55%, transparent 100%);
  mask-composite: intersect;
  opacity: .72; animation: nb-turn 240s linear infinite, nb-churn 19s ease-in-out infinite;
}
.nebula > .nb-dust {             /* dark lanes of dust drifting across the glow */
  inset: 6%; background: #010302;
  -webkit-mask-image: url("assets/nebula-cloud-b.svg"), radial-gradient(ellipse 40% 24% at 48% 52%, #000 20%, transparent 100%);
  -webkit-mask-size: calc(var(--nb) * .7) calc(var(--nb) * .7), 100% 100%;
  -webkit-mask-position: 61% 23%, 0 0;
  mask: url("assets/nebula-cloud-b.svg") 61% 23% / calc(var(--nb) * .7) calc(var(--nb) * .7), radial-gradient(ellipse 40% 24% at 48% 52%, #000 20%, transparent 100%);
  mask-composite: intersect;
  opacity: .42; animation: nb-turn 170s linear infinite reverse;
}
.nebula > .nb-wisp {             /* bright filaments in the section's light tint */
  inset: 10%; background: radial-gradient(closest-side, var(--bh-hot), var(--bh-main) 60%, var(--bh-dark));
  -webkit-mask-image: url("assets/nebula-cloud-b.svg"), radial-gradient(ellipse 40% 26% at 60% 40%, #000 10%, rgba(0, 0, 0, .4) 55%, transparent 100%);
  -webkit-mask-size: calc(var(--nb) * .5) calc(var(--nb) * .5), 100% 100%;
  -webkit-mask-position: 37% 61%, 0 0;
  mask: url("assets/nebula-cloud-b.svg") 37% 61% / calc(var(--nb) * .5) calc(var(--nb) * .5), radial-gradient(ellipse 40% 26% at 60% 40%, #000 10%, rgba(0, 0, 0, .4) 55%, transparent 100%);
  mask-composite: intersect;
  opacity: .7; mix-blend-mode: screen; animation: nb-turn 130s linear infinite, nb-churn 13s ease-in-out -6s infinite;
}
.nebula > .nb-flash {            /* the storm lighting up the clouds around each strike */
  inset: 18%; background: radial-gradient(closest-side, color-mix(in srgb, var(--bh-hot) 45%, #fff), var(--bh-hot) 30%, transparent 78%);
  -webkit-mask-image: url("assets/nebula-cloud-a.svg"), radial-gradient(closest-side, #000 40%, transparent 100%);
  -webkit-mask-size: calc(var(--nb) * .5) calc(var(--nb) * .5), 100% 100%;
  mask: url("assets/nebula-cloud-a.svg") 0 0 / calc(var(--nb) * .5) calc(var(--nb) * .5), radial-gradient(closest-side, #000 40%, transparent 100%);
  mask-composite: intersect;
  opacity: 0; animation: nb-flash 12.5s linear infinite, nb-strike-spot 12.5s steps(1, end) infinite;
}
.nebula > .nb-bolt {             /* the lightning itself */
  inset: 18%; background: color-mix(in srgb, var(--bh-hot) 30%, #fff);
  -webkit-mask: url("assets/nebula-lightning.svg") center / contain no-repeat; mask: url("assets/nebula-lightning.svg") center / contain no-repeat;
  opacity: 0; animation: nb-bolt 12.5s steps(1, end) infinite, nb-strike-spot 12.5s steps(1, end) infinite;
}
@keyframes nb-turn { to { rotate: 360deg; } }
@keyframes nb-churn { 0%, 100% { scale: 1; } 50% { scale: 1.07; } }
/* two strikes per cycle, the second somewhere else; the flash follows the bolt */
@keyframes nb-bolt {
  0%    { opacity: 0; }
  28%   { opacity: .95; } 28.5% { opacity: .1; } 29.1% { opacity: 1; } 29.9% { opacity: .35; } 30.6% { opacity: 0; }
  71%   { opacity: .9; } 71.6% { opacity: 0; } 72.2% { opacity: .85; } 73%  { opacity: 0; }
}
/* the bolt and its glow move together to a new spot while dark */
@keyframes nb-strike-spot {
  0% { translate: 0 0; rotate: 0deg; } 45% { translate: 16% 13%; rotate: 128deg; } 88% { translate: -12% -9%; rotate: 236deg; }
}
@keyframes nb-flash {
  0%, 27.8% { opacity: 0; } 28% { opacity: .55; } 28.5% { opacity: .15; } 29.1% { opacity: .7; } 31.5% { opacity: 0; }
  70.8% { opacity: 0; } 71% { opacity: .5; } 71.6% { opacity: .1; } 72.2% { opacity: .55; } 74.5%, 100% { opacity: 0; }
}
@media (max-width: 760px) {
  .nebula { --nb: 125vmin; left: calc(var(--nb) * -.42); top: calc(38vh - var(--nb) / 2); opacity: .7; }
}

@media (max-width: 760px) {
  body::before { opacity: .1; }
  html::after { opacity: .3; }
}

@media (prefers-reduced-motion: reduce) {
  html::before, body::after { display: none; }
  .bh-disk, .bh-disk::after, .bh-glow, .bh-lens, .nebula > span { animation: none; }
  .nebula > .nb-flash, .nebula > .nb-bolt { display: none; }
  body::before, html::after, .site-header::before,
  .story .thumb::before, .side-item .thumb::before, .showcase-image::before,
  .archive-feature .frame::before, #hero .hero-main:not(.has-art) .media-card .frame::before,
  .story .thumb::after, .showcase-image::after,
  .archive-feature .frame::after, #hero .hero-main:not(.has-art) .media-card .frame::after,
  #hero .has-art .art-tile::before, .showcase-hero .has-art .art-tile::before, .article-top .story-paper-art::before,
  .thumb > img, .showcase-image > img, .frame > img, .art-tile > img { animation: none; }
}
