/* SPDX-License-Identifier: AGPL-3.0-or-later
 *
 * The world behind every surface.
 *
 * A flat #14100c is a hex code, not a room. What makes Brass & Soot read as a
 * place is four things a screen can do for free: light arriving from a known
 * direction, air with dust in it, corners that fall away, and a grain that
 * stops the gradients from banding. All four are theme tokens, so a theme
 * that wants none of them sets its strengths to zero and gets a flat page
 * back - Ministry Grey is supposed to look like a government form.
 *
 * Constraints this layer holds itself to:
 *
 *   - ZERO extra DOM. Four pseudo-elements across <html> and <body>. The wall
 *     is a list of articles and stays one.
 *   - ZERO hit testing. Every layer is `pointer-events: none` and fixed, so
 *     nothing here can ever eat a tap or shift a layout.
 *   - Motion is transform-only. Animating `background-position` repaints a
 *     viewport-sized layer every frame; animating `transform` hands it to the
 *     compositor and costs approximately nothing, which is the whole reason
 *     the embers are allowed to exist at all.
 */

:root {
  /* The tile the embers repeat on. The drift animation translates by exactly
     this distance, which is what makes the loop seamless - any other number
     and the field visibly jumps once a minute.
   *
     It was 520 and 340, and the first attempt at fixing the lattice moved
     the dots around INSIDE the tile. That was the wrong half of the problem:
     the eye groups on the repeat, not on the arrangement, and three
     identical bright specks at the same height across a 1440px screen read
     as a print flaw however they are placed. 520 gives 2.8 repeats per
     screen; 1180 gives 1.2, so the second copy of any dot is usually off the
     edge. The dot count doubles with the area to keep the density. */
  --ember-tile: 1180px;
  --ember-tile-far: 870px;
}

/* ---- Layer 1: the light ------------------------------------------------ */

/* Fixed, so the light belongs to the room rather than to the scroll position.
   Three gradients: coals below the fold, cold sky above it, and a vignette
   that closes the corners. Painted on <html> so it sits under everything,
   including <body>'s own background where a theme sets one. */
