:root {
  --ink: #111113;
  --muted: #6e6e73;
  --line: #e6e6e8;
  --paper: #ffffff;
  --soft: #f5f5f7;
  --green: #2f9e5b;
  --code-bg: #111113;
  --code-ink: #e8e8ea;
  --radius: 14px;
  --max: 1080px;
  --text: 640px;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body { margin: 0; font-size: 17px; line-height: 1.6; }
a { color: inherit; }
img, svg { max-width: 100%; height: auto; display: block; }
code, pre { font-family: "SF Mono", ui-monospace, Menlo, Consolas, "Liberation Mono", monospace; font-size: 0.88em; }
:not(pre) > code { background: var(--soft); padding: 0.12em 0.4em; border-radius: 6px; }

/* Header */
.bar {
  position: sticky; top: 0; z-index: 10;
  background: rgba(255,255,255,0.82);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s;
}
.bar.scrolled { border-bottom-color: var(--line); }
.bar-inner {
  max-width: var(--max); margin: 0 auto; padding: 0 24px;
  height: 60px; display: flex; align-items: center; justify-content: space-between;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 600; letter-spacing: -0.01em; }
.brand img { width: 26px; height: 26px; }
.bar nav { display: flex; gap: 28px; font-size: 15px; }
.bar nav a { text-decoration: none; color: var(--muted); transition: color .15s; }
.bar nav a:hover, .bar nav a[aria-current] { color: var(--ink); }

/* Layout */
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 24px; }
section { padding: 120px 0; }
.narrow { max-width: var(--text); }
.center { text-align: center; margin-left: auto; margin-right: auto; }

h1, h2, h3 { letter-spacing: -0.025em; line-height: 1.08; margin: 0; font-weight: 700; }
h1 { font-size: clamp(42px, 6.4vw, 76px); }
h2 { font-size: clamp(32px, 4.4vw, 52px); }
h3 { font-size: 24px; letter-spacing: -0.015em; line-height: 1.25; }
.lead { font-size: clamp(19px, 2vw, 22px); line-height: 1.5; color: var(--muted); margin: 24px 0 0; }
p { margin: 16px 0 0; }

