:root {
  /* the ride: line geometry */
  /* desktop: the trunk drops out of the map's first stop (x=40 of 1160), so it is a share of the column */
  --col: 260px;
  --x-rub: 3.448%;
  --x-usdt: calc(var(--x-rub) + 64px);
  --lw: 1.897%;
  --gy: 96px;
  --dot: 20px;
  --dy: 70px;
}


/* hero */
.hero {
  display: grid; grid-template-columns: minmax(0, 1fr) 340px; column-gap: 56px;
  padding-top: 36px; padding-bottom: 0;
}
h1 { font-size: clamp(44px, 5.4vw, 80px); line-height: 0.98; font-weight: 800; letter-spacing: -0.025em; text-wrap: balance; }
h1 span { white-space: nowrap; }
.lead { margin-top: 28px; max-width: 34em; font-size: 20px; line-height: 1.55; color: var(--navy-2); }

.map { position: relative; grid-column: 1 / -1; margin-top: 32px; }
.map svg { position: relative; z-index: 1; display: block; width: 100%; height: auto; overflow: visible; }
/* the trunk leaves the bend (y=128 of the 20..250 viewBox) and runs into the ride */
.map::after { content: ""; position: absolute; left: calc(var(--x-rub) - var(--lw) / 2); width: var(--lw); top: 46.96%; bottom: 0; background: var(--red); }
.l-rub { stroke: var(--red); stroke-width: 22; fill: none; }
.l-usdt { stroke: var(--green); stroke-width: 22; fill: none; }
.map .xfer { fill: var(--navy); }
.map .stop { fill: #fff; }
.map .lock { fill: var(--lock); }
.map a { cursor: pointer; }
.map a:focus-visible { outline: none; }
.map a:focus-visible .stop { stroke: var(--navy); stroke-width: 4; }
.nm { font: 700 22px var(--font); fill: var(--navy); }
.sm { font: 400 16px var(--font); fill: var(--navy-2); }
.sm .num { font-weight: 700; font-size: 18px; fill: var(--navy); }
.sm .red, .sm .num.red { fill: var(--red-text); }
.sm .note { font-size: 14px; }

.act { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 32px; }
/* the ride: one line down the page, each section a station */
.ride { position: relative; padding-bottom: 32px; }
.track { position: absolute; top: 0; bottom: 32px; left: 48px; right: 48px; pointer-events: none; z-index: 2; }
.train { display: none; }
.ride.live .train {
  position: sticky; top: 50vh; display: inline-flex; align-items: center; gap: 10px;
  height: 36px; padding: 0 16px 0 9px; border-radius: 999px; background: var(--navy); color: #fff;
  font-size: 14px; font-weight: 700; white-space: nowrap;
  margin-left: calc(var(--x-rub) - 18px);
  transition: margin-left 420ms cubic-bezier(.16, 1, .3, 1);
}
.ride.live .train::before { content: ""; width: 18px; height: 18px; border-radius: 50%; background: #fff; flex: none; }
.ride.live .train.on-usdt { margin-left: calc(var(--x-usdt) - 18px); }

.st { position: relative; display: grid; grid-template-columns: var(--col) minmax(0, 780px); padding: 44px 0 72px; scroll-margin-top: 24px; }
.st::before, .st::after { content: ""; position: absolute; width: var(--lw); }
.st.rub::before { left: calc(var(--x-rub) - var(--lw) / 2); top: 0; bottom: 0; background: var(--red); }
.st.first { padding-top: 72px; }
.st.usdt::before { left: calc(var(--x-usdt) - var(--lw) / 2); top: 0; bottom: 0; background: var(--green); }
.st.usdt.end::before { bottom: auto; height: var(--dy); }
.st.xfer-st::before { left: calc(var(--x-rub) - var(--lw) / 2); top: 0; height: var(--dy); background: var(--red); }
.st.xfer-st::after { left: calc(var(--x-usdt) - var(--lw) / 2); top: var(--dy); bottom: 0; background: var(--green); }

.st .dot {
  position: absolute; z-index: 1; left: calc(var(--x-rub) - var(--dot) / 2); top: calc(var(--dy) - var(--dot) / 2);
  width: var(--dot); height: var(--dot); border-radius: 50%; background: #fff;
  transition: background-color 240ms cubic-bezier(.16, 1, .3, 1), transform 240ms cubic-bezier(.16, 1, .3, 1);
}
.st.usdt .dot { left: calc(var(--x-usdt) - var(--dot) / 2); }
/* state is a shape: a passed station fills in */
.st.passed .dot { background: var(--navy); box-shadow: inset 0 0 0 5px #fff; }

.st .xfer {
  position: absolute; z-index: 1; top: calc(var(--dy) - 18px); left: calc(var(--x-rub) - 18px);
  width: calc(var(--x-usdt) - var(--x-rub) + 36px); height: 36px; border-radius: 999px; background: var(--navy);
}
.xfer .lock, .xfer .dot2 { position: absolute; top: 50%; border-radius: 50%; translate: -50% -50%; }
.xfer .lock { left: 18px; width: 26px; height: 26px; background: #fff; }
.xfer .lock::after { content: ""; position: absolute; inset: 6px; border-radius: 50%; background: var(--lock); }
.xfer .dot2 { right: 0; left: auto; translate: -9px -50%; width: 18px; height: 18px; background: #fff; }

.st .bar { position: absolute; z-index: 1; top: calc(var(--dy) - 8px); left: calc(var(--x-usdt) - 32px); width: 64px; height: 16px; border-radius: 2px; background: var(--navy); }

.st-body { grid-column: 2; padding-left: 8px; }
.st-head { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 24px; row-gap: 4px; margin-bottom: 16px; }
.st h2 { font-size: clamp(30px, 3.4vw, 44px); line-height: 1.1; font-weight: 800; letter-spacing: -0.02em; }
.fig { font-size: 22px; font-weight: 700; }
.st-body > p { max-width: 62ch; }
p, li, dd { text-wrap: pretty; }
.st-body > p + p, .st-body > p + ul, .st-body > ul + p { margin-top: 16px; }

.locked {
  display: inline-flex; align-items: center; gap: 12px; padding: 10px 18px 10px 12px; border-radius: 2px;
  background: var(--navy); color: #fff; font-weight: 700; font-size: 18px;
}
/* the locked-rate double ring: the one place the lock colour appears */
.lock-chip { width: 24px; height: 24px; border-radius: 50%; background: var(--lock); box-shadow: inset 0 0 0 6px #fff; flex: none; }

/* compact route for narrow screens: HTML, so labels keep their size */
.mini { display: none; position: relative; grid-column: 1 / -1; height: 172px; margin-top: 36px; color: var(--navy-2); }
.mini > span, .mini i { position: absolute; display: block; }
/* rounded bend from the trunk into the line: inner radius --bend */
.mini-bend { left: calc(var(--x-rub) - var(--lw) / 2); top: 20px; width: calc(var(--bend) + var(--lw)); height: calc(var(--bend) + var(--lw)); border-top: var(--lw) solid var(--red); border-left: var(--lw) solid var(--red); border-top-left-radius: calc(var(--bend) + var(--lw)); }
.mini-red { left: calc(var(--x-rub) + var(--lw) / 2 + var(--bend) - 1px); right: 22%; top: 20px; height: var(--lw); background: var(--red); }
.mini-trunk { left: calc(var(--x-rub) - var(--lw) / 2); width: var(--lw); top: calc(20px + var(--lw) + var(--bend) - 1px); bottom: 0; background: var(--red); }
.mini-green { left: 78%; right: 0; top: var(--gy); height: var(--lw); background: var(--green); }
.mini-xf { left: calc(78% - 15px); width: 30px; top: calc(20px + var(--lw) / 2 - 15px); height: calc(var(--gy) - 20px + 30px); border-radius: 999px; background: var(--navy); }
.mini-xf .lk { left: 50%; top: 15px; width: 22px; height: 22px; border-radius: 50%; background: var(--lock); box-shadow: inset 0 0 0 5px #fff; translate: -50% -50%; }
.mini-xf .d2 { left: 50%; bottom: 15px; width: 14px; height: 14px; border-radius: 50%; background: #fff; translate: -50% 50%; }
.ms { left: var(--at); top: calc(20px + var(--lw) / 2); translate: -50% 0; padding-top: calc(var(--lw) / 2 + 10px); text-align: center; font-size: 14px; line-height: 1.35; white-space: nowrap; }
.ms i { left: 50%; top: 0; width: var(--dot); height: var(--dot); border-radius: 50%; background: #fff; translate: -50% -50%; }
.ms b { display: block; font-size: 16px; color: var(--navy); }
.ms b.red, .ms .red { color: var(--red-text); }
.ms.first { left: var(--x-rub); translate: none; padding-left: calc(var(--lw) / 2 + 10px); text-align: left; }
/* the first stop sits on the middle of the bend */
.ms.first i { left: calc(0.2929 * (var(--bend) + var(--lw) / 2)); top: calc(0.2929 * (var(--bend) + var(--lw) / 2)); }
.ms.usd { left: auto; right: 0; top: calc(var(--gy) + var(--lw) / 2); translate: none; text-align: right; }
/* the USDT stop sits on the green line, clear of the transfer capsule */
.ms.usd i { left: auto; right: 24px; translate: 50% -50%; }

.rules { list-style: none; padding: 0; max-width: 62ch; }
.rules li { padding: 12px 0 12px 28px; border-top: 2px solid var(--rule); position: relative; }
.rules li:last-child { border-bottom: 2px solid var(--rule); }
.rules li::before { content: ""; position: absolute; left: 0; top: 23px; width: 12px; height: 4px; background: var(--navy); }
.st .note { font-size: 14px; color: var(--navy-2); }

.spec div { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 24px; padding: 16px 0; border-top: 2px solid var(--rule); }
.spec div:last-child { border-bottom: 2px solid var(--rule); }
.spec dt { font-weight: 700; }
.spec dd { color: var(--navy-2); max-width: 58ch; }

.st h2.terminus { font-size: clamp(36px, 5vw, 64px); line-height: 1.02; letter-spacing: -0.025em; }
.end .lead { margin-top: 20px; }
.end .act { margin-top: 32px; }


/* one authored moment: the map draws itself, stations arrive in route order */
@media (prefers-reduced-motion: no-preference) {
  .draw { transform-box: fill-box; transform-origin: left center; animation: draw 1100ms cubic-bezier(.16, 1, .3, 1) both; }
  .l-usdt.draw { animation-delay: 750ms; animation-duration: 700ms; }
  .pop { transform-box: fill-box; transform-origin: center; animation: pop 520ms cubic-bezier(.16, 1, .3, 1) both; animation-delay: calc(150ms + var(--i) * 120ms); }
}
@media (prefers-reduced-motion: reduce) {
  .ride.live .train, .st .dot { transition: none; }
}
@keyframes draw { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes pop { from { opacity: 0; transform: scale(0.3); } to { opacity: 1; transform: scale(1); } }

@media (max-width: 1040px) {
  :root { --col: 240px; --x-rub: 40px; --x-usdt: 104px; --lw: 18px; --gy: 104px; --bend: 22px; }
  .map { display: none; }
  .mini { display: block; height: 190px; }
  .ms { font-size: 16px; }
  .ms b { font-size: 20px; }
  .hero { grid-template-columns: 1fr; }
  .legend { margin-top: 40px; max-width: 560px; }
  .line-name { display: none; }
}

@media (max-width: 760px) {
  :root { --col: 64px; --x-rub: 18px; --x-usdt: 44px; --lw: 12px; --dot: 14px; --dy: 52px; --gy: 96px; --bend: 16px; }
  h1 { font-size: clamp(30px, 9.6vw, 44px); }
  .hero { padding-top: 32px; padding-bottom: 0; }
  .lead { font-size: 18px; margin-top: 20px; }
  .legend { display: none; }
  .mini { height: 190px; }
  .ms { font-size: 14px; }
  .ms b { font-size: 16px; }
  .act { margin-top: 28px; }
  .act .sign { flex: 1 1 100%; justify-content: center; }

  .track { left: 16px; right: 16px; }
  .st { padding: 28px 0 48px; }
  /* Leave 24px below the 28px train when it stops at the terminal bar. */
  .st.end { padding-top: calc(var(--dy) + 14px + 24px); }
  .st-body { padding-left: 0; }
  /* the train rides at the bottom of the screen, its dot on the line, the amount read horizontally */
  .ride.live .train { top: calc(100vh - 44px); top: calc(100svh - 44px); height: 28px; padding: 0 12px 0 8px; gap: 8px; font-size: 14px; margin-left: calc(var(--x-rub) - 14px); }
  .ride.live .train::before { width: 12px; height: 12px; }
  .ride.live .train.on-usdt { margin-left: calc(var(--x-usdt) - 14px); }
  .st.first { padding-top: 48px; }
  .st .xfer { top: calc(var(--dy) - 13px); left: calc(var(--x-rub) - 13px); width: calc(var(--x-usdt) - var(--x-rub) + 26px); height: 26px; }
  .xfer .lock { left: 13px; width: 20px; height: 20px; }
  .xfer .lock::after { inset: 5px; }
  .xfer .dot2 { width: 12px; height: 12px; translate: -7px -50%; }
  .st .bar { left: calc(var(--x-usdt) - 14px); width: 28px; height: 10px; top: calc(var(--dy) - 5px); }
  .spec div { grid-template-columns: 1fr; gap: 4px; }
  .locked { font-size: 16px; }
}
