:root {
  --bg: #060c09;
  --bg2: #0a130f;
  --card: #0c1612;
  --line: #1a2a22;
  --line2: #243a2f;
  --text: #e8f0ec;
  --muted: #8ea398;
  --dim: #5f7469;
  --green: #25d366;
  --green2: #3ddc84;
  --link: #5fe39a;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --radius: 14px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 76px; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.6 Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; -webkit-user-drag: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.hero img, .top img, .foot img { pointer-events: none; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
svg .fill, svg.solid { fill: currentColor; stroke: none; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.wrap { width: 100%; max-width: 1040px; margin: 0 auto; padding: 0 16px; }
::selection { background: rgba(37, 211, 102, .3); }

/* ==== topo ==== */
.top {
  position: fixed; inset: 0 0 auto; z-index: 50;
  border-bottom: 1px solid transparent;
  transition: background .25s, border-color .25s, backdrop-filter .25s;
}
.top.is-scrolled { background: rgba(6, 12, 9, .78); border-color: var(--line); backdrop-filter: blur(14px) saturate(140%); -webkit-backdrop-filter: blur(14px) saturate(140%); }
.top-in { height: 60px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: -.01em; }
.brand img { border-radius: 8px; }
.top-nav { display: flex; align-items: center; gap: 6px; }
.top-nav .link { padding: 8px 12px; color: var(--muted); font-size: 14px; font-weight: 500; border-radius: 8px; transition: color .2s; }
.top-nav .link:hover { color: var(--text); }
.icon-btn { width: 38px; height: 38px; display: grid; place-items: center; color: var(--muted); border-radius: 10px; transition: color .2s, background .2s; }
.icon-btn:hover { color: var(--text); background: rgba(255, 255, 255, .06); }
.icon-btn svg { width: 20px; height: 20px; }

/* ==== botões ==== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 46px; padding: 0 22px; border-radius: 12px;
  background: var(--green); color: #04140a;
  font-weight: 600; font-size: 15px; white-space: nowrap;
  box-shadow: 0 8px 28px -10px rgba(37, 211, 102, .7), inset 0 1px 0 rgba(255, 255, 255, .25);
  transition: transform .15s, background .2s, box-shadow .2s;
}
.btn:hover { background: var(--green2); box-shadow: 0 10px 32px -10px rgba(61, 220, 132, .85), inset 0 1px 0 rgba(255, 255, 255, .25); }
.btn:active { transform: translateY(1px); }
.btn svg { stroke-width: 2.2; }
.btn-ghost { background: rgba(255, 255, 255, .05); color: var(--text); border: 1px solid var(--line2); box-shadow: none; backdrop-filter: blur(6px); }
.btn-ghost:hover { background: rgba(255, 255, 255, .09); box-shadow: none; }
.btn-sm { height: 36px; padding: 0 14px; font-size: 13.5px; border-radius: 10px; }
.btn-sm svg { width: 16px; height: 16px; }

/* ==== inicial ==== */
.hero { position: relative; padding: 84px 0 40px; overflow: hidden; isolation: isolate; }
.hero-bg {
  position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(60% 50% at 50% 40%, rgba(37, 211, 102, .14), transparent 70%),
    linear-gradient(180deg, rgba(6, 12, 9, .55) 0%, rgba(6, 12, 9, .35) 40%, var(--bg) 100%),
    url("../img/bg.webp") center 30% / cover no-repeat;
  opacity: .9;
}
.hero-in { display: flex; flex-direction: column; align-items: center; text-align: center; }
.stage {
  margin: 0; width: min(600px, 100%);
  display: flex; flex-direction: column; align-items: center;
}
.stage img { display: block; height: auto; will-change: transform; }
.stage .robot { width: 44%; margin-left: 4%; animation: bob 5.4s ease-in-out infinite; }
.stage .logo { width: 100%; margin-top: 14px; animation: drift 7.2s ease-in-out -1.8s infinite; }
@keyframes bob {
  0%, 100% { transform: translateY(0) rotate(0); }
  50% { transform: translateY(-16px) rotate(-1.5deg); }
}
@keyframes drift {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-7px); }
}
.lead { max-width: 560px; margin: 26px auto 0; color: var(--muted); font-size: 17px; line-height: 1.6; text-wrap: balance; }
.cta { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 26px; }
.clone {
  display: inline-flex; align-items: center; gap: 12px; max-width: 100%;
  margin-top: 18px; padding: 9px 12px 9px 14px;
  font: 500 13px/1 var(--mono); color: var(--muted);
  background: rgba(10, 19, 15, .7); border: 1px solid var(--line); border-radius: 10px;
  cursor: pointer; transition: border-color .2s, color .2s;
}
.clone:hover { border-color: var(--line2); color: var(--text); }
.clone-txt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.clone b { color: var(--green); font-weight: 500; margin-right: 4px; }
.clone svg { width: 16px; height: 16px; }