html::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -3;
  pointer-events: none;
  background-image:
    /* The forge, and it is off centre. Low and to the start edge, so the
       page has an azimuth rather than a symmetry - the same direction every
       bevel and every shadow now agrees on. Measured before this change,
       both gutters of a scrolled wall were identical to within 0.2 of a
       luminance level at every height, which is what a room with no light
       position looks like. */
    radial-gradient(120% 78% at 38% 116%,
      color-mix(in oklab, var(--atmos-forge) var(--atmos-forge-strength), transparent),
      transparent 64%),
    /* The cold half, thrown the other way. Without it the glow reads as a
       yellow cast over the whole screen instead of as a light source with
       somewhere to fall off to. */
    radial-gradient(100% 70% at 62% -24%,
      color-mix(in oklab, var(--atmos-sky) var(--atmos-sky-strength), transparent),
      transparent 62%),
    /* A vignette that actually closes the sides.
     *
       At 135% x 105% the horizontal mid-edge sits at (W/2)/(1.35W) = 0.370
       of the ellipse - inside the `transparent 42%` stop, at every viewport
       size, permanently. Measured across a full 1440px row: a range of 0.06
       luminance levels. It was not a vignette, it was a letterbox.
     *
       82% x 84% puts the mid-edge at 0.61 and the corner past 1.0, which is
       the ~60% corner-to-edge ratio a lens actually has.
     *
       An earlier version of this comment claimed the longer ramp was also a
       banding fix, "the same luminance delta spread over more pixels makes
       each 8-bit terrace narrower". That is inverted twice over and the
       rendered plate said so. The number of terraces is set by the DELTA -
       N levels means N contours - and width is pixels divided by levels, so
       a longer ramp makes each terrace WIDER, and a deeper one adds more of
       them. The vignette got better and the banding got worse, directly
       because of it.
     *
       This used to quote a delta going "from 2.8 levels to 6.7" and terraces
       "82-85px where the old ramp gave 17-23px". Neither number could be
       reproduced against any theme afterwards, and a reviewer built a target
       on the 6.7 and spent a round of review on it. So the before-and-after
       is retired rather than restated - the geometry it compared against is
       no longer in this file to measure - and what is stated is what can be
       measured now, with the grain off, centre against a corner patch:
     *
         Brass & Soot      3.5 levels     narrowest plateau 78px
         Ljubljana Night   6.2 levels     narrowest plateau 13px
         Foolscap         13.1 levels     narrowest plateau 28px
     *
       Ljubljana's ramp is the steepest and therefore the most banded, which
       is the trade this section is about.
     *
       That is the right trade - a real lens vignette is a stop or more - but
       only if the quantisation is then dealt with, which is what the warm
       --atmos-vignette and the grain amplitude below are for.
     *
       And it is centred at 43% 46%, not 50% 50%, because the falloff in a
       lit room is not symmetric about the frame - it is biased away from the
       light. With it centred, the two gutters measured identical to within
       0.01 of a level at every height except where the forge itself reached,
       which meant the azimuth existed only in the bottom eighth of the
       screen. */
    /* One ramp, and this is where the banding fight stops.
     *
       Four things were tried against a reviewer's criterion - the blurred
       profile monotonic to within 0.3 of a level - and all four are recorded
       here because the negative results cost as much to get as the positive
       ones and are worth more to whoever reads this next:
     *
       - Splitting the vignette into two and then three ramps at a fraction
         of the alpha each, so their contours interleave. Sound in theory.
         Measured WORSE: residual 0.516 for one ramp, 0.742 for three,
         because overlapping alpha compositing does not sum the way the
         argument assumes.
       - Blending noise into this background stack so it lands before
         quantisation. Needs an opaque backdrop or it washes every theme to
         mid-grey - Brass & Soot measured 85 where its ground is 17 - and
         with the backdrop, `overlay` lifts the black point (17 to 23) while
         still missing the target.
       - Moving the whole atmosphere into an SVG filter graph with
         feTurbulence composited arithmetically. This one WORKS, and gains
         14%. It also bakes the gradient's colours into a data-URI, which
         ends the --atmos-* tokens and with them a theme's ability to own the
         room. Not a trade this file will make.
       - What did land: the warm vignette, which decorrelates where the three
         channels step, and the grain amplitude, measured properly.
     *
       Where it rests: residual max 0.52, rms 0.204, against a 0.30 target.
       Better than the 0.90 it started at, short of the bar, and honest about
       which. */
    radial-gradient(82% 84% at 43% 46%, transparent 30%, var(--atmos-vignette) 100%);
}

/* ---- Layer 2: the air -------------------------------------------------- */

/* Two ember fields at different depths. Same idea as a matte painting: the
   far field is smaller, dimmer and slower, and the parallax between them is
   what the eye reads as distance. One field alone reads as dirt on the
   screen.
 *
 * The layer is taller than the viewport by two tiles and anchored one tile
 * above it, so translating up by one tile never exposes an edge. */
html::after,
body::before {
  content: "";
  position: fixed;
  inset-inline: 0;
  pointer-events: none;
  opacity: var(--ember-opacity);
  background-repeat: repeat;
  /* The compositor needs to know these move before the first frame, or the
     first loop stutters while it promotes the layer. */
  will-change: transform;
}

/* The far field: larger, softer, dimmer.
 *
   It used to be the CRISPER of the two, which is backwards - defocus is the
   strongest depth cue the eye has, and a 1px hard dot at distance reads as a
   speck on the glass rather than as something far away. Now it is drawn
   bigger and blurred, and the near field is the sharp one. Size does not
   carry the depth; focus does. */
