/* ==========================================================================
   ScrapeGuys — design system
   Plain CSS, no build step. Edit tokens in :root to re-theme the whole site.
   ========================================================================== */

:root {
  /* Brand + neutrals */
  --brand:        #4f46e5;
  --brand-600:    #4338ca;
  --brand-700:    #3730a3;
  --brand-soft:   #eef2ff;
  --ink:          #0f172a;
  --ink-2:        #1e293b;
  --muted:        #64748b;
  --muted-2:      #94a3b8;
  --line:         #e2e8f0;
  --line-2:       #cbd5e1;
  --bg:           #ffffff;
  --bg-soft:      #f8fafc;
  --bg-soft-2:    #f1f5f9;
  --code-bg:      #0f172a;
  --code-ink:     #e2e8f0;
  --ok:           #059669;
  --ok-soft:      #ecfdf5;
  --warn:         #b45309;
  --warn-soft:    #fffbeb;

  /* Type */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: "SFMono-Regular", "JetBrains Mono", Menlo, Consolas, "Liberation Mono", monospace;

  /* Layout */
  --maxw: 1120px;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(15,23,42,.06), 0 1px 3px rgba(15,23,42,.08);
  --shadow-md: 0 4px 6px rgba(15,23,42,.05), 0 10px 24px rgba(15,23,42,.08);
  --shadow-lg: 0 12px 40px rgba(15,23,42,.12);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 96px; }
body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { line-height: 1.2; color: var(--ink); letter-spacing: -0.02em; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
p { margin: 0 0 1rem; }
img { max-width: 100%; height: auto; }
hr { border: none; border-top: 1px solid var(--line); margin: 2.5rem 0; }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.section { padding: 72px 0; }
.section-sm { padding: 48px 0; }
.bg-soft { background: var(--bg-soft); }
.text-center { text-align: center; }
.muted { color: var(--muted); }
.eyebrow {
  display: inline-block; font-size: .8rem; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--brand); margin-bottom: .75rem;
}
.lead { font-size: 1.15rem; color: var(--muted); max-width: 46rem; }

/* ---------- Announcement bar ---------- */
.announce {
  background: linear-gradient(90deg, var(--brand-700), var(--brand));
  color: #fff; text-align: center; font-size: .9rem; padding: 9px 16px;
}
.announce a { color: #fff; text-decoration: underline; font-weight: 600; }

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.85);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { display: inline-flex; align-items: center; gap: .5rem; font-weight: 800; font-size: 1.15rem; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand-mark {
  display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 7px;
  background: var(--brand); color: #fff; font-size: .8rem; transform: rotate(0deg);
}
.site-nav { display: flex; align-items: center; gap: 4px; }
.site-nav > a, .dropdown-toggle {
  display: inline-block; padding: 8px 12px; border-radius: 8px; font-size: .93rem; font-weight: 500;
  color: var(--ink-2); background: none; border: none; cursor: pointer; font-family: inherit;
}
.site-nav > a:hover, .dropdown-toggle:hover { background: var(--bg-soft-2); text-decoration: none; color: var(--ink); }
.site-nav a.active { color: var(--brand); font-weight: 600; }

/* Dropdown */
.dropdown { position: relative; }
.dropdown-toggle::after { content: "▾"; margin-left: 5px; font-size: .7rem; color: var(--muted); }
.dropdown-menu {
  position: absolute; top: calc(100% + 8px); left: 0; min-width: 244px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-md); padding: 6px; opacity: 0; visibility: hidden;
  transform: translateY(-6px); transition: .16s ease;
}
.dropdown:hover .dropdown-menu,
.dropdown.open .dropdown-menu { opacity: 1; visibility: visible; transform: translateY(0); }
.dropdown-menu a {
  display: block; padding: 9px 12px; border-radius: 8px; font-size: .9rem; color: var(--ink-2);
}
.dropdown-menu a:hover { background: var(--brand-soft); color: var(--brand-700); text-decoration: none; }
.dropdown-menu .dm-label {
  display: block; padding: 8px 12px 4px; font-size: .72rem; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--muted-2);
}
.dropdown-menu .dm-sub { padding-left: 24px; }
.nav-toggle { display: none; background: none; border: 1px solid var(--line); border-radius: 8px; font-size: 1.2rem; padding: 4px 10px; cursor: pointer; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .5rem; justify-content: center;
  padding: 11px 20px; border-radius: 10px; font-weight: 600; font-size: .95rem;
  border: 1px solid transparent; cursor: pointer; transition: .15s ease; white-space: nowrap;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: var(--brand); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--brand-600); color: #fff; }
