/* NexusPay Docs — Dark OLED + green accent · JetBrains Mono / IBM Plex Sans */
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

/* ── Tokens ─────────────────────────────────────────────────────────── */
:root {
  --bg: #0F172A;
  --bg-2: #0B1220;
  --surface: #1E293B;
  --surface-2: #172033;
  --muted: #272F42;
  --border: #1f2b44;
  --border-2: #334155;
  --fg: #F8FAFC;
  --fg-dim: #94A3B8;
  --fg-faint: #64748B;
  --accent: #22C55E;
  --accent-2: #16A34A;
  --info: #38BDF8;
  --danger: #EF4444;
  --warn: #F59E0B;

  --sans: 'IBM Plex Sans', system-ui, -apple-system, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  --radius: 14px;
  --radius-sm: 10px;
  --maxw: 1320px;
  --sidebar: 264px;
  --toc: 220px;
  --topbar-h: 60px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  --glow: 0 0 24px rgba(34, 197, 94, .25);

  /* Glassmorphism */
  --blur: 16px;
  --glass: rgba(30, 41, 59, .55);
  --glass-strong: rgba(23, 32, 51, .72);
  --glass-soft: rgba(30, 41, 59, .35);
  --glass-border: rgba(255, 255, 255, .12);
  --glass-hi: rgba(255, 255, 255, .06);
}

[data-theme="light"] {
  --bg: #F8FAFC;
  --bg-2: #FFFFFF;
  --surface: #FFFFFF;
  --surface-2: #F1F5F9;
  --muted: #EEF2F7;
  --border: #E2E8F0;
  --border-2: #CBD5E1;
  --fg: #0F172A;
  --fg-dim: #475569;
  --fg-faint: #64748B;
  --accent: #16A34A;
  --accent-2: #15803D;
  --shadow: 0 10px 30px rgba(15, 23, 42, .08);
  --glow: 0 0 0 rgba(0, 0, 0, 0);

  --glass: rgba(255, 255, 255, .6);
  --glass-strong: rgba(255, 255, 255, .75);
  --glass-soft: rgba(255, 255, 255, .45);
  --glass-border: rgba(255, 255, 255, .7);
  --glass-hi: rgba(255, 255, 255, .5);
}

/* ── Reset / base ───────────────────────────────────────────────────── */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--topbar-h) + 16px); }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

