/* Train hub — centered mast + full-height format rows (restored card scale) */

.train-page {
  --flow-nav: 4.25rem;
}

.train-hub {
  --flow-nav: 4.25rem;
  position: relative;
  isolation: isolate;
  height: calc(100dvh - var(--flow-nav));
  max-height: calc(100dvh - var(--flow-nav));
  min-height: calc(100dvh - var(--flow-nav));
  padding: clamp(1.25rem, 2.8vh, 2rem) 0 clamp(1.5rem, 3.2vh, 2.25rem);
  background: var(--aura-bg);
  text-align: center;
  overflow: hidden;
  box-sizing: border-box;
}

.train-hub__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 58% 42% at 50% 0%, rgba(255, 42, 66, 0.09) 0%, transparent 58%),
    radial-gradient(ellipse 44% 36% at 88% 12%, rgba(0, 229, 255, 0.07) 0%, transparent 52%);
}

.train-hub__bg::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.22;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: linear-gradient(180deg, #000 0%, transparent 72%);
  animation: train-hub-grid-drift 22s linear infinite;
  will-change: transform;
}

@keyframes train-hub-grid-drift {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(40px, 40px, 0); }
}

.train-hub__shell {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 0;
  width: 100%;
  max-width: none;
  height: 100%;
  min-height: 0;
  max-height: 100%;
  margin: 0;
  padding-left: 0;
  padding-right: 0;
  box-sizing: border-box;
}

.train-hub__mast {
  --mast-inner: clamp(0.32rem, 0.62vh, 0.48rem);
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--mast-inner);
  width: 100%;
  padding: clamp(0.35rem, 1vh, 0.75rem) clamp(1.25rem, 3.5vw, 2.75rem) clamp(1.1rem, 2.8vh, 1.85rem);
  text-align: center;
}

.train-hub__head {
  position: relative;
  width: min(100%, 48rem);
  margin: 0 auto;
}

.train-hub__head::before {
  content: "";
  position: absolute;
  inset: -12% -8%;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(ellipse 88% 72% at 50% 50%, rgba(255, 42, 66, 0.08) 0%, transparent 62%);
  filter: blur(12px);
}

.train-hub__glitch {
  position: relative;
  display: block;
  width: 100%;
  min-height: 0;
  margin: 0 auto;
  cursor: default;
  outline: none;
  animation: train-hub-glitch-settle 0.9s cubic-bezier(0.22, 1, 0.36, 1) 0.08s both;
}

.train-hub__swap--rest {
  position: relative;
  display: block;
  opacity: 1;
  animation: train-hub-rest-cycle 6.8s steps(1, end) infinite;
}

.train-hub__swap--alt {
  position: absolute;
  inset: 0;
  display: block;
  opacity: 0;
  pointer-events: none;
  animation: train-hub-alt-cycle 6.8s steps(1, end) infinite;
}

/* Title swap is driven by CSS on all viewports; JS hover sets .is-swap */
.train-hub__glitch.is-swap .train-hub__swap--rest {
  animation: none;
  opacity: 0;
  transform: scale(0.985);
}

.train-hub__glitch.is-swap .train-hub__swap--alt {
  animation: none;
  opacity: 1;
  pointer-events: none;
}

.train-hub__glitch.is-swap .train-hub__swap--alt .train-hub__layer--a {
  opacity: 1;
}

.train-hub__glitch.is-swap .train-hub__swap--alt .train-hub__layer--b {
  opacity: 0.4;
}

.train-hub__glitch.is-swap .train-hub__swap--alt .train-hub__layer--acid,
.train-hub__glitch.is-swap .train-hub__swap--alt .train-hub__layer--blood {
  animation-play-state: running;
}

@keyframes train-hub-glitch-settle {
  from {
    opacity: 0;
    transform: scaleX(0.96) translateY(8px);
  }
  to {
    opacity: 1;
    transform: scaleX(1) translateY(0);
  }
}