.btn-ghost { background: #fff; color: var(--ink); border-color: var(--line-2); }
.btn-ghost:hover { border-color: var(--brand); color: var(--brand); }
.btn-sm { padding: 7px 14px; font-size: .88rem; border-radius: 8px; }
.btn-lg { padding: 14px 26px; font-size: 1.02rem; }

/* ---------- Hero ---------- */
.hero { padding: 84px 0 64px; background:
  radial-gradient(1000px 400px at 50% -120px, var(--brand-soft), transparent 70%); }
.hero h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); margin: 0 0 1rem; }
.hero .lead { margin: 0 auto 1.75rem; font-size: 1.2rem; }
.hero-cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.gradient-text { background: linear-gradient(90deg, var(--brand), #7c3aed); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* Stat row */
.stat-row { display: flex; gap: 40px; justify-content: center; flex-wrap: wrap; margin-top: 44px; }
.stat { text-align: center; }
.stat .num { font-size: 2rem; font-weight: 800; color: var(--ink); letter-spacing: -.02em; }
.stat .lbl { font-size: .85rem; color: var(--muted); }

/* Logo strip */
.logos { display: flex; flex-wrap: wrap; gap: 12px 28px; justify-content: center; align-items: center; margin-top: 40px; }
.logos span { color: var(--muted); font-weight: 600; font-size: .95rem; opacity: .85; }

/* ---------- Cards / grids ---------- */
.grid { display: grid; gap: 22px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px; box-shadow: var(--shadow-sm); transition: .18s ease;
}
.card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); border-color: var(--line-2); }
.card .ico {
  display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 10px;
  background: var(--brand-soft); color: var(--brand); font-size: 1.25rem; margin-bottom: 14px;
}
.card h3 { margin: 0 0 .4rem; font-size: 1.08rem; }
.card p { margin: 0; color: var(--muted); font-size: .95rem; }

/* Steps */
.steps { counter-reset: step; }
.step .n {
  display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%;
  background: var(--brand); color: #fff; font-weight: 700; margin-bottom: 12px;
}

