/* ───────────────────────────────────────────────────────────────────────────
   Gasless.cash docs — design system
   Brand: #6bbd51
   ─────────────────────────────────────────────────────────────────────────── */

:root {
  --brand: #6bbd51;
  --brand-600: #57a83f;
  --brand-700: #418030;
  --brand-050: #f3f9ef;
  --brand-100: #e4f2db;
  --brand-200: #c9e6b8;

  --ink: #0d1710;
  --body: #3a4742;
  --muted: #6f7d75;
  --bg: #ffffff;
  --bg-soft: #f7faf5;
  --bg-softer: #fbfdfa;
  --border: #e7ede6;
  --border-strong: #d6e0d4;

  --code-bg: #0e1712;
  --code-fg: #e6efe6;

  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 22px;
  --maxw: 1200px;
  --sidebar-w: 264px;
  --header-h: 64px;

  --shadow-sm: 0 1px 2px rgba(13, 23, 16, 0.05), 0 1px 3px rgba(13, 23, 16, 0.06);
  --shadow-md: 0 8px 24px rgba(13, 23, 16, 0.08);
  --shadow-lg: 0 24px 60px rgba(13, 23, 16, 0.14);
  --shadow-brand: 0 12px 30px rgba(107, 189, 81, 0.35);

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

/* Auto dark mode lives at the END of this file — see the note there.
   It must come after the base component rules so its surface patches
   (.card, .step, .pill, .btn--ghost, callouts, header) win on equal
   specificity, which is decided by source order. */

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 20px); }

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

h1, h2, h3, h4 { color: var(--ink); line-height: 1.2; letter-spacing: -0.02em; font-weight: 700; }
a { color: var(--brand-600); text-decoration: none; }
a:hover { color: var(--brand-700); }
p { margin: 0 0 1rem; }
img { max-width: 100%; }
hr { border: none; border-top: 1px solid var(--border); margin: 2.5rem 0; }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.muted { color: var(--muted); }
.center { text-align: center; }