.train-hub__layer {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: baseline;
  justify-content: center;
  gap: 0.28em;
  font-family: var(--aura-font-heading);
  font-weight: 900;
  font-size: clamp(1.55rem, 4vw, 2.85rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  white-space: normal;
  filter: drop-shadow(0 8px 28px rgba(0, 0, 0, 0.72));
}

.train-hub__layer--rest {
  gap: 0.28em;
}

.train-hub__line {
  display: inline-block;
  width: auto;
  text-align: center;
  color: var(--aura-text-main);
  text-shadow:
    0 1px 0 rgba(0, 0, 0, 0.95),
    0 0 32px rgba(0, 0, 0, 0.45);
}

.train-hub__line--cyan {
  color: var(--aura-secondary);
  text-shadow:
    0 1px 0 rgba(0, 0, 0, 0.95),
    0 0 24px rgba(0, 229, 255, 0.32);
}

.train-hub__line--accent {
  color: var(--aura-accent);
  text-shadow:
    0 1px 0 rgba(0, 0, 0, 0.95),
    0 0 28px rgba(223, 255, 0, 0.35);
}

.train-hub__swap--alt .train-hub__layer--b .train-hub__line:first-child { color: var(--aura-secondary); }
.train-hub__swap--alt .train-hub__layer--b .train-hub__line--accent { color: var(--aura-primary); }
.train-hub__swap--alt .train-hub__layer--acid .train-hub__line { color: var(--aura-secondary); }
.train-hub__swap--alt .train-hub__layer--blood .train-hub__line { color: var(--aura-primary); }

.train-hub__swap--alt .train-hub__layer--b,
.train-hub__swap--alt .train-hub__layer--acid,
.train-hub__swap--alt .train-hub__layer--blood {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.14s ease, transform 0.14s ease;
}

.train-hub__swap--alt .train-hub__layer--acid {
  animation: train-hub-glitch-idle-acid 6.5s steps(1, end) infinite;
}

.train-hub__swap--alt .train-hub__layer--blood {
  animation: train-hub-glitch-idle-blood 6.5s steps(1, end) infinite;
}

@keyframes train-hub-rest-cycle {
  0%, 56%, 100% { opacity: 1; transform: none; }
  57%, 88% { opacity: 0; transform: scale(0.985); }
}

@keyframes train-hub-alt-cycle {
  0%, 56%, 100% { opacity: 0; }
  57%, 88% { opacity: 1; }
}

@keyframes train-hub-cyan-flicker {
  0%, 14%, 18%, 62%, 66%, 100% { opacity: 1; }
  15%, 63% { opacity: 0.28; }
}

.train-hub__layer--rest .train-hub__line--cyan {
  animation: train-hub-cyan-flicker 5.4s steps(1, end) infinite;
}

@keyframes train-hub-glitch-idle-acid {
  0%, 88%, 100% { opacity: 0; transform: none; }
  89% { opacity: 0.45; transform: translate(-3px, 1px); }
  90% { opacity: 0; transform: none; }
  91% { opacity: 0.35; transform: translate(-2px, 0); }
  92% { opacity: 0; transform: none; }
}

@keyframes train-hub-glitch-idle-blood {
  0%, 90%, 100% { opacity: 0; transform: none; }
  91% { opacity: 0.4; transform: translate(3px, -1px); }
  92% { opacity: 0; transform: none; }
  93% { opacity: 0.3; transform: translate(2px, 0); }
  94% { opacity: 0; transform: none; }
}

.train-hub__tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.55em 0.85em;
  margin: 0;
  padding-top: 0.05rem;
  font-family: var(--aura-font-heading);
  font-size: clamp(0.62rem, 0.8vw, 0.72rem);
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.train-hub__pitch {
  margin: 0;
  width: min(100%, 40rem);
  max-width: none;
  padding-bottom: 0;
  font-family: var(--aura-font-body, "Manrope", sans-serif);
  font-size: clamp(0.76rem, 0.92vw, 0.86rem);
  line-height: 1.38;
  color: rgba(240, 242, 245, 0.72);
  text-wrap: balance;
}

.train-hub__pitch span {
  color: var(--aura-accent);
  font-weight: 700;
}


.train-flow__rows {
  list-style: none;
  margin: 0;
  padding: 0;
  flex: 1 1 0;
  min-height: 0;
  display: grid;
  grid-template-rows: repeat(3, minmax(0, 1fr));
  gap: clamp(0.55rem, 1.2vh, 0.85rem);
  width: 100%;
  max-width: none;
  align-content: stretch;
}

.train-flow__rows--3 {
  grid-template-rows: repeat(3, minmax(0, 1fr));
}

.train-flow__rows > li {
  min-height: 0;
  height: 100%;
  display: block;
}

.train-flow__row {
  --flow-accent: var(--aura-primary);
  --flow-glow: rgba(255, 42, 66, 0.45);
  position: relative;
  display: grid;
  grid-template-columns: clamp(5rem, 9vw, 7.5rem) minmax(0, 1fr) auto;
  align-items: center;
  column-gap: clamp(0.85rem, 2vw, 1.75rem);
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: clamp(1.35rem, 2.8vh, 2rem) clamp(1.25rem, 3.5vw, 2.75rem);
  text-decoration: none;
  color: inherit;
  overflow: hidden;
  background: #07090d;
  border: none;
  border-left: 3px solid transparent;
  /* Soft rail cut — not a pointed arrow card */
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 20px), calc(100% - 42px) 100%, 0 100%);
  transition:
    transform 0.3s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.3s ease,
    border-color 0.3s ease;
}

.train-flow__rows > li:nth-child(even) .train-flow__row {
  clip-path: polygon(0 0, calc(100% - 42px) 0, 100% 20px, 100% 100%, 0 100%);
}

.train-flow__row--cyan {
  --flow-accent: var(--aura-secondary);
  --flow-glow: rgba(0, 229, 255, 0.45);
}

.train-flow__row--acid {
  --flow-accent: var(--aura-accent);
  --flow-glow: rgba(223, 255, 0, 0.22);
}

.train-flow__edge {
  display: none;
}

.train-flow__bg {
  position: absolute;
  inset: -4%;
  z-index: 0;
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  filter: brightness(1.08) saturate(1.06);
  transform: scale(1.04);
  transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1), filter 0.35s ease;
}

