/* Highway background: three identical, evenly spaced roads with small white trucks driving both ways.
   Shared by the landing page, portal, sign-in pages and admin. Each page sets --road-o and --truck-o.
   Everything that moves is transform-only, so it runs on the GPU compositor. */
.stripe { position: absolute; left: -30vmax; width: 160vmax; height: 110px; transform: rotate(-45deg);
  animation: hw-glide 22s ease-in-out infinite alternate; will-change: translate; contain: strict;
  /* roads fade out toward both ends, trucks included */
  -webkit-mask: linear-gradient(90deg, transparent 6%, #000 30%, #000 70%, transparent 94%);
          mask: linear-gradient(90deg, transparent 6%, #000 30%, #000 70%, transparent 94%); }
.s1 { top: -6%; } .s2 { top: 30%; } .s3 { top: 66%; }
@keyframes hw-glide { to { translate: 6vmax -3vmax; } }

/* asphalt: the blue band */
.stripe::before { content: ""; position: absolute; inset: 0; border-radius: 80px; opacity: var(--road-o, .3); filter: blur(3px);
  background: linear-gradient(90deg, transparent, var(--blue) 35%, var(--blue-hi) 65%, transparent); }
/* lane markings: solid edges and a dashed centre line */
.stripe::after { content: ""; position: absolute; left: 0; right: 0; top: 16px; bottom: 16px; opacity: calc(var(--truck-o, 1) * .4);
  background:
    linear-gradient(rgba(255,255,255,.55), rgba(255,255,255,.55)) top / 100% 1px no-repeat,
    linear-gradient(rgba(255,255,255,.55), rgba(255,255,255,.55)) bottom / 100% 1px no-repeat,
    repeating-linear-gradient(90deg, rgba(255,255,255,.75) 0 16px, transparent 16px 38px) center / 100% 2px no-repeat; }

/* A .trk spans the whole road and slides its own length; the truck rides at its left edge. */
.trk { position: absolute; inset: 0; z-index: 1; animation: hw-drive var(--t, 30s) linear var(--d, 0s) infinite; will-change: transform; }
.trk.back { animation-direction: reverse; }
@keyframes hw-drive { from { transform: translateX(0); } to { transform: translateX(100%); } }

/* truck seen from above, pointing along the road: trailer (with tail lights), cab, headlight glow */
.trk b { position: absolute; left: -48px; top: 31px; width: 24px; height: 9px; border-radius: 2px; opacity: var(--truck-o, 1);
  background: linear-gradient(90deg, #ff5d5d 0 1.5px, #fff 1.5px); box-shadow: 0 2px 6px rgba(2, 18, 38, .35); }
.trk b::before { content: ""; position: absolute; left: 25.5px; top: .5px; width: 7px; height: 8px; border-radius: 1px 3px 3px 1px; background: #fff; }
.trk b::after { content: ""; position: absolute; left: 33px; top: -3px; width: 34px; height: 15px;
  background: radial-gradient(60% 50% at 0 50%, rgba(255, 246, 214, .75), transparent 72%); }
/* the other carriageway: lower lane, driving the opposite way */
.trk.back b { top: auto; bottom: 31px; transform: scaleX(-1); }

/* phones: no blur on the roads, slower glide off */
@media (hover: none), (max-width: 760px) {
  .stripe { animation: none; }
  .stripe::before { filter: none; }
}
@media (prefers-reduced-motion: reduce) {
  .stripe, .trk { animation: none !important; }
  .trk { transform: translateX(var(--rest, 50%)); }
}