html::after {
  z-index: -2;
  inset-block-start: calc(var(--ember-tile-far) * -1);
  block-size: calc(100dvh + var(--ember-tile-far) * 2);
  background-image:
    radial-gradient(1.6px 1.6px at 12% 33%, color-mix(in oklab, var(--ember-near) 55%, transparent), transparent 60%),
    radial-gradient(1.2px 1.2px at 71% 19%, color-mix(in oklab, var(--ember-near) 30%, transparent), transparent 60%),
    radial-gradient(1.9px 1.9px at 47% 77%, color-mix(in oklab, var(--ember-near) 50%, transparent), transparent 60%),
    radial-gradient(1.1px 1.1px at 88% 46%, color-mix(in oklab, var(--ember-near) 22%, transparent), transparent 60%),
    radial-gradient(1.5px 1.5px at 31% 62%, color-mix(in oklab, var(--ember-near) 38%, transparent), transparent 60%),
    radial-gradient(1.0px 1.0px at 58% 91%, color-mix(in oklab, var(--ember-near) 25%, transparent), transparent 60%),
    radial-gradient(1.7px 1.7px at 4% 8%, color-mix(in oklab, var(--ember-near) 45%, transparent), transparent 60%),
    radial-gradient(1.1px 1.1px at 23% 51%, color-mix(in oklab, var(--ember-near) 20%, transparent), transparent 60%),
    radial-gradient(1.4px 1.4px at 39% 14%, color-mix(in oklab, var(--ember-near) 33%, transparent), transparent 60%),
    radial-gradient(1.0px 1.0px at 66% 68%, color-mix(in oklab, var(--ember-near) 21%, transparent), transparent 60%),
    radial-gradient(1.8px 1.8px at 81% 5%, color-mix(in oklab, var(--ember-near) 42%, transparent), transparent 60%),
    radial-gradient(1.2px 1.2px at 94% 83%, color-mix(in oklab, var(--ember-near) 28%, transparent), transparent 60%),
    radial-gradient(1.5px 1.5px at 17% 96%, color-mix(in oklab, var(--ember-near) 36%, transparent), transparent 60%),
    radial-gradient(1.0px 1.0px at 53% 42%, color-mix(in oklab, var(--ember-near) 23%, transparent), transparent 60%),
    radial-gradient(1.3px 1.3px at 78% 57%, color-mix(in oklab, var(--ember-near) 32%, transparent), transparent 60%),
    radial-gradient(1.1px 1.1px at 36% 29%, color-mix(in oklab, var(--ember-near) 18%, transparent), transparent 60%),
    radial-gradient(1.6px 1.6px at 61% 49%, color-mix(in oklab, var(--ember-near) 40%, transparent), transparent 60%),
    radial-gradient(1.2px 1.2px at 8% 72%, color-mix(in oklab, var(--ember-near) 26%, transparent), transparent 60%),
    radial-gradient(1.4px 1.4px at 86% 27%, color-mix(in oklab, var(--ember-near) 34%, transparent), transparent 60%),
    radial-gradient(1.0px 1.0px at 28% 11%, color-mix(in oklab, var(--ember-near) 19%, transparent), transparent 60%),
    radial-gradient(1.7px 1.7px at 49% 85%, color-mix(in oklab, var(--ember-near) 44%, transparent), transparent 60%),
    radial-gradient(1.1px 1.1px at 73% 36%, color-mix(in oklab, var(--ember-near) 24%, transparent), transparent 60%),
    radial-gradient(1.3px 1.3px at 15% 58%, color-mix(in oklab, var(--ember-near) 29%, transparent), transparent 60%),
    radial-gradient(1.5px 1.5px at 97% 64%, color-mix(in oklab, var(--ember-near) 37%, transparent), transparent 60%),
    radial-gradient(1.0px 1.0px at 42% 70%, color-mix(in oklab, var(--ember-near) 20%, transparent), transparent 60%),
    radial-gradient(1.2px 1.2px at 64% 3%, color-mix(in oklab, var(--ember-near) 27%, transparent), transparent 60%),
    radial-gradient(1.6px 1.6px at 21% 40%, color-mix(in oklab, var(--ember-near) 41%, transparent), transparent 60%),
    radial-gradient(1.1px 1.1px at 90% 95%, color-mix(in oklab, var(--ember-near) 23%, transparent), transparent 60%),
    radial-gradient(1.4px 1.4px at 2% 25%, color-mix(in oklab, var(--ember-near) 31%, transparent), transparent 60%),
    radial-gradient(1.0px 1.0px at 57% 17%, color-mix(in oklab, var(--ember-near) 22%, transparent), transparent 60%);
  background-size: var(--ember-tile-far) var(--ember-tile-far);
  filter: blur(1.4px);
  animation: ember-far 97s linear infinite;
}