.train-flow__veil {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(
      90deg,
      rgba(7, 9, 13, 0.9) 0%,
      rgba(7, 9, 13, 0.78) 24%,
      rgba(7, 9, 13, 0.68) 50%,
      rgba(7, 9, 13, 0.55) 74%,
      rgba(7, 9, 13, 0.62) 100%
    ),
    linear-gradient(0deg, rgba(7, 9, 13, 0.42) 0%, transparent 50%);
  pointer-events: none;
  transition: background 0.35s ease;
}

.train-flow__num {
  position: relative;
  z-index: 4;
  display: block;
  width: auto;
  height: auto;
  font-family: var(--aura-font-heading);
  font-size: clamp(2.4rem, 5.5vw, 4rem);
  font-weight: 900;
  line-height: 0.85;
  letter-spacing: -0.06em;
  color: transparent;
  -webkit-text-stroke: 1.5px color-mix(in srgb, var(--flow-accent) 55%, rgba(255, 255, 255, 0.25));
  background: none;
  border: none;
  clip-path: none;
  box-shadow: none;
  user-select: none;
  transition:
    color 0.25s ease,
    -webkit-text-stroke-color 0.25s ease,
    transform 0.25s ease,
    text-shadow 0.25s ease,
    filter 0.25s ease;
}

.train-flow__row--blood .train-flow__num,
.train-flow__row--cyan .train-flow__num,
.train-flow__row--acid .train-flow__num {
  -webkit-text-stroke-color: color-mix(in srgb, var(--flow-accent) 55%, rgba(255, 255, 255, 0.25));
}

.train-flow__copy {
  position: relative;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  width: 100%;
  max-width: 36rem;
  margin: 0 auto;
  text-align: center;
  transition: transform 0.22s ease;
}

.train-flow__tag {
  display: none;
}

.train-flow__name {
  display: block;
  margin: 0;
  font-family: var(--aura-font-heading);
  font-size: clamp(1.4rem, 2.9vw, 2.15rem);
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  color: #fff;
  text-shadow:
    0 2px 18px rgba(0, 0, 0, 0.7),
    0 0 24px rgba(0, 0, 0, 0.45);
  transition: color 0.25s ease, text-shadow 0.25s ease;
}

.train-flow__desc {
  margin: 0;
  max-width: 34rem;
  font-size: clamp(1rem, 1.3vw, 1.18rem);
  line-height: 1.48;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.94);
  text-shadow:
    0 1px 2px rgba(0, 0, 0, 0.85),
    0 2px 16px rgba(0, 0, 0, 0.65);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.train-flow__go {
  position: relative;
  z-index: 4;
  justify-self: end;
  align-self: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  margin: 0;
  min-width: 10.5rem;
  padding: 0.82rem 1.25rem 0.82rem 1.4rem;
  font-family: var(--aura-font-heading);
  font-size: clamp(0.84rem, 1.05vw, 0.98rem);
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #fff;
  white-space: nowrap;
  background: var(--flow-accent);
  border: none;
  border-radius: 999px;
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--flow-accent) 55%, #fff),
    0 0 22px var(--flow-glow),
    0 10px 24px rgba(0, 0, 0, 0.35);
  clip-path: none;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.25);
  transition:
    color 0.2s ease,
    background 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.2s ease,
    filter 0.2s ease;
}

.train-flow__go-label {
  display: block;
  line-height: 1;
}

.train-flow__go-arrow {
  display: block;
  width: 1.15em;
  height: 1.15em;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.35;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.22s ease;
}

.train-flow__row:hover,
.train-flow__row:focus-visible,
.train-flow__row:active,
.train-flow__row.is-hot {
  transform: none;
  border-left-color: var(--flow-accent);
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--flow-accent) 22%, transparent),
    0 0 40px color-mix(in srgb, var(--flow-glow) 35%, transparent);
  outline: none;
}

.train-flow__row:hover .train-flow__bg,
.train-flow__row:focus-visible .train-flow__bg,
.train-flow__row:active .train-flow__bg,
.train-flow__row.is-hot .train-flow__bg {
  transform: scale(1.08);
  filter: brightness(1.16) saturate(1.12);
}

.train-flow__row:hover .train-flow__veil,
.train-flow__row:focus-visible .train-flow__veil,
.train-flow__row:active .train-flow__veil,
.train-flow__row.is-hot .train-flow__veil {
  background:
    linear-gradient(
      90deg,
      color-mix(in srgb, var(--flow-accent) 14%, rgba(7, 9, 13, 0.88)) 0%,
      rgba(7, 9, 13, 0.7) 28%,
      rgba(7, 9, 13, 0.52) 52%,
      rgba(7, 9, 13, 0.4) 74%,
      rgba(7, 9, 13, 0.58) 100%
    ),
    linear-gradient(0deg, rgba(7, 9, 13, 0.32) 0%, transparent 50%);
}

.train-flow__row:hover .train-flow__edge,
.train-flow__row:focus-visible .train-flow__edge,
.train-flow__row:active .train-flow__edge,
.train-flow__row.is-hot .train-flow__edge {
  transform: none;
}

.train-flow__row:hover .train-flow__copy,
.train-flow__row:focus-visible .train-flow__copy,
.train-flow__row:active .train-flow__copy,
.train-flow__row.is-hot .train-flow__copy {
  transform: none;
}

