:root {
  --bg: #0b0b0d;
  --surface: #141417;
  --raised: #1c1c21;
  --hover: #26262c;
  --border: rgba(255, 255, 255, 0.1);
  --border-strong: rgba(255, 255, 255, 0.18);
  --text: #f5f5f7;
  --muted: rgba(255, 255, 255, 0.66);
  --faint: rgba(255, 255, 255, 0.45);
  --accent: #d92d3a;
  --accent-hover: #e63b48;
  --accent-text: #ff5a66;
  --accent-soft: rgba(217, 45, 58, 0.12);
  --ok: #5fd18b;
  --ok-soft: rgba(95, 209, 139, 0.12);
  --warn: #f0a35e;
  --warn-soft: rgba(240, 163, 94, 0.12);
  --radius: 12px;
  --radius-sm: 8px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, Menlo, Consolas, "Liberation Mono", monospace;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; }
a { color: inherit; }
code { font-family: var(--mono); font-size: 0.92em; color: var(--accent-text); }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 2px; border-radius: 6px; }

.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 32px; }
.wrap.narrow { max-width: 760px; }
.muted { color: var(--muted); }

.skip {
  position: absolute; left: 16px; top: -60px; z-index: 100;
  background: var(--accent); color: #fff; padding: 10px 16px; border-radius: var(--radius-sm); text-decoration: none;
}
.skip:focus { top: 16px; }

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 20;
  background: rgba(11, 11, 13, 0.82);
  backdrop-filter: saturate(140%) blur(12px);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav-inner { display: flex; align-items: center; gap: 32px; height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-mark { width: 30px; height: 30px; }
.brand-mark rect { fill: var(--surface); stroke: var(--accent); stroke-width: 2; }
.brand-mark path { stroke: var(--accent-text); stroke-width: 3; stroke-linecap: round; fill: none; }
.brand-name { font-weight: 800; letter-spacing: 0.06em; font-size: 17px; }
.brand-name span { color: var(--accent-text); margin-left: 4px; font-weight: 600; }
.nav-links { display: flex; gap: 24px; margin-right: auto; }
.nav-links a { color: var(--muted); text-decoration: none; font-size: 15px; padding: 10px 0; }
.nav-links a:hover { color: var(--text); }

.live-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px; border-radius: 999px; font-size: 14px;
  background: var(--surface); border: 1px solid var(--border); color: var(--muted);
  white-space: nowrap;
}
.live-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }
.live-pill.ok .dot { background: var(--ok); box-shadow: 0 0 0 4px var(--ok-soft); }
.live-pill.down .dot { background: var(--warn); }

/* ---------- hero ---------- */
.hero { position: relative; overflow: hidden; padding: 72px 0 88px; border-bottom: 1px solid var(--border); }
.glow {
  position: absolute; inset: -30% -10% auto auto; width: 760px; height: 760px; pointer-events: none;
  background: radial-gradient(closest-side, rgba(217, 45, 58, 0.22), rgba(217, 45, 58, 0.06) 55%, transparent 72%);
}
.hero-grid { position: relative; display: grid; grid-template-columns: 1fr 440px; gap: 64px; align-items: center; }
.eyebrow {
  margin: 0 0 12px; font-size: 13px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent-text);
}
h1 { margin: 0; font-size: 52px; line-height: 1.08; letter-spacing: -0.025em; font-weight: 800; max-width: 12.5em; }
.accent { color: var(--accent-text); }
.lead { margin: 20px 0 0; font-size: 18px; color: var(--muted); max-width: 34em; }
.lead.small { font-size: 16px; margin-top: 12px; }

.stats { display: flex; gap: 12px; margin: 40px 0 0; flex-wrap: wrap; }
.stats div {
  min-width: 128px; padding: 14px 18px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border);
}
.stats dt { font-size: 13px; color: var(--muted); }
.stats dd { margin: 2px 0 0; font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; }

