/* pigo site — shared styles, MiMo Code-inspired (warm light default + dark variant)
 * zero-build static site. Used by docs/index.html and docs/web/*.html */

@import url('https://fonts.googleapis.cn/css2?family=Inter:ital,opsz,wght@0,14..32,400;0,14..32,500;0,14..32,600;0,14..32,700;1,14..32,400&family=Newsreader:ital,opsz,wght@0,6..72,400;0,6..72,500;0,6..72,600;1,6..72,400&display=swap');
@import url('https://cdn.jsdelivr.net/gh/satouriko/LxgwWenKai_Webfonts@v1.101/dist/LXGWWenKai-Regular.css');
@import url('https://cdn.jsdelivr.net/gh/satouriko/LxgwWenKai_Webfonts@v1.101/dist/LXGWWenKai-Bold.css');

:root {
  --bg: #fcfaf8;
  --bg-elev: #f3f0ef;
  --bg-card: #ffffff;
  --border: #e7e2dd;
  --text: #26251e;
  --text-dim: #504f49;
  --text-faint: #8a857c;
  --accent: #c15f3c;        /* warm terracotta */
  --accent-2: #26251e;      /* near-black, used for primary CTA */
  --accent-soft: rgba(193, 95, 60, .10);
  --code-bg: #2b2a24;       /* dark warm terminal panel */
  --code-text: #ede9e1;
  --code-prompt: #d9a066;
  --radius: 16px;
  --radius-pill: 46px;
  --maxw: 1120px;
  --font: "Inter", "LXGWWenKai", "PingFang SC", -apple-system, BlinkMacSystemFont, system-ui, "Segoe UI",
          Roboto, "Hiragino Sans GB", "Microsoft YaHei", Helvetica, Arial, sans-serif;
  --font-display: "Newsreader", "LXGWWenKai", Georgia, "Times New Roman",
          "PingFang SC", serif;
  --mono: "SF Mono", "JetBrains Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

html[data-theme="dark"] {
  --bg: #17150f;
  --bg-elev: #201d16;
  --bg-card: #211e17;
  --border: #35301f;
  --text: #f2ede2;
  --text-dim: #b8b0a1;
  --text-faint: #857e70;
  --accent: #e08a5f;
  --accent-2: #f2ede2;
  --accent-soft: rgba(224, 138, 95, .14);
  --code-bg: #100e0a;
  --code-text: #e6ddcd;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

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

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

h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.22; font-weight: 500; letter-spacing: normal; }

img { max-width: 100%; }

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

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

/* ---------- top navigation ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: saturate(150%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: var(--maxw); margin: 0 auto; padding: 14px 24px;
  display: flex; align-items: center; gap: 20px;
}
.nav-brand { display: flex; align-items: center; gap: 9px; font-family: var(--font-display); font-weight: 600; font-size: 21px; color: var(--text); }
.nav-brand:hover { text-decoration: none; }
.nav-logo {
  width: 30px; height: 30px; border-radius: 9px;
  background: var(--accent-2); color: var(--bg);
  display: grid; place-items: center; font-family: var(--font-display); font-weight: 400; font-size: 17px;
}
.nav-links { display: flex; gap: 20px; margin-left: auto; align-items: center; }
.nav-links a { color: var(--text-dim); font-size: 15px; font-weight: 500; }
.nav-links a:hover { color: var(--text); text-decoration: none; }
.nav-btn {
  border: 1px solid var(--border); background: transparent; color: var(--text-dim);
  border-radius: var(--radius-pill); padding: 7px 14px; font-size: 13px; cursor: pointer; font-family: var(--font);
  transition: background .15s, color .15s, border-color .15s;
}
.nav-btn:hover { color: var(--text); border-color: var(--text-faint); background: var(--bg-elev); }

/* ---------- buttons (pill) ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 26px; border-radius: var(--radius-pill); font-weight: 500; font-size: 15px;
  cursor: pointer; border: 1px solid transparent; transition: transform .08s ease, opacity .15s, background .15s;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: var(--accent-2); color: var(--bg); border-color: var(--accent-2); }
.btn-primary:hover { opacity: .9; }
.btn-ghost { background: var(--bg-card); color: var(--text); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--text-faint); }

/* ---------- code blocks ---------- */
pre {
  background: var(--code-bg); border: 1px solid transparent;
  border-radius: 12px; padding: 16px 18px; overflow-x: auto; margin: 14px 0;
}
pre code { color: var(--code-text); font-size: 13.5px; line-height: 1.7; }
:not(pre) > code {
  background: var(--accent-soft); color: var(--accent);
  padding: 2px 6px; border-radius: 6px;
}
.copy-wrap { position: relative; }
.copy-btn {
  position: absolute; top: 8px; right: 8px;
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.18); color: #d8d2c6;
  border-radius: var(--radius-pill); padding: 4px 12px; font-size: 12px; cursor: pointer; opacity: 0; transition: opacity .15s;
  font-family: var(--font);
}
.copy-wrap:hover .copy-btn { opacity: 1; }
.copy-btn:hover { color: #fff; border-color: rgba(255,255,255,.4); }

/* ---------- hero ---------- */
.hero { padding: 96px 0 68px; text-align: center; position: relative; }
.hero-badge {
  display: inline-block; padding: 6px 16px; border-radius: var(--radius-pill);
  border: 1px solid var(--border); background: var(--bg-card);
  color: var(--text-dim); font-size: 13px; margin-bottom: 24px;
}
.hero h1 { font-size: clamp(42px, 6.4vw, 72px); margin: 0 0 20px; letter-spacing: -.01em; }
.hero h1 .grad { color: var(--accent); }
.hero p.lead { font-size: clamp(17px, 2.4vw, 21px); color: var(--text-dim); max-width: 860px; margin: 0 auto 34px; }
.hero-cta { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-bottom: 36px; }
.hero-cmd {
  display: inline-flex; align-items: center; gap: 12px; max-width: min(940px, 100%); margin: 0 auto;
  background: var(--code-bg); border: 1px solid transparent; border-radius: 12px;
  padding: 13px 18px; font-family: var(--mono); font-size: 13.5px; color: var(--code-text); text-align: left;
  white-space: nowrap; overflow-x: auto;
}
.hero-cmd > span:not(.prompt) { flex: 1 1 auto; }
.hero-cmd .prompt { color: var(--code-prompt); user-select: none; flex: none; }
.hero-cmd .copy-btn { position: static; opacity: 1; margin-left: auto; flex: none; }

/* ---------- screenshot showcase ---------- */
.shot {
  border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--border); background: var(--code-bg);
  box-shadow: 0 24px 60px -28px rgba(38,37,30,.42);
}
.shot img { display: block; width: 100%; height: auto; }
.hero-shot { max-width: 960px; margin: 52px auto 0; }
.shot-caption { text-align: center; color: var(--text-faint); font-size: 13px; margin-top: 12px; }

