:root {
  /* Zinc palette — matches the app */
  --bg-primary: #0a0a0a;
  --bg-secondary: #18181b;
  --bg-tertiary: #27272a;
  --text-primary: #fafafa;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;
  --border-color: #3f3f46;

  /* Accents — from the app icon + chat panel */
  --accent-green: #22c55e;
  --accent-green-hover: #16a34a;
  --accent-purple: #a855f7;
  --accent-blue: #3b82f6;
  --accent-red: #f87171;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
}

main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 20px 64px;
}

/* --- Sticky top nav --- */

.topnav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 20px;
  background: rgba(10, 10, 10, 0.78);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border-color);
}

.topnav-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text-primary);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.01em;
}

.topnav-brand:hover { text-decoration: none; opacity: 0.9; }

.topnav-brand img {
  width: 26px;
  height: 26px;
  border-radius: 6px;
}

.topnav-links {
  display: flex;
  align-items: center;
  gap: 6px;
}

.topnav-links a {
  padding: 7px 12px;
  border-radius: 6px;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  transition: color 0.15s, background 0.15s;
}

.topnav-links a:hover {
  color: var(--text-primary);
  background: var(--bg-tertiary);
  text-decoration: none;
}

.topnav-install {
  background: var(--accent-green);
  color: #052e14 !important;
  font-weight: 600 !important;
  padding: 7px 14px !important;
}

.topnav-install:hover {
  background: var(--accent-green-hover) !important;
  color: #052e14 !important;
}

html { scroll-padding-top: 64px; }

@media (max-width: 560px) {
  .topnav { padding: 8px 12px; gap: 8px; }
  .topnav-brand span { display: none; }
  .topnav-links { gap: 2px; }
  .topnav-links a { padding: 6px 9px; font-size: 12px; }
  .topnav-github { display: none; }
}

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

a:hover { text-decoration: underline; }

/* --- Hero --- */

.hero {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  padding: 40px 32px;
  background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  margin-bottom: 40px;
}

.hero-logo {
  flex-shrink: 0;
  width: 96px;
  height: 96px;
  border-radius: 20px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.hero-body { flex: 1; min-width: 0; }

.hero-title {
  font-size: 42px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 10px;
  background: linear-gradient(135deg, var(--accent-green) 0%, #4ade80 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

.hero-tagline {
  font-size: 17px;
  color: var(--text-secondary);
  margin: 0 0 24px;
  line-height: 1.5;
  max-width: 640px;
}

.hero-tagline em {
  color: var(--accent-purple);
  font-style: normal;
  font-weight: 500;
}

.nav-links { display: flex; gap: 10px; flex-wrap: wrap; }

.nav-links a {
  display: inline-flex;
  align-items: center;
  padding: 10px 18px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 500;
  transition: background 0.15s, border-color 0.15s, transform 0.05s;
}

.nav-links a:hover {
  background: #3f3f46;
  border-color: var(--text-muted);
  text-decoration: none;
}

.nav-links a:active { transform: translateY(1px); }

.nav-links a.primary {
  background: var(--accent-green);
  color: #052e14;
  border-color: var(--accent-green);
  font-weight: 600;
}

.nav-links a.primary:hover {
  background: var(--accent-green-hover);
  border-color: var(--accent-green-hover);
}

/* --- Sections --- */

section { margin-bottom: 48px; }

section#intro { margin-top: -12px; }

section#intro p {
  font-size: 16px;
  color: var(--text-secondary);
  margin: 0 0 14px;
}

section#intro strong {
  color: var(--text-primary);
  font-weight: 600;
}

h2 {
  font-size: 24px;
  font-weight: 700;
  margin: 0 0 20px;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 20px 0 10px;
}

p, li { line-height: 1.65; }

/* --- Comparison table --- */

.comparison {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow: hidden;
}

.comparison table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.comparison th, .comparison td {
  padding: 12px 16px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--border-color);
}

.comparison th {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--bg-tertiary);
}