/* The near field: sharp, denser, and much dimmer than it was.
 *
   Clustering every bright outlier on a screenshot showed the old field
   sitting on an exact lattice - three to five dots per row, at identical y,
   repeating every 520px across the viewport - with peaks +50 luminance over
   a 16.8 ambient. That is 4:1 local contrast in a 2px dot: the brightest
   non-text pixels on the page, arranged in rows. The eye is very good at
   collinearity, and the read was dirt rather than air.
 *
   Thirty dots at irregular x AND y, a 3:1 spread of per-dot brightness via
   the mix percentage, and a top end at 55% of --ember-near rather than
   100% - the first attempt claimed to have cut the peak to a sixth and had
   not touched it at all, because the brightest dots were still being drawn
   at full strength. Dust is many faint things at different distances, not a
   few bright ones. */
body::before {
  z-index: -1;
  inset-block-start: calc(var(--ember-tile) * -1);
  block-size: calc(100dvh + var(--ember-tile) * 2);
  background-image:
    radial-gradient(1.6px 1.6px at 12% 33%, var(--ember-near), transparent 60%),
    radial-gradient(1.2px 1.2px at 71% 19%, color-mix(in oklab, var(--ember-near) 55%, transparent), transparent 60%),
    radial-gradient(1.9px 1.9px at 47% 77%, var(--ember-near), transparent 60%),
    radial-gradient(1.1px 1.1px at 88% 46%, color-mix(in oklab, var(--ember-near) 40%, transparent), transparent 60%),
    radial-gradient(1.5px 1.5px at 31% 62%, color-mix(in oklab, var(--ember-near) 70%, transparent), transparent 60%),
    radial-gradient(1.0px 1.0px at 58% 91%, color-mix(in oklab, var(--ember-near) 45%, transparent), transparent 60%),
    radial-gradient(1.7px 1.7px at 4% 8%, color-mix(in oklab, var(--ember-near) 80%, transparent), transparent 60%),
    radial-gradient(1.1px 1.1px at 23% 51%, color-mix(in oklab, var(--ember-near) 35%, transparent), transparent 60%),
    radial-gradient(1.4px 1.4px at 39% 14%, color-mix(in oklab, var(--ember-near) 60%, transparent), transparent 60%),
    radial-gradient(1.0px 1.0px at 66% 68%, color-mix(in oklab, var(--ember-near) 38%, transparent), transparent 60%),
    radial-gradient(1.8px 1.8px at 81% 5%, color-mix(in oklab, var(--ember-near) 75%, transparent), transparent 60%),
    radial-gradient(1.2px 1.2px at 94% 83%, color-mix(in oklab, var(--ember-near) 50%, transparent), transparent 60%),
    radial-gradient(1.5px 1.5px at 17% 96%, color-mix(in oklab, var(--ember-near) 65%, transparent), transparent 60%),
    radial-gradient(1.0px 1.0px at 53% 42%, color-mix(in oklab, var(--ember-near) 42%, transparent), transparent 60%),
    radial-gradient(1.3px 1.3px at 78% 57%, color-mix(in oklab, var(--ember-near) 58%, transparent), transparent 60%),
    radial-gradient(1.1px 1.1px at 36% 29%, color-mix(in oklab, var(--ember-near) 33%, transparent), transparent 60%);
  background-size: var(--ember-tile) var(--ember-tile);
  animation: ember-near 61s linear infinite;
}