/* ── Header ───────────────────────────────────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 50;
  height: var(--header-h);
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.site-header .inner {
  max-width: var(--maxw); margin: 0 auto; height: 100%;
  display: flex; align-items: center; gap: 28px; padding: 0 24px;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 700; color: var(--ink); font-size: 17px; letter-spacing: -0.02em;
}
.brand .logo { width: 30px; height: 30px; display: block; }
.brand b { color: var(--brand-600); }
.nav { display: flex; gap: 22px; margin-left: 8px; }
.nav a { color: var(--body); font-weight: 500; font-size: 15px; }
.nav a:hover { color: var(--ink); }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.header-actions .ghost { color: var(--body); font-weight: 500; font-size: 15px; }

/* ── Buttons ──────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 20px; border-radius: 999px; font-weight: 600; font-size: 15px;
  border: 1px solid transparent; cursor: pointer; transition: all .18s ease;
  white-space: nowrap;
}
.btn--primary { background: var(--brand); color: #06210b; box-shadow: var(--shadow-brand); }
.btn--primary:hover { background: var(--brand-600); color: #06210b; transform: translateY(-1px); }
.btn--ghost { background: #fff; color: var(--ink); border-color: var(--border-strong); }
.btn--ghost:hover { border-color: var(--brand); color: var(--brand-700); }
.btn--lg { padding: 14px 26px; font-size: 16px; }

/* ── Hero ─────────────────────────────────────────────────────────────────── */
.hero {
  position: relative; overflow: hidden;
  padding: 92px 0 80px;
  background:
    radial-gradient(900px 420px at 78% -8%, rgba(107, 189, 81, 0.18), transparent 60%),
    radial-gradient(700px 380px at 8% 8%, rgba(107, 189, 81, 0.10), transparent 55%),
    var(--bg-softer);
  border-bottom: 1px solid var(--border);
}
.hero .grid { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 56px; align-items: center; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--brand-100); color: var(--brand-700);
  font-weight: 600; font-size: 13px; padding: 6px 14px; border-radius: 999px;
  border: 1px solid var(--brand-200);
}
.hero h1 { font-size: 54px; margin: 22px 0 18px; }
.hero h1 .grad {
  background: linear-gradient(100deg, var(--brand-700), var(--brand) 60%, #8fd06f);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero p.lede { font-size: 19px; color: var(--body); max-width: 560px; margin-bottom: 30px; }
.hero .cta-row { display: flex; gap: 14px; flex-wrap: wrap; }
.hero .trust { margin-top: 26px; display: flex; gap: 22px; flex-wrap: wrap; color: var(--muted); font-size: 14px; }
.hero .trust span { display: inline-flex; align-items: center; gap: 7px; }

/* ── Code window ──────────────────────────────────────────────────────────── */
.window {
  background: var(--code-bg); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); overflow: hidden; border: 1px solid #1c2a20;
}
.window .bar {
  display: flex; align-items: center; gap: 7px; padding: 12px 16px;
  background: #0a120d; border-bottom: 1px solid #1c2a20;
}
.window .bar .dot { width: 11px; height: 11px; border-radius: 50%; background: #2a3a2e; }
.window .bar .dot:nth-child(1) { background: #ef6f5e; }
.window .bar .dot:nth-child(2) { background: #f2c04b; }
.window .bar .dot:nth-child(3) { background: var(--brand); }
.window .bar .file { margin-left: 10px; color: #7f927f; font-size: 13px; font-family: var(--mono); }
.window pre { margin: 0; border-radius: 0; box-shadow: none; }

/* ── Code blocks ──────────────────────────────────────────────────────────── */
pre {
  background: var(--code-bg); color: var(--code-fg);
  border-radius: var(--radius-sm); padding: 18px 20px; overflow: auto;
  font-family: var(--mono); font-size: 13.5px; line-height: 1.7;
  margin: 0 0 1.25rem; position: relative;
}
pre code { font-family: var(--mono); background: none; padding: 0; color: inherit; }
:not(pre) > code {
  font-family: var(--mono); font-size: 0.86em;
  background: var(--brand-050); color: var(--brand-700);
  padding: 2px 6px; border-radius: 6px; border: 1px solid var(--brand-100);
}
.copy-btn {
  position: absolute; top: 10px; right: 10px;
  background: rgba(255,255,255,0.07); color: #cfe0cf; border: 1px solid rgba(255,255,255,0.12);
  border-radius: 7px; padding: 5px 10px; font-size: 12px; font-family: var(--font);
  cursor: pointer; opacity: 0; transition: opacity .15s ease;
}
pre:hover .copy-btn { opacity: 1; }
.copy-btn:hover { background: rgba(107,189,81,0.25); color: #fff; }
.copy-btn.copied { background: var(--brand); color: #06210b; border-color: var(--brand); }

/* ── Sections / cards ─────────────────────────────────────────────────────── */
.section { padding: 84px 0; }
.section.alt { background: var(--bg-soft); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-head { max-width: 680px; margin: 0 auto 52px; text-align: center; }
.section-head h2 { font-size: 36px; margin: 0 0 14px; }
.section-head p { font-size: 18px; color: var(--muted); margin: 0; }

.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.card {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 26px; transition: all .2s ease;
}
.card:hover { border-color: var(--brand-200); box-shadow: var(--shadow-md); transform: translateY(-3px); }
.card .ic {
  width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center;
  background: var(--brand-100); color: var(--brand-700); margin-bottom: 18px;
}
.card h3 { font-size: 19px; margin: 0 0 8px; }
.card p { margin: 0; color: var(--muted); font-size: 15px; }

/* ── Steps ────────────────────────────────────────────────────────────────── */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; counter-reset: step; }
.step { position: relative; padding: 24px; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); }
.step::before {
  counter-increment: step; content: counter(step);
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px;
  background: var(--brand); color: #06210b; font-weight: 700; margin-bottom: 14px;
}
.step h4 { margin: 0 0 6px; font-size: 16px; }
.step p { margin: 0; font-size: 14px; color: var(--muted); }

/* ── Token / chain strip ──────────────────────────────────────────────────── */
.pill-row { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.pill {
  display: inline-flex; align-items: center; gap: 9px;
  background: #fff; border: 1px solid var(--border); border-radius: 999px;
  padding: 10px 18px; font-weight: 600; color: var(--ink); font-size: 15px;
}
.pill .blob { width: 12px; height: 12px; border-radius: 50%; }

/* ── CTA band ─────────────────────────────────────────────────────────────── */
.cta-band {
  margin: 0 auto; max-width: 980px; border-radius: var(--radius-lg);
  background: linear-gradient(120deg, var(--brand-700), var(--brand-600) 55%, var(--brand));
  color: #f3fff0; padding: 54px; text-align: center; box-shadow: var(--shadow-brand);
}
.cta-band h2 { color: #fff; font-size: 34px; margin: 0 0 12px; }
.cta-band p { color: #eafbe3; font-size: 18px; margin: 0 0 28px; }
.cta-band .btn--primary { background: #fff; color: var(--brand-700); box-shadow: none; }
.cta-band .btn--primary:hover { background: #f0fdec; color: var(--brand-700); }
.cta-band .btn--ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,0.5); }
.cta-band .btn--ghost:hover { border-color: #fff; color: #fff; }

/* ── Footer ───────────────────────────────────────────────────────────────── */
.site-footer { background: var(--ink); color: #b9c7bc; padding: 56px 0 40px; }
.site-footer .cols { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 32px; }
.site-footer h5 { color: #fff; font-size: 14px; margin: 0 0 14px; text-transform: uppercase; letter-spacing: .06em; }
.site-footer a { color: #b9c7bc; display: block; margin-bottom: 9px; font-size: 15px; }
.site-footer a:hover { color: var(--brand); }
.site-footer .brand { color: #fff; margin-bottom: 14px; }
.site-footer .legal { margin-top: 40px; padding-top: 24px; border-top: 1px solid #1e2c22; font-size: 14px; color: #7f927f; }

/* ── Docs layout ──────────────────────────────────────────────────────────── */
.docs-shell { max-width: var(--maxw); margin: 0 auto; display: grid; grid-template-columns: var(--sidebar-w) 1fr; gap: 48px; padding: 0 24px; }
.sidebar {
  position: sticky; top: var(--header-h); align-self: start;
  height: calc(100vh - var(--header-h)); overflow-y: auto;
  padding: 32px 0 60px; padding-right: 8px;
}
.sidebar .group { margin-bottom: 26px; }
.sidebar .group-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin: 0 0 10px; padding-left: 12px; }
.sidebar a {
  display: block; padding: 7px 12px; border-radius: 8px; font-size: 14.5px;
  color: var(--body); font-weight: 500; border-left: 2px solid transparent;
}
.sidebar a:hover { background: var(--brand-050); color: var(--brand-700); }
.sidebar a.active { background: var(--brand-050); color: var(--brand-700); border-left-color: var(--brand); font-weight: 600; }

.doc-content { min-width: 0; padding: 40px 0 100px; max-width: 820px; }
.doc-content h1 { font-size: 40px; margin: 0 0 10px; }
.doc-content .subtitle { font-size: 19px; color: var(--muted); margin: 0 0 36px; }
.doc-content h2 { font-size: 28px; margin: 56px 0 16px; padding-top: 8px; }
.doc-content h3 { font-size: 20px; margin: 36px 0 12px; }
.doc-content section { scroll-margin-top: calc(var(--header-h) + 16px); }
.doc-content ul, .doc-content ol { padding-left: 22px; margin: 0 0 1.25rem; }
.doc-content li { margin-bottom: 8px; }

/* ── Callouts ─────────────────────────────────────────────────────────────── */
.callout {
  border: 1px solid var(--border); border-left-width: 4px; border-radius: var(--radius-sm);
  padding: 16px 18px; margin: 0 0 1.4rem; background: var(--bg-soft); font-size: 15px;
}
.callout p:last-child { margin: 0; }
.callout .label { font-weight: 700; display: block; margin-bottom: 4px; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; }
.callout--tip { border-left-color: var(--brand); background: var(--brand-050); }
.callout--tip .label { color: var(--brand-700); }
.callout--warn { border-left-color: #e8a23a; background: #fdf6ea; }
.callout--warn .label { color: #b9791a; }
.callout--note { border-left-color: #5b8def; background: #f0f5ff; }
.callout--note .label { color: #3a6ad0; }

/* ── Tables ───────────────────────────────────────────────────────────────── */
.doc-content table { width: 100%; border-collapse: collapse; margin: 0 0 1.5rem; font-size: 14.5px; }
.doc-content th, .doc-content td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
.doc-content th { background: var(--bg-soft); font-weight: 600; color: var(--ink); }
.doc-content td code { white-space: nowrap; }

/* ── Badges ───────────────────────────────────────────────────────────────── */
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.badge--method { background: var(--brand-100); color: var(--brand-700); font-family: var(--mono); }

/* ── Pager ────────────────────────────────────────────────────────────────── */
.pager { display: flex; justify-content: space-between; gap: 16px; margin-top: 56px; }
.pager a { flex: 1; border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 20px; }
.pager a:hover { border-color: var(--brand); }
.pager .dir { font-size: 13px; color: var(--muted); }
.pager .ttl { font-weight: 600; color: var(--ink); }
.pager .next { text-align: right; }

/* ── Mobile menu button ───────────────────────────────────────────────────── */
.menu-btn { display: none; background: none; border: 1px solid var(--border-strong); border-radius: 8px; padding: 7px 10px; cursor: pointer; }

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 980px) {
  .hero .grid { grid-template-columns: 1fr; gap: 40px; }
  .hero h1 { font-size: 40px; }
  .cards, .steps, .site-footer .cols { grid-template-columns: 1fr 1fr; }
  .nav { display: none; }
  .docs-shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; left: 0; top: var(--header-h); bottom: 0; width: 280px;
    background: var(--bg); border-right: 1px solid var(--border); padding: 24px 16px;
    transform: translateX(-100%); transition: transform .25s ease; z-index: 40; height: auto;
  }
  .sidebar.open { transform: translateX(0); box-shadow: var(--shadow-lg); }
  .menu-btn { display: inline-flex; }
  .doc-content { padding: 28px 0 80px; }
}
@media (max-width: 600px) {
  .hero h1 { font-size: 33px; }
  .cards, .steps, .site-footer .cols { grid-template-columns: 1fr; }
  .section { padding: 56px 0; }
  .cta-band { padding: 36px 22px; }
  .header-actions .ghost { display: none; }
}

/* ── Auto dark mode (follows OS prefers-color-scheme) ─────────────────────────
   Re-maps the design tokens to a dark palette and patches the few surfaces
   that hardcode light colors (white cards, the blurred header, the footer
   which uses --ink as a *background*, and the light-tinted callouts).

   This block must stay at the END of the file: its surface patches (.card,
   .step, .pill, .btn--ghost, callouts) share specificity with the base rules
   they override, so the cascade resolves by source order — last one wins.
   When this lived at the top, the base `background: #fff` rules below it won
   and cards/buttons rendered white in dark mode. */
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;

    /* Brand tints become subtle dark-green surfaces; 600/700 lighten so they
       stay legible as link/chip text on dark backgrounds. */
    --brand-600: #82cf67;
    --brand-700: #a3dd8b;
    --brand-050: #16231a;
    --brand-100: #1d3122;
    --brand-200: #2c4a33;

    --ink: #e8efe9;
    --body: #b3c0b8;
    --muted: #8a9890;
    --bg: #0d1410;
    --bg-soft: #131a16;
    --bg-softer: #0f1612;
    --border: #232e27;
    --border-strong: #2f3c34;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4), 0 1px 3px rgba(0, 0, 0, 0.5);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.6);
  }

  .site-header { background: rgba(13, 20, 16, 0.82); }
  .btn--ghost { background: var(--bg-soft); }
  .card, .step, .pill { background: var(--bg-soft); }

  .callout--warn { border-left-color: #e8a23a; background: #2a2110; }
  .callout--warn .label { color: #e8b25e; }
  .callout--note { border-left-color: #5b8def; background: #141d2e; }
  .callout--note .label { color: #84a8f2; }

  /* Footer uses --ink as its background — keep it dark, independent of theme. */
  .site-footer { background: #0a100c; }

  /* cta-band is a green gradient in both themes; pin its button text dark
     so it stays readable against the white button. */
  .cta-band .btn--primary { color: #2f6b1f; }
  .cta-band .btn--primary:hover { color: #2f6b1f; }
}
