/* =========================================================
   МАРШРУТ — design system + homepage
   Signal yellow · blueprint slate/cyan · dark cinematic
   ========================================================= */

:root {
  --bg: #0a0e14;
  --bg-elevated: #121820;
  --ink: #f2f4f7;
  --ink-muted: #9aa5b5;
  --ink-dim: #6b7687;
  --signal: #f5c518;
  --signal-deep: #d4a60e;
  --signal-soft: rgba(245, 197, 24, 0.14);
  --slate: #1a2332;
  --cyan: #3d8b9c;
  --cyan-soft: rgba(61, 139, 156, 0.18);
  --line: rgba(242, 244, 247, 0.08);
  --line-strong: rgba(242, 244, 247, 0.16);
  --radius: 14px;
  --radius-sm: 10px;
  --font-display: "Unbounded", "Segoe UI", sans-serif;
  --font-body: "Manrope", "Segoe UI", sans-serif;
  --space: clamp(1rem, 3vw, 2rem);
  --max: 1120px;
  --header-h: 4.25rem;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --shadow-cta: 0 12px 40px rgba(245, 197, 24, 0.22);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: var(--cyan);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

a:hover {
  color: var(--signal);
}

button {
  font: inherit;
  cursor: pointer;
  border: 0;
  background: none;
  color: inherit;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Atmosphere ---------- */

.page-bg {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(ellipse 80% 50% at 70% 0%, rgba(61, 139, 156, 0.16), transparent 55%),
    radial-gradient(ellipse 60% 40% at 10% 30%, rgba(245, 197, 24, 0.07), transparent 50%),
    radial-gradient(ellipse 50% 60% at 90% 90%, rgba(26, 35, 50, 0.9), transparent 60%),
    linear-gradient(180deg, #0a0e14 0%, #0d121a 40%, #0a0e14 100%);
}

.page-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.045;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 180px;
  mix-blend-mode: overlay;
}

/* ---------- Layout ---------- */

.wrap {
  width: min(100% - 2 * var(--space), var(--max));
  margin-inline: auto;
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  display: flex;
  align-items: center;
  backdrop-filter: blur(16px) saturate(1.2);
  background: rgba(10, 14, 20, 0.72);
  border-bottom: 1px solid var(--line);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: min(100% - 2 * var(--space), var(--max));
  margin-inline: auto;
}

.logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.logo__mark {
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 4px;
  background: var(--signal);
  position: relative;
  flex-shrink: 0;
}

.logo__mark::after {
  content: "";
  position: absolute;
  inset: 28% 22%;
  border: 2px solid var(--bg);
  border-left: 0;
  border-bottom: 0;
  transform: rotate(45deg);
}

.nav {
  display: none;
  align-items: center;
  gap: 0.15rem 1.35rem;
}

.nav a {
  color: var(--ink-muted);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
  transition: color 0.2s var(--ease);
}

.nav a:hover,
.nav a[aria-current="page"] {
  color: var(--ink);
}

.nav__cta {
  margin-left: 0.5rem;
  padding: 0.55rem 1rem;
  border-radius: 999px;
  background: var(--signal);
  color: #111 !important;
  font-weight: 700;
  font-size: 0.88rem;
  text-decoration: none;
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.nav__tg {
  display: inline-flex !important;
  align-items: center;
  gap: 0.4rem;
  color: var(--cyan) !important;
  font-weight: 600 !important;
}

.nav__tg svg {
  flex-shrink: 0;
}

.nav__tg:hover {
  color: var(--signal) !important;
}

.nav__cta:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-cta);
  color: #111 !important;
}

.nav-toggle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0.5rem;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
}