/* Embers rise. A sideways component, because a dead-vertical drift reads as a
   texture being scrolled rather than as anything in the air - but it has to
   be small, since the tile only repeats seamlessly on the vertical axis. */
@keyframes ember-near {
  from { transform: translate3d(0, 0, 0); }
  to   { transform: translate3d(6px, calc(var(--ember-tile) * -1), 0); }
}
@keyframes ember-far {
  from { transform: translate3d(0, 0, 0); }
  to   { transform: translate3d(-4px, calc(var(--ember-tile-far) * -1), 0); }
}

/* ---- Layer 3: the grain ------------------------------------------------ */

/* Above the content, not behind it - that is the difference between a
 * textured background and a photographed image, and it is the single cheapest
 * thing on this page that makes it stop looking like a web page.
 *
 * What it is NOT, and what this comment claimed for three revisions, is
 * dithering.
 *
 * A true dither averages back to a smooth ramp under blur. This one does not:
 * blurring a rendered page with a 4px Gaussian still resolves the vignette
 * into four to eight flat plateaus - 78px at the narrowest in Brass & Soot,
 * 13px in Ljubljana Night, whose ramp is steeper. (This said "17 to 20
 * pixels wide" until the numbers were checked, contradicting the vignette
 * section 170 lines above by a factor of four. It was quoting the geometry
 * that section had already replaced.)
 *
 * The reason is structural and no opacity fixes it - the browser rasterises
 * the gradient to 8 bits FIRST and composites this layer over the result, so
 * the noise is statistically independent of the quantisation error it would
 * have to cancel. It can mask a contour. It cannot reconstruct one.
 *
 * So the repeat is broken here instead. One 180px tile is wallpaper, stamped
 * eight by five per viewport, and it measures as such: the grain residual
 * correlates with itself at 0.92 at lag 180. Two coprime tiles blended
 * together bring that to 0.43, and the combined pattern repeats at
 * lcm(180, 173) = 31,140px, which is to say never.
 *
 * That last number is the only structural claim in this file, and it is the
 * one that had no test - deleting the second tile moves the black point not
 * at all and the amplitude barely, so both grain gates passed a wall that
 * had gone back to wallpaper. `bin/vault shots` measures the correlation
 * now. (It also said 0.83 here for a while, from a measurement nobody could
 * reproduce; 0.92 is this method, on this page, at the shipped opacity.)
 *
 * ---- The three attributes that are not decoration ----------------------
 *
 * `color-interpolation-filters='sRGB'`, the alpha clamp and the -0.02 bias
 * look like one fix. They are three, doing three different jobs, and the
 * first draft of this comment credited the wrong one - so each is ablated
 * below rather than asserted.
 *
 * The defect was that this layer was not a grain. It was a light.
 *
 * SVG filters interpolate in linearRGB unless told otherwise, so the noise
 * was generated in linear space and converted up for display, which lands
 * the band high: measured alone against white, mean 221 of 255. That is not
 * a zero-mean modulation, it is a source with a DC offset of +93 levels, and
 * soft-light on a dark ground is one-sided - for b < 0.5 it evaluates to
 * 2ab + a^2(1-2b), lifting far more than it darkens. The room paid for its
 * grain in black point:
 *
 *                       ground    with the old grain
 *   Brass & Soot         17.00    21.84   (+4.84)
 *   Ljubljana Night      17.00    21.45   (+4.45)
 *   the darkest plate     5.00     7.47   (+2.47, half again as bright)
 *
 * Removing each attribute in turn, at the shipped opacity, says which does
 * what - Brass & Soot, ground 17.00:
 *
 *                         black point   sigma
 *   as shipped                  16.90   1.260
 *   without sRGB                22.71   0.987    <- the DC fix, +5.71
 *   without the alpha clamp     16.99   0.814    <- amplitude, not DC
 *   without the -0.02 bias      17.43   1.392    <- soft-light's residual
 *
 * So: sRGB is what stops the layer being a light. feTurbulence also emits
 * noise in the ALPHA channel, so a rect painted with its raw output is noise
 * seen through holes of varying transparency - clamping alpha opaque changes
 * no black point at all, it buys 55% more amplitude for the same opacity by
 * making the layer modulate instead of perforate. And soft-light's asymmetry
 * survives a perfectly centred band, which is the last 0.43 of a level; the
 * bias cancels it by putting the band's centre a touch below neutral so the
 * mean of the OUTPUT, not the input, is the ground.
 *
 * The vignette and the azimuth were being inflated by the same hand, because
 * soft-light lifts a brighter pixel more than a darker one: Ljubljana's
 * vignette read 7.06 against the 6.01 its gradient actually draws, and its
 * azimuth 2.38 against 1.92. Every atmospheric number in this file was being
 * read through a layer that was quietly adding to all of them.
 *
 * Generating in sRGB, forcing alpha opaque so the noise modulates rather than
 * perforates, and biasing the band down 0.02 to cancel soft-light's residual
 * asymmetry leaves the room where the gradients put it, and buys amplitude
 * rather than spending it:
 *
 *                       ground     now            sigma
 *   Brass & Soot         17.00    16.90  (-0.10)  1.16 -> 1.26
 *   Ljubljana Night      17.00    16.95  (-0.05)  0.98 -> 1.11
 *   the darkest plate     5.00     5.19  (+0.19)  0.59 -> 0.53
 *
 * Ljubljana's vignette now measures 6.01 and its azimuth 1.91 - the numbers
 * the gradients draw, neither flattered nor flattened. Both dark themes
 * clear one code value of grain for the first time, on a ground that is
 * finally as dark as it was designed to be.
 *
 * The previous comment also claimed soft-light "does nothing at all" on the
 * darkest plate, thirty-five rows at identical luminance, variance zero. It
 * was wrong twice: the layer was not silent there, it was the brightest thing
 * happening there. Nothing in this file is now asserted that was not measured
 * with bin/vault shots against all four themes.
 *
 * One thing the -0.02 is not: blend-mode aware. It cancels soft-light's
 * asymmetry, and the light themes composite this same tile with `multiply`,
 * where it buys them nothing and costs about 0.2 of a level. A per-blend
 * constant living in a shared asset, left shared because two tiles to keep
 * in step is a worse trade than a fifth of a level on paper.
 *
 * Amplitude is still bought with `--grain-opacity`, and it is per mode: the
 * light themes blend `multiply`, where neutral is 1.0 rather than 0.5, so an
 * opaque band darkens paper instead of leaving it alone. Foolscap went 0.045
 * -> 0.02 to hold its sheet at the 237 it had. Ministry Grey keeps 0, which
 * is not an oversight - it is the one theme with no weather. */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  /* Above every surface, below nothing that can be interacted with, because
     it cannot be interacted with. */
  z-index: 2147483000;
  pointer-events: none;
  opacity: var(--grain-opacity);
  mix-blend-mode: var(--grain-blend);
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n' color-interpolation-filters='sRGB'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3CfeComponentTransfer%3E%3CfeFuncR type='linear' slope='1' intercept='-0.02'/%3E%3CfeFuncG type='linear' slope='1' intercept='-0.02'/%3E%3CfeFuncB type='linear' slope='1' intercept='-0.02'/%3E%3CfeFuncA type='linear' slope='0' intercept='1'/%3E%3C/feComponentTransfer%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)'/%3E%3C/svg%3E"),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='173' height='173'%3E%3Cfilter id='m' color-interpolation-filters='sRGB'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.74' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3CfeComponentTransfer%3E%3CfeFuncR type='linear' slope='1' intercept='-0.02'/%3E%3CfeFuncG type='linear' slope='1' intercept='-0.02'/%3E%3CfeFuncB type='linear' slope='1' intercept='-0.02'/%3E%3CfeFuncA type='linear' slope='0' intercept='1'/%3E%3C/feComponentTransfer%3E%3C/filter%3E%3Crect width='173' height='173' filter='url(%23m)'/%3E%3C/svg%3E");
  /* Each drawn at the size its filter stitched. Any other size resamples the
     noise and turns crisp grain into grey mush. */
  background-size: 180px 180px, 173px 173px;
  /* The two fields combine with each other before the layer meets the page,
     which is what makes the repeat period their lowest common multiple. */
  background-blend-mode: overlay;
}