/* ---------- Code blocks ---------- */
.code {
  position: relative; background: var(--code-bg); color: var(--code-ink);
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-md); margin: 1.2rem 0;
}
.code-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 14px; background: rgba(255,255,255,.04); border-bottom: 1px solid rgba(255,255,255,.08);
  font-size: .78rem; color: var(--muted-2);
}
.code-head .dots { display: flex; gap: 6px; }
.code-head .dots i { width: 11px; height: 11px; border-radius: 50%; background: #475569; display: inline-block; }
.code pre { margin: 0; padding: 16px 18px; overflow-x: auto; font-family: var(--font-mono); font-size: .84rem; line-height: 1.65; }
.code code { font-family: var(--font-mono); white-space: pre; }
.copy-btn {
  background: rgba(255,255,255,.08); color: var(--code-ink); border: 1px solid rgba(255,255,255,.14);
  border-radius: 6px; padding: 3px 10px; font-size: .74rem; cursor: pointer; font-family: inherit;
}
.copy-btn:hover { background: rgba(255,255,255,.16); }
/* tiny inline syntax accents */
.tok-key { color: #93c5fd; } .tok-str { color: #86efac; } .tok-num { color: #fca5a5; }
.tok-com { color: #64748b; font-style: italic; } .tok-fn { color: #c4b5fd; }
code.inline { background: var(--bg-soft-2); color: var(--brand-700); padding: 2px 6px; border-radius: 6px; font-family: var(--font-mono); font-size: .85em; }

/* ---------- Pricing ---------- */
.price-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; align-items: stretch; }
.price-card { display: flex; flex-direction: column; }
.price-card.featured { border: 2px solid var(--brand); box-shadow: var(--shadow-lg); position: relative; }
.price-card.featured .tag {
  position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
  background: var(--brand); color: #fff; font-size: .72rem; font-weight: 700; letter-spacing: .05em;
  text-transform: uppercase; padding: 4px 12px; border-radius: 999px;
}
.price-card .plan { font-weight: 700; font-size: 1.1rem; }
.price-card .amt { font-size: 2.1rem; font-weight: 800; margin: 8px 0 2px; }
.price-card .amt small { font-size: .9rem; font-weight: 500; color: var(--muted); }
.price-card ul { list-style: none; padding: 0; margin: 18px 0 24px; flex: 1; }
.price-card li { padding: 7px 0 7px 26px; position: relative; color: var(--ink-2); font-size: .93rem; }
.price-card li::before { content: "✓"; position: absolute; left: 0; color: var(--ok); font-weight: 700; }

/* ---------- FAQ accordion ---------- */
.faq-item { border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 12px; background: #fff; overflow: hidden; }
.faq-q {
  width: 100%; text-align: left; background: none; border: none; cursor: pointer;
  padding: 18px 22px; font-size: 1.02rem; font-weight: 600; color: var(--ink); font-family: inherit;
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
}
.faq-q::after { content: "+"; font-size: 1.4rem; color: var(--brand); font-weight: 400; flex: none; }
.faq-item.open .faq-q::after { content: "–"; }
.faq-a { max-height: 0; overflow: hidden; transition: max-height .25s ease; }
.faq-a-inner { padding: 0 22px 20px; color: var(--muted); }
.faq-item.open .faq-a { max-height: 600px; }

/* ---------- Tables (API params) ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); margin: 1.2rem 0; }
table.api { width: 100%; border-collapse: collapse; font-size: .9rem; min-width: 520px; }
table.api th, table.api td { text-align: left; padding: 11px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.api thead th { background: var(--bg-soft); font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
table.api tr:last-child td { border-bottom: none; }
table.api code { font-family: var(--font-mono); color: var(--brand-700); font-size: .86em; }
.req { color: #dc2626; font-weight: 700; font-size: .72rem; text-transform: uppercase; }
.opt { color: var(--muted-2); font-size: .72rem; text-transform: uppercase; }

/* Badges / pills */
.badge { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: .74rem; font-weight: 700; letter-spacing: .02em; }
.badge-get { background: #ecfdf5; color: #047857; }
.badge-post { background: #eff6ff; color: #1d4ed8; }
.badge-soon { background: #fff7ed; color: #c2410c; }
.endpoint { display: flex; align-items: center; gap: 12px; background: var(--bg-soft); border: 1px solid var(--line);
  border-radius: 10px; padding: 12px 16px; font-family: var(--font-mono); font-size: .92rem; margin: 1rem 0; flex-wrap: wrap; }
.endpoint .path { color: var(--ink); }

.callout { border-left: 4px solid var(--brand); background: var(--brand-soft); padding: 14px 18px; border-radius: 0 10px 10px 0; margin: 1.2rem 0; font-size: .93rem; }
.callout.warn { border-color: var(--warn); background: var(--warn-soft); }
.callout.ok { border-color: var(--ok); background: var(--ok-soft); }
.callout strong { color: var(--ink); }

/* ---------- Docs layout ---------- */
.docs { display: grid; grid-template-columns: 250px 1fr; gap: 44px; align-items: start; }
.docs-side { position: sticky; top: 88px; align-self: start; }
.docs-side nav { border-left: 2px solid var(--line); }
.docs-side .grp { display: block; font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted-2); padding: 14px 0 6px 16px; }
.docs-side a { display: block; padding: 6px 16px; margin-left: -2px; border-left: 2px solid transparent; color: var(--muted); font-size: .9rem; }
.docs-side a:hover { color: var(--ink); text-decoration: none; }
.docs-side a.active { color: var(--brand); border-left-color: var(--brand); font-weight: 600; }
.docs-main { min-width: 0; }
.docs-main h2 { margin-top: 2.4rem; padding-top: .4rem; font-size: 1.5rem; }
.docs-main h3 { margin-top: 1.8rem; font-size: 1.15rem; }
.docs-main h2:first-child { margin-top: 0; }
.docs-main ul, .docs-main ol { padding-left: 1.3rem; }
.docs-main li { margin: .3rem 0; }
.anchor { scroll-margin-top: 90px; }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: #cbd5e1; padding: 56px 0 32px; margin-top: 0; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 32px; }
.site-footer h4 { color: #fff; font-size: .82rem; text-transform: uppercase; letter-spacing: .06em; margin: 0 0 14px; }
.site-footer a { display: block; color: #94a3b8; padding: 5px 0; font-size: .92rem; }
.site-footer a:hover { color: #fff; text-decoration: none; }
.site-footer .brand { color: #fff; }
.site-footer .brand-mark { background: var(--brand); }
.footer-bottom { border-top: 1px solid #1e293b; margin-top: 40px; padding-top: 22px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; color: #64748b; font-size: .86rem; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .grid-3, .price-grid { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .docs { grid-template-columns: 1fr; }
  .docs-side { position: static; display: none; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .nav-toggle { display: inline-block; }
  .site-nav {
    display: none; position: absolute; top: 64px; left: 0; right: 0; flex-direction: column;
    align-items: stretch; background: #fff; border-bottom: 1px solid var(--line); padding: 12px;
    gap: 2px; box-shadow: var(--shadow-md);
  }
  .site-nav.open { display: flex; }
  .site-nav > a, .dropdown-toggle { width: 100%; text-align: left; }
  .dropdown-menu { position: static; opacity: 1; visibility: visible; transform: none; box-shadow: none;
    border: none; border-left: 2px solid var(--line); border-radius: 0; margin: 2px 0 6px 12px;
    max-height: 0; overflow: hidden; padding: 0; transition: max-height .2s ease; }
  .dropdown.open .dropdown-menu { max-height: 500px; padding: 4px; }
  .stat-row { gap: 26px; }
}
@media (max-width: 560px) {
  .footer-grid { grid-template-columns: 1fr; }
  .section { padding: 52px 0; }
  .hero { padding: 56px 0 44px; }
}
