/* ============================================
   VEX CRYPTO — строгий тёмный стиль
   Графитовый фон, тонкие линии, сдержанная
   типографика, точечный бирюзовый акцент
   ============================================ */

:root {
  --bg: #0b1016;
  --surface: #0f151d;
  --surface-2: #131b25;
  --border: #1d2732;
  --text: #e8edf2;
  --muted: #7d8894;
  --accent: #2fe6c2;
  --accent-dim: rgba(47, 230, 194, 0.09);
  --danger: #e06a6a;
  --radius: 10px;
  --font: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  font-weight: 500;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 24px;
}

.container--narrow { max-width: 820px; }

.overline {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 14px;
}

/* ===== Лента курсов ===== */
.ticker {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
  white-space: nowrap;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.ticker__track {
  display: inline-block;
  padding: 7px 0;
  animation: ticker 40s linear infinite;
}

.ticker__track span { margin-right: 44px; }

.ticker__track b { color: var(--text); font-weight: 600; }

@keyframes ticker {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* ===== Шапка ===== */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(11, 16, 22, 0.88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 66px;
  gap: 16px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text);
}

.logo__img {
  width: 36px;
  height: 36px;
  border-radius: 8px;
}

.logo__name {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.logo__name em {
  font-style: normal;
  font-weight: 600;
  color: var(--muted);
}

.nav { display: flex; gap: 30px; }

.nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 14.5px;
  font-weight: 600;
  transition: color 0.2s;
}

.nav a:hover { color: var(--text); }

.burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  align-items: center;
}

.burger span {
  display: block;
  width: 16px;
  height: 1.5px;
  background: var(--text);
}

/* ===== Hero ===== */
.hero {
  padding: 72px 0 88px;
  background: radial-gradient(ellipse 55% 45% at 78% 0%, rgba(47, 230, 194, 0.05), transparent);
}

.hero__inner {
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 72px;
  align-items: start;
}

.hero__title {
  font-size: clamp(30px, 3.8vw, 44px);
  font-weight: 800;
  line-height: 1.18;
  letter-spacing: -0.01em;
  margin-bottom: 20px;
}

.hero__subtitle {
  color: var(--muted);
  font-size: 16.5px;
  max-width: 480px;
  margin-bottom: 44px;
}

.hero__stats {
  display: flex;
  gap: 0;
}

.hero__stats > div {
  padding: 0 28px;
  border-left: 1px solid var(--border);
}

.hero__stats > div:first-child { padding-left: 0; border-left: none; }

.hero__stats dt {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}

.hero__stats dd {
  font-size: 22px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

/* ===== Калькулятор ===== */
.calc {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 28px 26px 22px;
}

.calc__title {
  font-size: 18px;
  font-weight: 800;
  margin-bottom: 22px;
}

.calc__row { margin-bottom: 16px; }

.calc__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.calc__label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 7px;
}

.calc__input-group { display: flex; gap: 10px; }

.calc__input-group input { flex: 1; min-width: 0; }

.calc__input-group select { width: 108px; flex-shrink: 0; }

input, select {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  font-weight: 600;
  padding: 12px 14px;
  outline: none;
  width: 100%;
  appearance: none;
  transition: border-color 0.2s;
  font-variant-numeric: tabular-nums;
}

input:focus, select:focus { border-color: var(--accent); }

input.invalid { border-color: var(--danger); }

input::placeholder { color: #4d5763; }

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%237d8894' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
  padding-right: 32px;
  cursor: pointer;
}

.calc__swap {
  display: block;
  margin: -6px auto 10px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--accent);
  font-size: 15px;
  cursor: pointer;
  transition: border-color 0.2s;
}

.calc__swap:hover { border-color: var(--accent); }

.calc__rate {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--muted);
  background: var(--accent-dim);
  border-radius: var(--radius);
  padding: 10px 14px;
  margin-bottom: 18px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.calc__rate b { color: var(--accent); font-weight: 700; }

.calc__note {
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  margin-top: 14px;
}

/* ===== Кнопки ===== */
.btn {
  display: inline-block;
  font-family: var(--font);
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  text-align: center;
  border-radius: var(--radius);
  padding: 14px 28px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.2s, border-color 0.2s, opacity 0.2s;
}

.btn--primary {
  background: var(--accent);
  color: #06231c;
}

.btn--primary:hover { opacity: 0.88; }

