:root {
  --bg: #fbfdf9;
  --bg-band: #f1f6ee;
  --text: #1d2a1f;
  --muted: #536356;
  --line: #d9e4d5;
  --accent: #2f8a45;
  --accent-strong: #236c35;
  --accent-text: #ffffff;
  --card: #ffffff;
  --code-bg: #1f2621;
  --code-text: #e3efe2;
  --shadow: 0 10px 30px rgba(20, 50, 25, 0.12);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111613;
    --bg-band: #161d18;
    --text: #e4ece4;
    --muted: #9fb0a2;
    --line: #2a352d;
    --accent: #5ec474;
    --accent-strong: #7bd88a;
    --accent-text: #0d1a10;
    --card: #19211b;
    --code-bg: #0c100d;
    --code-text: #d7e8d6;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

img { max-width: 100%; height: auto; display: block; }

code, pre {
  font-family: ui-monospace, "Cascadia Code", "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.88em;
}

p code, li code {
  background: var(--bg-band);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0.05em 0.35em;
}

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

/* Navigation */
.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 60px; gap: 16px; }
.brand {
  display: flex; align-items: center; gap: 8px;
  font-weight: 700; font-size: 1.15rem; color: var(--text); text-decoration: none;
}
.nav nav { display: flex; gap: 22px; flex-wrap: wrap; }
.nav nav a { color: var(--muted); text-decoration: none; font-size: 0.95rem; }
.nav nav a:hover { color: var(--text); }
.nav .nav-github { color: var(--accent); font-weight: 600; }

/* Hero */
.hero { padding: 72px 0 40px; text-align: center; }
.eyebrow { color: var(--accent); font-weight: 600; letter-spacing: 0.02em; margin: 0 0 12px; }
h1 { font-size: clamp(2.2rem, 5.5vw, 3.6rem); line-height: 1.1; margin: 0 0 20px; letter-spacing: -0.02em; }
.lead { font-size: 1.2rem; color: var(--muted); max-width: 720px; margin: 0 auto 28px; }
.actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-bottom: 48px; }
.button {
  display: inline-block; padding: 12px 22px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--card); color: var(--text);
  font-weight: 600; text-decoration: none;
}
.button:hover { border-color: var(--accent); color: var(--text); }
.button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.button.primary:hover { background: var(--accent-strong); color: var(--accent-text); }

.shot { margin: 0; }
.shot img { border-radius: 12px; border: 1px solid var(--line); box-shadow: var(--shadow); }
.hero-shot { max-width: 1040px; margin: 0 auto; }

/* Sections */
section { padding: 72px 0; }
.band { background: var(--bg-band); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
h2 { font-size: clamp(1.7rem, 3.5vw, 2.3rem); line-height: 1.2; margin: 0 0 10px; text-align: center; }
.section-lead { color: var(--muted); text-align: center; max-width: 680px; margin: 0 auto 40px; }
h3 { font-size: 1.15rem; margin: 0 0 8px; }

.grid { display: grid; gap: 20px; }
.features { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.features article {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 22px;
}
.features p { margin: 0; color: var(--muted); }

.two { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); align-items: start; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 22px;
  display: flex; flex-direction: column; gap: 14px; min-width: 0;
}
.card p { margin: 0; color: var(--muted); }
.card .shot img { box-shadow: none; }
.engine-shots { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.more { font-weight: 600; text-decoration: none; }
.note { text-align: center; color: var(--muted); margin: 28px auto 0; max-width: 680px; }

pre {
  margin: 0; padding: 16px 18px; border-radius: 10px;
  background: var(--code-bg); color: var(--code-text);
  overflow-x: auto; line-height: 1.5;
}
pre code { background: none; border: 0; padding: 0; color: inherit; font-size: 1em; }

/* Get started */
.steps { list-style: none; counter-reset: step; padding: 0; margin: 0 auto 40px; max-width: 760px; }
.steps li {
  counter-increment: step; position: relative; padding: 0 0 28px 56px;
}
.steps li::before {
  content: counter(step); position: absolute; left: 0; top: -2px;
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--accent); color: var(--accent-text);
  display: flex; align-items: center; justify-content: center; font-weight: 700;
}
.steps p { margin: 6px 0 0; color: var(--muted); }
.tabs { margin-top: 10px; }
.tab-buttons { display: flex; gap: 6px; margin-bottom: 8px; }
.tab-buttons button {
  font: inherit; font-size: 0.9rem; padding: 6px 12px; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--line); background: var(--card); color: var(--muted);
}
.tab-buttons button[aria-selected="true"] { border-color: var(--accent); color: var(--text); font-weight: 600; }
.game-shot { max-width: 640px; margin: 0 auto; }

/* Docs */
.docs { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.docs ul { margin: 0; padding-left: 18px; }
.docs li { margin: 6px 0; }

/* Footer */
.footer { border-top: 1px solid var(--line); padding: 32px 0 40px; color: var(--muted); font-size: 0.92rem; }
.footer-inner p { margin: 6px 0; }
.footer-inner img { display: inline-block; vertical-align: -4px; }

@media (max-width: 720px) {
  body { font-size: 16px; }
  .nav nav { gap: 14px; }
  .nav nav a:not(.nav-github) { display: none; }
  .hero { padding-top: 44px; }
  section { padding: 52px 0; }
  .engine-shots { grid-template-columns: 1fr; }
}
