/* RustPay landing — responsive mobile-first patch (drop-in replacement) */

:root {
  --bg: #000;
  --text: #fff;
  --accent: #ffffff;
  --card-bg: #ffffff0f;
  --transition: 0.35s;
  --fade-width: 100px;

  --radius-xl: 40px;
  --radius-lg: 24px;

  --container: 1300px;
  --container-pad: 20px;
}

*,
*::before,
*::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
}

img, video { max-width: 100%; height: auto; display: block; }
a { color: inherit; }

/* Container */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: var(--container-pad);
}

/* Header */
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 0;
}

.logo { font-size: 1.5rem; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; }

.logo a{
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.logo img { height: 30px; width: auto; }

nav { display: flex; gap: 24px; }

nav a {
  position: relative;
  text-decoration: none;
  color: var(--text);
  font-weight: 500;
  padding: 4px 0;
  transition: color var(--transition);
  white-space: nowrap;
}

nav a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width var(--transition);
}

nav a:hover { color: var(--accent); }
nav a:hover::after { width: 100%; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 28px;
  border-radius: 999px;
  font-weight: 600;
  text-decoration: none;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition), color var(--transition);
  white-space: nowrap;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.btn-primary { background: var(--accent); color: var(--bg); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(255,255,255,0.18); }

.btn-outline {
  border: 2px solid var(--accent);
  color: var(--accent);
  padding: 10px 26px;
  background: transparent;
}
.btn-outline:hover { background: var(--accent); color: var(--bg); transform: translateY(-2px); }

/* Hero */
.hero {
  position: relative;
  padding: 0 25px 25px 25px;
  overflow: hidden;
  place-items: center;
  background: radial-gradient(140% 107.13% at 50% 10%, transparent 37.41%, #63e 69.27%, #fff 100%);
  border-radius: var(--radius-xl);
}

.hero .content {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 40px;
}

.hero .text { flex: 1 1 400px; }

.hero h1 {
  font-size: clamp(26px, 4.2vw, 46px);
  line-height: 1.12;
  margin-bottom: 14px;
}

.hero p {
  font-size: 1rem;
  margin-bottom: 22px;
  color: #ccc;
  max-width: 56ch;
}

.hero .image {flex: 1 1 420px;display: flex;justify-content: center;align-items: center;}
.hero .image video {
  width: min(550px, 100%);
  height: auto;
  animation: float 6s ease-in-out infinite;
}

@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-15px); } }

/* Cards */
.cards {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  margin-top: 0;
}

.card {
  background: var(--card-bg);
  border-radius: 15px;
  padding: 18px 24px 24px 24px;
  flex: 1 1 280px;
  transition: transform var(--transition), background var(--transition);
  transform: perspective(600px);
  border: 1px solid #ffffff29;
  backdrop-filter: blur(10px);
  background-image: url(bg.png);
  background-repeat: no-repeat;
  background-size: contain;
}

.card:hover {
  background: #ffffff1f;
  background-image: url(bg.png);
  background-repeat: no-repeat;
  background-size: contain;
  transform: perspective(600px) rotateX(5deg) rotateY(5deg) translateY(-10px);
}