.train-flow__row:hover .train-flow__num,
.train-flow__row:focus-visible .train-flow__num,
.train-flow__row:active .train-flow__num,
.train-flow__row.is-hot .train-flow__num {
  color: var(--flow-accent);
  -webkit-text-stroke-color: transparent;
  text-shadow: 0 0 22px var(--flow-glow);
  transform: scale(1.04);
  background: none;
  border: none;
  box-shadow: none;
}

.train-flow__row:hover .train-flow__name,
.train-flow__row:focus-visible .train-flow__name,
.train-flow__row:active .train-flow__name,
.train-flow__row.is-hot .train-flow__name {
  color: #fff;
  text-shadow:
    0 2px 18px rgba(0, 0, 0, 0.55),
    0 0 22px color-mix(in srgb, var(--flow-glow) 55%, transparent);
}

.train-flow__row:hover .train-flow__go,
.train-flow__row:focus-visible .train-flow__go,
.train-flow__row:active .train-flow__go,
.train-flow__row.is-hot .train-flow__go {
  color: #fff;
  background: var(--flow-accent);
  border: none;
  filter: brightness(1.08);
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--flow-accent) 70%, #fff),
    0 0 32px var(--flow-glow),
    0 12px 28px rgba(0, 0, 0, 0.4);
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.25);
  transform: translateX(3px) scale(1.03);
  letter-spacing: 0.12em;
}