body {
  margin: 0;
  min-height: 100dvh;
  background:
    radial-gradient(900px 520px at 8% -6%, rgba(34, 197, 94, .28), transparent 58%),
    radial-gradient(820px 480px at 98% 4%, rgba(56, 189, 248, .22), transparent 56%),
    radial-gradient(760px 600px at 60% 108%, rgba(124, 58, 237, .18), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  color: var(--fg);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
[data-theme="light"] body {
  background:
    radial-gradient(900px 520px at 8% -6%, rgba(34, 197, 94, .20), transparent 58%),
    radial-gradient(820px 480px at 98% 4%, rgba(56, 189, 248, .18), transparent 56%),
    radial-gradient(760px 600px at 60% 108%, rgba(124, 58, 237, .12), transparent 60%),
    var(--bg);
  background-attachment: fixed;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; }

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

.skip-link {
  position: absolute; left: -999px; top: 8px; z-index: 200;
  background: var(--accent); color: #05210f; padding: 10px 16px; border-radius: 8px;
  font-family: var(--mono); font-weight: 600;
}
.skip-link:focus { left: 12px; }

/* ── Top bar ────────────────────────────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 100; height: var(--topbar-h);
  display: flex; align-items: center; gap: 16px;
  padding: 0 20px;
  background: var(--glass-soft);
  backdrop-filter: blur(var(--blur)) saturate(140%);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(140%);
  border-bottom: 1px solid var(--glass-border);
}
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--mono); font-weight: 700; color: var(--fg); }
.brand:hover { text-decoration: none; }
.brand svg { width: 28px; height: 28px; filter: drop-shadow(0 0 8px rgba(34, 197, 94, .45)); }
.brand .v { font-size: 11px; color: var(--fg-faint); font-weight: 500; }

.topnav { display: flex; gap: 4px; margin-left: 10px; }
.topnav a {
  font-family: var(--mono); font-size: 13px; font-weight: 500; color: var(--fg-dim);
  padding: 8px 12px; border-radius: 9px; transition: all .18s var(--ease);
}
.topnav a:hover { color: var(--fg); background: var(--surface-2); text-decoration: none; }
.topnav a[aria-current="page"] { color: var(--accent); }

.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px;
  border: 1px solid var(--glass-border); border-radius: 10px; background: var(--glass);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  color: var(--fg-dim); cursor: pointer; transition: all .18s var(--ease);
}
.icon-btn:hover { color: var(--fg); border-color: var(--border-2); transform: translateY(-1px); }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn .moon { display: none; }
[data-theme="light"] .icon-btn .moon { display: block; }
[data-theme="light"] .icon-btn .sun { display: none; }
#menu-btn { display: none; }

/* ── Layout shell ───────────────────────────────────────────────────── */
.shell { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr) var(--toc); gap: 0; max-width: var(--maxw); margin: 0 auto; }
.shell.no-toc { grid-template-columns: var(--sidebar) minmax(0, 1fr); }
.shell.landing-shell { display: block; }

/* ── Sidebar ────────────────────────────────────────────────────────── */
.sidebar {
  position: sticky; top: var(--topbar-h); align-self: start;
  height: calc(100dvh - var(--topbar-h));
  overflow-y: auto; padding: 24px 16px 48px;
  background: var(--glass-soft);
  backdrop-filter: blur(var(--blur)); -webkit-backdrop-filter: blur(var(--blur));
  border-right: 1px solid var(--glass-border);
}
.sidebar h4 {
  font-family: var(--mono); font-size: 11px; letter-spacing: 1.4px; text-transform: uppercase;
  color: var(--fg-faint); margin: 18px 10px 8px; font-weight: 600;
}
.sidebar nav a {
  display: block; font-size: 14px; color: var(--fg-dim);
  padding: 7px 12px; border-radius: 9px; transition: all .15s var(--ease);
  border-left: 2px solid transparent;
}
.sidebar nav a:hover { color: var(--fg); background: var(--surface-2); text-decoration: none; }
.sidebar nav a.active { color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); border-left-color: var(--accent); font-weight: 500; }
.sidebar nav a.sub { font-size: 13px; padding-left: 26px; color: var(--fg-faint); }
.sidebar nav a.sub:hover { color: var(--fg-dim); }

/* Collapsible "Documentation → on-this-page" group */
.nav-group .group-toggle { display: flex; align-items: center; justify-content: space-between; }
.nav-group .group-toggle .chev { width: 15px; height: 15px; flex: none; transition: transform .25s var(--ease); opacity: .7; }
.nav-group.open .group-toggle .chev { transform: rotate(90deg); }
.nav-group .group-items {
  display: grid; grid-template-rows: 0fr;
  transition: grid-template-rows .28s var(--ease);
}
.nav-group .group-items > div { overflow: hidden; }
.nav-group.open .group-items { grid-template-rows: 1fr; }
.nav-group .group-items a { opacity: 0; transition: opacity .2s var(--ease) .05s; }
.nav-group.open .group-items a { opacity: 1; }

.sidebar-scrim { display: none; }

/* ── Main content ───────────────────────────────────────────────────── */
.content { padding: 40px 48px 96px; min-width: 0; }
.doc { max-width: 800px; }
.doc.animate > * { opacity: 0; animation: rise .5s var(--ease) forwards; }
@keyframes rise { to { opacity: 1; transform: none; } }
.doc.animate > *:nth-child(1) { animation-delay: .02s; }
.doc.animate > *:nth-child(2) { animation-delay: .06s; }
.doc.animate > *:nth-child(3) { animation-delay: .10s; }
.doc.animate > *:nth-child(n+4) { animation-delay: .14s; }
.doc.animate > * { transform: translateY(10px); }

