:root {
  --bg: #0d1117;
  --bg-2: #161b22;
  --border: #30363d;
  --text: #e6edf3;
  --muted: #9198a1;
  --accent: #58a6ff;
  --accent-2: #3fb950;
  --open: #d29922;
  --radius: 12px;
  --max: 1080px;
  --mono: ui-monospace, SFMono-Regular, "Cascadia Code", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code {
  font-family: var(--mono);
  font-size: 0.88em;
  background: rgba(110, 118, 129, 0.2);
  padding: 0.1em 0.35em;
  border-radius: 6px;
}

/* Navigation */
.nav {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding: 0.9rem max(1.25rem, calc((100% - var(--max)) / 2));
  background: rgba(13, 17, 23, 0.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.brand { font-family: var(--mono); font-weight: 600; color: var(--text); }
.brand .prompt { color: var(--accent-2); }
.nav nav { display: flex; gap: 1.25rem; flex-wrap: wrap; }
.nav nav a { color: var(--muted); font-size: 0.93rem; }
.nav nav a:hover { color: var(--text); text-decoration: none; }

main { max-width: var(--max); margin: 0 auto; padding: 0 1.25rem; }
section { padding: 4.5rem 0 1rem; }
h1, h2, h3 { line-height: 1.25; }
h2 { font-size: 1.7rem; margin: 0 0 1.5rem; }
h2.sub { margin-top: 3rem; }
h3 { font-size: 1.08rem; margin: 0 0 0.5rem; }

/* Hero */
.hero > div { min-width: 0; }
.hero { display: flex; gap: 2.5rem; align-items: flex-start; padding-top: 5rem; }
.avatar { border-radius: 50%; border: 2px solid var(--border); flex-shrink: 0; }
.eyebrow { font-family: var(--mono); color: var(--accent-2); margin: 0; font-size: 0.92rem; }
.hero h1 { font-size: clamp(2.2rem, 5vw, 3.2rem); margin: 0.3rem 0 1rem; }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 62ch; margin: 0; }
.stats { display: flex; gap: 2.5rem; margin: 2rem 0; flex-wrap: wrap; }
.stats strong { display: block; font-size: 1.9rem; color: var(--text); }
.stats span { color: var(--muted); font-size: 0.9rem; }
.cta { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.btn {
  display: inline-block; padding: 0.6rem 1.1rem;
  border: 1px solid var(--border); border-radius: 8px;
  color: var(--text); background: var(--bg-2); font-weight: 500;
}
.btn:hover { border-color: var(--muted); text-decoration: none; }
.btn.primary { background: #238636; border-color: #2ea043; }
.btn.primary:hover { background: #2ea043; }

/* Cards */
.grid { display: grid; gap: 1rem; }
.cards { grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); }
.card {
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.3rem 1.4rem;
  display: flex; flex-direction: column;
  transition: border-color 0.15s, transform 0.15s;
}
.card:hover { border-color: #484f58; transform: translateY(-2px); }
.card p { color: var(--muted); margin: 0 0 1rem; flex-grow: 1; }
.card.featured { grid-column: 1 / -1; border-color: rgba(88, 166, 255, 0.45); }
.tags { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 0.4rem; }
.tags li {
  font-size: 0.78rem; padding: 0.15rem 0.6rem; border-radius: 999px;
  background: rgba(56, 139, 253, 0.12); color: var(--accent);
}
.project-top { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.lang { font-size: 0.8rem; color: var(--muted); white-space: nowrap; }
.lang::before {
  content: ""; display: inline-block; width: 0.65em; height: 0.65em;
  border-radius: 50%; margin-right: 0.35em; background: var(--dot, #8b949e);
}
.lang.hcl { --dot: #844fba; }
.lang.js { --dot: #f1e05a; }
.lang.lua { --dot: #000080; }
.lang.cpp { --dot: #f34b7d; }
.lang.java { --dot: #b07219; }
.more { margin-top: 1.25rem; }

/* Open source */
.section-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem; margin-bottom: 1.5rem; }
.section-head h2 { margin: 0; }
.filter { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.filter button {
  background: var(--bg-2); color: var(--muted); border: 0; padding: 0.45rem 0.9rem;
  font: inherit; font-size: 0.88rem; cursor: pointer;
}
.filter button + button { border-left: 1px solid var(--border); }
.filter button.active { background: #1f6feb; color: #fff; }
.upstream {
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--bg-2); margin-bottom: 1rem; overflow: hidden;
}
.upstream-head { padding: 1.1rem 1.4rem 0.6rem; }
.upstream-head h3 { font-family: var(--mono); font-size: 1rem; }
.upstream-head p { margin: 0; color: var(--muted); font-size: 0.95rem; }
.prs { list-style: none; margin: 0.6rem 0 0; padding: 0; }
.prs li {
  display: flex; justify-content: space-between; align-items: baseline; gap: 1rem;
  padding: 0.6rem 1.4rem 0.6rem 2.6rem; border-top: 1px solid var(--border); position: relative;
}
.prs li::before {
  position: absolute; left: 1.2rem; font-size: 0.85rem;
}
.prs li[data-state="merged"]::before { content: "●"; color: #a371f7; }
.prs li[data-state="open"]::before { content: "○"; color: var(--open); }
.prs a { color: var(--text); }
.prs .meta { color: var(--muted); font-size: 0.82rem; white-space: nowrap; font-family: var(--mono); }
.prs li[data-state="merged"] .meta::before { content: "merged · "; color: #a371f7; }
.prs li[data-state="open"] .meta::before { content: "in review · "; color: var(--open); }
.hidden { display: none !important; }

/* Timeline */
.timeline { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--border); }
.timeline li { display: grid; grid-template-columns: 170px 1fr; gap: 1.5rem; padding: 0 0 2rem 1.5rem; position: relative; }
.timeline li::before {
  content: ""; position: absolute; left: -7px; top: 0.45rem;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--accent);
}
.timeline li:first-child::before { background: var(--accent); }
.when { font-family: var(--mono); color: var(--muted); font-size: 0.88rem; padding-top: 0.15rem; }
.what p { margin: 0; color: var(--muted); }

/* Contact & footer */
.contact { text-align: center; padding-bottom: 4rem; }
.contact p { color: var(--muted); }
.contact .cta { justify-content: center; }
footer { border-top: 1px solid var(--border); text-align: center; color: var(--muted); font-size: 0.85rem; padding: 1.5rem; }

@media (max-width: 720px) {
  .nav nav { display: none; }
  .hero { flex-direction: column; gap: 1.5rem; padding-top: 3rem; }
  .avatar { width: 96px; height: 96px; }
  .prs li { flex-direction: column; gap: 0.2rem; }
  .timeline li { grid-template-columns: 1fr; gap: 0.25rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .card { transition: none; }
  .card:hover { transform: none; }
}
