/* ============================================================
   Tarsier — Secure Chat  ·  Landing page styles
   Mobile-first, responsive. Edit tokens in :root to retheme.
   ============================================================ */

:root {
  --bg: #ffffff;
  --bg-soft: #f5f6f8;
  --bg-elevated: #ffffff;
  --text: #1d1d1f;
  --text-soft: #515154;
  --text-muted: #86868b;
  --border: #e3e5e8;
  --primary: #0071e3;
  --primary-hover: #0077ed;
  --primary-contrast: #ffffff;
  --accent: #32c0f3;
  --success: #34c759;
  --radius: 14px;
  --radius-sm: 10px;
  --radius-pill: 980px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04), 0 2px 6px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
  --max-width: 1040px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display",
    "Segoe UI", Roboto, "Helvetica Neue", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

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

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 52px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 17px;
  color: var(--text);
}
.brand:hover { text-decoration: none; }
.brand-icon {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  object-fit: cover;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 26px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-links a {
  color: var(--text-soft);
  font-size: 14px;
  font-weight: 500;
}
.nav-links a:hover { color: var(--text); text-decoration: none; }
.nav-cta {
  display: inline-flex;
  align-items: center;
  padding: 7px 16px;
  background: var(--primary);
  color: var(--primary-contrast);
  border-radius: var(--radius-pill);
  font-size: 14px;
  font-weight: 500;
}
.nav-cta:hover { background: var(--primary-hover); text-decoration: none; }

/* ---------- Hero ---------- */
.hero {
  padding: 56px 0 48px;
  text-align: center;
}
.hero-icon {
  width: 112px;
  height: 112px;
  border-radius: 24px;
  margin: 0 auto 24px;
  box-shadow: var(--shadow-md);
}
.hero h1 {
  font-size: 40px;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 8px;
  font-weight: 700;
}
.hero .tagline {
  font-size: 19px;
  color: var(--text-soft);
  margin: 0 0 14px;
  font-weight: 500;
}
.hero .lead {
  max-width: 600px;
  margin: 0 auto 22px;
  color: var(--text-soft);
  font-size: 16px;
}
.hero-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 28px;
}
.hero-meta .dot { color: var(--border); }
.stars { color: #f5a623; letter-spacing: 2px; }
.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 34px;
  background: var(--primary);
  color: var(--primary-contrast);
  border-radius: var(--radius-pill);
  font-size: 16px;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}
.hero-cta:hover { background: var(--primary-hover); text-decoration: none; }

/* ---------- Section ---------- */
.section {
  padding: 56px 0;
  border-top: 1px solid var(--border);
}
.section-soft { background: var(--bg-soft); }
.section-head {
  text-align: center;
  margin-bottom: 36px;
}
.section-head h2 {
  font-size: 28px;
  letter-spacing: -0.01em;
  margin: 0 0 8px;
  font-weight: 700;
}
.section-head p {
  color: var(--text-muted);
  margin: 0;
  font-size: 15px;
}

/* ---------- Downloads ---------- */
.platform-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
.platform-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow-sm);
}
.platform-card-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.platform-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-soft);
  border-radius: var(--radius-sm);
  color: var(--text);
  flex-shrink: 0;
}
.platform-icon svg { width: 22px; height: 22px; }
.platform-card-head h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
}
.dl-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dl-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  transition: border-color 0.15s, background 0.15s, transform 0.05s;
}
.dl-btn:hover {
  border-color: var(--primary);
  background: rgba(0, 113, 227, 0.04);
  text-decoration: none;
}
.dl-btn:active { transform: translateY(1px); }
.dl-btn.primary {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--primary-contrast);
}
.dl-btn.primary:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
}

.dl-label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.dl-label svg.download-ico { width: 17px; height: 17px; opacity: 0.85; flex-shrink: 0; }

.region {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-soft);
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
  flex-shrink: 0;
}
.dl-btn.primary .region {
  color: var(--primary-contrast);
  background: rgba(255, 255, 255, 0.18);
}

/* ---------- Features ---------- */
.feature-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
.feature {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}
.feature .ico {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: rgba(0, 113, 227, 0.08);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}
.feature .ico svg { width: 22px; height: 22px; }
.feature h3 { margin: 0 0 6px; font-size: 17px; font-weight: 600; }
.feature p { margin: 0; color: var(--text-soft); font-size: 15px; }

/* ---------- About / description ---------- */
.about-body {
  max-width: 720px;
  margin: 0 auto;
  color: var(--text-soft);
  font-size: 16px;
}
.about-body p { margin: 0 0 16px; }
.about-body p:last-child { margin-bottom: 0; }

/* ---------- Screenshots ---------- */
.shots {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding: 6px 4px 18px;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x mandatory;
}
.shots::-webkit-scrollbar { height: 8px; }
.shots::-webkit-scrollbar-thumb { background: var(--border); border-radius: 8px; }
.shot {
  flex: 0 0 auto;
  width: 180px;
  scroll-snap-align: start;
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  background: var(--bg-soft);
}
.shot img { width: 100%; height: auto; }

/* ---------- What's New ---------- */
.whatsnew {
  max-width: 640px;
  margin: 0 auto;
  text-align: center;
}
.version-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  background: rgba(0, 113, 227, 0.08);
  color: var(--primary);
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 18px;
}
.whatsnew ul {
  list-style: none;
  margin: 0;
  padding: 0;
  text-align: left;
  display: inline-block;
}
.whatsnew li {
  position: relative;
  padding-left: 26px;
  margin-bottom: 10px;
  color: var(--text-soft);
}
.whatsnew li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 9px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 36px 0;
  color: var(--text-muted);
  font-size: 14px;
}
.footer-row {
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: center;
  text-align: center;
}
.footer-links {
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
  justify-content: center;
}
.footer-links a { color: var(--text-soft); }

/* ---------- Responsive ---------- */
/* Phones: collapse the nav to brand + Download; the anchor links reappear on larger screens. */
@media (max-width: 599px) {
  .nav-links { gap: 0; }
  .nav-links li:not(.nav-cta-li) { display: none; }
  .nav { height: 48px; }
}
@media (min-width: 600px) {
  .platform-grid { grid-template-columns: repeat(2, 1fr); }
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .hero h1 { font-size: 48px; }
  .hero .tagline { font-size: 21px; }
  .footer-row { flex-direction: row; justify-content: space-between; text-align: left; }
}
@media (min-width: 900px) {
  .platform-grid { grid-template-columns: repeat(3, 1fr); }
  .feature-grid { grid-template-columns: repeat(4, 1fr); }
  .hero { padding: 80px 0 64px; }
  .hero h1 { font-size: 56px; }
  .section { padding: 72px 0; }
  .section-head h2 { font-size: 32px; }
  .shot { width: 220px; }
}

/* ---------- Loading / error states ---------- */
.state {
  text-align: center;
  color: var(--text-muted);
  padding: 24px;
  font-size: 15px;
}
.state.error { color: #c00; }
