.conn {

  --conn-bg: linear-gradient(185.06deg, #ffffff 8.197%, #d1d1d1 60.989%, #f0f0f0 71.22%);
  --conn-fade: #f0f0f0;
  --design-w: 1728;
  --ox: 0;
  --oy: 0;
  position: relative;
  overflow: hidden;
  background: var(--conn-fade);
  color: var(--c-text);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .conn {
    --conn-bg: linear-gradient(185.06deg, #0e111b 8.197%, #0e111b 60.989%, #000000 71.22%);
    --conn-fade: #131726;
  }
}
:root[data-theme="dark"] .conn {
  --conn-bg: linear-gradient(185.06deg, #0e111b 8.197%, #0e111b 60.989%, #000000 71.22%);
  --conn-fade: #131726;
}

.conn__inner {
  position: relative;
  isolation: isolate;
  max-width: 1728px;
  margin: 0 auto;
  container-type: inline-size;
}

.conn__inner::before {
  content: "";
  position: absolute;
  inset: 0 calc(50% - 50vw);
  z-index: -1;
  background: var(--conn-bg);
}

.conn__copy {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
  padding: 108px 30px 8px;
  text-align: center;
}

.conn__title {
  margin: 0;
  color: var(--c-heading);
  font-weight: 700;
  font-size: clamp(34px, 5.2vw + 19px, 56px);
  line-height: 1;
}
.conn__title .line { display: block; }
.conn__title .accent { color: var(--c-red); }

.conn__lead {
  margin: 0;
  max-width: 34em;
  font-size: 18px;
  line-height: 1.35;
}

.conn__scene {
  --design-w: 760;
  --ox: 60;
  --oy: -105;
  position: relative;
  aspect-ratio: 760 / 715;
  container-type: inline-size;
}

.cn-el {
  position: absolute;
  left: calc((var(--x) + var(--ox)) * 100cqw / var(--design-w));
  top: calc((var(--y) + var(--oy)) * 100cqw / var(--design-w));
  width: calc(var(--w) * 100cqw / var(--design-w));
  height: calc(var(--h) * 100cqw / var(--design-w));
  max-width: none;
}

.conn__city { --x: -60; --y: 138; --w: 1728; --h: 556; }

.cn-city { position: absolute; inset: 0; width: 100%; height: 100%; }

.cn-train-lane {
  position: absolute;
  left: 0;
  top: calc(441.87 / 556 * 100%);
  width: calc(1240 / 1728 * 100%);
  height: calc(33 / 556 * 100%);
  overflow: hidden;
}
.cn-train {
  position: absolute;
  top: 0;
  left: calc(309.89 / 1240 * 100%);
  width: calc(467 / 1240 * 100%);
  height: 100%;
  animation: cn-train 16s linear infinite;
}
.cn-train svg { position: absolute; inset: 0; width: 100%; height: 100%; }

@keyframes cn-train {
  from { transform: translateX(-166.4%); }
  80%, to { transform: translateX(199.2%); }
}
.conn.is-out .cn-train { animation-play-state: paused; }

.cn-hill {
  position: absolute;
  left: calc(566.64 / 1728 * 100%);
  top: calc(433.47 / 556 * 100%);
  width: calc(1162 / 1728 * 100%);
  height: calc(112 / 556 * 100%);
  max-width: none;
  clip-path: inset(0 0 0 45.9%);
}

.conn__fade {
  --x: -60; --y: 451; --w: 1728; --h: 374;
  width: 100%;
  background: linear-gradient(to bottom, transparent, var(--conn-fade) 58.654%);
}
.conn__art { --x: 375.99; --y: 130; --w: 277; --h: 602; z-index: 1; }
.conn__car { --x: -134.54; --y: 515.86; --w: 523.33; --h: 251.77; z-index: 2; }
.conn__art svg,
.conn__car svg { display: block; width: 100%; height: 100%; overflow: visible; }

@media (min-width: 1024px) {
  .conn__inner { aspect-ratio: 1728 / 820; }

  .conn__scene {
    --design-w: 1728;
    --ox: 0;
    --oy: 0;
    position: absolute;
    inset: 0;
    aspect-ratio: auto;
  }

  .conn__copy {
    position: absolute;
    left: calc(944 * 100cqw / 1728);
    top: calc(125 * 100cqw / 1728);
    width: calc(634 * 100cqw / 1728);
    padding: 0;
    align-items: flex-start;
    gap: 32px;
    text-align: left;
  }

  .conn__city { --x: 0; left: min(0px, (1728px - 100vw) / 2); }

  .conn__fade { --x: 0; left: min(0px, (1728px - 100vw) / 2); width: max(100%, 100vw); }

  .conn__title { font-size: max(calc(80 * 100cqw / 1728), 40px); }
  .conn__lead { max-width: none; font-size: max(calc(20 * 100cqw / 1728), 16px); line-height: 1.2; }
  .conn__copy .btn--cta {
    height: max(calc(60 * 100cqw / 1728), 46px);
    font-size: max(calc(18 * 100cqw / 1728), 15px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .cn-train { animation: none; }
}

.cn-beam, .cn-globe, .cn-line, .cn-node { translate: 10px 0; }

.cn-tire, .cn-beam, .cn-globe, .cn-node {
  transform-box: fill-box;
}
.cn-tire, .cn-node { transform-origin: 50% 50%; }
.cn-beam { transform-origin: 50% 100%; }
.cn-globe { transform-origin: 50% 100%; }

.cn-reveal { --reveal-x: 0px; --reveal-y: 24px; }
@media (min-width: 1024px) { .cn-reveal { --reveal-x: 48px; --reveal-y: 0px; } }
.conn.is-armed .cn-reveal { opacity: 0; transform: translate(var(--reveal-x), var(--reveal-y)); }
.conn.is-text-in .cn-reveal {
  opacity: 1;
  transform: none;
  transition: opacity .8s ease var(--d), transform .8s cubic-bezier(.2, .7, .3, 1) var(--d);
}

.conn.is-armed .conn__car { transform: translateX(calc(-560 * 100cqw / var(--design-w))); }
.conn.is-armed .cn-tire { transform: rotate(-433deg); }
.conn.is-armed .cn-beam { opacity: 0; transform: scale(.25, 0); }
.conn.is-armed .cn-globe { opacity: 0; }
.conn.is-armed .cn-line { stroke-dasharray: 1; stroke-dashoffset: 1; }
.conn.is-armed .cn-node { transform: scale(0); }

.conn.is-playing .conn__car,
.conn.is-playing .cn-tire {
  transform: none;

  transition: transform 1.6s cubic-bezier(.2, .7, .3, 1);
}

.conn.is-lit .cn-beam {
  opacity: .3;
  transform: none;
  transition: opacity .7s ease, transform .9s cubic-bezier(.2, .8, .3, 1);
}
.conn.is-lit .cn-globe {
  opacity: 1;
  transition: opacity .9s ease .25s;
}
.conn.is-lit .cn-line {
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 1s ease-in-out .25s;
}
.conn.is-lit .cn-node {
  transform: none;
  transition: transform .35s cubic-bezier(.3, 1.6, .5, 1) calc(.4s + var(--i) * 45ms);
}