/* ---------- feature icons ---------- */
.feature-icon {
  width: 38px; height: 38px; border-radius: 11px; display: inline-grid; place-items: center;
  vertical-align: middle; background: var(--accent-soft); color: var(--accent); margin: 0 12px 0 0;
}
.feature-text .tag { vertical-align: middle; }
.feature-icon svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.doc-shot { margin: 20px 0 24px; }

/* ---------- diagrams (light SVG figures) ---------- */
.diagram { background: #ffffff; border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; margin: 22px 0 26px; }
.diagram img, .diagram svg { display: block; width: 100%; height: auto; }
.diagram figcaption { text-align: center; color: var(--text-faint); font-size: 13px; margin-top: 12px; }

/* ---------- feature alternating sections ---------- */
.features { padding: 40px 0; }
.feature-row {
  display: grid; grid-template-columns: 1fr 1fr; gap: 52px; align-items: center;
  padding: 48px 0; border-top: 1px solid var(--border);
}
.feature-row:first-child { border-top: none; }
.feature-row.reverse .feature-media { order: -1; }
.feature-text h2 { font-size: clamp(26px, 3vw, 34px); margin: 0 0 14px; }
.feature-text p { color: var(--text-dim); font-size: 16.5px; margin: 0 0 14px; }
.feature-text .tag { color: var(--accent); font-weight: 600; font-size: 13px; letter-spacing: .06em; text-transform: uppercase; }
.feature-media {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px; min-height: 210px; display: flex; flex-direction: column; justify-content: center;
  box-shadow: 0 1px 3px rgba(38,37,30,.04);
}
.feature-media pre { margin: 0; }
.section-head { text-align: center; max-width: 720px; margin: 0 auto 10px; padding-top: 34px; }
.section-head h2 { font-size: clamp(28px, 3.4vw, 40px); margin: 0 0 12px; }
.section-head p { color: var(--text-dim); font-size: 17px; }

/* ---------- footer ---------- */
.footer { border-top: 1px solid var(--border); padding: 44px 0; margin-top: 64px; color: var(--text-faint); }
.footer-inner { display: flex; flex-wrap: wrap; gap: 20px; justify-content: space-between; align-items: center; }
.footer a { color: var(--text-dim); }
.footer-links { display: flex; gap: 18px; flex-wrap: wrap; }

/* ---------- docs layout (sidebar + content) ---------- */
.docs { max-width: var(--maxw); margin: 0 auto; padding: 34px 24px 64px; display: grid; grid-template-columns: 236px 1fr; gap: 48px; align-items: start; }
.doc-sidebar { position: sticky; top: 80px; align-self: start; }
.doc-sidebar h4 { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-faint); margin: 18px 0 8px; font-family: var(--font); font-weight: 700; }
.doc-sidebar ul { list-style: none; margin: 0 0 8px; padding: 0; }
.doc-sidebar li { margin: 1px 0; }
.doc-sidebar a { display: block; padding: 7px 14px; border-radius: var(--radius-pill); color: var(--text-dim); font-size: 14.5px; }
.doc-sidebar a:hover { background: var(--bg-elev); color: var(--text); text-decoration: none; }
.doc-sidebar a.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.doc-toc { list-style: none; margin: 2px 0 6px 22px; padding: 0 0 0 10px; border-left: 1px solid var(--border); }
.doc-toc li { margin: 0; }
.doc-toc a { padding: 4px 12px; font-size: 13px; color: var(--text-faint); }
.doc-toc a:hover { background: var(--bg-elev); color: var(--text); }

