/* ============================================================
   TOKSY — tx-landing.css
   Лендинг: шапка, герой с живой перепиской, скриншоты,
   возможности, платежи, безопасность, развитие, скачивание.
   ============================================================ */

/* ---------- Токены (из манифеста) ---------- */

:root {
  --tx-accent: #007aff;
  --tx-signal: #34c759;
  --tx-alert:  #ff3b30;
  --tx-warn:   #ff9500;
  --tx-vault:  #af52de;
  --tx-ghost:  #8e8e93;

  /* Производные: тёмные оттенки для текста на цветном фоне */
  --tx-signal-deep: #1f8a3f;
  --tx-vault-deep:  #8f3dbf;
  --tx-slate:       #3a4250;

  --tx-bg-void:  #f5f5f7;
  --tx-bg-rail:  #f2f2f7;
  --tx-bg-panel: #ffffff;
  --tx-bg-input: rgba(118, 118, 128, 0.12);
  --tx-bg-chat:  #e9eff8;
  --tx-bg-bubble-in:  #ffffff;
  --tx-bg-bubble-out: #007aff;

  --tx-text:   #1d1d1f;
  --tx-text-2: #5f5f64;
  --tx-line:   rgba(0, 0, 0, 0.1);

  --tx-r-xs: 6px;
  --tx-r-sm: 10px;
  --tx-r-md: 14px;
  --tx-r-lg: 18px;
  --tx-r-xl: 22px;
  --tx-r-2xl: 28px;
  --tx-r-full: 999px;

  --tx-sp-2xs: 4px;
  --tx-sp-xs: 8px;
  --tx-sp-sm: 12px;
  --tx-sp-md: 16px;
  --tx-sp-lg: 24px;
  --tx-sp-xl: 32px;

  --tx-ease:   cubic-bezier(0.16, 1, 0.3, 1);
  --tx-dur-fast: 0.15s;
  --tx-dur-base: 0.25s;
  --tx-dur-slow: 0.4s;

  --tx-shadow-md: 0 8px 28px rgba(0, 0, 0, 0.09);
  --tx-shadow-lg: 0 24px 64px rgba(0, 0, 0, 0.18);

  --tx-font-display: 'Unbounded', 'Arial Rounded MT Bold', 'Trebuchet MS', system-ui, sans-serif;
  --tx-font-text: 'Onest', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;

  --tx-wrap: 1120px;
  --tx-nav-h: 60px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --tx-bg-void:  #000000;
    --tx-bg-rail:  #1c1c1e;
    --tx-bg-panel: #2c2c2e;
    --tx-bg-chat:  #0b121b;
    --tx-bg-bubble-in: #222b38;
    --tx-text:   #f5f5f7;
    --tx-text-2: #a1a1a6;
    --tx-line:   rgba(255, 255, 255, 0.14);
  }
}

/* ---------- Основа ---------- */

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

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--tx-nav-h) + 12px); -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--tx-font-text);
  font-size: 17px;
  line-height: 1.55;
  color: var(--tx-text);
  background: var(--tx-bg-void);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; height: auto; }
button { font: inherit; color: inherit; border: none; background: none; cursor: pointer; }
ul, ol { list-style: none; }

:focus-visible { outline: 3px solid var(--tx-accent); outline-offset: 3px; border-radius: var(--tx-r-xs); }

.tx-container { width: 100%; max-width: var(--tx-wrap); margin: 0 auto; padding: 0 var(--tx-sp-lg); }

