:root {
  --bg: #ffffff;
  --bg-soft: #f5f7fa;
  --fg: #0f172a;
  --fg-dim: #556070;
  --line: #e3e8ef;
  --accent: #1f6feb;
  --accent-soft: #e8f0fe;
  --ok: #1a7f37;
  --warn: #9a6700;
  --code-bg: #0d1117;
  --code-fg: #e6edf3;
  --code-line: #d0d7de;   /* faint edge around command and code blocks */
  --radius: 10px;
  --mono: ui-monospace, SFMono-Regular, "JetBrains Mono", Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0f14;
    --bg-soft: #121821;
    --fg: #e6edf3;
    --fg-dim: #9aa6b2;
    --line: #232c37;
    --accent: #58a6ff;
    --accent-soft: #13233a;
    --ok: #3fb950;
    --warn: #d29922;
    --code-bg: #010409;
    --code-line: #30363d;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 16px/1.6 var(--sans); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
/* scrollbars: brand blue, nearly square */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg-soft); }
::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 2px; border: 2px solid var(--bg-soft); }
::-webkit-scrollbar-thumb:hover { background: #388bfd; }
::-webkit-scrollbar-corner { background: var(--bg-soft); }
@supports (-moz-appearance: none) { html, .side, .md pre, .md table { scrollbar-color: var(--accent) var(--bg-soft); } }
.md pre::-webkit-scrollbar-track, .md pre::-webkit-scrollbar-corner { background: var(--code-bg); }
.md pre::-webkit-scrollbar-thumb { border-color: var(--code-bg); }
code, pre, kbd { font-family: var(--mono); font-size: 0.92em; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }

/* header */
.top { border-bottom: 1px solid var(--line); position: sticky; top: 0; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); z-index: 10; }
.top .wrap { display: flex; align-items: center; gap: 20px; height: 56px; }
.brand { font: 700 18px/1 var(--mono); color: var(--fg); display: flex; align-items: center; gap: 8px; }
.brand:hover { text-decoration: none; }
.brand img { width: 24px; height: 24px; display: block; }
.top nav { margin-left: auto; display: flex; gap: 18px; font-size: 15px; }
.top nav a { color: var(--fg-dim); }
.top nav a:hover, .top nav a.on { color: var(--fg); text-decoration: none; }