.card h3 { font-size: 1rem; margin-bottom: 12px; }
.card p { font-size: 0.95rem; margin-bottom: 16px; color: #ffffffb5; }

/* Partners marquee */
.rp-partners-wrapper {
  position: relative;
  width: 100vw;
  left: 50%;
  margin-left: -50vw;
  overflow: hidden;
  padding: 0 var(--fade-width);
}

.rp-partners-wrapper::before,
.rp-partners-wrapper::after {
  content: '';
  position: absolute;
  top: 0; bottom: 0;
  width: var(--fade-width);
  pointer-events: none;
  z-index: 2;
}

.rp-partners-wrapper::before { left: 0; background: linear-gradient(to right, var(--bg) 0%, transparent 100%); }
.rp-partners-wrapper::after  { right: 0; background: linear-gradient(to left,  var(--bg) 0%, transparent 100%); }

.rp-partners { margin: 40px 0; opacity: 0.5; }
.rp-marquee { display: flex; gap: 40px; animation: rpMarqueeAnimation 30s linear infinite; }
.rp-marquee-item { height: 50px; object-fit: contain; filter: brightness(0) invert(1); }
.rp-marquee:hover { animation-play-state: paused; }

@keyframes rpMarqueeAnimation {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* Sections */
.section {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 40px;
  margin-bottom: 60px;
  border-radius: var(--radius-xl);
  padding: 0 25px;
  background-color: #1a191c;
  border: 1px solid #333333;
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.section.reverse { flex-direction: row-reverse; }

.section .text { flex: 1 1 420px; padding: 18px 0; }

.section h2 {
  font-size: clamp(22px, 3.2vw, 38px);
  line-height: 1.15;
  margin-bottom: 14px;
}

.section p { font-size: 1rem; color: #ccc; margin-bottom: 18px; }

.image {max-height: 400px;}
.images {
  margin-top: 25px;
  border-radius: 25px;
  background: #262629;
  padding: 15px;
  border: 1px solid #333333;
  max-width: 600px;
  margin-bottom: 50px;
}

/* FAQ */
.faq { margin-bottom: 80px; }
.faq h2 {
  font-size: clamp(22px, 3.2vw, 38px);
  text-align: center;
  margin-bottom: 32px;
}

.accordion { max-width: 1000px; margin: 0 auto; }

.accordion-item {
  background: rgb(26 25 28);
  border-radius: 15px;
  margin-bottom: 12px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.06);
}

.accordion-header {
  padding: 16px;
  cursor: pointer;
  position: relative;
  font-weight: 600;
}

.accordion-header::after {
  content: '\25BC';
  position: absolute;
  right: 16px;
  transition: transform var(--transition);
}

.accordion-header.active::after { transform: rotate(180deg); }

.accordion-body {
  max-height: 0;
  padding: 0 16px;
  transition: max-height var(--transition), padding var(--transition);
  overflow: hidden;
}

.accordion-body.open {
  max-height: 900px; /* чтобы длинные ответы на мобилке не обрезались */
  padding: 16px;
  background: #262629;
}

/* CTA */
.cta {
  text-align: center;
  padding: 80px 20px;
  margin-bottom: 40px;
  background: radial-gradient(140% 107.13% at 50% 10%, transparent 37.41%, #63e 69.27%, #fff 100%);
  border-radius: var(--radius-xl);
}

.cta p.tag {
  color: #7548ef;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
  margin-bottom: 8px;
}

.cta h2 {
  font-size: clamp(26px, 4.6vw, 44px);
  line-height: 1.12;
  margin-bottom: 14px;
}

.cta p { font-size: 1rem; color: #ccc; margin-bottom: 24px; max-width: 70ch; margin-left: auto; margin-right: auto; }

/* Footer */
footer {
  padding: 40px 0 0 0;
  border-top: 1px solid rgba(255,255,255,0.1);
}

.footer-cols {
  display: flex;
  flex-wrap: wrap;
  gap: 40px;
  justify-content: space-between;
  margin-bottom: 24px;
}

.footer-col h4 { font-size: 1.1rem; margin-bottom: 12px; }
.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: 8px; }
.footer-col ul li a {
  color: #ccc;
  text-decoration: none;
  font-size: 0.9rem;
  transition: color var(--transition);
}
.footer-col ul li a:hover { color: var(--accent); }

/* Bottom footer (your blocks) */
.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0;
  margin-top: auto;
  font-size: 11px;
  color: #888;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 15px;
  padding: 16px 0;
}

.legal-links a {
  color: #888;
  text-decoration: none;
  transition: color 0.3s ease, text-shadow 0.3s ease;
}

.legal-links a:hover {
  color: #fff;
  text-shadow: 0 0 12px rgba(255, 255, 255, 0.6);
}

/* Beta badge */
.beta-badge {
  position: absolute;
  top: -6px;
  left: 100%;
  transform: translateX(8px);
  background-color: #ff0046;
  color: var(--beta-badge-text, #ffffff);
  font-size: 10px;
  font-weight: bold;
  padding: 3px 6px 1px 6px;
  border-radius: 8px;
  cursor: pointer;
}

/* Auto-hover state */
.card.auto-hover {
  background: #ffffff24;
  background-image: url(bg.png);
  background-repeat: no-repeat;
  background-size: contain;
  transform: perspective(600px) rotateX(5deg) rotateY(5deg) translateY(-10px);
}

/* ---------- Responsive ---------- */

/* <= 1024px */
@media (max-width: 1024px) {
  :root { --container-pad: 18px; }
  .hero { border-radius: 32px; }
  .section { border-radius: 32px; }
  .cta { border-radius: 32px; }
  .images { max-width: 100%; }
}

/* <= 768px (phones + small tablets) */
@media (max-width: 768px) {
  :root { --container-pad: 14px; --fade-width: 28px; --radius-xl: 28px; }

  /* Header: переносы + кнопки в ряд */
  header { flex-wrap: wrap; align-items: center; justify-content: space-between; }
  .logo { flex: 1 1 auto; }
  .logo img { height: 26px; }

  nav {
    order: 3;
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 6px;
  }
  nav a { font-size: 14px; padding: 6px 0; }

  header > div:last-child {
    order: 2;
    width: 100%;
    display: flex;
    gap: 12px;
  }
  header > div:last-child .btn {
    flex: 1 1 0;
    padding: 12px 12px;
  }

  /* Hero: колонка, всё по ширине */
  .hero { padding: 18px 16px 16px 16px; }
  .hero .content { flex-direction: column; gap: 18px; align-items: stretch; }
  .hero .text { flex: 1 1 auto; }
  .hero p { font-size: 0.98rem; }

  .hero .image { justify-content: center; }
  .hero .image video { width: min(420px, 100%); animation: none; }

  /* Cards: одна под одной, кнопки шире */
  .cards { flex-direction: column; gap: 14px; }
  .card { padding: 16px; }
  .card .btn { width: 100%; justify-content: center; }

  /* Marquee: меньше логотипы */
  .rp-partners { margin: 26px 0; }
  .rp-marquee { gap: 26px; }
  .rp-marquee-item { height: 34px; }

  /* Sections: колонка */
  .section {
    padding: 16px;
    gap: 16px;
  }
  .section.reverse { flex-direction: column; }
  .section:not(.reverse) { flex-direction: column; }
  .section .text { padding: 0; }
  .image { max-height: none; width: 100%; }

  .images {
    margin-top: 10px;
    margin-bottom: 10px;
    padding: 12px;
    border-radius: 18px;
    width: 100%;
    max-width: 100%;
  }

  /* FAQ */
  .accordion-header { padding-right: 44px; }
  .accordion-body.open { max-height: 1200px; }

  /* CTA */
  .cta { padding: 44px 16px; }
  .cta .btn { width: 100%; }

  /* Footer */
  .footer-cols { gap: 22px; }
  .footer-col { flex: 1 1 240px; }

  .footer-content {
    flex-direction: column-reverse;
    text-align: center;
  }

  /* На тач-устройствах убираем тяжёлые 3D hover, чтобы не дергало */
  @media (hover: none) {
    .card:hover { transform: none; }
    .card.auto-hover { transform: none; }
    .btn:hover { transform: none; box-shadow: none; }
  }
}

/* <= 420px (маленькие телефоны) */
@media (max-width: 420px) {
  header > div:last-child { gap: 10px; }
  header > div:last-child .btn { padding: 12px 10px; font-size: 14px; }

  .hero h1 { font-size: 26px; }
  .section h2, .faq h2 { font-size: 22px; }

  .btn { padding: 12px 18px; }
  .btn-outline { padding: 10px 16px; }
}


/* ==== FIX: кейс (video) в hero не должен вылезать за экран ==== */

/* твой общий .image { max-height: 400px; } мешает hero — отключаем именно для hero */
.hero .image {
  max-height: 100%;
  overflow: hidden;          /* на всякий случай, чтобы точно ничего не вылезало */
  display: flex;
  justify-content: center;
  align-items: flex-start;   /* чтобы не уходило вверх */
}

/* ==== HERO: карточки должны немного перекрывать кейс ==== */

/* чтобы слои работали предсказуемо */
.hero { position: relative; }

/* кейс ниже карточек */
.hero .image { position: relative; z-index: 1; }

/* карточки поверх + поднимаем вверх */
.hero .cards {
  position: relative;
  z-index: 5;
  margin-top: -100px;        /* степень перекрытия (подгони 50-90px) */
}

/* чтобы снизу не обрезало */
.hero {/* padding-bottom: 60px; */}

/* на мобилке обычно перекрытие не нужно/минимальное */
@media (max-width: 768px) {
  .hero .cards { margin-top: 0; }
  .hero { padding-bottom: 16px; }
}

/* ==== FIX: убрать огромные пустые пробелы на мобилке (flex-basis -> высота) ==== */
@media (max-width: 768px) {
  /* карточки: не задаём им "высоту" через flex-basis */
  .card {
    flex: 0 0 auto;      /* было: 1 1 280px -> на column это высота */
    height: auto;
  }

  /* секции: текст не должен иметь "минимальную высоту" */
  .section .text {
    flex: 0 0 auto;      /* было: 1 1 400px -> на column это высота */
  }

  /* на всякий случай: убрать лишние отступы у скринов */
  .images {
    margin-top: 12px;
    margin-bottom: 0;
  }
}
