/* GMGN AI App Guide - single stylesheet, no framework. Mobile-first. */
:root {
  --bg: #0b0f14;
  --bg-2: #111722;
  --bg-3: #171f2c;
  --line: #243044;
  --text: #e6edf3;
  --muted: #9aa8b8;
  --accent: #16c784;
  --accent-2: #0fa86c;
  --warn: #f5a524;
  --danger: #ef5350;
  --link: #5ad8a4;
  --max: 1120px;
  --radius: 12px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f7f9fb;
    --bg-2: #ffffff;
    --bg-3: #eef2f6;
    --line: #d9e0e8;
    --text: #0f1720;
    --muted: #5b6b7c;
    --link: #0b7a52;
    --accent: #0fa86c;
  }
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; font-family: var(--font); font-size: 17px; line-height: 1.65; color: var(--text); background: var(--bg); }
img, svg { max-width: 100%; height: auto; }
a { color: var(--link); text-decoration: underline; text-underline-offset: 2px; }
a:hover { color: var(--accent); }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .5em; font-weight: 700; letter-spacing: -0.01em; }
h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); }
h2 { font-size: clamp(1.4rem, 2.8vw, 1.85rem); margin-top: 1.6em; }
h3 { font-size: 1.2rem; margin-top: 1.4em; }
p { margin: 0 0 1em; }
.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 16px; }
.skip { position: absolute; left: -999px; top: 0; background: var(--accent); color: #000; padding: 8px 12px; z-index: 100; }
.skip:focus { left: 8px; }
.kicker { text-transform: uppercase; letter-spacing: .08em; font-size: .75rem; font-weight: 700; color: var(--accent); margin-bottom: .6em; }
.lede { font-size: 1.12rem; color: var(--muted); max-width: 70ch; }
.meta { color: var(--muted); font-size: .9rem; }
.section { padding: 28px 16px; }
.section-lede { color: var(--muted); max-width: 70ch; }
.text-link { font-weight: 600; }
.prose { max-width: 76ch; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; }
.brand { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: var(--text); font-weight: 800; font-size: 1.05rem; }
.brand-mark { flex: none; }
.brand-accent { color: var(--accent); }
.brand-muted { color: var(--muted); font-weight: 500; }
.nav-toggle { display: inline-flex; flex-direction: column; gap: 4px; background: none; border: 1px solid var(--line); border-radius: 8px; padding: 9px 8px; cursor: pointer; }
.nav-toggle span { display: block; width: 20px; height: 2px; background: var(--text); }
.primary-nav { display: none; position: absolute; left: 0; right: 0; top: 60px; background: var(--bg-2); border-bottom: 1px solid var(--line); }
.primary-nav.open { display: block; }
.primary-nav ul { list-style: none; margin: 0; padding: 8px 16px 12px; display: flex; flex-direction: column; gap: 2px; }
.primary-nav a { display: block; padding: 10px 8px; text-decoration: none; color: var(--text); font-weight: 600; border-radius: 8px; }
.primary-nav a:hover, .primary-nav a[aria-current="page"] { background: var(--bg-3); color: var(--accent); }
.nav-cta a { background: var(--accent); color: #041; text-align: center; }
.nav-cta a:hover { background: var(--accent-2); color: #041; }
@media (min-width: 900px) {
  .nav-toggle { display: none; }
  .primary-nav { display: block; position: static; background: none; border: 0; }
  .primary-nav ul { flex-direction: row; align-items: center; padding: 0; gap: 4px; }
  .primary-nav a { padding: 8px 10px; font-size: .95rem; }
  .nav-cta { margin-left: 6px; }
}

/* Buttons */
.btn { display: inline-block; padding: 11px 18px; border-radius: 10px; font-weight: 700; text-decoration: none; border: 1px solid transparent; line-height: 1.2; }
.btn-primary { background: var(--accent); color: #041; }
.btn-primary:hover { background: var(--accent-2); color: #041; }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--text); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-block { display: block; text-align: center; }

/* Hero */
.hero { padding: 36px 0 20px; background: radial-gradient(1200px 500px at 20% -10%, rgba(22,199,132,.18), transparent 60%); }
.hero-inner { display: grid; gap: 28px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0 10px; }
.hero-note { color: var(--muted); font-size: .85rem; }
.hero-panel { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.panel-title { font-size: 1rem; margin: 0 0 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.stats { margin: 0; display: grid; gap: 10px; }
.stats div { display: grid; grid-template-columns: 110px 1fr; gap: 8px; padding-bottom: 10px; border-bottom: 1px dashed var(--line); }
.stats dt { color: var(--muted); font-size: .9rem; }
.stats dd { margin: 0; font-weight: 600; font-size: .95rem; }
.panel-foot { margin: 12px 0 0; color: var(--muted); font-size: .78rem; }
@media (min-width: 900px) { .hero-inner { grid-template-columns: 1.4fr 1fr; align-items: start; } .hero { padding: 56px 0 30px; } }

/* Cards */
.card-grid { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .card-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .card-grid { grid-template-columns: repeat(3, 1fr); } }
.card { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); transition: border-color .15s, transform .15s; }
.card:hover { border-color: var(--accent); transform: translateY(-2px); }
.card-link { display: flex; flex-direction: column; height: 100%; padding: 18px; text-decoration: none; color: inherit; }
.card-kicker { font-size: .75rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.card-title { font-size: 1.05rem; margin: 8px 0; }
.card-desc { color: var(--muted); font-size: .92rem; flex: 1; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card-more { color: var(--accent); font-weight: 700; font-size: .9rem; margin-top: 10px; }

/* Topic grid */
.topic-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.topic { display: flex; flex-direction: column; gap: 4px; padding: 16px; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: inherit; }
.topic:hover { border-color: var(--accent); }
.topic-title { font-weight: 800; color: var(--accent); }
.topic-blurb { color: var(--muted); font-size: .9rem; }
.topic-count { font-size: .78rem; color: var(--muted); }

/* Steps */
.steps { counter-reset: step; list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.steps li { position: relative; padding: 14px 14px 14px 58px; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); }
.steps li::before { counter-increment: step; content: counter(step); position: absolute; left: 14px; top: 12px; width: 32px; height: 32px; border-radius: 50%; background: var(--accent); color: #041; font-weight: 800; display: grid; place-items: center; }

/* Breadcrumbs */
.crumbs { padding: 14px 0 0; font-size: .85rem; }
.crumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; color: var(--muted); }
.crumbs li + li::before { content: "›"; margin-right: 6px; }
.crumbs a { color: var(--muted); }

/* Article */
.article { padding-bottom: 40px; }
.article-head { padding: 18px 0 8px; }
.byline { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; border: 1px solid var(--line); }
.author-photo { width: 160px; height: 160px; border-radius: 50%; object-fit: cover; border: 2px solid var(--accent); float: right; margin: 0 0 16px 20px; }
@media (max-width: 600px) { .author-photo { float: none; display: block; margin: 0 0 16px; } }
.summary-box { background: var(--bg-2); border-left: 4px solid var(--accent); border-radius: 8px; padding: 14px 16px; margin: 16px 0 8px; max-width: 80ch; }
.article-grid { display: grid; gap: 24px; }
@media (min-width: 960px) { .article-grid { grid-template-columns: 260px minmax(0, 1fr); align-items: start; } .toc { position: sticky; top: 76px; } }
.toc details { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; margin-bottom: 12px; }
.toc summary { cursor: pointer; font-weight: 700; }
.toc ol { margin: 8px 0 4px; padding-left: 18px; font-size: .9rem; }
.toc li { margin: 6px 0; }
.toc a { color: var(--muted); text-decoration: none; }
.toc a:hover, .toc a.active { color: var(--accent); }
.toc-note { color: var(--muted); font-size: .78rem; margin-top: 8px; }
.article-body { max-width: 78ch; min-width: 0; }
.article-narrow { max-width: 820px; }
.article-body h2 { scroll-margin-top: 80px; padding-top: 6px; border-top: 1px solid var(--line); padding-top: 18px; }
.article-body h3 { scroll-margin-top: 80px; }
.article-body ul, .article-body ol { padding-left: 1.3em; }
.article-body li { margin: .35em 0; }
.article-body blockquote { margin: 1.2em 0; padding: 10px 16px; border-left: 4px solid var(--warn); background: var(--bg-2); color: var(--muted); }
.article-body code { font-family: var(--mono); font-size: .9em; background: var(--bg-3); padding: 2px 6px; border-radius: 6px; }
.article-body pre { background: var(--bg-3); border: 1px solid var(--line); border-radius: 10px; padding: 14px; overflow: auto; font-size: .88rem; }
.article-body pre code { background: none; padding: 0; }
.article-body hr { border: 0; border-top: 1px solid var(--line); margin: 2em 0; }
.table-wrap { overflow-x: auto; margin: 1.2em 0; border: 1px solid var(--line); border-radius: 10px; -webkit-overflow-scrolling: touch; }
table { border-collapse: collapse; width: 100%; font-size: .93rem; }
caption { caption-side: bottom; color: var(--muted); font-size: .8rem; padding: 8px; text-align: left; }
th, td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { background: var(--bg-3); font-weight: 700; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
.sources-note { color: var(--muted); font-size: .85rem; border-top: 1px solid var(--line); padding-top: 14px; margin-top: 24px; }

/* FAQ */
.faq h2 { margin-top: 1.8em; }
.faq-item { border: 1px solid var(--line); border-radius: 10px; background: var(--bg-2); margin: 10px 0; }
.faq-item summary { cursor: pointer; padding: 12px 16px; list-style: none; display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; font-size: 1.3rem; color: var(--accent); flex: none; }
.faq-item[open] summary::after { content: "–"; }
.faq-item summary h3 { margin: 0; font-size: 1.02rem; }
.faq-a { padding: 0 16px 14px; color: var(--muted); }

/* CTA */
.cta-box { display: grid; gap: 14px; padding: 20px; background: linear-gradient(135deg, rgba(22,199,132,.14), rgba(22,199,132,.03)); border: 1px solid var(--line); border-radius: var(--radius); margin: 28px 0; }
.cta-box p { margin: 4px 0 0; color: var(--muted); }
.cta-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
@media (min-width: 720px) { .cta-box { grid-template-columns: 1fr auto; align-items: center; } }

/* Related */
.related { margin-top: 36px; }

/* Hub */
.hub-head { padding: 18px 16px 8px; }
.hub-foot { padding-bottom: 30px; }
.compare-table { margin-bottom: 24px; }
.plain-list { padding-left: 1.2em; }

/* Token widget */
.token-widget { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin: 18px 0 24px; }
.tw-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.tw-name { font-weight: 800; font-size: 1.05rem; }
.tw-chain { text-transform: uppercase; font-size: .75rem; color: var(--muted); letter-spacing: .06em; }
.tw-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 560px) { .tw-grid { grid-template-columns: repeat(3, 1fr); } }
.tw-grid div { background: var(--bg-3); border-radius: 8px; padding: 10px; }
.tw-label { display: block; color: var(--muted); font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; }
.tw-val { display: block; font-weight: 700; font-family: var(--mono); font-size: .95rem; word-break: break-all; }
.tw-val.up { color: var(--accent); }
.tw-val.down { color: var(--danger); }
.tw-foot { color: var(--muted); font-size: .8rem; margin: 12px 0; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); margin-top: 40px; background: var(--bg-2); }
.footer-grid { display: grid; gap: 24px; padding: 32px 16px 12px; }
@media (min-width: 800px) { .footer-grid { grid-template-columns: 1.6fr 1fr 1fr 1fr; } }
.footer-about p { color: var(--muted); font-size: .9rem; }
.footer-h { font-size: .85rem; text-transform: uppercase; letter-spacing: .08em; margin: 0 0 8px; }
.footer-h a { color: var(--text); text-decoration: none; }
.footer-links { list-style: none; padding: 0; margin: 0 0 14px; font-size: .92rem; }
.footer-links li { margin: 6px 0; }
.footer-links a { color: var(--muted); text-decoration: none; }
.footer-links a:hover { color: var(--accent); }
.footer-bottom { padding: 8px 16px 28px; color: var(--muted); font-size: .85rem; border-top: 1px solid var(--line); }
.footer-bottom a { color: var(--muted); }
.footer-small { font-size: .8rem; }