/* ---------- card ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 24px 48px rgba(0, 0, 0, 0.35);
}
.link-card { padding: 28px; }
.card-head h2 { margin: 0; font-size: 22px; letter-spacing: -0.01em; }
.card-head p { margin: 4px 0 0; font-size: 15px; }

.tabs {
  display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin: 20px 0 24px; padding: 4px;
  background: var(--bg); border: 1px solid var(--border); border-radius: 10px;
}
.tab {
  min-height: 44px; border: 0; border-radius: 7px; background: transparent; color: var(--muted);
  font: 600 15px var(--font); cursor: pointer;
}
.tab:hover { color: var(--text); }
.tab[aria-selected="true"] { background: var(--raised); color: var(--text); box-shadow: inset 0 0 0 1px var(--border-strong); }

.label { display: block; margin: 0 0 8px; font-size: 14px; font-weight: 600; color: var(--muted); }
.field {
  display: flex; align-items: center; height: 52px; padding: 0 14px;
  background: var(--bg); border: 1px solid var(--border-strong); border-radius: 10px;
  transition: border-color 0.15s;
}
.field:focus-within { border-color: var(--accent-text); box-shadow: 0 0 0 3px var(--accent-soft); }
.field.invalid { border-color: var(--warn); }
.field-prefix { color: var(--faint); font-size: 18px; margin-right: 6px; }
.field input {
  flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; color: var(--text);
  font: 500 18px var(--font); letter-spacing: 0.04em; font-variant-numeric: tabular-nums;
}
.field input::placeholder { color: rgba(255, 255, 255, 0.28); }
.hint { margin: 8px 0 0; font-size: 14px; color: var(--muted); }
.hint.warn { color: var(--warn); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 20px; border-radius: 10px; border: 1px solid transparent;
  font: 600 16px var(--font); cursor: pointer; text-decoration: none;
  transition: background 0.15s, border-color 0.15s, opacity 0.15s;
}
.btn.block { width: 100%; margin-top: 20px; }
.btn.primary { background: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-hover); }
.btn.ghost { background: var(--raised); border-color: var(--border-strong); color: var(--text); }
.btn.ghost:hover { background: var(--hover); }
.btn.text { background: none; color: var(--muted); padding: 0 4px; min-height: 44px; margin-top: 8px; text-decoration: underline; text-underline-offset: 3px; }
.btn.text:hover { color: var(--text); }
.btn[disabled] { opacity: 0.6; cursor: progress; }
.btn .spinner {
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.35); border-top-color: #fff; animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.result { margin-top: 4px; }
#panel-code .how-mini { margin-top: 24px; }
.code-row { display: flex; gap: 12px; align-items: stretch; }
.code {
  flex: 1; display: flex; align-items: center; justify-content: center; min-height: 72px;
  font: 700 34px var(--mono); letter-spacing: 0.14em; color: var(--text);
  background: var(--bg); border: 1px dashed rgba(255, 90, 102, 0.55); border-radius: 10px;
}
.code-row .btn { min-height: 72px; }
.timer { margin: 10px 0 0; font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; min-height: 21px; }
.timer.low { color: var(--warn); }

.how-mini { margin: 20px 0 0; padding: 16px 16px 16px 36px; background: var(--raised); border-radius: 10px; font-size: 14px; color: var(--muted); }
.how-mini li + li { margin-top: 6px; }
.how-mini b { color: var(--text); font-weight: 600; }

.qr-box {
  position: relative; display: grid; place-items: center; width: 260px; height: 260px; margin: 0 auto;
  background: var(--bg); border: 1px dashed var(--border-strong); border-radius: 12px; overflow: hidden;
}
.qr-box.ready { background: #fff; border: 0; }
.qr-box img { width: 240px; height: 240px; image-rendering: pixelated; }
.qr-empty { display: grid; justify-items: center; gap: 12px; color: var(--faint); font-size: 14px; text-align: center; }
.qr-empty svg { width: 48px; height: 48px; fill: none; stroke: currentColor; stroke-width: 1.5; }
#panel-qr .timer { text-align: center; }

.stepper { list-style: none; margin: 24px 0 0; padding: 16px 0 0; border-top: 1px solid var(--border); display: grid; gap: 10px; }
.stepper li { display: flex; align-items: center; gap: 12px; font-size: 15px; color: var(--faint); }
.stepper .bullet {
  position: relative; flex: none; width: 20px; height: 20px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.22);
}
.stepper li.done { color: var(--muted); }
.stepper li.done .bullet { border-color: var(--ok); background: var(--ok); }
.stepper li.done .bullet::after {
  content: ""; position: absolute; left: 5px; top: 2px; width: 5px; height: 9px;
  border: solid #0b0b0d; border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.stepper li.active { color: var(--text); font-weight: 600; }
.stepper li.active .bullet { border-color: var(--accent-text); border-top-color: transparent; animation: spin 0.9s linear infinite; }

.alert {
  display: flex; gap: 12px; align-items: flex-start; margin-top: 20px; padding: 14px 16px;
  background: var(--warn-soft); border: 1px solid rgba(240, 163, 94, 0.4); border-radius: 10px;
}
.alert svg { flex: none; width: 20px; height: 20px; margin-top: 1px; fill: none; stroke: var(--warn); stroke-width: 2; stroke-linecap: round; }
.alert p { margin: 0; font-size: 15px; color: var(--text); }

.success { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 40px 8px 8px; outline: 0; }
.success-icon { display: grid; place-items: center; width: 72px; height: 72px; border-radius: 50%; background: var(--ok-soft); border: 1px solid rgba(95, 209, 139, 0.45); }
.success-icon svg { width: 34px; height: 34px; fill: none; stroke: var(--ok); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.success h2 { margin: 20px 0 6px; font-size: 26px; }
.success > p { margin: 0; }
.success-tip {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; margin: 28px 0 0;
  padding: 14px 16px; background: var(--raised); border: 1px solid var(--border); border-radius: 10px; font-size: 15px; color: var(--muted); text-align: left;
}
.success-tip code { font-size: 17px; font-weight: 700; padding: 4px 10px; border-radius: 6px; background: var(--accent-soft); }
.success .hint { margin-top: 12px; }

/* ---------- sections ---------- */
.section { padding: 96px 0; }
.section.alt { background: #0f0f12; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-title { margin: 0; font-size: 36px; line-height: 1.15; letter-spacing: -0.02em; max-width: 18em; }

.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 48px; }
.feature { padding: 24px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.feature svg { width: 40px; height: 40px; padding: 9px; border-radius: 10px; background: var(--accent-soft); fill: none; stroke: var(--accent-text); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.feature h3 { margin: 18px 0 6px; font-size: 18px; }
.feature p { margin: 0; color: var(--muted); font-size: 15px; }

.preview-grid { display: grid; grid-template-columns: 1fr 380px; gap: 64px; align-items: center; }
.preview-grid .label { margin-top: 32px; }
.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; }
.chips li { padding: 8px 14px; border-radius: 8px; background: var(--surface); border: 1px solid var(--border); }
.chips code { font-size: 15px; }

.phone {
  width: 100%; max-width: 380px; justify-self: end; border-radius: 28px; padding: 10px;
  background: #18181c; border: 1px solid var(--border-strong); box-shadow: 0 30px 60px rgba(0, 0, 0, 0.45);
}
.phone-top { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: #1f1f24; border-radius: 20px 20px 0 0; }
.phone-top b { display: block; font-size: 15px; }
.phone-top small { display: block; font-size: 13px; color: var(--ok); }
.avatar {
  display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%;
  background: var(--accent); color: #fff; font-weight: 800; font-size: 13px; letter-spacing: 0.04em;
}
.chat { display: flex; flex-direction: column; gap: 10px; padding: 18px 14px 22px; background: #101013; border-radius: 0 0 20px 20px; min-height: 360px; }
.bubble { position: relative; margin: 0; max-width: 82%; padding: 8px 12px 20px; border-radius: 12px; font-size: 15px; line-height: 1.45; }
.bubble time { position: absolute; right: 10px; bottom: 4px; font-size: 11px; color: rgba(255, 255, 255, 0.55); }
.bubble.out { align-self: flex-end; background: #6d1a22; font-family: var(--mono); padding-right: 52px; padding-bottom: 8px; }
.bubble.out time { bottom: 8px; }
.bubble.in { align-self: flex-start; display: grid; gap: 2px; background: #202026; border: 1px solid var(--border); }
.bubble.in span { color: var(--muted); font-size: 14px; }

.how { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 48px 0 0; padding: 0; }
.how li { padding: 24px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); }
.num {
  display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid rgba(255, 90, 102, 0.5); color: var(--accent-text); font-weight: 700;
}
.how h3 { margin: 18px 0 6px; font-size: 18px; }
.how p { margin: 0; color: var(--muted); font-size: 15px; }

.faq { max-width: 760px; margin-top: 32px; border-top: 1px solid var(--border); }
.faq details { border-bottom: 1px solid var(--border); }
.faq summary {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  min-height: 60px; padding: 14px 0; cursor: pointer; font-size: 17px; font-weight: 600; list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; flex: none; font-size: 24px; font-weight: 400; color: var(--muted); }
.faq details[open] summary::after { content: "\2212"; }
.faq details p { margin: 0 0 20px; color: var(--muted); max-width: 62ch; }

.footer { padding: 32px 0 40px; border-top: 1px solid var(--border); }
.footer-inner { display: flex; align-items: center; gap: 24px; font-size: 14px; }
.footer-inner .muted { margin-right: auto; }
.footer-inner a { color: var(--muted); padding: 10px 0; }
.footer-inner a:hover { color: var(--text); }
.brand.small .brand-mark { width: 24px; height: 24px; }
.brand.small .brand-name { font-size: 14px; }

/* ---------- responsive ---------- */
@media (max-width: 1000px) {
  .hero-grid { grid-template-columns: 1fr; gap: 48px; }
  .link-card { max-width: 520px; width: 100%; }
  h1 { font-size: 44px; }
  .preview-grid { grid-template-columns: 1fr; gap: 48px; }
  .phone { justify-self: start; }
}
@media (max-width: 760px) {
  .wrap { padding: 0 20px; }
  .nav-links { display: none; }
  .nav-inner { justify-content: space-between; }
  .hero { padding: 40px 0 56px; }
  h1 { font-size: 34px; }
  .lead { font-size: 17px; }
  .stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 28px; }
  .stats div { min-width: 0; padding: 12px; }
  .stats dd { font-size: 20px; }
  .link-card { padding: 20px; min-height: 0; }
  .code { font-size: 26px; letter-spacing: 0.1em; }
  .section { padding: 64px 0; }
  .section-title { font-size: 28px; }
  .feature-grid, .how { grid-template-columns: 1fr; margin-top: 32px; }
  .footer-inner { flex-wrap: wrap; gap: 8px 20px; }
  .footer-inner .muted { margin-right: 0; flex-basis: 100%; order: 3; }
}
@media (max-width: 380px) {
  .code-row { flex-direction: column; }
  .code-row .btn { min-height: 48px; }
}

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