:root {
  --bg: #efece5;
  --bg-2: #e7e3d8;
  --card: #ffffff;
  --soft: #f4f1ea;
  --ink: #17150f;
  --muted: #6e685c;
  --line: #e6e0d2;
  --accent: #17150f;
  --accent-ink: #ffffff;
  --pos: #1f7a4d;
  --grid-line: rgba(23, 21, 15, 0.05);
  --glow: rgba(23, 21, 15, 0.08);
  --mono: "SF Mono", "JetBrains Mono", "Geist Mono", ui-monospace, Menlo, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", Roboto, system-ui, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.app {
  max-width: 560px;
  margin: 0 auto;
  padding: 16px 16px 132px;
}

/* Reveal-on-load */
.reveal { animation: rise 620ms cubic-bezier(0.22, 1, 0.36, 1) both; }
.mock.reveal { animation-delay: 90ms; }
.stats.reveal { animation-delay: 150ms; }
.features.reveal { animation-delay: 210ms; }
.pricing.reveal { animation-delay: 270ms; }
@keyframes rise {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) { .reveal { animation: none; } }

/* HERO */
.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: min(760px, 88svh);
  padding: 40px 18px 34px;
  gap: 15px;
  overflow: hidden;
  border-radius: 28px;
  border: 1px solid var(--line);
  background:
    radial-gradient(120% 78% at 50% -8%, #fff, transparent 55%),
    linear-gradient(180deg, var(--bg-2), var(--bg));
}

.scroll-hint {
  margin-top: 4px;
  color: var(--muted);
  opacity: 0.6;
  animation: bob 1.8s ease-in-out infinite;
}
.scroll-hint svg { width: 22px; height: 22px; display: block; }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(5px); } }
@media (prefers-reduced-motion: reduce) { .scroll-hint { animation: none; } }

/* When running inside Telegram, the native MainButton replaces the sticky CTA. */
body.tg .sticky-cta { display: none; }