/* ==== números ==== */
.stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin-top: 8px; }
.stat {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 18px 10px 16px; min-width: 0;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  transition: border-color .2s, transform .2s;
}
a.stat:hover { border-color: var(--line2); transform: translateY(-2px); }
.stat svg { width: 20px; height: 20px; color: var(--green); margin-bottom: 6px; }
.stat b { font-size: 24px; font-weight: 700; letter-spacing: -.02em; line-height: 1.2; font-variant-numeric: tabular-nums; }
.stat span { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }

/* ==== detalhes ==== */
.meta { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 16px; }
.chip {
  display: inline-flex; align-items: center; gap: 7px;
  height: 32px; padding: 0 12px;
  font-size: 13px; color: var(--muted);
  background: rgba(255, 255, 255, .03); border: 1px solid var(--line); border-radius: 999px;
}
.chip svg { width: 15px; height: 15px; color: var(--dim); }

/* ==== readme ==== */
#readme { margin-top: 40px; margin-bottom: 64px; }
.readme { background: var(--bg2); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.readme-head {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--card);
}
.readme-title { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; }
.readme-title svg { width: 16px; height: 16px; color: var(--muted); }
.readme-commit { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 13px; color: var(--muted); }
.readme-commit:hover .msg { color: var(--text); }
.readme-commit svg { width: 16px; height: 16px; }
.readme-commit .msg { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; transition: color .2s; }
.readme-commit code { font: 12px var(--mono); color: var(--dim); }
.readme-commit .when { white-space: nowrap; color: var(--dim); }
.readme-foot {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px;
  padding: 12px 16px; border-top: 1px solid var(--line); font-size: 13px; color: var(--dim);
}
.readme-foot a { display: inline-flex; align-items: center; gap: 4px; color: var(--link); font-weight: 500; }
.readme-foot svg { width: 14px; height: 14px; }