/* Markdown typography */
.doc h1 { font-family: var(--mono); font-size: 2.1rem; line-height: 1.15; letter-spacing: -.5px; margin: .2em 0 .5em; font-weight: 700; }
.doc h2 { font-family: var(--mono); font-size: 1.5rem; margin: 2.2em 0 .7em; padding-top: .4em; border-top: 1px solid var(--border); font-weight: 600; letter-spacing: -.3px; }
.doc h3 { font-family: var(--mono); font-size: 1.18rem; margin: 1.8em 0 .5em; font-weight: 600; }
.doc h4 { font-size: 1.02rem; margin: 1.5em 0 .4em; font-weight: 600; color: var(--fg); }
.doc h1:first-child, .doc h2:first-child { margin-top: 0; border-top: none; padding-top: 0; }
.doc p, .doc li { color: var(--fg); }
.doc p { margin: 0 0 1.1em; max-width: 72ch; }
.doc ul, .doc ol { padding-left: 1.4em; margin: 0 0 1.2em; }
.doc li { margin: .35em 0; }
.doc li::marker { color: var(--accent); }
.doc strong { color: var(--fg); font-weight: 600; }
.doc blockquote {
  margin: 1.2em 0; padding: 2px 18px; border-left: 3px solid var(--accent);
  background: color-mix(in srgb, var(--accent) 7%, transparent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0; color: var(--fg-dim);
}
.doc blockquote p { margin: .6em 0; }
.doc hr { border: none; border-top: 1px solid var(--border); margin: 2.4em 0; }

/* centered hero block from source README (<div align="center">) */
.doc .md-center { text-align: center; margin: 0 0 1.5em; }
.doc .md-center h1, .doc .md-center h2, .doc .md-center h3 { border: none; padding: 0; }
.doc .md-center h1 { font-size: 2.4rem; }
.doc .md-center h3 { color: var(--fg-dim); font-weight: 500; }
.doc .md-center p { margin: .6em auto; max-width: none; }
.doc .md-center img { display: inline-block; margin: 3px; vertical-align: middle; }
.doc .md-center a { text-decoration: none; }

/* heading anchor link */
.doc .headerlink { opacity: 0; margin-left: .35em; color: var(--fg-faint); font-weight: 400; transition: opacity .15s; }
.doc h2:hover .headerlink, .doc h3:hover .headerlink { opacity: 1; }

/* inline code */
.doc :not(pre) > code {
  font-family: var(--mono); font-size: .86em; padding: .14em .42em;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 6px; color: var(--accent);
}
[data-theme="light"] .doc :not(pre) > code { color: var(--accent-2); }

/* code blocks */
.doc pre, .doc .codehilite, .doc .highlight {
  position: relative; margin: 0 0 1.3em;
  background: var(--glass-strong); border: 1px solid var(--glass-border);
  backdrop-filter: blur(var(--blur)); -webkit-backdrop-filter: blur(var(--blur));
  border-radius: var(--radius); overflow: hidden;
}
[data-theme="light"] .doc pre, [data-theme="light"] .doc .codehilite { background: rgba(13, 20, 36, .92); }
[data-theme="light"] .doc pre code, [data-theme="light"] .doc .codehilite pre { color: #e2e8f0; }
.doc pre code, .doc .codehilite pre {
  display: block; margin: 0; padding: 16px 18px; overflow-x: auto;
  font-family: var(--mono); font-size: 13.5px; line-height: 1.6; color: #e2e8f0;
}
.doc .codehilite pre { background: transparent; border: none; }
.copy-btn {
  position: absolute; top: 8px; right: 8px; z-index: 2;
  display: inline-grid; place-items: center; width: 32px; height: 32px;
  border: 1px solid var(--border-2); border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 70%, transparent); color: var(--fg-dim);
  cursor: pointer; opacity: 0; transition: all .15s var(--ease);
}
.doc pre:hover .copy-btn, .doc .codehilite:hover .copy-btn { opacity: 1; }
.copy-btn:hover { color: var(--fg); border-color: var(--accent); }
.copy-btn svg { width: 15px; height: 15px; }
.copy-btn.copied { color: var(--accent); border-color: var(--accent); }

/* tables */
.doc table { width: 100%; border-collapse: collapse; margin: 0 0 1.4em; font-size: 14px; display: block; overflow-x: auto; }
.doc th, .doc td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--border); }
.doc th { font-family: var(--mono); font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: var(--fg-dim); background: var(--surface-2); }
.doc tr:hover td { background: color-mix(in srgb, var(--surface-2) 50%, transparent); }
.doc td code { white-space: nowrap; }

