/* Chameleon website: one stylesheet for the intro page and the documentation. */
:root {
  --bg: #fbfaf7;
  --surface: #ffffff;
  --text: #1d1f22;
  --muted: #5f646b;
  --border: #e3e1dc;
  --accent: #2f6b4f;
  --accent-soft: #e6f0ea;
  --code-bg: #f2f1ec;
  --radius: 10px;
  --max: 1080px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141517;
    --surface: #1c1e21;
    --text: #e8e6e1;
    --muted: #a3a7ad;
    --border: #2d3035;
    --accent: #7cc4a0;
    --accent-soft: #1f3129;
    --code-bg: #24272b;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.7 -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
}

a { color: var(--accent); }

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

/* Header */
.site-header { border-bottom: 1px solid var(--border); background: var(--surface); }
.site-header .wrap { display: flex; align-items: center; gap: 24px; height: 60px; }
.brand { font-weight: 700; font-size: 18px; color: var(--text); text-decoration: none; letter-spacing: 0.2px; }
.brand span { color: var(--accent); }
.nav { display: flex; align-items: center; gap: 20px; margin-left: auto; flex-wrap: wrap; }
.nav a { color: var(--muted); text-decoration: none; font-size: 15px; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--text); }
.nav a.button { color: #fff; }

.button {
  display: inline-block;
  padding: 9px 18px;
  border-radius: var(--radius);
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  font-weight: 600;
}
@media (prefers-color-scheme: dark) { .button, .nav a.button { color: #10241a; } }
.button.secondary { background: transparent; color: var(--text); border: 1px solid var(--border); }

/* Intro page */
.hero { padding: 72px 0 48px; }
.hero h1 { font-size: 40px; line-height: 1.25; margin: 0 0 16px; }
.hero p { font-size: 18px; color: var(--muted); max-width: 640px; margin: 0 0 28px; }
.hero .actions { display: flex; gap: 12px; flex-wrap: wrap; }

.section { padding: 40px 0; }
.section h2 { font-size: 24px; margin: 0 0 20px; }

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.card h3 { margin: 0 0 8px; font-size: 17px; }
.card p { margin: 0; color: var(--muted); font-size: 15px; }

.steps { counter-reset: step; list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.steps li { counter-increment: step; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px 14px 56px; position: relative; }
.steps li::before {
  content: counter(step);
  position: absolute; left: 16px; top: 14px;
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent);
  display: grid; place-items: center; font-weight: 700; font-size: 14px;
}

.site-footer { border-top: 1px solid var(--border); margin-top: 48px; padding: 24px 0; color: var(--muted); font-size: 14px; }

/* Documentation */
.docs { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 40px; padding: 32px 0; }
.docs-nav { position: sticky; top: 16px; align-self: start; }
.docs-nav h2 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.6px; color: var(--muted); margin: 0 0 8px; }
.docs-nav ul { list-style: none; margin: 0; padding: 0; }
.docs-nav a { display: block; padding: 6px 10px; border-radius: 8px; color: var(--muted); text-decoration: none; }
.docs-nav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); font-weight: 600; }

.doc { min-width: 0; }
.doc h1 { font-size: 30px; line-height: 1.3; margin: 0 0 16px; }
.doc h2 { font-size: 22px; margin: 36px 0 12px; padding-top: 8px; border-top: 1px solid var(--border); }
.doc h3 { font-size: 18px; margin: 24px 0 8px; }
.doc code { background: var(--code-bg); padding: 1px 6px; border-radius: 6px; font-size: 0.92em; }
.doc pre { background: var(--code-bg); padding: 14px 16px; border-radius: var(--radius); overflow-x: auto; }
.doc pre code { background: none; padding: 0; }
.doc table { border-collapse: collapse; width: 100%; display: block; overflow-x: auto; }
.doc th, .doc td { border: 1px solid var(--border); padding: 8px 10px; text-align: left; vertical-align: top; }
.doc blockquote { margin: 16px 0; padding: 10px 16px; border-left: 4px solid var(--accent); background: var(--accent-soft); border-radius: 0 var(--radius) var(--radius) 0; }
.doc blockquote p { margin: 4px 0; }
.doc img { max-width: 100%; }
.doc .missing { color: var(--muted); }

@media (max-width: 760px) {
  .site-header .wrap { height: auto; min-height: 56px; gap: 12px; }
  /* The hero repeats the sign-up button, so the header keeps only text links. */
  .nav a.button { display: none; }
  .hero h1 { font-size: 30px; }
  .docs { grid-template-columns: 1fr; gap: 16px; }
  .docs-nav { position: static; }
  .nav { gap: 14px; }
}