.doc-content { min-width: 0; }
.doc-content h1 { font-size: 40px; margin: 0 0 10px; }
.doc-content .doc-sub { color: var(--text-dim); font-size: 17px; margin: 0 0 30px; }
.doc-content h2 { font-size: 27px; margin: 40px 0 14px; padding-top: 8px; scroll-margin-top: 84px; }
.doc-content h3 { font-size: 19px; margin: 26px 0 10px; }
.doc-content p, .doc-content li { color: var(--text); }
.doc-content p { margin: 12px 0; }
.doc-content ul, .doc-content ol { padding-left: 22px; }
.doc-content li { margin: 6px 0; }

/* tables */
table { border-collapse: collapse; width: 100%; margin: 16px 0; font-size: 14.5px; }
th, td { border: 1px solid var(--border); padding: 10px 13px; text-align: left; vertical-align: top; }
th { background: var(--bg-elev); color: var(--text); font-weight: 600; }
td { color: var(--text-dim); }
td code, th code { white-space: nowrap; }

/* callout */
.note { border-left: 3px solid var(--accent); background: var(--accent-soft); padding: 13px 16px; border-radius: 0 12px 12px 0; margin: 16px 0; color: var(--text-dim); }
.doc-next { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 44px; padding-top: 24px; border-top: 1px solid var(--border); }
.doc-next a { display: inline-flex; flex-direction: column; padding: 14px 20px; border: 1px solid var(--border); border-radius: 14px; color: var(--text); min-width: 160px; }
.doc-next a:hover { border-color: var(--text-faint); text-decoration: none; }
.doc-next span { font-size: 12px; color: var(--text-faint); }

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .feature-row { grid-template-columns: 1fr; gap: 22px; }
  .feature-row.reverse .feature-media { order: 0; }
  .docs { grid-template-columns: 1fr; gap: 20px; }
  .doc-sidebar { position: static; border: 1px solid var(--border); border-radius: 14px; padding: 8px 12px; }
  .nav-links { gap: 12px; }
  .nav-links a.hide-sm { display: none; }
}
@media (max-width: 520px) {
  .hero { padding: 60px 0 42px; }
  .hero-cmd { font-size: 12.5px; }
}
[hidden] { display: none !important; }