.nav-toggle span {
  display: block;
  height: 2px;
  background: var(--ink);
  border-radius: 1px;
  transition: transform 0.25s var(--ease), opacity 0.2s;
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

@media (min-width: 860px) {
  .nav {
    display: flex;
  }

  .nav-toggle {
    display: none;
  }
}

.nav--open {
  display: flex;
  position: absolute;
  top: var(--header-h);
  left: 0;
  right: 0;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  padding: 0.75rem var(--space) 1.25rem;
  background: rgba(10, 14, 20, 0.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}

.nav--open a {
  padding: 0.85rem 0.25rem;
  border-bottom: 1px solid var(--line);
  font-size: 1.05rem;
}

.nav--open .nav__cta {
  margin: 0.85rem 0 0;
  text-align: center;
  border: 0;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 3.15rem;
  padding: 0.85rem 1.55rem;
  border-radius: 999px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: -0.01em;
  text-decoration: none;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), background 0.2s, color 0.2s, border-color 0.2s;
  touch-action: manipulation;
}

.btn:active {
  transform: scale(0.98);
}

.btn--primary {
  background: var(--signal);
  color: #111;
  box-shadow: var(--shadow-cta);
  position: relative;
}

.btn--primary::after {
  content: "";
  position: absolute;
  left: 18%;
  right: 18%;
  bottom: 0.55rem;
  height: 2px;
  background: rgba(17, 17, 17, 0.35);
  border-radius: 2px;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s var(--ease);
}

.btn--primary:hover {
  background: #ffd54a;
  color: #111;
  transform: translateY(-2px);
}

.btn--primary:hover::after {
  transform: scaleX(1);
}

.btn--ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line-strong);
}

.btn--ghost:hover {
  border-color: var(--cyan);
  color: var(--ink);
  background: var(--cyan-soft);
}

.btn--pulse {
  animation: cta-pulse 2.8s var(--ease) infinite;
}

@keyframes cta-pulse {
  0%,
  100% {
    box-shadow: 0 12px 40px rgba(245, 197, 24, 0.22);
  }
  50% {
    box-shadow: 0 14px 48px rgba(245, 197, 24, 0.4);
  }
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  min-height: calc(100svh - var(--header-h));
  display: grid;
  align-items: end;
  overflow: visible;
  isolation: isolate;
}

.hero__visual {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(105deg, rgba(10, 14, 20, 0.92) 0%, rgba(10, 14, 20, 0.55) 42%, rgba(10, 14, 20, 0.25) 100%),
    linear-gradient(180deg, transparent 55%, rgba(10, 14, 20, 0.95) 100%),
    radial-gradient(ellipse 70% 80% at 78% 42%, rgba(61, 139, 156, 0.28), transparent 55%),
    radial-gradient(circle at 65% 30%, rgba(245, 197, 24, 0.12), transparent 35%),
    var(--slate);
}

.hero__route {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.85;
}

.hero__route path {
  fill: none;
  stroke: var(--signal);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1400;
  stroke-dashoffset: 1400;
}

.hero__route path.route-secondary {
  stroke: var(--cyan);
  stroke-width: 1.5;
  opacity: 0.55;
  stroke-dasharray: 900;
  stroke-dashoffset: 900;
}

.hero__route .route-dot {
  fill: var(--signal);
  opacity: 0;
}

.hero.is-ready .hero__route path.route-main {
  animation: route-draw 1.8s var(--ease) 0.35s forwards;
}

.hero.is-ready .hero__route path.route-secondary {
  animation: route-draw 2.2s var(--ease) 0.55s forwards;
}

.hero.is-ready .hero__route .route-dot {
  animation: fade-in 0.6s var(--ease) 1.6s forwards;
}