.btn--secondary {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}

.btn--secondary:hover { border-color: var(--muted); }

.btn--full { width: 100%; }

/* ===== Секции ===== */
.section { padding: 88px 0; }

.section--bordered {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.section--bordered + .section--bordered,
.section--bordered:last-of-type { border-bottom: none; }

.section__title {
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 800;
  letter-spacing: -0.01em;
  margin-bottom: 48px;
}

/* ===== Шаги ===== */
.steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 40px;
}

.step {
  border-top: 1px solid var(--border);
  padding-top: 22px;
}

.step__num {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.1em;
  margin-bottom: 12px;
  font-variant-numeric: tabular-nums;
}

.step h3 {
  font-size: 16.5px;
  font-weight: 700;
  margin-bottom: 8px;
}

.step p { font-size: 14.5px; color: var(--muted); }

/* ===== Принципы ===== */
.principles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}

.principle {
  background: var(--bg);
  padding: 28px 30px;
}

.principle h3 {
  font-size: 16.5px;
  font-weight: 700;
  margin-bottom: 8px;
}

.principle h3::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  margin-right: 10px;
  vertical-align: 2px;
}

.principle p { font-size: 14.5px; color: var(--muted); }

/* ===== FAQ ===== */
.faq { border-bottom: 1px solid var(--border); }

.faq:first-of-type { border-top: 1px solid var(--border); }

.faq summary {
  padding: 20px 40px 20px 0;
  cursor: pointer;
  font-size: 16px;
  font-weight: 700;
  list-style: none;
  position: relative;
  transition: color 0.2s;
}

.faq summary:hover { color: var(--accent); }

.faq summary::-webkit-details-marker { display: none; }

.faq summary::after {
  content: "+";
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 20px;
  font-weight: 400;
  transition: transform 0.2s, color 0.2s;
}

.faq[open] summary::after {
  transform: translateY(-50%) rotate(45deg);
  color: var(--accent);
}

.faq p {
  padding: 0 0 20px;
  font-size: 15px;
  color: var(--muted);
  max-width: 680px;
}

/* ===== Контакты ===== */
.contacts {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
  flex-wrap: wrap;
}

.contacts .section__title { margin-bottom: 12px; }

.contacts__text { color: var(--muted); font-size: 16px; }

.contacts__buttons {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

/* ===== Подвал ===== */
.footer {
  border-top: 1px solid var(--border);
  padding: 26px 0;
}

.footer__inner {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 13px;
}

/* ===== Модалка ===== */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal[hidden] { display: none; }

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 7, 10, 0.7);
}

.modal__box {
  position: relative;
  max-width: 400px;
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 32px 28px 26px;
}

.modal__box h3 {
  font-size: 19px;
  font-weight: 800;
  margin-bottom: 10px;
}

.modal__box p {
  font-size: 15px;
  color: var(--muted);
  margin-bottom: 22px;
}

.modal__close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 15px;
  cursor: pointer;
}

.modal__close:hover { color: var(--text); }

/* ===== Telegram Mini App ===== */
body.tg-app .header,
body.tg-app .footer { display: none; }

body.tg-app .hero { padding-top: 28px; }

body.tg-app .section { padding: 56px 0; }

/* ===== Адаптив ===== */
@media (max-width: 960px) {
  .hero__inner {
    grid-template-columns: 1fr;
    gap: 48px;
  }

  .calc { max-width: 480px; }

  .steps {
    grid-template-columns: repeat(2, 1fr);
    gap: 32px;
  }

  .nav {
    display: none;
    position: absolute;
    top: 66px;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 8px 24px 16px;
  }

  .nav.open { display: flex; }

  .nav a { padding: 12px 0; border-bottom: 1px solid var(--border); }

  .nav a:last-child { border-bottom: none; }

  .burger { display: flex; }
}

@media (max-width: 600px) {
  .hero { padding: 48px 0 64px; }

  .section { padding: 64px 0; }

  .steps { grid-template-columns: 1fr; gap: 28px; }

  .principles { grid-template-columns: 1fr; }

  .hero__stats { flex-wrap: wrap; gap: 20px 0; }

  .hero__stats > div { padding: 0 20px; }

  .calc { padding: 24px 18px 18px; }

  .calc__input-group select { width: 96px; }

  .contacts { display: block; }

  .contacts__buttons { margin-top: 24px; }
}
