/* Tellygram landing page — palette lifted from the app's own theme
   (ui/theme/Theme.kt, JetStream dark scheme) so the site and the app match. */
:root {
  --bg:        #1A1C1E;
  --panel:     #121316;
  --panel-2:   #16181B;
  --on:        #C7C6CA;
  --on-variant:#C4C6CF;
  --outline:   #8E9099;
  --accent:    #A8C8FF;
  --accent-ink:#003062;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--on);
  font: 16px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { color: #E3E2E6; line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: clamp(2rem, 5vw, 3.25rem); letter-spacing: -.02em; }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); }
h3 { font-size: 1.05rem; }

/* ---------- header ---------- */
.site-header {
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  max-width: 1080px; margin: 0 auto; padding: 28px 24px;
}
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  color: #E3E2E6; font-weight: 600; letter-spacing: .01em; font-size: 1.05rem;
}
.brand:hover { text-decoration: none; }
.mark { width: 26px; height: 26px; color: var(--accent); flex: none; }
.site-header nav { display: flex; gap: 22px; font-size: .95rem; }
.site-header nav a { color: var(--on-variant); }
.site-header nav a:hover { color: var(--accent); }

/* ---------- hero ---------- */
.hero {
  max-width: 1080px; margin: 0 auto; padding: 32px 24px 24px;
  display: grid; grid-template-columns: 1.15fr .85fr; gap: 48px; align-items: center;
}
.lede { font-size: 1.1rem; color: var(--on-variant); margin: 0 0 12px; }
.lede-cn { font-size: 1rem; color: var(--on-variant); opacity: .85; margin: 0 0 26px; }
.cta { display: flex; gap: 12px; flex-wrap: wrap; }
.btn {
  display: inline-block; padding: 12px 22px; border-radius: 8px;
  font-weight: 600; font-size: .95rem; border: 1px solid transparent;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { filter: brightness(1.06); }
.btn-ghost { border-color: var(--outline); color: var(--on); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.meta { margin: 18px 0 0; font-size: .85rem; color: var(--outline); }

/* decorative TV panel — abstract, deliberately not a mock screenshot */
.hero-art { display: flex; justify-content: center; }
.tv {
  width: 100%; max-width: 420px; padding: 14px; border-radius: 14px;
  background: linear-gradient(160deg, #22262B, #101214);
  box-shadow: 0 24px 60px rgba(0,0,0,.55), inset 0 0 0 1px rgba(255,255,255,.05);
}
.tv-screen {
  position: relative; aspect-ratio: 16 / 9; border-radius: 8px; overflow: hidden;
  background: radial-gradient(120% 120% at 20% 0%, #1E2A44 0%, #0E1013 60%);
  display: grid; place-items: center;
}
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; width: 78%; opacity: .5; }
.grid span { display: block; aspect-ratio: 16 / 10; border-radius: 4px; background: rgba(255,255,255,.10); }
.play {
  position: absolute; width: 54px; height: 54px; border-radius: 50%;
  background: rgba(168,200,255,.92);
  clip-path: none;
}
.play::after {
  content: ""; position: absolute; inset: 0;
  background: var(--accent-ink);
  clip-path: polygon(38% 30%, 38% 70%, 70% 50%);
}
.tv-stand { width: 34%; height: 8px; margin: 12px auto 0; border-radius: 3px; background: #2A2E33; }

/* ---------- sections ---------- */
.section { max-width: 1080px; margin: 0 auto; padding: 56px 24px; border-top: 1px solid rgba(255,255,255,.06); }
.section-lede { color: var(--on-variant); max-width: 62ch; }
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 24px; }
.card {
  background: var(--panel); border: 1px solid rgba(255,255,255,.07);
  border-radius: 10px; padding: 20px;
}
.card p { margin: 0; color: var(--on-variant); font-size: .94rem; }

/* ---------- downloads ---------- */
.downloads { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 24px 0; }
.dl {
  display: flex; flex-direction: column; gap: 4px; padding: 16px;
  background: var(--panel); border: 1px solid rgba(255,255,255,.08); border-radius: 10px;
  color: var(--on);
}
.dl:hover { border-color: var(--accent); text-decoration: none; }
.dl-abi { font-weight: 600; color: #E3E2E6; }
.dl-size { font-size: .82rem; color: var(--outline); }
.dl-tag {
  align-self: flex-start; font-size: .68rem; text-transform: uppercase; letter-spacing: .08em;
  background: rgba(168,200,255,.16); color: var(--accent); border-radius: 4px; padding: 2px 6px;
}
.dl-recommended { border-color: rgba(168,200,255,.45); }

.steps { color: var(--on-variant); padding-left: 20px; }
.steps li { margin: 6px 0; }
.note { font-size: .88rem; color: var(--outline); max-width: 70ch; }

/* ---------- faq ---------- */
.faq { margin: 24px 0 0; }
.faq dt { font-weight: 600; color: #E3E2E6; margin-top: 20px; }
.faq dd { margin: 6px 0 0; color: var(--on-variant); max-width: 72ch; }

.cn p { color: var(--on-variant); max-width: 72ch; }

/* ---------- footer ---------- */
.site-footer {
  max-width: 1080px; margin: 0 auto; padding: 32px 24px 56px;
  border-top: 1px solid rgba(255,255,255,.06); color: var(--outline); font-size: .85rem;
}
.footer-meta { display: flex; gap: 16px; flex-wrap: wrap; }

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; gap: 32px; }
  .cards { grid-template-columns: 1fr 1fr; }
  .downloads { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .cards, .downloads { grid-template-columns: 1fr; }
  .site-header nav { gap: 14px; font-size: .88rem; }
}

/* ---------- personal APK page (form + progress) ---------- */
.page { max-width: 860px; margin: 0 auto; padding: 24px 24px 64px; }
.page-title { margin: 16px 0 8px; }

.box {
  background: var(--panel); border: 1px solid rgba(255,255,255,.07);
  border-radius: 10px; padding: 22px 24px; margin: 22px 0;
}
.box h2 { display: flex; align-items: center; gap: 10px; font-size: 1.15rem; margin-bottom: 12px; }
.step {
  display: inline-grid; place-items: center; width: 26px; height: 26px; flex: none;
  border-radius: 50%; background: rgba(168,200,255,.16); color: var(--accent);
  font-size: .85rem; font-weight: 600;
}

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field label { font-weight: 600; color: #E3E2E6; font-size: .92rem; }
.field input, .field select {
  background: #0E1013; color: var(--on); border: 1px solid rgba(255,255,255,.14);
  border-radius: 8px; padding: 11px 13px; font-size: .95rem; font-family: inherit;
}
.field input:focus, .field select:focus { outline: none; border-color: var(--accent); }
.field input::placeholder { color: #6C7076; }
.hint { font-size: .8rem; color: var(--outline); }
.actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 6px; }
.actions .btn[disabled] { opacity: .55; cursor: default; }

.progress { margin-top: 8px; }
.bar { height: 6px; border-radius: 3px; background: rgba(255,255,255,.09); overflow: hidden; }
.bar-fill { height: 100%; width: 0; background: var(--accent); transition: width .4s ease; }
.status-text { margin: 14px 0 4px; font-weight: 600; color: #E3E2E6; }
.hashline { font-size: .78rem; color: var(--outline); word-break: break-all; margin-top: 10px; }

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .88em; background: rgba(255,255,255,.06);
  padding: 1px 5px; border-radius: 4px; color: var(--on-variant);
}
.en { color: var(--on-variant); font-size: .95rem; }
.steps code { font-size: .85em; }

/* ---------- bilingual content + language switch ---------- */
/* Only one language is in flow at a time. `revert` hands the property back to
   the user-agent origin, so paragraphs stay block, spans stay inline and list
   items stay list items — which is why [data-lang] must not sit on an element
   whose display an author rule overrides (a .btn, a flex row, ...). */
/* Only the INACTIVE language is hidden. The active one is never touched, so
   no `revert` is involved (an engine that drops `revert` used to leave both
   languages on screen at once, which is exactly what looked "中英夹杂"). */
html[lang="en"] [data-lang="zh"],
html[lang="zh"] [data-lang="en"] { display: none; }

.lang-switch {
  background: none; border: 1px solid var(--outline); color: var(--on);
  border-radius: 999px; padding: 4px 12px; font: inherit; font-size: .85rem;
  cursor: pointer; line-height: 1.4;
}
.lang-switch:hover { border-color: var(--accent); color: var(--accent); }
.site-header nav { align-items: center; }

/* ---------- icons (inline SVG sprite, no icon font, no CDN) ---------- */
.sprite { display: none; }
.ico {
  width: 1em; height: 1em; flex: none;
  vertical-align: -0.125em;
  fill: currentColor;
}
.ico-stroke { fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round; }
.btn .ico { width: 1.05em; height: 1.05em; margin-right: .5em; vertical-align: -0.15em; }
.lang-switch .ico { margin-right: .35em; }
.card h3 .ico { width: 1.15em; height: 1.15em; margin-right: .5em; color: var(--accent); vertical-align: -0.2em; }
.nav-icon { width: 20px; height: 20px; color: var(--on-variant); }
.nav-icon:hover { color: var(--accent); }
h2 .ico { color: var(--accent); margin-right: .5em; }
.site-header nav a.with-icon { display: inline-flex; align-items: center; }