/* Текст только для скринридеров: на экране не виден */
.tx-sr {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.tx-h2 {
  font-family: var(--tx-font-display);
  font-size: clamp(28px, 3.8vw, 46px);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.03em;
  text-wrap: balance;
}
.tx-lead { font-size: 19px; line-height: 1.5; color: var(--tx-text-2); max-width: 46ch; margin-top: var(--tx-sp-md); }

.tx-section { padding: 120px 0; }
.tx-section--rail { background: var(--tx-bg-rail); }

.tx-split { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 72px; align-items: start; }

/* ---------- Кнопки ---------- */

.tx-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--tx-sp-xs);
  min-height: 48px; padding: 0 26px;
  border-radius: var(--tx-r-full);
  font-weight: 600; font-size: 16px;
  transition: background var(--tx-dur-base) var(--tx-ease), transform var(--tx-dur-base) var(--tx-ease), border-color var(--tx-dur-base);
}
.tx-btn:active { transform: scale(0.97); }
.tx-btn--primary { background: var(--tx-accent); color: #fff; }
.tx-btn--primary:hover { background: #006ae0; }
.tx-btn--ghost { box-shadow: inset 0 0 0 1.5px var(--tx-line); }
.tx-btn--ghost:hover { box-shadow: inset 0 0 0 1.5px var(--tx-text-2); }
.tx-btn--danger { background: rgba(255, 59, 48, 0.12); color: #c42a20; }
.tx-btn--danger:hover { background: rgba(255, 59, 48, 0.2); }
@media (prefers-color-scheme: dark) { .tx-btn--danger { color: #ff6b62; } }
.tx-btn--light { background: #fff; color: #0a4fa8; }
.tx-btn--light:hover { background: #eaf3ff; }

/* ---------- Шапка ---------- */

.tx-nav {
  position: sticky; top: 0; z-index: 50;
  height: var(--tx-nav-h);
  background: var(--tx-bg-void);
  border-bottom: 1px solid transparent;
  transition: border-color var(--tx-dur-base);
}
.tx-nav.is-scrolled { border-bottom-color: var(--tx-line); }
.tx-nav__inner { height: 100%; display: flex; align-items: center; gap: 36px; }
.tx-nav__brand { display: flex; align-items: center; gap: 10px; font-family: var(--tx-font-display); font-weight: 600; font-size: 17px; letter-spacing: -0.02em; margin-right: auto; }
.tx-nav__brand img { width: 28px; height: 28px; border-radius: 8px; }
.tx-nav__links { display: flex; gap: 28px; font-size: 15px; color: var(--tx-text-2); }
.tx-nav__links a:hover { color: var(--tx-text); }
.tx-nav__cta { min-height: 38px; padding: 0 18px; font-size: 14.5px; background: var(--tx-text); color: var(--tx-bg-void); }
.tx-nav__burger { display: none; width: 44px; height: 44px; align-items: center; justify-content: center; flex-direction: column; gap: 5px; }
.tx-nav__burger span { width: 20px; height: 2px; background: var(--tx-text); border-radius: 2px; }

/* ---------- Герой ---------- */

.tx-hero { padding: 56px 0 120px; }
.tx-hero__grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); gap: 64px; align-items: center; }
.tx-hero__title {
  font-family: var(--tx-font-display);
  font-size: clamp(42px, 6.6vw, 84px);
  font-weight: 600;
  line-height: 1.02;
  letter-spacing: -0.04em;
}
.tx-hero__sub { font-size: 20px; line-height: 1.5; color: var(--tx-text-2); max-width: 34ch; margin: 28px 0 36px; }
.tx-hero__cta { display: flex; flex-wrap: wrap; gap: var(--tx-sp-sm); }
.tx-hero__note { margin-top: 20px; font-size: 15px; color: var(--tx-text-2); }

/* ---------- Живая переписка ---------- */

.tx-thread {
  width: 100%; max-width: 440px; margin-left: auto;
  background: var(--tx-bg-chat);
  border-radius: var(--tx-r-2xl);
  box-shadow: var(--tx-shadow-lg);
  overflow: hidden;
}
.tx-thread__bar { display: flex; align-items: center; gap: var(--tx-sp-sm); padding: 14px 20px; background: var(--tx-bg-panel); }
.tx-thread__avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--tx-accent); color: #fff; font-weight: 600; display: grid; place-items: center; }
.tx-thread__name { font-weight: 600; line-height: 1.2; }
.tx-thread__state { font-size: 13px; color: var(--tx-text-2); }
.tx-thread__list { display: flex; flex-direction: column; gap: 10px; padding: 20px; min-height: 560px; }
.tx-thread__foot { display: flex; justify-content: center; padding: 0 20px 18px; min-height: 52px; }
.tx-thread__replay { font-size: 14px; font-weight: 600; color: var(--tx-accent); padding: 8px 14px; border-radius: var(--tx-r-full); opacity: 0; pointer-events: none; transition: opacity var(--tx-dur-slow); }
.tx-thread__replay.is-visible { opacity: 1; pointer-events: auto; }
.tx-thread__replay:hover { background: var(--tx-bg-input); }

.tx-beacon {
  max-width: 82%; padding: 10px 14px;
  border-radius: var(--tx-r-lg);
  font-size: 16px; line-height: 1.4;
  transition: opacity var(--tx-dur-slow) var(--tx-ease), transform var(--tx-dur-slow) var(--tx-ease), filter 0.8s;
}
.tx-beacon--incoming { align-self: flex-start; background: var(--tx-bg-bubble-in); border-bottom-left-radius: var(--tx-r-xs); }
.tx-beacon--outgoing { align-self: flex-end; background: var(--tx-bg-bubble-out); color: #fff; border-bottom-right-radius: var(--tx-r-xs); }
.tx-beacon--vault { background: var(--tx-vault-deep); color: #fff; }

.tx-beacon--transmit { width: 100%; max-width: 300px; padding: 16px 18px; color: #fff; }
.tx-beacon--request { background: var(--tx-slate); }
.tx-beacon--sent { background: var(--tx-signal-deep); }
.tx-beacon__kind { font-size: 13px; font-weight: 600; opacity: 0.85; }
.tx-beacon__sum { font-family: var(--tx-font-display); font-size: 28px; font-weight: 600; letter-spacing: -0.03em; margin: 2px 0; }
.tx-beacon__sum small { font-family: var(--tx-font-text); font-size: 14px; font-weight: 600; opacity: 0.75; letter-spacing: 0; }
.tx-beacon__fee { font-size: 13px; opacity: 0.8; }
.tx-beacon__result { display: inline-block; margin-top: 10px; padding: 6px 14px; border-radius: var(--tx-r-full); background: rgba(255, 255, 255, 0.2); font-size: 14px; font-weight: 600; }

.tx-thread__vault {
  display: flex; align-items: center; gap: 8px; align-self: center;
  margin-top: 6px; padding: 6px 14px;
  border-radius: var(--tx-r-full);
  background: rgba(175, 82, 222, 0.14); color: var(--tx-vault-deep);
  font-size: 13px; font-weight: 600; text-align: center;
  transition: opacity var(--tx-dur-slow) var(--tx-ease), transform var(--tx-dur-slow) var(--tx-ease);
}
@media (prefers-color-scheme: dark) { .tx-thread__vault { color: #d79bf5; } }
.tx-thread__note { align-self: center; font-size: 13px; color: var(--tx-text-2); opacity: 0; transition: opacity var(--tx-dur-slow); }
.tx-thread.is-ended .tx-thread__note { opacity: 1; }

/* Пока скрипт готовит показ, сообщения прячутся, но место за ними остаётся */
.tx-thread.is-armed .tx-beacon:not(.is-shown),
.tx-thread.is-armed .tx-thread__vault:not(.is-shown) { opacity: 0; transform: translateY(10px); }
.tx-beacon.is-gone { opacity: 0; filter: blur(8px); }

/* ---------- Скриншоты ---------- */

.tx-shots { padding: 0 0 120px; }
.tx-shots__row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px; align-items: start; }
.tx-shots__item:nth-child(2) { margin-top: 56px; }
.tx-shot__frame {
  aspect-ratio: 9 / 19;
  background: var(--tx-bg-panel);
  border: 8px solid #111; border-radius: 40px;
  overflow: hidden; box-shadow: var(--tx-shadow-md);
}
.tx-shot__frame img { width: 100%; height: 100%; object-fit: cover; }
.tx-shot__cap { margin-top: var(--tx-sp-md); font-size: 15px; color: var(--tx-text-2); text-align: center; }

/* ---------- Возможности ---------- */

.tx-split__head { position: sticky; top: calc(var(--tx-nav-h) + 32px); }
.tx-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 44px 40px; }
.tx-fact__title { font-size: 19px; font-weight: 650; letter-spacing: -0.015em; margin-bottom: 6px; }
.tx-fact__text { font-size: 16px; color: var(--tx-text-2); line-height: 1.55; max-width: 34ch; }

/* ---------- Платежи ---------- */

.tx-wallet { margin-top: 40px; display: flex; flex-direction: column; }
.tx-wallet__row { display: flex; align-items: center; justify-content: space-between; gap: var(--tx-sp-md); padding: 16px 0; border-top: 1px solid var(--tx-line); font-size: 17px; }
.tx-wallet__row:last-child { border-bottom: 1px solid var(--tx-line); }
.tx-status { display: inline-flex; align-items: center; gap: 7px; font-size: 14px; font-weight: 600; color: var(--tx-signal-deep); white-space: nowrap; }
.tx-status::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--tx-signal); }
@media (prefers-color-scheme: dark) { .tx-status { color: var(--tx-signal); } }

.tx-pay__stage { background: var(--tx-bg-chat); border-radius: var(--tx-r-2xl); padding: 40px; display: flex; flex-direction: column; gap: 14px; }
.tx-pay__stage .tx-beacon--transmit { max-width: 340px; }
.tx-pay__stage .tx-beacon--sent { align-self: flex-end; }

/* ---------- Безопасность ---------- */

.tx-segment { display: inline-flex; gap: 4px; padding: 4px; border-radius: var(--tx-r-full); background: var(--tx-bg-input); }
.tx-segment__opt { min-height: 40px; padding: 0 18px; border-radius: var(--tx-r-full); font-size: 15px; font-weight: 600; color: var(--tx-text-2); transition: background var(--tx-dur-base), color var(--tx-dur-base); }
.tx-segment__opt[aria-checked='true'] { background: var(--tx-bg-panel); color: var(--tx-text); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15); }

.tx-vaultdemo { margin-top: 36px; display: flex; flex-direction: column; align-items: flex-start; gap: 20px; }
.tx-vaultdemo__screen { width: 100%; max-width: 420px; background: var(--tx-bg-chat); border-radius: var(--tx-r-2xl); padding: 28px 24px 22px; min-height: 164px; }
.tx-vaultdemo__ttl { margin-top: 18px; font-size: 14px; font-weight: 600; color: var(--tx-vault-deep); }
@media (prefers-color-scheme: dark) { .tx-vaultdemo__ttl { color: #d79bf5; } }
.tx-vaultdemo__bar { margin-top: 8px; height: 4px; border-radius: 4px; background: rgba(175, 82, 222, 0.2); overflow: hidden; }
.tx-vaultdemo__fill { display: block; height: 100%; width: 100%; background: var(--tx-vault); transform-origin: left; }
.tx-vaultdemo__fill.is-running { animation: txDrain var(--tx-drain, 5s) linear forwards; }
.tx-vaultdemo__screen.is-wiped .tx-beacon { opacity: 0; filter: blur(8px); }
@keyframes txDrain { from { transform: scaleX(1); } to { transform: scaleX(0); } }
.tx-vaultdemo__hint { font-size: 14px; color: var(--tx-text-2); }

.tx-guard { display: flex; flex-direction: column; gap: 36px; }
.tx-guard__title { font-size: 19px; font-weight: 650; letter-spacing: -0.015em; margin-bottom: 6px; }
.tx-guard__text { font-size: 16px; color: var(--tx-text-2); max-width: 44ch; }

/* ---------- Развитие ---------- */

.tx-road { margin-top: 64px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 48px; }
.tx-road__head { display: flex; align-items: center; gap: 10px; font-family: var(--tx-font-display); font-size: 20px; font-weight: 600; letter-spacing: -0.02em; margin-bottom: 28px; }
.tx-road__head::before { content: ''; width: 12px; height: 12px; border-radius: 50%; background: var(--tx-ghost); }
.tx-road__col--done .tx-road__head::before { background: var(--tx-signal); }
.tx-road__col--now .tx-road__head::before { background: var(--tx-accent); }
.tx-road__list { display: flex; flex-direction: column; gap: 28px; }
.tx-road__title { font-size: 18px; font-weight: 650; letter-spacing: -0.015em; margin-bottom: 4px; }
.tx-road__text { font-size: 16px; color: var(--tx-text-2); }

/* ---------- Скачивание ---------- */

.tx-dl { margin-top: 56px; display: flex; flex-direction: column; }
.tx-dl__row {
  display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 4fr) auto; align-items: center; gap: var(--tx-sp-lg);
  padding: 30px 0; border-top: 1px solid var(--tx-line);
  transition: padding var(--tx-dur-base) var(--tx-ease);
}
.tx-dl__row:last-child { border-bottom: 1px solid var(--tx-line); }
a.tx-dl__row:hover { padding-left: 14px; }
.tx-dl__name { font-family: var(--tx-font-display); font-size: clamp(26px, 3.4vw, 40px); font-weight: 600; letter-spacing: -0.03em; }
.tx-dl__note { font-size: 16px; color: var(--tx-text-2); }
.tx-dl__go { font-weight: 600; color: var(--tx-accent); display: inline-flex; align-items: center; gap: 8px; }
.tx-dl__row--soon { opacity: 0.6; }
.tx-dl__row--soon .tx-dl__go { color: var(--tx-text-2); }

/* ---------- Финал ---------- */

.tx-close { background: var(--tx-accent); color: #fff; padding: 110px 0 96px; }
.tx-close__title { font-family: var(--tx-font-display); font-size: clamp(34px, 5.4vw, 68px); font-weight: 600; line-height: 1.05; letter-spacing: -0.04em; max-width: 14ch; }
.tx-close__text { margin: 22px 0 34px; font-size: 20px; max-width: 40ch; opacity: 0.92; }
.tx-close .tx-btn--light:focus-visible, .tx-close .tx-social:focus-visible { outline-color: #fff; }
.tx-socials { display: flex; gap: var(--tx-sp-sm); margin-top: 56px; }
.tx-social { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, 0.16); transition: background var(--tx-dur-base); }
.tx-social:hover { background: rgba(255, 255, 255, 0.3); }

/* ---------- Подвал ---------- */

.tx-footer { padding: 36px 0; font-size: 14.5px; color: var(--tx-text-2); }
.tx-footer__inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px; }
.tx-footer__brand { display: flex; align-items: center; gap: 10px; }
.tx-footer__brand img { width: 22px; height: 22px; border-radius: 6px; }
.tx-footer__links { display: flex; flex-wrap: wrap; gap: 24px; }
.tx-footer__links a:hover { color: var(--tx-text); }

/* ---------- Планшет и телефон ---------- */

@media (max-width: 960px) {
  .tx-section { padding: 88px 0; }
  .tx-split { grid-template-columns: 1fr; gap: 48px; }
  .tx-split__head { position: static; }
  .tx-hero { padding: 32px 0 80px; }
  .tx-hero__grid { grid-template-columns: 1fr; gap: 56px; }
  .tx-thread { margin: 0 auto; }
  .tx-road { grid-template-columns: 1fr; gap: 56px; }
  .tx-shots { padding-bottom: 80px; }
}

@media (max-width: 860px) {
  .tx-nav__links { display: none; }
  .tx-nav__burger { display: flex; }
  .tx-nav__inner { gap: 12px; }
  .tx-nav__links.is-open {
    display: flex; flex-direction: column; gap: 18px;
    position: absolute; top: var(--tx-nav-h); left: 0; right: 0;
    padding: 22px var(--tx-sp-lg) 28px;
    font-size: 17px;
    background: var(--tx-bg-void);
    border-bottom: 1px solid var(--tx-line);
  }
}

@media (max-width: 640px) {
  body { font-size: 16px; }
  .tx-container { padding: 0 20px; }
  .tx-facts { grid-template-columns: 1fr; gap: 32px; }
  .tx-shots__row { grid-template-columns: 1fr; gap: 40px; max-width: 280px; margin: 0 auto; }
  .tx-shots__item:nth-child(2) { margin-top: 0; }
  .tx-shots__item:not(:nth-child(2)) { display: none; }
  .tx-pay__stage { padding: 24px 16px; }
  .tx-dl__row { grid-template-columns: 1fr auto; gap: 6px 16px; padding: 24px 0; }
  .tx-dl__note { grid-column: 1; grid-row: 2; }
  .tx-dl__go { grid-column: 2; grid-row: 1; }
  .tx-thread__list { min-height: 600px; padding: 16px; }
  .tx-close { padding: 80px 0 72px; }
}

/* ---------- Без анимации ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
