/* ─────────────────────────────────────────────────────────────
   Synapse — landing page styles
   Palette mirrors the desktop app (src/main/kotlin/com/synapse/ui/Theme.kt)
   ───────────────────────────────────────────────────────────── */

:root {
  --bg:           #0D1117;
  --surface:      #161B22;
  --elevated:     #1C2230;
  --border:       #30363D;
  --border-soft:  #21262D;

  --text:         #E6EDF3;
  --text-2:       #8B949E;
  --text-muted:   #484F58;

  --accent:       #818CF8;  /* indigo-400 */
  --accent-soft:  #1E2347;
  --accent-dim:   #3D4580;
  --teal:         #34D399;
  --rose:         #F87171;

  --get:          #22C55E;
  --post:         #3B82F6;

  --radius:       16px;
  --radius-sm:    10px;
  --maxw:         1120px;
  --ease:         cubic-bezier(.22, 1, .36, 1);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }

code, pre {
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

h1, h2, h3 { line-height: 1.15; letter-spacing: -0.02em; margin: 0; }

.grad {
  background: linear-gradient(120deg, var(--accent), var(--teal));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ───────────────────────── Nav ───────────────────────── */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px clamp(16px, 5vw, 40px);
  background: rgba(13, 17, 23, 0.72);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-soft);
}
.nav__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.02em;
}
.nav__links {
  display: flex;
  align-items: center;
  gap: 26px;
  font-size: 14px;
  color: var(--text-2);
}
.nav__links a { transition: color .2s var(--ease); }
.nav__links a:hover { color: var(--text); }
.nav__gh {
  padding: 7px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text) !important;
}
.nav__gh:hover { border-color: var(--accent-dim); background: var(--accent-soft); }

/* ───────────────────────── Hero ───────────────────────── */
.hero {
  position: relative;
  overflow: hidden;
  padding: clamp(56px, 10vw, 120px) clamp(16px, 5vw, 40px) clamp(40px, 7vw, 90px);
}
.hero__glow {
  position: absolute;
  inset: -30% -10% auto;
  height: 620px;
  background:
    radial-gradient(closest-side, rgba(129, 140, 248, .28), transparent 70%),
    radial-gradient(closest-side, rgba(52, 211, 153, .18), transparent 70%);
  background-position: 30% 0, 75% 20%;
  background-repeat: no-repeat;
  background-size: 60% 100%, 50% 90%;
  filter: blur(20px);
  pointer-events: none;
}
.hero__inner {
  position: relative;
  max-width: var(--maxw);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(28px, 5vw, 64px);
  align-items: center;
}
.pill {
  display: inline-block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--accent-dim);
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 22px;
}
.pill--teal { color: var(--teal); background: rgba(52,211,153,.1); border-color: rgba(52,211,153,.35); }

.hero h1 {
  font-size: clamp(34px, 5.4vw, 60px);
  font-weight: 800;
  margin-bottom: 20px;
}
.hero__lede {
  font-size: clamp(16px, 2.1vw, 19px);
  color: var(--text);
  max-width: 36ch;
  margin: 0 0 10px;
}
.hero__sub { color: var(--text-2); margin: 0 0 28px; font-weight: 500; }

