/* Traffic-system comparison for legacy and i-XALL change routes. */
.ownership-traffic {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border-color: rgba(101, 133, 169, .3);
  background:
    radial-gradient(circle at 86% 22%, rgba(37, 199, 220, .075), transparent 34%),
    radial-gradient(circle at 44% 74%, rgba(255, 179, 92, .045), transparent 32%),
    linear-gradient(145deg, #0a1a2d, #0c2036);
  box-shadow: 0 28px 75px rgba(0, 0, 0, .22);
}

.ownership-traffic::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.018) 1px, transparent 1px);
  background-size: 26px 26px;
  mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}

.ownership-traffic > .matrix-head,
.ownership-traffic > .traffic-row {
  grid-template-columns: .92fr 1fr 1.16fr;
  gap: 14px;
}

.ownership-traffic > .matrix-head {
  position: relative;
  z-index: 2;
  padding: 16px 18px 13px;
  border-bottom-color: rgba(255,255,255,.1);
  background: rgba(16, 38, 65, .78);
}

.ownership-traffic > .matrix-head span {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ownership-traffic > .matrix-head span:nth-child(2)::before,
.ownership-traffic > .matrix-head span:nth-child(3)::before {
  content: "";
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
}

.ownership-traffic > .matrix-head span:nth-child(2)::before {
  background: #ff9f5b;
  box-shadow: 0 0 11px rgba(255, 159, 91, .72);
}

.ownership-traffic > .matrix-head span:nth-child(3)::before {
  background: #37d3b5;
  box-shadow: 0 0 13px rgba(55, 211, 181, .8);
}

.ownership-traffic > .traffic-row {
  position: relative;
  z-index: 1;
  padding: 12px 14px;
  align-items: stretch;
  opacity: 0;
  transform: translateX(18px);
  border-bottom-color: rgba(255,255,255,.065);
}

.ownership-traffic > .traffic-row:nth-child(2) { --route-delay: .14s; }
.ownership-traffic > .traffic-row:nth-child(3) { --route-delay: .3s; }
.ownership-traffic > .traffic-row:nth-child(4) { --route-delay: .46s; }
.ownership-traffic > .traffic-row:nth-child(5) { --route-delay: .62s; }

.ownership-traffic.is-visible > .traffic-row {
  animation: trafficRouteEnter .7s cubic-bezier(.16, 1, .3, 1) var(--route-delay) forwards;
}

.traffic-change {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 8px 4px;
  color: #e7edf6;
  font-size: 11px;
  line-height: 1.35;
}

.traffic-change > i {
  width: 31px;
  height: 31px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 1px solid #314966;
  border-radius: 10px;
  background: #0b1c30;
  color: #71849d;
  font-style: normal;
  font-size: 8px;
  letter-spacing: .06em;
  box-shadow: inset 0 0 15px rgba(255,255,255,.025);
}

.traffic-route {
  position: relative;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  grid-template-rows: 1fr 5px;
  align-items: center;
  gap: 9px 10px;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 13px;
  background: rgba(7, 21, 37, .5);
  transition: transform .25s ease, border-color .25s ease, background .25s ease;
}

.traffic-route:hover {
  transform: translateY(-2px);
}

.traffic-legacy:hover {
  border-color: rgba(255, 159, 91, .32);
  background: rgba(54, 35, 28, .28);
}

.traffic-ixall:hover {
  border-color: rgba(55, 211, 181, .4);
  background: rgba(18, 57, 65, .34);
}

.traffic-signal {
  width: 39px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: 1px solid #2a3d57;
  border-radius: 999px;
  background: #071423;
  box-shadow: inset 0 2px 8px rgba(0,0,0,.55);
}

.traffic-signal > i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #26384e;
}

.traffic-legacy .traffic-signal > i:first-child {
  background: #ff657d;
  box-shadow: 0 0 9px rgba(255,101,125,.82);
  animation: legacyRedSignal 2.6s ease-in-out infinite;
}

.traffic-legacy .traffic-signal > i:nth-child(2) {
  background: #ffb35c;
  box-shadow: 0 0 8px rgba(255,179,92,.6);
  animation: legacyAmberSignal 2.6s ease-in-out infinite;
}

.traffic-ixall .traffic-signal > i:last-child {
  background: #37d3b5;
  box-shadow: 0 0 11px rgba(55,211,181,.9);
  animation: ixallGreenSignal 1.9s ease-in-out infinite;
}