.comparison tr:last-child td { border-bottom: none; }

.comparison td:first-child { color: var(--text-secondary); }

.yes { color: var(--accent-green); font-weight: 500; }
.no { color: var(--text-muted); }

/* --- Features grid --- */

.features-subhead {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  font-weight: 600;
  margin: 32px 0 12px;
}

.features-subhead:first-child { margin-top: 0; }

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

.feature {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 18px 20px;
  transition: border-color 0.15s, transform 0.15s;
}

.feature:hover {
  border-color: var(--text-muted);
  transform: translateY(-1px);
}

.feature h3 {
  margin: 0 0 6px;
  font-size: 15px;
  color: var(--text-primary);
}

.feature p {
  margin: 0;
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.55;
}

/* --- Install steps --- */

.step {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 20px 24px;
  margin-bottom: 16px;
  position: relative;
  padding-left: 68px;
}

.step::before {
  content: attr(data-step);
  position: absolute;
  left: 20px;
  top: 20px;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-green);
  color: #052e14;
  border-radius: 50%;
  font-weight: 700;
  font-size: 14px;
}

.step h3 {
  margin: 0 0 8px;
  font-size: 17px;
  font-weight: 600;
}

.step p {
  margin: 8px 0 0;
  color: var(--text-secondary);
  font-size: 14px;
}

.note {
  background: rgba(168, 85, 247, 0.08);
  border: 1px solid rgba(168, 85, 247, 0.3);
  border-radius: 10px;
  padding: 14px 18px;
  margin: 20px 0;
  font-size: 14px;
  color: var(--text-secondary);
}

.note strong { color: var(--accent-purple); }

/* --- Code --- */

pre {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 14px 16px;
  overflow-x: auto;
  font-size: 13px;
  line-height: 1.55;
  margin: 12px 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

code {
  background: var(--bg-tertiary);
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 13px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

pre code {
  background: transparent;
  padding: 0;
  font-size: 13px;
}

/* --- Screenshots --- */

.screenshot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

.screenshot-grid.mobile {
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

.shot {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow: hidden;
  margin: 0;
  transition: border-color 0.15s, transform 0.15s;
}

.shot:hover {
  border-color: var(--text-muted);
  transform: translateY(-2px);
}

.shot a { display: block; }

.shot img {
  display: block;
  width: 100%;
  height: auto;
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-color);
}

.shot figcaption {
  padding: 10px 16px;
  font-size: 13px;
  color: var(--text-secondary);
}

/* --- Links list --- */

.doc-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 8px;
}

.doc-links li {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 14px;
}

.doc-links a {
  color: var(--text-primary);
  font-weight: 500;
}

.doc-links .desc {
  display: block;
  color: var(--text-muted);
  font-size: 12px;
  margin-top: 2px;
}

/* --- Footer --- */

footer {
  margin-top: 56px;
  padding-top: 20px;
  border-top: 1px solid var(--border-color);
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
}

footer a { color: var(--text-secondary); }

/* --- Version chip --- */

.version-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 18px;
  padding: 5px 12px;
  background: rgba(34, 197, 94, 0.08);
  border: 1px solid rgba(34, 197, 94, 0.35);
  border-radius: 999px;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.01em;
  font-variant-numeric: tabular-nums;
  transition: background 0.15s, border-color 0.15s;
}

.version-chip:hover {
  background: rgba(34, 197, 94, 0.14);
  border-color: var(--accent-green);
  text-decoration: none;
  color: var(--text-primary);
}

.version-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-green);
  box-shadow: 0 0 6px rgba(34, 197, 94, 0.8);
}

/* --- Section lede (used under section titles) --- */

.section-lede {
  color: var(--text-secondary);
  font-size: 15px;
  margin: -8px 0 20px;
  max-width: 720px;
}

/* --- Requirements callout --- */

.requirements {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-left: 3px solid var(--accent-green);
  border-radius: 8px;
  padding: 12px 16px;
  margin: 0 0 20px;
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.55;
}

.requirements strong { color: var(--text-primary); }