.hero-bg {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 26px 26px, 26px 26px;
  -webkit-mask-image: radial-gradient(120% 92% at 50% 4%, #000 42%, transparent 84%);
  mask-image: radial-gradient(120% 92% at 50% 4%, #000 42%, transparent 84%);
  pointer-events: none;
}

/* Thematic line icons, very faint */
.hero-deco { position: absolute; inset: 0; pointer-events: none; color: var(--ink); }
.hero-deco .d {
  position: absolute;
  width: 40px; height: 40px;
  opacity: 0.06;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.hero-deco .d1 { top: 26px; left: 18px; transform: rotate(-12deg); }
.hero-deco .d2 { top: 60px; right: 20px; width: 46px; height: 46px; transform: rotate(9deg); }
.hero-deco .d3 { top: 150px; left: 26px; transform: rotate(7deg); }
.hero-deco .d4 { bottom: 44px; right: 30px; transform: rotate(-8deg); }
.hero-deco .d5 { bottom: 30px; left: 40px; width: 34px; height: 34px; transform: rotate(12deg); }

.hero > *:not(.hero-bg):not(.hero-deco) { position: relative; }

.mark {
  width: 92px;
  height: 92px;
  filter: drop-shadow(0 16px 34px rgba(23, 21, 15, 0.22));
}
.mark svg { width: 100%; height: 100%; display: block; }

.platform {
  padding: 6px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: 46px;
  line-height: 1;
  letter-spacing: -0.035em;
  font-weight: 800;
}

.lead {
  margin: 0;
  max-width: 430px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.5;
}

.cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 8px;
  padding: 15px 30px;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font-family: var(--sans);
  font-size: 16px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 14px 28px rgba(23, 21, 15, 0.20);
  transition: transform 120ms ease, box-shadow 160ms ease;
}
.cta:hover { box-shadow: 0 18px 34px rgba(23, 21, 15, 0.26); }
.cta:active { transform: scale(0.98); }
.cta.wide { width: 100%; margin-top: 4px; }

/* APP WINDOW MOCK */
.mock {
  margin: 16px 0 26px;
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  background: var(--card);
  box-shadow: 0 24px 54px rgba(23, 21, 15, 0.14);
}
.mock-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 15px;
  border-bottom: 1px solid var(--line);
  background: var(--soft);
}
.mock-bar .dot { width: 11px; height: 11px; border-radius: 999px; background: var(--line); }
.mock-bar .dot:nth-child(1) { background: #e0685f; }
.mock-bar .dot:nth-child(2) { background: #e5b84e; }
.mock-bar .dot:nth-child(3) { background: #6cc06a; }
.mock-bar em {
  margin-left: 8px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
  font-style: normal;
}

.mock-body { display: grid; grid-template-columns: 60px 1fr; min-height: 200px; }
.mock-side {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 16px 12px;
  border-right: 1px solid var(--line);
  background: var(--soft);
}
.mock-logo { width: 22px; height: 22px; border-radius: 7px; background: var(--accent); margin-bottom: 4px; }
.mock-nav { height: 9px; border-radius: 4px; background: var(--line); }
.mock-nav.on { background: var(--accent); opacity: 0.9; }

.mock-main { padding: 18px; display: grid; gap: 16px; align-content: start; }
.mock-metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.mock-metric {
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--soft);
  display: grid; gap: 4px;
}
.mock-metric small { color: var(--muted); font-size: 11px; white-space: nowrap; }
.mock-metric b { font-family: var(--mono); font-size: 13.5px; letter-spacing: -0.02em; white-space: nowrap; }
.mock-metric b.pos { color: var(--pos); }

.mock-chart { display: flex; align-items: flex-end; gap: 8px; height: 72px; padding: 0 2px; }
.mock-chart i {
  flex: 1;
  border-radius: 6px 6px 3px 3px;
  background: linear-gradient(180deg, var(--accent), color-mix(in srgb, var(--accent) 72%, transparent));
}

.mock-rows { display: grid; gap: 9px; }
.mock-rows span { height: 10px; border-radius: 5px; background: var(--line); }
.mock-rows span:nth-child(1) { width: 92%; }
.mock-rows span:nth-child(2) { width: 76%; }
.mock-rows span:nth-child(3) { width: 60%; }

/* STATS */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 30px; }
.stat {
  display: grid;
  gap: 3px;
  padding: 17px 10px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
  text-align: center;
}
.stat strong { font-family: var(--mono); font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }
.stat span { color: var(--muted); font-size: 12px; }

/* SECTION TITLES */
section h2 {
  margin: 0 0 14px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  font-family: var(--mono);
}

/* FEATURES */
.features { margin-bottom: 30px; }
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.feature {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
  transition: transform 160ms ease, box-shadow 160ms ease;
}
.feature:hover { transform: translateY(-2px); box-shadow: 0 14px 28px rgba(23, 21, 15, 0.10); }
.feature .ico {
  display: grid; place-items: center;
  width: 40px; height: 40px;
  margin-bottom: 12px;
  border-radius: 12px;
  background: var(--soft);
  color: var(--ink);
}
.feature .ico svg { width: 21px; height: 21px; }
.feature h3 { margin: 0 0 6px; font-size: 15px; font-weight: 700; letter-spacing: -0.01em; }
.feature p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.45; }

/* PRICING */
.pricing { margin-bottom: 26px; }
.plan {
  position: relative;
  overflow: hidden;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--soft);
}
.plan-glow {
  position: absolute;
  inset: -40% 30% auto -10%;
  height: 200px;
  background: radial-gradient(60% 100% at 30% 0%, var(--glow), transparent 70%);
  pointer-events: none;
}
.plan > *:not(.plan-glow) { position: relative; }
.plan-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.plan-name { display: block; font-size: 17px; font-weight: 800; letter-spacing: -0.01em; }
.plan-sub { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; }
.plan-price { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; font-family: var(--mono); white-space: nowrap; line-height: 1; }
.plan-price .amount { color: var(--ink); font-size: 30px; font-weight: 800; letter-spacing: -0.02em; }
.plan-price .amount b { font-weight: 800; }
.plan-price i { font-style: normal; font-size: 10.5px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.plan-list { margin: 0 0 18px; padding: 0; list-style: none; display: grid; gap: 10px; }
.plan-list li { position: relative; padding-left: 26px; font-size: 14px; color: var(--ink); }
.plan-list li::before {
  content: "";
  position: absolute;
  left: 0; top: 5px;
  width: 15px; height: 9px;
  border-left: 2px solid var(--accent);
  border-bottom: 2px solid var(--accent);
  transform: rotate(-45deg);
}
.fineprint { margin: 12px 0 0; text-align: center; color: var(--muted); font-size: 12px; }

/* LEGAL LINKS */
.legal {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin: 0 0 22px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
}
.legal a {
  color: var(--muted);
  font-size: 13px;
  text-decoration: none;
}
.legal a:first-child {
  color: var(--ink);
  font-weight: 700;
}
.legal a:hover { text-decoration: underline; }
.legal-code {
  margin-top: 2px;
  color: var(--faint, #9a948c);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.04em;
}

/* FOOTER */
.foot { display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--muted); font-size: 12px; }
.mark-sm { width: 16px; height: 16px; color: var(--muted); }
.mark-sm svg { width: 100%; height: 100%; display: block; }

/* STICKY CTA */
.sticky-cta {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 20;
  padding: 12px 16px calc(14px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, transparent, var(--bg) 34%);
}
.sticky-cta .cta { width: min(560px, 100%); margin: 0 auto; justify-content: space-between; padding: 15px 22px; }
.sticky-cta .cta em { font-family: var(--mono); font-style: normal; font-weight: 700; opacity: 0.92; }

/* ACCOUNT (owns a license) */
.account { padding: 0 20px; }
.account-card { display: grid; gap: 14px; }
.account-status { display: flex; }
.account-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(31, 122, 77, 0.12);
  color: var(--pos);
  font-weight: 700;
  font-size: 14px;
}
.account-hint { color: var(--muted); font-size: 14px; margin: 0; }

.code-box {
  display: grid;
  gap: 8px;
  padding: 16px;
  border: 1px dashed var(--line);
  border-radius: 16px;
  background: var(--soft);
  text-align: center;
}
.code-label { color: var(--muted); font-size: 13px; }
.code-value {
  font-family: var(--mono);
  font-size: 30px;
  font-weight: 700;
  letter-spacing: 0.22em;
  color: var(--ink);
}
.code-copy {
  justify-self: center;
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 10px;
  padding: 8px 16px;
  font-weight: 600;
  cursor: pointer;
}
.code-copy:active { transform: scale(0.98); }
.code-note { color: var(--muted); font-size: 12px; }

.device-box { border-top: 1px solid var(--line); padding-top: 14px; }
.device-empty { color: var(--muted); font-size: 14px; }
.device-bound { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.device-label { display: block; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.device-info { font-weight: 600; font-size: 14px; }
.device-unbind {
  border: 1px solid var(--line);
  background: var(--card);
  color: #b3261e;
  border-radius: 10px;
  padding: 8px 14px;
  font-weight: 600;
  cursor: pointer;
  flex: 0 0 auto;
}
.device-unbind:active { transform: scale(0.98); }
