/* Need More, or Selling Online: The Light.

   How to mount it: load this after styles.css. It changes no size, gap or colour of the approved section. It adds
     1. a pool of ultramarine light inside the one dark field, with a fine field of points that shows only where the light falls,
        and the field's 1 pixel edge catching the light where it is near;
     2. one entrance, played once as the field comes into view: the light comes in from the left to its resting place and the words rise;
     3. after that the light follows a mouse, a finger, or the keyboard's focus on the button, and goes home when they leave.
   Everything that moves is a transform or an opacity. The layers are built by night-show.js inside .field__bg; without it none of this exists. */

[data-show-night] { --nt-ease: cubic-bezier(0.16, 1, 0.3, 1); --nt-d: 0ms; }

.nt-clip, .nt-edge { position: absolute; inset: 0; border-radius: inherit; overflow: hidden; pointer-events: none; }
.nt-in { position: absolute; inset: 0; }
.nt-glow, .nt-core, .nt-win, .nt-edge i { position: absolute; left: 0; top: 0; border-radius: 50%; will-change: transform; }
/* the wide soft pool, and a smaller brighter heart that keeps closer to the pointer */
.nt-glow { width: 1280px; height: 1280px; margin: -640px 0 0 -640px; background: radial-gradient(closest-side, rgba(47, 75, 255, 0.38) 0%, rgba(47, 75, 255, 0.35) 10%, rgba(47, 75, 255, 0.289) 20%, rgba(47, 75, 255, 0.224) 30%, rgba(47, 75, 255, 0.163) 40%, rgba(47, 75, 255, 0.11) 50%, rgba(47, 75, 255, 0.068) 60%, rgba(47, 75, 255, 0.038) 70%, rgba(47, 75, 255, 0.017) 80%, rgba(47, 75, 255, 0.005) 90%, rgba(47, 75, 255, 0) 100%); }
.nt-core { width: 420px; height: 420px; margin: -210px 0 0 -210px; background: radial-gradient(closest-side, rgba(122, 142, 255, 0.2) 0%, rgba(122, 142, 255, 0.184) 10%, rgba(122, 142, 255, 0.152) 20%, rgba(122, 142, 255, 0.118) 30%, rgba(122, 142, 255, 0.086) 40%, rgba(122, 142, 255, 0.058) 50%, rgba(122, 142, 255, 0.036) 60%, rgba(122, 142, 255, 0.02) 70%, rgba(122, 142, 255, 0.009) 80%, rgba(122, 142, 255, 0.002) 90%, rgba(122, 142, 255, 0) 100%); }
/* the points: a round window that travels with the light; the sheet of points inside it is moved back by the same amount, so the points stay still */
.nt-win { width: 640px; height: 640px; margin: -320px 0 0 -320px; overflow: hidden; -webkit-mask: radial-gradient(closest-side, #000, rgba(0, 0, 0, 0.5) 45%, transparent 100%); mask: radial-gradient(closest-side, #000, rgba(0, 0, 0, 0.5) 45%, transparent 100%); }
.nt-dots {
  position: absolute; left: 320px; top: 320px; width: 2400px; height: 1800px; will-change: transform;
  /* one point every 24, the page's gutter, the first one standing on the content's left edge */
  background-image: radial-gradient(circle, rgba(245, 246, 248, 0.34) 0, rgba(245, 246, 248, 0.34) 0.9px, rgba(245, 246, 248, 0) 1.6px);
  background-size: 24px 24px; background-position: calc(var(--bleed) - 12px) calc(var(--bleed) - 12px);
}
/* the edge: only the field's outermost pixel shows (the middle is masked away), lit where the light is near */
.nt-edge {
  padding: 1px;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
}
.nt-edge i { width: 720px; height: 720px; margin: -360px 0 0 -360px; background: radial-gradient(closest-side, rgba(170, 184, 255, 0.95), rgba(96, 118, 255, 0.5) 40%, rgba(47, 75, 255, 0) 100%); }

/* The entrance. Nothing here applies unless night-show.js has put .nt-ready on <html>, which it does only when movement is allowed. */
@media (prefers-reduced-motion: no-preference) {
  .nt-ready [data-show-night]:not(.is-in) .nt-in, .nt-ready [data-show-night]:not(.is-in) .nt-edge,
  .nt-ready [data-show-night]:not(.is-in) .nt-item { opacity: 0; }

  [data-show-night].is-in .nt-in { animation: nt-arrive 1.7s var(--nt-ease) both; }
  [data-show-night].is-in .nt-edge { animation: nt-fade 1.2s ease 0.5s both; }
  [data-show-night].is-in .nt-item { animation: nt-rise 0.8s var(--nt-ease) both; animation-delay: var(--nt-d); }
  /* once an entrance has finished it is taken off, so the button is free to press as it always does */
  [data-show-night].is-in .nt-item.is-done { animation: none; }

  @keyframes nt-arrive { from { opacity: 0; transform: translateX(-36%); } to { opacity: 1; transform: none; } }
  @keyframes nt-fade { from { opacity: 0; } to { opacity: 1; } }
  @keyframes nt-rise { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: none; } }
}
