/* ChatDock landing page — self-contained design system.
   Legal pages keep using /assets/style.css. */

:root {
  --ink: #0c1022;
  --ink-2: #1a2140;
  --muted: #5c6579;
  --line: #e8eaf4;
  --soft: #f5f7ff;
  --brand: #6c5ce7;
  --brand-2: #0a84ff;
  --brand-3: #00c2a8;
  --grad: linear-gradient(135deg, #6c5ce7 0%, #0a84ff 100%);
  --grad-soft: linear-gradient(135deg, #eef1ff 0%, #e8f4ff 100%);
  --radius: 20px;
  --shadow-sm: 0 2px 10px rgba(16, 24, 64, .06);
  --shadow: 0 18px 50px rgba(16, 24, 64, .12);
  --shadow-lg: 0 40px 90px rgba(16, 24, 64, .22);
  --maxw: 1120px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; background: var(--ink); }

body {
  margin: 0;
  color: var(--ink);
  background: #fff;
  overflow-x: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro SC", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", Roboto, Helvetica, Arial,
    sans-serif;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* Typography: avoid orphan characters / balance multi-line intro text. */
h1, h2, h3, .section-head h2, .final-card h2 { text-wrap: balance; }
p, li, .checks span, .card p, .sec-card p, .step p, .faq details p { text-wrap: pretty; }
.section-head p, .hero p.lead { text-wrap: balance; }

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

/* ---------- Header ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  background: rgba(12, 16, 34, .82);
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  transition: background .25s ease, box-shadow .25s ease;
}
.nav.scrolled {
  background: rgba(12, 16, 34, .95);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .28);
}
.nav-inner {
  max-width: var(--maxw); margin: 0 auto; padding: 12px 22px;
  display: flex; align-items: center; gap: 22px;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  color: #fff; font-weight: 700; font-size: 18px; letter-spacing: .2px;
}
.brand img { width: 30px; height: 30px; border-radius: 8px; }
.nav-links { display: flex; gap: 20px; margin-left: auto; }
.nav-links a { color: rgba(255, 255, 255, .78); font-size: 14.5px; font-weight: 500; }
.nav-links a:hover { color: #fff; }

/* custom language switcher */
.lang-switch { position: relative; }
.lang-btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(255, 255, 255, .08); color: #fff;
  border: 1px solid rgba(255, 255, 255, .18); border-radius: 10px;
  padding: 7px 12px; font-size: 13.5px; font-weight: 600;
  font-family: inherit; cursor: pointer;
  transition: background .18s ease, border-color .18s ease;
}
.lang-btn:hover { background: rgba(255, 255, 255, .16); }
.lang-globe { width: 16px; height: 16px; opacity: .85; flex: 0 0 auto; }
.lang-caret { font-size: 10px; opacity: .7; transition: transform .2s ease; }
.lang-switch.open .lang-caret { transform: rotate(180deg); }
.lang-menu {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 168px;
  background: #12162c; border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 14px; padding: 6px; z-index: 120;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .45);
  opacity: 0; transform: translateY(-6px) scale(.98); pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
}
.lang-switch.open .lang-menu { opacity: 1; transform: none; pointer-events: auto; }
.lang-opt {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  width: 100%; background: transparent; border: 0; color: #dfe3f5;
  font-size: 14px; font-weight: 600; text-align: left; cursor: pointer;
  padding: 9px 12px; border-radius: 9px; font-family: inherit;
}
.lang-opt:hover { background: rgba(255, 255, 255, .08); }
.lang-opt.is-active { color: #fff; }
.lang-opt .lang-check { opacity: 0; color: #7fe3cf; font-size: 13px; }
.lang-opt.is-active .lang-check { opacity: 1; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  border-radius: 14px; font-weight: 650; cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, opacity .18s ease;
  border: 0;
}
.btn:active { transform: translateY(1px) scale(.99); }

.btn-primary {
  background: var(--grad); color: #fff;
  padding: 13px 24px; font-size: 16px;
  box-shadow: 0 12px 30px rgba(80, 90, 240, .38);
}
.btn-primary:hover { box-shadow: 0 16px 40px rgba(80, 90, 240, .5); transform: translateY(-1px); }

.btn-appstore {
  background: #000; color: #fff; padding: 11px 20px 11px 16px;
  border-radius: 14px; box-shadow: 0 12px 30px rgba(0, 0, 0, .3);
}
.btn-appstore:hover { transform: translateY(-1px); box-shadow: 0 16px 38px rgba(0, 0, 0, .4); }
.btn-appstore svg { width: 24px; height: 24px; }
.btn-appstore .as-text { display: flex; flex-direction: column; line-height: 1.15; text-align: left; }
.btn-appstore .as-text small { font-size: 10.5px; opacity: .8; font-weight: 500; letter-spacing: .3px; }
.btn-appstore .as-text strong { font-size: 15.5px; font-weight: 650; }

.btn-ghost {
  background: rgba(255, 255, 255, .1); color: #fff;
  border: 1px solid rgba(255, 255, 255, .24);
  padding: 13px 22px; font-size: 15px;
}
.btn-ghost:hover { background: rgba(255, 255, 255, .16); }

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden; color: #fff;
  background: radial-gradient(900px 520px at 82% -8%, #3b2f8f 0%, transparent 60%),
              radial-gradient(760px 500px at 8% 6%, #123a86 0%, transparent 58%),
              linear-gradient(180deg, #0c1022 0%, #10142b 100%);
  padding: 138px 0 96px;
}
.hero::after {
  content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(rgba(255,255,255,.05) 1px, transparent 1px);
  background-size: 22px 22px; opacity: .5; pointer-events: none;
}
.hero-grid {
  position: relative; z-index: 2;
  display: grid; grid-template-columns: 1.08fr .92fr;
  gap: 56px; align-items: center;
}
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(255, 255, 255, .09); border: 1px solid rgba(255, 255, 255, .16);
  color: #dfe3ff; font-size: 13px; font-weight: 600;
  padding: 6px 13px; border-radius: 999px; margin-bottom: 20px;
}
.eyebrow .spark { color: #ffd166; }
.hero h1 {
  font-size: clamp(32px, 4.4vw, 54px); line-height: 1.16;
  margin: 0 0 18px; letter-spacing: -.5px; font-weight: 800;
}
.hero h1 .hl {
  background: linear-gradient(120deg, #9f8bff, #56b7ff 60%, #4ee0c6);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.only-narrow { display: none; }
.hero p.lead {
  font-size: clamp(16px, 1.7vw, 19px); color: #c3c9e6;
  max-width: 540px; margin: 0 0 30px;
}
.hero-cta { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.hero-meta { display: flex; gap: 18px; margin-top: 22px; color: #9aa2c8; font-size: 13.5px; }
.hero-meta span { display: inline-flex; align-items: center; gap: 7px; }
.hero-meta .tick { color: #4ee0c6; }

.platforms {
  margin-top: 34px; color: #8b93ba; font-size: 13px;
}
.platforms .chips { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 10px; }
.platforms .chip {
  background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .12);
  color: #d4d9f2; border-radius: 999px; padding: 5px 13px; font-size: 13px; font-weight: 550;
}

/* ---------- Phone mockup ---------- */
.phone-frame {
  position: relative; width: 292px; margin: 0 auto;
  aspect-ratio: 292 / 598;
  border-radius: 48px;
  background: linear-gradient(160deg, #3b4272 0%, #12162c 46%, #06080f 100%);
  padding: 11px;
  box-shadow:
    0 60px 100px -34px rgba(8, 12, 34, .7),
    0 0 0 1px rgba(255, 255, 255, .08) inset;
}
/* Frame sized per shot so `cover` never trims the screenshot's bottom. The
   shots are padded by tools/web/pad_shots.py (hero +6px, features +32px) and the
   aspect below matches the padded image, leaving a ~4% bottom gap under the
   app's bottom bar — the real device's home-indicator spacing. */
.hero .phone-frame { aspect-ratio: 292 / 612; }
#features .phone-frame { aspect-ratio: 292 / 623; }
.phone-screen {
  position: relative; height: 100%; border-radius: 38px; overflow: hidden;
  background: linear-gradient(180deg, #ffffff 0%, #f3f5fc 100%);
  color: var(--ink);
  display: flex; flex-direction: column;
}
/* Real app screenshot filling the phone screen (replaces the old CSS mock). */
.phone-screen .phone-shot {
  width: 100%; height: 100%; object-fit: cover; object-position: top center;
  display: block;
}
.phone-island {
  position: absolute; top: 9px; left: 50%; transform: translateX(-50%);
  width: 74px; height: 22px; border-radius: 999px; background: #0a0d18; z-index: 3;
}
.ps-status {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 24px 4px; font-size: 12px; font-weight: 700; color: #10142b;
}
.ps-status .dots { letter-spacing: 1px; color: #10142b; }
.ps-head { padding: 12px 20px 12px; }
.ps-head h4 { margin: 0; font-size: 21px; font-weight: 800; letter-spacing: -.3px; }
.ps-head p { margin: 2px 0 0; font-size: 12px; color: var(--muted); }
.ps-list { padding: 4px 12px; display: flex; flex-direction: column; gap: 9px; }
.ps-row {
  display: flex; align-items: center; gap: 11px;
  padding: 12px; border-radius: 16px; background: #fff;
  border: 1px solid #eef0f8; box-shadow: 0 2px 10px rgba(16, 24, 64, .05);
}
.ps-av {
  width: 40px; height: 40px; border-radius: 13px; flex: 0 0 auto;
  display: grid; place-items: center; color: #fff; font-size: 16px; font-weight: 800;
  box-shadow: 0 6px 14px rgba(16, 24, 64, .18);
}
.ps-row .txt { min-width: 0; flex: 1; }
.ps-row .txt b { display: block; font-size: 13.5px; font-weight: 700;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ps-row .txt small { font-size: 11.5px; color: var(--muted); }
.ps-badge {
  background: #ff3b57; color: #fff; font-size: 11px; font-weight: 800;
  border-radius: 999px; padding: 2px 8px; min-width: 22px; text-align: center;
  box-shadow: 0 4px 10px rgba(255, 59, 87, .35);
}
.ps-lock { color: #b9c0d8; font-size: 14px; }
.ps-tab {
  margin-top: auto; display: flex; justify-content: space-around;
  padding: 12px 8px 22px; border-top: 1px solid #eef0f7; color: #aab1c8;
  background: rgba(255, 255, 255, .72);
}
.ps-tab .on { color: #6c5ce7; }
.ps-tab div { font-size: 10px; text-align: center; font-weight: 600; }
.ps-tab .ico { font-size: 17px; display: block; }

/* floating chips over the phone */
.phone-badge {
  position: absolute; z-index: 5; display: flex; align-items: center; gap: 9px;
  background: #fff; color: #10142b; border-radius: 15px; padding: 10px 14px;
  font-size: 12.5px; font-weight: 700; white-space: nowrap;
  box-shadow: 0 20px 45px rgba(8, 12, 34, .28);
}
.phone-badge .dot { width: 9px; height: 9px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 4px rgba(34, 197, 94, .18); }
.phone-badge.badge-lock { left: -28px; bottom: 92px; }
.phone-badge.badge-cloud { right: -24px; top: 78px; }
.phone-glow {
  position: absolute; inset: -14% -20% -18%; z-index: -1; filter: blur(54px);
  background: radial-gradient(closest-side, rgba(108, 92, 231, .68), transparent 70%);
}

/* ---------- Sections ---------- */
section { padding: 84px 0; }
section[id] { scroll-margin-top: 80px; }
.section-soft { background: var(--soft); }
.section-head { max-width: 720px; margin: 0 auto 46px; text-align: center; }
.section-head .kicker {
  color: var(--brand); font-weight: 700; font-size: 14px; letter-spacing: 1.5px;
  text-transform: uppercase;
}
.section-head h2 {
  font-size: clamp(25px, 3vw, 36px); margin: 10px 0 12px; font-weight: 800; letter-spacing: -.4px;
}
.section-head p { color: var(--muted); font-size: 16.5px; margin: 0; }

/* feature split */
.split {
  display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center;
}
.split.rev .visual { order: -1; }
.checks { list-style: none; padding: 0; margin: 22px 0 0; display: grid; gap: 14px; }
.checks li { display: flex; gap: 12px; align-items: flex-start; color: #2b3050; }
.checks .cico {
  flex: 0 0 auto; width: 24px; height: 24px; border-radius: 8px;
  background: var(--grad-soft); color: var(--brand);
  display: grid; place-items: center; font-size: 13px; margin-top: 2px;
}
.checks b { display: block; font-size: 15.5px; }
.checks span { color: var(--muted); font-size: 14px; }

/* cards */
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px 24px; box-shadow: var(--shadow-sm);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: #dcdff2; }
.card .ico {
  width: 46px; height: 46px; border-radius: 13px; margin-bottom: 16px;
  background: var(--grad-soft); color: var(--brand);
  display: grid; place-items: center;
}
.card .ico svg { width: 24px; height: 24px; }
.card h3 { margin: 0 0 7px; font-size: 17px; font-weight: 700; }
.card p { margin: 0; color: var(--muted); font-size: 14.5px; }

/* security */
.security { color: #e8eaf6; background: linear-gradient(160deg, #0e1330, #171a3d 60%, #0e1330); }
.security .section-head h2 { color: #fff; }
.security .section-head p { color: #aab2d8; }
.security .section-head .kicker { color: #7fe3cf; }
.sec-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.sec-card {
  background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 18px; padding: 24px 20px;
}
.sec-card .ico {
  width: 42px; height: 42px; border-radius: 12px; margin-bottom: 14px;
  background: rgba(127, 227, 207, .14); color: #7fe3cf; display: grid; place-items: center;
}
.sec-card .ico svg { width: 22px; height: 22px; }
.sec-card h3 { margin: 0 0 6px; font-size: 16px; color: #fff; }
.sec-card p { margin: 0; color: #a7afd4; font-size: 14px; }
.sec-note {
  margin-top: 26px; text-align: center; color: #8d96c0; font-size: 13.5px;
}

/* steps */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; counter-reset: s; }
.step {
  position: relative; background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius); padding: 30px 24px 26px; box-shadow: var(--shadow-sm);
}
.step .num {
  counter-increment: s; width: 40px; height: 40px; border-radius: 50%;
  background: var(--grad); color: #fff; font-weight: 800; font-size: 17px;
  display: grid; place-items: center; margin-bottom: 16px;
}
.step .num::before { content: counter(s); }
.step h3 { margin: 0 0 7px; font-size: 17px; }
.step p { margin: 0; color: var(--muted); font-size: 14.5px; }

/* faq */
.faq { max-width: 820px; margin: 0 auto; }
.faq details {
  background: #fff; border: 1px solid var(--line); border-radius: 14px;
  padding: 4px 20px; margin-bottom: 12px; box-shadow: var(--shadow-sm);
}
.faq summary {
  cursor: pointer; list-style: none; padding: 16px 0; font-weight: 650; font-size: 16px;
  display: flex; justify-content: space-between; align-items: center; gap: 14px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--brand); font-size: 22px; font-weight: 400; }
.faq details[open] summary::after { content: "–"; }
.faq details p { margin: 0 0 16px; color: var(--muted); font-size: 14.8px; }

/* final cta */
.final { text-align: center; }
.final-card {
  background: radial-gradient(720px 320px at 50% -30%, #3a2f8f, transparent 65%), var(--grad);
  color: #fff; border-radius: 28px; padding: 64px 26px; box-shadow: var(--shadow-lg);
}
.final-card h2 { font-size: clamp(26px, 3.4vw, 38px); margin: 0 0 12px; font-weight: 800; }
.final-card p { color: rgba(255, 255, 255, .85); margin: 0 auto 28px; max-width: 520px; font-size: 16.5px; }
.final-card .btn-appstore { background: #fff; color: #000; }
.final-card .btn-appstore .as-text small { opacity: .6; }
.final-card .btn-appstore .as-text strong { color: #000; }

/* footer */
footer.site {
  background: #0c1022; color: #9aa2c8; padding: 54px 0 34px; font-size: 14px;
}
.foot-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; margin-bottom: 34px; }
.foot-brand { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 700; margin-bottom: 12px; }
.foot-brand img { width: 28px; height: 28px; border-radius: 7px; }
.foot-col h4 { color: #fff; font-size: 14px; margin: 0 0 12px; }
.foot-col a { display: block; color: #9aa2c8; padding: 5px 0; }
.foot-col a:hover { color: #fff; }
.foot-legal {
  border-top: 1px solid rgba(255, 255, 255, .1); padding-top: 22px;
  color: #6f779c; font-size: 12.5px; line-height: 1.7;
}

/* reveal (progressive enhancement: visible without JS) */
.reveal { transition: opacity .7s ease, transform .7s ease; }
html.js .reveal { opacity: 0; transform: translateY(22px); }
html.js .reveal.in { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 940px) {
  .hero-grid { grid-template-columns: 1fr; gap: 44px; }
  .phone-frame { transform: none; }
  .split { grid-template-columns: 1fr; gap: 30px; }
  .split.rev .visual { order: 0; }
  .grid { grid-template-columns: repeat(2, 1fr); }
  .sec-grid { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: 1fr; }
  .foot-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 620px) {
  section { padding: 60px 0; }
  .nav-links { display: none; }
  .grid, .sec-grid { grid-template-columns: 1fr; }
  .foot-grid { grid-template-columns: 1fr; }
  .hero { padding: 118px 0 70px; }
  .hero h1 { font-size: 30px; }
  .only-narrow { display: inline; }
  .phone-badge.badge-lock { left: -6px; }
  .phone-badge.badge-cloud { right: -6px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  html.js .reveal { opacity: 1; transform: none; transition: none; }
}