/* --- Ask Familiar prompt grid --- */

.prompt-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 12px;
}

.prompt {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 16px 18px;
  transition: border-color 0.15s, transform 0.15s;
}

.prompt:hover {
  border-color: var(--accent-purple);
  transform: translateY(-1px);
}

.prompt-text {
  margin: 0 0 8px;
  font-size: 15px;
  color: var(--text-primary);
  font-weight: 500;
  font-style: italic;
}

.prompt-text::before {
  content: "→ ";
  color: var(--accent-purple);
  font-style: normal;
  font-weight: 700;
  margin-right: 2px;
}

.prompt-map {
  display: block;
  margin: 0;
  padding: 6px 10px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  color: var(--text-muted);
  font-size: 12px;
  overflow-x: auto;
  white-space: nowrap;
}

/* --- Install alt details --- */

.install-alt {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 14px 18px;
  margin: 12px 0;
}

.install-alt summary {
  cursor: pointer;
  color: var(--text-primary);
  font-weight: 500;
  font-size: 14px;
  list-style: none;
  position: relative;
  padding-left: 22px;
}

.install-alt summary::-webkit-details-marker { display: none; }

.install-alt summary::before {
  content: "+";
  position: absolute;
  left: 0;
  top: -1px;
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-green);
  font-weight: 700;
  font-size: 16px;
  transition: transform 0.15s;
}

.install-alt[open] summary::before { transform: rotate(45deg); }

.install-alt p { margin: 10px 0 0; color: var(--text-secondary); font-size: 14px; }

.install-alt pre { margin-top: 10px; }

/* --- Remote access --- */

.remote-panel {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-left: 3px solid var(--accent-green);
  border-radius: 12px;
  padding: 20px 24px;
  margin: 16px 0 20px;
}

.remote-panel h3 {
  margin: 0 0 10px;
  font-size: 17px;
  color: var(--text-primary);
}

.remote-panel p {
  margin: 10px 0;
  color: var(--text-secondary);
  font-size: 14px;
}

.remote-panel p:first-of-type { margin-top: 0; }

.remote-why {
  background: rgba(168, 85, 247, 0.06);
  border: 1px solid rgba(168, 85, 247, 0.24);
  border-radius: 8px;
  padding: 10px 14px;
  margin: 14px 0 !important;
  font-size: 13px !important;
}

.remote-why strong { color: var(--accent-purple); }

.remote-alts ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 8px;
}

.remote-alts li {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.remote-alts li strong { color: var(--text-primary); }

/* --- FAQ --- */

.faq { display: grid; gap: 8px; }

.faq details {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 14px 18px;
  transition: border-color 0.15s;
}

.faq details[open] { border-color: var(--text-muted); }

.faq summary {
  cursor: pointer;
  color: var(--text-primary);
  font-weight: 500;
  font-size: 15px;
  list-style: none;
  position: relative;
  padding-left: 26px;
}

.faq summary::-webkit-details-marker { display: none; }

.faq summary::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 7px;
  width: 6px;
  height: 6px;
  border-right: 2px solid var(--accent-green);
  border-bottom: 2px solid var(--accent-green);
  transform: rotate(-45deg);
  transition: transform 0.15s;
}

.faq details[open] summary::before { transform: rotate(45deg); top: 5px; }

.faq p {
  margin: 10px 0 0;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.6;
}

/* --- Responsive --- */

@media (max-width: 700px) {
  main { padding: 20px 16px 48px; }

  .hero {
    flex-direction: column;
    padding: 28px 22px;
    gap: 18px;
  }

  .hero-logo { width: 72px; height: 72px; border-radius: 16px; }
  .hero-title { font-size: 34px; }
  .hero-tagline { font-size: 15px; }

  .step { padding-left: 60px; padding-right: 20px; }
  .step::before { left: 16px; width: 28px; height: 28px; font-size: 13px; }

  .remote-panel { padding: 16px 18px; }

  h2 { font-size: 20px; }
}
