/* Self-hosted, matching frontend/src/index.css exactly — same files, same
   reasoning: no third-party font request for a face used on two elements. */
@font-face {
  font-family: 'IBM Plex Serif';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('./fonts/IBMPlexSerif-400-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'IBM Plex Serif';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('./fonts/IBMPlexSerif-400-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'IBM Plex Serif';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('./fonts/IBMPlexSerif-600-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'IBM Plex Serif';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('./fonts/IBMPlexSerif-600-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'IBM Plex Serif';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('./fonts/IBMPlexSerif-700-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'IBM Plex Serif';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('./fonts/IBMPlexSerif-700-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  /* Every color below is the exact value from DESIGN.md's frontmatter
     (neutral-canvas/neutral-surface/neutral-text/neutral-hint,
     submind-accent, telegram-accent, success, premium) — not
     approximated from a screenshot. --surface-2/--text-dim-2/--border
     have no direct DESIGN.md token (the app doesn't need a nested-card
     or footer-text step), so they're derived from the ones that do. */
  --bg: #0f172a;
  --surface: #1e293b;
  --surface-2: color-mix(in srgb, var(--surface), white 8%);
  --border: rgba(255, 255, 255, 0.06);
  --text: #f8fafc;
  --text-dim: #94a3b8;
  --text-dim-2: color-mix(in srgb, var(--text) 66%, var(--bg));
  --violet: #863bff;
  /* Hover state: DESIGN.md has none (Telegram WebView never fires
     :hover), but this page runs in a real desktop browser where a
     link/button hover is expected — landing-only, not a TWA token. */
  --violet-hi: #9a5aff;
  --blue: #3b82f6;
  --gold: #fbbf24;
  --green: #22c55e;

  /* Same pairing as the TWA: system-ui everywhere, IBM Plex Serif only on
     the phone mock's spend figure and section headings (see --font-display
     usage below) — not a generic webfont-for-everything look. */
  --font-sans: -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'IBM Plex Serif', serif;
  --container: 1160px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

.wrap {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

.label {
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-dim);
}

/* ── Buttons ─────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 999px;
  padding: 13px 26px;
  font-size: 15px;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
  white-space: nowrap;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--violet);
  color: #fff;
}

.btn-primary:hover {
  background: var(--violet-hi);
}

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

.btn-ghost:hover {
  border-color: var(--text-dim);
}

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

.btn-secondary:hover {
  background: var(--surface-2);
  border-color: color-mix(in srgb, var(--text-dim) 70%, var(--border));
}

.btn-sm {
  padding: 9px 18px;
  font-size: 13.5px;
}

.btn:focus-visible,
.platform-card:focus-visible,
.hero-secondary-link:focus-visible,
.footer-links a:focus-visible,
.nav-toggle:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--violet) 70%, white);
  outline-offset: 3px;
}

/* ── Header ──────────────────────────────────────────────────────── */

.header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid transparent;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.header.scrolled {
  background: rgba(11, 11, 16, 0.78);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom-color: var(--border);
}

.header .wrap {
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 17px;
}

.brand img {
  width: 32px;
  height: 32px;
  border-radius: 9px;
}

.nav {
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
}

.nav-links a {
  font-size: 14.5px;
  font-weight: 500;
  color: var(--text-dim);
  transition: color 0.15s ease;
}

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

.nav-links a.nav-cta,
.nav-links a.nav-cta:hover {
  color: #fff;
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  padding: 8px;
  cursor: pointer;
}

/* ── Hero ────────────────────────────────────────────────────────── */

.hero {
  padding: 88px 0 96px;
}

.hero .wrap {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 56px;
  align-items: start;
}

.hero h1 {
  font-size: 44px;
  line-height: 1.14;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin: 0 0 20px;
}

.hero p.sub {
  font-size: 17px;
  line-height: 1.6;
  color: var(--text-dim);
  margin: 0 0 32px;
  max-width: 46ch;
}

.hero-platform-actions,
.cta-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.platform-cta {
  min-height: 48px;
}

.platform-mark {
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 26px;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
}

.platform-mark svg {
  width: 17px;
  height: 17px;
}

.btn-primary .platform-mark {
  color: #fff;
  background: rgba(255, 255, 255, 0.16);
}

.btn-secondary .platform-mark {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
}

.platform-mark-telegram {
  color: var(--blue);
  background: color-mix(in srgb, var(--blue) 16%, transparent);
}

.platform-mark-vk {
  color: #79a9d6;
  background: color-mix(in srgb, #79a9d6 16%, transparent);
}

.hero-secondary-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  color: var(--text-dim);
  font-size: 14px;
  font-weight: 600;
  transition: color 0.15s ease;
}

.hero-secondary-link:hover {
  color: var(--text);
}

.hero-secondary-link svg {
  width: 16px;
  height: 16px;
}

.hero-note {
  margin: 16px 0 0;
  font-size: 13.5px;
  color: var(--text-dim-2);
}

/* ── Phone mockup ────────────────────────────────────────────────── */

.phone-stage {
  display: flex;
  justify-content: flex-end;
  padding-top: 4px;
}

.phone {
  width: 100%;
  max-width: 300px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 32px;
  padding: 18px;
  box-shadow: 0 40px 80px -32px rgba(134, 59, 255, 0.35);
}

.phone-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 4px 14px;
  font-size: 11px;
  color: var(--text-dim-2);
}

.phone-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 18px;
  margin-bottom: 14px;
}

.phone-card .label {
  margin-bottom: 10px;
}

.spend-amount {
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}

.spend-amount span {
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 600;
  color: var(--text-dim);
}

.legend {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

.legend i {
  display: block;
  height: 6px;
  border-radius: 999px;
  flex: 1;
}

.next-charge {
  display: flex;
  align-items: center;
  gap: 12px;
}

.next-charge .icon {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  color: var(--violet);
  background: color-mix(in srgb, var(--violet) 14%, transparent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.next-charge .icon svg {
  width: 18px;
  height: 18px;
}

.next-charge .meta {
  flex: 1;
  min-width: 0;
}

.next-charge .name {
  font-size: 14.5px;
  font-weight: 600;
}

.next-charge .date {
  font-size: 12.5px;
  color: var(--text-dim-2);
  margin-top: 2px;
}

.next-charge .price {
  font-size: 14.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.phone-add-btn {
  width: 100%;
  border: none;
  border-radius: 14px;
  background: var(--violet);
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  padding: 13px;
  cursor: default;
}

/* ── Section shell ───────────────────────────────────────────────── */

section {
  padding: 88px 0;
}

section .section-head {
  text-align: center;
  max-width: 560px;
  margin: 0 auto 48px;
}

section .section-head .label {
  display: block;
  margin-bottom: 12px;
}

section .section-head h2 {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0 0 12px;
}

section .section-head p {
  color: var(--text-dim);
  font-size: 15.5px;
  margin: 0;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 28px;
}

/* ── Platform entry points ──────────────────────────────────────── */

.platform-section {
  padding-top: 24px;
}

.platform-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  max-width: 820px;
  margin: 0 auto;
}

.platform-card {
  display: flex;
  flex-direction: column;
  min-height: 236px;
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  transition: border-color 0.15s ease, background-color 0.15s ease, transform 0.15s ease;
}

.platform-card:hover {
  background: var(--surface-2);
  border-color: color-mix(in srgb, var(--violet) 45%, var(--border));
  transform: translateY(-2px);
}

.platform-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 24px;
}

.platform-card-top .platform-mark {
  width: 38px;
  height: 38px;
  flex-basis: 38px;
  border-radius: 11px;
  font-size: 13px;
}

.platform-card-top .platform-mark svg {
  width: 21px;
  height: 21px;
}

.platform-badge {
  color: var(--text-dim);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.platform-card h3 {
  margin: 0 0 10px;
  font-size: 20px;
  font-weight: 700;
}

.platform-card p {
  max-width: 42ch;
  margin: 0;
  color: var(--text-dim);
  font-size: 14px;
  line-height: 1.6;
}

.platform-card-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding-top: 24px;
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
}

.platform-card-link .link-arrow {
  width: 16px;
  height: 16px;
  color: var(--violet);
  transition: transform 0.15s ease;
}

.platform-card:hover .platform-card-link .link-arrow {
  transform: translateX(3px);
}

.platform-bridge {
  max-width: 820px;
  margin: 20px auto 0;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 28px;
  align-items: center;
  background: linear-gradient(135deg, color-mix(in srgb, var(--violet) 10%, var(--surface)), var(--surface));
}

.platform-bridge .label {
  display: block;
  margin-bottom: 10px;
}

.platform-bridge h3 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
}

.platform-bridge p {
  margin: 0;
  color: var(--text-dim);
  font-size: 14px;
  line-height: 1.6;
}

.platform-bridge-grid {
  display: grid;
  gap: 14px;
}

.platform-bridge-grid div {
  display: grid;
  gap: 3px;
  padding-left: 14px;
  border-left: 2px solid color-mix(in srgb, var(--violet) 55%, transparent);
}

.platform-bridge-grid strong {
  font-size: 13px;
}

.platform-bridge-grid span {
  color: var(--text-dim);
  font-size: 13px;
  line-height: 1.45;
}

/* ── Steps ───────────────────────────────────────────────────────── */

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.step-num {
  font-size: 13px;
  font-weight: 800;
  color: var(--violet);
  letter-spacing: 0.04em;
  margin-bottom: 16px;
}

.step h3 {
  font-size: 17px;
  font-weight: 700;
  margin: 0 0 10px;
}

.step p {
  font-size: 14.5px;
  color: var(--text-dim);
  margin: 0;
  line-height: 1.6;
}

/* ── Feature grid ────────────────────────────────────────────────── */

.features {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

/* Single accent-tinted plate, same pattern as .twa-category-icon in the
   app (frontend/src/index.css) — one color-mix tint for every icon,
   glyphs differ, not a rainbow of per-card colors. */
.feature-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--violet);
  background: color-mix(in srgb, var(--violet) 14%, transparent);
  margin-bottom: 18px;
}

.feature-icon svg {
  width: 20px;
  height: 20px;
}

.feature h3 {
  font-size: 16.5px;
  font-weight: 700;
  margin: 0 0 8px;
}

.feature p {
  font-size: 14.5px;
  color: var(--text-dim);
  margin: 0;
  line-height: 1.6;
}

/* ── Pricing ─────────────────────────────────────────────────────── */

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  max-width: 720px;
  margin: 0 auto;
}

.price-card h3 {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 4px;
}

.price-card .price {
  font-size: 30px;
  font-weight: 800;
  margin: 14px 0 22px;
  font-variant-numeric: tabular-nums;
}

.price-card .price span {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-dim);
}