@keyframes route-draw {
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes fade-in {
  to {
    opacity: 1;
  }
}

.hero__grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(61, 139, 156, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(61, 139, 156, 0.07) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 70% 70% at 75% 40%, #000 20%, transparent 70%);
  opacity: 0.7;
}

.hero__content {
  position: relative;
  padding: clamp(2.5rem, 8vh, 5rem) 0 clamp(3rem, 10vh, 5.5rem);
  max-width: min(100%, 56rem);
}

.hero__brand {
  margin: 0 0 1.1rem;
  font-family: var(--font-display);
  font-weight: 800;
  /* Must fit «МАРШРУТ» on one line — was clipping at 7.5rem inside narrow column */
  font-size: clamp(2.5rem, 11vw, 5.75rem);
  line-height: 0.95;
  letter-spacing: -0.04em;
  color: var(--ink);
  text-transform: uppercase;
  width: max-content;
  max-width: 100%;
}

.hero__brand span {
  display: inline-block;
  max-width: 100%;
  background: linear-gradient(120deg, var(--ink) 42%, var(--signal) 92%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero__headline {
  margin: 0 0 0.85rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.35rem, 3.6vw, 1.85rem);
  line-height: 1.25;
  letter-spacing: -0.03em;
  color: var(--ink);
  max-width: 22ch;
}

.hero__lead {
  margin: 0 0 1.75rem;
  font-size: clamp(1rem, 2.2vw, 1.125rem);
  color: var(--ink-muted);
  max-width: 32ch;
}

.hero__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.hero__help {
  margin: 1.15rem 0 0;
  font-size: 0.95rem;
  color: var(--ink-muted);
}

.hero__help a {
  color: var(--signal);
  font-weight: 600;
  text-decoration: none;
}

.hero__help a:hover {
  text-decoration: underline;
}

.hero__reveal {
  opacity: 0;
  transform: translateY(28px);
}

.hero.is-ready .hero__reveal {
  animation: hero-up 0.9s var(--ease) forwards;
}

.hero.is-ready .hero__brand {
  animation-delay: 0.05s;
}

.hero.is-ready .hero__headline {
  animation-delay: 0.18s;
}

.hero.is-ready .hero__lead {
  animation-delay: 0.3s;
}

.hero.is-ready .hero__cta {
  animation-delay: 0.42s;
}

.hero.is-ready .hero__help {
  animation-delay: 0.52s;
}

@keyframes hero-up {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---------- Sections ---------- */

.section {
  padding: clamp(3.5rem, 9vw, 6.5rem) 0;
}

.section__head {
  margin-bottom: clamp(1.75rem, 4vw, 2.75rem);
  max-width: 36rem;
}

.section__eyebrow {
  margin: 0 0 0.65rem;
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cyan);
}

.section__title {
  margin: 0 0 0.65rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.65rem, 4vw, 2.35rem);
  letter-spacing: -0.035em;
  line-height: 1.15;
}

.section__sub {
  margin: 0;
  color: var(--ink-muted);
  font-size: 1.05rem;
}

/* ---------- Route picker ---------- */

.routes {
  display: grid;
  gap: 0.85rem;
}

@media (min-width: 640px) {
  .routes {
    grid-template-columns: 1fr 1fr;
  }
}

@media (min-width: 960px) {
  .routes {
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
  }
}

.route-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 11.5rem;
  padding: 1.35rem 1.25rem 1.25rem;
  border-radius: var(--radius);
  border: 1px solid var(--line-strong);
  background:
    linear-gradient(165deg, rgba(26, 35, 50, 0.85), rgba(18, 24, 32, 0.95));
  text-decoration: none;
  color: var(--ink);
  overflow: hidden;
  transition: border-color 0.25s var(--ease), transform 0.25s var(--ease), background 0.25s;
}

.route-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--accent, var(--signal));
  transform: scaleX(0.25);
  transform-origin: left;
  transition: transform 0.35s var(--ease);
}

.route-card:hover,
.route-card:focus-visible {
  border-color: color-mix(in srgb, var(--accent, var(--signal)) 55%, transparent);
  transform: translateY(-3px);
  outline: none;
}

.route-card:hover::before,
.route-card:focus-visible::before {
  transform: scaleX(1);
}

.route-card__tag {
  font-family: var(--font-display);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent, var(--signal));
  margin-bottom: 0.85rem;
}

.route-card__title {
  margin: 0 0 0.45rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: -0.03em;
}

.route-card__desc {
  margin: 0;
  flex: 1;
  font-size: 0.92rem;
  color: var(--ink-muted);
  line-height: 1.45;
}

.route-card__go {
  margin-top: 1.1rem;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.route-card__go svg {
  width: 1rem;
  height: 1rem;
  transition: transform 0.25s var(--ease);
}

.route-card:hover .route-card__go svg {
  transform: translateX(4px);
}

.route-card--biz {
  --accent: #3d8b9c;
}

.route-card--pay {
  --accent: #f5c518;
}

.route-card--cards {
  --accent: #7eb8c4;
}

.route-card--deposit {
  --accent: #c4a035;
}

/* ---------- How it works ---------- */

.steps {
  display: grid;
  gap: 0;
  border-top: 1px solid var(--line-strong);
}

.step {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.15rem 1.5rem;
  padding: 1.65rem 0;
  border-bottom: 1px solid var(--line);
  align-items: start;
}

@media (min-width: 720px) {
  .step {
    grid-template-columns: 4.5rem 1fr minmax(12rem, 18rem);
    align-items: center;
  }
}

.step__num {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2rem, 4vw, 2.6rem);
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--signal);
}