/* ---- The dial ---------------------------------------------------------- */

/* The Restraint Dial, and the system setting that means the same thing. Not
   `display: none`: the light and the grain are not motion, and taking them
   away changes what the page IS rather than how it arrived. Only the drift
   stops.
 *
 * `animation: none` rather than leaning on the global reduced-motion rule in
 * typography.css - that rule collapses durations to 0.01ms, which for an
 * `infinite` animation does not mean "stop", it means "restart a hundred
 * thousand times a second". */
@media (prefers-reduced-motion: reduce) {
  html::after, body::before { animation: none; }
}
/* `:root[data-motion="still"] html::after` is what this said, and it could
   never match anything: :root IS html, and no html element is descended from
   an html element. The far ember field kept drifting with the dial set to
   still - the only reason nobody saw it is that the same layer is hidden on
   phones for battery. A selector that cannot match is worse than a missing
   rule, because it reads as done.
 *
   It also turned nothing else off, and nothing anywhere set the attribute.
   Both are fixed: MotionController writes the cookie, the layout writes the
   attribute, and the dial reaches everything that moves.
 *
   ONE exception, and it is the same exception the reduced-motion block
   makes: the undo filament stays. It is not decoration, it is a six-second
   window being drawn, and switching it off either takes the undo away
   instantly or leaves it on the screen for ever. A reader who wants a still
   room still gets their six seconds. */