.price-card ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.price-card li {
  font-size: 14px;
  color: var(--text-dim);
  padding-left: 24px;
  position: relative;
  line-height: 1.5;
}

.price-card li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 6px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--green) 22%, transparent);
}

.price-card.pro {
  position: relative;
  border-color: color-mix(in srgb, var(--gold) 45%, var(--border));
  background: linear-gradient(160deg, color-mix(in srgb, var(--gold) 7%, var(--surface)), var(--surface) 55%);
}

.pro-badge {
  position: absolute;
  top: 24px;
  right: 24px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--gold);
  background: color-mix(in srgb, var(--gold) 16%, transparent);
  padding: 5px 10px;
  border-radius: 999px;
}

.price-card.pro li::before {
  background: color-mix(in srgb, var(--gold) 28%, transparent);
}

/* ── CTA section ─────────────────────────────────────────────────── */

.cta-section {
  text-align: center;
}

.cta-section h2 {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0 0 14px;
}

.cta-section p {
  color: var(--text-dim);
  font-size: 15.5px;
  margin: 0 0 32px;
}

.cta-actions {
  justify-content: center;
}

/* ── Footer ──────────────────────────────────────────────────────── */

.footer {
  border-top: 1px solid var(--border);
  padding: 40px 0;
}

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

.footer-copy {
  font-size: 13px;
  color: var(--text-dim-2);
}