.hero__cta { display: flex; gap: 14px; flex-wrap: wrap; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 15px;
  padding: 13px 24px;
  border-radius: var(--radius-sm);
  transition: transform .15s var(--ease), box-shadow .2s var(--ease), background .2s var(--ease);
  border: 1px solid transparent;
}
.btn--primary {
  background: linear-gradient(120deg, var(--accent), #6D78F0);
  color: #0D1117;
  box-shadow: 0 8px 28px rgba(129, 140, 248, .35);
}
.btn--primary:hover { transform: translateY(-2px); box-shadow: 0 12px 34px rgba(129,140,248,.45); }
.btn--ghost { border-color: var(--border); color: var(--text); background: var(--surface); }
.btn--ghost:hover { border-color: var(--accent-dim); background: var(--elevated); }

.hero__badges {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  padding: 0;
  margin: 30px 0 0;
  color: var(--text-2);
  font-size: 14px;
}

/* Code card */
.hero__art { display: flex; justify-content: center; }
.code-card {
  width: 100%;
  background: var(--elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 30px 70px rgba(0, 0, 0, .5);
  overflow: hidden;
}
.code-card__bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 12px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border-soft);
}
.code-card__bar span { width: 11px; height: 11px; border-radius: 50%; background: var(--border); }
.code-card__bar span:nth-child(1) { background: #ff5f56; }
.code-card__bar span:nth-child(2) { background: #ffbd2e; }
.code-card__bar span:nth-child(3) { background: #27c93f; }
.code-card__bar em {
  margin-left: auto;
  font-style: normal;
  font-size: 12px;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
}
.code-card pre {
  margin: 0;
  padding: 20px 22px;
  font-size: 13px;
  line-height: 1.7;
  color: var(--text);
  overflow-x: auto;
}
.t-key { color: var(--accent); }
.t-str { color: var(--teal); }
.t-com { color: var(--text-muted); font-style: italic; }
.m-get  { color: var(--get); font-weight: 600; }
.m-post { color: var(--post); font-weight: 600; }

/* ───────────────────────── Sections ───────────────────────── */
.section {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(56px, 9vw, 110px) clamp(16px, 5vw, 40px);
}
.section--alt { background: linear-gradient(180deg, transparent, rgba(28,34,48,.4), transparent); max-width: none; }
.section--alt > * { max-width: var(--maxw); margin-inline: auto; }
.section__head { text-align: center; max-width: 680px; margin: 0 auto 52px; }
.section__head h2 { font-size: clamp(26px, 3.6vw, 40px); font-weight: 800; margin-bottom: 14px; }
.section__head p { color: var(--text-2); font-size: 17px; margin: 0; }

/* Grids */
.grid { display: grid; gap: 20px; }
.grid--features { grid-template-columns: repeat(4, 1fr); }
.grid--three { grid-template-columns: repeat(3, 1fr); }

.card {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 26px 24px;
  transition: transform .2s var(--ease), border-color .2s var(--ease), background .2s var(--ease);
}
.card:hover { transform: translateY(-4px); border-color: var(--accent-dim); background: var(--elevated); }
.card__icon {
  width: 46px; height: 46px;
  display: grid; place-items: center;
  font-size: 22px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-dim);
  border-radius: 12px;
  margin-bottom: 16px;
}
.card h3 { font-size: 17px; margin-bottom: 8px; }
.card p { color: var(--text-2); font-size: 14.5px; margin: 0; }
.card code, .ticks code, .hero code, .how p code, .secrets code, .faq code {
  font-size: .88em;
  background: var(--elevated);
  border: 1px solid var(--border-soft);
  color: var(--accent);
  padding: 1px 6px;
  border-radius: 6px;
}
.card--compare h3 { color: var(--accent); margin-bottom: 6px; }

/* ───────────────────────── How it works ───────────────────────── */
.how { display: flex; flex-direction: column; gap: 18px; }
.how__step {
  display: grid;
  grid-template-columns: auto 1fr 1.1fr;
  gap: 22px;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 26px;
}
.how__num {
  width: 44px; height: 44px;
  display: grid; place-items: center;
  font-weight: 800; font-size: 18px;
  color: #0D1117;
  background: linear-gradient(120deg, var(--accent), var(--teal));
  border-radius: 12px;
}
.how__body h3 { font-size: 19px; margin-bottom: 6px; }
.how__body p { color: var(--text-2); font-size: 14.5px; margin: 0; }
.how__code {
  background: var(--bg);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  overflow: auto;
}
.how__code pre { margin: 0; padding: 16px 18px; font-size: 12.5px; line-height: 1.7; }

/* ───────────────────────── Secrets ───────────────────────── */
.section--secrets { max-width: none; background: linear-gradient(180deg, transparent, rgba(28,34,48,.35), transparent); }
.secrets {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(40px, 7vw, 80px) clamp(16px, 5vw, 40px);
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(28px, 5vw, 60px);
  align-items: center;
}
.secrets__copy h2 { font-size: clamp(24px, 3.4vw, 36px); font-weight: 800; margin: 16px 0 14px; }
.secrets__copy > p { color: var(--text-2); font-size: 16px; }
.ticks { list-style: none; padding: 0; margin: 22px 0 0; display: grid; gap: 12px; }
.ticks li { position: relative; padding-left: 30px; color: var(--text-2); font-size: 14.5px; }
.ticks li::before {
  content: "✓";
  position: absolute; left: 0; top: 0;
  width: 20px; height: 20px;
  display: grid; place-items: center;
  font-size: 12px; font-weight: 700;
  color: var(--teal);
  background: rgba(52, 211, 153, .12);
  border: 1px solid rgba(52, 211, 153, .35);
  border-radius: 6px;
}
.ticks li strong, .secrets__copy strong { color: var(--text); }
.secrets__note { color: var(--text-muted); font-size: 13px; margin-top: 14px; text-align: center; }

/* ───────────────────────── FAQ ───────────────────────── */
.faq { max-width: 820px; margin: 0 auto; display: grid; gap: 12px; }
.faq__item {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  padding: 4px 22px;
  transition: border-color .2s var(--ease);
}
.faq__item[open] { border-color: var(--accent-dim); background: var(--elevated); }
.faq__item summary {
  cursor: pointer;
  list-style: none;
  padding: 16px 0;
  font-weight: 600;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.faq__item summary::-webkit-details-marker { display: none; }
.faq__item summary::after {
  content: "+";
  font-size: 22px;
  color: var(--accent);
  font-weight: 400;
  transition: transform .2s var(--ease);
}
.faq__item[open] summary::after { transform: rotate(45deg); }
.faq__item p { color: var(--text-2); font-size: 15px; margin: 0 0 18px; }

/* ───────────────────────── Download ───────────────────────── */
.section--download { text-align: center; }
.downloads { margin-top: 8px; }
.dl {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 34px 24px;
  transition: transform .2s var(--ease), border-color .2s var(--ease), background .2s var(--ease);
}
.dl:hover { transform: translateY(-5px); border-color: var(--accent-dim); background: var(--elevated); }
.dl--primary { border-color: var(--accent); box-shadow: 0 14px 40px rgba(129,140,248,.25); }
.dl--primary::before {
  content: "Recommended for you";
  font-size: 11px; font-weight: 700; letter-spacing: .04em;
  color: var(--accent); text-transform: uppercase;
  margin-bottom: 4px;
}
.dl__icon { width: 54px; height: 54px; margin-bottom: 10px; color: var(--text); opacity: .92; }
.dl__icon svg { width: 100%; height: 100%; display: block; }
.dl h3 { font-size: 19px; }
.dl p { color: var(--text-2); font-size: 13.5px; margin: 0; }
.dl__btn {
  margin-top: 14px;
  padding: 9px 26px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 14px;
  color: #0D1117;
  background: linear-gradient(120deg, var(--accent), var(--teal));
}
.downloads__hint { color: var(--text-2); font-size: 14px; margin-top: 28px; }
.dl__alt { font-size: 12px; color: var(--text-muted); margin-top: 8px; }
.dl__alt a { color: var(--accent); text-decoration: underline; }
.downloads__hint a { color: var(--accent); }
.downloads__hint a:hover { text-decoration: underline; }

/* ───────────────────────── Footer ───────────────────────── */
.footer { border-top: 1px solid var(--border-soft); background: var(--surface); }
.footer__inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 40px clamp(16px, 5vw, 40px);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px 32px;
}
.footer__brand { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.footer__links { display: flex; flex-wrap: wrap; gap: 22px; color: var(--text-2); font-size: 14px; }
.footer__links a:hover { color: var(--text); }
.footer__copy { color: var(--text-muted); font-size: 13px; margin: 0 0 0 auto; }

/* ───────────────────────── Legal pages ───────────────────────── */
.legal {
  max-width: 780px;
  margin: 0 auto;
  padding: clamp(40px, 7vw, 80px) clamp(16px, 5vw, 40px);
}
.legal h1 { font-size: clamp(28px, 4vw, 40px); font-weight: 800; margin-bottom: 8px; }
.legal .legal__sub { color: var(--text-2); font-style: italic; margin: 0 0 28px; }
.legal h2 { font-size: 22px; font-weight: 700; margin: 36px 0 12px; }
.legal p { color: var(--text-2); }
.legal ul { color: var(--text-2); padding-left: 22px; }
.legal li { margin: 6px 0; }
.legal a { color: var(--accent); }
.legal a:hover { text-decoration: underline; }
.legal blockquote {
  margin: 18px 0;
  padding: 14px 18px;
  border-left: 3px solid var(--accent);
  background: var(--surface);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-2);
}
.legal strong { color: var(--text); }
.legal hr { border: none; border-top: 1px solid var(--border-soft); margin: 32px 0; }
.legal__back { display: inline-block; margin-bottom: 24px; color: var(--text-2); font-size: 14px; }
.legal__back:hover { color: var(--accent); }

/* ───────────────────────── Support Us ───────────────────────── */
.support { max-width: 640px; margin: 0 auto; text-align: center; }
.support > p { color: var(--text-2); font-size: 16px; margin: 0 0 26px; }
.support__btn { margin: 0 auto 28px; display: inline-flex; }
.support__list { list-style: none; padding: 0; text-align: left; max-width: 480px; margin: 0 auto; display: grid; gap: 10px; }
.support__list li { color: var(--text-2); font-size: 14.5px; }
.support__list strong { color: var(--text); }
.support__thanks { color: var(--text-muted); font-size: 14px; margin-top: 24px; }

/* ───────────────────────── Documentation page ───────────────────────── */
.doc { max-width: 920px; margin: 0 auto; padding: clamp(40px, 7vw, 80px) clamp(16px, 5vw, 40px); }
.doc__back { display: inline-block; margin-bottom: 24px; color: var(--text-2); font-size: 14px; }
.doc__back:hover { color: var(--accent); }
.doc h1 { font-size: clamp(28px, 4vw, 42px); font-weight: 800; margin-bottom: 8px; }
.doc__sub { color: var(--text-2); font-style: italic; margin: 0 0 28px; }
.doc h2 {
  font-size: 24px; font-weight: 700;
  margin: 44px 0 14px; padding-top: 22px;
  border-top: 1px solid var(--border-soft);
  scroll-margin-top: 80px;
}
.doc h3 { font-size: 18px; font-weight: 600; margin: 28px 0 10px; scroll-margin-top: 80px; }
.doc h4 { font-size: 15px; font-weight: 600; color: var(--text); margin: 20px 0 8px; }
.doc p { color: var(--text-2); }
.doc ul, .doc ol { color: var(--text-2); padding-left: 22px; }
.doc li { margin: 6px 0; }
.doc a { color: var(--accent); }
.doc a:hover { text-decoration: underline; }
.doc strong { color: var(--text); }
.doc code {
  font-size: .88em;
  background: var(--elevated);
  border: 1px solid var(--border-soft);
  color: var(--accent);
  padding: 1px 6px;
  border-radius: 6px;
  font-family: 'JetBrains Mono', monospace;
}
.doc pre {
  background: var(--bg);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  overflow-x: auto;
  margin: 14px 0;
}
.doc pre code {
  background: none; border: none; color: var(--text);
  padding: 0; font-size: 12.5px; line-height: 1.7; display: block;
}
.doc blockquote {
  margin: 18px 0;
  padding: 14px 18px;
  border-left: 3px solid var(--accent);
  background: var(--surface);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-2);
}
.doc table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 13.5px;
  display: block;
  overflow-x: auto;
}
.doc th, .doc td {
  border: 1px solid var(--border-soft);
  padding: 8px 12px;
  text-align: left;
  vertical-align: top;
  color: var(--text-2);
}
.doc th { background: var(--elevated); color: var(--text); font-weight: 600; white-space: nowrap; }
.doc__toc {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 18px 30px;
  margin: 0 0 28px;
}
.doc__toc ol { margin: 0; color: var(--text); }
.doc__toc a { color: var(--text); }
.doc__toc a:hover { color: var(--accent); }
.doc hr { border: none; border-top: 1px solid var(--border-soft); margin: 32px 0; }

/* ───────────────────────── Responsive ───────────────────────── */
@media (max-width: 980px) {
  .grid--features { grid-template-columns: repeat(2, 1fr); }
  .hero__inner, .secrets { grid-template-columns: 1fr; }
  .hero__art { order: -1; }
  .how__step { grid-template-columns: auto 1fr; }
  .how__code { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  .nav__links a:not(.nav__gh) { display: none; }
  .grid--features, .grid--three { grid-template-columns: 1fr; }
  .footer__copy { margin: 0; width: 100%; }
}