/* ── TOC rail ───────────────────────────────────────────────────────── */
.toc { position: sticky; top: var(--topbar-h); align-self: start; height: calc(100dvh - var(--topbar-h)); overflow-y: auto; padding: 40px 20px; }
.toc h4 { font-family: var(--mono); font-size: 11px; letter-spacing: 1.4px; text-transform: uppercase; color: var(--fg-faint); margin: 0 0 12px; }
.toc a { display: block; font-size: 13px; color: var(--fg-faint); padding: 4px 10px; border-left: 2px solid var(--border); transition: all .15s var(--ease); }
.toc a:hover { color: var(--fg-dim); text-decoration: none; }
.toc a.h3 { padding-left: 22px; }
.toc a.active { color: var(--accent); border-left-color: var(--accent); }

/* ── Footer ─────────────────────────────────────────────────────────── */
.footer { border-top: 1px solid var(--border); margin-top: 40px; padding: 28px 0; color: var(--fg-faint); font-size: 13px; }
.footer .inner { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: center; justify-content: space-between; }
.footer a { color: var(--fg-dim); }
.footer .built { font-family: var(--mono); font-size: 12px; }
.footer .built b { color: var(--accent); font-weight: 600; }

/* ── Landing / hero ─────────────────────────────────────────────────── */
.landing { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.hero { padding: 80px 0 48px; text-align: center; }
.hero .eyebrow {
  display: inline-flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 12px;
  color: var(--fg-dim); background: var(--glass); border: 1px solid var(--glass-border);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  padding: 6px 14px; border-radius: 999px; margin-bottom: 22px;
}
.hero .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 8px var(--accent); animation: pulse 1.8s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: .5; } 50% { opacity: 1; } }
.hero h1 {
  font-family: var(--mono); font-size: clamp(2.2rem, 6vw, 3.6rem); line-height: 1.05;
  letter-spacing: -1.5px; margin: 0 0 18px; font-weight: 700;
  background: linear-gradient(100deg, var(--fg), var(--accent) 140%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.hero p.lead { font-size: clamp(1.05rem, 2.4vw, 1.3rem); color: var(--fg-dim); max-width: 640px; margin: 0 auto 32px; }
.hero .cta { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; font-family: var(--mono); font-weight: 600;
  font-size: 14px; padding: 13px 22px; border-radius: 11px; cursor: pointer;
  border: 1px solid var(--glass-border); color: var(--fg); background: var(--glass);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  transition: all .18s var(--ease);
}
.btn:hover { text-decoration: none; transform: translateY(-2px); border-color: var(--accent); box-shadow: var(--shadow); }
.btn svg { width: 17px; height: 17px; }
.btn.primary { background: linear-gradient(90deg, var(--accent), var(--accent-2)); color: #05210f; border: none; }
.btn.primary:hover { box-shadow: var(--glow), var(--shadow); }

.hero-code {
  max-width: 720px; margin: 48px auto 0; text-align: left;
  background: var(--glass-strong); border: 1px solid var(--glass-border); border-radius: var(--radius);
  backdrop-filter: blur(var(--blur)); -webkit-backdrop-filter: blur(var(--blur));
  overflow: hidden; box-shadow: inset 0 1px 0 var(--glass-hi), var(--shadow);
}
.hero-code .bar { display: flex; align-items: center; gap: 7px; padding: 11px 14px; border-bottom: 1px solid var(--border); }
.hero-code .bar i { width: 11px; height: 11px; border-radius: 50%; background: var(--muted); display: inline-block; }
.hero-code .bar i:nth-child(1) { background: #ff5f57; } .hero-code .bar i:nth-child(2) { background: #febc2e; } .hero-code .bar i:nth-child(3) { background: #28c840; }
.hero-code .bar span { margin-left: 8px; font-family: var(--mono); font-size: 12px; color: var(--fg-faint); }
.hero-code pre { margin: 0; padding: 18px 20px; overflow-x: auto; font-family: var(--mono); font-size: 13.5px; line-height: 1.7; }
.hero-code .c-com { color: var(--fg-faint); }
.hero-code .c-acc { color: var(--accent); }
.hero-code .c-str { color: var(--info); }

.section { padding: 56px 0; }
.section-h { text-align: center; margin-bottom: 36px; }
.section-h h2 { font-family: var(--mono); font-size: clamp(1.5rem, 4vw, 2rem); letter-spacing: -.5px; margin: 0 0 8px; }
.section-h p { color: var(--fg-dim); margin: 0; }

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; }
.card {
  background: var(--glass); border: 1px solid var(--glass-border); border-radius: var(--radius);
  backdrop-filter: blur(var(--blur)); -webkit-backdrop-filter: blur(var(--blur));
  box-shadow: inset 0 1px 0 var(--glass-hi); padding: 24px;
  transition: transform .2s var(--ease), border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.card:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--accent) 45%, var(--glass-border)); box-shadow: inset 0 1px 0 var(--glass-hi), var(--shadow); }
.card .ic { display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 11px; background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); margin-bottom: 14px; }
.card .ic svg { width: 22px; height: 22px; }
.card h3 { font-family: var(--mono); font-size: 1.05rem; margin: 0 0 8px; font-weight: 600; }
.card p { color: var(--fg-dim); margin: 0; font-size: 14.5px; }

