:root {
  --bg:       #0d1117;
  --surface:  #161b22;
  --border:   #30363d;
  --text:     #e6edf3;
  --muted:    #7d8590;
  --accent:   #39ff14;
  --grid:     #1f6feb;
  --ok:       #2ea043;
  --err:      #f85149;

  --max:   1100px;
  --pad-x: 24px;
  --radius: 12px;

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3 { line-height: 1.2; margin: 0 0 0.4em; font-weight: 600; }
h1 { font-size: 40px; }
h2 { font-size: 32px; }
h3 { font-size: 18px; }
p  { margin: 0 0 1em; }
a  { color: var(--text); text-decoration: none; }
a:hover { color: var(--accent); }
img { display: block; max-width: 100%; height: auto; }

code, pre { font-family: var(--font-mono); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.container {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--pad-x);
}

@media (min-width: 1024px) {
  :root { --pad-x: 48px; }
  h1 { font-size: 64px; }
  h2 { font-size: 40px; }
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: transparent;
  transition: background 200ms ease, border-color 200ms ease;
  border-bottom: 1px solid transparent;
}
.site-header.is-scrolled {
  background: var(--surface);
  border-bottom-color: var(--border);
}
.site-header__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: var(--text);
}
.brand__mark { color: var(--accent); }

.site-nav {
  display: flex;
  align-items: center;
  gap: 24px;
}
.site-nav a {
  font-size: 14px;
  color: var(--muted);
}
.site-nav a:hover { color: var(--text); }

@media (max-width: 639px) {
  .site-nav a:not([href*="github"]) { display: none; }
}

.hero {
  padding: 96px 0 80px;
}
.hero__inner { text-align: center; }
.eyebrow {
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 24px;
}
.hero__title {
  margin: 0 0 16px;
  letter-spacing: -0.02em;
  text-shadow: 0 0 8px rgba(57, 255, 20, 0.35);
}
.hero__sub {
  color: var(--muted);
  font-size: 18px;
  max-width: 620px;
  margin: 0 auto 32px;
}
.hero__cta {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}
.hero__note {
  margin: 20px auto 0;
  color: var(--muted);
  font-size: 13px;
  max-width: 520px;
}
.hero__note a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.hero__note a:hover { color: var(--text); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 500;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 150ms ease, box-shadow 150ms ease, border-color 150ms ease, color 150ms ease;
}
.btn svg { display: block; }
.btn--primary {
  background: var(--accent);
  color: var(--bg);
}
.btn--primary:hover {
  color: var(--bg);
  box-shadow: 0 0 16px rgba(57, 255, 20, 0.45);
  transform: translateY(-1px);
}
.btn--ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}
.btn--ghost:hover {
  color: var(--accent);
  border-color: var(--accent);
}

@media (min-width: 1024px) {
  .hero { padding: 128px 0 96px; }
}

.demo {
  padding: 0 0 80px;
}
.demo__figure {
  margin: 0;
  text-align: center;
}
.demo__media {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.5);
}
.demo__media--still { display: none; }
.demo__figure figcaption {
  margin-top: 16px;
  color: var(--muted);
  font-size: 14px;
}

@media (prefers-reduced-motion: reduce) {
  .demo__media--motion { display: none; }
  .demo__media--still  { display: block; margin-left: auto; margin-right: auto; }
}

.features { padding: 64px 0; border-top: 1px solid var(--border); }
.features h2 { margin-bottom: 32px; }

.features__grid {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
.feature {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}
.feature__icon { color: var(--accent); margin-bottom: 16px; }
.feature h3 { margin-bottom: 8px; }
.feature p {
  color: var(--muted);
  font-size: 14px;
  margin: 0;
}
.feature code {
  font-size: 13px;
  padding: 2px 6px;
  background: var(--bg);
  border-radius: 4px;
}

@media (min-width: 640px)  { .features__grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1024px) { .features__grid { grid-template-columns: repeat(3, 1fr); } }

.arch { padding: 64px 0; border-top: 1px solid var(--border); }
.arch__inner { display: grid; grid-template-columns: 1fr; gap: 32px; }
.arch__intro p { color: var(--muted); margin: 0; }

.arch__list {
  list-style: none;
  counter-reset: arch;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 16px;
}
.arch__item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  counter-increment: arch;
  position: relative;
}
.arch__item::before {
  content: counter(arch, decimal-leading-zero);
  position: absolute;
  top: 16px;
  right: 20px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
}
.arch__item h3 {
  margin: 8px 0;
  font-size: 18px;
}
.arch__item p {
  color: var(--muted);
  font-size: 14px;
  margin: 0;
}
.arch__item code {
  font-size: 13px;
  background: var(--bg);
  padding: 1px 6px;
  border-radius: 4px;
}

.chip {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--grid);
  background: rgba(31, 111, 235, 0.12);
  border: 1px solid rgba(31, 111, 235, 0.4);
  padding: 2px 8px;
  border-radius: 999px;
}

.muted { color: var(--muted); }

@media (min-width: 1024px) {
  .arch__inner { grid-template-columns: 5fr 7fr; gap: 48px; }
  .arch__intro { position: sticky; top: 80px; align-self: start; }
}

.quick { padding: 64px 0 96px; border-top: 1px solid var(--border); }
.quick h2 { margin-bottom: 24px; }
.quick h3 { margin: 32px 0 12px; }

.code-block {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin: 0 0 16px;
}
.code-block pre {
  margin: 0;
  padding: 20px 24px;
  overflow-x: auto;
  font-size: 14px;
  line-height: 1.55;
  color: var(--text);
}
.copy {
  position: absolute;
  top: 12px;
  right: 12px;
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--muted);
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: color 150ms ease, border-color 150ms ease;
}
.copy:hover { color: var(--accent); border-color: var(--accent); }
.copy.is-copied { color: var(--ok); border-color: var(--ok); }

.hw {
  padding-left: 20px;
  color: var(--muted);
  font-size: 14px;
}
.hw li { margin-bottom: 6px; }
.hw code {
  font-size: 13px;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 1px 6px;
  border-radius: 4px;
  color: var(--text);
}

.site-footer {
  border-top: 1px solid var(--border);
  padding: 32px 0;
  color: var(--muted);
  font-size: 14px;
}
.site-footer__row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: center;
}
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--accent); }

@media (min-width: 640px) {
  .site-footer__row { flex-direction: row; justify-content: space-between; text-align: left; }
}

.reveal {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 250ms ease-out, transform 250ms ease-out;
}
.reveal.is-visible {
  opacity: 1;
  transform: none;
}
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

.gh-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.gh-link svg { display: block; }
