/* LIGHTNING divider (V3: everything drifts left to right) - slow white and blue energy line
   For the line above "All Items" and the one above the footer (class="glow-divider").
   Load this AFTER upinit-glow.css (and after glow_not_green_V2.css if you use it).
   It takes the same space as the old line, so nothing else on the page moves.

   V2: no flashing. A smooth glowing line like glow2, in lightning colors.
   Several slow movements run at different speeds at the same time:
     - two sets of bright patches both drift left to right at different speeds (90s and 133s),
       so the faster one slowly catches up, they merge into a bright spot, and pull apart again
     - the glow around the line slowly swells and fades (27s)
     - the line slowly gets thicker and thinner (41s)
     - the color slowly drifts between pure white and electric blue (71s)
   Because the speeds never line up, it almost never looks the same twice. */

@property --lt-p1   { syntax: "<length>";     inherits: true; initial-value: 0px; }
@property --lt-p2   { syntax: "<length>";     inherits: true; initial-value: 0px; }
@property --lt-glow { syntax: "<number>";     inherits: true; initial-value: 0.5; }
@property --lt-h    { syntax: "<length>";     inherits: true; initial-value: 2px; }
@property --lt-mix  { syntax: "<percentage>"; inherits: true; initial-value: 50%; }

.glow-divider {
  /* ---- settings you can change ---- */
  --lt-white: #ffffff;
  --lt-blue:  #4fa8ff;      /* electric blue */
  --lt-ice:   #bfe3ff;      /* pale icy blue */
  --lt-speed: 1;            /* 2 = twice as slow, 0.5 = twice as fast */

  position: relative;
  height: 36px;             /* old line: 2px tall + 34px space above and below. */
  margin: 17px 4px;         /* new: 36px tall + 17px space = the same 70px total. */
  border-radius: 0;
  background: none;
  box-shadow: none;
  filter: none;
  --lt-color: color-mix(in srgb, var(--lt-white) var(--lt-mix), var(--lt-blue));

  animation:
    lt-drift-1  calc(90s  * var(--lt-speed)) linear infinite,
    lt-drift-2  calc(133s * var(--lt-speed)) linear infinite,
    lt-breathe  calc(27s  * var(--lt-speed)) ease-in-out infinite alternate,
    lt-thick    calc(41s  * var(--lt-speed)) ease-in-out infinite alternate,
    lt-color    calc(71s  * var(--lt-speed)) ease-in-out infinite alternate;
}

/* the line (::before) and its soft glow (::after) are painted the same way */
.glow-divider::before,
.glow-divider::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  background:
    /* bright patches set 1: white with icy edges, drifting right */
    linear-gradient(90deg,
      transparent 0, color-mix(in srgb, var(--lt-ice) 70%, transparent) 10%,
      var(--lt-white) 17%, color-mix(in srgb, var(--lt-ice) 70%, transparent) 24%,
      transparent 36%, transparent 58%,
      color-mix(in srgb, var(--lt-white) 75%, transparent) 70%, transparent 82%)
      var(--lt-p1) center / 900px var(--lt-band) repeat-x,
    /* bright patches set 2: blue, drifting right (slower) */
    linear-gradient(90deg,
      transparent 0, color-mix(in srgb, var(--lt-blue) 85%, transparent) 20%,
      color-mix(in srgb, var(--lt-ice) 90%, transparent) 28%, transparent 46%,
      transparent 62%, color-mix(in srgb, var(--lt-blue) 70%, transparent) 78%, transparent 94%)
      var(--lt-p2) center / 1300px var(--lt-band) repeat-x,
    /* the steady line underneath, so it's never empty */
    linear-gradient(90deg, color-mix(in srgb, var(--lt-color) 55%, transparent), color-mix(in srgb, var(--lt-color) 55%, transparent))
      center / 100% var(--lt-band) no-repeat;
  background-blend-mode: screen, screen, normal;
  /* fade out at both ends */
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
}
.glow-divider::before {          /* the sharp core */
  --lt-band: 100%;
  height: var(--lt-h);
  transform: translateY(-50%);
  border-radius: 2px;
}
.glow-divider::after {           /* the soft light around it */
  /* a tall see-through box with a thin painted band in the middle,
     so the blur has room to spread and doesn't get a hard edge */
  --lt-band: 8px;
  height: 60px;
  transform: translateY(-50%);
  filter: blur(9px);
  opacity: var(--lt-glow);
}

@keyframes lt-drift-1 { to { --lt-p1: 900px; } }
@keyframes lt-drift-2 { to { --lt-p2: 1300px; } }
@keyframes lt-breathe { from { --lt-glow: 0.35; } to { --lt-glow: 0.95; } }
@keyframes lt-thick   { from { --lt-h: 1.5px; } to { --lt-h: 3px; } }
@keyframes lt-color   { from { --lt-mix: 85%; } to { --lt-mix: 25%; } }

/* the footer line starts at a different point, so the two lines don't match */
.main > .glow-divider:last-of-type {
  animation-delay: -37s, -71s, -11s, -23s, -40s;
}