.footer-links {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}

.footer-links a {
  font-size: 13.5px;
  color: var(--text-dim);
  transition: color 0.15s ease;
}

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

/* ── Responsive ──────────────────────────────────────────────────── */

@media (max-width: 900px) {
  .hero .wrap {
    grid-template-columns: 1fr;
  }

  .phone-stage {
    order: -1;
    justify-content: center;
  }

  .phone {
    max-width: 340px;
  }

  .steps,
  .features {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .nav-links {
    display: none;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .header.open .nav-links {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    position: absolute;
    top: 72px;
    left: 0;
    right: 0;
    background: rgba(11, 11, 16, 0.97);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
    padding: 16px 24px 20px;
  }

  .header.open .nav-links a {
    padding: 10px 0;
    width: 100%;
  }

  .header.open .nav-links .nav-cta {
    padding: 13px 26px;
    margin-top: 8px;
    justify-content: center;
  }

  .hero {
    padding: 48px 0 64px;
  }

  .hero h1 {
    font-size: 32px;
  }

  .hero p.sub {
    font-size: 15.5px;
  }

  .hero-platform-actions,
  .cta-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-platform-actions .btn,
  .cta-actions .btn {
    width: 100%;
  }

  .hero-secondary-link {
    display: flex;
    justify-content: center;
  }

  section {
    padding: 56px 0;
  }

  section .section-head h2,
  .cta-section h2 {
    font-size: 26px;
  }

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

  .platform-bridge {
    grid-template-columns: 1fr;
  }

  .footer .wrap {
    flex-direction: column;
    align-items: flex-start;
  }
}