.step__title {
  margin: 0 0 0.35rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}

.step__text {
  margin: 0;
  color: var(--ink-muted);
  font-size: 0.98rem;
}

.step__aside {
  display: none;
  font-size: 0.88rem;
  color: var(--ink-dim);
  text-align: right;
}

@media (min-width: 720px) {
  .step__aside {
    display: block;
  }
}

/* ---------- Quiz band ---------- */

.quiz-band {
  position: relative;
  margin: 0 var(--space);
  border-radius: calc(var(--radius) + 4px);
  overflow: hidden;
  border: 1px solid var(--line-strong);
  background:
    radial-gradient(ellipse 80% 120% at 100% 0%, rgba(245, 197, 24, 0.16), transparent 50%),
    radial-gradient(ellipse 60% 80% at 0% 100%, rgba(61, 139, 156, 0.2), transparent 45%),
    var(--bg-elevated);
}

.quiz-band__inner {
  width: min(100% - 2 * var(--space), var(--max));
  margin-inline: auto;
  padding: clamp(2.25rem, 6vw, 3.5rem) 0;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  align-items: flex-start;
}

@media (min-width: 720px) {
  .quiz-band__inner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.quiz-band__title {
  margin: 0 0 0.5rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.45rem, 3.5vw, 2rem);
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.quiz-band__text {
  margin: 0;
  color: var(--ink-muted);
  max-width: 36ch;
}

/* ---------- Footer ---------- */

.site-footer {
  padding: 3rem 0 2rem;
  border-top: 1px solid var(--line);
  margin-top: clamp(2rem, 5vw, 3.5rem);
}

.site-footer__grid {
  display: grid;
  gap: 1.75rem;
}

@media (min-width: 720px) {
  .site-footer__grid {
    grid-template-columns: 1.4fr 1fr 1fr;
  }
}

.site-footer__brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  margin: 0 0 0.5rem;
}

.site-footer__note {
  margin: 0;
  font-size: 0.9rem;
  color: var(--ink-muted);
  max-width: 32ch;
}

.site-footer__label {
  margin: 0 0 0.65rem;
  font-family: var(--font-display);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-dim);
}

.site-footer__links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.45rem;
}

.site-footer__links a {
  color: var(--ink-muted);
  text-decoration: none;
  font-size: 0.95rem;
}

.site-footer__links a:hover {
  color: var(--signal);
}

.site-footer__legal {
  margin-top: 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
  font-size: 0.78rem;
  line-height: 1.5;
  color: var(--ink-dim);
}

.site-footer__legal p {
  margin: 0 0 0.55rem;
}

.erid-line {
  display: none;
}

.erid-line.is-visible {
  display: block;
}

.erid-line code {
  font-family: ui-monospace, "Cascadia Code", monospace;
  font-size: 0.85em;
  color: var(--ink-muted);
}

/* ---------- Stub pages ---------- */

.stub {
  padding: clamp(3rem, 10vh, 5rem) 0 clamp(4rem, 12vh, 6rem);
  max-width: 36rem;
}

.stub h1 {
  margin: 0 0 0.75rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2rem, 5vw, 2.75rem);
  letter-spacing: -0.035em;
  line-height: 1.1;
}

.stub p {
  margin: 0 0 1.5rem;
  color: var(--ink-muted);
}

.stub__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  .btn--pulse {
    animation: none;
  }

  .hero__reveal {
    opacity: 1;
    transform: none;
  }

  .hero.is-ready .hero__reveal {
    animation: none;
  }

  .hero__route path,
  .hero.is-ready .hero__route path.route-main,
  .hero.is-ready .hero__route path.route-secondary {
    stroke-dasharray: none;
    stroke-dashoffset: 0;
    animation: none;
  }

  .hero.is-ready .hero__route .route-dot {
    opacity: 1;
    animation: none;
  }

  .route-card,
  .btn {
    transition: none;
  }
}