.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; counter-reset: s; }
.step { background: var(--glass); border: 1px solid var(--glass-border); border-radius: var(--radius); backdrop-filter: blur(var(--blur)); -webkit-backdrop-filter: blur(var(--blur)); box-shadow: inset 0 1px 0 var(--glass-hi); padding: 20px; position: relative; }
.step::before { counter-increment: s; content: counter(s); font-family: var(--mono); font-weight: 700; color: var(--accent); font-size: 13px; border: 1px solid var(--accent); width: 26px; height: 26px; display: grid; place-items: center; border-radius: 8px; margin-bottom: 12px; }
.step h4 { font-family: var(--mono); margin: 0 0 6px; font-size: .98rem; }
.step p { color: var(--fg-dim); margin: 0; font-size: 14px; }

.cta-band { text-align: center; background: var(--glass); border: 1px solid var(--glass-border); border-radius: var(--radius); backdrop-filter: blur(var(--blur)); -webkit-backdrop-filter: blur(var(--blur)); box-shadow: inset 0 1px 0 var(--glass-hi); padding: 48px 24px; margin: 24px 0 56px; }
.cta-band h2 { font-family: var(--mono); margin: 0 0 10px; }
.cta-band p { color: var(--fg-dim); margin: 0 0 24px; }

.aiready { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 24px; }
.pill { font-family: var(--mono); font-size: 12px; color: var(--fg-dim); border: 1px solid var(--glass-border); background: var(--glass); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-radius: 999px; padding: 7px 14px; }
.pill b { color: var(--accent); }

/* ── Responsive ─────────────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .shell, .shell.no-toc { grid-template-columns: var(--sidebar) minmax(0, 1fr); }
  .toc { display: none; }
}
@media (max-width: 820px) {
  #menu-btn { display: inline-grid; }
  .topnav { display: none; }
  .shell, .shell.no-toc { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: fixed; top: var(--topbar-h); left: 0; bottom: 0; width: 280px; z-index: 90;
    background: var(--bg-2); transform: translateX(-100%); transition: transform .25s var(--ease);
  }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .sidebar-scrim { display: block; position: fixed; inset: var(--topbar-h) 0 0; background: rgba(0,0,0,.5); z-index: 80; }
  .content { padding: 28px 20px 72px; }
}
@media (max-width: 420px) {
  .content { padding: 22px 16px 64px; }
  .hero { padding: 52px 0 36px; }
}