/* hero: always dark, with the blue glow of the brand image */
.hero {
  position: relative; overflow: hidden; color: #e6edf3;
  background:
    radial-gradient(900px 520px at 12% 20%, rgba(31, 111, 235, 0.34), transparent 60%),
    radial-gradient(700px 480px at 92% 85%, rgba(56, 189, 248, 0.16), transparent 60%),
    linear-gradient(180deg, #0b1220 0%, #0d1117 100%);
}
.hero::before { /* faint grid, fading to the right */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(rgba(88, 166, 255, 0.07) 1px, transparent 1px), linear-gradient(90deg, rgba(88, 166, 255, 0.07) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: linear-gradient(90deg, #000 0%, transparent 75%); -webkit-mask-image: linear-gradient(90deg, #000 0%, transparent 75%);
}
.hero .wrap { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 48px; align-items: center; padding-top: 72px; padding-bottom: 72px; }
.hero h1 { font-size: clamp(32px, 4.6vw, 54px); line-height: 1.08; margin: 0 0 24px; letter-spacing: -0.02em; color: #fff; }
.hero h1 .accent { background: linear-gradient(90deg, #58a6ff, #38bdf8); -webkit-background-clip: text; background-clip: text; color: transparent; }
.keys { list-style: none; padding: 0; margin: 0 0 28px; display: grid; gap: 10px; }
.keys li { display: flex; gap: 12px; align-items: baseline; color: #aeb9c6; font-size: 16px; }
.keys li::before { content: ""; flex: none; width: 6px; height: 6px; border-radius: 50%; background: #58a6ff; transform: translateY(-2px); box-shadow: 0 0 8px #1f6feb; }
.keys b { color: #fff; font-weight: 600; min-width: 84px; flex: none; }
.hero .links { display: flex; gap: 12px; flex-wrap: wrap; }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 8px; font-weight: 600; font-size: 15px; }
.btn:hover { text-decoration: none; }
.btn.primary { background: #1f6feb; color: #fff; }
.btn.primary:hover { background: #388bfd; }
.btn.ghost { color: #e6edf3; border: 1px solid rgba(255, 255, 255, 0.18); }
.btn.ghost:hover { border-color: rgba(255, 255, 255, 0.4); }

.side-r { position: relative; min-width: 0; }
.illus { display: block; width: 100%; height: auto; overflow: visible; }
.illus .spin { transform-box: view-box; transform-origin: 290px 150px; animation: spin 60s linear infinite; }
.illus .spin.rev { animation-duration: 90s; animation-direction: reverse; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .illus .moving { display: none; } .illus .spin { animation: none; } }
.glass {
  background: rgba(13, 17, 23, 0.42); border: 1px solid rgba(255, 255, 255, 0.16); border-radius: 16px;
  backdrop-filter: blur(14px) saturate(150%); -webkit-backdrop-filter: blur(14px) saturate(150%);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}
/* the install command floats over the lower part of the illustration */
.install { position: absolute; left: 5%; right: 5%; bottom: 4%; padding: 14px; }
.install .label { font-size: 13px; color: #9aa6b2; margin: 0 2px 8px; display: flex; justify-content: space-between; gap: 12px; }
.install .label a { color: #79c0ff; }
.install .cmd { display: flex; align-items: center; gap: 12px; background: rgba(1, 4, 9, 0.6); border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 10px; padding: 11px 11px 11px 14px; font: 15px/1.5 var(--mono); }
.install .cmd .prompt { color: #7ee787; user-select: none; flex: none; }
.install .cmd code { flex: 1; min-width: 0; white-space: pre; overflow-x: auto; scrollbar-width: none; color: #e6edf3; font-size: inherit; }
.install .cmd .url { color: #79c0ff; }

/* terminals in sections */
.term { border: 1px solid var(--code-line); background: var(--code-bg); color: var(--code-fg); border-radius: var(--radius); padding: 12px 14px; display: flex; align-items: center; gap: 12px; font: 14px/1.5 var(--mono); overflow: hidden; }
.term .prompt { color: #7ee787; user-select: none; flex: none; }
.term code { white-space: pre; flex: 1; min-width: 0; overflow-x: auto; font-size: inherit; scrollbar-width: none; }
.term .note { color: #8b949e; flex: none; }
.copy { background: rgba(255, 255, 255, 0.04); border: 1px solid #30363d; color: #c9d1d9; border-radius: 6px; padding: 4px 10px; font: 13px var(--sans); cursor: pointer; flex: none; }
.copy:hover { border-color: #8b949e; }
.copy.done { color: #7ee787; border-color: #2ea043; }
.install .copy { border-color: rgba(255, 255, 255, 0.2); background: rgba(255, 255, 255, 0.08); }
.start { display: grid; gap: 8px; max-width: 760px; }

/* sections */
section { padding: 48px 0 8px; }
section h2 { font-size: 26px; margin: 0 0 6px; letter-spacing: -0.01em; }
section p.sub { color: var(--fg-dim); margin: 0 0 24px; max-width: 760px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 16px; }
.card { border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 18px 14px; background: var(--bg); }
.card .tag { font: 600 12px/1 var(--mono); color: var(--accent); background: var(--accent-soft); padding: 5px 8px; border-radius: 6px; display: inline-block; margin-bottom: 10px; }
.card h3 { margin: 0 0 6px; font-size: 18px; }
.card p { margin: 0 0 10px; color: var(--fg-dim); font-size: 15px; }
.card code { color: var(--fg); }

.nums { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.num { background: var(--bg-soft); border-radius: var(--radius); padding: 18px; }
.num b { display: block; font: 700 28px/1.2 var(--mono); }
.num span { color: var(--fg-dim); font-size: 14px; }

.principles { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px 24px; padding: 0; list-style: none; }
.principles li { padding-left: 22px; position: relative; color: var(--fg-dim); }
.principles li::before { content: "✓"; position: absolute; left: 0; color: var(--ok); font-weight: 700; }
.principles b { color: var(--fg); }

.contact { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.mail { display: block; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; color: var(--fg); }
.mail:hover { border-color: var(--accent); text-decoration: none; }
.mail b { display: block; font: 600 17px/1.4 var(--mono); color: var(--accent); }
.mail span { color: var(--fg-dim); font-size: 15px; }

footer { border-top: 1px solid var(--line); padding: 24px 0 40px; color: var(--fg-dim); font-size: 14px; margin-top: 48px; }
footer .wrap { display: flex; flex-wrap: wrap; gap: 8px 20px; }
footer .sp { margin-left: auto; }

/* docs */
.docs { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 32px; padding: 28px 20px 60px; max-width: 1180px; margin: 0 auto; }
.side { position: sticky; top: 76px; align-self: start; max-height: calc(100vh - 96px); overflow-y: auto; font-size: 15px; }
.side h4 { font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--fg-dim); margin: 18px 0 6px; }
.side h4:first-child { margin-top: 0; }
.side a { display: block; padding: 4px 10px; border-radius: 6px; color: var(--fg); }
.side a:hover { background: var(--bg-soft); text-decoration: none; }
.side a.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.menu-btn { display: none; }

.md { min-width: 0; }
.md h1 { font-size: 32px; margin: 0 0 16px; letter-spacing: -0.01em; }
.md h2 { font-size: 22px; margin: 36px 0 10px; padding-top: 8px; border-top: 1px solid var(--line); }
.md h3 { font-size: 18px; margin: 26px 0 8px; }
.md h2 a.anchor, .md h3 a.anchor { color: var(--fg-dim); opacity: 0; margin-left: 6px; font-weight: 400; }
.md h2:hover a.anchor, .md h3:hover a.anchor { opacity: 1; }
.md p, .md li { color: var(--fg); }
.md pre { border: 1px solid var(--code-line); background: var(--code-bg); color: var(--code-fg); border-radius: var(--radius); padding: 14px 16px; overflow-x: auto; line-height: 1.5; }
.md .code { position: relative; margin: 1em 0; }
.md .code pre { margin: 0; }
.md .code .copy { position: absolute; top: 8px; right: 8px; opacity: 0; background: var(--code-bg); }
.md .code:hover .copy, .md .code .copy:focus { opacity: 1; }
.md pre .cm { color: #6a9955; }   /* # comments in commands and config */
@media (hover: none) { .md .code .copy { opacity: 1; } }
.md :not(pre) > code { background: var(--bg-soft); border: 1px solid var(--line); border-radius: 5px; padding: 1px 5px; }
.md table { border-collapse: collapse; width: 100%; display: block; overflow-x: auto; font-size: 15px; margin: 12px 0; }
.md th, .md td { border: 1px solid var(--line); padding: 7px 10px; text-align: left; vertical-align: top; }
.md th { background: var(--bg-soft); }
.md blockquote { margin: 12px 0; padding: 4px 16px; border-left: 3px solid var(--accent); color: var(--fg-dim); }
.md img { max-width: 100%; }
.md .edit { display: inline-block; margin-top: 30px; font-size: 14px; color: var(--fg-dim); }
.loading, .error { color: var(--fg-dim); padding: 20px 0; }
.error { color: #cf222e; }

/* one column: title, then the illustration with the command, then the keys */
@media (max-width: 900px) {
  .hero .wrap { grid-template-columns: minmax(0, 1fr); gap: 0; padding-top: 40px; padding-bottom: 44px; }
  .intro { display: contents; }
  .hero h1 { order: 0; margin-bottom: 20px; }
  .side-r { order: 1; margin-bottom: 32px; }
  .keys { order: 2; }
  .hero .links { order: 3; }
}
@media (max-width: 820px) {
  .wrap { padding: 0 16px; }
  .docs { grid-template-columns: 1fr; gap: 0; padding: 12px 16px 60px; }
  .side { position: static; max-height: none; display: none; border-bottom: 1px solid var(--line); padding-bottom: 12px; margin-bottom: 16px; }
  .side.open { display: block; }
  .menu-btn { display: inline-flex; margin-bottom: 12px; background: var(--bg-soft); border: 1px solid var(--line); color: var(--fg); border-radius: 8px; padding: 6px 12px; font: 14px var(--sans); cursor: pointer; }
  .top nav { gap: 12px; font-size: 14px; }
  .term .note { display: none; }
  .keys b { min-width: 76px; }
  .install .cmd { font-size: 13px; gap: 10px; }
  .install .label a { display: none; }
  .install { left: 0; right: 0; bottom: 0; padding: 10px; }
  .install .label { margin-bottom: 6px; font-size: 12px; }
  footer .sp { margin-left: 0; }
}
@media (max-width: 420px) {
  .top nav a[href*="benchmark"] { display: none; }
}