.train-flow__row--acid .train-flow__go {
  color: #0a0c10;
  text-shadow: none;
  box-shadow:
    0 0 0 1px color-mix(in srgb, #0a0c10 28%, var(--flow-accent)),
    0 0 12px rgba(223, 255, 0, 0.22),
    0 8px 18px rgba(0, 0, 0, 0.4);
}

.train-flow__row--acid:hover .train-flow__go,
.train-flow__row--acid:focus-visible .train-flow__go,
.train-flow__row--acid:active .train-flow__go,
.train-flow__row--acid.is-hot .train-flow__go {
  color: #0a0c10;
  filter: brightness(1.02);
  text-shadow: none;
  box-shadow:
    0 0 0 1px color-mix(in srgb, #0a0c10 32%, var(--flow-accent)),
    0 0 16px rgba(223, 255, 0, 0.26),
    0 10px 22px rgba(0, 0, 0, 0.45);
}

.train-flow__row:hover .train-flow__go-arrow,
.train-flow__row:focus-visible .train-flow__go-arrow,
.train-flow__row:active .train-flow__go-arrow,
.train-flow__row.is-hot .train-flow__go-arrow {
  transform: translateX(4px);
}

.train-hub .reveal-up {
  opacity: 1 !important;
  transform: none !important;
}

.train-hub .hero-rise {
  opacity: 0;
}

.train-page .train-menu {
  padding-top: clamp(1.25rem, 2.5vh, 1.75rem);
  padding-bottom: clamp(2rem, 4vh, 3rem);
}

/* ── Process timeline ── */
.train-process {
  padding-block: clamp(2rem, 4vh, 3.25rem);
  background:
    radial-gradient(ellipse 70% 55% at 0% 0%, rgba(255, 42, 66, 0.08), transparent 55%),
    radial-gradient(ellipse 55% 45% at 100% 100%, rgba(0, 229, 255, 0.06), transparent 50%),
    var(--aura-bg);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.train-process__head {
  max-width: 42rem;
  margin: 0 auto clamp(1.75rem, 3.5vh, 2.5rem);
  text-align: center;
}

.train-process__lead {
  margin: 0 auto;
  max-width: 36rem;
  font-size: clamp(0.88rem, 1.6vw, 1rem);
  line-height: 1.5;
  color: rgba(240, 242, 245, 0.72);
}

.train-process__kicker {
  margin: 0 0 0.35rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--aura-secondary);
}

.train-process__title {
  margin: 0 0 0.5rem;
  font-family: var(--aura-font-heading);
  font-size: clamp(1.35rem, 2.8vw, 2rem);
  font-weight: 800;
  line-height: 1.1;
  text-transform: uppercase;
  color: #fff;
}

.train-process__steps-wrap {
  --process-gap: clamp(0.65rem, 1.5vw, 1rem);
  position: relative;
}

.train-process__track {
  position: absolute;
  top: 1.625rem;
  left: calc((100% - 3 * var(--process-gap)) / 8);
  width: calc(100% - (100% - 3 * var(--process-gap)) / 4);
  height: 2px;
  transform: translateY(-50%);
  pointer-events: none;
  z-index: 0;
}

.train-process__track-bg,
.train-process__track-fill {
  position: absolute;
  inset: 0;
  border-radius: 999px;
}

.train-process__track-bg {
  background: rgba(255, 255, 255, 0.12);
}

.train-process__track-fill {
  width: 0;
  background: linear-gradient(
    90deg,
    var(--aura-primary) 0%,
    var(--aura-secondary) 55%,
    var(--aura-accent) 100%
  );
  transition: width 1.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.train-process.is-ready .train-process__track-fill {
  width: 100%;
}

.train-process__steps {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: 1fr;
  align-items: stretch;
  gap: var(--process-gap);
  margin: 0;
  padding: 0;
  list-style: none;
}

.train-process__step {
  position: relative;
  display: grid;
  grid-template-rows: 3.25rem minmax(0, 1fr);
  justify-items: center;
  align-items: stretch;
  height: 100%;
  gap: clamp(0.75rem, 1.5vw, 0.95rem);
  min-width: 0;
}

.train-process__num {
  position: relative;
  z-index: 2;
  grid-row: 1;
  align-self: center;
  justify-self: center;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3.25rem;
  height: 3.25rem;
  font-family: var(--aura-font-heading);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: #fff;
  background: #12151c;
  border: 2px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  box-shadow: 0 0 0 4px #12151c;
  transition: border-color 0.35s ease, box-shadow 0.35s ease, transform 0.35s ease;
}

.train-process__step--blood .train-process__num { border-color: rgba(255, 42, 66, 0.65); }
.train-process__step--cyan .train-process__num { border-color: rgba(0, 229, 255, 0.65); }
.train-process__step--acid .train-process__num { border-color: rgba(204, 255, 0, 0.65); }

.train-process__step.is-lit .train-process__num {
  transform: scale(1.03);
}

.train-process__step--blood.is-lit .train-process__num {
  border-color: var(--aura-primary);
  box-shadow: 0 0 0 4px #12151c, 0 0 16px rgba(255, 42, 66, 0.35);
}

.train-process__step--cyan.is-lit .train-process__num {
  border-color: var(--aura-secondary);
  box-shadow: 0 0 0 4px #12151c, 0 0 16px rgba(0, 229, 255, 0.28);
}

.train-process__step--acid.is-lit .train-process__num {
  border-color: var(--aura-accent);
  box-shadow: 0 0 0 4px #12151c, 0 0 16px rgba(204, 255, 0, 0.22);
}

.train-process__card {
  grid-row: 2;
  width: 100%;
  height: 100%;
  min-height: clamp(7.25rem, 13vw, 8.75rem);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: clamp(1rem, 1.8vw, 1.2rem);
  text-align: center;
  background: rgba(10, 12, 16, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-top: 2px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  box-sizing: border-box;
  opacity: 0;
  transform: translateY(16px);
  transition:
    opacity 0.5s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.5s cubic-bezier(0.22, 1, 0.36, 1),
    border-color 0.3s ease;
}

.train-process.is-ready .train-process__card {
  opacity: 1;
  transform: translateY(0);
}

.train-process.is-ready .train-process__step:nth-child(1) .train-process__card { transition-delay: 0.08s; }
.train-process.is-ready .train-process__step:nth-child(2) .train-process__card { transition-delay: 0.22s; }
.train-process.is-ready .train-process__step:nth-child(3) .train-process__card { transition-delay: 0.36s; }
.train-process.is-ready .train-process__step:nth-child(4) .train-process__card { transition-delay: 0.5s; }

.train-process__step.is-lit .train-process__card {
  border-color: rgba(255, 255, 255, 0.14);
  border-top-color: rgba(0, 229, 255, 0.45);
}

.train-process__card-title {
  margin: 0;
  width: 100%;
  font-family: var(--aura-font-heading);
  font-size: clamp(0.8rem, 1.35vw, 0.92rem);
  font-weight: 800;
  line-height: 1.3;
  text-align: center;
  text-transform: uppercase;
  color: #fff;
}

.train-process__card-text {
  margin: 0;
  width: 100%;
  font-size: clamp(0.82rem, 1.35vw, 0.9rem);
  line-height: 1.5;
  text-align: center;
  color: rgba(240, 242, 245, 0.72);
}

.train-faq-shell {
  padding-block: clamp(2rem, 4vh, 3rem) clamp(2.5rem, 5vh, 3.5rem);
  background: var(--aura-surface, #141820);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.train-page .train-menu__dock {
  margin-top: 0;
  padding-top: clamp(0.75rem, 1.4vh, 1rem);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.train-page .train-menu__panel {
  border: none;
  background: rgba(10, 12, 16, 0.38);
  clip-path: none;
}

@media (max-height: 900px) and (min-width: 901px) {
  .train-hub:not(.train-hub--home) {
    height: auto;
    max-height: none;
    min-height: 0;
    overflow: visible;
    padding-block: clamp(0.85rem, 1.8vh, 1.35rem);
  }

  .train-hub:not(.train-hub--home) .train-hub__shell {
    height: auto;
    max-height: none;
    min-height: 0;
  }

  .train-hub:not(.train-hub--home) .train-hub__mast {
    --mast-inner: clamp(0.24rem, 0.48vh, 0.36rem);
    padding-bottom: clamp(0.7rem, 1.6vh, 1.1rem);
  }

  .train-hub__layer {
    font-size: clamp(1.2rem, 2.6vw, 1.7rem);
    white-space: normal;
    flex-wrap: wrap;
    line-height: 1.06;
  }

  .train-hub:not(.train-hub--home) .train-flow__rows {
    flex: none;
    grid-template-rows: none;
    min-height: 0;
    gap: clamp(0.65rem, 1.4vh, 0.95rem);
  }

  .train-hub:not(.train-hub--home) .train-flow__rows > li {
    height: auto;
    min-height: 0;
  }

  .train-hub:not(.train-hub--home) .train-flow__row {
    height: auto;
    min-height: 7.25rem;
    padding-block: clamp(0.75rem, 1.4vh, 1rem);
  }

  .train-hub__pitch {
    font-size: 0.72rem;
    line-height: 1.32;
  }

  .train-hub__tags {
    font-size: 0.6rem;
  }
}

@media (max-width: 900px) {
  .train-hub {
    height: auto;
    max-height: none;
    min-height: auto;
    overflow: visible;
    padding: clamp(1.75rem, 4vh, 2.5rem) 0 clamp(2rem, 5vh, 3rem);
  }

  .train-hub__layer {
    font-size: clamp(1.15rem, 5.8vw, 1.85rem);
    gap: 0.22em;
  }

  .train-hub__mast {
    padding-top: 0;
    padding-bottom: 1.25rem;
  }

  .train-hub__shell {
    height: auto;
    max-height: none;
    min-height: auto;
    gap: 0;
  }

      .train-flow__rows {
    grid-template-rows: none;
    flex: none;
    min-height: 0;
    margin-top: 0;
    gap: 0.75rem;
    max-width: none;
  }

  .train-flow__rows > li {
    min-height: 0;
    height: auto;
    display: block;
  }

  .train-flow__row {
    grid-template-columns: clamp(3.4rem, 14vw, 4.5rem) minmax(0, 1fr);
    grid-template-rows: auto auto;
    height: auto;
    min-height: clamp(8rem, 30vw, 10rem);
    padding: 1.2rem 1.1rem 1.2rem 1rem;
    justify-items: stretch;
    column-gap: 0.75rem;
    row-gap: 0.55rem;
    clip-path: polygon(0 0, 100% 0, 100% calc(100% - 14px), calc(100% - 28px) 100%, 0 100%);
  }

  .train-flow__rows > li:nth-child(even) .train-flow__row {
    clip-path: polygon(0 0, calc(100% - 28px) 0, 100% 14px, 100% 100%, 0 100%);
  }

  .train-flow__num {
    left: auto;
    width: auto;
    height: auto;
    font-size: clamp(2.1rem, 11vw, 2.85rem);
    grid-column: 1;
    grid-row: 1;
    align-self: center;
    -webkit-text-stroke-width: 1.25px;
  }

  .train-flow__copy {
    max-width: none;
    width: 100%;
    align-items: center;
    text-align: center;
    gap: 0.28rem;
    grid-column: 2;
    grid-row: 1;
    margin: 0;
  }

  .train-flow__name {
    font-size: clamp(1.2rem, 5.2vw, 1.55rem);
  }

  .train-flow__desc {
    font-size: clamp(0.92rem, 3.6vw, 1.05rem);
    -webkit-line-clamp: 3;
    color: rgba(255, 255, 255, 0.94);
  }

  .train-flow__go {
    position: static;
    transform: none;
    margin: 0;
    grid-column: 1 / -1;
    grid-row: 2;
    justify-self: center;
    width: max-content;
    padding: 0.72rem 1.25rem;
    font-size: 0.82rem;
    border-radius: 999px;
  }

  .train-flow__row:hover .train-flow__go,
  .train-flow__row:focus-visible .train-flow__go,
  .train-flow__row:active .train-flow__go,
  .train-flow__row.is-hot .train-flow__go {
    transform: none;
  }

  .train-process__track {
    display: none;
  }

  .train-process__steps {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .train-process__step {
    position: relative;
    display: grid;
    grid-template-columns: 3.25rem minmax(0, 1fr);
    column-gap: 0.85rem;
    row-gap: 0;
    align-items: start;
    padding: 0 0 1.35rem;
  }

  .train-process__step:not(:last-child)::before {
    content: '';
    position: absolute;
    display: block;
    top: 3.25rem;
    left: 1.625rem;
    width: 2px;
    height: calc(100% - 3.25rem);
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    pointer-events: none;
    transition: background 0.35s ease;
  }

  .train-process__step.is-lit:not(:last-child)::before {
    background: linear-gradient(180deg, var(--aura-primary), var(--aura-secondary));
  }

  .train-process__num {
    grid-column: 1;
    grid-row: 1;
  }

  .train-process__card {
    grid-column: 2;
    grid-row: 1;
    margin: 0;
    height: auto;
    min-height: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .train-hub__bg::after,
  .train-hub__glitch,
  .train-hub__swap--rest,
  .train-hub__swap--alt,
  .train-hub__layer--rest .train-hub__line--cyan,
  .train-hub__swap--alt .train-hub__layer--acid,
  .train-hub__swap--alt .train-hub__layer--blood {
    animation: none;
  }

  .train-hub .hero-rise {
    opacity: 1;
    animation: none;
  }

  .train-hub__swap--rest,
  .train-hub__swap--alt {
    transition: none;
  }

  .train-flow__row,
  .train-flow__bg,
  .train-flow__go,
  .train-flow__edge,
  .train-flow__copy {
    transition: none;
  }

  .train-process__card,
  .train-process__num,
  .train-process__track-fill {
    transition: none !important;
  }

  .train-process__card {
    opacity: 1;
    transform: none;
  }

  .train-process.is-ready .train-process__track-fill {
    width: 100%;
  }
}

/* Homepage only: heavier billboard vs catalog on /trenirovki/ */
.train-hub--home {
  box-sizing: border-box;
  height: calc(100svh - var(--flow-nav));
  min-height: calc(100svh - var(--flow-nav));
  max-height: calc(100svh - var(--flow-nav));
  padding-top: clamp(0.9rem, 2.4vh, 1.6rem);
  padding-bottom: clamp(1.35rem, 3.4vh, 2.35rem);
  overflow: hidden;
}

.train-hub--home .train-hub__shell {
  height: 100%;
  min-height: 0;
  max-height: none;
  gap: clamp(1rem, 3vh, 2rem);
}

.train-hub--home .train-hub__mast {
  padding-top: clamp(0.35rem, 1.2vh, 0.85rem);
  padding-bottom: clamp(0.65rem, 2vh, 1.25rem);
}

.train-hub--home .train-hub__layer {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  white-space: normal;
  font-size: clamp(2.15rem, 6.4vw, 4.85rem);
  line-height: 1.02;
  letter-spacing: -0.03em;
}

.train-hub--home .train-hub__line {
  display: block;
}

.train-hub--home .train-flow__rows {
  flex: 1 1 0;
  min-height: 0;
  gap: clamp(1rem, 2.8vh, 1.85rem);
}

.train-hub--home .train-flow__name {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: center;
  align-items: baseline;
  gap: 0.28em;
  font-size: clamp(1.55rem, 3.3vw, 2.45rem);
}

.train-hub--home .train-flow__name-a,
.train-hub--home .train-flow__name-b {
  display: inline;
  font-size: 1em;
  font-weight: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
}

.train-hub--home .train-flow__name-a {
  color: var(--flow-accent);
  text-shadow:
    0 2px 18px rgba(0, 0, 0, 0.7),
    0 0 28px var(--flow-glow);
}

.train-hub--home .train-flow__name-b {
  color: #fff;
}

.train-hub--home .train-flow__row:hover .train-flow__name-a,
.train-hub--home .train-flow__row:focus-visible .train-flow__name-a,
.train-hub--home .train-flow__row:active .train-flow__name-a,
.train-hub--home .train-flow__row.is-hot .train-flow__name-a {
  color: var(--flow-accent);
}

.train-hub--home .train-flow__desc {
  display: none;
}

.train-hub--home .train-flow__veil {
  background:
    linear-gradient(
      90deg,
      rgba(28, 30, 36, 0.62) 0%,
      rgba(28, 30, 36, 0.32) 40%,
      rgba(28, 30, 36, 0.12) 100%
    ),
    linear-gradient(0deg, rgba(28, 30, 36, 0.2) 0%, transparent 55%);
}

.train-hub--home .train-flow__row:hover .train-flow__veil,
.train-hub--home .train-flow__row:focus-visible .train-flow__veil,
.train-hub--home .train-flow__row.is-hot .train-flow__veil {
  background:
    linear-gradient(
      90deg,
      color-mix(in srgb, var(--flow-accent) 18%, rgba(28, 30, 36, 0.48)) 0%,
      rgba(28, 30, 36, 0.22) 48%,
      rgba(28, 30, 36, 0.08) 100%
    );
}

.train-hub--home .train-flow__bg {
  filter: brightness(1.12) saturate(1.18) contrast(1.04);
}

.train-hub--home .train-flow__row:hover .train-flow__bg,
.train-hub--home .train-flow__row:focus-visible .train-flow__bg,
.train-hub--home .train-flow__row.is-hot .train-flow__bg {
  transform: scale(1.08);
  filter: brightness(1.2) saturate(1.26) contrast(1.06);
}

.train-hub--home .train-flow__go {
  animation: none;
  min-width: 11.5rem;
}

.train-hub--home .train-flow__row--acid .train-flow__go,
.train-hub--home .train-flow__row--acid:hover .train-flow__go,
.train-hub--home .train-flow__row--acid:focus-visible .train-flow__go,
.train-hub--home .train-flow__row--acid.is-hot .train-flow__go {
  color: #0a0c10;
  text-shadow: none;
}

@media (max-width: 900px) {
  .train-hub--home .train-hub__layer {
    font-size: clamp(1.85rem, 9.5vw, 2.7rem);
  }

  .train-hub--home .train-flow__name {
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: center;
    gap: 0.12em;
    font-size: clamp(1.18rem, 5vw, 1.5rem);
    letter-spacing: -0.025em;
    max-width: 100%;
  }

  .train-hub--home .train-flow__copy {
    min-width: 0;
  }

  .train-hub--home .train-flow__name-a,
  .train-hub--home .train-flow__name-b {
    display: block;
  }

  .train-hub--home .train-flow__name-a {
    color: var(--flow-accent);
    white-space: nowrap;
    max-width: 100%;
  }

  .train-hub--home .train-flow__desc {
    display: none;
  }

  .train-hub--home .train-flow__row {
    row-gap: 0.85rem;
    padding-block: 1.2rem;
    align-content: center;
    align-items: center;
  }

  .train-hub--home .train-flow__num {
    grid-row: 1 / span 2;
    align-self: center;
  }

  .train-hub--home .train-flow__go {
    grid-column: 2;
    grid-row: 2;
    justify-self: center;
    margin-top: 0;
  }

  .train-hub--home {
    display: flex;
    flex-direction: column;
    height: auto;
    min-height: calc(100svh - var(--flow-nav));
    max-height: none;
    padding-top: clamp(0.85rem, 2.2vh, 1.35rem);
    padding-bottom: clamp(1.15rem, 3.2vh, 1.85rem);
    overflow: visible;
  }

  .train-hub--home .train-hub__shell {
    flex: 1 1 auto;
    height: auto;
    min-height: 0;
    max-height: none;
    gap: clamp(0.85rem, 2.4vh, 1.35rem);
  }

  .train-hub--home .train-hub__mast {
    padding-top: 0.15rem;
    padding-bottom: clamp(0.55rem, 1.8vh, 0.95rem);
  }

  .train-hub--home .train-flow__rows {
    flex: 1 1 auto;
    display: grid;
    grid-template-rows: repeat(3, minmax(8rem, 1fr));
    gap: clamp(0.8rem, 2vh, 1.15rem);
    min-height: 0;
  }

  .train-hub--home .train-flow__rows > li {
    min-height: 8rem;
    height: auto;
  }

  .train-hub--home .train-flow__row {
    height: 100%;
    min-height: 8rem;
    padding-block: clamp(1.15rem, 2.8vh, 1.55rem);
  }
}

@media (max-width: 900px) and (orientation: landscape) and (max-height: 500px) {
  .train-hub--home {
    min-height: 0;
  }

  .train-hub--home .train-flow__rows {
    flex: none;
    grid-template-rows: none;
  }
}

.train-hub--catalog .train-flow__row {
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  column-gap: clamp(0.75rem, 1.8vw, 1.35rem);
  padding-block: clamp(1.1rem, 2.4vh, 1.65rem);
}

.train-hub--catalog .train-flow__copy {
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  text-align: left;
  margin: 0;
  max-width: none;
  width: auto;
}

.train-hub--catalog .train-flow__name {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: baseline;
  gap: 0.28em;
  white-space: nowrap;
  font-size: clamp(1.65rem, 3.7vw, 2.45rem);
  line-height: 0.92;
  letter-spacing: -0.045em;
  overflow-wrap: normal;
  word-break: normal;
}

.train-hub--catalog .train-flow__name-a,
.train-hub--catalog .train-flow__name-b {
  display: inline-block;
  white-space: nowrap;
}

.train-hub--catalog .train-flow__name-a {
  color: var(--flow-accent);
  text-shadow:
    0 2px 18px rgba(0, 0, 0, 0.7),
    0 0 28px var(--flow-glow);
}

.train-hub--catalog .train-flow__name-b {
  color: #fff;
}

.train-hub--catalog .train-flow__num {
  font-size: clamp(2.6rem, 6.4vw, 4.6rem);
  color: transparent;
  -webkit-text-stroke: 1.5px color-mix(in srgb, var(--flow-accent) 55%, rgba(255, 255, 255, 0.25));
  text-shadow: none;
}

.train-hub--catalog .train-flow__row:hover .train-flow__num,
.train-hub--catalog .train-flow__row:focus-visible .train-flow__num,
.train-hub--catalog .train-flow__row:active .train-flow__num,
.train-hub--catalog .train-flow__row.is-hot .train-flow__num {
  color: var(--flow-accent);
  -webkit-text-stroke-color: transparent;
  text-shadow: 0 0 22px var(--flow-glow);
}

.train-hub--catalog .train-flow__row:hover .train-flow__name,
.train-hub--catalog .train-flow__row:focus-visible .train-flow__name,
.train-hub--catalog .train-flow__row.is-hot .train-flow__name {
  color: #fff;
  text-shadow:
    0 2px 18px rgba(0, 0, 0, 0.55),
    0 0 26px color-mix(in srgb, var(--flow-glow) 70%, transparent);
}

.train-hub--catalog .train-flow__row:hover .train-flow__name-a,
.train-hub--catalog .train-flow__row:focus-visible .train-flow__name-a,
.train-hub--catalog .train-flow__row.is-hot .train-flow__name-a {
  color: var(--flow-accent);
}

.train-hub--catalog .train-flow__row:hover .train-flow__name-b,
.train-hub--catalog .train-flow__row:focus-visible .train-flow__name-b,
.train-hub--catalog .train-flow__row.is-hot .train-flow__name-b {
  color: #fff;
}

@media (max-width: 900px) {
  .train-hub--catalog .train-flow__row {
    position: relative;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto;
    min-height: 6.4rem;
    padding: 1.05rem 1rem;
    column-gap: 0;
    row-gap: 0.7rem;
    justify-items: center;
    align-items: center;
  }

  .train-hub--catalog .train-flow__copy {
    align-items: center;
    text-align: center;
    width: 100%;
    padding-inline: 2.55rem;
  }

  .train-hub--catalog .train-flow__name {
    white-space: normal;
    font-size: clamp(1.05rem, 4.8vw, 1.45rem);
    line-height: 1.08;
    flex-direction: column;
    align-items: center;
    gap: 0.1em;
  }

  .train-hub--catalog .train-flow__num {
    position: absolute;
    left: 0.7rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: clamp(1.55rem, 7.4vw, 2rem);
  }

  .train-hub--catalog .train-flow__go {
    grid-column: 1;
    grid-row: 2;
    justify-self: center;
    min-width: 0;
    padding: 0.7rem 0.95rem 0.7rem 1.05rem;
  }
}