.md { padding: 32px 40px; font-size: 15.5px; line-height: 1.65; color: #d7e2dc; overflow-wrap: anywhere; min-width: 0; }
.md > :first-child { margin-top: 0 !important; }
.md > :last-child { margin-bottom: 0 !important; }
.md p, .md ul, .md ol, .md blockquote, .md .highlight, .md pre, .md .tbl, .md details { margin: 0 0 16px; }
.md a { color: var(--link); }
.md a:hover { text-decoration: underline; }
.md strong { color: var(--text); font-weight: 600; }
.md .markdown-heading { position: relative; }
.md .anchor { display: none; }
.md h2, .md h3, .md h4 { color: var(--text); font-weight: 600; line-height: 1.3; letter-spacing: -.01em; margin: 28px 0 14px; }
.md h2 { font-size: 1.45em; padding-bottom: .35em; border-bottom: 1px solid var(--line); }
.md h2[data-h1] { font-size: 1.9em; border: 0; padding: 0; }
.md h3 { font-size: 1.18em; }
.md h4 { font-size: 1em; }
.md [align="center"] { text-align: center; }
.md p[align="center"] a { display: inline-block; margin: 2px; }
.md img { max-width: 100%; height: auto; border-radius: 6px; vertical-align: middle; background: transparent; }
.md p[align="center"]:first-child img { border-radius: 12px; }
.md ul, .md ol { padding-left: 1.6em; }
.md li + li { margin-top: 4px; }
.md hr { height: 1px; border: 0; background: var(--line); margin: 28px 0; }
.md blockquote { margin-left: 0; padding: 2px 16px; color: var(--muted); border-left: 3px solid var(--green); background: rgba(37, 211, 102, .05); border-radius: 0 8px 8px 0; }
.md blockquote p { margin: 10px 0; }
.md code { font: 500 .86em var(--mono); padding: .18em .42em; background: rgba(140, 170, 155, .13); border-radius: 6px; color: #e7efe9; }
.md .highlight { position: relative; }
.md pre {
  padding: 16px 18px; overflow-x: auto;
  font: .86em/1.6 var(--mono); color: #e1e9e4;
  background: #050a07; border: 1px solid var(--line); border-radius: 10px;
  -webkit-overflow-scrolling: touch;
}
.md .highlight pre { padding-right: 52px; margin: 0; }
.md pre code { padding: 0; background: none; font-size: 1em; }
.md .tbl { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line); border-radius: 10px; }
.md table { border-collapse: collapse; width: 100%; font-size: .93em; }
.md th, .md td { padding: 9px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.md th { color: var(--text); font-weight: 600; background: rgba(255, 255, 255, .03); white-space: nowrap; }
.md tr:last-child td { border-bottom: 0; }
.md td + td, .md th + th { border-left: 1px solid var(--line); }
.md details { padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px; }
.md summary { cursor: pointer; font-weight: 600; color: var(--text); }
.md .pl-c { color: #7d8f86; }
.md .pl-c1, .md .pl-smi { color: #79c0ff; }
.md .pl-s, .md .pl-pds { color: #a5d6ff; }
.md .pl-k { color: #ff7b72; }
.md .pl-en { color: #d2a8ff; }
.md .pl-v { color: #ffa657; }
.md .pl-ent { color: #7ee787; }
.copy-btn {
  position: absolute; top: 8px; right: 8px;
  width: 34px; height: 34px; display: grid; place-items: center;
  color: var(--muted); background: var(--card); border: 1px solid var(--line); border-radius: 8px;
  cursor: pointer; transition: color .2s, border-color .2s;
}
.copy-btn:hover { color: var(--text); border-color: var(--line2); }
.copy-btn svg { width: 16px; height: 16px; }
.copy-btn.ok { color: var(--green); }

/* ==== rodapé ==== */
.foot { border-top: 1px solid var(--line); padding: 28px 0 calc(28px + env(safe-area-inset-bottom)); }
.foot-in { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 20px; font-size: 13.5px; color: var(--muted); }
.foot p { margin: 0; }
.foot a:hover { color: var(--text); }
.foot .copy { color: var(--dim); }

/* ==== aviso ==== */
.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); z-index: 60;
  padding: 10px 16px; border-radius: 10px;
  background: #0f1d16; border: 1px solid var(--line2); color: var(--text); font-size: 14px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .5);
  opacity: 0; transform: translate(-50%, 10px); pointer-events: none;
  transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ==== responsivo ==== */
@media (max-width: 860px) {
  .md { padding: 24px 20px; }
  .readme-commit .msg, .readme-commit code { display: none; }
}
@media (max-width: 860px) and (min-width: 521px) {
  .stats { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .stats .stat { grid-column: span 2; }
  .stats .stat:nth-child(4), .stats .stat:nth-child(5) { grid-column: span 3; }
}
@media (max-width: 520px) {
  .top-nav .link { display: none; }
  .hero { padding-top: 72px; }
  .lead { font-size: 15.5px; margin-top: 18px; }
  .cta { width: 100%; }
  .cta .btn { flex: 1 1 100%; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .stats .stat:last-child { grid-column: 1 / -1; }
  .stat { padding: 14px 8px 12px; }
  .stat b { font-size: 21px; }
  .chip { font-size: 12.5px; height: 30px; padding: 0 10px; }
  .md { padding: 20px 16px; font-size: 15px; }
  .md h2[data-h1] { font-size: 1.6em; }
  .foot-in { flex-direction: column; text-align: center; }
}
@media (prefers-reduced-motion: reduce) {
  .stage img { animation: none; }
  html { scroll-behavior: auto; }
}
