:root {
  --bg: #ffffff;
  --bg-alt: #f6f6fb;
  --ink: #1a1a2e;
  --muted: #5b6172;
  --border: #e6e6ef;
  --accent: #6459e6;
  --accent-ink: #4b41c9;

  /* code panel */
  --code-bg: #1b1b2b;
  --code-ink: #e4e4f0;
  --code-dim: #9d9dc0;
  --code-kw: #c3a6ff;
  --code-str: #8fe1a2;
  --code-fn: #7cc7ff;
  --code-dir: #ffcf7a;

  --radius: 12px;
  --maxw: 1080px;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

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

code { font-family: var(--mono); font-size: 0.92em; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background:
    repeating-linear-gradient(0deg, var(--accent) 0 2px, transparent 2px 7px),
    repeating-linear-gradient(90deg, var(--accent) 0 2px, transparent 2px 7px),
    var(--accent);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}

/* ---- hero ---- */
.hero {
  padding: 88px 0 76px;
  text-align: center;
  background:
    radial-gradient(60% 60% at 50% 0%, rgba(100, 89, 230, 0.10), transparent 70%),
    linear-gradient(var(--bg), var(--bg));
  border-bottom: 1px solid var(--border);
}
.hero-top {
  padding-bottom: 30px;
  margin-bottom: 44px;
  border-bottom: 1px solid var(--border);
}
.hero-brand {
  display: inline-flex;
  align-items: center;
  gap: 13px;
  font-weight: 700;
  font-size: 1.95rem;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin: 0 auto 20px;
  max-width: 16ch;
}
.accent { color: var(--accent); }
.lede {
  max-width: 62ch;
  margin: 0 auto 30px;
  font-size: 1.12rem;
  color: var(--muted);
}
.cta-row {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 34px;
}
.btn {
  display: inline-flex;
  align-items: center;
  padding: 11px 22px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.98rem;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-ink); }
.btn-ghost { border: 1px solid var(--border); color: var(--ink); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent-ink); }

.install-pill {
  display: inline-flex;
  align-items: center;
  gap: 18px;
  max-width: 100%;
  overflow-x: auto;
  padding: 12px 16px 12px 18px;
  border-radius: 10px;
  background: var(--code-bg);
  color: var(--code-ink);
  border: 1px solid #2a2a40;
  font: inherit;
  cursor: pointer;
}
.install-pill code { font-family: var(--mono); font-size: 0.95rem; white-space: nowrap; }
.install-pill code::before { content: "$ "; color: var(--code-dim); }
.copy-btn { display: inline-flex; color: var(--code-dim); transition: color 0.15s ease; }
.install-pill:hover .copy-btn { color: var(--code-ink); }
.icon-check { display: none; }
.install-pill.copied .copy-btn { color: var(--code-str); }
.install-pill.copied .icon-copy { display: none; }
.install-pill.copied .icon-check { display: inline-flex; }

/* ---- sections ---- */
.section { padding: 78px 0; }
.section-alt { background: var(--bg-alt); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section h2 {
  font-size: clamp(1.6rem, 3.2vw, 2.1rem);
  letter-spacing: -0.02em;
  margin: 0 0 12px;
  text-align: center;
}
.section-sub {
  max-width: 58ch;
  margin: 0 auto 40px;
  text-align: center;
  color: var(--muted);
  font-size: 1.05rem;
}
.section-sub code {
  background: rgba(100, 89, 230, 0.10);
  color: var(--accent-ink);
  padding: 1px 6px;
  border-radius: 5px;
}

/* ---- code cards ---- */
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
  align-items: stretch;
}
.code-card {
  display: flex;
  flex-direction: column;
  margin: 0;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--code-bg);
  border: 1px solid #2a2a40;
  box-shadow: 0 12px 34px rgba(26, 26, 46, 0.14);
}
.code-card pre { flex: 1; }
.code-card figcaption {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--code-dim);
  padding: 11px 16px;
  border-bottom: 1px solid #2a2a40;
  background: #16161f;
}
.code-card pre {
  margin: 0;
  padding: 18px 16px;
  overflow-x: auto;
}

/* hide horizontal scrollbars on code panels */
.code-card pre,
.install-pill,
.step-code {
  scrollbar-width: none;
}
.code-card pre::-webkit-scrollbar,
.install-pill::-webkit-scrollbar,
.step-code::-webkit-scrollbar {
  display: none;
}
.code-card code {
  font-family: var(--mono);
  font-size: 0.85rem;
  line-height: 1.65;
  color: var(--code-ink);
  white-space: pre;
}

/* token colors */
.kw { color: var(--code-kw); }
.str { color: var(--code-str); }
.fn { color: var(--code-fn); }
.cm { color: var(--code-dim); font-style: italic; }
.dir { color: var(--code-dir); font-weight: 600; }

/* ---- install steps ---- */
.install-section { max-width: 720px; }
.steps {
  list-style: none;
  counter-reset: step;
  margin: 0;
  padding: 0;
}
.steps li {
  counter-increment: step;
  position: relative;
  padding: 0 0 26px 52px;
}
.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
}
.steps li:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 17px;
  top: 38px;
  bottom: 4px;
  width: 2px;
  background: var(--border);
}
.step-label {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
}
.step-code {
  margin: 0;
  padding: 14px 16px;
  border-radius: 10px;
  background: var(--code-bg);
  color: var(--code-ink);
  overflow-x: auto;
}
.step-code code { font-family: var(--mono); font-size: 0.86rem; line-height: 1.7; white-space: pre; }

/* ---- footer ---- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 30px 0;
  background: var(--bg-alt);
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  color: var(--muted);
  font-size: 0.9rem;
}
.footer-inner a { color: var(--muted); }

/* ---- responsive ---- */
@media (max-width: 860px) {
  .split { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .hero { padding: 64px 0 52px; }
  .section { padding: 56px 0; }
  .install-pill { align-items: flex-start; }
  .install-pill code { white-space: normal; overflow-wrap: anywhere; text-align: left; }
}