/* Hero */
.hero { padding: 96px 0 80px; }
.hero-grid > *, .story > *, .docs > * { min-width: 0; }
.hero-grid { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 64px; align-items: center; }
.hero h1 span { color: var(--muted); }
.hero-visual svg { width: 100%; }
.cluster circle {
  transform-box: fill-box; transform-origin: center;
  animation: pop .7s cubic-bezier(.2,.8,.2,1.2) both;
  animation-delay: calc(var(--i) * 14ms);
}
@keyframes pop { from { transform: scale(0); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .cluster circle { animation: none; } html { scroll-behavior: auto; } }

/* Terminal */
.term {
  position: relative; margin-top: 40px;
  background: var(--code-bg); color: var(--code-ink);
  border-radius: var(--radius); padding: 22px 24px;
  font-family: "SF Mono", ui-monospace, Menlo, Consolas, monospace; font-size: 15px; line-height: 1.8;
  overflow-x: auto;
}
.term pre { margin: 0; font-size: inherit; }
.term .p { color: #6e6e73; user-select: none; }
.term .c { color: #8a8a90; }
.copy {
  position: absolute; top: 14px; right: 14px;
  background: rgba(255,255,255,0.08); color: #c7c7cc;
  border: 0; border-radius: 8px; padding: 6px 10px; font: 500 13px/1 inherit; font-family: inherit;
  cursor: pointer; transition: background .15s, color .15s;
}
.copy:hover { background: rgba(255,255,255,0.16); color: #fff; }

.actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 28px; align-items: center; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 13px 24px; border-radius: 999px; font-size: 16px; font-weight: 500;
  text-decoration: none; transition: transform .15s, background .15s;
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:hover { background: #2c2c2e; }
.btn-ghost { color: var(--ink); }
.btn-ghost:hover { background: var(--soft); }

/* Report shot */
.shot { background: var(--soft); }
.frame {
  margin-top: 64px; border-radius: 18px; overflow: hidden;
  box-shadow: 0 1px 2px rgba(0,0,0,.04), 0 30px 80px -20px rgba(0,0,0,.25);
  border: 1px solid var(--line); background: #fff;
}
.frame-top { height: 34px; display: flex; gap: 8px; align-items: center; padding: 0 14px; border-bottom: 1px solid var(--line); background: #fafafa; }
.frame-top i { width: 11px; height: 11px; border-radius: 50%; background: #e2e2e4; }

/* Stories */
.story { display: grid; grid-template-columns: 1fr 1fr; gap: 72px; align-items: center; }
.story + .story { margin-top: 140px; }
.story .lead { margin-top: 20px; }
.legend { display: flex; flex-direction: column; gap: 18px; font-size: 16px; color: var(--muted); }
.legend div { display: flex; align-items: center; gap: 18px; }
.legend b { color: var(--ink); font-weight: 600; }
.dot { flex: none; border-radius: 50%; }
.code {
  background: var(--code-bg); color: var(--code-ink); border-radius: var(--radius);
  padding: 24px; margin: 0; overflow-x: auto; font-size: 14px; line-height: 1.7;
}
.code .k { color: #9ecbff; }
.code .s { color: #a5d6a7; }
.code .c { color: #8a8a90; }

/* Closing */
.closing { border-top: 1px solid var(--line); }
.closing .actions { justify-content: center; }

footer { border-top: 1px solid var(--line); padding: 32px 0 48px; font-size: 14px; color: var(--muted); }
footer .wrap { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 16px; }
footer nav { display: flex; gap: 22px; }
footer a { text-decoration: none; }
footer a:hover { color: var(--ink); }

/* Docs */
.docs { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 64px; padding-top: 64px; padding-bottom: 120px; }
.toc { position: sticky; top: 92px; align-self: start; font-size: 14px; }
.toc a { display: block; padding: 5px 0; text-decoration: none; color: var(--muted); }
.toc a:hover, .toc a.on { color: var(--ink); }
.toc a.sub { padding-left: 12px; font-size: 13px; }
.doc { max-width: 720px; }
.doc h1 { font-size: 48px; }
.doc h2 { font-size: 32px; margin-top: 88px; padding-top: 8px; }
.doc h3 { font-size: 20px; margin-top: 40px; }
.doc pre { background: var(--code-bg); color: var(--code-ink); border-radius: 12px; padding: 18px 20px; overflow-x: auto; line-height: 1.65; margin: 16px 0 0; }
.doc table { width: 100%; border-collapse: collapse; margin-top: 20px; font-size: 15px; }
.doc th, .doc td { text-align: left; vertical-align: top; padding: 12px 12px 12px 0; border-bottom: 1px solid var(--line); }
.doc th { font-weight: 600; font-size: 13px; color: var(--muted); }
.doc td:first-child { white-space: nowrap; }
.doc .note { color: var(--muted); font-size: 15px; }
.doc .formula { font-family: "SF Mono", ui-monospace, Menlo, Consolas, monospace; font-size: 14px; background: var(--soft); border-radius: 10px; padding: 14px 18px; margin-top: 16px; line-height: 1.9; }
.doc .keys { font-size: 14px; color: var(--muted); }

.tabs { margin-top: 20px; }
.tabs [role=tablist] { display: flex; gap: 4px; flex-wrap: wrap; background: var(--soft); padding: 4px; border-radius: 12px; width: fit-content; }
.tabs button { border: 0; background: none; padding: 8px 14px; border-radius: 9px; font: inherit; font-size: 14px; color: var(--muted); cursor: pointer; }
.tabs button[aria-selected=true] { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.tabs [role=tabpanel] > p:first-child { margin-top: 16px; }

@media (max-width: 860px) {
  section { padding: 80px 0; }
  .hero { padding: 56px 0 64px; }
  .hero-grid, .story { grid-template-columns: 1fr; gap: 48px; }
  .hero-visual { max-width: 280px; width: 100%; margin: 0 auto; order: -1; }
  .term { padding-top: 50px; }
  .story + .story { margin-top: 96px; }
  .story .visual { order: 2; }
  .docs { grid-template-columns: 1fr; gap: 0; }
  .toc { display: none; }
  .bar nav { gap: 20px; }
}