:root[data-motion="still"]::before,
:root[data-motion="still"]::after,
:root[data-motion="still"] body::before,
:root[data-motion="still"] .card,
:root[data-motion="still"] .card.arrived,
:root[data-motion="still"] .card.pending::after,
/* The seal pours over the face and the face warms under it. Both are beats,
   not structure, so both stop - and the pane must be hidden as well as
   stopped: an amber pane frozen at 0% of amber-close is a card wearing a
   brass sheet for ever. */
:root[data-motion="still"] .card.arrived.sealed .face img,
/* Even the breathing. A dial set to still means a room where nothing moves,
   and an infinite animation is the one kind the global reduced-motion rule
   cannot switch off - it collapses the duration, which for `infinite` means
   restarting it a hundred thousand times a second. */
:root[data-motion="still"] .dragon-asleep,
:root[data-motion="still"] .masthead {
  animation: none;
}
:root[data-motion="still"] .card.arrived.sealed .face::before { display: none; }
/* Instant cuts, not slow motion - the plan's own words. A transition that
   still runs is a dial that was turned and did nothing. */
:root[data-motion="still"] :not(.flash):not(.flash *) {
  transition-duration: 0.01ms !important;
}
/* Turbo checks prefers-reduced-motion before it calls startViewTransition,
   but it knows nothing about this dial - so the transition still happens and
   is cut to a frame here instead. */
:root[data-motion="still"]::view-transition-group(*),
:root[data-motion="still"]::view-transition-old(*),
:root[data-motion="still"]::view-transition-new(*) {
  animation-duration: 1ms !important;
}

/* A phone rendering four composited full-screen layers is spending battery on
   weather. The far field is the one carrying the least - it is 1px dots at a
   third of the near field's opacity - so it is the one that goes. */
@media (max-width: 40rem) {
  html::after { display: none; }
}