.traffic-route-copy {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 10px;
  line-height: 1.3;
}

.traffic-legacy .traffic-route-copy {
  color: #8c9cb0;
}

.traffic-ixall .traffic-route-copy {
  color: #64e1df;
  font-weight: 850;
}

.traffic-road {
  position: relative;
  grid-column: 1 / -1;
  display: block;
  height: 3px;
  overflow: visible;
  border-radius: 999px;
}

.traffic-legacy .traffic-road {
  background: repeating-linear-gradient(90deg, rgba(255,179,92,.5) 0 8px, rgba(255,179,92,.08) 8px 15px);
}

.traffic-ixall .traffic-road {
  background: rgba(47, 102, 115, .28);
}

.traffic-ixall .traffic-road::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #7454ff, #25c7dc, #37d3b5);
  box-shadow: 0 0 10px rgba(37,199,220,.56);
}

.ownership-traffic.is-visible .traffic-ixall .traffic-road::before {
  animation: ixallRoadBuild .9s cubic-bezier(.2,.8,.2,1) calc(var(--route-delay) + .35s) forwards;
}

.traffic-road > i {
  position: absolute;
  top: 50%;
  left: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  opacity: 0;
  transform: translate(-50%, -50%);
}

.traffic-legacy .traffic-road > i {
  background: #ffb35c;
  box-shadow: 0 0 10px rgba(255,179,92,.8);
}

.traffic-ixall .traffic-road > i {
  background: #66f0dc;
  box-shadow: 0 0 12px #25c7dc, 0 0 20px rgba(55,211,181,.65);
}

.ownership-traffic.is-visible .traffic-legacy .traffic-road > i {
  animation: legacyLaneTraffic 4.2s ease-in-out calc(var(--route-delay) + .65s) infinite;
}

.ownership-traffic.is-visible .traffic-ixall .traffic-road > i {
  animation: ixallLaneTraffic 2.8s ease-in-out calc(var(--route-delay) + .55s) infinite;
}

@keyframes trafficRouteEnter {
  to { opacity: 1; transform: translateX(0); }
}

@keyframes legacyRedSignal {
  0%, 35%, 100% { opacity: 1; transform: scale(1); }
  55%, 75% { opacity: .38; transform: scale(.82); }
}

@keyframes legacyAmberSignal {
  0%, 28%, 82%, 100% { opacity: .3; transform: scale(.82); }
  45%, 68% { opacity: 1; transform: scale(1.08); }
}

@keyframes ixallGreenSignal {
  0%, 100% { opacity: .72; transform: scale(.9); }
  50% { opacity: 1; transform: scale(1.18); }
}

@keyframes ixallRoadBuild {
  to { width: 100%; }
}

@keyframes legacyLaneTraffic {
  0% { left: 0; opacity: 0; }
  10% { opacity: 1; }
  48%, 70% { left: 58%; opacity: 1; }
  88%, 100% { left: 58%; opacity: 0; }
}

@keyframes ixallLaneTraffic {
  0% { left: 0; opacity: 0; }
  12% { opacity: 1; }
  82% { left: 100%; opacity: 1; }
  100% { left: 100%; opacity: 0; }
}

@media (max-width: 720px) {
  .ownership-traffic > .matrix-head {
    display: none;
  }

  .ownership-traffic > .traffic-row {
    grid-template-columns: 1fr;
    gap: 9px;
    padding: 16px 14px;
  }

  .traffic-change {
    padding: 2px 2px 6px;
  }

  .traffic-route {
    padding-top: 28px;
  }

  .traffic-route::before {
    position: absolute;
    top: 8px;
    left: 12px;
    color: #647890;
    font-size: 7px;
    font-weight: 900;
    letter-spacing: .12em;
    text-transform: uppercase;
  }

  .traffic-legacy::before { content: "Legacy approach"; }
  .traffic-ixall::before { content: "i-XALL approach"; color: #4db9b7; }
}

@media (prefers-reduced-motion: reduce) {
  .ownership-traffic > .traffic-row {
    opacity: 1;
    transform: none;
    animation: none !important;
  }

  .traffic-signal > i,
  .traffic-road > i,
  .traffic-road::before {
    animation: none !important;
  }

  .traffic-ixall .traffic-road::before {
    width: 100%;
  }

  .traffic-road > i {
    display: none;
  }
}
